summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2011-05-17 16:27:50 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2011-05-17 16:27:50 -0400
commitb81536ad49001abf292bd31a0dcbf57e387387b1 (patch)
tree722cac2e9eab46a3b18d930dcd37703df48ebeba
parent5b8794f1f5e82c1a220f36a724e5c8ce3335c462 (diff)
Fiddle with emacs config (when to use -n, -c), get emacs using el-get.
-rw-r--r--.bash.d/emacs.sh19
-rw-r--r--.bash_aliases3
-rw-r--r--.emacs94
-rw-r--r--.emacs.d/.gitignore1
-rw-r--r--.emacs.d/color-theme-6.6.0.tar.gzbin124858 -> 0 bytes
-rw-r--r--.emacs.d/color-theme-6.6.0/AUTHORS31
-rw-r--r--.emacs.d/color-theme-6.6.0/BUGS71
-rw-r--r--.emacs.d/color-theme-6.6.0/COPYING342
-rw-r--r--.emacs.d/color-theme-6.6.0/ChangeLog121
-rw-r--r--.emacs.d/color-theme-6.6.0/HACKING26
-rw-r--r--.emacs.d/color-theme-6.6.0/Makefile141
-rw-r--r--.emacs.d/color-theme-6.6.0/Makefile.defs39
-rw-r--r--.emacs.d/color-theme-6.6.0/README86
-rw-r--r--.emacs.d/color-theme-6.6.0/build-stamp0
-rw-r--r--.emacs.d/color-theme-6.6.0/color-theme-autoloads.el159
-rw-r--r--.emacs.d/color-theme-6.6.0/color-theme-autoloads.elcbin5371 -> 0 bytes
-rw-r--r--.emacs.d/color-theme-6.6.0/color-theme-autoloads.in15
-rw-r--r--.emacs.d/color-theme-6.6.0/color-theme.el1668
-rw-r--r--.emacs.d/color-theme-6.6.0/color-theme.elcbin47673 -> 0 bytes
-rw-r--r--.emacs.d/color-theme-6.6.0/configure-stamp0
-rw-r--r--.emacs.d/color-theme-6.6.0/themes/color-theme-example.el22
-rw-r--r--.emacs.d/color-theme-6.6.0/themes/color-theme-library.el13539
-rw-r--r--.emacs.d/color-theme-solarized.el139
-rw-r--r--.emacs.d/conkeror.el5
-rw-r--r--.emacs.d/ezbl.el1246
-rw-r--r--.emacs.d/folding.el5396
-rw-r--r--.emacs.d/identica-mode-1.1.tar.gzbin33078 -> 0 bytes
-rw-r--r--.emacs.d/identica-mode-1.1/.gitignore1
-rwxr-xr-x.emacs.d/identica-mode-1.1/COPYING339
-rw-r--r--.emacs.d/identica-mode-1.1/doc/fdl.texi451
-rw-r--r--.emacs.d/identica-mode-1.1/doc/identica-mode.texi345
-rw-r--r--.emacs.d/identica-mode-1.1/identica-mode.el1853
l---------.emacs.d/identica-mode.el1
-rw-r--r--.emacs.d/org-7.4.tar.gzbin2981061 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/Changes.org2522
-rw-r--r--.emacs.d/org-7.4/Makefile511
-rw-r--r--.emacs.d/org-7.4/README39
-rw-r--r--.emacs.d/org-7.4/contrib/.DS_Storebin6148 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/contrib/README60
-rw-r--r--.emacs.d/org-7.4/contrib/babel/langs/ob-oz.el306
-rw-r--r--.emacs.d/org-7.4/contrib/babel/library-of-babel.org370
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/.DS_Storebin6148 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/htmlize.el1769
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-annotate-file.el130
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-bookmark.el88
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-checklist.el143
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-choose.el539
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-collector.el235
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-contribdir.el38
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-depend.el279
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-drill.el1144
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-elisp-symbol.el159
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-eval-light.el200
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-eval.el220
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-exp-bibtex.el155
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-expiry.el346
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-export-generic.el1385
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-git-link.el219
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-interactive-query.el310
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-invoice.el399
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-jira.el65
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-learn.el180
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-mac-iCal.el249
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-mac-link-grabber.el465
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-mairix.el332
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-man.el64
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-mime.el245
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-mtags.el257
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-panel.el642
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-registry.el271
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-screen.el108
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-secretary.el232
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-special-blocks.el94
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-static-mathjax.el171
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-toc.el488
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-track.el219
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-velocity.el527
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org-wikinodes.el339
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/org2rem.el653
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/orgtbl-sqlinsert.el115
-rw-r--r--.emacs.d/org-7.4/contrib/lisp/test-org-export-preproc.el39
-rw-r--r--.emacs.d/org-7.4/contrib/scripts/.DS_Storebin6148 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/contrib/scripts/.gitignore1
-rw-r--r--.emacs.d/org-7.4/contrib/scripts/StartOzServer.oz220
-rwxr-xr-x.emacs.d/org-7.4/contrib/scripts/dir2org.zsh56
-rw-r--r--.emacs.d/org-7.4/contrib/scripts/ditaa.jarbin210364 -> 0 bytes
-rwxr-xr-x.emacs.d/org-7.4/contrib/scripts/org2hpda106
-rw-r--r--.emacs.d/org-7.4/contrib/scripts/staticmathjax/.gitignore1
-rw-r--r--.emacs.d/org-7.4/contrib/scripts/staticmathjax/README.org79
-rw-r--r--.emacs.d/org-7.4/contrib/scripts/staticmathjax/README.txt91
-rw-r--r--.emacs.d/org-7.4/contrib/scripts/staticmathjax/application.ini11
-rw-r--r--.emacs.d/org-7.4/contrib/scripts/staticmathjax/chrome/chrome.manifest1
-rw-r--r--.emacs.d/org-7.4/contrib/scripts/staticmathjax/chrome/content/main.js198
-rw-r--r--.emacs.d/org-7.4/contrib/scripts/staticmathjax/chrome/content/main.xul11
-rw-r--r--.emacs.d/org-7.4/contrib/scripts/staticmathjax/defaults/preferences/prefs.js1
-rw-r--r--.emacs.d/org-7.4/doc/.nosearch1
-rw-r--r--.emacs.d/org-7.4/doc/dir18
-rw-r--r--.emacs.d/org-7.4/doc/org16592
-rw-r--r--.emacs.d/org-7.4/doc/org.pdfbin1482828 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/doc/org.texi14774
-rw-r--r--.emacs.d/org-7.4/doc/orgcard.pdfbin83342 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/doc/orgcard.tex686
-rw-r--r--.emacs.d/org-7.4/doc/orgcard_letter.pdfbin83320 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/doc/orgguide.pdfbin283532 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/doc/orgguide.texi2699
-rw-r--r--.emacs.d/org-7.4/doc/pdflayout.sty47
-rw-r--r--.emacs.d/org-7.4/lisp/ob-C.el194
-rw-r--r--.emacs.d/org-7.4/lisp/ob-C.elcbin6027 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-R.el303
-rw-r--r--.emacs.d/org-7.4/lisp/ob-R.elcbin11446 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-asymptote.el164
-rw-r--r--.emacs.d/org-7.4/lisp/ob-asymptote.elcbin4611 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-calc.el97
-rw-r--r--.emacs.d/org-7.4/lisp/ob-calc.elcbin2171 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-clojure.el88
-rw-r--r--.emacs.d/org-7.4/lisp/ob-clojure.elcbin2246 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-comint.el163
-rw-r--r--.emacs.d/org-7.4/lisp/ob-comint.elcbin5478 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-css.el49
-rw-r--r--.emacs.d/org-7.4/lisp/ob-css.elcbin1165 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-ditaa.el74
-rw-r--r--.emacs.d/org-7.4/lisp/ob-ditaa.elcbin1907 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-dot.el90
-rw-r--r--.emacs.d/org-7.4/lisp/ob-dot.elcbin2283 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-emacs-lisp.el71
-rw-r--r--.emacs.d/org-7.4/lisp/ob-emacs-lisp.elcbin1789 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-eval.el262
-rw-r--r--.emacs.d/org-7.4/lisp/ob-eval.elcbin6895 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-exp.el328
-rw-r--r--.emacs.d/org-7.4/lisp/ob-exp.elcbin11656 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-gnuplot.el235
-rw-r--r--.emacs.d/org-7.4/lisp/ob-gnuplot.elcbin7589 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-haskell.el217
-rw-r--r--.emacs.d/org-7.4/lisp/ob-haskell.elcbin8470 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-js.el165
-rw-r--r--.emacs.d/org-7.4/lisp/ob-js.elcbin6056 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-keys.el98
-rw-r--r--.emacs.d/org-7.4/lisp/ob-keys.elcbin2789 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-latex.el180
-rw-r--r--.emacs.d/org-7.4/lisp/ob-latex.elcbin5248 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-ledger.el72
-rw-r--r--.emacs.d/org-7.4/lisp/ob-ledger.elcbin2088 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-lob.el124
-rw-r--r--.emacs.d/org-7.4/lisp/ob-lob.elcbin4170 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-matlab.el48
-rw-r--r--.emacs.d/org-7.4/lisp/ob-matlab.elcbin684 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-mscgen.el86
-rw-r--r--.emacs.d/org-7.4/lisp/ob-mscgen.elcbin1610 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-ocaml.el157
-rw-r--r--.emacs.d/org-7.4/lisp/ob-ocaml.elcbin5629 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-octave.el264
-rw-r--r--.emacs.d/org-7.4/lisp/ob-octave.elcbin10445 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-org.el62
-rw-r--r--.emacs.d/org-7.4/lisp/ob-org.elcbin1554 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-perl.el117
-rw-r--r--.emacs.d/org-7.4/lisp/ob-perl.elcbin3775 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-plantuml.el83
-rw-r--r--.emacs.d/org-7.4/lisp/ob-plantuml.elcbin2389 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-python.el282
-rw-r--r--.emacs.d/org-7.4/lisp/ob-python.elcbin11282 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-ref.el229
-rw-r--r--.emacs.d/org-7.4/lisp/ob-ref.elcbin6342 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-ruby.el239
-rw-r--r--.emacs.d/org-7.4/lisp/ob-ruby.elcbin8737 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-sass.el69
-rw-r--r--.emacs.d/org-7.4/lisp/ob-sass.elcbin2013 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-scheme.el139
-rw-r--r--.emacs.d/org-7.4/lisp/ob-scheme.elcbin5136 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-screen.el147
-rw-r--r--.emacs.d/org-7.4/lisp/ob-screen.elcbin4542 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-sh.el171
-rw-r--r--.emacs.d/org-7.4/lisp/ob-sh.elcbin7082 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-sql.el126
-rw-r--r--.emacs.d/org-7.4/lisp/ob-sql.elcbin3485 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-sqlite.el149
-rw-r--r--.emacs.d/org-7.4/lisp/ob-sqlite.elcbin4649 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-table.el125
-rw-r--r--.emacs.d/org-7.4/lisp/ob-table.elcbin2551 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob-tangle.el454
-rw-r--r--.emacs.d/org-7.4/lisp/ob-tangle.elcbin14790 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/ob.el1968
-rw-r--r--.emacs.d/org-7.4/lisp/ob.elcbin64353 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-agenda.el8063
-rw-r--r--.emacs.d/org-7.4/lisp/org-agenda.elcbin301386 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-archive.el471
-rw-r--r--.emacs.d/org-7.4/lisp/org-archive.elcbin13563 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-ascii.el723
-rw-r--r--.emacs.d/org-7.4/lisp/org-ascii.elcbin20902 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-attach.el422
-rw-r--r--.emacs.d/org-7.4/lisp/org-attach.elcbin14876 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-bbdb.el386
-rw-r--r--.emacs.d/org-7.4/lisp/org-bbdb.elcbin8633 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-beamer.el636
-rw-r--r--.emacs.d/org-7.4/lisp/org-beamer.elcbin22195 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-bibtex.el205
-rw-r--r--.emacs.d/org-7.4/lisp/org-bibtex.elcbin4201 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-capture.el1391
-rw-r--r--.emacs.d/org-7.4/lisp/org-capture.elcbin41841 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-clock.el2499
-rw-r--r--.emacs.d/org-7.4/lisp/org-clock.elcbin75423 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-colview-xemacs.el1736
-rw-r--r--.emacs.d/org-7.4/lisp/org-colview-xemacs.elcbin47675 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-colview.el1542
-rw-r--r--.emacs.d/org-7.4/lisp/org-colview.elcbin48917 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-compat.el431
-rw-r--r--.emacs.d/org-7.4/lisp/org-compat.elcbin12570 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-complete.el279
-rw-r--r--.emacs.d/org-7.4/lisp/org-complete.elcbin7419 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-crypt.el187
-rw-r--r--.emacs.d/org-7.4/lisp/org-crypt.elcbin3593 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-ctags.el541
-rw-r--r--.emacs.d/org-7.4/lisp/org-ctags.elcbin12521 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-datetree.el200
-rw-r--r--.emacs.d/org-7.4/lisp/org-datetree.elcbin5293 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-docbook.el1444
-rw-r--r--.emacs.d/org-7.4/lisp/org-docbook.elcbin38411 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-docview.el93
-rw-r--r--.emacs.d/org-7.4/lisp/org-docview.elcbin1802 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-entities.el573
-rw-r--r--.emacs.d/org-7.4/lisp/org-entities.elcbin24484 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-exp-blocks.el356
-rw-r--r--.emacs.d/org-7.4/lisp/org-exp-blocks.elcbin10938 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-exp.el2968
-rw-r--r--.emacs.d/org-7.4/lisp/org-exp.elcbin94461 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-faces.el723
-rw-r--r--.emacs.d/org-7.4/lisp/org-faces.elcbin26857 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-feed.el678
-rw-r--r--.emacs.d/org-7.4/lisp/org-feed.elcbin19050 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-footnote.el590
-rw-r--r--.emacs.d/org-7.4/lisp/org-footnote.elcbin16759 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-freemind.el1243
-rw-r--r--.emacs.d/org-7.4/lisp/org-freemind.elcbin28559 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-gnus.el263
-rw-r--r--.emacs.d/org-7.4/lisp/org-gnus.elcbin7898 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-habit.el355
-rw-r--r--.emacs.d/org-7.4/lisp/org-habit.elcbin10932 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-html.el2419
-rw-r--r--.emacs.d/org-7.4/lisp/org-html.elcbin71594 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-icalendar.el655
-rw-r--r--.emacs.d/org-7.4/lisp/org-icalendar.elcbin22085 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-id.el647
-rw-r--r--.emacs.d/org-7.4/lisp/org-id.elcbin18451 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-indent.el326
-rw-r--r--.emacs.d/org-7.4/lisp/org-indent.elcbin10341 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-info.el83
-rw-r--r--.emacs.d/org-7.4/lisp/org-info.elcbin1703 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-inlinetask.el338
-rw-r--r--.emacs.d/org-7.4/lisp/org-inlinetask.elcbin8900 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-install.el1762
-rw-r--r--.emacs.d/org-7.4/lisp/org-install.elcbin60523 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-irc.el256
-rw-r--r--.emacs.d/org-7.4/lisp/org-irc.elcbin6009 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-jsinfo.el210
-rw-r--r--.emacs.d/org-7.4/lisp/org-jsinfo.elcbin5521 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-latex.el2578
-rw-r--r--.emacs.d/org-7.4/lisp/org-latex.elcbin76174 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-list.el2292
-rw-r--r--.emacs.d/org-7.4/lisp/org-list.elcbin65245 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-mac-message.el219
-rw-r--r--.emacs.d/org-7.4/lisp/org-mac-message.elcbin6527 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-macs.el349
-rw-r--r--.emacs.d/org-7.4/lisp/org-macs.elcbin12243 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-mew.el140
-rw-r--r--.emacs.d/org-7.4/lisp/org-mew.elcbin3259 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-mhe.el230
-rw-r--r--.emacs.d/org-7.4/lisp/org-mhe.elcbin5531 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-mks.el137
-rw-r--r--.emacs.d/org-7.4/lisp/org-mks.elcbin3611 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-mobile.el1089
-rw-r--r--.emacs.d/org-7.4/lisp/org-mobile.elcbin35845 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-mouse.el1148
-rw-r--r--.emacs.d/org-7.4/lisp/org-mouse.elcbin33681 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-plot.el354
-rw-r--r--.emacs.d/org-7.4/lisp/org-plot.elcbin10778 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-protocol.el708
-rw-r--r--.emacs.d/org-7.4/lisp/org-protocol.elcbin19853 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-publish.el1082
-rw-r--r--.emacs.d/org-7.4/lisp/org-publish.elcbin35918 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-remember.el1155
-rw-r--r--.emacs.d/org-7.4/lisp/org-remember.elcbin37257 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-rmail.el120
-rw-r--r--.emacs.d/org-7.4/lisp/org-rmail.elcbin2852 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-src.el811
-rw-r--r--.emacs.d/org-7.4/lisp/org-src.elcbin29956 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-table.el4398
-rw-r--r--.emacs.d/org-7.4/lisp/org-table.elcbin149646 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-taskjuggler.el648
-rw-r--r--.emacs.d/org-7.4/lisp/org-taskjuggler.elcbin17170 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-timer.el399
-rw-r--r--.emacs.d/org-7.4/lisp/org-timer.elcbin12169 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-vm.el143
-rw-r--r--.emacs.d/org-7.4/lisp/org-vm.elcbin3226 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-w3m.el173
-rw-r--r--.emacs.d/org-7.4/lisp/org-w3m.elcbin4050 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-wl.el315
-rw-r--r--.emacs.d/org-7.4/lisp/org-wl.elcbin7392 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org-xoxo.el128
-rw-r--r--.emacs.d/org-7.4/lisp/org-xoxo.elcbin2619 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/lisp/org.el19647
-rw-r--r--.emacs.d/org-7.4/lisp/org.elcbin668210 -> 0 bytes
-rw-r--r--.emacs.d/org-7.4/request-assign-future.txt44
-rw-r--r--.emacs.d/whitespace.el2732
-rw-r--r--.profile2
-rw-r--r--.selected_editor3
-rwxr-xr-xbin/v-editor2
305 files changed, 79 insertions, 163617 deletions
diff --git a/.bash.d/emacs.sh b/.bash.d/emacs.sh
index 66b5558..f484bbb 100644
--- a/.bash.d/emacs.sh
+++ b/.bash.d/emacs.sh
@@ -1,13 +1,8 @@
-case "$SELECTED_EDITOR" in
- emacsclient*)
- case "$TERM" in
- eterm*)
- SELECTED_EDITOR="$SELECTED_EDITOR -n"
- EDITOR=$SELECTED_EDITOR
- VISUAL=$SELECTED_EDITOR
- export SELECTED_EDITOR EDITOR VISUAL
- :;;
- esac
- :;;
+case "$TERM" in
+ eterm*)
+ SELECTED_EDITOR='emacsclient'
+ EDITOR=$SELECTED_EDITOR
+ VISUAL=$SELECTED_EDITOR
+ export SELECTED_EDITOR EDITOR VISUAL
+ :;;
esac
-
diff --git a/.bash_aliases b/.bash_aliases
index 269f36e..6597185 100644
--- a/.bash_aliases
+++ b/.bash_aliases
@@ -51,3 +51,6 @@ alias redshift="$redshift"
#alias serva='ssh luke@servb.ath.cx -p3440'
#alias phpdoctor='php /usr/gnu/www/0-other/phpdoctor-head/phpdoc.php'
alias lock="clear; away -C 'This terminal is locked'"
+case "$TERM" in
+ eterm*) alias editor='editor -n';;
+esac
diff --git a/.emacs b/.emacs
index 4e8f026..27d8dcc 100644
--- a/.emacs
+++ b/.emacs
@@ -1,26 +1,67 @@
-(add-to-list 'load-path "~/.emacs.d/")
+(set-face-attribute 'default nil :height 80)
+
+(defun load-identica-mode ()
+ (when (require 'netrc nil t)
+ (autoload 'identica-mode "identica-mode" nil t)
+ (let ((identica (netrc-machine (netrc-parse "~/.netrc") "identi.ca" t)))
+ (setq identica-password (netrc-get identica "password"))
+ (setq identica-username (netrc-get identica "login"))
+ )
+ )
+)
-(add-to-list 'load-path "~/.emacs.d/org-7.4/lisp")
-(add-to-list 'load-path "~/.emacs.d/org-7.4/contrib/lisp")
-(add-to-list 'load-path "~/.emacs.d/color-theme-6.6.0")
+(setq package-archives '(("ELPA" . "http://tromey.com/elpa/")
+ ("marmalade" . "http://marmalade-repo.org/packages/")
+ ("gnu" . "http://elpa.gnu.org/packages/")))
-(require 'org-install)
-(require 'org-checklist)
+(add-to-list 'load-path "~/.emacs.d/")
+(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
+(require 'el-get)
+(add-to-list 'el-get-recipe-path "~/.emacs.d/el-get-recipes")
+(setq el-get-sources
+ '(el-get
+ (:name color-theme
+ :after (lambda ()
+ (color-theme-tty-dark)))
+ package
+ (:name color-theme-solarized
+ :after (lambda ()
+ (add-hook 'after-make-frame-functions
+ (lambda (frame)
+ (set-variable 'color-theme-is-global nil)
+ (select-frame frame)
+ (if window-system
+ (color-theme-solarized-dark))))))
+ (:name org-mode
+ :url "git://orgmode.org/org-mode.git"
+ :features org-install
+ :after ((require 'org-checklist)))
+ (:name identica-mode
+ :after (lambda ()
+ (load-identica-mode)))
+ (:name rainbow-delimiters
+ :after (lambda ()
+ ))
+ (:name autopair
+ :after (lambda ()
+ (autopair-global-mode 1)
+ (setq autopair-autowrap t)))
+ ))
+(el-get)
(ido-mode t)
;(global-linum-mode)
-(require 'color-theme-solarized)
-(color-theme-solarized-dark)
+(defun toggle-fullscreen (&optional f)
+ (interactive)
+ (let ((current-value (frame-parameter nil 'fullscreen)))
+ (set-frame-parameter nil 'fullscreen
+ (if (equal 'fullboth current-value)
+ (if (boundp 'old-fullscreen) old-fullscreen nil)
+ (progn (setq old-fullscreen current-value)
+ 'fullboth)))))
-(when (require 'netrc nil t)
- (autoload 'identica-mode "identica-mode" nil t)
- (let
- ((identica (netrc-machine (netrc-parse "~/.netrc") "identi.ca" t)))
- (setq identica-password (netrc-get identica "password"))
- (setq identica-username (netrc-get identica "login"))
- )
-)
+(global-set-key [f11] 'toggle-fullscreen)
(load "whitespace")
(global-set-key "\C-cw" 'global-whitespace-mode)
@@ -45,21 +86,14 @@
;; (setq-defualt indent-tabs-mode nill);; no tabs
(setq-default indent-tabs-mode t);; use tabs
-(load "folding" 'nomessage 'noerror)
-(folding-mode-add-find-file-hook)
+(setq column-number-mode t
+ inhibit-startup-screen t
+ line-number-mode t
+ server-mode t
+ show-paren-mode t)
(setq browse-url-generic-program (executable-find "v-www-browser")
browse-url-browser-function 'browse-url-generic)
-(custom-set-variables
- ;; custom-set-variables was added by Custom.
- ;; If you edit it by hand, you could mess it up, so be careful.
- ;; Your init file should contain only one such instance.
- ;; If there is more than one, they won't work right.
- '(column-number-mode t)
- '(inhibit-startup-screen t)
- '(line-number-mode t)
- '(server-mode t)
- '(show-paren-mode t))
-
-(set-face-attribute 'default nil :height 80)
+(setq custom-file "~/.emacs.d/custom.el")
+(load custom-file 'noerror)
diff --git a/.emacs.d/.gitignore b/.emacs.d/.gitignore
index f1f7d02..3fa6e57 100644
--- a/.emacs.d/.gitignore
+++ b/.emacs.d/.gitignore
@@ -1,2 +1,3 @@
auto-save-list/*
session.*
+el-get/*
diff --git a/.emacs.d/color-theme-6.6.0.tar.gz b/.emacs.d/color-theme-6.6.0.tar.gz
deleted file mode 100644
index 19e9049..0000000
--- a/.emacs.d/color-theme-6.6.0.tar.gz
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/color-theme-6.6.0/AUTHORS b/.emacs.d/color-theme-6.6.0/AUTHORS
deleted file mode 100644
index 0042b81..0000000
--- a/.emacs.d/color-theme-6.6.0/AUTHORS
+++ /dev/null
@@ -1,31 +0,0 @@
-
- *****************************************
- AUTHORS
- *****************************************
-
-NOTE: NEVER send bug reports, help and feature requests directly to the
- authors !
-
-Original code and ideas by Jonadab the Unsightly One
-
-Current Maintainers:
- * Xavier Maillard (release manager) <zedek@gnu.org>
- * Brian Palmer <bpalmer@gmail.com>
-
-Previous maintainers:
- * (1999 2000) Jonadab the Unsightly One <jonadab@bright.net>
- * (2000, 2001, 2002, 2003) Alex Schroeder <alex@gnu.org>
-
-Contributors
-
- * Deepak Goel <deego@glue.umd.edu>
- * S. Pokrovsky <pok@nbsp.nsk.su> for ideas and discussion
- * Gordon Messmer <gordon@dragonsdawn.net> for ideas and discussion.
- * Sriram Karra <karra@cs.utah.edu> for the color-theme-submit stuff.
- * Olgierd `Kingsajz' Ziolko <kingsajz@rpg.pl> for the spec-filter idea.
- * Brian Palmer for color-theme-library ideas and code
-
-Note: all the users that contributed their color themes. See CREDITS.themes
- for a complete listing of them.
-
-Thank you all of you !
diff --git a/.emacs.d/color-theme-6.6.0/BUGS b/.emacs.d/color-theme-6.6.0/BUGS
deleted file mode 100644
index e464a7c..0000000
--- a/.emacs.d/color-theme-6.6.0/BUGS
+++ /dev/null
@@ -1,71 +0,0 @@
-This is the list of common problems.
-
-Emacs 20.7: Some faces are created using copy-face; these faces are
-not printed correctly using M-x color-theme-print. They will have
-(nil) in their spec. M-x customize-face has the same problem.
-
-Example:
-
-(copy-face 'bold 'new-bold)
-(color-theme-spec 'bold)
- => (bold ((t (:bold t))))
-(color-theme-spec 'new-bold)
- => (new-bold ((t (nil))))
-
-XEmacs 21.1: Some faces are defined using a certain font instead of
-of the correct attribute. They will have (nil) in their spec.
-M-x customize-face has the same problem.
-
-Example:
-
-(color-theme-spec 'bold)
- => (bold ((t (nil))))
-
-XEmacs 21.2 and up, Emacs 21: Not compatible with the custom-theme
-mode. It should be easy to transform the color-theme source into
-custom-theme source, however.
-
-If you are running XEmacs, then only foreground and background color
-of the default face and only the background color of the text-cursor
-face will used. This is due to the fact that these three pieces of
-information are stored as frame parameters in Emacs.
-
-If you are running XEmacs, variables cannot have a frame-local
-binding. Therefore, if color-theme-is-global is set to nil, the
-variable settings in a color theme are ignored.
-
-Using Emacs and a non-nil value for color-theme-is-global will
-install a new color theme for all frames. Using XEmacs and a non-nil
-value for color-theme-is-global will install a new color theme only
-on those frames that are not using a local color theme.
-
-If your system does not define the color names used, you will get the
-error "undefined color". See the output of `list-colors-display' for
-a list of colors defined on your display.
-
-The :box, :height, and other new attributes will be honored in Emacs
-21, but when you print such a color-theme on Emacs 20 or XEmacs 21,
-the information will get lost. So don't do that. Furthermore,
-customizing these faces may end up showing you a lisp expression
-instead of the real widgets on Emacs 20 or XEmacs 21 because these
-attributes are not understood.
-
-:inverse-video handling differs in Emacs and XEmacs. We therefore do
-away with it. When printing a color-theme, the inverse-video
-attribute should be handled correctly without ever appearing in color
-themes. For maintenance, the following might be usefull for
-query-replace-regexp.
-:background "\([^"]*\)"\(.*\):foreground "\([^"]*\)"\(.*\) :inverse-video t
-:background "\3"\2:foreground "\1"\4
-
-In XEmacs 21.1, some of the face tests don't work. Example:
-(custom-face-bold 'bold) returns nil on my system. A bug report was
-submitted.
-
-Emacs 20 users will loose with new color themes, because these will
-set the colors of the default face only, leaving frame background
-untouched. In Emacs 20, the colors of the default face and of the
-frame could be changed independently. In Emacs 21, this is no longer
-true. New color themes will not be made backwards compatible.
-
-This release was superficially tested with Emacs 21.x/22.x and XEmacs 21.4.
diff --git a/.emacs.d/color-theme-6.6.0/COPYING b/.emacs.d/color-theme-6.6.0/COPYING
deleted file mode 100644
index 7d1f860..0000000
--- a/.emacs.d/color-theme-6.6.0/COPYING
+++ /dev/null
@@ -1,342 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
-
-
diff --git a/.emacs.d/color-theme-6.6.0/ChangeLog b/.emacs.d/color-theme-6.6.0/ChangeLog
deleted file mode 100644
index 2f0d25f..0000000
--- a/.emacs.d/color-theme-6.6.0/ChangeLog
+++ /dev/null
@@ -1,121 +0,0 @@
-2006-05-28 Xavier Maillard <zedek@gnu.org>
-
- * Version 6.6.0 is released
-
- * Tagged source with RELEASE_6-6-0 for "Back in the business" release
-
- * HAGKING, BUGS, README: New files.
-
- * color-theme.el (color-theme-libraries): Changed docstring.
- (define-color-theme): Reworked macro to properly define themes.
- (color-theme-initialize): Actually does what expected.
- (color-theme-theme): Removed this useless variable.
-
- Removed commentary section (splitted into specific files)
-
- * Makefile.defs (DEBNAME): Changed default value to reveal all
- needed informations
- (LASTUPLOAD): New version.
- (CVSMODULE, CVSBRANCH, CVSROOT): New variables used to
- prepare a release.
-
- * Makefile (dist, dist-prepare, debian,
- tarball, realease, upload, $TARBALL, $DEBNAME): New targets.
- (distclean): Delete old build traces (files, package, etc...)
-
- * debian/control: Changed Maintainer informations.
-
- * debian/emacsen-startup: Safely load autoloads file or die if tests fail.
-
- * debian/rules: Fixed bad package construction.
-
- * debian/emacsen-install: Handle theme files installation correctfully.
-
-2006-05-27 Xavier Maillard <zedek@gnu.org>
-
- * debian: New directory. Contains all stuff to build a neat and
- cool color-theme-el Debian package.
-
- * AUTHORS: New file.
-
- * color-theme-autoloads.in: Ditto..
-
- * Makefile.defs: Ditto.
-
- * Makefile: Ditto.
-
- * color-theme.el (replace-in-string): New function. Used in define-color-theme
- (color-theme-directory): New variable.
- (color-theme-libraries): Changed default value to color-theme
- official theme directory
- (color-theme-load-all-themes): New variable.
- (color-theme-initialize): Load theme files defined either in
- color-theme-libraries or color-theme-directory.
-
-2006-05-22 Xavier Maillard <zedek@gnu.org>
-
- * color-theme-library.el: make bytecompiler happy.
-
- * color-theme.el (color-theme-initialize, color-theme-select)
- (color-theme-describe, color-theme-install-at-mouse)
- (color-theme-install-at-point)
- (color-theme-install-at-point-for-current-frame)
- (color-theme-print, color-theme-analyze-defun)
- (color-theme-make-snapshot, color-theme-compare)
- (color-theme-submit, color-theme-initialize): Added autoload cookies
-
- * COPYING: New file
-
-2006-05-21 Xavier Maillard <zedek@gnu.org>
-
- * color-theme.el: Make byte compiler happy.
- Added autoload cookie on color-theme-install (useless ??)
- Added eval-when-compile in color-theme-print
-
-2006-05-14 Xavier Maillard <zedek@gnu.org>
-
- * color-theme.el: Cosmetic changes
-
- * color-theme-library.el: Ditto (added header, legal notice)
-
-2006-05-11 Xavier Maillard <zedek@gnu.org>
-
- * color-theme.el (color-theme-xemacs-p): Check for xemacs feature.
- (color-theme-face-attr-construct): New function. Use it when
- face-custom-attributes-get is bound. Fixes a bug on M-x
- color-theme-select.
-
-2006-05-07 Xavier Maillard <zedek@gnu.org>
-
- * color-theme.el (color-theme-entry-path): New variable used for easymenu definition.
- We now check which (x)emacs version is used to correctly define our menu.
- (Fixes a long standing bug)
-
-2006-03-31 Brian Palmer <bpalmer@gmail.com>
-
- * color-theme-library.el (color-theme-renegade): Added new theme
- by Dave Benjamin. Thanks Dave.
-
- * color-theme.el (color-theme-select): Call
- color-theme-initialized if it has not been called before.
- (color-theme-initialized): Variable tracking initialization state, used in color-theme-select
- (color-themes): Added renegade theme by Dave Benjamin. Thanks Dave.
-
-
-2006-01-13 Xavier Maillard <zedek@gnu.org>
-
- * color-theme.el: Changed copyright header (just to test Gna services)
-
-2006-01-10 Brian Palmer <bpalmer@gmail.com>
-
- * color-theme-library.el: Added color-theme-library.el, containing
- the defined themes.
- * color-theme.el (color-theme-libraries): Customizable variable.
- * color-theme.el (color-theme-initialize): Load each file
- specified in color-theme-libraries.
-
-2006-01-10 Brian Palmer <bpalmer@gmail.com>
-
- * Added color-theme.el 6.5.5 to the repository.
- * Added ChangeLog to the repository.
-
diff --git a/.emacs.d/color-theme-6.6.0/HACKING b/.emacs.d/color-theme-6.6.0/HACKING
deleted file mode 100644
index 7477360..0000000
--- a/.emacs.d/color-theme-6.6.0/HACKING
+++ /dev/null
@@ -1,26 +0,0 @@
-This file is intented to help any color-theme hacker and particulary
-color-theme release team.
-
-
-To release a new version, please follow these instructions:
-
-1a. Change Makefile.defs (VERSION and LASTUPLOAD)
-
-1b. Verify color-theme.el header file
-
-2. Prepare debian/ directory
- => control and changelog
- => check other files
-
-3. Tag the whole source files with:
-
- cvs tag -c RELEASE-X-X-X
-
-4. Launch the automatic tarball/debian creation:
-
- make release
-
-5. Pray :)
-
-
-
diff --git a/.emacs.d/color-theme-6.6.0/Makefile b/.emacs.d/color-theme-6.6.0/Makefile
deleted file mode 100644
index 029554e..0000000
--- a/.emacs.d/color-theme-6.6.0/Makefile
+++ /dev/null
@@ -1,141 +0,0 @@
-# -*- Makefile -*-
-
-# Borrowed from many emacs places
-
-include Makefile.defs
-
-SPECIAL =
-UNCOMPILED =
-AUTOLOADFILE = color-theme-autoloads
-TESTING =
-THEMES_DIRECTORY = themes
-THEMES_FILES := $(wildcard $(THEMES_DIRECTORY)/*.el)
-ALLSOURCE := $(wildcard *.el) $(THEMES_FILES)
-SOURCE = $(filter-out $(SPECIAL) $(UNCOMPILED) $(TESTING),$(ALLSOURCE))
-TARGET = $(patsubst %.el,%.elc,$(SPECIAL) $(SOURCE))
-MANUAL = color-theme
-MISC = AUTHORS COPYING ChangeLog Makefile.defs Makefile $(AUTOLOADFILE).in
-#AUTHORS CREDITS HISTORY NEWS README Makefile ChangeLog \
-#ChangeLog.2005 ChangeLog.2004 ChangeLog.2003 ChangeLog.2002 \
-#ChangeLog.2001 servers.pl color-theme-auto.in color-theme.texi
-
-all: lisp #$(MANUAL).info
-
-lisp: clean $(TARGET)
-
-autoloads: $(AUTOLOADFILE).elc
-
-$(AUTOLOADFILE).el: $(AUTOLOADFILE).in #$(TARGET)
- cp $(AUTOLOADFILE).in $(AUTOLOADFILE).el
- rm -f $(AUTOLOADFILE).elc
- @$(EMACS) -q $(SITEFLAG) -batch \
- -l $(shell pwd | sed -e 's|^/cygdrive/\([a-z]\)|\1:|')/$(AUTOLOADFILE) \
- -f color-theme-generate-autoloads \
- $(shell pwd | sed -e 's|^/cygdrive/\([a-z]\)|\1:|')/$(AUTOLOADFILE).el . \
- $(THEMES_DIRECTORY)
-
-$(AUTOLOADFILE).elc: $(AUTOLOADFILE).el
- @echo "Byte compiling the autoload file "$<
- @$(EMACS) -batch -q -f batch-byte-compile $^
- @echo "*******************************************************************"
- @echo "Autoloads up to date. Put the following lines in your configuration"
- @echo "file (~/.emacs for a single user) :"
- @echo
- @echo ${patsubst %, "(add-to-list 'load-path \""%"\") ", $(LISPDIRS)}
- @echo "(require 'color-theme-autoload \""$(AUTOLOADFILE)"\")"
- @echo
-
-%.elc: %.el
- @$(EMACS) $(OPTIONCOMPILE) \
- --eval '(setq load-path (cons "." load-path))' \
- -f batch-byte-compile $<
-
-%.info: %.texi
- @echo "No doc yet !"
-# makeinfo $<
-
-%.html: %.texi
- @echo "No doc yet !"
-# makeinfo --html --no-split $<
-
-doc: $(MANUAL).info $(MANUAL).html
- @echo "No doc yet !"
-
-clean:
- -rm -f themes/*.elc
- -rm -f *~ *.elc $(AUTOLOADFILE).el
-
-realclean: clean
- -rm -f $(MANUAL).info $(MANUAL).html $(TARGET) $(SPECIAL)
-
-install-info: $(MANUAL).info
- [ -d $(INFODIR) ] || install -d $(INFODIR)
- install -m 0644 $(MANUAL).info $(INFODIR)/$(MANUAL)
- $(INSTALLINFO) $(INFODIR)/$(MANUAL)
-
-install-bin: lisp
- install -d $(ELISPDIR)
- install -d $(ELISPDIR)/themes
- install -m 0644 $(ALLSOURCE) $(TARGET) $(ELISPDIR)
- install -m 0644 $(THEMES_FILES) $(TARGET) $(ELISPDIR)/themes
-
-install: install-bin install-info
-
-## DO NOT TOUCH THIS !
-## HELPERS FOR MAINTAINER(S)
-distclean:
- -rm $(MANUAL).info $(MANUAL).html $(TARGET)
- -rm -Rf ../$(DISTDIR)
- -rm -f debian/dirs debian/files
- -rm -rf $(DISTDIR) $(TARBALL)* $(ZIPFILE)* $(DEBNAME)*
-
-dist: distclean Makefile
- $(MAKE) dist-prepare
-
-# Idea taken from w3m-el
-dist-prepare: CVS/Root CVS/Repository
- cvs -d $(CVSROOT) -w export -d $(DISTDIR) -r $(CVSBRANCH) $(CVSMODULE)
- -cvs diff |( cd $(DISTDIR) && patch -p0 )
-
-$(TARBALL): tarball
-$(DEBNAME): debian
-
-tarball: dist
- find $(DISTDIR) -name .cvsignore | xargs rm -f
- find $(DISTDIR) -name debian | xargs rm -fr
- find $(DISTDIR) -type d | xargs chmod 755
- find $(DISTDIR) -type f | xargs chmod 644
-
- tar -cf `basename $(TARBALL) .gz` $(DISTDIR)
- gzip -9 `basename $(TARBALL) .gz`
- zip -r $(ZIPFILE) $(DISTDIR)
- gpg --detach $(TARBALL)
- gpg --detach $(ZIPFILE)
-
-debian: dist
- (cd $(DISTDIR) && \
- dpkg-buildpackage -v$(LASTUPLOAD) $(BUILDOPTS) \
- -us -uc -rfakeroot && \
- echo "Running lintian ..." && \
- lintian -i ../$(DEBNAME)*.deb || : && \
- echo "Done running lintian." && \
- debsign)
-
- cp $(DEBNAME)* /var/spool/repo
- (cd /var/spool/repo && \
- dpkg-scanpackages . /dev/null | gzip -9 > Packages.gz && \
- dpkg-scansources . | gzip -9 > Sources.gz)
-
-release: $(DEBNAME) $(TARBALL)
- rm -rf $(DISTDIR)
- $(MAKE) upload distclean
-
-upload:
- (cd /var/spool/repo && echo open perso.nerim.net > upload.lftp ; \
- echo cd /var/spool/repo >> upload.lftp ; \
- echo mput * >> upload.lftp ; \
- echo close >> upload.lftp ; \
- lftp -f upload.lftp ; \
- rm -f upload.lftp)
- (scp $(ZIPFILE)* $(TARBALL)* \
- zeDek@download.gna.org:/upload/color-theme)
diff --git a/.emacs.d/color-theme-6.6.0/Makefile.defs b/.emacs.d/color-theme-6.6.0/Makefile.defs
deleted file mode 100644
index eeaba18..0000000
--- a/.emacs.d/color-theme-6.6.0/Makefile.defs
+++ /dev/null
@@ -1,39 +0,0 @@
-# -*- Makefile -*-
-EMACS = emacs
-SITEFLAG = --no-site-file
-OPTIONCOMPILE = -q --no-site-file --batch
-
-# XEmacs users will probably want the following settings.
-#EMACS = xemacs
-#SITEFLAG = -no-site-file
-
-# Installation options
-# PREFIX is only used here.
-PREFIX = /usr/local
-ELISPDIR = $(PREFIX)/share/emacs/site-lisp/color-theme-el
-INFODIR = $(PREFIX)/info
-
-# Command to use to install the Info dir entry
-# If you're using Debian, uncomment the following line and comment out
-#the above line.
-#INSTALLINFO = install-info --section "Emacs" "emacs" --info-dir=$(INFODIR)
-INSTALLINFO = install-info --info-dir=$(INFODIR)
-
-# Useful only for the maintainer
-PROJECT = color-theme
-VERSION = 6.6.0
-DISTDIR = $(PROJECT)-$(VERSION)
-DEBNAME = $(PROJECT)-el_$(VERSION)
-TARBALL = $(DISTDIR).tar.gz
-ZIPFILE = $(DISTDIR).zip
-
-MANUAL =
-LASTUPLOAD = 6.6.0-2
-BUILDOPTS =
-
-# DO NOT TOUCH THIS
-TAG = $(shell echo RELEASE-$(VERSION) | tr '.' '-')
-CVSMODULE = $(shell cat CVS/Repository)
-CVSBRANCH = $(shell cvs status color-theme.el |grep "Sticky Tag:"|awk '{print $$3}'|sed 's/(none)/HEAD/')
-CVSBRANCH = $(shell echo rel-$(VERSION) | tr '.' '-')
-CVSROOT = $(shell cat CVS/Root)
diff --git a/.emacs.d/color-theme-6.6.0/README b/.emacs.d/color-theme-6.6.0/README
deleted file mode 100644
index e454c0c..0000000
--- a/.emacs.d/color-theme-6.6.0/README
+++ /dev/null
@@ -1,86 +0,0 @@
-Sharing your current color setup:
-
-Use `color-theme-submit'. If you have already invested time in
-customizing Emacs faces, please consider sharing your current setup.
-Make sure that color-theme.el is in your `load-path'. Type M-x
-load-library RET color-theme RET to load all the functions. Type M-x
-color-theme-submit RET and mail the result to the maintainer of this
-package (see above for mail addres).
-
-If you want to make sure that all your customization was exported,
-type M-x list-faces-display RET to get a list of all faces currently
-defined. This is the list of faces that `color-theme-print' uses.
-
-Installing a color theme:
-
-Make sure that color-theme.el is in your `load-path'. Type M-x
-load-library RET color-theme RET to load all the functions.
-
-The main function to call is color-theme-select. Type M-x
-color-theme-select RET. That creates a Color Theme Selection
-buffer. Press RET or `i' on a color theme to install it for the
-rest of your session.
-
-If you want to install the color theme as soon as Emacs is started
-up, read the description of the theme you like and remember the
-name of the color theme function. Press `d' on a color theme in
-the Color Theme Selection buffer to read the description. Assuming
-you like the Gnome2 theme, you'll find that the function to use is
-called `color-theme-gnome2'. Add the following to the end of your
-.emacs (removing the leading `;;').
-
-(require 'color-theme)
-(color-theme-gnome2)
-
-Changing menu colors:
-
-In Emacs 21 on X, you can set the menu colors and font using the
-menu face. Example for your .emacs file:
-
- (set-face-font 'menu "7x14")
- (set-face-foreground 'menu "white").
-
-If are using X, you can set the menu foreground and background using
-a resource file, usually .Xdefaults or .Xresources. Usually
-.Xdefaults is used when you start your session using a display
-manager such as xdm or gdm. .Xresources is usually used when you
-start X directly via a shell script such as startx. If you set
-Emacs*Background and Emacs*Foreground in such a resource file, the
-foreground and background of Emacs including the menu will be set.
-If your .emacs then loads a color theme, the foreground and
-background are changed -- with the exception of the menu. There is
-no way to manipulate the menu foreground and background color from
-elisp. You can also set more specific menu resources for Emacs in
-the resource file. Here is a sample entry for your resource file:
-
- Emacs*Background: DarkSlateGray
- Emacs*Foreground: wheat
-
-Creating your own color theme:
-
-Use M-x customize-face and customize the faces. Make sure to "Set
-for Current Session" -- you don't want to save these using custom!
-When you are done, call M-x color-theme-print to produce the elisp
-code required to recreate your theme. Better yet, use M-x
-color-theme-submit to mail it to the maintainer. That way it will be
-added to future versions of color-theme.el.
-
-For more information on the elisp format of a color theme, start with
-the documentation of `color-theme-install' using C-h f
-color-theme-install.
-
-When your color theme is just a variation of an existing color theme,
-take a look at `color-theme-robin-hood' in order to see an example of
-how to do it. Essentially you want to call all the parent color
-themes before installing your changes. For all but the first parent
-color theme, you need to make sure that `color-theme-is-cumulative'
-is bound to t. If you don't do that, users that set
-`color-theme-is-cumulative' to nil will only install your changes
-without the parent color themes.
-
-Making a color theme work for both Emacs and XEmacs:
-
-Once you have printed the color-theme, you can make sure it looks
-similar in both Emacs and XEmacs by running
-`color-theme-analyze-defun' on the printed theme. This function
-will check for missing faces for the other editor...
diff --git a/.emacs.d/color-theme-6.6.0/build-stamp b/.emacs.d/color-theme-6.6.0/build-stamp
deleted file mode 100644
index e69de29..0000000
--- a/.emacs.d/color-theme-6.6.0/build-stamp
+++ /dev/null
diff --git a/.emacs.d/color-theme-6.6.0/color-theme-autoloads.el b/.emacs.d/color-theme-6.6.0/color-theme-autoloads.el
deleted file mode 100644
index 32991ef..0000000
--- a/.emacs.d/color-theme-6.6.0/color-theme-autoloads.el
+++ /dev/null
@@ -1,159 +0,0 @@
-;;; -*-emacs-lisp-*-
-
-;; Copyright (C) 2002 Free Software Foundation, Inc.
-
-(defvar generated-autoload-file)
-(defvar command-line-args-left)
-(defun color-theme-generate-autoloads ()
- (interactive)
- (require 'autoload)
- (setq generated-autoload-file (car command-line-args-left))
- (setq command-line-args-left (cdr command-line-args-left))
- (batch-update-autoloads))
-
-(provide 'color-theme-autoloads)
-;;; Generated autoloads follow (made by autoload.el).
-
-;;;### (autoloads nil nil ("themes/color-theme-example.el" "themes/color-theme-library.el")
-;;;;;; (19875 28323 773936))
-
-;;;***
-
-;;;### (autoloads (color-theme-initialize color-theme-submit color-theme-install
-;;;;;; color-theme-compare color-theme-make-snapshot color-theme-analyze-defun
-;;;;;; color-theme-print color-theme-install-at-point-for-current-frame
-;;;;;; color-theme-install-at-mouse color-theme-describe color-theme-select)
-;;;;;; "color-theme" "color-theme.el" (17529 41105))
-;;; Generated autoloads from color-theme.el
-
-(autoload 'color-theme-select "color-theme" "\
-Displays a special buffer for selecting and installing a color theme.
-With optional prefix ARG, this buffer will include color theme libraries
-as well. A color theme library is in itself not complete, it must be
-used as part of another color theme to be useful. Thus, color theme
-libraries are mainly useful for color theme authors.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'color-theme-describe "color-theme" "\
-Describe color theme listed at point.
-This shows the documentation of the value of text-property color-theme
-at point. The text-property color-theme should be a color theme
-function. See `color-themes'.
-
-\(fn)" t nil)
-
-(autoload 'color-theme-install-at-mouse "color-theme" "\
-Install color theme clicked upon using the mouse.
-First argument EVENT is used to set point. Then
-`color-theme-install-at-point' is called.
-
-\(fn EVENT)" t nil)
-
-(autoload 'color-theme-install-at-point-for-current-frame "color-theme" "\
-Install color theme at point for current frame only.
-Binds `color-theme-is-global' to nil and calls
-`color-theme-install-at-point'.
-
-\(fn)" t nil)
-
-(autoload 'color-theme-print "color-theme" "\
-Print the current color theme function.
-
-You can contribute this function to <URL:news:gnu.emacs.sources> or
-paste it into your .emacs file and call it. That should recreate all
-the settings necessary for your color theme.
-
-Example:
-
- (require 'color-theme)
- (defun my-color-theme ()
- \"Color theme by Alex Schroeder, created 2000-05-17.\"
- (interactive)
- (color-theme-install
- '(...
- ...
- ...)))
- (my-color-theme)
-
-If you want to use a specific color theme function, you can call the
-color theme function in your .emacs directly.
-
-Example:
-
- (require 'color-theme)
- (color-theme-gnome2)
-
-\(fn &optional BUF)" t nil)
-
-(autoload 'color-theme-analyze-defun "color-theme" "\
-Once you have a color-theme printed, check for missing faces.
-This is used by maintainers who receive a color-theme submission
-and want to make sure it follows the guidelines by the color-theme
-author.
-
-\(fn)" t nil)
-
-(autoload 'color-theme-make-snapshot "color-theme" "\
-Return the definition of the current color-theme.
-The function returned will recreate the color-theme in use at the moment.
-
-\(fn)" nil nil)
-
-(autoload 'color-theme-compare "color-theme" "\
-Compare two color themes.
-This will print the differences between installing THEME-A and
-installing THEME-B. Note that the order is important: If a face is
-defined in THEME-A and not in THEME-B, then this will not show up as a
-difference, because there is no reset before installing THEME-B. If a
-face is defined in THEME-B and not in THEME-A, then this will show up as
-a difference.
-
-\(fn THEME-A THEME-B)" t nil)
-
-(autoload 'color-theme-install "color-theme" "\
-Install a color theme defined by frame parameters, variables and faces.
-
-The theme is installed for all present and future frames; any missing
-faces are created. See `color-theme-install-faces'.
-
-THEME is a color theme definition. See below for more information.
-
-If you want to install a color theme from your .emacs, use the output
-generated by `color-theme-print'. This produces color theme function
-which you can copy to your .emacs.
-
-A color theme definition is a list:
-\([FUNCTION] FRAME-PARAMETERS VARIABLE-SETTINGS FACE-DEFINITIONS)
-
-FUNCTION is the color theme function which called `color-theme-install'.
-This is no longer used. There was a time when this package supported
-automatic factoring of color themes. This has been abandoned.
-
-FRAME-PARAMETERS is an alist of frame parameters. These are installed
-with `color-theme-install-frame-params'. These are installed last such
-that any changes to the default face can be changed by the frame
-parameters.
-
-VARIABLE-DEFINITIONS is an alist of variable settings. These are
-installed with `color-theme-install-variables'.
-
-FACE-DEFINITIONS is an alist of face definitions. These are installed
-with `color-theme-install-faces'.
-
-If `color-theme-is-cumulative' is nil, a color theme will undo face and
-frame-parameter settings of previous color themes.
-
-\(fn THEME)" nil nil)
-
-(autoload 'color-theme-submit "color-theme" "\
-Submit your color-theme to the maintainer.
-
-\(fn)" t nil)
-
-(autoload 'color-theme-initialize "color-theme" "\
-Initialize the color theme package by loading color-theme-libraries.
-
-\(fn)" t nil)
-
-;;;***
diff --git a/.emacs.d/color-theme-6.6.0/color-theme-autoloads.elc b/.emacs.d/color-theme-6.6.0/color-theme-autoloads.elc
deleted file mode 100644
index 9e36347..0000000
--- a/.emacs.d/color-theme-6.6.0/color-theme-autoloads.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/color-theme-6.6.0/color-theme-autoloads.in b/.emacs.d/color-theme-6.6.0/color-theme-autoloads.in
deleted file mode 100644
index 28f1771..0000000
--- a/.emacs.d/color-theme-6.6.0/color-theme-autoloads.in
+++ /dev/null
@@ -1,15 +0,0 @@
-;;; -*-emacs-lisp-*-
-
-;; Copyright (C) 2002 Free Software Foundation, Inc.
-
-(defvar generated-autoload-file)
-(defvar command-line-args-left)
-(defun color-theme-generate-autoloads ()
- (interactive)
- (require 'autoload)
- (setq generated-autoload-file (car command-line-args-left))
- (setq command-line-args-left (cdr command-line-args-left))
- (batch-update-autoloads))
-
-(provide 'color-theme-autoloads)
-;;; Generated autoloads follow (made by autoload.el).
diff --git a/.emacs.d/color-theme-6.6.0/color-theme.el b/.emacs.d/color-theme-6.6.0/color-theme.el
deleted file mode 100644
index c92c1a5..0000000
--- a/.emacs.d/color-theme-6.6.0/color-theme.el
+++ /dev/null
@@ -1,1668 +0,0 @@
-;;; color-theme.el --- install color themes
-
-;; Copyright (C) 1999, 2000 Jonadab the Unsightly One <jonadab@bright.net>
-;; Copyright (C) 2000, 2001, 2002, 2003 Alex Schroeder <alex@gnu.org>
-;; Copyright (C) 2003, 2004, 2005, 2006 Xavier Maillard <zedek@gnu.org>
-
-;; Version: 6.6.0
-;; Keywords: faces
-;; Author: Jonadab the Unsightly One <jonadab@bright.net>
-;; Maintainer: Xavier Maillard <zedek@gnu.org>
-;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ColorTheme
-
-;; This file is not (YET) part of GNU Emacs.
-
-;; This is free software; you can redistribute it and/or modify it under
-;; the terms of the GNU General Public License as published by the Free
-;; Software Foundation; either version 2, or (at your option) any later
-;; version.
-;;
-;; This is distributed in the hope that it will be useful, but WITHOUT
-;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-;; for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-;; MA 02111-1307, USA.
-
-;;; Commentary:
-
-;; Please read README and BUGS files for any relevant help.
-;; Contributors (not themers) should also read HACKING file.
-
-;;; Thanks
-
-;; Deepak Goel <deego@glue.umd.edu>
-;; S. Pokrovsky <pok@nbsp.nsk.su> for ideas and discussion.
-;; Gordon Messmer <gordon@dragonsdawn.net> for ideas and discussion.
-;; Sriram Karra <karra@cs.utah.edu> for the color-theme-submit stuff.
-;; Olgierd `Kingsajz' Ziolko <kingsajz@rpg.pl> for the spec-filter idea.
-;; Brian Palmer for color-theme-library ideas and code
-;; All the users that contributed their color themes.
-
-
-
-;;; Code:
-(eval-when-compile
- (require 'easymenu)
- (require 'reporter)
- (require 'sendmail))
-
-(require 'cl); set-difference is a function...
-
-;; for custom-face-attributes-get or face-custom-attributes-get
-(require 'cus-face)
-(require 'wid-edit); for widget-apply stuff in cus-face.el
-
-(defconst color-theme-maintainer-address "zedek@gnu.org"
- "Address used by `submit-color-theme'.")
-
-;; Emacs / XEmacs compatibility and workaround layer
-
-(cond ((and (facep 'tool-bar)
- (not (facep 'toolbar)))
- (put 'toolbar 'face-alias 'tool-bar))
- ((and (facep 'toolbar)
- (not (facep 'tool-bar)))
- (put 'tool-bar 'face-alias 'toolbar)))
-
-(defvar color-theme-xemacs-p (and (featurep 'xemacs)
- (string-match "XEmacs" emacs-version))
- "Non-nil if running XEmacs.")
-
-;; Add this since it appears to miss in emacs-2x
-(or (fboundp 'replace-in-string)
- (defun replace-in-string (target old new)
- (replace-regexp-in-string old new target)))
-
-;; face-attr-construct has a problem in Emacs 20.7 and older when
-;; dealing with inverse-video faces. Here is a short test to check
-;; wether you are affected.
-
-;; (set-background-color "wheat")
-;; (set-foreground-color "black")
-;; (setq a (make-face 'a-face))
-;; (face-spec-set a '((t (:background "white" :foreground "black" :inverse-video t))))
-;; (face-attr-construct a)
-;; => (:background "black" :inverse-video t)
-
-;; The expected response is the original specification:
-;; => (:background "white" :foreground "black" :inverse-video t)
-
-;; That's why we depend on cus-face.el functionality.
-
-(cond ((fboundp 'custom-face-attributes-get)
- (defun color-theme-face-attr-construct (face frame)
- (if (atom face)
- (custom-face-attributes-get face frame)
- (if (and (consp face) (eq (car face) 'quote))
- (custom-face-attributes-get (cadr face) frame)
- (custom-face-attributes-get (car face) frame)))))
- ((fboundp 'face-custom-attributes-get)
- (defalias 'color-theme-face-attr-construct
- 'face-custom-attributes-get))
- (t
- (defun color-theme-face-attr-construct (&rest ignore)
- (error "Unable to construct face attributes"))))
-
-(defun color-theme-alist (plist)
- "Transform PLIST into an alist if it is a plist and return it.
-If the first element of PLIST is a cons cell, we just return PLIST,
-assuming PLIST to be an alist. If the first element of plist is not a
-symbol, this is an error: We cannot distinguish a plist from an ordinary
-list, but a list that doesn't start with a symbol is certainly no plist
-and no alist.
-
-This is used to make sure `default-frame-alist' really is an alist and not
-a plist. In XEmacs, the alist is deprecated; a plist is used instead."
- (cond ((consp (car plist))
- plist)
- ((not (symbolp (car plist)))
- (error "Wrong type argument: plist, %S" plist))
- ((featurep 'xemacs)
- (plist-to-alist plist)))); XEmacs only
-
-;; Customization
-
-(defgroup color-theme nil
- "Color Themes for Emacs.
-A color theme consists of frame parameter settings, variable settings,
-and face definitions."
- :version "20.6"
- :group 'faces)
-
-(defcustom color-theme-legal-frame-parameters "\\(color\\|mode\\)$"
- "Regexp that matches frame parameter names.
-Only frame parameter names that match this regexp can be changed as part
-of a color theme."
- :type '(choice (const :tag "Colors only" "\\(color\\|mode\\)$")
- (const :tag "Colors, fonts, and size"
- "\\(color\\|mode\\|font\\|height\\|width\\)$")
- (regexp :tag "Custom regexp"))
- :group 'color-theme
- :link '(info-link "(elisp)Window Frame Parameters"))
-
-(defcustom color-theme-legal-variables "\\(color\\|face\\)$"
- "Regexp that matches variable names.
-Only variables that match this regexp can be changed as part of a color
-theme. In addition to matching this name, the variables have to be user
-variables (see function `user-variable-p')."
- :type 'regexp
- :group 'color-theme)
-
-(defcustom color-theme-illegal-faces "^w3-"
- "Regexp that matches face names forbidden in themes.
-The default setting \"^w3-\" excludes w3 faces since these
-are created dynamically."
- :type 'regexp
- :group 'color-theme
- :link '(info-link "(elisp)Faces for Font Lock")
- :link '(info-link "(elisp)Standard Faces"))
-
-(defcustom color-theme-illegal-default-attributes '(:family :height :width)
- "A list of face properties to be ignored when installing faces.
-This prevents Emacs from doing terrible things to your display just because
-a theme author likes weird fonts."
- :type '(repeat symbol)
- :group 'color-theme)
-
-(defcustom color-theme-is-global t
- "*Determines wether a color theme is installed on all frames or not.
-If non-nil, color themes will be installed for all frames.
-If nil, color themes will be installed for the selected frame only.
-
-A possible use for this variable is dynamic binding. Here is a larger
-example to put in your ~/.emacs; it will make the Blue Sea color theme
-the default used for the first frame, and it will create two additional
-frames with different color themes.
-
-setup:
- \(require 'color-theme)
- ;; set default color theme
- \(color-theme-blue-sea)
- ;; create some frames with different color themes
- \(let ((color-theme-is-global nil))
- \(select-frame (make-frame))
- \(color-theme-gnome2)
- \(select-frame (make-frame))
- \(color-theme-standard))
-
-Please note that using XEmacs and and a nil value for
-color-theme-is-global will ignore any variable settings for the color
-theme, since XEmacs doesn't have frame-local variable bindings.
-
-Also note that using Emacs and a non-nil value for color-theme-is-global
-will install a new color theme for all frames. Using XEmacs and a
-non-nil value for color-theme-is-global will install a new color theme
-only on those frames that are not using a local color theme."
- :type 'boolean
- :group 'color-theme)
-
-(defcustom color-theme-is-cumulative t
- "*Determines wether new color themes are installed on top of each other.
-If non-nil, installing a color theme will undo all settings made by
-previous color themes."
- :type 'boolean
- :group 'color-theme)
-
-(defcustom color-theme-directory nil
- "Directory where we can find additionnal themes (personnal).
-Note that there is at least one directory shipped with the official
-color-theme distribution where all contributed themes are located.
-This official selection can't be changed with that variable.
-However, you still can decide to turn it on or off and thus,
-not be shown with all themes but yours."
- :type '(repeat string)
- :group 'color-theme)
-
-(defcustom color-theme-libraries (directory-files
- (concat
- (file-name-directory (locate-library "color-theme"))
- "/themes") t "^color-theme")
- "A list of files, which will be loaded in color-theme-initialize depending
-on `color-theme-load-all-themes' value.
-This allows a user to prune the default color-themes (which can take a while
-to load)."
- :type '(repeat string)
- :group 'color-theme)
-
-(defcustom color-theme-load-all-themes t
- "When t, load all color-theme theme files
-as presented by `color-theme-libraries'. Else
-do not load any of this themes."
- :type 'boolean
- :group 'color-theme)
-
-(defcustom color-theme-mode-hook nil
- "Hook for color-theme-mode."
- :type 'hook
- :group 'color-theme)
-
-(defvar color-theme-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map (kbd "RET") 'color-theme-install-at-point)
- (define-key map (kbd "c") 'list-colors-display)
- (define-key map (kbd "d") 'color-theme-describe)
- (define-key map (kbd "f") 'list-faces-display)
- (define-key map (kbd "i") 'color-theme-install-at-point)
- (define-key map (kbd "l") 'color-theme-install-at-point-for-current-frame)
- (define-key map (kbd "p") 'color-theme-print)
- (define-key map (kbd "q") 'bury-buffer)
- (define-key map (kbd "?") 'color-theme-describe)
- (if color-theme-xemacs-p
- (define-key map (kbd "<button2>") 'color-theme-install-at-mouse)
- (define-key map (kbd "<mouse-2>") 'color-theme-install-at-mouse))
- map)
- "Mode map used for the buffer created by `color-theme-select'.")
-
-(defvar color-theme-initialized nil
- "Internal variable determining whether color-theme-initialize has been invoked yet")
-
-(defvar color-theme-buffer-name "*Color Theme Selection*"
- "Name of the color theme selection buffer.")
-
-(defvar color-theme-original-frame-alist nil
- "nil until one of the color themes has been installed.")
-
-(defvar color-theme-history nil
- "List of color-themes called, in reverse order")
-
-(defcustom color-theme-history-max-length nil
- "Max length of history to maintain.
-Two other values are acceptable: t means no limit, and
-nil means that no history is maintained."
- :type '(choice (const :tag "No history" nil)
- (const :tag "Unlimited length" t)
- integer)
- :group 'color-theme)
-
-(defvar color-theme-counter 0
- "Counter for every addition to `color-theme-history'.
-This counts how many themes were installed, regardless
-of `color-theme-history-max-length'.")
-
-(defvar color-theme-entry-path (cond
- ;; Emacs 22.x and later
- ((lookup-key global-map [menu-bar tools])
- '("tools"))
- ;; XEmacs
- ((featurep 'xemacs)
- (setq tool-entry '("Tools")))
- ;; Emacs < 22
- (t
- '("Tools")))
- "Menu tool entry path.")
-
-(defun color-theme-add-to-history (name)
- "Add color-theme NAME to `color-theme-history'."
- (setq color-theme-history
- (cons (list name color-theme-is-cumulative)
- color-theme-history)
- color-theme-counter (+ 1 color-theme-counter))
- ;; Truncate the list if necessary.
- (when (and (integerp color-theme-history-max-length)
- (>= (length color-theme-history)
- color-theme-history-max-length))
- (setcdr (nthcdr (1- color-theme-history-max-length)
- color-theme-history)
- nil)))
-
-;; (let ((l '(1 2 3 4 5)))
-;; (setcdr (nthcdr 2 l) nil)
-;; l)
-
-
-
-;; List of color themes used to create the *Color Theme Selection*
-;; buffer.
-
-(defvar color-themes
- '((color-theme-aalto-dark "Aalto Dark" "Jari Aalto <jari.aalto@poboxes.com>")
- (color-theme-aalto-light "Aalto Light" "Jari Aalto <jari.aalto@poboxes.com>")
- (color-theme-aliceblue "Alice Blue" "Girish Bharadwaj <girishb@gbvsoft.com>")
- (color-theme-andreas "Andreas" "Andreas Busch <Andreas.Busch@politics.ox.ac.uk>")
- (color-theme-arjen "Arjen" "Arjen Wiersma <arjen@wiersma.org>")
- (color-theme-beige-diff "Beige Diff" "Alex Schroeder <alex@gnu.org>" t)
- (color-theme-bharadwaj "Bharadwaj" "Girish Bharadwaj <girishb@gbvsoft.com>")
- (color-theme-bharadwaj-slate "Bharadwaj Slate" "Girish Bharadwaj <girishb@gbvsoft.com>")
- (color-theme-billw "Billw" "Bill White <billw@wolfram.com>")
- (color-theme-black-on-gray "BlackOnGray" "Sudhir Bhojwani <sbhojwani@altoweb.com>")
- (color-theme-blippblopp "Blipp Blopp" "Thomas Sicheritz-Ponten<thomas@biopython.org>")
- (color-theme-simple-1 "Black" "Jonadab <jonadab@bright.net>")
- (color-theme-blue-erc "Blue ERC" "Alex Schroeder <alex@gnu.org>" t)
- (color-theme-blue-gnus "Blue Gnus" "Alex Schroeder <alex@gnu.org>" t)
- (color-theme-blue-mood "Blue Mood" "Nelson Loyola <nloyola@yahoo.com>")
- (color-theme-blue-sea "Blue Sea" "Alex Schroeder <alex@gnu.org>")
- (color-theme-calm-forest "Calm Forest" "Artur Hefczyc <kobit@plusnet.pl>")
- (color-theme-charcoal-black "Charcoal Black" "Lars Chr. Hausmann <jazz@zqz.dk>")
- (color-theme-goldenrod "Cheap Goldenrod" "Alex Schroeder <alex@gnu.org>")
- (color-theme-clarity "Clarity and Beauty" "Richard Wellum <rwellum@cisco.com>")
- (color-theme-classic "Classic" "Frederic Giroud <postcard@worldonline.fr>")
- (color-theme-comidia "Comidia" "Marcelo Dias de Toledo <mtole@ig.com.br>")
- (color-theme-jsc-dark "Cooper Dark" "John S Cooper <John.Cooper@eu.citrix.com>")
- (color-theme-jsc-light "Cooper Light" "John S Cooper <John.Cooper@eu.citrix.com>")
- (color-theme-jsc-light2 "Cooper Light 2" "John S Cooper <John.Cooper@eu.citrix.com>")
- (color-theme-dark-blue "Dark Blue" "Chris McMahan <cmcmahan@one.net>")
- (color-theme-dark-blue2 "Dark Blue 2" "Chris McMahan <cmcmahan@one.net>")
- (color-theme-dark-green "Dark Green" "eddy_woody@hotmail.com")
- (color-theme-dark-laptop "Dark Laptop" "Laurent Michel <ldm@cs.brown.edu>")
- (color-theme-deep-blue "Deep Blue" "Tomas Cerha <cerha@brailcom.org>")
- (color-theme-digital-ofs1 "Digital OFS1" "Gareth Owen <gowen@gwowen.freeserve.co.uk>")
- (color-theme-euphoria "Euphoria" "oGLOWo@oGLOWo.cjb.net")
- (color-theme-feng-shui "Feng Shui" "Walter Higgins <walterh@rocketmail.com>")
- (color-theme-fischmeister "Fischmeister"
- "Sebastian Fischmeister <sfischme@nexus.lzk.tuwien.ac.at>")
- (color-theme-gnome "Gnome" "Jonadab <jonadab@bright.net>")
- (color-theme-gnome2 "Gnome 2" "Alex Schroeder <alex@gnu.org>")
- (color-theme-gray1 "Gray1" "Paul Pulli <P.Pulli@motorola.com>")
- (color-theme-gray30 "Gray30" "Girish Bharadwaj <girishb@gbvsoft.com>")
- (color-theme-kingsajz "Green Kingsajz" "Olgierd `Kingsajz' Ziolko <kingsajz@rpg.pl>")
- (color-theme-greiner "Greiner" "Kevin Greiner <kgreiner@mapquest.com>")
- (color-theme-gtk-ide "GTK IDE" "Gordon Messmer <gordon@dragonsdawn.net>")
- (color-theme-high-contrast "High Contrast" "Alex Schroeder <alex@gnu.org>")
- (color-theme-hober "Hober" "Edward O'Connor <ted@oconnor.cx>")
- (color-theme-infodoc "Infodoc" "Frederic Giroud <postcard@worldonline.fr>")
- (color-theme-jb-simple "JB Simple" "jeff@dvns.com")
- (color-theme-jedit-grey "Jedit Grey" "Gordon Messmer <gordon@dragonsdawn.net>")
- (color-theme-jonadabian "Jonadab" "Jonadab <jonadab@bright.net>")
- (color-theme-jonadabian-slate "Jonadabian Slate" "Jonadab <jonadab@bright.net>")
- (color-theme-katester "Katester" "Higgins_Walter@emc.com")
- (color-theme-late-night "Late Night" "Alex Schroeder <alex@gnu.org>")
- (color-theme-lawrence "Lawrence" "lawrence mitchell <wence@gmx.li>")
- (color-theme-lethe "Lethe" "Ivica Loncar <ivica.loncar@srk.fer.hr>")
- (color-theme-ld-dark "Linh Dang Dark" "Linh Dang <linhd@nortelnetworks.com>")
- (color-theme-marine "Marine" "Girish Bharadwaj <girishb@gbvsoft.com>")
- (color-theme-matrix "Matrix" "Walter Higgins <walterh@rocketmail.com>")
- (color-theme-marquardt "Marquardt" "Colin Marquardt <colin@marquardt-home.de>")
- (color-theme-midnight "Midnight" "Gordon Messmer <gordon@dragonsdawn.net>")
- (color-theme-mistyday "Misty Day" "Hari Kumar <Hari.Kumar@mtm.kuleuven.ac.be>")
- (color-theme-montz "Montz" "Brady Montz <bradym@becomm.com>")
- (color-theme-oswald "Oswald" "Tom Oswald <toswald@sharplabs.com>")
- (color-theme-parus "Parus" "Jon K Hellan <hellan@acm.org>")
- (color-theme-pierson "Pierson" "Dan L. Pierson <dan@sol.control.com>")
- (color-theme-ramangalahy "Ramangalahy" "Solofo Ramangalahy <solofo@irisa.fr>")
- (color-theme-raspopovic "Raspopovic" "Pedja Raspopovic <pedja@lsil.com>")
- (color-theme-renegade "Renegade" "Dave Benjamin <ramen@ramenfest.com>")
- (color-theme-resolve "Resolve" "Damien Elmes <resolve@repose.cx>")
- (color-theme-retro-green "Retro Green" "Alex Schroeder <alex@gnu.org>")
- (color-theme-retro-orange "Retro Orange" "Alex Schroeder <alex@gnu.org>")
- (color-theme-robin-hood "Robin Hood" "Alex Schroeder <alex@gnu.org>")
- (color-theme-rotor "Rotor" "Jinwei Shen <shenjw@wam.umd.edu>")
- (color-theme-ryerson "Ryerson" "Luis Fernandes <elf@ee.ryerson.ca>")
- (color-theme-salmon-diff "Salmon Diff" "Alex Schroeder <alex@gnu.org>" t)
- (color-theme-salmon-font-lock "Salmon Font-Lock" "Alex Schroeder <alex@gnu.org>" t)
- (color-theme-scintilla "Scintilla" "Gordon Messmer <gordon@dragonsdawn.net>")
- (color-theme-shaman "Shaman" "shaman@interdon.net")
- (color-theme-sitaramv-nt "Sitaram NT"
- "Sitaram Venkatraman <sitaramv@loc251.tandem.com>")
- (color-theme-sitaramv-solaris "Sitaram Solaris"
- "Sitaram Venkatraman <sitaramv@loc251.tandem.com>")
- (color-theme-snow "Snow" "Nicolas Rist <Nicolas.Rist@alcatel.de>")
- (color-theme-snowish "Snowish" "Girish Bharadwaj <girishb@gbvsoft.com>")
- (color-theme-standard-ediff "Standard Ediff" "Emacs Team, added by Alex Schroeder <alex@gnu.org>" t)
- (color-theme-standard "Standard Emacs 20" "Emacs Team, added by Alex Schroeder <alex@gnu.org>")
- (color-theme-emacs-21 "Standard Emacs 21" "Emacs Team, added by Alex Schroeder <alex@gnu.org>")
- (color-theme-emacs-nw "Standard Emacs 21 No Window" "Emacs Team, added by D. Goel <deego@gnufans.org>")
- (color-theme-xemacs "Standard XEmacs" "XEmacs Team, added by Alex Schroeder <alex@gnu.org>")
- (color-theme-subtle-blue "Subtle Blue" "Chris McMahan <cmcmahan@one.net>")
- (color-theme-subtle-hacker "Subtle Hacker" "Colin Walters <levanti@verbum.org>")
- (color-theme-taming-mr-arneson "Taming Mr Arneson" "Erik Arneson <erik@aarg.net>")
- (color-theme-taylor "Taylor" "Art Taylor <reeses@hemisphere.org>")
- (color-theme-tty-dark "TTY Dark" "O Polite <m2@plusseven.com>")
- (color-theme-vim-colors "Vim Colors" "Michael Soulier <msoulier@biryani.nssg.mitel.com>")
- (color-theme-whateveryouwant "Whateveryouwant" "Fabien Penso <penso@linuxfr.org>, color by Scott Jaderholm <scott@jaderholm.com>")
- (color-theme-wheat "Wheat" "Alex Schroeder <alex@gnu.org>")
- (color-theme-pok-wob "White On Black" "S. Pokrovsky <pok@nbsp.nsk.su>")
- (color-theme-pok-wog "White On Grey" "S. Pokrovsky <pok@nbsp.nsk.su>")
- (color-theme-word-perfect "WordPerfect" "Thomas Gehrlein <Thomas.Gehrlein@t-online.de>")
- (color-theme-xp "XP" "Girish Bharadwaj <girishb@gbvsoft.com>"))
- "List of color themes.
-
-Each THEME is itself a three element list (FUNC NAME MAINTAINER &optional LIBRARY).
-
-FUNC is a color theme function which does the setup. The function
-FUNC may call `color-theme-install'. The color theme function may be
-interactive.
-
-NAME is the name of the theme and MAINTAINER is the name and/or email of
-the maintainer of the theme.
-
-If LIBRARY is non-nil, the color theme will be considered a library and
-may not be shown in the default menu.
-
-If you defined your own color theme and want to add it to this list,
-use something like this:
-
- (add-to-list 'color-themes '(color-theme-gnome2 \"Gnome2\" \"Alex\"))")
-
-;;; Functions
-
-(defun color-theme-backup-original-values ()
- "Back up the original `default-frame-alist'.
-The values are stored in `color-theme-original-frame-alist' on
-startup."
- (if (null color-theme-original-frame-alist)
- (setq color-theme-original-frame-alist
- (color-theme-filter (frame-parameters (selected-frame))
- color-theme-legal-frame-parameters))))
-(add-hook 'after-init-hook 'color-theme-backup-original-values)
-
-;;;###autoload
-(defun color-theme-select (&optional arg)
- "Displays a special buffer for selecting and installing a color theme.
-With optional prefix ARG, this buffer will include color theme libraries
-as well. A color theme library is in itself not complete, it must be
-used as part of another color theme to be useful. Thus, color theme
-libraries are mainly useful for color theme authors."
- (interactive "P")
- (unless color-theme-initialized (color-theme-initialize))
- (switch-to-buffer (get-buffer-create color-theme-buffer-name))
- (setq buffer-read-only nil)
- (erase-buffer)
- ;; recreate the snapshot if necessary
- (when (or (not (assq 'color-theme-snapshot color-themes))
- (not (commandp 'color-theme-snapshot)))
- (fset 'color-theme-snapshot (color-theme-make-snapshot))
- (setq color-themes (delq (assq 'color-theme-snapshot color-themes)
- color-themes)
- color-themes (delq (assq 'bury-buffer color-themes)
- color-themes)
- color-themes (append '((color-theme-snapshot
- "[Reset]" "Undo changes, if possible.")
- (bury-buffer
- "[Quit]" "Bury this buffer."))
- color-themes)))
- (dolist (theme color-themes)
- (let ((func (nth 0 theme))
- (name (nth 1 theme))
- (author (nth 2 theme))
- (library (nth 3 theme))
- (desc))
- (when (or (not library) arg)
- (setq desc (format "%-23s %s"
- (if library (concat name " [lib]") name)
- author))
- (put-text-property 0 (length desc) 'color-theme func desc)
- (put-text-property 0 (length name) 'face 'bold desc)
- (put-text-property 0 (length name) 'mouse-face 'highlight desc)
- (insert desc)
- (newline))))
- (goto-char (point-min))
- (setq buffer-read-only t)
- (set-buffer-modified-p nil)
- (color-theme-mode))
-
-(when (require 'easymenu)
- (easy-menu-add-item nil color-theme-entry-path "--")
- (easy-menu-add-item nil color-theme-entry-path
- ["Color Themes" color-theme-select t]))
-
-(defun color-theme-mode ()
- "Major mode to select and install color themes.
-
-Use \\[color-theme-install-at-point] to install a color theme on all frames.
-Use \\[color-theme-install-at-point-for-current-frame] to install a color theme for the current frame only.
-
-The changes are applied on top of your current setup. This is a
-feature.
-
-Some of the themes should be considered extensions to the standard color
-theme: they modify only a limited number of faces and variables. To
-verify the final look of a color theme, install the standard color
-theme, then install the other color theme. This is a feature. It allows
-you to mix several color themes.
-
-Use \\[color-theme-describe] to read more about the color theme function at point.
-If you want to install the color theme permanently, put the call to the
-color theme function into your ~/.emacs:
-
- \(require 'color-theme)
- \(color-theme-gnome2)
-
-If you worry about the size of color-theme.el: You are right. Use
-\\[color-theme-print] to print the current color theme and save the resulting buffer
-as ~/.emacs-color-theme. Now you can install only this specific color
-theme in your .emacs:
-
- \(load-file \"~/.emacs-color-theme\")
- \(my-color-theme)
-
-The Emacs menu is not affected by color themes within Emacs. Depending
-on the toolkit you used to compile Emacs, you might have to set specific
-X ressources. See the info manual for more information. Here is an
-example ~/.Xdefaults fragment:
-
- emacs*Background: DarkSlateGray
- emacs*Foreground: wheat
-
-\\{color-theme-mode-map}
-
-The color themes are listed in `color-themes', which see."
- (kill-all-local-variables)
- (setq major-mode 'color-theme-mode)
- (setq mode-name "Color Themes")
- (use-local-map color-theme-mode-map)
- (when (functionp 'goto-address); Emacs
- (goto-address))
- (run-hooks 'color-theme-mode-hook))
-
-;;; Commands in Color Theme Selection mode
-
-;;;###autoload
-(defun color-theme-describe ()
- "Describe color theme listed at point.
-This shows the documentation of the value of text-property color-theme
-at point. The text-property color-theme should be a color theme
-function. See `color-themes'."
- (interactive)
- (describe-function (get-text-property (point) 'color-theme)))
-
-;;;###autoload
-(defun color-theme-install-at-mouse (event)
- "Install color theme clicked upon using the mouse.
-First argument EVENT is used to set point. Then
-`color-theme-install-at-point' is called."
- (interactive "e")
- (save-excursion
- (mouse-set-point event)
- (color-theme-install-at-point)))
-
-;;;autoload
-(defun color-theme-install-at-point ()
- "Install color theme at point.
-This calls the value of the text-property `color-theme' at point.
-The text-property `color-theme' should be a color theme function.
-See `color-themes'."
- (interactive)
- (let ((func (get-text-property (point) 'color-theme)))
- ;; install theme
- (if func
- (funcall func))
- ;; If goto-address is being used, remove all overlays in the current
- ;; buffer and run it again. The face used for the mail addresses in
- ;; the the color theme selection buffer is based on the variable
- ;; goto-address-mail-face. Changes in that variable will not affect
- ;; existing overlays, however, thereby confusing users.
- (when (functionp 'goto-address); Emacs
- (dolist (o (overlays-in (point-min) (point-max)))
- (delete-overlay o))
- (goto-address))))
-
-;;;###autoload
-(defun color-theme-install-at-point-for-current-frame ()
- "Install color theme at point for current frame only.
-Binds `color-theme-is-global' to nil and calls
-`color-theme-install-at-point'."
- (interactive)
- (let ((color-theme-is-global nil))
- (color-theme-install-at-point)))
-
-
-
-;; Taking a snapshot of the current color theme and pretty printing it.
-
-(defun color-theme-filter (old-list regexp &optional exclude)
- "Filter OLD-LIST.
-The resulting list will be newly allocated and contains only elements
-with names matching REGEXP. OLD-LIST may be a list or an alist. If you
-want to filter a plist, use `color-theme-alist' to convert your plist to
-an alist, first.
-
-If the optional argument EXCLUDE is non-nil, then the sense is
-reversed: only non-matching elements will be retained."
- (let (elem new-list)
- (dolist (elem old-list)
- (setq name (symbol-name (if (listp elem) (car elem) elem)))
- (when (or (and (not exclude)
- (string-match regexp name))
- (and exclude
- (not (string-match regexp name))))
- ;; Now make sure that if elem is a cons cell, and the cdr of
- ;; that cons cell is a string, then we need a *new* string in
- ;; the new list. Having a new cons cell is of no use because
- ;; modify-frame-parameters will modify this string, thus
- ;; modifying our color theme functions!
- (when (and (consp elem)
- (stringp (cdr elem)))
- (setq elem (cons (car elem)
- (copy-sequence (cdr elem)))))
- ;; Now store elem
- (setq new-list (cons elem new-list))))
- new-list))
-
-(defun color-theme-spec-filter (spec)
- "Filter the attributes in SPEC.
-This makes sure that SPEC has the form ((t (PLIST ...))).
-Only properties not in `color-theme-illegal-default-attributes'
-are included in the SPEC returned."
- (let ((props (cadar spec))
- result prop val)
- (while props
- (setq prop (nth 0 props)
- val (nth 1 props)
- props (nthcdr 2 props))
- (unless (memq prop color-theme-illegal-default-attributes)
- (setq result (cons val (cons prop result)))))
- `((t ,(nreverse result)))))
-
-;; (color-theme-spec-filter '((t (:background "blue3"))))
-;; (color-theme-spec-filter '((t (:stipple nil :background "Black" :foreground "SteelBlue" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width semi-condensed :family "misc-fixed"))))
-
-(defun color-theme-plist-delete (plist prop)
- "Delete property PROP from property list PLIST by side effect.
-This modifies PLIST."
- ;; deal with prop at the start
- (while (eq (car plist) prop)
- (setq plist (cddr plist)))
- ;; deal with empty plist
- (when plist
- (let ((lastcell (cdr plist))
- (l (cddr plist)))
- (while l
- (if (eq (car l) prop)
- (progn
- (setq l (cddr l))
- (setcdr lastcell l))
- (setq lastcell (cdr l)
- l (cddr l))))))
- plist)
-
-;; (color-theme-plist-delete '(a b c d e f g h) 'a)
-;; (color-theme-plist-delete '(a b c d e f g h) 'b)
-;; (color-theme-plist-delete '(a b c d e f g h) 'c)
-;; (color-theme-plist-delete '(a b c d e f g h) 'g)
-;; (color-theme-plist-delete '(a b c d c d e f g h) 'c)
-;; (color-theme-plist-delete '(a b c d e f c d g h) 'c)
-
-(if (or (featurep 'xemacs)
- (< emacs-major-version 21))
- (defalias 'color-theme-spec-compat 'identity)
- (defun color-theme-spec-compat (spec)
- "Filter the attributes in SPEC such that is is never invalid.
-Example: Eventhough :bold works in Emacs, it is not recognized by
-`customize-face' -- and then the face is uncustomizable. This
-function replaces a :bold attribute with the corresponding :weight
-attribute, if there is no :weight, or deletes it. This undoes the
-doings of `color-theme-spec-canonical-font', more or less."
- (let ((props (cadar spec)))
- (when (plist-member props :bold)
- (setq props (color-theme-plist-delete props :bold))
- (unless (plist-member props :weight)
- (setq props (plist-put props :weight 'bold))))
- (when (plist-member props :italic)
- (setq props (color-theme-plist-delete props :italic))
- (unless (plist-member props :slant)
- (setq props (plist-put props :slant 'italic))))
- `((t ,props)))))
-
-;; (color-theme-spec-compat '((t (:foreground "blue" :bold t))))
-;; (color-theme-spec-compat '((t (:bold t :foreground "blue" :weight extra-bold))))
-;; (color-theme-spec-compat '((t (:italic t :foreground "blue"))))
-;; (color-theme-spec-compat '((t (:slant oblique :italic t :foreground "blue"))))
-
-(defun color-theme-spec-canonical-font (atts)
- "Add :bold and :italic attributes if necessary."
- ;; add these to the front of atts -- this will keept the old value for
- ;; customize-face in Emacs 21.
- (when (and (memq (plist-get atts :weight)
- '(ultra-bold extra-bold bold semi-bold))
- (not (plist-get atts :bold)))
- (setq atts (cons :bold (cons t atts))))
- (when (and (not (memq (plist-get atts :slant)
- '(normal nil)))
- (not (plist-get atts :italic)))
- (setq atts (cons :italic (cons t atts))))
- atts)
-;; (color-theme-spec-canonical-font (color-theme-face-attr-construct 'bold (selected-frame)))
-;; (defface foo '((t (:weight extra-bold))) "foo")
-;; (color-theme-spec-canonical-font (color-theme-face-attr-construct 'foo (selected-frame)))
-;; (face-spec-set 'foo '((t (:weight extra-bold))) nil)
-;; (face-spec-set 'foo '((t (:bold t))) nil)
-;; (face-spec-set 'foo '((t (:bold t :weight extra-bold))) nil)
-
-;; Handle :height according to NEWS file for Emacs 21
-(defun color-theme-spec-resolve-height (old new)
- "Return the new height given OLD and NEW height.
-OLD is the current setting, NEW is the setting inherited from."
- (cond ((not old)
- new)
- ((integerp old)
- old)
- ((and (floatp old)
- (integerp new))
- (round (* old new)))
- ((and (floatp old)
- (floatp new))
- (* old new))
- ((and (functionp old)
- (integerp new))
- (round (funcall old new)))
- ((and (functionp old)
- (float new))
- `(lambda (f) (* (funcall ,old f) ,new)))
- ((and (functionp old)
- (functionp new))
- `(lambda (f) (* (funcall ,old (funcall ,new f)))))
- (t
- (error "Illegal :height attributes: %S or %S" old new))))
-;; (color-theme-spec-resolve-height 12 1.2)
-;; (color-theme-spec-resolve-height 1.2 1.2)
-;; (color-theme-spec-resolve-height 1.2 12)
-;; (color-theme-spec-resolve-height 1.2 'foo)
-;; (color-theme-spec-resolve-height (lambda (f) (* 2 f)) 5)
-;; (color-theme-spec-resolve-height (lambda (f) (* 2 f)) 2.0)
-;; the following lambda is the result from the above calculation
-;; (color-theme-spec-resolve-height (lambda (f) (* (funcall (lambda (f) (* 2 f)) f) 2.0)) 5)
-
-(defun color-theme-spec-resolve-inheritance (atts)
- "Resolve all occurences of the :inherit attribute."
- (let ((face (plist-get atts :inherit)))
- ;; From the Emacs 21 NEWS file: "Attributes from inherited faces are
- ;; merged into the face like an underlying face would be." --
- ;; therefore properties of the inherited face only add missing
- ;; attributes.
- (when face
- ;; remove :inherit face from atts -- this assumes only one
- ;; :inherit attribute.
- (setq atts (delq ':inherit (delq face atts)))
- (let ((more-atts (color-theme-spec-resolve-inheritance
- (color-theme-face-attr-construct
- face (selected-frame))))
- att val)
- (while more-atts
- (setq att (car more-atts)
- val (cadr more-atts)
- more-atts (cddr more-atts))
- ;; Color-theme assumes that no value is ever 'unspecified.
- (cond ((eq att ':height); cumulative effect!
- (setq atts (plist-put atts
- ':height
- (color-theme-spec-resolve-height
- (plist-get atts att)
- val))))
- ;; Default: Only put if it has not been specified before.
- ((not (plist-get atts att))
- (setq atts (cons att (cons val atts))))
-
-))))
- atts))
-;; (color-theme-spec-resolve-inheritance '(:bold t))
-;; (color-theme-spec-resolve-inheritance '(:bold t :foreground "blue"))
-;; (color-theme-face-attr-construct 'font-lock-comment-face (selected-frame))
-;; (color-theme-spec-resolve-inheritance '(:bold t :inherit font-lock-comment-face))
-;; (color-theme-spec-resolve-inheritance '(:bold t :foreground "red" :inherit font-lock-comment-face))
-;; (color-theme-face-attr-construct 'Info-title-2-face (selected-frame))
-;; (color-theme-face-attr-construct 'Info-title-3-face (selected-frame))
-;; (color-theme-face-attr-construct 'Info-title-4-face (selected-frame))
-;; (color-theme-spec-resolve-inheritance '(:inherit Info-title-2-face))
-
-;; The :inverse-video attribute causes Emacs to swap foreground and
-;; background colors, XEmacs does not. Therefore, if anybody chooses
-;; the inverse-video attribute, we 1. swap the colors ourselves in Emacs
-;; and 2. we remove the inverse-video attribute in Emacs and XEmacs.
-;; Inverse-video is only useful on a monochrome tty.
-(defun color-theme-spec-maybe-invert (atts)
- "Remove the :inverse-video attribute from ATTS.
-If ATTS contains :inverse-video t, remove it and swap foreground and
-background color. Return ATTS."
- (let ((inv (plist-get atts ':inverse-video)))
- (if inv
- (let (result att)
- (while atts
- (setq att (car atts)
- atts (cdr atts))
- (cond ((and (eq att :foreground) (not color-theme-xemacs-p))
- (setq result (cons :background result)))
- ((and (eq att :background) (not color-theme-xemacs-p))
- (setq result (cons :foreground result)))
- ((eq att :inverse-video)
- (setq atts (cdr atts))); this prevents using dolist
- (t
- (setq result (cons att result)))))
- (nreverse result))
- ;; else
- atts)))
-;; (color-theme-spec-maybe-invert '(:bold t))
-;; (color-theme-spec-maybe-invert '(:foreground "blue"))
-;; (color-theme-spec-maybe-invert '(:background "red"))
-;; (color-theme-spec-maybe-invert '(:inverse-video t))
-;; (color-theme-spec-maybe-invert '(:inverse-video t :foreground "red"))
-;; (color-theme-spec-maybe-invert '(:inverse-video t :background "red"))
-;; (color-theme-spec-maybe-invert '(:inverse-video t :background "red" :foreground "blue" :bold t))
-;; (color-theme-spec-maybe-invert '(:inverse-video nil :background "red" :foreground "blue" :bold t))
-
-(defun color-theme-spec (face)
- "Return a list for FACE which has the form (FACE SPEC).
-See `defface' for the format of SPEC. In this case we use only one
-DISPLAY, t, and determine ATTS using `color-theme-face-attr-construct'.
-If ATTS is nil, (nil) is used instead.
-
-If ATTS contains :inverse-video t, we remove it and swap foreground and
-background color using `color-theme-spec-maybe-invert'. We do this
-because :inverse-video is handled differently in Emacs and XEmacs. We
-will loose on a tty without colors, because in that situation,
-:inverse-video means something."
- (let ((atts
- (color-theme-spec-canonical-font
- (color-theme-spec-maybe-invert
- (color-theme-spec-resolve-inheritance
- (color-theme-face-attr-construct face (selected-frame)))))))
- (if atts
- `(,face ((t ,atts)))
- `(,face ((t (nil)))))))
-
-(defun color-theme-get-params ()
- "Return a list of frame parameter settings usable in a color theme.
-Such an alist may be installed by `color-theme-install-frame-params'. The
-frame parameters returned must match `color-theme-legal-frame-parameters'."
- (let ((params (color-theme-filter (frame-parameters (selected-frame))
- color-theme-legal-frame-parameters)))
- (sort params (lambda (a b) (string< (symbol-name (car a))
- (symbol-name (car b)))))))
-
-(defun color-theme-get-vars ()
- "Return a list of variable settings usable in a color theme.
-Such an alist may be installed by `color-theme-install-variables'.
-The variable names must match `color-theme-legal-variables', and the
-variable must be a user variable according to `user-variable-p'."
- (let ((vars)
- (val))
- (mapatoms (lambda (v)
- (and (boundp v)
- (user-variable-p v)
- (string-match color-theme-legal-variables
- (symbol-name v))
- (setq val (eval v))
- (add-to-list 'vars (cons v val)))))
- (sort vars (lambda (a b) (string< (car a) (car b))))))
-
-(defun color-theme-print-alist (alist)
- "Print ALIST."
- (insert "\n " (if alist "(" "nil"))
- (dolist (elem alist)
- (when (= (preceding-char) ?\))
- (insert "\n "))
- (prin1 elem (current-buffer)))
- (when (= (preceding-char) ?\)) (insert ")")))
-
-(defun color-theme-get-faces ()
- "Return a list of faces usable in a color theme.
-Such an alist may be installed by `color-theme-install-faces'. The
-faces returned must not match `color-theme-illegal-faces'."
- (let ((faces (color-theme-filter (face-list) color-theme-illegal-faces t)))
- ;; default face must come first according to comments in
- ;; custom-save-faces, the rest is to be sorted by name
- (cons 'default (sort (delq 'default faces) 'string-lessp))))
-
-(defun color-theme-get-face-definitions ()
- "Return face settings usable in a color-theme."
- (let ((faces (color-theme-get-faces)))
- (mapcar 'color-theme-spec faces)))
-
-(defun color-theme-print-faces (faces)
- "Print face settings for all faces returned by `color-theme-get-faces'."
- (when faces
- (insert "\n "))
- (dolist (face faces)
- (when (= (preceding-char) ?\))
- (insert "\n "))
- (prin1 face (current-buffer))))
-
-(defun color-theme-reset-faces ()
- "Reset face settings for all faces returned by `color-theme-get-faces'."
- (let ((faces (color-theme-get-faces))
- (face) (spec) (entry)
- (frame (if color-theme-is-global nil (selected-frame))))
- (while faces
- (setq entry (color-theme-spec (car faces)))
- (setq face (nth 0 entry))
- (setq spec '((t (nil))))
- (setq faces (cdr faces))
- (if (functionp 'face-spec-reset-face)
- (face-spec-reset-face face frame)
- (face-spec-set face spec frame)
- (if color-theme-is-global
- (put face 'face-defface-spec spec))))))
-
-(defun color-theme-print-theme (func doc params vars faces)
- "Print a theme into the current buffer.
-FUNC is the function name, DOC the doc string, PARAMS the
-frame parameters, VARS the variable bindings, and FACES
-the list of faces and their specs."
- (insert "(defun " (symbol-name func) " ()\n"
- " \"" doc "\"\n"
- " (interactive)\n"
- " (color-theme-install\n"
- " '(" (symbol-name func))
- ;; alist of frame parameters
- (color-theme-print-alist params)
- ;; alist of variables
- (color-theme-print-alist vars)
- ;; remaining elements of snapshot: face specs
- (color-theme-print-faces faces)
- (insert ")))\n")
- (insert "(add-to-list 'color-themes '(" (symbol-name func) " "
- " \"THEME NAME\" \"YOUR NAME\"))")
- (goto-char (point-min)))
-
-;;;###autoload
-(defun color-theme-print (&optional buf)
- "Print the current color theme function.
-
-You can contribute this function to <URL:news:gnu.emacs.sources> or
-paste it into your .emacs file and call it. That should recreate all
-the settings necessary for your color theme.
-
-Example:
-
- \(require 'color-theme)
- \(defun my-color-theme ()
- \"Color theme by Alex Schroeder, created 2000-05-17.\"
- \(interactive)
- \(color-theme-install
- '(...
- ...
- ...)))
- \(my-color-theme)
-
-If you want to use a specific color theme function, you can call the
-color theme function in your .emacs directly.
-
-Example:
-
- \(require 'color-theme)
- \(color-theme-gnome2)"
- (interactive)
- (message "Pretty printing current color theme function...")
- (switch-to-buffer (if buf
- buf
- (get-buffer-create "*Color Theme*")))
- (unless buf
- (setq buffer-read-only nil)
- (erase-buffer))
- ;; insert defun
- (insert "(eval-when-compile"
- " (require 'color-theme))\n")
- (color-theme-print-theme 'my-color-theme
- (concat "Color theme by "
- (if (string= "" user-full-name)
- (user-login-name)
- user-full-name)
- ", created " (format-time-string "%Y-%m-%d") ".")
- (color-theme-get-params)
- (color-theme-get-vars)
- (mapcar 'color-theme-spec (color-theme-get-faces)))
- (unless buf
- (emacs-lisp-mode))
- (goto-char (point-min))
- (message "Pretty printing current color theme function... done"))
-
-(defun color-theme-analyze-find-theme (code)
- "Find the sexpr that calls `color-theme-install'."
- (let (theme)
- (while (and (not theme) code)
- (when (eq (car code) 'color-theme-install)
- (setq theme code))
- (when (listp (car code))
- (setq theme (color-theme-analyze-find-theme (car code))))
- (setq code (cdr code)))
- theme))
-
-;; (equal (color-theme-analyze-find-theme
-;; '(defun color-theme-blue-eshell ()
-;; "Color theme for eshell faces only."
-;; (color-theme-install
-;; '(color-theme-blue-eshell
-;; nil
-;; (eshell-ls-archive-face ((t (:bold t :foreground "IndianRed"))))
-;; (eshell-ls-backup-face ((t (:foreground "Grey"))))))))
-;; '(color-theme-install
-;; (quote
-;; (color-theme-blue-eshell
-;; nil
-;; (eshell-ls-archive-face ((t (:bold t :foreground "IndianRed"))))
-;; (eshell-ls-backup-face ((t (:foreground "Grey")))))))))
-
-(defun color-theme-analyze-add-face (a b regexp faces)
- "If only one of A or B are in FACES, the other is added, and FACES is returned.
-If REGEXP is given, this is only done if faces contains a match for regexps."
- (when (or (not regexp)
- (catch 'found
- (dolist (face faces)
- (when (string-match regexp (symbol-name (car face)))
- (throw 'found t)))))
- (let ((face-a (assoc a faces))
- (face-b (assoc b faces)))
- (if (and face-a (not face-b))
- (setq faces (cons (list b (nth 1 face-a))
- faces))
- (if (and (not face-a) face-b)
- (setq faces (cons (list a (nth 1 face-b))
- faces))))))
- faces)
-
-;; (equal (color-theme-analyze-add-face
-;; 'blue 'violet nil
-;; '((blue ((t (:foreground "blue"))))
-;; (bold ((t (:bold t))))))
-;; '((violet ((t (:foreground "blue"))))
-;; (blue ((t (:foreground "blue"))))
-;; (bold ((t (:bold t))))))
-;; (equal (color-theme-analyze-add-face
-;; 'violet 'blue nil
-;; '((blue ((t (:foreground "blue"))))
-;; (bold ((t (:bold t))))))
-;; '((violet ((t (:foreground "blue"))))
-;; (blue ((t (:foreground "blue"))))
-;; (bold ((t (:bold t))))))
-;; (equal (color-theme-analyze-add-face
-;; 'violet 'blue "foo"
-;; '((blue ((t (:foreground "blue"))))
-;; (bold ((t (:bold t))))))
-;; '((blue ((t (:foreground "blue"))))
-;; (bold ((t (:bold t))))))
-;; (equal (color-theme-analyze-add-face
-;; 'violet 'blue "blue"
-;; '((blue ((t (:foreground "blue"))))
-;; (bold ((t (:bold t))))))
-;; '((violet ((t (:foreground "blue"))))
-;; (blue ((t (:foreground "blue"))))
-;; (bold ((t (:bold t))))))
-
-(defun color-theme-analyze-add-faces (faces)
- "Add missing faces to FACES and return it."
- ;; The most important thing is to add missing faces for the other
- ;; editor. These are the most important faces to check. The
- ;; following rules list two faces, A and B. If either of the two is
- ;; part of the theme, the other must be, too. The optional third
- ;; argument specifies a regexp. Only if an existing face name
- ;; matches this regexp, is the rule applied.
- (let ((rules '((font-lock-builtin-face font-lock-reference-face)
- (font-lock-doc-face font-lock-doc-string-face)
- (font-lock-constant-face font-lock-preprocessor-face)
- ;; In Emacs 21 `modeline' is just an alias for
- ;; `mode-line'. I recommend the use of
- ;; `modeline' until further notice.
- (modeline mode-line)
- (modeline modeline-buffer-id)
- (modeline modeline-mousable)
- (modeline modeline-mousable-minor-mode)
- (region primary-selection)
- (region zmacs-region)
- (font-lock-string-face dired-face-boring "^dired")
- (font-lock-function-name-face dired-face-directory "^dired")
- (default dired-face-executable "^dired")
- (font-lock-warning-face dired-face-flagged "^dired")
- (font-lock-warning-face dired-face-marked "^dired")
- (default dired-face-permissions "^dired")
- (default dired-face-setuid "^dired")
- (default dired-face-socket "^dired")
- (font-lock-keyword-face dired-face-symlink "^dired")
- (tool-bar menu))))
- (dolist (rule rules)
- (setq faces (color-theme-analyze-add-face
- (nth 0 rule) (nth 1 rule) (nth 2 rule) faces))))
- ;; The `fringe' face defines what the left and right borders of the
- ;; frame look like in Emacs 21. To give them default fore- and
- ;; background colors, use (fringe ((t (nil)))) in your color theme.
- ;; Usually it makes more sense to choose a color slightly lighter or
- ;; darker from the default background.
- (unless (assoc 'fringe faces)
- (setq faces (cons '(fringe ((t (nil)))) faces)))
- ;; The tool-bar should not be part of the frame-parameters, since it
- ;; should not appear or disappear depending on the color theme. The
- ;; apppearance of the toolbar, however, can be changed by the color
- ;; theme. For Emacs 21, use the `tool-bar' face. The easiest way
- ;; to do this is to give it the default fore- and background colors.
- ;; This can be achieved using (tool-bar ((t (nil)))) in the theme.
- ;; Usually it makes more sense, however, to provide the same colors
- ;; as used in the `menu' face, and to specify a :box attribute. In
- ;; order to alleviate potential Emacs/XEmacs incompatibilities,
- ;; `toolbar' will be defined as an alias for `tool-bar' if it does
- ;; not exist, and vice-versa. This is done eventhough the face
- ;; `toolbar' seems to have no effect on XEmacs. If you look at
- ;; XEmacs lisp/faces.el, however, you will find that it is in fact
- ;; referenced for XPM stuff.
- (unless (assoc 'tool-bar faces)
- (setq faces (cons '(tool-bar ((t (nil)))) faces)))
- ;; Move the default face back to the front, and sort the rest.
- (unless (eq (caar faces) 'default)
- (let ((face (assoc 'default faces)))
- (setq faces (cons face
- (sort (delete face faces)
- (lambda (a b)
- (string-lessp (car a) (car b))))))))
- faces)
-
-(defun color-theme-analyze-remove-heights (faces)
- "Remove :height property where it is an integer and return FACES."
- ;; I don't recommend making font sizes part of a color theme. Most
- ;; users would be surprised to see their font sizes change when they
- ;; install a color-theme. Therefore, remove all :height attributes
- ;; if the value is an integer. If the value is a float, this is ok
- ;; -- the value is relative to the default height. One notable
- ;; exceptions is for a color-theme created for visually impaired
- ;; people. These *must* use a larger font in order to be usable.
- (let (result)
- (dolist (face faces)
- (let ((props (cadar (nth 1 face))))
- (if (and (plist-member props :height)
- (integerp (plist-get props :height)))
- (setq props (color-theme-plist-delete props :height)
- result (cons (list (car face) `((t ,props)))
- result))
- (setq result (cons face result)))))
- (nreverse result)))
-
-;; (equal (color-theme-analyze-remove-heights
-;; '((blue ((t (:foreground "blue" :height 2))))
-;; (bold ((t (:bold t :height 1.0))))))
-;; '((blue ((t (:foreground "blue"))))
-;; (bold ((t (:bold t :height 1.0))))))
-
-;;;###autoload
-(defun color-theme-analyze-defun ()
- "Once you have a color-theme printed, check for missing faces.
-This is used by maintainers who receive a color-theme submission
-and want to make sure it follows the guidelines by the color-theme
-author."
- ;; The support for :foreground and :background attributes works for
- ;; Emacs 20 and 21 as well as for XEmacs. :inverse-video is taken
- ;; care of while printing color themes.
- (interactive)
- ;; Parse the stuff and find the call to color-theme-install
- (save-excursion
- (save-restriction
- (narrow-to-defun)
- ;; define the function
- (eval-defun nil)
- (goto-char (point-min))
- (let* ((code (read (current-buffer)))
- (theme (color-theme-canonic
- (eval
- (cadr
- (color-theme-analyze-find-theme
- code)))))
- (func (color-theme-function theme))
- (doc (documentation func t))
- (variables (color-theme-variables theme))
- (faces (color-theme-faces theme))
- (params (color-theme-frame-params theme)))
- (setq faces (color-theme-analyze-remove-heights
- (color-theme-analyze-add-faces faces)))
- ;; Remove any variable bindings of faces that point to their
- ;; symbol? Perhaps not, because another theme might want to
- ;; change this, so it is important to be able to reset them.
- ;; (let (result)
- ;; (dolist (var variables)
- ;; (unless (eq (car var) (cdr var))
- ;; (setq result (cons var result))))
- ;; (setq variables (nreverse result)))
- ;; Now modify the theme directly.
- (setq theme (color-theme-analyze-find-theme code))
- (setcdr (cadadr theme) (list params variables faces))
- (message "Pretty printing analysed color theme function...")
- (with-current-buffer (get-buffer-create "*Color Theme*")
- (setq buffer-read-only nil)
- (erase-buffer)
- ;; insert defun
- (color-theme-print-theme func doc params variables faces)
- (emacs-lisp-mode))
- (message "Pretty printing analysed color theme function... done")
- (ediff-buffers (current-buffer)
- (get-buffer "*Color Theme*"))))))
-
-;;; Creating a snapshot of the current color theme
-
-(defun color-theme-snapshot nil)
-
-;;;###autoload
-(defun color-theme-make-snapshot ()
- "Return the definition of the current color-theme.
-The function returned will recreate the color-theme in use at the moment."
- (eval `(lambda ()
- "The color theme in use when the selection buffer was created.
-\\[color-theme-select] creates the color theme selection buffer. At the
-same time, this snapshot is created as a very simple undo mechanism.
-The snapshot is created via `color-theme-snapshot'."
- (interactive)
- (color-theme-install
- '(color-theme-snapshot
- ;; alist of frame parameters
- ,(color-theme-get-params)
- ;; alist of variables
- ,(color-theme-get-vars)
- ;; remaining elements of snapshot: face specs
- ,@(color-theme-get-face-definitions))))))
-
-
-
-;;; Handling the various parts of a color theme install
-
-(defvar color-theme-frame-param-frobbing-rules
- '((foreground-color default foreground)
- (background-color default background))
- "List of rules to use when frobbing faces based on frame parameters.
-This is only necessary for XEmacs, because in Emacs 21 changing the
-frame paramters automatically affects the relevant faces.")
-
-;; fixme: silent the bytecompiler with set-face-property
-(defun color-theme-frob-faces (params)
- "Change certain faces according to PARAMS.
-This uses `color-theme-frame-param-frobbing-rules'."
- (dolist (rule color-theme-frame-param-frobbing-rules)
- (let* ((param (nth 0 rule))
- (face (nth 1 rule))
- (prop (nth 2 rule))
- (val (cdr (assq param params)))
- (frame (if color-theme-is-global nil (selected-frame))))
- (when val
- (set-face-property face prop val frame)))))
-
-(defun color-theme-alist-reduce (old-list)
- "Reduce OLD-LIST.
-The resulting list will be newly allocated and will not contain any elements
-with duplicate cars. This will speed the installation of new themes by
-only installing unique attributes."
- (let (new-list)
- (dolist (elem old-list)
- (when (not (assq (car elem) new-list))
- (setq new-list (cons elem new-list))))
- new-list))
-
-(defun color-theme-install-frame-params (params)
- "Change frame parameters using alist PARAMETERS.
-
-If `color-theme-is-global' is non-nil, all frames are modified using
-`modify-frame-parameters' and the PARAMETERS are prepended to
-`default-frame-alist'. The value of `initial-frame-alist' is not
-modified. If `color-theme-is-global' is nil, only the selected frame is
-modified. If `color-theme-is-cumulative' is nil, the frame parameters
-are restored from `color-theme-original-frame-alist'.
-
-If the current frame parameters have a parameter `minibuffer' with
-value `only', then the frame parameters are not installed, since this
-indicates a dedicated minibuffer frame.
-
-Called from `color-theme-install'."
- (setq params (color-theme-filter
- params color-theme-legal-frame-parameters))
- ;; We have a new list in params now, therefore we may use
- ;; destructive nconc.
- (if color-theme-is-global
- (let ((frames (frame-list)))
- (if (or color-theme-is-cumulative
- (null color-theme-original-frame-alist))
- (setq default-frame-alist
- (append params (color-theme-alist default-frame-alist))
- minibuffer-frame-alist
- (append params (color-theme-alist minibuffer-frame-alist)))
- (setq default-frame-alist
- (append params color-theme-original-frame-alist)
- minibuffer-frame-alist
- (append params (color-theme-alist minibuffer-frame-alist))))
- (setq default-frame-alist
- (color-theme-alist-reduce default-frame-alist)
- minibuffer-frame-alist
- (color-theme-alist-reduce minibuffer-frame-alist))
- (dolist (frame frames)
- (let ((params (if (eq 'only (cdr (assq 'minibuffer (frame-parameters frame))))
- minibuffer-frame-alist
- default-frame-alist)))
- (condition-case var
- (modify-frame-parameters frame params)
- (error (message "Error using params %S: %S" params var))))))
- (condition-case var
- (modify-frame-parameters (selected-frame) params)
- (error (message "Error using params %S: %S" params var))))
- (when color-theme-xemacs-p
- (color-theme-frob-faces params)))
-
-;; (setq default-frame-alist (cons '(height . 30) default-frame-alist))
-
-(defun color-theme-install-variables (vars)
- "Change variables using alist VARS.
-All variables matching `color-theme-legal-variables' are set.
-
-If `color-theme-is-global' and `color-theme-xemacs-p' are nil, variables
-are made frame-local before setting them. Variables are set using `set'
-in either case. This may lead to problems if changing the variable
-requires the usage of the function specified with the :set tag in
-defcustom declarations.
-
-Called from `color-theme-install'."
- (let ((vars (color-theme-filter vars color-theme-legal-variables)))
- (dolist (var vars)
- (if (or color-theme-is-global color-theme-xemacs-p)
- (set (car var) (cdr var))
- (make-variable-frame-local (car var))
- (modify-frame-parameters (selected-frame) (list var))))))
-
-(defun color-theme-install-faces (faces)
- "Change faces using FACES.
-
-Change faces for all frames and create any faces listed in FACES which
-don't exist. The modified faces will be marked as \"unchanged from
-its standard setting\". This is OK, since the changes made by
-installing a color theme should never by saved in .emacs by
-customization code.
-
-FACES should be a list where each entry has the form:
-
- (FACE SPEC)
-
-See `defface' for the format of SPEC.
-
-If `color-theme-is-global' is non-nil, faces are modified on all frames
-using `face-spec-set'. If `color-theme-is-global' is nil, faces are
-only modified on the selected frame. Non-existing faces are created
-using `make-empty-face' in either case. If `color-theme-is-cumulative'
-is nil, all faces are reset before installing the new faces.
-
-Called from `color-theme-install'."
- ;; clear all previous faces
- (when (not color-theme-is-cumulative)
- (color-theme-reset-faces))
- ;; install new faces
- (let ((faces (color-theme-filter faces color-theme-illegal-faces t))
- (frame (if color-theme-is-global nil (selected-frame))))
- (dolist (entry faces)
- (let ((face (nth 0 entry))
- (spec (nth 1 entry)))
- (or (facep face)
- (make-empty-face face))
- ;; remove weird properties from the default face only
- (when (eq face 'default)
- (setq spec (color-theme-spec-filter spec)))
- ;; Emacs/XEmacs customization issues: filter out :bold when
- ;; the spec contains :weight, etc, such that the spec remains
- ;; "valid" for custom.
- (setq spec (color-theme-spec-compat spec))
- ;; using a spec of ((t (nil))) to reset a face doesn't work
- ;; in Emacs 21, we use the new function face-spec-reset-face
- ;; instead
- (if (and (functionp 'face-spec-reset-face)
- (equal spec '((t (nil)))))
- (face-spec-reset-face face frame)
- (condition-case var
- (progn
- (face-spec-set face spec frame)
- (if color-theme-is-global
- (put face 'face-defface-spec spec)))
- (error (message "Error using spec %S: %S" spec var))))))))
-
-;; `custom-set-faces' is unusable here because it doesn't allow to set
-;; the faces for one frame only.
-
-;; Emacs `face-spec-set': If FRAME is nil, the face is created and
-;; marked as a customized face. This is achieved by setting the
-;; `face-defface-spec' property. If we don't, new frames will not be
-;; created using the face we installed because `face-spec-set' is
-;; broken: If given a FRAME of nil, it will not set the default faces;
-;; instead it will walk through all the frames and set modify the faces.
-;; If we do set a property (`saved-face' or `face-defface-spec'),
-;; `make-frame' will correctly use the faces we defined with our color
-;; theme. If we used the property `saved-face',
-;; `customize-save-customized' will save all the faces installed as part
-;; of a color-theme in .emacs. That's why we use the
-;; `face-defface-spec' property.
-
-
-
-;;; Theme accessor functions, canonicalization, merging, comparing
-
-(defun color-theme-canonic (theme)
- "Return the canonic form of THEME.
-This deals with all the backwards compatibility stuff."
- (let (function frame-params variables faces)
- (when (functionp (car theme))
- (setq function (car theme)
- theme (cdr theme)))
- (setq frame-params (car theme)
- theme (cdr theme))
- ;; optional variable defintions (for backwards compatibility)
- (when (listp (caar theme))
- (setq variables (car theme)
- theme (cdr theme)))
- ;; face definitions
- (setq faces theme)
- (list function frame-params variables faces)))
-
-(defun color-theme-function (theme)
- "Return function used to create THEME."
- (nth 0 theme))
-
-(defun color-theme-frame-params (theme)
- "Return frame-parameters defined by THEME."
- (nth 1 theme))
-
-(defun color-theme-variables (theme)
- "Return variables set by THEME."
- (nth 2 theme))
-
-(defun color-theme-faces (theme)
- "Return faces defined by THEME."
- (nth 3 theme))
-
-(defun color-theme-merge-alists (&rest alists)
- "Merges all the alist arguments into one alist.
-Only the first instance of every key will be part of the resulting
-alist. Membership will be tested using `assq'."
- (let (result)
- (dolist (l alists)
- (dolist (entry l)
- (unless (assq (car entry) result)
- (setq result (cons entry result)))))
- (nreverse result)))
-;; (color-theme-merge-alists '((a . 1) (b . 2)))
-;; (color-theme-merge-alists '((a . 1) (b . 2) (a . 3)))
-;; (color-theme-merge-alists '((a . 1) (b . 2)) '((a . 3)))
-;; (color-theme-merge-alists '((a . 1) (b . 2)) '((c . 3)))
-;; (color-theme-merge-alists '((a . 1) (b . 2)) '((c . 3) (d . 4)))
-;; (color-theme-merge-alists '((a . 1) (b . 2)) '((c . 3) (d . 4) (b . 5)))
-
-;;;###autoload
-(defun color-theme-compare (theme-a theme-b)
- "Compare two color themes.
-This will print the differences between installing THEME-A and
-installing THEME-B. Note that the order is important: If a face is
-defined in THEME-A and not in THEME-B, then this will not show up as a
-difference, because there is no reset before installing THEME-B. If a
-face is defined in THEME-B and not in THEME-A, then this will show up as
-a difference."
- (interactive
- (list
- (intern
- (completing-read "Theme A: "
- (mapcar (lambda (i) (list (symbol-name (car i))))
- color-themes)
- (lambda (i) (string-match "color-theme" (car i)))))
- (intern
- (completing-read "Theme B: "
- (mapcar (lambda (i) (list (symbol-name (car i))))
- color-themes)
- (lambda (i) (string-match "color-theme" (car i)))))))
- ;; install the themes in a new frame and get the definitions
- (let ((color-theme-is-global nil))
- (select-frame (make-frame))
- (funcall theme-a)
- (setq theme-a (list theme-a
- (color-theme-get-params)
- (color-theme-get-vars)
- (color-theme-get-face-definitions)))
- (funcall theme-b)
- (setq theme-b (list theme-b
- (color-theme-get-params)
- (color-theme-get-vars)
- (color-theme-get-face-definitions)))
- (delete-frame))
- (let ((params (set-difference
- (color-theme-frame-params theme-b)
- (color-theme-frame-params theme-a)
- :test 'equal))
- (vars (set-difference
- (color-theme-variables theme-b)
- (color-theme-variables theme-a)
- :test 'equal))
- (faces (set-difference
- (color-theme-faces theme-b)
- (color-theme-faces theme-a)
- :test 'equal)))
- (list 'diff
- params
- vars
- faces)))
-
-
-
-;;; Installing a color theme
-;;;###autoload
-(defun color-theme-install (theme)
- "Install a color theme defined by frame parameters, variables and faces.
-
-The theme is installed for all present and future frames; any missing
-faces are created. See `color-theme-install-faces'.
-
-THEME is a color theme definition. See below for more information.
-
-If you want to install a color theme from your .emacs, use the output
-generated by `color-theme-print'. This produces color theme function
-which you can copy to your .emacs.
-
-A color theme definition is a list:
-\([FUNCTION] FRAME-PARAMETERS VARIABLE-SETTINGS FACE-DEFINITIONS)
-
-FUNCTION is the color theme function which called `color-theme-install'.
-This is no longer used. There was a time when this package supported
-automatic factoring of color themes. This has been abandoned.
-
-FRAME-PARAMETERS is an alist of frame parameters. These are installed
-with `color-theme-install-frame-params'. These are installed last such
-that any changes to the default face can be changed by the frame
-parameters.
-
-VARIABLE-DEFINITIONS is an alist of variable settings. These are
-installed with `color-theme-install-variables'.
-
-FACE-DEFINITIONS is an alist of face definitions. These are installed
-with `color-theme-install-faces'.
-
-If `color-theme-is-cumulative' is nil, a color theme will undo face and
-frame-parameter settings of previous color themes."
- (setq theme (color-theme-canonic theme))
- (color-theme-install-variables (color-theme-variables theme))
- (color-theme-install-faces (color-theme-faces theme))
- ;; frame parameters override faces
- (color-theme-install-frame-params (color-theme-frame-params theme))
- (when color-theme-history-max-length
- (color-theme-add-to-history
- (car theme))))
-
-
-
-;; Sharing your stuff
-;;;###autoload
-(defun color-theme-submit ()
- "Submit your color-theme to the maintainer."
- (interactive)
- (require 'reporter)
- (let ((reporter-eval-buffer (current-buffer))
- final-resting-place
- after-sep-pos
- (reporter-status-message "Formatting buffer...")
- (reporter-status-count 0)
- (problem "Yet another color-theme")
- (agent (reporter-compose-outgoing))
- (mailbuf (current-buffer))
- hookvar)
- ;; do the work
- (require 'sendmail)
- ;; If mailbuf did not get made visible before, make it visible now.
- (let (same-window-buffer-names same-window-regexps)
- (pop-to-buffer mailbuf)
- ;; Just in case the original buffer is not visible now, bring it
- ;; back somewhere
- (and pop-up-windows (display-buffer reporter-eval-buffer)))
- (goto-char (point-min))
- (mail-position-on-field "to")
- (insert color-theme-maintainer-address)
- (mail-position-on-field "subject")
- (insert problem)
- ;; move point to the body of the message
- (mail-text)
- (setq after-sep-pos (point))
- (unwind-protect
- (progn
- (setq final-resting-place (point-marker))
- (goto-char final-resting-place))
- (color-theme-print (current-buffer))
- (goto-char final-resting-place)
- (insert "\n\n")
- (goto-char final-resting-place)
- (insert "Hello there!\n\nHere's my color theme named: ")
- (set-marker final-resting-place nil))
- ;; compose the minibuf message and display this.
- (let* ((sendkey-whereis (where-is-internal
- (get agent 'sendfunc) nil t))
- (abortkey-whereis (where-is-internal
- (get agent 'abortfunc) nil t))
- (sendkey (if sendkey-whereis
- (key-description sendkey-whereis)
- "C-c C-c")); TBD: BOGUS hardcode
- (abortkey (if abortkey-whereis
- (key-description abortkey-whereis)
- "M-x kill-buffer"))); TBD: BOGUS hardcode
- (message "Enter a message and type %s to send or %s to abort."
- sendkey abortkey))))
-
-
-
-;; Use this to define themes
-(defmacro define-color-theme (name author description &rest forms)
- (let ((n name))
- `(progn
- (add-to-list 'color-themes
- (list ',n
- (upcase-initials
- (replace-in-string
- (replace-in-string
- (symbol-name ',n) "^color-theme-" "") "-" " "))
- ,author))
- (defun ,n ()
- ,description
- (interactive)
- ,@forms))))
-
-
-;;; FIXME: is this useful ??
-;;;###autoload
-(defun color-theme-initialize ()
- "Initialize the color theme package by loading color-theme-libraries."
- (interactive)
-
- (cond ((and (not color-theme-load-all-themes)
- color-theme-directory)
- (setq color-theme-libraries
- (directory-files color-theme-directory t "^color-theme")))
- (color-theme-directory
- (push (cdr (directory-files color-theme-directory t "^color-theme"))
- color-theme-libraries)))
- (dolist (library color-theme-libraries)
- (load library)))
-
-(when nil
- (setq color-theme-directory "themes/"
- color-theme-load-all-themes nil)
- (color-theme-initialize)
-)
-;; TODO: I don't like all those function names cluttering up my namespace.
-;; Instead, a hashtable for the color-themes should be created. Now that
-;; define-color-theme is around, it should be easy to change in just the
-;; one place.
-
-
-(provide 'color-theme)
-
-;;; color-theme.el ends here
diff --git a/.emacs.d/color-theme-6.6.0/color-theme.elc b/.emacs.d/color-theme-6.6.0/color-theme.elc
deleted file mode 100644
index bff6d81..0000000
--- a/.emacs.d/color-theme-6.6.0/color-theme.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/color-theme-6.6.0/configure-stamp b/.emacs.d/color-theme-6.6.0/configure-stamp
deleted file mode 100644
index e69de29..0000000
--- a/.emacs.d/color-theme-6.6.0/configure-stamp
+++ /dev/null
diff --git a/.emacs.d/color-theme-6.6.0/themes/color-theme-example.el b/.emacs.d/color-theme-6.6.0/themes/color-theme-example.el
deleted file mode 100644
index f73b4f6..0000000
--- a/.emacs.d/color-theme-6.6.0/themes/color-theme-example.el
+++ /dev/null
@@ -1,22 +0,0 @@
-(eval-when-compile
- (require 'color-theme))
-
-(defun color-theme-example ()
- "Example theme. Carbon copy of color-theme-gnome contributed by Jonadab."
- (interactive)
- (color-theme-install
- '(color-theme-example
- ((foreground-color . "wheat")
- (background-color . "darkslategrey")
- (background-mode . dark))
- (default ((t (nil))))
- (region ((t (:foreground "cyan" :background "dark cyan"))))
- (underline ((t (:foreground "yellow" :underline t))))
- (modeline ((t (:foreground "dark cyan" :background "wheat"))))
- (modeline-buffer-id ((t (:foreground "dark cyan" :background "wheat"))))
- (modeline-mousable ((t (:foreground "dark cyan" :background "wheat"))))
- (modeline-mousable-minor-mode ((t (:foreground "dark cyan" :background "wheat"))))
- (italic ((t (:foreground "dark red" :italic t))))
- (bold-italic ((t (:foreground "dark red" :bold t :italic t))))
- (font-lock-comment-face ((t (:foreground "Firebrick"))))
- (bold ((t (:bold)))))))
diff --git a/.emacs.d/color-theme-6.6.0/themes/color-theme-library.el b/.emacs.d/color-theme-6.6.0/themes/color-theme-library.el
deleted file mode 100644
index d194708..0000000
--- a/.emacs.d/color-theme-6.6.0/themes/color-theme-library.el
+++ /dev/null
@@ -1,13539 +0,0 @@
-;;; color-theme-library.el --- The real color theme functions
-
-;; Copyright (C) 2005, 2006 Xavier Maillard <zedek@gnu.org>
-;; Copyright (C) 2005, 2006 Brian Palmer <bpalmer@gmail.com>
-
-;; Version: 0.0.9
-;; Keywords: faces
-;; Author: Brian Palmer, Xavier Maillard
-;; Maintainer: Xavier Maillard <zedek@gnu.org>
-;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ColorTheme
-
-;; This file is not (YET) part of GNU Emacs.
-
-;; This is free software; you can redistribute it and/or modify it under
-;; the terms of the GNU General Public License as published by the Free
-;; Software Foundation; either version 2, or (at your option) any later
-;; version.
-;;
-;; This is distributed in the hope that it will be useful, but WITHOUT
-;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-;; for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-;; MA 02111-1307, USA.
-
-;; Code:
-(eval-when-compile
- (require 'color-theme))
-
-(defun color-theme-gnome ()
- "Wheat on darkslategrey scheme.
-From one version of Emacs in RH6 and Gnome, modified by Jonadab."
- (interactive)
- (color-theme-install
- '(color-theme-gnome
- ((foreground-color . "wheat")
- (background-color . "darkslategrey")
- (background-mode . dark))
- (default ((t (nil))))
- (region ((t (:foreground "cyan" :background "dark cyan"))))
- (underline ((t (:foreground "yellow" :underline t))))
- (modeline ((t (:foreground "dark cyan" :background "wheat"))))
- (modeline-buffer-id ((t (:foreground "dark cyan" :background "wheat"))))
- (modeline-mousable ((t (:foreground "dark cyan" :background "wheat"))))
- (modeline-mousable-minor-mode ((t (:foreground "dark cyan" :background "wheat"))))
- (italic ((t (:foreground "dark red" :italic t))))
- (bold-italic ((t (:foreground "dark red" :bold t :italic t))))
- (font-lock-comment-face ((t (:foreground "Firebrick"))))
- (bold ((t (:bold)))))))
-
-(defun color-theme-blue-gnus ()
- "Color theme for gnus and message faces only.
-This is intended for other color themes to use (eg. `color-theme-gnome2'
-and `color-theme-blue-sea')."
- (interactive)
- (color-theme-install
- '(color-theme-blue-gnus
- nil
- (gnus-cite-attribution-face ((t (:lforeground "lemon chiffon" :bold t))))
- (gnus-cite-face-1 ((t (:foreground "LightSalmon"))))
- (gnus-cite-face-2 ((t (:foreground "Khaki"))))
- (gnus-cite-face-3 ((t (:foreground "Coral"))))
- (gnus-cite-face-4 ((t (:foreground "yellow green"))))
- (gnus-cite-face-5 ((t (:foreground "dark khaki"))))
- (gnus-cite-face-6 ((t (:foreground "bisque"))))
- (gnus-cite-face-7 ((t (:foreground "peru"))))
- (gnus-cite-face-8 ((t (:foreground "light coral"))))
- (gnus-cite-face-9 ((t (:foreground "plum"))))
- (gnus-emphasis-bold ((t (:bold t))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t))))
- (gnus-emphasis-highlight-words ((t (:background "black" :foreground "yellow"))))
- (gnus-emphasis-italic ((t (:italic t))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:bold t :underline t))))
- (gnus-emphasis-underline-bold-italic ((t (:italic t :bold t :underline t))))
- (gnus-emphasis-underline-italic ((t (:italic t :underline t))))
- (gnus-group-mail-1-empty-face ((t (:foreground "White"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "White"))))
- (gnus-group-mail-2-empty-face ((t (:foreground "light cyan"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "light cyan"))))
- (gnus-group-mail-3-empty-face ((t (:foreground "LightBlue"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "LightBlue"))))
- (gnus-group-mail-low-empty-face ((t (:foreground "Aquamarine"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "Aquamarine"))))
- (gnus-group-news-1-empty-face ((t (:foreground "White"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "White"))))
- (gnus-group-news-2-empty-face ((t (:foreground "light cyan"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "light cyan"))))
- (gnus-group-news-3-empty-face ((t (:foreground "LightBlue"))))
- (gnus-group-news-3-face ((t (:bold t :foreground "LightBlue"))))
- (gnus-group-news-4-empty-face ((t (:foreground "Aquamarine"))))
- (gnus-group-news-4-face ((t (:bold t :foreground "Aquamarine"))))
- (gnus-group-news-5-empty-face ((t (:foreground "MediumAquamarine"))))
- (gnus-group-news-5-face ((t (:bold t :foreground "MediumAquamarine"))))
- (gnus-group-news-6-empty-face ((t (:foreground "MediumAquamarine"))))
- (gnus-group-news-6-face ((t (:bold t :foreground "MediumAquamarine"))))
- (gnus-group-news-low-empty-face ((t (:foreground "MediumAquamarine"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "MediumAquamarine"))))
- (gnus-header-content-face ((t (:foreground "LightSkyBlue3"))))
- (gnus-header-from-face ((t (:bold t :foreground "light cyan"))))
- (gnus-header-name-face ((t (:bold t :foreground "LightBlue"))))
- (gnus-header-newsgroups-face ((t (:bold t :foreground "MediumAquamarine"))))
- (gnus-header-subject-face ((t (:bold t :foreground "light cyan"))))
- (gnus-signature-face ((t (:foreground "Grey"))))
- (gnus-splash-face ((t (:foreground "ForestGreen"))))
- (gnus-summary-cancelled-face ((t (:background "Black" :foreground "Yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "MediumAquamarine"))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "Aquamarine"))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "LightSalmon"))))
- (gnus-summary-high-unread-face ((t (:bold t :foreground "beige"))))
- (gnus-summary-low-ancient-face ((t (:foreground "DimGray"))))
- (gnus-summary-low-read-face ((t (:foreground "slate gray"))))
- (gnus-summary-low-ticked-face ((t (:foreground "Pink"))))
- (gnus-summary-low-unread-face ((t (:foreground "LightGray"))))
- (gnus-summary-normal-ancient-face ((t (:foreground "MediumAquamarine"))))
- (gnus-summary-normal-read-face ((t (:foreground "Aquamarine"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "LightSalmon"))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-selected-face ((t (:background "DarkSlateBlue"))))
- (message-cited-text-face ((t (:foreground "LightSalmon"))))
- (message-header-cc-face ((t (:foreground "light cyan"))))
- (message-header-name-face ((t (:foreground "LightBlue"))))
- (message-header-newsgroups-face ((t (:bold t :foreground "MediumAquamarine"))))
- (message-header-other-face ((t (:foreground "MediumAquamarine"))))
- (message-header-subject-face ((t (:bold t :foreground "light cyan"))))
- (message-header-to-face ((t (:bold t :foreground "light cyan"))))
- (message-header-xheader-face ((t (:foreground "MediumAquamarine"))))
- (message-separator-face ((t (:foreground "chocolate")))))))
-
-(defun color-theme-dark-gnus ()
- "Color theme for gnus and message faces only.
-This is intended for other color themes to use
-\(eg. `color-theme-late-night')."
- (interactive)
- (color-theme-install
- '(color-theme-blue-gnus
- nil
- (gnus-cite-attribution-face ((t (:foreground "#bbb"))))
- (gnus-cite-face-1 ((t (:foreground "#aaa"))))
- (gnus-cite-face-2 ((t (:foreground "#aaa"))))
- (gnus-cite-face-3 ((t (:foreground "#aaa"))))
- (gnus-cite-face-4 ((t (:foreground "#aaa"))))
- (gnus-cite-face-5 ((t (:foreground "#aaa"))))
- (gnus-cite-face-6 ((t (:foreground "#aaa"))))
- (gnus-cite-face-7 ((t (:foreground "#aaa"))))
- (gnus-cite-face-8 ((t (:foreground "#aaa"))))
- (gnus-cite-face-9 ((t (:foreground "#aaa"))))
- (gnus-emphasis-bold ((t (:bold t))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t))))
- (gnus-emphasis-highlight-words ((t (:foreground "#ccc"))))
- (gnus-emphasis-italic ((t (:italic t))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:bold t :underline t))))
- (gnus-emphasis-underline-bold-italic ((t (:italic t :bold t :underline t))))
- (gnus-emphasis-underline-italic ((t (:italic t :underline t))))
- (gnus-group-mail-1-empty-face ((t (:foreground "#999"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "#999"))))
- (gnus-group-mail-2-empty-face ((t (:foreground "#999"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "#999"))))
- (gnus-group-mail-3-empty-face ((t (:foreground "#888"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "#888"))))
- (gnus-group-mail-low-empty-face ((t (:foreground "#777"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "#777"))))
- (gnus-group-news-1-empty-face ((t (:foreground "#999"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "#999"))))
- (gnus-group-news-2-empty-face ((t (:foreground "#888"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "#888"))))
- (gnus-group-news-3-empty-face ((t (:foreground "#777"))))
- (gnus-group-news-3-face ((t (:bold t :foreground "#777"))))
- (gnus-group-news-4-empty-face ((t (:foreground "#666"))))
- (gnus-group-news-4-face ((t (:bold t :foreground "#666"))))
- (gnus-group-news-5-empty-face ((t (:foreground "#666"))))
- (gnus-group-news-5-face ((t (:bold t :foreground "#666"))))
- (gnus-group-news-6-empty-face ((t (:foreground "#666"))))
- (gnus-group-news-6-face ((t (:bold t :foreground "#666"))))
- (gnus-group-news-low-empty-face ((t (:foreground "#666"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "#666"))))
- (gnus-header-content-face ((t (:foreground "#888"))))
- (gnus-header-from-face ((t (:bold t :foreground "#888"))))
- (gnus-header-name-face ((t (:bold t :foreground "#777"))))
- (gnus-header-newsgroups-face ((t (:bold t :foreground "#777"))))
- (gnus-header-subject-face ((t (:bold t :foreground "#999"))))
- (gnus-signature-face ((t (:foreground "#444"))))
- (gnus-splash-face ((t (:foreground "#ccc"))))
- (gnus-summary-cancelled-face ((t (:background "#555" :foreground "#000"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "#555"))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "#666"))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "#777"))))
- (gnus-summary-high-unread-face ((t (:bold t :foreground "#888"))))
- (gnus-summary-low-ancient-face ((t (:foreground "#444"))))
- (gnus-summary-low-read-face ((t (:foreground "#555"))))
- (gnus-summary-low-ticked-face ((t (:foreground "#666"))))
- (gnus-summary-low-unread-face ((t (:foreground "#777"))))
- (gnus-summary-normal-ancient-face ((t (:foreground "#555"))))
- (gnus-summary-normal-read-face ((t (:foreground "#666"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "#777"))))
- (gnus-summary-normal-unread-face ((t (:foreground "#888"))))
- (gnus-summary-selected-face ((t (:background "#333"))))
- (message-cited-text-face ((t (:foreground "#aaa"))))
- (message-header-cc-face ((t (:foreground "#888"))))
- (message-header-name-face ((t (:bold t :foreground "#777"))))
- (message-header-newsgroups-face ((t (:bold t :foreground "#777"))))
- (message-header-other-face ((t (:foreground "#666"))))
- (message-header-subject-face ((t (:bold t :foreground "#999"))))
- (message-header-to-face ((t (:bold t :foreground "#777"))))
- (message-header-xheader-face ((t (:foreground "#666"))))
- (message-separator-face ((t (:foreground "#999")))))))
-
-(defun color-theme-blue-eshell ()
- "Color theme for eshell faces only.
-This is intended for other color themes to use (eg. `color-theme-gnome2')."
- (interactive)
- (color-theme-install
- '(color-theme-blue-eshell
- nil
- (eshell-ls-archive-face ((t (:bold t :foreground "IndianRed"))))
- (eshell-ls-backup-face ((t (:foreground "Grey"))))
- (eshell-ls-clutter-face ((t (:foreground "DimGray"))))
- (eshell-ls-directory-face ((t (:bold t :foreground "MediumSlateBlue"))))
- (eshell-ls-executable-face ((t (:foreground "Coral"))))
- (eshell-ls-missing-face ((t (:foreground "black"))))
- (eshell-ls-picture-face ((t (:foreground "Violet")))) ; non-standard face
- (eshell-ls-product-face ((t (:foreground "LightSalmon"))))
- (eshell-ls-readonly-face ((t (:foreground "Aquamarine"))))
- (eshell-ls-special-face ((t (:foreground "Gold"))))
- (eshell-ls-symlink-face ((t (:foreground "White"))))
- (eshell-ls-text-face ((t (:foreground "medium aquamarine")))) ; non-standard face
- (eshell-ls-todo-face ((t (:bold t :foreground "aquamarine")))) ; non-standard face
- (eshell-ls-unreadable-face ((t (:foreground "DimGray"))))
- (eshell-prompt-face ((t (:foreground "powder blue")))))))
-
-(defun color-theme-salmon-font-lock ()
- "Color theme for font-lock faces only.
-This is intended for other color themes to use (eg. `color-theme-gnome2')."
- (interactive)
- (color-theme-install
- '(color-theme-salmon-font-lock
- nil
- (font-lock-builtin-face ((t (:bold t :foreground "PaleGreen"))))
- (font-lock-comment-face ((t (:foreground "LightBlue"))))
- (font-lock-constant-face ((t (:foreground "Aquamarine"))))
- (font-lock-doc-string-face ((t (:foreground "LightSalmon"))))
- (font-lock-function-name-face ((t (:bold t :foreground "Aquamarine"))))
- (font-lock-keyword-face ((t (:foreground "Salmon"))))
- (font-lock-preprocessor-face ((t (:foreground "Salmon"))))
- (font-lock-reference-face ((t (:foreground "pale green"))))
- (font-lock-string-face ((t (:foreground "LightSalmon"))))
- (font-lock-type-face ((t (:bold t :foreground "YellowGreen"))))
- (font-lock-variable-name-face ((t (:bold t :foreground "Aquamarine"))))
- (font-lock-warning-face ((t (:bold t :foreground "red")))))))
-
-(defun color-theme-dark-font-lock ()
- "Color theme for font-lock faces only.
-This is intended for other color themes to use (eg. `color-theme-late-night')."
- (interactive)
- (color-theme-install
- '(color-theme-dark-font-lock
- nil
- (font-lock-builtin-face ((t (:bold t :foreground "#777"))))
- (font-lock-comment-face ((t (:foreground "#555"))))
- (font-lock-constant-face ((t (:foreground "#777"))))
- (font-lock-doc-string-face ((t (:foreground "#777"))))
- (font-lock-doc-face ((t (:foreground "#777"))))
- (font-lock-function-name-face ((t (:bold t :foreground "#777"))))
- (font-lock-keyword-face ((t (:foreground "#777"))))
- (font-lock-preprocessor-face ((t (:foreground "#777"))))
- (font-lock-reference-face ((t (:foreground "#777"))))
- (font-lock-string-face ((t (:foreground "#777"))))
- (font-lock-type-face ((t (:bold t))))
- (font-lock-variable-name-face ((t (:bold t :foreground "#888"))))
- (font-lock-warning-face ((t (:bold t :foreground "#999")))))))
-
-(defun color-theme-dark-info ()
- "Color theme for info, help and apropos faces.
-This is intended for other color themes to use (eg. `color-theme-late-night')."
- (interactive)
- (color-theme-install
- '(color-theme-dark-info
- nil
- (info-header-node ((t (:foreground "#666"))))
- (info-header-xref ((t (:foreground "#666"))))
- (info-menu-5 ((t (:underline t))))
- (info-menu-header ((t (:bold t :foreground "#666"))))
- (info-node ((t (:bold t :foreground "#888"))))
- (info-xref ((t (:bold t :foreground "#777")))))))
-
-(defun color-theme-gnome2 ()
- "Wheat on darkslategrey scheme.
-`color-theme-gnome' started it all.
-
-This theme supports standard faces, font-lock, eshell, info, message,
-gnus, custom, widget, woman, diary, cperl, bbdb, and erc. This theme
-includes faces for Emacs and XEmacs.
-
-The theme does not support w3 faces because w3 faces can be controlled
-by your default style sheet.
-
-This is what you should put in your .Xdefaults file, if you want to
-change the colors of the menus in Emacs 20 as well:
-
-emacs*Background: DarkSlateGray
-emacs*Foreground: Wheat"
- (interactive)
- (color-theme-blue-gnus)
- (let ((color-theme-is-cumulative t))
- (color-theme-blue-erc)
- (color-theme-blue-eshell)
- (color-theme-salmon-font-lock)
- (color-theme-salmon-diff)
- (color-theme-install
- '(color-theme-gnome2
- ((foreground-color . "wheat")
- (background-color . "darkslategrey")
- (mouse-color . "Grey")
- (cursor-color . "LightGray")
- (border-color . "black")
- (background-mode . dark))
- ((apropos-keybinding-face . underline)
- (apropos-label-face . italic)
- (apropos-match-face . secondary-selection)
- (apropos-property-face . bold-italic)
- (apropos-symbol-face . info-xref)
- (goto-address-mail-face . message-header-to-face)
- (goto-address-mail-mouse-face . secondary-selection)
- (goto-address-url-face . info-xref)
- (goto-address-url-mouse-face . highlight)
- (list-matching-lines-face . bold)
- (view-highlight-face . highlight))
- (default ((t (nil))))
- (bbdb-company ((t (:foreground "pale green"))))
- (bbdb-name ((t (:bold t :foreground "pale green"))))
- (bbdb-field-name ((t (:foreground "medium sea green"))))
- (bbdb-field-value ((t (:foreground "dark sea green"))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:italic t :bold t :foreground "beige"))))
- (calendar-today-face ((t (:underline t))))
- (comint-highlight-prompt ((t (:foreground "medium aquamarine"))))
- (cperl-array-face ((t (:foreground "Yellow"))))
- (cperl-hash-face ((t (:foreground "White"))))
- (cperl-nonoverridable-face ((t (:foreground "SkyBlue"))))
- (custom-button-face ((t (:underline t :foreground "MediumSlateBlue"))))
- (custom-documentation-face ((t (:foreground "Grey"))))
- (custom-group-tag-face ((t (:foreground "MediumAquamarine"))))
- (custom-state-face ((t (:foreground "LightSalmon"))))
- (custom-variable-tag-face ((t (:foreground "Aquamarine"))))
- (diary-face ((t (:foreground "IndianRed"))))
- (dired-face-directory ((t (:bold t :foreground "sky blue"))))
- (dired-face-permissions ((t (:foreground "aquamarine"))))
- (dired-face-flagged ((t (:foreground "tomato"))))
- (dired-face-marked ((t (:foreground "light salmon"))))
- (dired-face-executable ((t (:foreground "green yellow"))))
- (fringe ((t (:background "darkslategrey"))))
- (highlight ((t (:background "PaleGreen" :foreground "DarkGreen"))))
- (highline-face ((t (:background "SeaGreen"))))
- (holiday-face ((t (:background "DimGray"))))
- (hyper-apropos-hyperlink ((t (:bold t :foreground "DodgerBlue1"))))
- (hyper-apropos-documentation ((t (:foreground "LightSalmon"))))
- (info-header-xref ((t (:foreground "DodgerBlue1" :bold t))))
- (info-menu-5 ((t (:underline t))))
- (info-node ((t (:underline t :bold t :foreground "DodgerBlue1"))))
- (info-xref ((t (:bold t :foreground "DodgerBlue1"))))
- (isearch ((t (:background "sea green"))))
- (italic ((t (:italic t))))
- (menu ((t (:foreground "wheat" :background "darkslategrey"))))
- (modeline ((t (:background "dark olive green" :foreground "wheat"))))
- (modeline-buffer-id ((t (:background "dark olive green" :foreground "beige"))))
- (modeline-mousable ((t (:background "dark olive green" :foreground "yellow green"))))
- (modeline-mousable-minor-mode ((t (:background "dark olive green" :foreground "wheat"))))
- (region ((t (:background "dark cyan" :foreground "cyan"))))
- (secondary-selection ((t (:background "Aquamarine" :foreground "SlateBlue"))))
- (show-paren-match-face ((t (:bold t :background "Aquamarine" :foreground "steel blue"))))
- (show-paren-mismatch-face ((t (:background "Red" :foreground "White"))))
- (underline ((t (:underline t))))
- (widget-field-face ((t (:foreground "LightBlue"))))
- (widget-inactive-face ((t (:foreground "DimGray"))))
- (widget-single-line-field-face ((t (:foreground "LightBlue"))))
- (w3m-anchor-face ((t (:bold t :foreground "DodgerBlue1"))))
- (w3m-arrived-anchor-face ((t (:bold t :foreground "DodgerBlue3"))))
- (w3m-header-line-location-title-face ((t (:foreground "beige" :background "dark olive green"))))
- (w3m-header-line-location-content-face ((t (:foreground "wheat" :background "dark olive green"))))
- (woman-bold-face ((t (:bold t))))
- (woman-italic-face ((t (:foreground "beige"))))
- (woman-unknown-face ((t (:foreground "LightSalmon"))))
- (zmacs-region ((t (:background "dark cyan" :foreground "cyan"))))))))
-
-(defun color-theme-simple-1 ()
- "Black background.
-Doesn't mess with most faces, but does turn on dark background mode."
- (interactive)
- (color-theme-install
- '(color-theme-simple-1
- ((foreground-color . "white")
- (background-color . "black")
- (cursor-color . "indian red")
- (background-mode . dark))
- (default ((t (nil))))
- (modeline ((t (:foreground "black" :background "white"))))
- (modeline-buffer-id ((t (:foreground "black" :background "white"))))
- (modeline-mousable ((t (:foreground "black" :background "white"))))
- (modeline-mousable-minor-mode ((t (:foreground "black" :background "white"))))
- (underline ((t (:underline t))))
- (region ((t (:background "grey")))))))
-
-(defun color-theme-jonadabian ()
- "Dark blue background.
-Supports standard faces, font-lock, highlight-changes, widget and
-custom."
- (interactive)
- (color-theme-install
- '(color-theme-jonadabian
- ((foreground-color . "#CCBB77")
- (cursor-color . "medium turquoise")
- (background-color . "#000055")
- (background-mode . dark))
- (default ((t (nil))))
- (modeline ((t (:foreground "cyan" :background "#007080"))))
- (modeline-buffer-id ((t (:foreground "cyan" :background "#007080"))))
- (modeline-mousable ((t (:foreground "cyan" :background "#007080"))))
- (modeline-mousable-minor-mode ((t (:foreground "cyan" :background "#007080"))))
- (underline ((t (:underline t))))
- (region ((t (:background "#004080"))))
- (font-lock-keyword-face ((t (:foreground "#00BBBB"))))
- (font-lock-comment-face ((t (:foreground "grey50" :bold t :italic t))))
- (font-lock-string-face ((t (:foreground "#10D010"))))
- (font-lock-constant-face ((t (:foreground "indian red"))))
- (highlight-changes-face ((t (:background "navy"))))
- (highlight-changes-delete-face ((t (:foreground "red" :background "navy"))))
- (widget-field-face ((t (:foreground "black" :background "grey35"))))
- (widget-inactive-face ((t (:foreground "gray"))))
- (custom-button-face ((t (:foreground "yellow" :background "dark blue"))))
- (custom-state-face ((t (:foreground "mediumaquamarine"))))
- (custom-face-tag-face ((t (:foreground "goldenrod" :underline t))))
- (custom-documentation-face ((t (:foreground "#10D010"))))
- (custom-set-face ((t (:foreground "#2020D0")))))))
-
-(defun color-theme-ryerson ()
- "White on midnightblue scheme.
-Used at Ryerson Polytechnic University in the Electronic Engineering department."
- (interactive)
- (color-theme-install
- '(color-theme-ryerson
- ((foreground-color . "white")
- (background-color . "midnightblue")
- (cursor-color . "red")
- (background-mode . dark))
- (default ((t (nil))))
- (modeline ((t (:foreground "black" :background "slategray3"))))
- (modeline-buffer-id ((t (:foreground "black" :background "slategray3"))))
- (modeline-mousable ((t (:foreground "black" :background "slategray3"))))
- (modeline-mousable-minor-mode ((t (:foreground "black" :background "slategray3"))))
- (underline ((t (:underline t))))
- (region ((t (:foreground "black" :background "slategray3")))))))
-
-(defun color-theme-wheat ()
- "Default colors on a wheat background.
-Calls the standard color theme function `color-theme-standard' in order
-to reset all faces."
- (interactive)
- (color-theme-standard)
- (let ((color-theme-is-cumulative t))
- (color-theme-install
- '(color-theme-wheat
- ((background-color . "Wheat"))))))
-
-(defun color-theme-standard ()
- "Emacs default colors.
-If you are missing standard faces in this theme, please notify the maintainer."
- (interactive)
- ;; Note that some of the things that make up a color theme are
- ;; actually variable settings!
- (color-theme-install
- '(color-theme-standard
- ((foreground-color . "black")
- (background-color . "white")
- (mouse-color . "black")
- (cursor-color . "black")
- (border-color . "black")
- (background-mode . light))
- ((Man-overstrike-face . bold)
- (Man-underline-face . underline)
- (apropos-keybinding-face . underline)
- (apropos-label-face . italic)
- (apropos-match-face . secondary-selection)
- (apropos-property-face . bold-italic)
- (apropos-symbol-face . bold)
- (goto-address-mail-face . italic)
- (goto-address-mail-mouse-face . secondary-selection)
- (goto-address-url-face . bold)
- (goto-address-url-mouse-face . highlight)
- (help-highlight-face . underline)
- (list-matching-lines-face . bold)
- (view-highlight-face . highlight))
- (default ((t (nil))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:bold t :italic t))))
- (calendar-today-face ((t (:underline t))))
- (cperl-array-face ((t (:foreground "Blue" :background "lightyellow2" :bold t))))
- (cperl-hash-face ((t (:foreground "Red" :background "lightyellow2" :bold t :italic t))))
- (cperl-nonoverridable-face ((t (:foreground "chartreuse3"))))
- (custom-button-face ((t (nil))))
- (custom-changed-face ((t (:foreground "white" :background "blue"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:underline t))))
- (custom-group-tag-face ((t (:foreground "blue" :underline t))))
- (custom-group-tag-face-1 ((t (:foreground "red" :underline t))))
- (custom-invalid-face ((t (:foreground "yellow" :background "red"))))
- (custom-modified-face ((t (:foreground "white" :background "blue"))))
- (custom-rogue-face ((t (:foreground "pink" :background "black"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:foreground "blue" :background "white"))))
- (custom-state-face ((t (:foreground "dark green"))))
- (custom-variable-button-face ((t (:bold t :underline t))))
- (custom-variable-tag-face ((t (:foreground "blue" :underline t))))
- (diary-face ((t (:foreground "red"))))
- (ediff-current-diff-face-A ((t (:foreground "firebrick" :background "pale green"))))
- (ediff-current-diff-face-Ancestor ((t (:foreground "Black" :background "VioletRed"))))
- (ediff-current-diff-face-B ((t (:foreground "DarkOrchid" :background "Yellow"))))
- (ediff-current-diff-face-C ((t (:foreground "Navy" :background "Pink"))))
- (ediff-even-diff-face-A ((t (:foreground "Black" :background "light grey"))))
- (ediff-even-diff-face-Ancestor ((t (:foreground "White" :background "Grey"))))
- (ediff-even-diff-face-B ((t (:foreground "White" :background "Grey"))))
- (ediff-even-diff-face-C ((t (:foreground "Black" :background "light grey"))))
- (ediff-fine-diff-face-A ((t (:foreground "Navy" :background "sky blue"))))
- (ediff-fine-diff-face-Ancestor ((t (:foreground "Black" :background "Green"))))
- (ediff-fine-diff-face-B ((t (:foreground "Black" :background "cyan"))))
- (ediff-fine-diff-face-C ((t (:foreground "Black" :background "Turquoise"))))
- (ediff-odd-diff-face-A ((t (:foreground "White" :background "Grey"))))
- (ediff-odd-diff-face-Ancestor ((t (:foreground "Black" :background "light grey"))))
- (ediff-odd-diff-face-B ((t (:foreground "Black" :background "light grey"))))
- (ediff-odd-diff-face-C ((t (:foreground "White" :background "Grey"))))
- (eshell-ls-archive-face ((t (:foreground "Orchid" :bold t))))
- (eshell-ls-backup-face ((t (:foreground "OrangeRed"))))
- (eshell-ls-clutter-face ((t (:foreground "OrangeRed" :bold t))))
- (eshell-ls-directory-face ((t (:foreground "Blue" :bold t))))
- (eshell-ls-executable-face ((t (:foreground "ForestGreen" :bold t))))
- (eshell-ls-missing-face ((t (:foreground "Red" :bold t))))
- (eshell-ls-product-face ((t (:foreground "OrangeRed"))))
- (eshell-ls-readonly-face ((t (:foreground "Brown"))))
- (eshell-ls-special-face ((t (:foreground "Magenta" :bold t))))
- (eshell-ls-symlink-face ((t (:foreground "DarkCyan" :bold t))))
- (eshell-ls-unreadable-face ((t (:foreground "Grey30"))))
- (eshell-prompt-face ((t (:foreground "Red" :bold t))))
- (eshell-test-failed-face ((t (:foreground "OrangeRed" :bold t))))
- (eshell-test-ok-face ((t (:foreground "Green" :bold t))))
- (excerpt ((t (:italic t))))
- (fixed ((t (:bold t))))
- (flyspell-duplicate-face ((t (:foreground "Gold3" :bold t :underline t))))
- (flyspell-incorrect-face ((t (:foreground "OrangeRed" :bold t :underline t))))
- (font-lock-builtin-face ((t (:foreground "Orchid"))))
- (font-lock-comment-face ((t (:foreground "Firebrick"))))
- (font-lock-constant-face ((t (:foreground "CadetBlue"))))
- (font-lock-function-name-face ((t (:foreground "Blue"))))
- (font-lock-keyword-face ((t (:foreground "Purple"))))
- (font-lock-string-face ((t (:foreground "RosyBrown"))))
- (font-lock-type-face ((t (:foreground "ForestGreen"))))
- (font-lock-variable-name-face ((t (:foreground "DarkGoldenrod"))))
- (font-lock-warning-face ((t (:foreground "Red" :bold t))))
- (fringe ((t (:background "grey95"))))
- (gnus-cite-attribution-face ((t (:italic t))))
- (gnus-cite-face-1 ((t (:foreground "MidnightBlue"))))
- (gnus-cite-face-10 ((t (:foreground "medium purple"))))
- (gnus-cite-face-11 ((t (:foreground "turquoise"))))
- (gnus-cite-face-2 ((t (:foreground "firebrick"))))
- (gnus-cite-face-3 ((t (:foreground "dark green"))))
- (gnus-cite-face-4 ((t (:foreground "OrangeRed"))))
- (gnus-cite-face-5 ((t (:foreground "dark khaki"))))
- (gnus-cite-face-6 ((t (:foreground "dark violet"))))
- (gnus-cite-face-7 ((t (:foreground "SteelBlue4"))))
- (gnus-cite-face-8 ((t (:foreground "magenta"))))
- (gnus-cite-face-9 ((t (:foreground "violet"))))
- (gnus-emphasis-bold ((t (:bold t))))
- (gnus-emphasis-bold-italic ((t (:bold t :italic t))))
- (gnus-emphasis-italic ((t (:italic t))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:bold t :underline t))))
- (gnus-emphasis-underline-bold-italic ((t (:bold t :italic t :underline t))))
- (gnus-emphasis-underline-italic ((t (:italic t :underline t))))
- (gnus-group-mail-1-empty-face ((t (:foreground "DeepPink3"))))
- (gnus-group-mail-1-face ((t (:foreground "DeepPink3" :bold t))))
- (gnus-group-mail-2-empty-face ((t (:foreground "HotPink3"))))
- (gnus-group-mail-2-face ((t (:foreground "HotPink3" :bold t))))
- (gnus-group-mail-3-empty-face ((t (:foreground "magenta4"))))
- (gnus-group-mail-3-face ((t (:foreground "magenta4" :bold t))))
- (gnus-group-mail-low-empty-face ((t (:foreground "DeepPink4"))))
- (gnus-group-mail-low-face ((t (:foreground "DeepPink4" :bold t))))
- (gnus-group-news-1-empty-face ((t (:foreground "ForestGreen"))))
- (gnus-group-news-1-face ((t (:foreground "ForestGreen" :bold t))))
- (gnus-group-news-2-empty-face ((t (:foreground "CadetBlue4"))))
- (gnus-group-news-2-face ((t (:foreground "CadetBlue4" :bold t))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (:bold t))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkGreen"))))
- (gnus-group-news-low-face ((t (:foreground "DarkGreen" :bold t))))
- (gnus-header-content-face ((t (:foreground "indianred4" :italic t))))
- (gnus-header-from-face ((t (:foreground "red3"))))
- (gnus-header-name-face ((t (:foreground "maroon"))))
- (gnus-header-newsgroups-face ((t (:foreground "MidnightBlue" :italic t))))
- (gnus-header-subject-face ((t (:foreground "red4"))))
- (gnus-signature-face ((t (:italic t))))
- (gnus-splash-face ((t (:foreground "ForestGreen"))))
- (gnus-summary-cancelled-face ((t (:foreground "yellow" :background "black"))))
- (gnus-summary-high-ancient-face ((t (:foreground "RoyalBlue" :bold t))))
- (gnus-summary-high-read-face ((t (:foreground "DarkGreen" :bold t))))
- (gnus-summary-high-ticked-face ((t (:foreground "firebrick" :bold t))))
- (gnus-summary-high-unread-face ((t (:bold t))))
- (gnus-summary-low-ancient-face ((t (:foreground "RoyalBlue" :italic t))))
- (gnus-summary-low-read-face ((t (:foreground "DarkGreen" :italic t))))
- (gnus-summary-low-ticked-face ((t (:foreground "firebrick" :italic t))))
- (gnus-summary-low-unread-face ((t (:italic t))))
- (gnus-summary-normal-ancient-face ((t (:foreground "RoyalBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "DarkGreen"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "firebrick"))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-selected-face ((t (:underline t))))
- (highlight ((t (:background "darkseagreen2"))))
- (highlight-changes-delete-face ((t (:foreground "red" :underline t))))
- (highlight-changes-face ((t (:foreground "red"))))
- (highline-face ((t (:background "paleturquoise"))))
- (holiday-face ((t (:background "pink"))))
- (info-menu-5 ((t (:underline t))))
- (info-node ((t (:bold t :italic t))))
- (info-xref ((t (:bold t))))
- (italic ((t (:italic t))))
- (makefile-space-face ((t (:background "hotpink"))))
- (message-cited-text-face ((t (:foreground "red"))))
- (message-header-cc-face ((t (:foreground "MidnightBlue"))))
- (message-header-name-face ((t (:foreground "cornflower blue"))))
- (message-header-newsgroups-face ((t (:foreground "blue4" :bold t :italic t))))
- (message-header-other-face ((t (:foreground "steel blue"))))
- (message-header-subject-face ((t (:foreground "navy blue" :bold t))))
- (message-header-to-face ((t (:foreground "MidnightBlue" :bold t))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-separator-face ((t (:foreground "brown"))))
- (modeline ((t (:foreground "white" :background "black"))))
- (modeline-buffer-id ((t (:foreground "white" :background "black"))))
- (modeline-mousable ((t (:foreground "white" :background "black"))))
- (modeline-mousable-minor-mode ((t (:foreground "white" :background "black"))))
- (region ((t (:background "gray"))))
- (secondary-selection ((t (:background "paleturquoise"))))
- (show-paren-match-face ((t (:background "turquoise"))))
- (show-paren-mismatch-face ((t (:foreground "white" :background "purple"))))
- (speedbar-button-face ((t (:foreground "green4"))))
- (speedbar-directory-face ((t (:foreground "blue4"))))
- (speedbar-file-face ((t (:foreground "cyan4"))))
- (speedbar-highlight-face ((t (:background "green"))))
- (speedbar-selected-face ((t (:foreground "red" :underline t))))
- (speedbar-tag-face ((t (:foreground "brown"))))
- (term-black ((t (:foreground "black"))))
- (term-blackbg ((t (:background "black"))))
- (term-blue ((t (:foreground "blue"))))
- (term-bluebg ((t (:background "blue"))))
- (term-bold ((t (:bold t))))
- (term-cyan ((t (:foreground "cyan"))))
- (term-cyanbg ((t (:background "cyan"))))
- (term-default-bg ((t (nil))))
- (term-default-bg-inv ((t (nil))))
- (term-default-fg ((t (nil))))
- (term-default-fg-inv ((t (nil))))
- (term-green ((t (:foreground "green"))))
- (term-greenbg ((t (:background "green"))))
- (term-invisible ((t (nil))))
- (term-invisible-inv ((t (nil))))
- (term-magenta ((t (:foreground "magenta"))))
- (term-magentabg ((t (:background "magenta"))))
- (term-red ((t (:foreground "red"))))
- (term-redbg ((t (:background "red"))))
- (term-underline ((t (:underline t))))
- (term-white ((t (:foreground "white"))))
- (term-whitebg ((t (:background "white"))))
- (term-yellow ((t (:foreground "yellow"))))
- (term-yellowbg ((t (:background "yellow"))))
- (underline ((t (:underline t))))
- (vcursor ((t (:foreground "blue" :background "cyan" :underline t))))
- (vhdl-font-lock-attribute-face ((t (:foreground "Orchid"))))
- (vhdl-font-lock-directive-face ((t (:foreground "CadetBlue"))))
- (vhdl-font-lock-enumvalue-face ((t (:foreground "Gold4"))))
- (vhdl-font-lock-function-face ((t (:foreground "Orchid4"))))
- (vhdl-font-lock-prompt-face ((t (:foreground "Red" :bold t))))
- (vhdl-font-lock-reserved-words-face ((t (:foreground "Orange" :bold t))))
- (vhdl-font-lock-translate-off-face ((t (:background "LightGray"))))
- (vhdl-speedbar-architecture-face ((t (:foreground "Blue"))))
- (vhdl-speedbar-architecture-selected-face ((t (:foreground "Blue" :underline t))))
- (vhdl-speedbar-configuration-face ((t (:foreground "DarkGoldenrod"))))
- (vhdl-speedbar-configuration-selected-face ((t (:foreground "DarkGoldenrod" :underline t))))
- (vhdl-speedbar-entity-face ((t (:foreground "ForestGreen"))))
- (vhdl-speedbar-entity-selected-face ((t (:foreground "ForestGreen" :underline t))))
- (vhdl-speedbar-instantiation-face ((t (:foreground "Brown"))))
- (vhdl-speedbar-instantiation-selected-face ((t (:foreground "Brown" :underline t))))
- (vhdl-speedbar-package-face ((t (:foreground "Grey50"))))
- (vhdl-speedbar-package-selected-face ((t (:foreground "Grey50" :underline t))))
- (viper-minibuffer-emacs-face ((t (:foreground "Black" :background "darkseagreen2"))))
- (viper-minibuffer-insert-face ((t (:foreground "Black" :background "pink"))))
- (viper-minibuffer-vi-face ((t (:foreground "DarkGreen" :background "grey"))))
- (viper-replace-overlay-face ((t (:foreground "Black" :background "darkseagreen2"))))
- (viper-search-face ((t (:foreground "Black" :background "khaki"))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (widget-single-line-field-face ((t (:background "gray85")))))))
-
-(defun color-theme-fischmeister ()
- "The light colors on a grey blackground.
-Sebastian Fischmeister <sfischme@nexus.lzk.tuwien.ac.at>"
- (interactive)
- (color-theme-install
- '(color-theme-fischmeister
- ((foreground-color . "black")
- (background-color . "gray80")
- (mouse-color . "red")
- (cursor-color . "yellow")
- (border-color . "black")
- (background-mode . light))
- (default ((t (nil))))
- (modeline ((t (:foreground "gray80" :background "black"))))
- (modeline-buffer-id ((t (:foreground "gray80" :background "black"))))
- (modeline-mousable ((t (:foreground "gray80" :background "black"))))
- (modeline-mousable-minor-mode ((t (:foreground "gray80" :background "black"))))
- (highlight ((t (:background "darkseagreen2"))))
- (bold ((t (:bold t))))
- (italic ((t (:italic t))))
- (bold-italic ((t (:bold t :italic t))))
- (region ((t (:background "gray"))))
- (secondary-selection ((t (:background "paleturquoise"))))
- (underline ((t (:underline t))))
- (show-paren-match-face ((t (:foreground "yellow" :background "darkgreen"))))
- (show-paren-mismatch-face ((t (:foreground "white" :background "red"))))
- (font-lock-comment-face ((t (:foreground "FireBrick" :bold t :italic t))))
- (font-lock-string-face ((t (:foreground "DarkSlateBlue" :italic t))))
- (font-lock-keyword-face ((t (:foreground "navy"))))
- (font-lock-builtin-face ((t (:foreground "white"))))
- (font-lock-function-name-face ((t (:foreground "Blue"))))
- (font-lock-variable-name-face ((t (:foreground "Darkblue"))))
- (font-lock-type-face ((t (:foreground "darkgreen"))))
- (font-lock-constant-face ((t (:foreground "CadetBlue"))))
- (font-lock-warning-face ((t (:foreground "Orchid" :bold t))))
- (font-lock-reference-face ((t (:foreground "SteelBlue")))))))
-
-(defun color-theme-sitaramv-solaris ()
- "White on a midnight blue background. Lots of yellow and orange.
-Includes faces for font-lock, widget, custom, speedbar, message, gnus,
-eshell."
- (interactive)
- (color-theme-install
- '(color-theme-sitaramv-solaris
- ((foreground-color . "white")
- (background-color . "MidnightBlue")
- (mouse-color . "yellow")
- (cursor-color . "magenta2")
- (border-color . "black")
- (background-mode . dark))
- (default ((t (nil))))
- (modeline ((t (:foreground "black" :background "gold2"))))
- (modeline-buffer-id ((t (:foreground "black" :background "gold2"))))
- (modeline-mousable ((t (:foreground "black" :background "gold2"))))
- (modeline-mousable-minor-mode ((t (:foreground "black" :background "gold2"))))
- (highlight ((t (:foreground "black" :background "Aquamarine"))))
- (bold ((t (:bold t))))
- (italic ((t (:italic t))))
- (bold-italic ((t (:bold t :italic t))))
- (region ((t (:foreground "black" :background "snow3"))))
- (secondary-selection ((t (:foreground "black" :background "aquamarine"))))
- (underline ((t (:underline t))))
- (lazy-highlight-face ((t (:foreground "yellow"))))
- (font-lock-comment-face ((t (:foreground "orange" :italic t))))
- (font-lock-string-face ((t (:foreground "orange"))))
- (font-lock-keyword-face ((t (:foreground "green"))))
- (font-lock-builtin-face ((t (:foreground "LightSteelBlue"))))
- (font-lock-function-name-face ((t (:foreground "cyan" :bold t))))
- (font-lock-variable-name-face ((t (:foreground "white"))))
- (font-lock-type-face ((t (:foreground "cyan"))))
- (font-lock-constant-face ((t (:foreground "Aquamarine"))))
- (font-lock-warning-face ((t (:foreground "Pink" :bold t))))
- (widget-documentation-face ((t (:foreground "lime green"))))
- (widget-button-face ((t (:bold t))))
- (widget-field-face ((t (:background "dim gray"))))
- (widget-single-line-field-face ((t (:background "dim gray"))))
- (widget-inactive-face ((t (:foreground "light gray"))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (custom-invalid-face ((t (:foreground "yellow" :background "red"))))
- (custom-rogue-face ((t (:foreground "pink" :background "black"))))
- (custom-modified-face ((t (:foreground "white" :background "blue"))))
- (custom-set-face ((t (:foreground "blue" :background "white"))))
- (custom-changed-face ((t (:foreground "white" :background "blue"))))
- (custom-saved-face ((t (:underline t))))
- (custom-button-face ((t (nil))))
- (custom-documentation-face ((t (nil))))
- (custom-state-face ((t (:foreground "lime green"))))
- (custom-variable-tag-face ((t (:foreground "light blue" :underline t))))
- (custom-variable-button-face ((t (:bold t :underline t))))
- (custom-face-tag-face ((t (:underline t))))
- (custom-group-tag-face-1 ((t (:foreground "pink" :underline t))))
- (custom-group-tag-face ((t (:foreground "light blue" :underline t))))
- (speedbar-button-face ((t (:foreground "green3"))))
- (speedbar-file-face ((t (:foreground "cyan"))))
- (speedbar-directory-face ((t (:foreground "light blue"))))
- (speedbar-tag-face ((t (:foreground "yellow"))))
- (speedbar-selected-face ((t (:foreground "red" :underline t))))
- (speedbar-highlight-face ((t (:background "sea green"))))
- (font-lock-doc-string-face ((t (:foreground "Plum1" :bold t))))
- (font-lock-exit-face ((t (:foreground "green"))))
- (ff-paths-non-existant-file-face ((t (:foreground "NavyBlue" :bold t))))
- (show-paren-match-face ((t (:background "red"))))
- (show-paren-mismatch-face ((t (:foreground "white" :background "purple"))))
- (message-header-to-face ((t (:foreground "green2" :bold t))))
- (message-header-cc-face ((t (:foreground "LightGoldenrod" :bold t))))
- (message-header-subject-face ((t (:foreground "green3"))))
- (message-header-newsgroups-face ((t (:foreground "yellow" :bold t :italic t))))
- (message-header-other-face ((t (:foreground "Salmon"))))
- (message-header-name-face ((t (:foreground "green3"))))
- (message-header-xheader-face ((t (:foreground "GreenYellow"))))
- (message-separator-face ((t (:foreground "Tan"))))
- (message-cited-text-face ((t (:foreground "Gold"))))
- (message-mml-face ((t (:foreground "ForestGreen"))))
- (gnus-group-news-1-face ((t (:foreground "PaleTurquoise" :bold t))))
- (gnus-group-news-1-empty-face ((t (:foreground "PaleTurquoise"))))
- (gnus-group-news-2-face ((t (:foreground "turquoise" :bold t))))
- (gnus-group-news-2-empty-face ((t (:foreground "turquoise"))))
- (gnus-group-news-3-face ((t (:bold t))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (:bold t))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (:bold t))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (:bold t))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-low-face ((t (:foreground "DarkTurquoise" :bold t))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkTurquoise"))))
- (gnus-group-mail-1-face ((t (:foreground "aquamarine1" :bold t))))
- (gnus-group-mail-1-empty-face ((t (:foreground "aquamarine1"))))
- (gnus-group-mail-2-face ((t (:foreground "aquamarine2" :bold t))))
- (gnus-group-mail-2-empty-face ((t (:foreground "aquamarine2"))))
- (gnus-group-mail-3-face ((t (:foreground "aquamarine3" :bold t))))
- (gnus-group-mail-3-empty-face ((t (:foreground "aquamarine3"))))
- (gnus-group-mail-low-face ((t (:foreground "aquamarine4" :bold t))))
- (gnus-group-mail-low-empty-face ((t (:foreground "aquamarine4"))))
- (gnus-summary-selected-face ((t (:underline t))))
- (gnus-summary-cancelled-face ((t (:foreground "yellow" :background "black"))))
- (gnus-summary-high-ticked-face ((t (:foreground "pink" :bold t))))
- (gnus-summary-low-ticked-face ((t (:foreground "pink" :italic t))))
- (gnus-summary-normal-ticked-face ((t (:foreground "pink"))))
- (gnus-summary-high-ancient-face ((t (:foreground "SkyBlue" :bold t))))
- (gnus-summary-low-ancient-face ((t (:foreground "SkyBlue" :italic t))))
- (gnus-summary-normal-ancient-face ((t (:foreground "SkyBlue"))))
- (gnus-summary-high-unread-face ((t (:bold t))))
- (gnus-summary-low-unread-face ((t (:italic t))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-high-read-face ((t (:foreground "PaleGreen" :bold t))))
- (gnus-summary-low-read-face ((t (:foreground "PaleGreen" :italic t))))
- (gnus-summary-normal-read-face ((t (:foreground "PaleGreen"))))
- (gnus-splash-face ((t (:foreground "Brown"))))
- (eshell-ls-directory-face ((t (:foreground "SkyBlue" :bold t))))
- (eshell-ls-symlink-face ((t (:foreground "Cyan" :bold t))))
- (eshell-ls-executable-face ((t (:foreground "Green" :bold t))))
- (eshell-ls-readonly-face ((t (:foreground "Pink"))))
- (eshell-ls-unreadable-face ((t (:foreground "DarkGrey"))))
- (eshell-ls-special-face ((t (:foreground "Magenta" :bold t))))
- (eshell-ls-missing-face ((t (:foreground "Red" :bold t))))
- (eshell-ls-archive-face ((t (:foreground "Orchid" :bold t))))
- (eshell-ls-backup-face ((t (:foreground "LightSalmon"))))
- (eshell-ls-product-face ((t (:foreground "LightSalmon"))))
- (eshell-ls-clutter-face ((t (:foreground "OrangeRed" :bold t))))
- (eshell-prompt-face ((t (:foreground "Pink" :bold t))))
- (term-default-fg ((t (nil))))
- (term-default-bg ((t (nil))))
- (term-default-fg-inv ((t (nil))))
- (term-default-bg-inv ((t (nil))))
- (term-bold ((t (:bold t))))
- (term-underline ((t (:underline t))))
- (term-invisible ((t (nil))))
- (term-invisible-inv ((t (nil))))
- (term-black ((t (:foreground "black"))))
- (term-red ((t (:foreground "red"))))
- (term-green ((t (:foreground "green"))))
- (term-yellow ((t (:foreground "yellow"))))
- (term-blue ((t (:foreground "blue"))))
- (term-magenta ((t (:foreground "magenta"))))
- (term-cyan ((t (:foreground "cyan"))))
- (term-white ((t (:foreground "white"))))
- (term-blackbg ((t (:background "black"))))
- (term-redbg ((t (:background "red"))))
- (term-greenbg ((t (:background "green"))))
- (term-yellowbg ((t (:background "yellow"))))
- (term-bluebg ((t (:background "blue"))))
- (term-magentabg ((t (:background "magenta"))))
- (term-cyanbg ((t (:background "cyan"))))
- (term-whitebg ((t (:background "white"))))
- (gnus-emphasis-bold ((t (:bold t))))
- (gnus-emphasis-italic ((t (:italic t))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:bold t :underline t))))
- (gnus-emphasis-underline-italic ((t (:italic t :underline t))))
- (gnus-emphasis-bold-italic ((t (:bold t :italic t))))
- (gnus-emphasis-underline-bold-italic ((t (:bold t :italic t :underline t))))
- (gnus-emphasis-highlight-words ((t (:foreground "yellow" :background "black"))))
- (gnus-signature-face ((t (:italic t))))
- (gnus-header-from-face ((t (:foreground "spring green"))))
- (gnus-header-subject-face ((t (:foreground "yellow" :bold t))))
- (gnus-header-newsgroups-face ((t (:foreground "SeaGreen3" :bold t :italic t))))
- (gnus-header-name-face ((t (:foreground "pink"))))
- (gnus-header-content-face ((t (:foreground "lime green" :italic t))))
- (gnus-cite-attribution-face ((t (:italic t))))
- (gnus-cite-face-1 ((t (:foreground "light blue"))))
- (gnus-cite-face-2 ((t (:foreground "light cyan"))))
- (gnus-cite-face-3 ((t (:foreground "light yellow"))))
- (gnus-cite-face-4 ((t (:foreground "light pink"))))
- (gnus-cite-face-5 ((t (:foreground "pale green"))))
- (gnus-cite-face-6 ((t (:foreground "beige"))))
- (gnus-cite-face-7 ((t (:foreground "orange"))))
- (gnus-cite-face-8 ((t (:foreground "magenta"))))
- (gnus-cite-face-9 ((t (:foreground "violet"))))
- (gnus-cite-face-10 ((t (:foreground "medium purple"))))
- (gnus-cite-face-11 ((t (:foreground "turquoise")))))))
-
-(defun color-theme-sitaramv-nt ()
- "Black foreground on white background.
-Includes faces for font-lock, widget, custom, speedbar."
- (interactive)
- (color-theme-install
- '(color-theme-sitaramv-nt
- ((foreground-color . "black")
- (background-color . "white")
- (mouse-color . "sienna3")
- (cursor-color . "HotPink")
- (border-color . "Blue")
- (background-mode . light))
- (default ((t (nil))))
- (modeline ((t (:foreground "black" :background "gold2"))))
- (modeline-buffer-id ((t (:foreground "black" :background "gold2"))))
- (modeline-mousable ((t (:foreground "black" :background "gold2"))))
- (modeline-mousable-minor-mode ((t (:foreground "black" :background "gold2"))))
- (highlight ((t (:foreground "black" :background "darkseagreen2"))))
- (bold ((t (:bold t))))
- (italic ((t (:italic t))))
- (bold-italic ((t (:bold t :italic t))))
- (region ((t (:foreground "black" :background "snow3"))))
- (secondary-selection ((t (:background "paleturquoise"))))
- (underline ((t (:underline t))))
- (lazy-highlight-face ((t (:foreground "dark magenta" :bold t))))
- (font-lock-comment-face ((t (:foreground "ForestGreen" :italic t))))
- (font-lock-string-face ((t (:foreground "red"))))
- (font-lock-keyword-face ((t (:foreground "blue" :bold t))))
- (font-lock-builtin-face ((t (:foreground "black"))))
- (font-lock-function-name-face ((t (:foreground "dark magenta" :bold t))))
- (font-lock-variable-name-face ((t (:foreground "black"))))
- (font-lock-type-face ((t (:foreground "blue"))))
- (font-lock-constant-face ((t (:foreground "CadetBlue"))))
- (font-lock-warning-face ((t (:foreground "Red" :bold t))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-button-face ((t (:bold t))))
- (widget-field-face ((t (:background "gray85"))))
- (widget-single-line-field-face ((t (:background "gray85"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (custom-invalid-face ((t (:foreground "yellow" :background "red"))))
- (custom-rogue-face ((t (:foreground "pink" :background "black"))))
- (custom-modified-face ((t (:foreground "white" :background "blue"))))
- (custom-set-face ((t (:foreground "blue" :background "white"))))
- (custom-changed-face ((t (:foreground "white" :background "blue"))))
- (custom-saved-face ((t (:underline t))))
- (custom-button-face ((t (nil))))
- (custom-documentation-face ((t (nil))))
- (custom-state-face ((t (:foreground "dark green"))))
- (custom-variable-tag-face ((t (:foreground "blue" :underline t))))
- (custom-variable-button-face ((t (:bold t :underline t))))
- (custom-face-tag-face ((t (:underline t))))
- (custom-group-tag-face-1 ((t (:foreground "red" :underline t))))
- (custom-group-tag-face ((t (:foreground "blue" :underline t))))
- (speedbar-button-face ((t (:foreground "green4"))))
- (speedbar-file-face ((t (:foreground "cyan4"))))
- (speedbar-directory-face ((t (:foreground "blue4"))))
- (speedbar-tag-face ((t (:foreground "brown"))))
- (speedbar-selected-face ((t (:foreground "red" :underline t))))
- (speedbar-highlight-face ((t (:background "green"))))
- (ff-paths-non-existant-file-face ((t (:foreground "NavyBlue" :bold t))))
- (show-paren-match-face ((t (:background "light blue"))))
- (show-paren-mismatch-face ((t (:foreground "white" :background "purple")))))))
-
-(defun color-theme-billw ()
- "Cornsilk on black.
-Includes info, diary, font-lock, eshell, sgml, message, gnus,
-widget, custom, latex, ediff."
- (interactive)
- (color-theme-install
- '(color-theme-billw
- ((foreground-color . "cornsilk")
- (background-color . "black")
- (mouse-color . "black")
- (cursor-color . "white")
- (border-color . "black")
- (background-mode . dark))
- (default ((t (nil))))
- (modeline ((t (:foreground "black" :background "wheat"))))
- (modeline-buffer-id ((t (:foreground "black" :background "wheat"))))
- (modeline-mousable ((t (:foreground "black" :background "wheat"))))
- (modeline-mousable-minor-mode ((t (:foreground "black" :background "wheat"))))
- (highlight ((t (:foreground "wheat" :background "darkslategray"))))
- (bold ((t (:bold t))))
- (italic ((t (:italic t))))
- (bold-italic ((t (:bold t :italic t))))
- (region ((t (:background "dimgray"))))
- (secondary-selection ((t (:background "deepskyblue4"))))
- (underline ((t (:underline t))))
- (info-node ((t (:foreground "yellow" :bold t :italic t))))
- (info-menu-5 ((t (:underline t))))
- (info-xref ((t (:foreground "yellow" :bold t))))
- (diary-face ((t (:foreground "orange"))))
- (calendar-today-face ((t (:underline t))))
- (holiday-face ((t (:background "red"))))
- (show-paren-match-face ((t (:background "deepskyblue4"))))
- (show-paren-mismatch-face ((t (:foreground "white" :background "red"))))
- (font-lock-comment-face ((t (:foreground "gold"))))
- (font-lock-string-face ((t (:foreground "orange"))))
- (font-lock-keyword-face ((t (:foreground "cyan1"))))
- (font-lock-builtin-face ((t (:foreground "LightSteelBlue"))))
- (font-lock-function-name-face ((t (:foreground "mediumspringgreen"))))
- (font-lock-variable-name-face ((t (:foreground "light salmon"))))
- (font-lock-type-face ((t (:foreground "yellow1"))))
- (font-lock-constant-face ((t (:foreground "salmon"))))
- (font-lock-warning-face ((t (:foreground "gold" :bold t))))
- (blank-space-face ((t (:background "LightGray"))))
- (blank-tab-face ((t (:foreground "black" :background "cornsilk"))))
- (highline-face ((t (:background "gray35"))))
- (eshell-ls-directory-face ((t (:foreground "green" :bold t))))
- (eshell-ls-symlink-face ((t (:foreground "Cyan" :bold t))))
- (eshell-ls-executable-face ((t (:foreground "orange" :bold t))))
- (eshell-ls-readonly-face ((t (:foreground "gray"))))
- (eshell-ls-unreadable-face ((t (:foreground "DarkGrey"))))
- (eshell-ls-special-face ((t (:foreground "Magenta" :bold t))))
- (eshell-ls-missing-face ((t (:foreground "Red" :bold t))))
- (eshell-ls-archive-face ((t (:foreground "Orchid" :bold t))))
- (eshell-ls-backup-face ((t (:foreground "LightSalmon"))))
- (eshell-ls-product-face ((t (:foreground "LightSalmon"))))
- (eshell-ls-clutter-face ((t (:foreground "blue" :bold t))))
- (sgml-start-tag-face ((t (:foreground "mediumspringgreen"))))
- (custom-button-face ((t (:foreground "white"))))
- (sgml-ignored-face ((t (:foreground "gray20" :background "gray60"))))
- (sgml-doctype-face ((t (:foreground "orange"))))
- (sgml-sgml-face ((t (:foreground "yellow"))))
- (vc-annotate-face-0046FF ((t (:foreground "wheat" :background "black"))))
- (custom-documentation-face ((t (:foreground "white"))))
- (sgml-end-tag-face ((t (:foreground "greenyellow"))))
- (linemenu-face ((t (:background "gray30"))))
- (sgml-entity-face ((t (:foreground "gold"))))
- (message-header-to-face ((t (:foreground "floral white" :bold t))))
- (message-header-cc-face ((t (:foreground "ivory"))))
- (message-header-subject-face ((t (:foreground "papaya whip" :bold t))))
- (message-header-newsgroups-face ((t (:foreground "lavender blush" :bold t :italic t))))
- (message-header-other-face ((t (:foreground "pale turquoise"))))
- (message-header-name-face ((t (:foreground "light sky blue"))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-separator-face ((t (:foreground "sandy brown"))))
- (message-cited-text-face ((t (:foreground "plum1"))))
- (message-mml-face ((t (:foreground "ForestGreen"))))
- (gnus-group-news-1-face ((t (:foreground "white" :bold t))))
- (gnus-group-news-1-empty-face ((t (:foreground "white"))))
- (gnus-group-news-2-face ((t (:foreground "lightcyan" :bold t))))
- (gnus-group-news-2-empty-face ((t (:foreground "lightcyan"))))
- (gnus-group-news-3-face ((t (:foreground "tan" :bold t))))
- (gnus-group-news-3-empty-face ((t (:foreground "tan"))))
- (gnus-group-news-4-face ((t (:foreground "white" :bold t))))
- (gnus-group-news-4-empty-face ((t (:foreground "white"))))
- (gnus-group-news-5-face ((t (:foreground "wheat" :bold t))))
- (gnus-group-news-5-empty-face ((t (:foreground "wheat"))))
- (gnus-group-news-6-face ((t (:foreground "tan" :bold t))))
- (gnus-group-news-6-empty-face ((t (:foreground "tan"))))
- (gnus-group-news-low-face ((t (:foreground "DarkTurquoise" :bold t))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkTurquoise"))))
- (gnus-group-mail-1-face ((t (:foreground "white" :bold t))))
- (gnus-group-mail-1-empty-face ((t (:foreground "gray80"))))
- (gnus-group-mail-2-face ((t (:foreground "lightcyan" :bold t))))
- (gnus-group-mail-2-empty-face ((t (:foreground "lightcyan"))))
- (gnus-group-mail-3-face ((t (:foreground "tan" :bold t))))
- (gnus-group-mail-3-empty-face ((t (:foreground "tan"))))
- (gnus-group-mail-low-face ((t (:foreground "aquamarine4" :bold t))))
- (gnus-group-mail-low-empty-face ((t (:foreground "aquamarine4"))))
- (gnus-summary-selected-face ((t (:background "deepskyblue4" :underline t))))
- (gnus-summary-cancelled-face ((t (:foreground "black" :background "gray"))))
- (gnus-summary-high-ticked-face ((t (:foreground "gray70" :bold t))))
- (gnus-summary-low-ticked-face ((t (:foreground "gray70" :bold t))))
- (gnus-summary-normal-ticked-face ((t (:foreground "gray70" :bold t))))
- (gnus-summary-high-ancient-face ((t (:foreground "SkyBlue" :bold t))))
- (gnus-summary-low-ancient-face ((t (:foreground "SkyBlue" :italic t))))
- (gnus-summary-normal-ancient-face ((t (:foreground "SkyBlue"))))
- (gnus-summary-high-unread-face ((t (:bold t))))
- (gnus-summary-low-unread-face ((t (:italic t))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-high-read-face ((t (:foreground "PaleGreen" :bold t))))
- (gnus-summary-low-read-face ((t (:foreground "PaleGreen" :italic t))))
- (gnus-summary-normal-read-face ((t (:foreground "PaleGreen"))))
- (gnus-splash-face ((t (:foreground "gold"))))
- (font-latex-bold-face ((t (nil))))
- (font-latex-italic-face ((t (nil))))
- (font-latex-math-face ((t (nil))))
- (font-latex-sedate-face ((t (:foreground "Gray85"))))
- (font-latex-string-face ((t (:foreground "orange"))))
- (font-latex-warning-face ((t (:foreground "gold"))))
- (widget-documentation-face ((t (:foreground "lime green"))))
- (widget-button-face ((t (:bold t))))
- (widget-field-face ((t (:background "gray20"))))
- (widget-single-line-field-face ((t (:background "gray20"))))
- (widget-inactive-face ((t (:foreground "wheat"))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (custom-invalid-face ((t (:foreground "yellow" :background "red"))))
- (custom-rogue-face ((t (:foreground "pink" :background "black"))))
- (custom-modified-face ((t (:foreground "white" :background "blue"))))
- (custom-set-face ((t (:foreground "blue"))))
- (custom-changed-face ((t (:foreground "wheat" :background "skyblue"))))
- (custom-saved-face ((t (:underline t))))
- (custom-state-face ((t (:foreground "light green"))))
- (custom-variable-tag-face ((t (:foreground "skyblue" :underline t))))
- (custom-variable-button-face ((t (:bold t :underline t))))
- (custom-face-tag-face ((t (:foreground "white" :underline t))))
- (custom-group-tag-face-1 ((t (:foreground "pink" :underline t))))
- (custom-group-tag-face ((t (:foreground "skyblue" :underline t))))
- (swbuff-current-buffer-face ((t (:foreground "red" :bold t))))
- (ediff-current-diff-face-A ((t (:foreground "firebrick" :background "pale green"))))
- (ediff-current-diff-face-B ((t (:foreground "DarkOrchid" :background "Yellow"))))
- (ediff-current-diff-face-C ((t (:foreground "white" :background "indianred"))))
- (ediff-current-diff-face-Ancestor ((t (:foreground "Black" :background "VioletRed"))))
- (ediff-fine-diff-face-A ((t (:foreground "Navy" :background "sky blue"))))
- (ediff-fine-diff-face-B ((t (:foreground "Black" :background "cyan"))))
- (ediff-fine-diff-face-C ((t (:foreground "Black" :background "Turquoise"))))
- (ediff-fine-diff-face-Ancestor ((t (:foreground "Black" :background "Green"))))
- (ediff-even-diff-face-A ((t (:foreground "Black" :background "light grey"))))
- (ediff-even-diff-face-B ((t (:foreground "White" :background "Grey"))))
- (ediff-even-diff-face-C ((t (:foreground "Black" :background "light grey"))))
- (ediff-even-diff-face-Ancestor ((t (:foreground "White" :background "Grey"))))
- (ediff-odd-diff-face-A ((t (:foreground "White" :background "Grey"))))
- (ediff-odd-diff-face-B ((t (:foreground "Black" :background "light grey"))))
- (ediff-odd-diff-face-C ((t (:foreground "White" :background "Grey"))))
- (ediff-odd-diff-face-Ancestor ((t (:foreground "Black" :background "light grey"))))
- (gnus-emphasis-bold ((t (:bold t))))
- (gnus-emphasis-italic ((t (:italic t))))
- (gnus-emphasis-underline ((t (:foreground "white" :background "goldenrod4"))))
- (gnus-emphasis-underline-bold ((t (:foreground "black" :background "yellow" :bold t :underline t))))
- (gnus-emphasis-underline-italic ((t (:foreground "black" :background "yellow" :italic t :underline t))))
- (gnus-emphasis-bold-italic ((t (:bold t :italic t))))
- (gnus-emphasis-underline-bold-italic ((t (:foreground "black" :background "yellow" :bold t :italic t :underline t))))
- (gnus-emphasis-highlight-words ((t (:foreground "yellow" :background "black"))))
- (gnus-signature-face ((t (:italic t))))
- (gnus-header-from-face ((t (:foreground "wheat"))))
- (gnus-header-subject-face ((t (:foreground "wheat" :bold t))))
- (gnus-header-newsgroups-face ((t (:foreground "wheat" :italic t))))
- (gnus-header-name-face ((t (:foreground "white"))))
- (gnus-header-content-face ((t (:foreground "tan" :italic t))))
- (gnus-filterhist-face-1 ((t (nil))))
- (gnus-splash ((t (:foreground "Brown"))))
- (gnus-cite-attribution-face ((t (:italic t))))
- (gnus-cite-face-1 ((t (:foreground "light blue"))))
- (gnus-cite-face-2 ((t (:foreground "light cyan"))))
- (gnus-cite-face-3 ((t (:foreground "light yellow"))))
- (gnus-cite-face-4 ((t (:foreground "light pink"))))
- (gnus-cite-face-5 ((t (:foreground "pale green"))))
- (gnus-cite-face-6 ((t (:foreground "beige"))))
- (gnus-cite-face-7 ((t (:foreground "orange"))))
- (gnus-cite-face-8 ((t (:foreground "magenta"))))
- (gnus-cite-face-9 ((t (:foreground "violet"))))
- (gnus-cite-face-10 ((t (:foreground "medium purple"))))
- (gnus-cite-face-11 ((t (:foreground "turquoise")))))))
-
-(defun color-theme-retro-green (&optional color func)
- "Plain green on black faces for those longing for the good old days."
- (interactive)
- ;; Build a list of faces without parameters
- (let ((old-faces (face-list))
- (faces)
- (face)
- (foreground (or color "green")))
- (dolist (face old-faces)
- (cond ((memq face '(bold bold-italic))
- (add-to-list 'faces `(,face (( t (:bold t))))))
- ((memq face '(italic underline show-paren-mismatch-face))
- (add-to-list 'faces `(,face (( t (:underline t))))))
- ((memq face '(modeline modeline-buffer-id modeline-mousable
- modeline-mousable-minor-mode highlight region
- secondary-selection show-paren-match-face))
- (add-to-list 'faces `(,face (( t (:foreground "black"
- :background ,foreground
- :inverse t))))))
- (t
- (add-to-list 'faces `(,face (( t (nil))))))))
- (color-theme-install
- (append
- (list (or func 'color-theme-retro-green)
- (list (cons 'foreground-color foreground)
- (cons 'background-color "black")
- (cons 'mouse-color foreground)
- (cons 'cursor-color foreground)
- (cons 'border-color foreground)
- (cons 'background-mode 'dark)))
- faces))))
-
-(defun color-theme-retro-orange ()
- "Plain orange on black faces for those longing for the good old days."
- (interactive)
- (color-theme-retro-green "orange" 'color-theme-retro-orange))
-
-(defun color-theme-subtle-hacker ()
- "Subtle Hacker Color Theme.
-Based on gnome2, but uses white for important things like comments,
-and less of the unreadable tomato. By Colin Walters <levanti@verbum.org>"
- (interactive)
- (color-theme-gnome2)
- (let ((color-theme-is-cumulative t))
- (color-theme-install
- '(color-theme-subtle-hacker
- nil
- nil
- (custom-state-face ((t (:foreground "Coral"))))
- (diary-face ((t (:bold t :foreground "IndianRed"))))
- (eshell-ls-clutter-face ((t (:bold t :foreground "DimGray"))))
- (eshell-ls-executable-face ((t (:bold t :foreground "Coral"))))
- (eshell-ls-missing-face ((t (:bold t :foreground "black"))))
- (eshell-ls-special-face ((t (:bold t :foreground "Gold"))))
- (eshell-ls-symlink-face ((t (:bold t :foreground "White"))))
- (font-lock-comment-face ((t (:foreground "White"))))
- (font-lock-constant-face ((t (:bold t :foreground "Aquamarine"))))
- (font-lock-function-name-face ((t (:bold t :foreground "MediumSlateBlue"))))
- (font-lock-string-face ((t (:italic t :foreground "LightSalmon"))))
- (font-lock-variable-name-face ((t (:italic t :bold t :foreground "Aquamarine"))))
- (gnus-cite-face-1 ((t (:foreground "dark khaki"))))
- (gnus-cite-face-2 ((t (:foreground "chocolate"))))
- (gnus-cite-face-3 ((t (:foreground "tomato"))))
- (gnus-group-mail-1-empty-face ((t (:foreground "light cyan"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "light cyan"))))
- (gnus-group-mail-2-empty-face ((t (:foreground "turquoise"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "turquoise"))))
- (gnus-group-mail-3-empty-face ((t (:foreground "tomato"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "tomato"))))
- (gnus-group-mail-low-empty-face ((t (:foreground "dodger blue"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "dodger blue"))))
- (gnus-group-news-1-empty-face ((t (:foreground "green yellow"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "green yellow"))))
- (gnus-group-news-2-empty-face ((t (:foreground "dark orange"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "dark orange"))))
- (gnus-group-news-3-empty-face ((t (:foreground "tomato"))))
- (gnus-group-news-3-face ((t (:bold t :foreground "tomato"))))
- (gnus-group-news-low-empty-face ((t (:foreground "yellow green"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "yellow green"))))
- (gnus-header-name-face ((t (:bold t :foreground "DodgerBlue1"))))
- (gnus-header-newsgroups-face ((t (:italic t :bold t :foreground "LightSkyBlue3"))))
- (gnus-signature-face ((t (:foreground "salmon"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "RoyalBlue"))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "forest green"))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "burlywood"))))
- (gnus-summary-high-unread-face ((t (:italic t :bold t :foreground "cyan"))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "chocolate"))))
- (gnus-summary-low-read-face ((t (:foreground "light sea green"))))
- (gnus-summary-low-ticked-face ((t (:italic t :foreground "chocolate"))))
- (gnus-summary-low-unread-face ((t (:italic t :foreground "light sea green"))))
- (gnus-summary-normal-ancient-face ((t (:foreground "RoyalBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "khaki"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "sandy brown"))))
- (gnus-summary-normal-unread-face ((t (:foreground "aquamarine"))))
- (message-cited-text-face ((t (:foreground "White"))))
- (message-header-name-face ((t (:foreground "DodgerBlue1"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "LightSkyBlue3"))))
- (message-header-other-face ((t (:foreground "LightSkyBlue3"))))
- (message-header-xheader-face ((t (:foreground "DodgerBlue3"))))))))
-
-(defun color-theme-pok-wog ()
- "Low-contrast White-on-Gray by S.Pokrovsky.
-
-The following might be a good addition to your .Xdefaults file:
-
-Emacs.pane.menubar.background: darkGrey
-Emacs.pane.menubar.foreground: black"
- (interactive)
- (color-theme-install
- '(color-theme-pok-wog
- ((foreground-color . "White")
- (background-color . "DarkSlateGray")
- (mouse-color . "gold")
- (cursor-color . "Cyan")
- (border-color . "black")
- (background-mode . dark))
- (default ((t (nil))))
- (bold ((t (:bold t :foreground "Wheat"))))
- (bold-italic ((t (:italic t :bold t :foreground "wheat"))))
- (calendar-today-face ((t (:underline t :foreground "white"))))
- (diary-face ((t (:foreground "red"))))
- (font-lock-builtin-face ((t (:bold t :foreground "cyan"))))
- (font-lock-comment-face ((t (:foreground "Gold"))))
- (font-lock-constant-face ((t (:bold t :foreground "LightSteelBlue"))))
- (font-lock-function-name-face ((t (:bold t :foreground "Yellow"))))
- (font-lock-keyword-face ((t (:bold t :foreground "Cyan"))))
- (font-lock-string-face ((t (:foreground "Khaki"))))
- (font-lock-type-face ((t (:bold t :foreground "Cyan"))))
- (font-lock-variable-name-face ((t (:foreground "LightGoldenrod"))))
- (font-lock-warning-face ((t (:bold t :foreground "Pink"))))
- (gnus-cite-attribution-face ((t (:bold t :foreground "Wheat"))))
- (gnus-cite-face-1 ((t (:foreground "wheat"))))
- (gnus-cite-face-10 ((t (:foreground "wheat"))))
- (gnus-cite-face-11 ((t (:foreground "turquoise"))))
- (gnus-cite-face-2 ((t (:foreground "cyan"))))
- (gnus-cite-face-3 ((t (:foreground "light yellow"))))
- (gnus-cite-face-4 ((t (:foreground "light pink"))))
- (gnus-cite-face-5 ((t (:foreground "pale green"))))
- (gnus-cite-face-6 ((t (:foreground "beige"))))
- (gnus-cite-face-7 ((t (:foreground "orange"))))
- (gnus-cite-face-8 ((t (:foreground "magenta"))))
- (gnus-cite-face-9 ((t (:foreground "violet"))))
- (gnus-emphasis-bold ((t (:bold t :foreground "wheat"))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t))))
- (gnus-emphasis-highlight-words ((t (:background "black" :foreground "yellow"))))
- (gnus-emphasis-italic ((t (:italic t :foreground "white"))))
- (gnus-emphasis-underline ((t (:underline t :foreground "white"))))
- (gnus-emphasis-underline-bold ((t (:underline t :bold t :foreground "wheat"))))
- (gnus-emphasis-underline-bold-italic ((t (:underline t :italic t :bold t))))
- (gnus-emphasis-underline-italic ((t (:underline t :italic t :foreground "white"))))
- (gnus-group-mail-1-empty-face ((t (:foreground "aquamarine1"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "aquamarine1"))))
- (gnus-group-mail-2-empty-face ((t (:foreground "aquamarine2"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "aquamarine2"))))
- (gnus-group-mail-3-empty-face ((t (:foreground "Salmon"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "gold"))))
- (gnus-group-mail-low-empty-face ((t (:foreground "Wheat"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "aquamarine4"))))
- (gnus-group-news-1-empty-face ((t (:foreground "PaleTurquoise"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "PaleTurquoise"))))
- (gnus-group-news-2-empty-face ((t (:foreground "turquoise"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "turquoise"))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (:bold t :foreground "Wheat"))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (:bold t))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (:bold t))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (:bold t))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkTurquoise"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "DarkTurquoise"))))
- (gnus-header-content-face ((t (:italic t :foreground "Wheat"))))
- (gnus-header-from-face ((t (:foreground "light yellow"))))
- (gnus-header-name-face ((t (:foreground "cyan"))))
- (gnus-header-newsgroups-face ((t (:italic t :foreground "yellow"))))
- (gnus-header-subject-face ((t (:bold t :foreground "Gold"))))
- (gnus-signature-face ((t (:italic t :foreground "wheat"))))
- (gnus-splash-face ((t (:foreground "orange"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "SkyBlue"))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "PaleGreen"))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "pink"))))
- (gnus-summary-high-unread-face ((t (:bold t :foreground "gold"))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "SkyBlue"))))
- (gnus-summary-low-read-face ((t (:italic t :foreground "PaleGreen"))))
- (gnus-summary-low-ticked-face ((t (:italic t :foreground "pink"))))
- (gnus-summary-low-unread-face ((t (:italic t))))
- (gnus-summary-normal-ancient-face ((t (:foreground "SkyBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "PaleGreen"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "pink"))))
- (gnus-summary-normal-unread-face ((t (:foreground "wheat"))))
- (gnus-summary-selected-face ((t (:underline t :foreground "white"))))
- (highlight ((t (:background "Blue" :foreground "white"))))
- (highline-face ((t (:background "black" :foreground "white"))))
- (holiday-face ((t (:background "pink" :foreground "white"))))
- (info-menu-5 ((t (:underline t))))
- (info-node ((t (:italic t :bold t :foreground "white"))))
- (info-xref ((t (:bold t :foreground "wheat"))))
- (italic ((t (:italic t :foreground "white"))))
- (makefile-space-face ((t (:background "hotpink"))))
- (message-cited-text-face ((t (:foreground "green"))))
- (message-header-cc-face ((t (:bold t :foreground "Aquamarine"))))
- (message-header-name-face ((t (:foreground "Gold"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "yellow"))))
- (message-header-other-face ((t (:foreground "lightGray"))))
- (message-header-subject-face ((t (:foreground "Yellow"))))
- (message-header-to-face ((t (:bold t :foreground "green2"))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-mml-face ((t (:bold t :foreground "khaki"))))
- (message-separator-face ((t (:background "aquamarine" :foreground "black"))))
- (modeline ((t (:background "DarkGray" :foreground "Black"))))
- (modeline-buffer-id ((t (:background "DarkGray" :foreground "Black"))))
- (modeline-mousable ((t (:background "DarkGray" :foreground "Black"))))
- (modeline-mousable-minor-mode ((t (:background "DarkGray" :foreground "Black"))))
- (paren-mismatch-face ((t (:background "DeepPink" :foreground "white"))))
- (paren-no-match-face ((t (:background "yellow" :foreground "white"))))
- (region ((t (:background "MediumSlateBlue" :foreground "white"))))
- (secondary-selection ((t (:background "Sienna" :foreground "white"))))
- (show-paren-match-face ((t (:background "turquoise" :foreground "white"))))
- (show-paren-mismatch-face ((t (:background "purple" :foreground "white"))))
- (speedbar-button-face ((t (:bold t :foreground "magenta"))))
- (speedbar-directory-face ((t (:bold t :foreground "orchid"))))
- (speedbar-file-face ((t (:foreground "pink"))))
- (speedbar-highlight-face ((t (:background "black"))))
- (speedbar-selected-face ((t (:underline t :foreground "cyan"))))
- (speedbar-tag-face ((t (:foreground "yellow"))))
- (swbuff-current-buffer-face ((t (:bold t :foreground "red"))))
- (underline ((t (:underline t :foreground "white"))))
- (widget-button-face ((t (:bold t :foreground "wheat"))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "lime green"))))
- (widget-field-face ((t (:background "dim gray" :foreground "white"))))
- (widget-inactive-face ((t (:foreground "light gray"))))
- (widget-single-line-field-face ((t (:background "dim gray" :foreground "white")))))))
-
-(defun color-theme-pok-wob ()
- "White-on-Black by S. Pokrovsky.
-
-The following might be a good addition to your .Xdefaults file:
-
-Emacs.pane.menubar.background: darkGrey
-Emacs.pane.menubar.foreground: black"
- (interactive)
-; (setq term-default-fg-color "white"
-; term-default-bg "black")
- (color-theme-install
- '(color-theme-pok-wob
- ((foreground-color . "white")
- (background-color . "black")
- (mouse-color . "gold")
- (cursor-color . "yellow")
- (border-color . "black")
- (background-mode . dark))
- (default ((t (nil))))
- (bold ((t (:bold t :foreground "light gray"))))
- (bold-italic ((t (:italic t :bold t :foreground "cyan"))))
- (calendar-today-face ((t (:underline t :foreground "white"))))
- (custom-button-face ((t (nil))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:underline t))))
- (custom-group-tag-face ((t (:underline t))))
- (custom-group-tag-face-1 ((t (:underline t))))
- (custom-invalid-face ((t (:background "red" :foreground "white"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (nil))))
- (custom-variable-button-face ((t (:underline t :bold t))))
- (custom-variable-tag-face ((t (:underline t))))
- (diary-face ((t (:foreground "gold"))))
- (font-lock-builtin-face ((t (:bold t :foreground "cyan"))))
- (font-lock-comment-face ((t (:foreground "Gold"))))
- (font-lock-constant-face ((t (:bold t :foreground "LightSteelBlue"))))
- (font-lock-function-name-face ((t (:bold t :foreground "gold"))))
- (font-lock-keyword-face ((t (:bold t :foreground "Cyan"))))
- (font-lock-string-face ((t (:foreground "Khaki"))))
- (font-lock-type-face ((t (:bold t :foreground "Cyan"))))
- (font-lock-variable-name-face ((t (:italic t :foreground "gold"))))
- (font-lock-warning-face ((t (:bold t :foreground "Pink"))))
- (gnus-cite-attribution-face ((t (:underline t :foreground "beige"))))
- (gnus-cite-face-1 ((t (:foreground "gold"))))
- (gnus-cite-face-10 ((t (:foreground "coral"))))
- (gnus-cite-face-11 ((t (:foreground "turquoise"))))
- (gnus-cite-face-2 ((t (:foreground "wheat"))))
- (gnus-cite-face-3 ((t (:foreground "light pink"))))
- (gnus-cite-face-4 ((t (:foreground "khaki"))))
- (gnus-cite-face-5 ((t (:foreground "pale green"))))
- (gnus-cite-face-6 ((t (:foreground "beige"))))
- (gnus-cite-face-7 ((t (:foreground "orange"))))
- (gnus-cite-face-8 ((t (:foreground "magenta"))))
- (gnus-cite-face-9 ((t (:foreground "violet"))))
- (gnus-emphasis-bold ((t (:bold t :foreground "light gray"))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t :foreground "cyan"))))
- (gnus-emphasis-highlight-words ((t (:background "black" :foreground "gold"))))
- (gnus-emphasis-italic ((t (:italic t :foreground "cyan"))))
- (gnus-emphasis-underline ((t (:underline t :foreground "white"))))
- (gnus-emphasis-underline-bold ((t (:underline t :bold t :foreground "white"))))
- (gnus-emphasis-underline-bold-italic ((t (:underline t :italic t :bold t :foreground "white"))))
- (gnus-emphasis-underline-italic ((t (:underline t :italic t :foreground "white"))))
- (gnus-group-mail-1-empty-face ((t (:foreground "Magenta"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "Magenta"))))
- (gnus-group-mail-2-empty-face ((t (:foreground "aquamarine2"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "aquamarine2"))))
- (gnus-group-mail-3-empty-face ((t (:foreground "Cyan"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "Cyan"))))
- (gnus-group-mail-low-empty-face ((t (:foreground "Wheat"))))
- (gnus-group-mail-low-face ((t (:foreground "aquamarine4"))))
- (gnus-group-news-1-empty-face ((t (:foreground "PaleTurquoise"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "PaleTurquoise"))))
- (gnus-group-news-2-empty-face ((t (:foreground "turquoise"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "turquoise"))))
- (gnus-group-news-3-empty-face ((t (:foreground "wheat"))))
- (gnus-group-news-3-face ((t (:bold t :foreground "Wheat"))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (:bold t))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (:bold t))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (:bold t))))
- (gnus-group-news-low-empty-face ((t (:foreground "MediumAquamarine"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "MediumAquamarine"))))
- (gnus-header-content-face ((t (:italic t :foreground "Wheat"))))
- (gnus-header-from-face ((t (:foreground "light yellow"))))
- (gnus-header-name-face ((t (:foreground "Wheat"))))
- (gnus-header-newsgroups-face ((t (:italic t :foreground "gold"))))
- (gnus-header-subject-face ((t (:bold t :foreground "Gold"))))
- (gnus-signature-face ((t (:italic t :foreground "white"))))
- (gnus-splash-face ((t (:foreground "orange"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "orange"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "SkyBlue"))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "red"))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "coral"))))
- (gnus-summary-high-unread-face ((t (:bold t :foreground "gold"))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "SkyBlue"))))
- (gnus-summary-low-read-face ((t (:italic t :foreground "red"))))
- (gnus-summary-low-ticked-face ((t (:italic t :foreground "coral"))))
- (gnus-summary-low-unread-face ((t (:italic t :foreground "white"))))
- (gnus-summary-normal-ancient-face ((t (:foreground "SkyBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "PaleGreen"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "pink"))))
- (gnus-summary-normal-unread-face ((t (:foreground "white"))))
- (gnus-summary-selected-face ((t (:underline t :foreground "white"))))
- (highlight ((t (:background "Blue" :foreground "white"))))
- (highline-face ((t (:background "dark slate gray" :foreground "white"))))
- (holiday-face ((t (:background "red" :foreground "white"))))
- (info-menu-5 ((t (:underline t))))
- (info-node ((t (:italic t :bold t :foreground "white"))))
- (info-xref ((t (:bold t :foreground "light gray"))))
- (italic ((t (:italic t :foreground "cyan"))))
- (makefile-space-face ((t (:background "hotpink" :foreground "white"))))
- (message-cited-text-face ((t (:foreground "green"))))
- (message-header-cc-face ((t (:bold t :foreground "Aquamarine"))))
- (message-header-name-face ((t (:foreground "Gold"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "gold"))))
- (message-header-other-face ((t (:foreground "lightGray"))))
- (message-header-subject-face ((t (:foreground "Yellow"))))
- (message-header-to-face ((t (:bold t :foreground "green2"))))
- (message-header-xheader-face ((t (:foreground "sky blue"))))
- (message-mml-face ((t (:bold t :foreground "khaki"))))
- (message-separator-face ((t (:background "aquamarine" :foreground "black"))))
- (modeline ((t (:background "dark gray" :foreground "black"))))
- (modeline-buffer-id ((t (:background "dark gray" :foreground "black"))))
- (modeline-mousable ((t (:background "dark gray" :foreground "black"))))
- (modeline-mousable-minor-mode ((t (:background "dark gray" :foreground "black"))))
- (paren-mismatch-face ((t (:bold t :background "white" :foreground "red"))))
- (paren-no-match-face ((t (:bold t :background "white" :foreground "red"))))
- (region ((t (:background "MediumSlateBlue" :foreground "white"))))
- (secondary-selection ((t (:background "Sienna" :foreground "white"))))
- (show-paren-match-face ((t (:background "purple" :foreground "white"))))
- (show-paren-mismatch-face ((t (:bold t :background "white" :foreground "red"))))
- (speedbar-button-face ((t (nil))))
- (speedbar-directory-face ((t (nil))))
- (speedbar-file-face ((t (:bold t))))
- (speedbar-highlight-face ((t (nil))))
- (speedbar-selected-face ((t (:underline t))))
- (speedbar-tag-face ((t (nil))))
- (swbuff-current-buffer-face ((t (:bold t :foreground "red"))))
- (underline ((t (:underline t :foreground "white"))))
- (widget-button-face ((t (:bold t :foreground "coral"))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "lime green"))))
- (widget-field-face ((t (:background "dim gray" :foreground "white"))))
- (widget-inactive-face ((t (:foreground "light gray"))))
- (widget-single-line-field-face ((t (:background "dim gray" :foreground "white")))))))
-
-(defun color-theme-blue-sea ()
- "The grey on midnight blue theme.
-
-Includes faces for apropos, font-lock (Emacs and XEmacs), speedbar,
-custom, widget, info, flyspell, gnus, message, man, woman, dired.
-
-This is what you should put in your .Xdefaults file, if you want to
-change the colors of the menus:
-
-emacs*Background: DarkSlateGray
-emacs*Foreground: Wheat"
- (interactive)
- (color-theme-blue-gnus)
- (let ((color-theme-is-cumulative t))
- (color-theme-blue-erc)
- (color-theme-install
- '(color-theme-blue-sea
- ((background-color . "MidnightBlue")
- (background-mode . dark)
- (border-color . "Grey")
- (cursor-color . "Grey")
- (foreground-color . "Grey")
- (mouse-color . "Grey"))
- ((Man-overstrike-face . woman-bold-face)
- (Man-underline-face . woman-italic-face))
- (default ((t (nil))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:bold t :foreground "beige"))))
- (calendar-today-face ((t (:underline t))))
- (cperl-array-face ((t (:foreground "light salmon" :bold t))))
- (cperl-hash-face ((t (:foreground "beige" :bold t :italic t))))
- (cperl-nonoverridable-face ((t (:foreground "aquamarine"))))
- (custom-button-face ((t (:foreground "gainsboro"))))
- (custom-changed-face ((t (:foreground "white" :background "blue"))))
- (custom-documentation-face ((t (:foreground "light blue"))))
- (custom-face-tag-face ((t (:underline t))))
- (custom-group-tag-face ((t (:foreground "pale turquoise" :bold t))))
- (custom-group-tag-face-1 ((t (:foreground "pale turquoise" :underline t))))
- (custom-invalid-face ((t (:foreground "yellow" :background "red"))))
- (custom-modified-face ((t (:foreground "white" :background "blue"))))
- (custom-rogue-face ((t (:foreground "pink" :background "black"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:foreground "blue" :background "white"))))
- (custom-state-face ((t (:foreground "light salmon"))))
- (custom-variable-button-face ((t (:bold t :underline t))))
- (custom-variable-tag-face ((t (:foreground "turquoise" :bold t))))
- (diary-face ((t (:foreground "red"))))
- (dired-face-directory ((t (:bold t :foreground "sky blue"))))
- (dired-face-permissions ((t (:foreground "aquamarine"))))
- (dired-face-flagged ((t (:foreground "tomato"))))
- (dired-face-marked ((t (:foreground "light salmon"))))
- (dired-face-executable ((t (:foreground "green yellow"))))
- (eshell-ls-archive-face ((t (:bold t :foreground "medium purple"))))
- (eshell-ls-backup-face ((t (:foreground "dim gray"))))
- (eshell-ls-clutter-face ((t (:foreground "dim gray"))))
- (eshell-ls-directory-face ((t (:bold t :foreground "medium slate blue"))))
- (eshell-ls-executable-face ((t (:bold t :foreground "aquamarine"))))
- (eshell-ls-missing-face ((t (:foreground "black"))))
- (eshell-ls-picture-face ((t (:foreground "violet"))))
- (eshell-ls-product-face ((t (:foreground "light steel blue"))))
- (eshell-ls-readonly-face ((t (:foreground "aquamarine"))))
- (eshell-ls-special-face ((t (:foreground "gold"))))
- (eshell-ls-symlink-face ((t (:foreground "white"))))
- (eshell-ls-unreadable-face ((t (:foreground "dim gray"))))
- (eshell-prompt-face ((t (:foreground "light sky blue" :bold t))))
- (excerpt ((t (:italic t))))
- (fixed ((t (:bold t))))
- (flyspell-duplicate-face ((t (:foreground "Gold3" :bold t :underline t))))
- (flyspell-incorrect-face ((t (:foreground "OrangeRed" :bold t :underline t))))
- (font-lock-builtin-face ((t (:foreground "aquamarine"))))
- (font-lock-comment-face ((t (:foreground "light blue"))))
- (font-lock-constant-face ((t (:foreground "pale green"))))
- (font-lock-doc-string-face ((t (:foreground "sky blue"))))
- (font-lock-function-name-face ((t (:bold t :foreground "aquamarine"))))
- (font-lock-keyword-face ((t (:foreground "pale turquoise" :bold t))))
- (font-lock-reference-face ((t (:foreground "pale green"))))
- (font-lock-string-face ((t (:foreground "light sky blue"))))
- (font-lock-type-face ((t (:foreground "sky blue" :bold t))))
- (font-lock-variable-name-face ((t (:foreground "turquoise" :bold t))))
- (font-lock-warning-face ((t (:foreground "Red" :bold t))))
- (fringe ((t (:background "MidnightBlue"))))
- (header-line ((t (:background "#002" :foreground "cornflower blue"))))
- (highlight ((t (:background "dark slate blue" :foreground "light blue"))))
- (highline-face ((t (:background "DeepSkyBlue4"))))
- (holiday-face ((t (:background "pink"))))
- (info-menu-5 ((t (:underline t))))
- (info-node ((t (:bold t))))
- (info-xref ((t (:bold t :foreground "sky blue"))))
- (isearch ((t (:background "slate blue"))))
- (italic ((t (:foreground "sky blue"))))
- (makefile-space-face ((t (:background "hotpink"))))
- (menu ((t (:background "MidnightBlue" :foreground "Grey"))))
- (modeline ((t (:foreground "wheat" :background "slate blue"))))
- (mode-line-inactive ((t (:background "dark slate blue" :foreground "wheat"))))
- (modeline-buffer-id ((t (:foreground "beige" :background "slate blue"))))
- (modeline-mousable ((t (:foreground "light cyan" :background "slate blue"))))
- (modeline-mousable-minor-mode ((t (:foreground "wheat" :background "slate blue"))))
- (region ((t (:background "DarkSlateBlue"))))
- (secondary-selection ((t (:background "steel blue"))))
- (show-paren-match-face ((t (:foreground "white" :background "light slate blue"))))
- (show-paren-mismatch-face ((t (:foreground "white" :background "red"))))
- (speedbar-button-face ((t (:foreground "seashell2"))))
- (speedbar-directory-face ((t (:foreground "seashell3"))))
- (speedbar-file-face ((t (:foreground "seashell4"))))
- (speedbar-highlight-face ((t (:background "dark slate blue" :foreground "wheat"))))
- (speedbar-selected-face ((t (:foreground "seashell1" :underline t))))
- (speedbar-tag-face ((t (:foreground "antique white"))))
- (tool-bar ((t (:background "MidnightBlue" :foreground "Grey" :box (:line-width 1 :style released-button)))))
- (underline ((t (:underline t))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "light blue"))))
- (widget-field-face ((t (:background "RoyalBlue4" :foreground "wheat"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (widget-single-line-field-face ((t (:background "slate blue" :foreground "wheat"))))
- (woman-bold-face ((t (:foreground "sky blue" :bold t))))
- (woman-italic-face ((t (:foreground "deep sky blue"))))
- (woman-unknown-face ((t (:foreground "LightSalmon"))))
- (zmacs-region ((t (:background "DarkSlateBlue"))))))))
-
-(defun color-theme-rotor ()
- "Black on Beige color theme by Jinwei Shen, created 2000-06-08.
-Supports default faces, font-lock, custom, widget, message, man,
-show-paren, viper."
- (interactive)
- (color-theme-install
- '(color-theme-rotor
- ((background-color . "Beige")
- (background-mode . light)
- (border-color . "black")
- (cursor-color . "Maroon")
- (foreground-color . "Black")
- (mouse-color . "Black"))
- ((Man-overstrike-face . font-lock-function-name-face)
- (Man-underline-face . font-lock-type-face)
- (list-matching-lines-face . bold)
- (rmail-highlight-face . font-lock-function-name-face)
- (watson-attribution-face . italic)
- (watson-url-face . bold)
- (watson-url-mouse-face . highlight))
- (default ((t (nil))))
- (bold ((t (:bold t :background "grey40" :foreground "yellow"))))
- (bold-italic ((t (:italic t :bold t :foreground "yellow green"))))
- (custom-button-face ((t (nil))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:underline t))))
- (custom-group-tag-face ((t (:underline t :foreground "blue"))))
- (custom-group-tag-face-1 ((t (:underline t :foreground "red"))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "dark green"))))
- (custom-variable-button-face ((t (:underline t :bold t))))
- (custom-variable-tag-face ((t (:underline t :foreground "blue"))))
- (font-lock-builtin-face ((t (:foreground "Orchid"))))
- (font-lock-comment-face ((t (:foreground "MediumBlue"))))
- (font-lock-constant-face ((t (:foreground "CadetBlue"))))
- (font-lock-function-name-face ((t (:foreground "MediumSlateBlue"))))
- (font-lock-keyword-face ((t (:foreground "#80a0ff"))))
- (font-lock-string-face ((t (:foreground "red"))))
- (font-lock-type-face ((t (:foreground "ForestGreen"))))
- (font-lock-variable-name-face ((t (:foreground "DarkGoldenrod"))))
- (font-lock-warning-face ((t (:bold t :foreground "Red"))))
- (highlight ((t (:background "PaleGreen" :foreground "black"))))
- (italic ((t (:italic t :foreground "yellow3"))))
- (message-cited-text-face ((t (:foreground "red"))))
- (message-header-cc-face ((t (:foreground "MidnightBlue"))))
- (message-header-name-face ((t (:foreground "cornflower blue"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "blue4"))))
- (message-header-other-face ((t (:foreground "steel blue"))))
- (message-header-subject-face ((t (:bold t :foreground "navy blue"))))
- (message-header-to-face ((t (:bold t :foreground "MidnightBlue"))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-separator-face ((t (:foreground "brown"))))
- (modeline ((t (:background "wheat" :foreground "DarkOliveGreen"))))
- (modeline-buffer-id ((t (:background "wheat" :foreground "DarkOliveGreen"))))
- (modeline-mousable ((t (:background "wheat" :foreground "DarkOliveGreen"))))
- (modeline-mousable-minor-mode ((t (:background "wheat" :foreground "DarkOliveGreen"))))
- (nil ((t (nil))))
- (region ((t (:background "dark cyan" :foreground "cyan"))))
- (secondary-selection ((t (:background "Turquoise" :foreground "black"))))
- (show-paren-match-face ((t (:background "turquoise"))))
- (show-paren-mismatch-face ((t (:background "purple" :foreground "white"))))
- (underline ((t (:underline t))))
- (viper-minibuffer-emacs-face ((t (:background "darkseagreen2" :foreground "Black"))))
- (viper-minibuffer-insert-face ((t (:background "pink" :foreground "Black"))))
- (viper-minibuffer-vi-face ((t (:background "grey" :foreground "DarkGreen"))))
- (viper-replace-overlay-face ((t (:background "darkseagreen2" :foreground "Black"))))
- (viper-search-face ((t (:background "khaki" :foreground "Black"))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (widget-single-line-field-face ((t (:background "gray85")))))))
-
-(defun color-theme-pierson ()
- "Black on White color theme by Dan L. Pierson, created 2000-06-08.
-Supports default faces, font-lock, show-paren."
- (interactive)
- (color-theme-install
- '(color-theme-pierson
- ((background-color . "AntiqueWhite")
- (background-mode . light)
- (border-color . "black")
- (cursor-color . "Orchid")
- (foreground-color . "black")
- (mouse-color . "Orchid"))
- ((list-matching-lines-face . bold))
- (default ((t (nil))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:italic t :bold t))))
- (font-lock-builtin-face ((t (:foreground "Orchid"))))
- (font-lock-comment-face ((t (:foreground "ForestGreen"))))
- (font-lock-constant-face ((t (:foreground "CadetBlue"))))
- (font-lock-function-name-face ((t (:foreground "blue3"))))
- (font-lock-keyword-face ((t (:foreground "Blue"))))
- (font-lock-string-face ((t (:foreground "Firebrick"))))
- (font-lock-type-face ((t (:foreground "Purple"))))
- (font-lock-variable-name-face ((t (:foreground "blue3"))))
- (font-lock-warning-face ((t (:bold t :foreground "Red"))))
- (highlight ((t (:background "darkseagreen2"))))
- (italic ((t (:italic t))))
- (modeline ((t (:foreground "antiquewhite" :background "black"))))
- (modeline-mousable-minor-mode ((t (:foreground "antiquewhite" :background "black"))))
- (modeline-mousable ((t (:foreground "antiquewhite" :background "black"))))
- (modeline-buffer-id ((t (:foreground "antiquewhite" :background "black"))))
- (region ((t (:background "gray"))))
- (secondary-selection ((t (:background "paleturquoise"))))
- (show-paren-match-face ((t (:background "turquoise"))))
- (show-paren-mismatch-face ((t (:background "purple" :foreground "white"))))
- (underline ((t (:underline t)))))))
-
-(defun color-theme-xemacs ()
- "XEmacs standard colors.
-If you are missing standard faces in this theme, please notify the maintainer.
-Currently, this theme includes the standard faces and font-lock faces, including
-some faces used in Emacs only but which are needed to recreate the look of the
-XEmacs color theme."
- (interactive)
- (color-theme-install
- '(color-theme-xemacs
- ((background-color . "gray80")
- (background-mode . light)
- (background-toolbar-color . "#cf3ccf3ccf3c")
- (border-color . "#000000000000")
- (bottom-toolbar-shadow-color . "#79e77df779e7")
- (cursor-color . "Red3")
- (foreground-color . "black")
- (top-toolbar-shadow-color . "#fffffbeeffff"))
- (default ((t (nil))))
- (blue ((t (:foreground "blue"))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:italic t :bold t))))
- (border-glyph ((t (nil))))
- (custom-button-face ((t (:bold t))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:underline t))))
- (custom-group-tag-face ((t (:underline t :foreground "blue"))))
- (custom-group-tag-face-1 ((t (:underline t :foreground "red"))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "dark green"))))
- (custom-variable-button-face ((t (:underline t :bold t))))
- (custom-variable-tag-face ((t (:underline t :foreground "blue"))))
- (dired-face-boring ((t (:foreground "Gray65"))))
- (dired-face-directory ((t (:bold t))))
- (dired-face-executable ((t (:foreground "SeaGreen"))))
- (dired-face-flagged ((t (:background "LightSlateGray"))))
- (dired-face-marked ((t (:background "PaleVioletRed"))))
- (dired-face-permissions ((t (:background "grey75" :foreground "black"))))
- (dired-face-setuid ((t (:foreground "Red"))))
- (dired-face-socket ((t (:foreground "magenta"))))
- (dired-face-symlink ((t (:foreground "cyan"))))
- (font-lock-builtin-face ((t (:foreground "red3"))))
- (font-lock-comment-face ((t (:foreground "blue4"))))
- (font-lock-constant-face ((t (:foreground "red3"))))
- (font-lock-doc-string-face ((t (:foreground "green4"))))
- (font-lock-function-name-face ((t (:foreground "brown4"))))
- (font-lock-keyword-face ((t (:foreground "red4"))))
- (font-lock-preprocessor-face ((t (:foreground "blue3"))))
- (font-lock-reference-face ((t (:foreground "red3"))))
- (font-lock-string-face ((t (:foreground "green4"))))
- (font-lock-type-face ((t (:foreground "steelblue"))))
- (font-lock-variable-name-face ((t (:foreground "magenta4"))))
- (font-lock-warning-face ((t (:bold t :foreground "Red"))))
- (green ((t (:foreground "green"))))
- (gui-button-face ((t (:background "grey75" :foreground "black"))))
- (gui-element ((t (:background "Gray80"))))
- (highlight ((t (:background "darkseagreen2"))))
- (info-node ((t (:italic t :bold t))))
- (info-xref ((t (:bold t))))
- (isearch ((t (:background "paleturquoise"))))
- (italic ((t (:italic t))))
- (left-margin ((t (nil))))
- (list-mode-item-selected ((t (:background "gray68"))))
- (modeline ((t (:background "Gray80"))))
- (modeline-buffer-id ((t (:background "Gray80" :foreground "blue4"))))
- (modeline-mousable ((t (:background "Gray80" :foreground "firebrick"))))
- (modeline-mousable-minor-mode ((t (:background "Gray80" :foreground "green4"))))
- (paren-blink-off ((t (:foreground "gray80"))))
- (paren-match ((t (:background "darkseagreen2"))))
- (paren-mismatch ((t (:background "DeepPink" :foreground "black"))))
- (pointer ((t (nil))))
- (primary-selection ((t (:background "gray65"))))
- (red ((t (:foreground "red"))))
- (region ((t (:background "gray65"))))
- (right-margin ((t (nil))))
- (secondary-selection ((t (:background "paleturquoise"))))
- (text-cursor ((t (:background "Red3" :foreground "gray80"))))
- (toolbar ((t (:background "Gray80"))))
- (underline ((t (:underline t))))
- (vertical-divider ((t (:background "Gray80"))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (yellow ((t (:foreground "yellow"))))
- (zmacs-region ((t (:background "gray65")))))))
-
-(defun color-theme-jsc-light ()
- "Color theme by John S Cooper, created 2000-06-08."
- (interactive)
- (color-theme-install
- '(color-theme-jsc-light
- ((background-color . "white")
- (background-mode . light)
- (border-color . "black")
- (cursor-color . "Red")
- (foreground-color . "black")
- (mouse-color . "black"))
- ((gnus-mouse-face . highlight)
- (list-matching-lines-face . bold)
- (view-highlight-face . highlight))
- (default ((t (nil))))
- (bold ((t (:bold t :foreground "red3"))))
- (bold-italic ((t (:italic t :bold t :foreground "red"))))
- (custom-button-face ((t (nil))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:underline t))))
- (custom-group-tag-face ((t (:underline t :foreground "blue"))))
- (custom-group-tag-face-1 ((t (:underline t :foreground "red"))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "dark green"))))
- (custom-variable-button-face ((t (:underline t :bold t))))
- (custom-variable-tag-face ((t (:underline t :foreground "blue"))))
- (font-lock-builtin-face ((t (:foreground "Orchid"))))
- (font-lock-comment-face ((t (:italic t :bold t :foreground "Red3"))))
- (font-lock-constant-face ((t (:foreground "navy"))))
- (font-lock-function-name-face ((t (:bold t :foreground "Blue"))))
- (font-lock-keyword-face ((t (:bold t :foreground "Purple"))))
- (font-lock-string-face ((t (:foreground "Green4"))))
- (font-lock-type-face ((t (:foreground "Navy"))))
- (font-lock-variable-name-face ((t (:foreground "Tan4"))))
- (font-lock-warning-face ((t (:bold t :foreground "Red"))))
- (gnus-cite-attribution-face ((t (:italic t))))
- (gnus-cite-face-1 ((t (:foreground "MidnightBlue"))))
- (gnus-cite-face-10 ((t (:foreground "medium purple"))))
- (gnus-cite-face-11 ((t (:foreground "turquoise"))))
- (gnus-cite-face-2 ((t (:foreground "firebrick"))))
- (gnus-cite-face-3 ((t (:foreground "dark green"))))
- (gnus-cite-face-4 ((t (:foreground "OrangeRed"))))
- (gnus-cite-face-5 ((t (:foreground "dark khaki"))))
- (gnus-cite-face-6 ((t (:foreground "dark violet"))))
- (gnus-cite-face-7 ((t (:foreground "SteelBlue4"))))
- (gnus-cite-face-8 ((t (:foreground "magenta"))))
- (gnus-cite-face-9 ((t (:foreground "violet"))))
- (gnus-emphasis-bold ((t (:bold t))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t))))
- (gnus-emphasis-highlight-words ((t (:background "black" :foreground "yellow"))))
- (gnus-emphasis-italic ((t (:italic t))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:underline t :bold t))))
- (gnus-emphasis-underline-bold-italic ((t (:underline t :italic t :bold t))))
- (gnus-emphasis-underline-italic ((t (:underline t :italic t))))
- (gnus-group-mail-1-empty-face ((t (:foreground "DeepPink3"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "DeepPink3"))))
- (gnus-group-mail-2-empty-face ((t (:foreground "HotPink3"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "HotPink3"))))
- (gnus-group-mail-3-empty-face ((t (:foreground "magenta4"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "magenta4"))))
- (gnus-group-mail-low-empty-face ((t (:foreground "DeepPink4"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "DeepPink4"))))
- (gnus-group-news-1-empty-face ((t (:foreground "blue2"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "blue2"))))
- (gnus-group-news-2-empty-face ((t (:foreground "CadetBlue4"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "CadetBlue4"))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (:bold t))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (:bold t))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (:bold t))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (:bold t))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkGreen"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "DarkGreen"))))
- (gnus-header-content-face ((t (:italic t :foreground "blue"))))
- (gnus-header-from-face ((t (:foreground "red3"))))
- (gnus-header-name-face ((t (:foreground "red3"))))
- (gnus-header-newsgroups-face ((t (:italic t :foreground "MidnightBlue"))))
- (gnus-header-subject-face ((t (:bold t :foreground "red"))))
- (gnus-signature-face ((t (:foreground "pink"))))
- (gnus-splash-face ((t (:foreground "Brown"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "RoyalBlue"))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "navy"))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "firebrick"))))
- (gnus-summary-high-unread-face ((t (:bold t :foreground "blue"))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "RoyalBlue"))))
- (gnus-summary-low-read-face ((t (:italic t :foreground "DarkGreen"))))
- (gnus-summary-low-ticked-face ((t (:italic t :foreground "firebrick"))))
- (gnus-summary-low-unread-face ((t (:italic t))))
- (gnus-summary-normal-ancient-face ((t (:foreground "RoyalBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "red3"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "black"))))
- (gnus-summary-normal-unread-face ((t (:bold t :foreground "red3"))))
- (gnus-summary-selected-face ((t (:underline t))))
- (highlight ((t (:background "antiquewhite" :foreground "blue"))))
- (italic ((t (:italic t))))
- (makefile-space-face ((t (:background "hotpink"))))
- (message-cited-text-face ((t (:foreground "red"))))
- (message-header-cc-face ((t (:foreground "MidnightBlue"))))
- (message-header-name-face ((t (:foreground "cornflower blue"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "blue4"))))
- (message-header-other-face ((t (:foreground "steel blue"))))
- (message-header-subject-face ((t (:bold t :foreground "navy blue"))))
- (message-header-to-face ((t (:bold t :foreground "MidnightBlue"))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-mml-face ((t (:foreground "ForestGreen"))))
- (message-separator-face ((t (:foreground "brown"))))
- (modeline ((t (:background "plum" :foreground "black"))))
- (modeline-buffer-id ((t (:background "plum" :foreground "black"))))
- (modeline-mousable ((t (:background "plum" :foreground "black"))))
- (modeline-mousable-minor-mode ((t (:background "plum" :foreground "black"))))
- (region ((t (:background "plum"))))
- (secondary-selection ((t (:background "palegreen"))))
- (show-paren-match-face ((t (:background "plum"))))
- (show-paren-mismatch-face ((t (:background "navy" :foreground "white"))))
- (speedbar-button-face ((t (:foreground "green4"))))
- (speedbar-directory-face ((t (:foreground "blue4"))))
- (speedbar-file-face ((t (:foreground "cyan4"))))
- (speedbar-highlight-face ((t (:background "green"))))
- (speedbar-selected-face ((t (:underline t :foreground "red"))))
- (speedbar-tag-face ((t (:foreground "brown"))))
- (underline ((t (:underline t))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (widget-single-line-field-face ((t (:background "gray85")))))))
-
-(defun color-theme-jsc-dark ()
- "Color theme by John S Cooper, created 2000-06-11."
- (interactive)
- (color-theme-install
- '(color-theme-jsc-dark
- ((background-color . "black")
- (background-mode . dark)
- (border-color . "black")
- (cursor-color . "white")
- (foreground-color . "cornsilk")
- (mouse-color . "black"))
- ((gnus-mouse-face . highlight)
- (goto-address-mail-face . italic)
- (goto-address-mail-mouse-face . secondary-selection)
- (goto-address-url-face . bold)
- (goto-address-url-mouse-face . highlight)
- (list-matching-lines-face . bold)
- (view-highlight-face . highlight))
- (blank-space-face ((t (:background "LightGray"))))
- (blank-tab-face ((t (:background "cornsilk" :foreground "black"))))
- (default ((t (nil))))
- (bold ((t (:bold t :foreground "white"))))
- (bold-italic ((t (:italic t :bold t))))
- (calendar-today-face ((t (:underline t))))
- (cperl-array-face ((t (:bold t :background "lightyellow2" :foreground "Blue"))))
- (cperl-hash-face ((t (:italic t :bold t :background "lightyellow2" :foreground "Red"))))
- (cperl-nonoverridable-face ((t (:foreground "chartreuse3"))))
- (custom-button-face ((t (:foreground "white"))))
- (custom-changed-face ((t (:background "skyblue" :foreground "wheat"))))
- (custom-documentation-face ((t (:foreground "white"))))
- (custom-face-tag-face ((t (:underline t :foreground "white"))))
- (custom-group-tag-face ((t (:underline t :foreground "skyblue"))))
- (custom-group-tag-face-1 ((t (:underline t :foreground "pink"))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:foreground "blue"))))
- (custom-state-face ((t (:foreground "light green"))))
- (custom-variable-button-face ((t (:underline t :bold t))))
- (custom-variable-tag-face ((t (:underline t :foreground "skyblue"))))
- (diary-face ((t (:bold t :foreground "orange"))))
- (font-lock-builtin-face ((t (:bold t :foreground "LightSteelBlue"))))
- (font-lock-comment-face ((t (:italic t :foreground "red"))))
- (font-lock-constant-face ((t (:bold t :foreground "salmon"))))
- (font-lock-function-name-face ((t (:bold t :foreground "orange"))))
- (font-lock-keyword-face ((t (:bold t :foreground "gold"))))
- (font-lock-string-face ((t (:italic t :foreground "orange"))))
- (font-lock-type-face ((t (:bold t :foreground "gold"))))
- (font-lock-variable-name-face ((t (:italic t :bold t :foreground "light salmon"))))
- (font-lock-warning-face ((t (:bold t :foreground "gold"))))
- (gnus-cite-attribution-face ((t (:italic t))))
- (gnus-cite-face-1 ((t (:foreground "light cyan"))))
- (gnus-cite-face-10 ((t (:foreground "medium purple"))))
- (gnus-cite-face-11 ((t (:foreground "turquoise"))))
- (gnus-cite-face-2 ((t (:foreground "light blue"))))
- (gnus-cite-face-3 ((t (:foreground "light yellow"))))
- (gnus-cite-face-4 ((t (:foreground "light pink"))))
- (gnus-cite-face-5 ((t (:foreground "pale green"))))
- (gnus-cite-face-6 ((t (:foreground "beige"))))
- (gnus-cite-face-7 ((t (:foreground "orange"))))
- (gnus-cite-face-8 ((t (:foreground "magenta"))))
- (gnus-cite-face-9 ((t (:foreground "violet"))))
- (gnus-emphasis-bold ((t (:bold t))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t))))
- (gnus-emphasis-highlight-words ((t (:background "black" :foreground "yellow"))))
- (gnus-emphasis-italic ((t (:italic t))))
- (gnus-emphasis-underline ((t (:background "goldenrod4" :foreground "white"))))
- (gnus-emphasis-underline-bold ((t (:underline t :bold t :background "yellow" :foreground "black"))))
- (gnus-emphasis-underline-bold-italic ((t (:underline t :italic t :bold t :background "yellow" :foreground "black"))))
- (gnus-emphasis-underline-italic ((t (:underline t :italic t :background "yellow" :foreground "black"))))
- (gnus-filterhist-face-1 ((t (nil))))
- (gnus-group-mail-1-empty-face ((t (:foreground "gray80"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "white"))))
- (gnus-group-mail-2-empty-face ((t (:foreground "lightcyan"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "lightcyan"))))
- (gnus-group-mail-3-empty-face ((t (:foreground "tan"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "tan"))))
- (gnus-group-mail-low-empty-face ((t (:foreground "aquamarine4"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "aquamarine4"))))
- (gnus-group-news-1-empty-face ((t (:foreground "white"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "white"))))
- (gnus-group-news-2-empty-face ((t (:foreground "lightcyan"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "lightcyan"))))
- (gnus-group-news-3-empty-face ((t (:foreground "tan"))))
- (gnus-group-news-3-face ((t (:bold t :foreground "tan"))))
- (gnus-group-news-4-empty-face ((t (:foreground "white"))))
- (gnus-group-news-4-face ((t (:bold t :foreground "white"))))
- (gnus-group-news-5-empty-face ((t (:foreground "wheat"))))
- (gnus-group-news-5-face ((t (:bold t :foreground "wheat"))))
- (gnus-group-news-6-empty-face ((t (:foreground "tan"))))
- (gnus-group-news-6-face ((t (:bold t :foreground "tan"))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkTurquoise"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "DarkTurquoise"))))
- (gnus-header-content-face ((t (:italic t :foreground "plum1"))))
- (gnus-header-from-face ((t (:bold t :foreground "wheat"))))
- (gnus-header-name-face ((t (:bold t :foreground "gold"))))
- (gnus-header-newsgroups-face ((t (:italic t :bold t :foreground "wheat"))))
- (gnus-header-subject-face ((t (:bold t :foreground "red"))))
- (gnus-signature-face ((t (:italic t :foreground "maroon"))))
- (gnus-splash ((t (:foreground "Brown"))))
- (gnus-splash-face ((t (:foreground "gold"))))
- (gnus-summary-cancelled-face ((t (:background "gray" :foreground "black"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "SkyBlue"))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "PaleGreen"))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "gray70"))))
- (gnus-summary-high-unread-face ((t (:italic t :bold t))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "SkyBlue"))))
- (gnus-summary-low-read-face ((t (:italic t :foreground "PaleGreen"))))
- (gnus-summary-low-ticked-face ((t (:italic t :bold t :foreground "gray70"))))
- (gnus-summary-low-unread-face ((t (:italic t))))
- (gnus-summary-normal-ancient-face ((t (:foreground "SkyBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "PaleGreen"))))
- (gnus-summary-normal-ticked-face ((t (:bold t :foreground "gray70"))))
- (gnus-summary-normal-unread-face ((t (:bold t))))
- (gnus-summary-selected-face ((t (:underline t :background "deepskyblue4"))))
- (highlight ((t (:background "darkslategray" :foreground "wheat"))))
- (highlight-changes-delete-face ((t (:underline t :foreground "red"))))
- (highlight-changes-face ((t (:foreground "red"))))
- (highline-face ((t (:background "gray35"))))
- (holiday-face ((t (:background "red"))))
- (info-menu-5 ((t (:underline t))))
- (info-node ((t (:italic t :bold t :foreground "yellow"))))
- (info-xref ((t (:bold t :foreground "plum"))))
- (italic ((t (:italic t))))
- (lazy-highlight-face ((t (:bold t :foreground "dark magenta"))))
- (linemenu-face ((t (:background "gray30"))))
- (makefile-space-face ((t (:background "hotpink"))))
- (message-cited-text-face ((t (:foreground "plum1"))))
- (message-header-cc-face ((t (:bold t :foreground "ivory"))))
- (message-header-name-face ((t (:foreground "light sky blue"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "lavender blush"))))
- (message-header-other-face ((t (:foreground "pale turquoise"))))
- (message-header-subject-face ((t (:bold t :foreground "papaya whip"))))
- (message-header-to-face ((t (:bold t :foreground "floral white"))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-mml-face ((t (:bold t :foreground "ForestGreen"))))
- (message-separator-face ((t (:foreground "sandy brown"))))
- (modeline ((t (:background "tan" :foreground "black"))))
- (modeline-buffer-id ((t (:background "tan" :foreground "black"))))
- (modeline-mousable ((t (:background "tan" :foreground "black"))))
- (modeline-mousable-minor-mode ((t (:background "tan" :foreground "black"))))
- (paren-mismatch-face ((t (:bold t :background "white" :foreground "red"))))
- (paren-no-match-face ((t (:bold t :background "white" :foreground "red"))))
- (region ((t (:background "slategrey"))))
- (secondary-selection ((t (:background "deepskyblue4"))))
- (sgml-doctype-face ((t (:foreground "orange"))))
- (sgml-end-tag-face ((t (:foreground "greenyellow"))))
- (sgml-entity-face ((t (:foreground "gold"))))
- (sgml-ignored-face ((t (:background "gray60" :foreground "gray20"))))
- (sgml-sgml-face ((t (:foreground "yellow"))))
- (sgml-start-tag-face ((t (:foreground "mediumspringgreen"))))
- (show-paren-match-face ((t (:background "deepskyblue4"))))
- (show-paren-mismatch-face ((t (:bold t :background "red" :foreground "white"))))
- (speedbar-button-face ((t (:foreground "green4"))))
- (speedbar-directory-face ((t (:foreground "blue4"))))
- (speedbar-file-face ((t (:bold t :foreground "cyan4"))))
- (speedbar-highlight-face ((t (:background "green"))))
- (speedbar-selected-face ((t (:underline t :foreground "red"))))
- (speedbar-tag-face ((t (:foreground "brown"))))
- (underline ((t (:underline t))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "lime green"))))
- (widget-field-face ((t (:background "gray20"))))
- (widget-inactive-face ((t (:foreground "wheat"))))
- (widget-single-line-field-face ((t (:background "gray20"))))
- (woman-bold-face ((t (:bold t))))
- (woman-italic-face ((t (:foreground "beige"))))
- (woman-unknown-face ((t (:foreground "LightSalmon")))))))
-
-(defun color-theme-greiner ()
- "Color theme by Kevin Greiner, created 2000-06-13.
-Black on Beige, supports default, font-lock, speedbar, custom, widget
-faces. Designed to be easy on the eyes, particularly on Win32
-computers which commonly have white window backgrounds."
- (interactive)
- (color-theme-install
- '(color-theme-greiner
- ((background-color . "beige")
- (background-mode . light)
- (border-color . "black")
- (cursor-color . "black")
- (foreground-color . "black")
- (mouse-color . "black"))
- ((list-matching-lines-face . bold))
- (default ((t (nil))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:italic t :bold t))))
- (custom-button-face ((t (nil))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:underline t))))
- (custom-group-tag-face ((t (:underline t :foreground "blue"))))
- (custom-group-tag-face-1 ((t (:underline t :foreground "red"))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "dark green"))))
- (custom-variable-button-face ((t (:underline t :bold t))))
- (custom-variable-tag-face ((t (:underline t :foreground "blue"))))
- (font-lock-builtin-face ((t (:foreground "blue4"))))
- (font-lock-comment-face ((t (:foreground "Firebrick"))))
- (font-lock-constant-face ((t (:foreground "CadetBlue"))))
- (font-lock-function-name-face ((t (:foreground "Blue"))))
- (font-lock-keyword-face ((t (:foreground "royal blue"))))
- (font-lock-string-face ((t (:foreground "RosyBrown"))))
- (font-lock-type-face ((t (:foreground "ForestGreen"))))
- (font-lock-variable-name-face ((t (:foreground "DarkGoldenrod"))))
- (font-lock-warning-face ((t (:bold t :foreground "Red"))))
- (highlight ((t (:background "darkseagreen2"))))
- (info-menu-5 ((t (:underline t))))
- (info-node ((t (:italic t :bold t))))
- (info-xref ((t (:bold t))))
- (italic ((t (:italic t))))
- (modeline ((t (:background "black" :foreground "white"))))
- (modeline-mousable-minor-mode ((t (:background "black" :foreground "white"))))
- (modeline-mousable ((t (:background "black" :foreground "white"))))
- (modeline-buffer-id ((t (:background "black" :foreground "white"))))
- (region ((t (:background "gray"))))
- (secondary-selection ((t (:background "paleturquoise"))))
- (show-paren-match-face ((t (:background "turquoise"))))
- (show-paren-mismatch-face ((t (:background "purple" :foreground "white"))))
- (speedbar-button-face ((t (:foreground "green4"))))
- (speedbar-directory-face ((t (:foreground "blue4"))))
- (speedbar-file-face ((t (:foreground "cyan4"))))
- (speedbar-highlight-face ((t (:background "green"))))
- (speedbar-selected-face ((t (:underline t :foreground "red"))))
- (speedbar-tag-face ((t (:foreground "brown"))))
- (underline ((t (:underline t))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (widget-single-line-field-face ((t (:background "gray85")))))))
-
-(defun color-theme-jb-simple ()
- "Color theme by jeff, created 2000-06-14.
-Uses white background and bold for many things"
- (interactive)
- (color-theme-install
- '(color-theme-jb-simple
- ((background-color . "white")
- (background-mode . light)
- (background-toolbar-color . "#cf3ccf3ccf3c")
- (border-color . "black")
- (bottom-toolbar-shadow-color . "#79e77df779e7")
- (cursor-color . "black")
- (foreground-color . "black")
- (mouse-color . "black")
- (top-toolbar-shadow-color . "#fffffbeeffff"))
- ((gnus-mouse-face . highlight)
- (list-matching-lines-face . bold)
- (rmail-highlight-face . font-lock-function-name-face)
- (view-highlight-face . highlight))
- (default ((t (nil))))
- (blank-space-face ((t (nil))))
- (blank-tab-face ((t (nil))))
- (blue ((t (nil))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:italic t :bold t))))
- (border-glyph ((t (nil))))
- (calendar-today-face ((t (:underline t))))
- (cperl-array-face ((t (:bold t :background "lightyellow2" :foreground "Blue"))))
- (cperl-hash-face ((t (:italic t :bold t :background "lightyellow2" :foreground "Red"))))
- (cperl-nonoverridable-face ((t (:foreground "chartreuse3"))))
- (custom-button-face ((t (:bold t))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:underline t))))
- (custom-group-tag-face ((t (:underline t :bold t :foreground "blue"))))
- (custom-group-tag-face-1 ((t (:underline t :foreground "red"))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "dark green"))))
- (custom-variable-button-face ((t (:underline t :bold t))))
- (custom-variable-tag-face ((t (:underline t :bold t :foreground "blue"))))
- (diary-face ((t (:bold t :foreground "red"))))
- (ediff-current-diff-face-A ((t (:background "pale green" :foreground "firebrick"))))
- (ediff-current-diff-face-Ancestor ((t (:background "VioletRed" :foreground "Black"))))
- (ediff-current-diff-face-B ((t (:background "Yellow" :foreground "DarkOrchid"))))
- (ediff-current-diff-face-C ((t (:background "Pink" :foreground "Navy"))))
- (ediff-even-diff-face-A ((t (:background "light grey" :foreground "Black"))))
- (ediff-even-diff-face-Ancestor ((t (:background "Grey" :foreground "White"))))
- (ediff-even-diff-face-B ((t (:background "Grey" :foreground "White"))))
- (ediff-even-diff-face-C ((t (:background "light grey" :foreground "Black"))))
- (ediff-fine-diff-face-A ((t (:background "sky blue" :foreground "Navy"))))
- (ediff-fine-diff-face-Ancestor ((t (:background "Green" :foreground "Black"))))
- (ediff-fine-diff-face-B ((t (:background "cyan" :foreground "Black"))))
- (ediff-fine-diff-face-C ((t (:background "Turquoise" :foreground "Black"))))
- (ediff-odd-diff-face-A ((t (:background "Grey" :foreground "White"))))
- (ediff-odd-diff-face-Ancestor ((t (:background "light grey" :foreground "Black"))))
- (ediff-odd-diff-face-B ((t (:background "light grey" :foreground "Black"))))
- (ediff-odd-diff-face-C ((t (:background "Grey" :foreground "White"))))
- (erc-action-face ((t (:bold t))))
- (erc-bold-face ((t (:bold t))))
- (erc-default-face ((t (nil))))
- (erc-direct-msg-face ((t (nil))))
- (erc-error-face ((t (:bold t))))
- (erc-input-face ((t (nil))))
- (erc-inverse-face ((t (nil))))
- (erc-notice-face ((t (nil))))
- (erc-pal-face ((t (nil))))
- (erc-prompt-face ((t (nil))))
- (erc-underline-face ((t (nil))))
- (eshell-ls-archive-face ((t (:bold t :foreground "Orchid"))))
- (eshell-ls-backup-face ((t (:foreground "OrangeRed"))))
- (eshell-ls-clutter-face ((t (:bold t :foreground "OrangeRed"))))
- (eshell-ls-directory-face ((t (:bold t :foreground "Blue"))))
- (eshell-ls-executable-face ((t (:bold t :foreground "ForestGreen"))))
- (eshell-ls-missing-face ((t (:bold t :foreground "Red"))))
- (eshell-ls-picture-face ((t (nil))))
- (eshell-ls-product-face ((t (:foreground "OrangeRed"))))
- (eshell-ls-readonly-face ((t (:foreground "Brown"))))
- (eshell-ls-special-face ((t (:bold t :foreground "Magenta"))))
- (eshell-ls-symlink-face ((t (:bold t :foreground "DarkCyan"))))
- (eshell-ls-unreadable-face ((t (:foreground "Grey30"))))
- (eshell-prompt-face ((t (:bold t :foreground "Red"))))
- (eshell-test-failed-face ((t (:bold t :foreground "OrangeRed"))))
- (eshell-test-ok-face ((t (:bold t :foreground "Green"))))
- (excerpt ((t (:italic t))))
- (ff-paths-non-existant-file-face ((t (:bold t :foreground "NavyBlue"))))
- (fixed ((t (:bold t))))
- (flyspell-duplicate-face ((t (:underline t :bold t :foreground "Gold3"))))
- (flyspell-incorrect-face ((t (:underline t :bold t :foreground "OrangeRed"))))
- (font-latex-bold-face ((t (nil))))
- (font-latex-italic-face ((t (nil))))
- (font-latex-math-face ((t (nil))))
- (font-latex-sedate-face ((t (nil))))
- (font-latex-string-face ((t (nil))))
- (font-latex-warning-face ((t (nil))))
- (font-lock-builtin-face ((t (:bold t :foreground "Orchid"))))
- (font-lock-comment-face ((t (:italic t :bold t :foreground "blue4"))))
- (font-lock-constant-face ((t (:bold t :foreground "CadetBlue"))))
- (font-lock-doc-string-face ((t (:italic t :bold t :foreground "blue4"))))
- (font-lock-exit-face ((t (nil))))
- (font-lock-function-name-face ((t (:bold t :foreground "brown4"))))
- (font-lock-keyword-face ((t (:bold t :foreground "black"))))
- (font-lock-preprocessor-face ((t (:foreground "blue3"))))
- (font-lock-reference-face ((t (:foreground "red3"))))
- (font-lock-string-face ((t (:italic t :bold t :foreground "green4"))))
- (font-lock-type-face ((t (:bold t :foreground "steelblue"))))
- (font-lock-variable-name-face ((t (:italic t :bold t :foreground "magenta4"))))
- (font-lock-warning-face ((t (:bold t :foreground "Red"))))
- (gnus-cite-attribution-face ((t (:italic t :bold t))))
- (gnus-cite-face-1 ((t (:foreground "MidnightBlue"))))
- (gnus-cite-face-10 ((t (:foreground "medium purple"))))
- (gnus-cite-face-11 ((t (:foreground "turquoise"))))
- (gnus-cite-face-2 ((t (:foreground "firebrick"))))
- (gnus-cite-face-3 ((t (:foreground "dark green"))))
- (gnus-cite-face-4 ((t (:foreground "OrangeRed"))))
- (gnus-cite-face-5 ((t (:foreground "dark khaki"))))
- (gnus-cite-face-6 ((t (:foreground "dark violet"))))
- (gnus-cite-face-7 ((t (:foreground "SteelBlue4"))))
- (gnus-cite-face-8 ((t (:foreground "magenta"))))
- (gnus-cite-face-9 ((t (:foreground "violet"))))
- (gnus-emphasis-bold ((t (:bold t))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t))))
- (gnus-emphasis-highlight-words ((t (nil))))
- (gnus-emphasis-italic ((t (:italic t))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:underline t :bold t))))
- (gnus-emphasis-underline-bold-italic ((t (:underline t :italic t :bold t))))
- (gnus-emphasis-underline-italic ((t (:underline t :italic t))))
- (gnus-filterhist-face-1 ((t (nil))))
- (gnus-group-mail-1-empty-face ((t (:foreground "DeepPink3"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "DeepPink3"))))
- (gnus-group-mail-2-empty-face ((t (:foreground "HotPink3"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "HotPink3"))))
- (gnus-group-mail-3-empty-face ((t (:foreground "magenta4"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "magenta4"))))
- (gnus-group-mail-low-empty-face ((t (:foreground "DeepPink4"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "DeepPink4"))))
- (gnus-group-news-1-empty-face ((t (:foreground "ForestGreen"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "ForestGreen"))))
- (gnus-group-news-2-empty-face ((t (:foreground "CadetBlue4"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "CadetBlue4"))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (:bold t))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (:bold t))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (:bold t))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (:bold t))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkGreen"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "DarkGreen"))))
- (gnus-header-content-face ((t (:italic t :foreground "indianred4"))))
- (gnus-header-from-face ((t (:bold t :foreground "red3"))))
- (gnus-header-name-face ((t (:bold t :foreground "maroon"))))
- (gnus-header-newsgroups-face ((t (:italic t :bold t :foreground "MidnightBlue"))))
- (gnus-header-subject-face ((t (:bold t :foreground "red4"))))
- (gnus-signature-face ((t (:italic t))))
- (gnus-splash ((t (nil))))
- (gnus-splash-face ((t (:foreground "ForestGreen"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "RoyalBlue"))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "DarkGreen"))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "firebrick"))))
- (gnus-summary-high-unread-face ((t (:italic t :bold t))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "RoyalBlue"))))
- (gnus-summary-low-read-face ((t (:italic t :foreground "DarkGreen"))))
- (gnus-summary-low-ticked-face ((t (:italic t :bold t :foreground "firebrick"))))
- (gnus-summary-low-unread-face ((t (:italic t))))
- (gnus-summary-normal-ancient-face ((t (:foreground "RoyalBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "DarkGreen"))))
- (gnus-summary-normal-ticked-face ((t (:bold t :foreground "firebrick"))))
- (gnus-summary-normal-unread-face ((t (:bold t))))
- (gnus-summary-selected-face ((t (:underline t))))
- (green ((t (nil))))
- (gui-button-face ((t (:background "grey75"))))
- (gui-element ((t (:background "Gray80"))))
- (highlight ((t (:background "darkseagreen2"))))
- (highlight-changes-delete-face ((t (:underline t :foreground "red"))))
- (highlight-changes-face ((t (:foreground "red"))))
- (highline-face ((t (:background "paleturquoise"))))
- (holiday-face ((t (:background "pink"))))
- (html-helper-italic-face ((t (:italic t))))
- (info-menu-5 ((t (:underline t))))
- (info-node ((t (:italic t :bold t))))
- (info-xref ((t (:bold t))))
- (isearch ((t (nil))))
- (italic ((t (:italic t))))
- (lazy-highlight-face ((t (:bold t :foreground "dark magenta"))))
- (left-margin ((t (nil))))
- (linemenu-face ((t (nil))))
- (list-mode-item-selected ((t (nil))))
- (makefile-space-face ((t (:background "hotpink"))))
- (message-cited-text-face ((t (:foreground "red"))))
- (message-header-cc-face ((t (:bold t :foreground "MidnightBlue"))))
- (message-header-name-face ((t (:foreground "cornflower blue"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "blue4"))))
- (message-header-other-face ((t (:foreground "steel blue"))))
- (message-header-subject-face ((t (:bold t :foreground "navy blue"))))
- (message-header-to-face ((t (:bold t :foreground "MidnightBlue"))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-mml-face ((t (:bold t))))
- (message-separator-face ((t (:foreground "brown"))))
- (modeline ((t (:background "darkblue" :foreground "yellow"))))
- (modeline-buffer-id ((t (:background "black" :foreground "white"))))
- (modeline-mousable ((t (:background "black" :foreground "white"))))
- (modeline-mousable-minor-mode ((t (:background "black" :foreground "white"))))
- (nil ((t (nil))))
- (paren-mismatch-face ((t (:bold t))))
- (paren-no-match-face ((t (:bold t))))
- (pointer ((t (nil))))
- (primary-selection ((t (nil))))
- (red ((t (nil))))
- (region ((t (:background "gray"))))
- (right-margin ((t (nil))))
- (secondary-selection ((t (:background "paleturquoise"))))
- (sgml-doctype-face ((t (nil))))
- (sgml-end-tag-face ((t (nil))))
- (sgml-entity-face ((t (nil))))
- (sgml-ignored-face ((t (nil))))
- (sgml-sgml-face ((t (nil))))
- (sgml-start-tag-face ((t (nil))))
- (show-paren-match-face ((t (:background "turquoise"))))
- (show-paren-mismatch-face ((t (:bold t :background "purple" :foreground "white"))))
- (speedbar-button-face ((t (:bold t :foreground "green4"))))
- (speedbar-directory-face ((t (:bold t :foreground "blue4"))))
- (speedbar-file-face ((t (:bold t :foreground "cyan4"))))
- (speedbar-highlight-face ((t (:background "green"))))
- (speedbar-selected-face ((t (:underline t :foreground "red"))))
- (speedbar-tag-face ((t (:foreground "brown"))))
- (swbuff-current-buffer-face ((t (:bold t))))
- (term-black ((t (:foreground "black"))))
- (term-blackbg ((t (:background "black"))))
- (term-blue ((t (:foreground "blue"))))
- (term-bluebg ((t (:background "blue"))))
- (term-bold ((t (:bold t))))
- (term-cyan ((t (:foreground "cyan"))))
- (term-cyanbg ((t (:background "cyan"))))
- (term-default-bg ((t (nil))))
- (term-default-bg-inv ((t (nil))))
- (term-default-fg ((t (nil))))
- (term-default-fg-inv ((t (nil))))
- (term-green ((t (:foreground "green"))))
- (term-greenbg ((t (:background "green"))))
- (term-invisible ((t (nil))))
- (term-invisible-inv ((t (nil))))
- (term-magenta ((t (:foreground "magenta"))))
- (term-magentabg ((t (:background "magenta"))))
- (term-red ((t (:foreground "red"))))
- (term-redbg ((t (:background "red"))))
- (term-underline ((t (:underline t))))
- (term-white ((t (:foreground "white"))))
- (term-whitebg ((t (:background "white"))))
- (term-yellow ((t (:foreground "yellow"))))
- (term-yellowbg ((t (:background "yellow"))))
- (text-cursor ((t (nil))))
- (toolbar ((t (nil))))
- (underline ((t (:underline t))))
- (vc-annotate-face-0046FF ((t (nil))))
- (vcursor ((t (:underline t :background "cyan" :foreground "blue"))))
- (vertical-divider ((t (nil))))
- (vhdl-font-lock-attribute-face ((t (:foreground "Orchid"))))
- (vhdl-font-lock-directive-face ((t (:foreground "CadetBlue"))))
- (vhdl-font-lock-enumvalue-face ((t (:foreground "Gold4"))))
- (vhdl-font-lock-function-face ((t (:foreground "Orchid4"))))
- (vhdl-font-lock-prompt-face ((t (:bold t :foreground "Red"))))
- (vhdl-font-lock-reserved-words-face ((t (:bold t :foreground "Orange"))))
- (vhdl-font-lock-translate-off-face ((t (:background "LightGray"))))
- (vhdl-speedbar-architecture-face ((t (:foreground "Blue"))))
- (vhdl-speedbar-architecture-selected-face ((t (:underline t :foreground "Blue"))))
- (vhdl-speedbar-configuration-face ((t (:foreground "DarkGoldenrod"))))
- (vhdl-speedbar-configuration-selected-face ((t (:underline t :foreground "DarkGoldenrod"))))
- (vhdl-speedbar-entity-face ((t (:foreground "ForestGreen"))))
- (vhdl-speedbar-entity-selected-face ((t (:underline t :foreground "ForestGreen"))))
- (vhdl-speedbar-instantiation-face ((t (:foreground "Brown"))))
- (vhdl-speedbar-instantiation-selected-face ((t (:underline t :foreground "Brown"))))
- (vhdl-speedbar-package-face ((t (:foreground "Grey50"))))
- (vhdl-speedbar-package-selected-face ((t (:underline t :foreground "Grey50"))))
- (viper-minibuffer-emacs-face ((t (:background "darkseagreen2" :foreground "Black"))))
- (viper-minibuffer-insert-face ((t (:background "pink" :foreground "Black"))))
- (viper-minibuffer-vi-face ((t (:background "grey" :foreground "DarkGreen"))))
- (viper-replace-overlay-face ((t (:background "darkseagreen2" :foreground "Black"))))
- (viper-search-face ((t (:background "khaki" :foreground "Black"))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (widget-single-line-field-face ((t (:background "gray85"))))
- (woman-bold-face ((t (:bold t))))
- (woman-italic-face ((t (nil))))
- (woman-unknown-face ((t (nil))))
- (yellow ((t (nil))))
- (zmacs-region ((t (nil)))))))
-
-(defun color-theme-beige-diff ()
- "Brownish faces for diff and change-log modes.
-This is intended for other color themes to use (eg. `color-theme-gnome2'
-and `color-theme-blue-sea')."
- (color-theme-install
- '(color-theme-beige-diff
- nil
- (change-log-acknowledgement-face ((t (:foreground "firebrick"))))
- (change-log-conditionals-face ((t (:foreground "khaki" :background "sienna"))))
- (change-log-date-face ((t (:foreground "gold"))))
- (change-log-email-face ((t (:foreground "khaki" :underline t))))
- (change-log-file-face ((t (:bold t :foreground "lemon chiffon"))))
- (change-log-function-face ((t (:foreground "khaki" :background "sienna"))))
- (change-log-list-face ((t (:foreground "wheat"))))
- (change-log-name-face ((t (:bold t :foreground "light goldenrod"))))
- (diff-added-face ((t (nil))))
- (diff-changed-face ((t (nil))))
- (diff-context-face ((t (:foreground "grey50"))))
- (diff-file-header-face ((t (:bold t :foreground "lemon chiffon"))))
- (diff-function-face ((t (:foreground "grey50"))))
- (diff-header-face ((t (:foreground "lemon chiffon"))))
- (diff-hunk-header-face ((t (:foreground "light goldenrod"))))
- (diff-index-face ((t (:bold t :underline t))))
- (diff-nonexistent-face ((t (:bold t :background "grey70" :weight bold))))
- (diff-removed-face ((t (nil))))
- (log-view-message-face ((t (:foreground "lemon chiffon")))))))
-
-(defun color-theme-standard-ediff ()
- "Standard colors for ediff faces.
-This is intended for other color themes to use
-\(eg. `color-theme-goldenrod')."
- (color-theme-install
- '(color-theme-beige-diff
- nil
- (ediff-current-diff-face-A ((t (:background "pale green" :foreground "firebrick"))))
- (ediff-current-diff-face-Ancestor ((t (:background "VioletRed" :foreground "Black"))))
- (ediff-current-diff-face-B ((t (:background "Yellow" :foreground "DarkOrchid"))))
- (ediff-current-diff-face-C ((t (:background "Pink" :foreground "Navy"))))
- (ediff-even-diff-face-A ((t (:background "light grey" :foreground "Black"))))
- (ediff-even-diff-face-Ancestor ((t (:background "Grey" :foreground "White"))))
- (ediff-even-diff-face-B ((t (:background "Grey" :foreground "White"))))
- (ediff-even-diff-face-C ((t (:background "light grey" :foreground "Black"))))
- (ediff-fine-diff-face-A ((t (:background "sky blue" :foreground "Navy"))))
- (ediff-fine-diff-face-Ancestor ((t (:background "Green" :foreground "Black"))))
- (ediff-fine-diff-face-B ((t (:background "cyan" :foreground "Black"))))
- (ediff-fine-diff-face-C ((t (:background "Turquoise" :foreground "Black"))))
- (ediff-odd-diff-face-A ((t (:background "Grey" :foreground "White"))))
- (ediff-odd-diff-face-Ancestor ((t (:background "light grey" :foreground "Black"))))
- (ediff-odd-diff-face-B ((t (:background "light grey" :foreground "Black"))))
- (ediff-odd-diff-face-C ((t (:background "Grey" :foreground "White")))))))
-
-(defun color-theme-beige-eshell ()
- "Brownish colors for eshell faces only.
-This is intended for other color themes to use (eg. `color-theme-goldenrod')."
- (color-theme-install
- '(color-theme-beige-eshell
- nil
- (eshell-ls-archive-face ((t (:bold t :foreground "IndianRed"))))
- (eshell-ls-backup-face ((t (:foreground "Grey"))))
- (eshell-ls-clutter-face ((t (:foreground "DimGray"))))
- (eshell-ls-directory-face ((t (:bold t :foreground "dark khaki"))))
- (eshell-ls-executable-face ((t (:foreground "Coral"))))
- (eshell-ls-missing-face ((t (:foreground "black"))))
- (eshell-ls-picture-face ((t (:foreground "gold")))) ; non-standard face
- (eshell-ls-product-face ((t (:foreground "dark sea green"))))
- (eshell-ls-readonly-face ((t (:foreground "light steel blue"))))
- (eshell-ls-special-face ((t (:foreground "gold"))))
- (eshell-ls-symlink-face ((t (:foreground "peach puff"))))
- (eshell-ls-text-face ((t (:foreground "moccasin")))) ; non-standard face
- (eshell-ls-todo-face ((t (:bold t :foreground "yellow green")))) ; non-standard face
- (eshell-ls-unreadable-face ((t (:foreground "DimGray"))))
- (eshell-prompt-face ((t (:foreground "lemon chiffon")))))))
-
-(defun color-theme-goldenrod ()
- "Brown color theme. Very different from the others.
-Supports standard, font-lock and info faces, and it uses
-`color-theme-blue-gnus', `color-theme-blue-erc' , and
-`color-theme-beige-diff'."
- (interactive)
- (color-theme-blue-gnus)
- (let ((color-theme-is-cumulative t))
- (color-theme-blue-erc)
- (color-theme-beige-diff)
- (color-theme-beige-eshell)
- (color-theme-install
- '(color-theme-goldenrod
- ((background-color . "black")
- (background-mode . dark)
- (border-color . "black")
- (cursor-color . "light goldenrod")
- (foreground-color . "goldenrod")
- (mouse-color . "goldenrod"))
- ((goto-address-mail-face . info-xref)
- (list-matching-lines-face . bold)
- (view-highlight-face . highlight))
- (default ((t (nil))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:italic t :bold t :foreground "lavender"))))
- (font-lock-builtin-face ((t (:foreground "pale goldenrod"))))
- (font-lock-comment-face ((t (:foreground "indian red"))))
- (font-lock-constant-face ((t (:foreground "pale green"))))
- (font-lock-function-name-face ((t (:bold t :foreground "lemon chiffon"))))
- (font-lock-keyword-face ((t (:foreground "wheat"))))
- (font-lock-string-face ((t (:foreground "gold"))))
- (font-lock-type-face ((t (:foreground "dark khaki" :bold t))))
- (font-lock-variable-name-face ((t (:bold t :foreground "khaki"))))
- (font-lock-warning-face ((t (:bold t :foreground "orange red"))))
- (fringe ((t (:background "gray25"))))
- (header-line ((t (:background "gray20" :foreground "gray70"))))
- (highlight ((t (:background "dark slate blue"))))
- (info-menu-5 ((t (:underline t))))
- (info-node ((t (:bold t))))
- (info-xref ((t (:bold t :foreground "pale goldenrod"))))
- (isearch ((t (:background "SeaGreen4"))))
- (isearch-lazy-highlight-face ((t (:background "DarkOliveGreen4"))))
- (italic ((t (:italic t :foreground "lavender"))))
- (menu ((t (:background "gray25" :foreground "lemon chiffon"))))
- (modeline ((t (:background "gray40" :foreground "lemon chiffon" :box (:line-width 1 :style released-button)))))
- (modeline-buffer-id ((t (:background "AntiqueWhite4" :foreground "lemon chiffon"))))
- (modeline-mousable ((t (:background "AntiqueWhite4" :foreground "lemon chiffon"))))
- (modeline-mousable-minor-mode ((t (:background "wheat" :foreground "lemon chiffon"))))
- (mode-line-inactive ((t (:background "gray20" :foreground "lemon chiffon" :box (:line-width 1 :style released-button)))))
- (region ((t (:background "dark olive green"))))
- (secondary-selection ((t (:background "dark green"))))
- (tool-bar ((t (:background "gray25" :foreground "lemon chiffon" :box (:line-width 1 :style released-button)))))
- (underline ((t (:underline t))))))))
-
-(defun color-theme-ramangalahy ()
- "Color theme by Solofo Ramangalahy, created 2000-10-18.
-Black on light grey, includes faces for vm, ispell, gnus,
-dired, display-time, cperl, font-lock, widget, x-symbol."
- (interactive)
- (color-theme-install
- '(color-theme-ramangalahy
- ((background-color . "lightgrey")
- (background-mode . light)
- (background-toolbar-color . "#bfbfbfbfbfbf")
- (border-color . "#000000000000")
- (bottom-toolbar-shadow-color . "#737373737373")
- (cursor-color . "blue")
- (foreground-color . "black")
- (top-toolbar-shadow-color . "#e6e6e6e6e6e6"))
- ((gnus-mouse-face . highlight)
- (goto-address-mail-face . info-xref)
- (ispell-highlight-face . highlight)
- (notes-bold-face . notes-bold-face)
- (setnu-line-number-face . bold)
- (tinyreplace-:face . highlight)
- (vm-highlight-url-face . bold-italic)
- (vm-highlighted-header-face . bold)
- (vm-mime-button-face . gui-button-face)
- (vm-summary-highlight-face . bold))
- (default ((t (nil))))
- (bbdb-company ((t (nil))))
- (blue ((t (:foreground "blue"))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:italic t :bold t))))
- (border-glyph ((t (nil))))
- (cperl-here-face ((t (:foreground "green4"))))
- (cperl-pod-face ((t (:foreground "brown4"))))
- (cperl-pod-head-face ((t (:foreground "steelblue"))))
- (custom-button-face ((t (:bold t))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:underline t))))
- (custom-group-tag-face ((t (:underline t :foreground "blue"))))
- (custom-group-tag-face-1 ((t (:underline t :foreground "red"))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "dark green"))))
- (custom-variable-button-face ((t (:underline t :bold t))))
- (custom-variable-tag-face ((t (:underline t :foreground "blue"))))
- (dired-face-boring ((t (:foreground "Gray65"))))
- (dired-face-directory ((t (:bold t))))
- (dired-face-executable ((t (:foreground "SeaGreen"))))
- (dired-face-flagged ((t (:background "LightSlateGray"))))
- (dired-face-marked ((t (:background "PaleVioletRed"))))
- (dired-face-permissions ((t (:background "grey75" :foreground "black"))))
- (dired-face-setuid ((t (:foreground "Red"))))
- (dired-face-socket ((t (:foreground "magenta"))))
- (dired-face-symlink ((t (:foreground "blue"))))
- (display-time-mail-balloon-enhance-face ((t (:background "orange"))))
- (display-time-mail-balloon-gnus-group-face ((t (:foreground "blue"))))
- (display-time-time-balloon-face ((t (:foreground "red"))))
- (ff-paths-non-existant-file-face ((t (:bold t :foreground "NavyBlue"))))
- (font-lock-comment-face ((t (:bold t :foreground "purple"))))
- (font-lock-doc-string-face ((t (:bold t :foreground "slateblue"))))
- (font-lock-emphasized-face ((t (:bold t :background "lightyellow2"))))
- (font-lock-function-name-face ((t (:bold t :foreground "blue"))))
- (font-lock-keyword-face ((t (:bold t :foreground "violetred"))))
- (font-lock-other-emphasized-face ((t (:italic t :bold t :background "lightyellow2"))))
- (font-lock-other-type-face ((t (:bold t :foreground "orange3"))))
- (font-lock-preprocessor-face ((t (:bold t :foreground "mediumblue"))))
- (font-lock-reference-face ((t (:foreground "red3"))))
- (font-lock-string-face ((t (:foreground "green4"))))
- (font-lock-type-face ((t (:bold t :foreground "steelblue"))))
- (font-lock-variable-name-face ((t (:foreground "magenta4"))))
- (font-lock-warning-face ((t (:bold t :background "yellow" :foreground "Red"))))
- (gnus-emphasis-bold ((t (:bold t))))
- (gnus-emphasis-bold-italic ((t (nil))))
- (gnus-emphasis-italic ((t (nil))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:underline t :bold t))))
- (gnus-emphasis-underline-bold-italic ((t (:underline t))))
- (gnus-emphasis-underline-italic ((t (:underline t))))
- (gnus-group-mail-1-empty-face ((t (:foreground "DeepPink3"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "DeepPink3"))))
- (gnus-group-mail-2-empty-face ((t (:foreground "HotPink3"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "HotPink3"))))
- (gnus-group-mail-3-empty-face ((t (:foreground "magenta4"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "magenta4"))))
- (gnus-group-mail-low-empty-face ((t (:foreground "DeepPink4"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "DeepPink4"))))
- (gnus-group-news-1-empty-face ((t (:foreground "ForestGreen"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "ForestGreen"))))
- (gnus-group-news-2-empty-face ((t (:foreground "CadetBlue4"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "CadetBlue4"))))
- (gnus-group-news-3-empty-face ((t (:foreground "DeepPink4"))))
- (gnus-group-news-3-face ((t (:bold t :foreground "DeepPink4"))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkGreen"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "DarkGreen"))))
- (gnus-header-content-face ((t (:foreground "indianred4"))))
- (gnus-header-from-face ((t (:foreground "red3"))))
- (gnus-header-name-face ((t (:foreground "maroon"))))
- (gnus-header-newsgroups-face ((t (:foreground "MidnightBlue"))))
- (gnus-header-subject-face ((t (:foreground "red4"))))
- (gnus-signature-face ((t (:bold t))))
- (gnus-splash-face ((t (:foreground "ForestGreen"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "RoyalBlue"))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "DarkGreen"))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "firebrick"))))
- (gnus-summary-high-unread-face ((t (:bold t))))
- (gnus-summary-low-ancient-face ((t (:foreground "RoyalBlue"))))
- (gnus-summary-low-read-face ((t (:foreground "DarkGreen"))))
- (gnus-summary-low-ticked-face ((t (:foreground "firebrick"))))
- (gnus-summary-low-unread-face ((t (nil))))
- (gnus-summary-normal-ancient-face ((t (:foreground "RoyalBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "DarkGreen"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "firebrick"))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-selected-face ((t (:underline t))))
- (gnus-x-face ((t (:background "lightgrey" :foreground "black"))))
- (green ((t (:foreground "green"))))
- (gui-button-face ((t (:background "grey75" :foreground "black"))))
- (gui-element ((t (:background "lightgrey"))))
- (highlight ((t (:background "darkseagreen2"))))
- (info-node ((t (:underline t :bold t :foreground "mediumpurple"))))
- (info-xref ((t (:underline t :bold t :foreground "#0000ee"))))
- (isearch ((t (:background "paleturquoise"))))
- (italic ((t (:italic t))))
- (left-margin ((t (nil))))
- (list-mode-item-selected ((t (:background "gray68" :foreground "black"))))
- (message-cited-text ((t (:foreground "slategrey"))))
- (message-cited-text-face ((t (:foreground "red"))))
- (message-header-cc-face ((t (:foreground "MidnightBlue"))))
- (message-header-contents ((t (:italic t))))
- (message-header-name-face ((t (:foreground "cornflower blue"))))
- (message-header-newsgroups-face ((t (:bold t :foreground "blue4"))))
- (message-header-other-face ((t (:foreground "steel blue"))))
- (message-header-subject-face ((t (:bold t :foreground "navy blue"))))
- (message-header-to-face ((t (:bold t :foreground "MidnightBlue"))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-headers ((t (:bold t))))
- (message-highlighted-header-contents ((t (:bold t))))
- (message-separator-face ((t (:foreground "brown"))))
- (message-url ((t (:bold t))))
- (modeline ((t (:bold t :background "Gray75" :foreground "Black"))))
- (modeline-buffer-id ((t (:bold t :background "Gray75" :foreground "blue4"))))
- (modeline-mousable ((t (:bold t :background "Gray75" :foreground "firebrick"))))
- (modeline-mousable-minor-mode ((t (:bold t :background "Gray75" :foreground "green4"))))
- (paren-blink-off ((t (:foreground "lightgrey"))))
- (paren-match ((t (:background "darkseagreen2"))))
- (paren-mismatch ((t (:background "DeepPink" :foreground "black"))))
- (pointer ((t (:foreground "blue"))))
- (primary-selection ((t (:background "gray65"))))
- (red ((t (:foreground "red"))))
- (region ((t (:background "black" :foreground "white"))))
- (right-margin ((t (nil))))
- (searchm-buffer ((t (:bold t :background "white" :foreground "red"))))
- (searchm-button ((t (:bold t :background "CadetBlue" :foreground "white"))))
- (searchm-field ((t (:background "grey89"))))
- (searchm-field-label ((t (:bold t))))
- (searchm-highlight ((t (:bold t :background "darkseagreen2" :foreground "black"))))
- (secondary-selection ((t (:background "paleturquoise"))))
- (template-message-face ((t (:bold t))))
- (text-cursor ((t (:background "blue" :foreground "lightgrey"))))
- (toolbar ((t (nil))))
- (underline ((t (:underline t))))
- (vertical-divider ((t (nil))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (x-face ((t (:background "white" :foreground "black"))))
- (x-symbol-adobe-fontspecific-face ((t (nil))))
- (x-symbol-face ((t (nil))))
- (x-symbol-heading-face ((t (:underline t :bold t :foreground "green4"))))
- (x-symbol-info-face ((t (:foreground "green4"))))
- (x-symbol-invisible-face ((t (nil))))
- (x-symbol-revealed-face ((t (:background "pink"))))
- (yellow ((t (:foreground "yellow"))))
- (zmacs-region ((t (:background "yellow")))))))
-
-(defun color-theme-raspopovic ()
- "Color theme by Pedja Raspopovic, created 2000-10-19.
-Includes faces for dired, font-lock, info, paren."
- (interactive)
- (color-theme-install
- '(color-theme-raspopovic
- ((background-color . "darkblue")
- (background-mode . light)
- (background-toolbar-color . "#bfbfbfbfbfbf")
- (border-color . "#000000000000")
- (bottom-toolbar-shadow-color . "#737373737373")
- (cursor-color . "Red3")
- (foreground-color . "yellow")
- (top-toolbar-shadow-color . "#e6e6e6e6e6e6"))
- ((setnu-line-number-face . bold)
- (goto-address-mail-face . info-xref))
- (default ((t (nil))))
- (blue ((t (:background "darkblue" :foreground "blue"))))
- (bold ((t (:bold t :background "darkblue" :foreground "yellow"))))
- (bold-italic ((t (:bold t :background "darkblue" :foreground "red3"))))
- (comint-input-face ((t (:foreground "deepskyblue"))))
- (dired-face-boring ((t (:foreground "Gray65"))))
- (dired-face-directory ((t (:foreground "lightgreen"))))
- (dired-face-executable ((t (:foreground "indianred"))))
- (dired-face-flagged ((t (:background "LightSlateGray"))))
- (dired-face-marked ((t (:background "darkblue" :foreground "deepskyblue"))))
- (dired-face-permissions ((t (:background "darkblue" :foreground "white"))))
- (dired-face-setuid ((t (:foreground "Red"))))
- (dired-face-socket ((t (:foreground "magenta"))))
- (dired-face-symlink ((t (:foreground "grey95"))))
- (font-lock-comment-face ((t (:background "darkblue" :foreground "lightgreen"))))
- (font-lock-doc-string-face ((t (:background "darkblue" :foreground "darkseagreen"))))
- (font-lock-function-name-face ((t (:bold t :background "darkblue" :foreground "indianred"))))
- (font-lock-keyword-face ((t (:background "darkblue" :foreground "skyblue"))))
- (font-lock-preprocessor-face ((t (:background "darkblue" :foreground "orange"))))
- (font-lock-reference-face ((t (:background "darkblue" :foreground "deepskyblue"))))
- (font-lock-string-face ((t (:background "darkblue" :foreground "lightgrey"))))
- (font-lock-type-face ((t (:background "darkblue" :foreground "orange"))))
- (font-lock-variable-name-face ((t (:background "darkblue" :foreground "white"))))
- (green ((t (:background "darkblue" :foreground "green"))))
- (gui-button-face ((t (:background "grey75" :foreground "black"))))
- (highlight ((t (:background "yellow" :foreground "darkblue"))))
- (info-node ((t (:bold t :background "darkblue" :foreground "red3"))))
- (info-xref ((t (:bold t :background "darkblue" :foreground "yellow"))))
- (isearch ((t (:background "yellow" :foreground "darkblue"))))
- (isearch-secondary ((t (:foreground "red3"))))
- (italic ((t (:background "darkblue" :foreground "red3"))))
- (left-margin ((t (:background "darkblue" :foreground "yellow"))))
- (list-mode-item-selected ((t (:background "gray68" :foreground "yellow"))))
- (makefile-space-face ((t (:background "hotpink"))))
- (modeline ((t (:background "Gray75" :foreground "Black"))))
- (modeline-buffer-id ((t (:background "Gray75" :foreground "blue"))))
- (modeline-mousable ((t (:background "Gray75" :foreground "red"))))
- (modeline-mousable-minor-mode ((t (:background "Gray75" :foreground "green4"))))
- (paren-blink-off ((t (:foreground "darkblue"))))
- (paren-match ((t (:background "yellow" :foreground "darkblue"))))
- (paren-mismatch ((t (:background "DeepPink" :foreground "yellow"))))
- (pointer ((t (:background "darkblue" :foreground "red3"))))
- (primary-selection ((t (:background "yellow" :foreground "darkblue"))))
- (red ((t (:background "darkblue" :foreground "red"))))
- (right-margin ((t (:background "darkblue" :foreground "yellow"))))
- (secondary-selection ((t (:background "darkblue" :foreground "yellow"))))
- (shell-option-face ((t (:background "darkblue" :foreground "cyan2"))))
- (shell-output-2-face ((t (:background "darkblue" :foreground "darkseagreen"))))
- (shell-output-3-face ((t (:background "darkblue" :foreground "lightgrey"))))
- (shell-output-face ((t (:background "darkblue" :foreground "white"))))
- (shell-prompt-face ((t (:background "darkblue" :foreground "red"))))
- (text-cursor ((t (:background "Red3" :foreground "white"))))
- (underline ((t (:underline t :background "darkblue" :foreground "yellow"))))
- (vvb-face ((t (:background "pink" :foreground "black"))))
- (yellow ((t (:background "darkblue" :foreground "yellow"))))
- (zmacs-region ((t (:background "gray" :foreground "black")))))))
-
-(defun color-theme-taylor ()
- "Color theme by Art Taylor, created 2000-10-20.
-Wheat on black. Includes faces for font-lock, gnus, paren."
- (interactive)
- (color-theme-install
- '(color-theme-taylor
- ((background-color . "black")
- (background-mode . dark)
- (border-color . "black")
- (cursor-color . "red")
- (foreground-color . "wheat")
- (mouse-color . "black"))
- ((gnus-mouse-face . highlight)
- (list-matching-lines-face . bold)
- (view-highlight-face . highlight))
- (default ((t (nil))))
- (bold ((t (:bold t :background "grey40" :foreground "yellow"))))
- (bold-italic ((t (:italic t :bold t :foreground "yellow green"))))
- (fl-comment-face ((t (:foreground "medium purple"))))
- (fl-function-name-face ((t (:foreground "green"))))
- (fl-keyword-face ((t (:foreground "LightGreen"))))
- (fl-string-face ((t (:foreground "light coral"))))
- (fl-type-face ((t (:foreground "cyan"))))
- (font-lock-builtin-face ((t (:foreground "LightSteelBlue"))))
- (font-lock-comment-face ((t (:foreground "OrangeRed"))))
- (font-lock-constant-face ((t (:foreground "Aquamarine"))))
- (font-lock-function-name-face ((t (:foreground "LightSkyBlue"))))
- (font-lock-keyword-face ((t (:foreground "Cyan"))))
- (font-lock-string-face ((t (:foreground "LightSalmon"))))
- (font-lock-type-face ((t (:foreground "PaleGreen"))))
- (font-lock-variable-name-face ((t (:foreground "LightGoldenrod"))))
- (font-lock-warning-face ((t (:bold t :foreground "Pink"))))
- (gnus-group-mail-1-empty-face ((t (:foreground "aquamarine1"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "aquamarine1"))))
- (gnus-group-mail-2-empty-face ((t (:foreground "aquamarine2"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "aquamarine2"))))
- (gnus-group-mail-3-empty-face ((t (:foreground "aquamarine3"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "aquamarine3"))))
- (gnus-group-mail-low-empty-face ((t (:foreground "aquamarine4"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "aquamarine4"))))
- (gnus-group-news-1-empty-face ((t (:foreground "PaleTurquoise"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "PaleTurquoise"))))
- (gnus-group-news-2-empty-face ((t (:foreground "turquoise"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "turquoise"))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (:bold t))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (:bold t))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (:bold t))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (:bold t))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkTurquoise"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "DarkTurquoise"))))
- (gnus-splash-face ((t (:foreground "Brown"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "SkyBlue"))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "PaleGreen"))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "pink"))))
- (gnus-summary-high-unread-face ((t (:bold t))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "SkyBlue"))))
- (gnus-summary-low-read-face ((t (:italic t :foreground "PaleGreen"))))
- (gnus-summary-low-ticked-face ((t (:italic t :foreground "pink"))))
- (gnus-summary-low-unread-face ((t (:italic t))))
- (gnus-summary-normal-ancient-face ((t (:foreground "SkyBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "PaleGreen"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "pink"))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-selected-face ((t (:underline t))))
- (highlight ((t (:background "black" :foreground "black"))))
- (italic ((t (:italic t :foreground "yellow3"))))
- (message-cited-text-face ((t (:foreground "red"))))
- (message-header-cc-face ((t (:bold t :foreground "green4"))))
- (message-header-name-face ((t (:foreground "DarkGreen"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "yellow"))))
- (message-header-other-face ((t (:foreground "#b00000"))))
- (message-header-subject-face ((t (:foreground "green3"))))
- (message-header-to-face ((t (:bold t :foreground "green2"))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-mml-face ((t (:foreground "ForestGreen"))))
- (message-separator-face ((t (:foreground "blue3"))))
- (modeline ((t (:background "wheat" :foreground "black"))))
- (modeline-buffer-id ((t (:background "wheat" :foreground "black"))))
- (modeline-mousable ((t (:background "wheat" :foreground "black"))))
- (modeline-mousable-minor-mode ((t (:background "wheat" :foreground "black"))))
- (region ((t (:background "blue"))))
- (secondary-selection ((t (:background "darkslateblue" :foreground "black"))))
- (show-paren-match-face ((t (:background "turquoise"))))
- (show-paren-mismatch-face ((t (:background "purple" :foreground "white"))))
- (underline ((t (:underline t))))
- (xref-keyword-face ((t (:foreground "blue"))))
- (xref-list-default-face ((t (nil))))
- (xref-list-pilot-face ((t (:foreground "navy"))))
- (xref-list-symbol-face ((t (:foreground "navy")))))))
-
-(defun color-theme-marquardt ()
- "Color theme by Colin Marquardt, created 2000-10-25.
-Black on bisque, a light color. Based on some settings from Robin S. Socha.
-Features some color changes to programming languages, especially vhdl-mode.
-You might also want to put something like
- Emacs*Foreground: Black
- Emacs*Background: bisque2
-in your ~/.Xdefaults."
- (interactive)
- (color-theme-install
- '(color-theme-marquardt
- ((background-color . "bisque")
- (background-mode . light)
- (background-toolbar-color . "bisque")
- (border-color . "#000000000000")
- (bottom-toolbar-shadow-color . "#909099999999")
- (cursor-color . "Red3")
- (foreground-color . "black")
- (top-toolbar-shadow-color . "#ffffffffffff"))
- (default ((t (nil))))
- (blue ((t (:foreground "blue"))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:bold t))))
- (border-glyph ((t (nil))))
- (calendar-today-face ((t (:underline t))))
- (diary-face ((t (:foreground "red"))))
- (display-time-mail-balloon-enhance-face ((t (:background "orange"))))
- (display-time-mail-balloon-gnus-group-face ((t (:foreground "blue"))))
- (display-time-time-balloon-face ((t (:foreground "red"))))
- (ff-paths-non-existant-file-face ((t (:bold t :foreground "NavyBlue"))))
- (font-lock-comment-face ((t (:foreground "gray50"))))
- (font-lock-doc-string-face ((t (:foreground "green4"))))
- (font-lock-function-name-face ((t (:foreground "darkorange"))))
- (font-lock-keyword-face ((t (:foreground "blue3"))))
- (font-lock-preprocessor-face ((t (:foreground "blue3"))))
- (font-lock-reference-face ((t (:foreground "red3"))))
- (font-lock-special-comment-face ((t (:foreground "blue4"))))
- (font-lock-special-keyword-face ((t (:foreground "red4"))))
- (font-lock-string-face ((t (:foreground "green4"))))
- (font-lock-type-face ((t (:foreground "steelblue"))))
- (font-lock-variable-name-face ((t (:foreground "black"))))
- (font-lock-warning-face ((t (:bold t :foreground "Red"))))
- (green ((t (:foreground "green"))))
- (gui-button-face ((t (:background "grey75" :foreground "black"))))
- (gui-element ((t (:background "azure1" :foreground "Black"))))
- (highlight ((t (:background "darkseagreen2" :foreground "blue"))))
- (holiday-face ((t (:background "pink" :foreground "black"))))
- (info-node ((t (:bold t))))
- (info-xref ((t (:bold t))))
- (isearch ((t (:background "yellow" :foreground "red"))))
- (italic ((t (:bold t))))
- (left-margin ((t (nil))))
- (list-mode-item-selected ((t (:background "gray68" :foreground "black"))))
- (message-cited-text-face ((t (:foreground "red"))))
- (message-header-cc-face ((t (:foreground "MidnightBlue"))))
- (message-header-name-face ((t (:foreground "cornflower blue"))))
- (message-header-newsgroups-face ((t (:bold t :foreground "blue4"))))
- (message-header-other-face ((t (:foreground "steel blue"))))
- (message-header-subject-face ((t (:bold t :foreground "navy blue"))))
- (message-header-to-face ((t (:bold t :foreground "MidnightBlue"))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-mml-face ((t (:foreground "ForestGreen"))))
- (message-separator-face ((t (:foreground "brown"))))
- (modeline ((t (:background "bisque2" :foreground "steelblue4"))))
- (modeline-buffer-id ((t (:background "bisque2" :foreground "blue4"))))
- (modeline-mousable ((t (:background "bisque2" :foreground "firebrick"))))
- (modeline-mousable-minor-mode ((t (:background "bisque2" :foreground "green4"))))
- (paren-blink-off ((t (:foreground "azure1"))))
- (paren-face ((t (:background "lightgoldenrod"))))
- (paren-match ((t (:background "bisque2"))))
- (paren-mismatch ((t (:background "DeepPink" :foreground "black"))))
- (paren-mismatch-face ((t (:background "DeepPink"))))
- (paren-no-match-face ((t (:background "yellow"))))
- (pointer ((t (:background "white" :foreground "blue"))))
- (primary-selection ((t (:background "gray65"))))
- (red ((t (:foreground "red"))))
- (right-margin ((t (nil))))
- (secondary-selection ((t (:background "paleturquoise"))))
- (shell-option-face ((t (:foreground "gray50"))))
- (shell-output-2-face ((t (:foreground "green4"))))
- (shell-output-3-face ((t (:foreground "green4"))))
- (shell-output-face ((t (:bold t))))
- (shell-prompt-face ((t (:foreground "blue3"))))
- (speedbar-button-face ((t (:foreground "green4"))))
- (speedbar-directory-face ((t (:foreground "blue4"))))
- (speedbar-file-face ((t (:foreground "cyan4"))))
- (speedbar-highlight-face ((t (:background "green"))))
- (speedbar-selected-face ((t (:underline t :foreground "red"))))
- (speedbar-tag-face ((t (:foreground "brown"))))
- (text-cursor ((t (:background "Red3" :foreground "bisque"))))
- (toolbar ((t (:background "Gray80"))))
- (underline ((t (:underline t))))
- (vertical-divider ((t (nil))))
- (vhdl-font-lock-attribute-face ((t (:foreground "Orchid"))))
- (vhdl-font-lock-directive-face ((t (:foreground "CadetBlue"))))
- (vhdl-font-lock-enumvalue-face ((t (:foreground "SaddleBrown"))))
- (vhdl-font-lock-function-face ((t (:foreground "DarkCyan"))))
- (vhdl-font-lock-generic-/constant-face ((t (:foreground "Gold3"))))
- (vhdl-font-lock-prompt-face ((t (:bold t :foreground "Red"))))
- (vhdl-font-lock-reserved-words-face ((t (:bold t :foreground "Orange"))))
- (vhdl-font-lock-translate-off-face ((t (:background "LightGray"))))
- (vhdl-font-lock-type-face ((t (:foreground "ForestGreen"))))
- (vhdl-font-lock-variable-face ((t (:foreground "Grey50"))))
- (vhdl-speedbar-architecture-face ((t (:foreground "Blue"))))
- (vhdl-speedbar-architecture-selected-face ((t (:underline t :foreground "Blue"))))
- (vhdl-speedbar-configuration-face ((t (:foreground "DarkGoldenrod"))))
- (vhdl-speedbar-configuration-selected-face ((t (:underline t :foreground "DarkGoldenrod"))))
- (vhdl-speedbar-entity-face ((t (:foreground "ForestGreen"))))
- (vhdl-speedbar-entity-selected-face ((t (:underline t :foreground "ForestGreen"))))
- (vhdl-speedbar-instantiation-face ((t (:foreground "Brown"))))
- (vhdl-speedbar-instantiation-selected-face ((t (:underline t :foreground "Brown"))))
- (vhdl-speedbar-package-face ((t (:foreground "Grey50"))))
- (vhdl-speedbar-package-selected-face ((t (:underline t :foreground "Grey50"))))
- (vhdl-speedbar-subprogram-face ((t (:foreground "Orchid4"))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (yellow ((t (:foreground "yellow"))))
- (zmacs-region ((t (:background "steelblue" :foreground "yellow")))))))
-
-(defun color-theme-parus ()
- "Color theme by Jon K Hellan, created 2000-11-01.
-White on dark blue color theme.
-
-There is some redundancy in the X resources, but I do not have time to
-find out which should go or which should stay:
-
-Emacs*dialog*Background: midnightblue
-Emacs*dialog*Foreground: white
-Emacs*popup*Background: midnightblue
-Emacs*popup*Foreground: white
-emacs*background: #00005a
-emacs*cursorColor: gray90
-emacs*foreground: White
-emacs.dialog*.background: midnightblue
-emacs.menu*.background: midnightblue
-emacs.pane.menubar.background: midnightblue"
- (interactive)
- (color-theme-install
- '(color-theme-parus
- ((background-color . "#00005a")
- (background-mode . dark)
- (border-color . "black")
- (cursor-color . "yellow")
- (foreground-color . "White")
- (mouse-color . "yellow"))
- ((gnus-mouse-face . highlight)
- (list-matching-lines-face . bold)
- (paren-face . bold)
- (paren-mismatch-face . paren-mismatch-face)
- (paren-no-match-face . paren-no-match-face)
- (view-highlight-face . highlight))
- (default ((t (nil))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:italic t :bold t))))
- (font-latex-bold-face ((t (:bold t :foreground "OliveDrab"))))
- (font-latex-italic-face ((t (:italic t :foreground "OliveDrab"))))
- (font-latex-math-face ((t (:foreground "burlywood"))))
- (font-latex-sedate-face ((t (:foreground "LightGray"))))
- (font-latex-string-face ((t (:foreground "LightSalmon"))))
- (font-latex-warning-face ((t (:foreground "Pink"))))
- (font-lock-builtin-face ((t (:foreground "#e0e0ff"))))
- (font-lock-reference-face ((t (:foreground "#e0e0ff"))))
- (font-lock-comment-face ((t (:foreground "#FFd1d1"))))
- (font-lock-constant-face ((t (:foreground "Aquamarine"))))
- (font-lock-preprocessor-face ((t (:foreground "Aquamarine"))))
- (font-lock-function-name-face ((t (:foreground "#b2e4ff"))))
- (font-lock-keyword-face ((t (:foreground "#a0ffff"))))
- (font-lock-string-face ((t (:foreground "#efca10"))))
- (font-lock-doc-string-face ((t (:foreground "#efca10"))))
- (font-lock-type-face ((t (:foreground "PaleGreen"))))
- (font-lock-variable-name-face ((t (:foreground "LightGoldenrod"))))
- (font-lock-warning-face ((t (:bold t :foreground "Pink"))))
- (gnus-cite-attribution-face ((t (:italic t))))
- (gnus-cite-face-1 ((t (:foreground "#dfdfff"))))
- (gnus-cite-face-10 ((t (:foreground "medium purple"))))
- (gnus-cite-face-11 ((t (:foreground "turquoise"))))
- (gnus-cite-face-2 ((t (:foreground "light cyan"))))
- (gnus-cite-face-3 ((t (:foreground "light yellow"))))
- (gnus-cite-face-4 ((t (:foreground "light pink"))))
- (gnus-cite-face-5 ((t (:foreground "pale green"))))
- (gnus-cite-face-6 ((t (:foreground "beige"))))
- (gnus-cite-face-7 ((t (:foreground "orange"))))
- (gnus-cite-face-8 ((t (:foreground "magenta"))))
- (gnus-cite-face-9 ((t (:foreground "violet"))))
- (gnus-emphasis-bold ((t (:bold t))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t))))
- (gnus-emphasis-highlight-words ((t (:background "black" :foreground "yellow"))))
- (gnus-emphasis-italic ((t (:italic t))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:underline t :bold t))))
- (gnus-emphasis-underline-bold-italic ((t (:underline t :italic t :bold t))))
- (gnus-emphasis-underline-italic ((t (:underline t :italic t))))
- (gnus-group-mail-1-empty-face ((t (:foreground "aquamarine1"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "aquamarine1"))))
- (gnus-group-mail-2-empty-face ((t (:foreground "aquamarine2"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "aquamarine2"))))
- (gnus-group-mail-3-empty-face ((t (:foreground "aquamarine3"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "aquamarine3"))))
- (gnus-group-mail-low-empty-face ((t (:foreground "aquamarine4"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "aquamarine4"))))
- (gnus-group-news-1-empty-face ((t (:foreground "PaleTurquoise"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "PaleTurquoise"))))
- (gnus-group-news-2-empty-face ((t (:foreground "turquoise"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "turquoise"))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (:bold t))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (:bold t))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (:bold t))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (:bold t))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkTurquoise"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "DarkTurquoise"))))
- (gnus-header-content-face ((t (:italic t :foreground "#90f490"))))
- (gnus-header-from-face ((t (:foreground "#aaffaa"))))
- (gnus-header-name-face ((t (:foreground "#c7e3c7"))))
- (gnus-header-newsgroups-face ((t (:italic t :foreground "yellow"))))
- (gnus-header-subject-face ((t (:foreground "#a0f0a0"))))
- (gnus-signature-face ((t (:italic t))))
- (gnus-splash-face ((t (:foreground "Brown"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "SkyBlue"))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "PaleGreen"))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "pink"))))
- (gnus-summary-high-unread-face ((t (:bold t))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "SkyBlue"))))
- (gnus-summary-low-read-face ((t (:italic t :foreground "PaleGreen"))))
- (gnus-summary-low-ticked-face ((t (:italic t :foreground "pink"))))
- (gnus-summary-low-unread-face ((t (:italic t))))
- (gnus-summary-normal-ancient-face ((t (:foreground "SkyBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "PaleGreen"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "pink"))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-selected-face ((t (:underline t))))
- (highlight ((t (:background "darkolivegreen"))))
- (italic ((t (:italic t))))
- (message-cited-text-face ((t (:foreground "#dfdfff"))))
- (message-header-cc-face ((t (:bold t :foreground "#a0f0a0"))))
- (message-header-name-face ((t (:foreground "#c7e3c7"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "yellow"))))
- (message-header-other-face ((t (:foreground "#db9b9b"))))
- (message-header-subject-face ((t (:foreground "#a0f0a0"))))
- (message-header-to-face ((t (:bold t :foreground "#aaffaa"))))
- (message-header-xheader-face ((t (:foreground "#e2e2ff"))))
- (message-mml-face ((t (:foreground "#abdbab"))))
- (message-separator-face ((t (:foreground "#dfdfff"))))
- (modeline ((t (:background "White" :foreground "#00005a"))))
- (modeline-buffer-id ((t (:background "White" :foreground "#00005a"))))
- (modeline-mousable ((t (:background "White" :foreground "#00005a"))))
- (modeline-mousable-minor-mode ((t (:background "White" :foreground "#00005a"))))
- (paren-mismatch-face ((t (:background "DeepPink"))))
- (paren-no-match-face ((t (:background "yellow"))))
- (region ((t (:background "blue"))))
- (primary-selection ((t (:background "blue"))))
- (isearch ((t (:background "blue"))))
- (secondary-selection ((t (:background "darkslateblue"))))
- (underline ((t (:underline t))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "lime green"))))
- (widget-field-face ((t (:background "dim gray"))))
- (widget-inactive-face ((t (:foreground "light gray"))))
- (widget-single-line-field-face ((t (:background "dim gray")))))))
-
-(defun color-theme-high-contrast ()
- "High contrast color theme, maybe for the visually impaired.
-Watch out! This will set a very large font-size!
-
-If you want to modify the font as well, you should customize variable
-`color-theme-legal-frame-parameters' to \"\\(color\\|mode\\|font\\|height\\|width\\)$\".
-The default setting will prevent color themes from installing specific
-fonts."
- (interactive)
- (color-theme-standard)
- (let ((color-theme-is-cumulative t))
- (color-theme-install
- '(color-theme-high-contrast
- ((cursor-color . "red")
- (width . 60)
- (height . 25)
- (background . dark))
- (default ((t (:stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight bold :height 240 :width normal :family "adobe-courier"))))
-
- (bold ((t (:bold t :underline t))))
- (bold-italic ((t (:bold t :underline t))))
- (font-lock-builtin-face ((t (:bold t :foreground "Red"))))
- (font-lock-comment-face ((t (:bold t :foreground "Firebrick"))))
- (font-lock-constant-face ((t (:bold t :underline t :foreground "Blue"))))
- (font-lock-function-name-face ((t (:bold t :foreground "Blue"))))
- (font-lock-keyword-face ((t (:bold t :foreground "Purple"))))
- (font-lock-string-face ((t (:bold t :foreground "DarkGreen"))))
- (font-lock-type-face ((t (:bold t :foreground "ForestGreen"))))
- (font-lock-variable-name-face ((t (:bold t :foreground "DarkGoldenrod"))))
- (font-lock-warning-face ((t (:bold t :foreground "Red"))))
- (highlight ((t (:background "black" :foreground "white" :bold 1))))
- (info-menu-5 ((t (:underline t :bold t))))
- (info-node ((t (:bold t))))
- (info-xref ((t (:bold t ))))
- (italic ((t (:bold t :underline t))))
- (modeline ((t (:background "black" :foreground "white" :bold 1))))
- (modeline-buffer-id ((t (:background "black" :foreground "white" :bold 1))))
- (modeline-mousable ((t (:background "black" :foreground "white" :bold 1))))
- (modeline-mousable-minor-mode ((t (:background "black" :foreground "white" :bold 1))))
- (region ((t (:background "black" :foreground "white" :bold 1))))
- (secondary-selection ((t (:background "black" :foreground "white" :bold 1))))
- (underline ((t (:bold t :underline t))))))))
-
-(defun color-theme-infodoc ()
- "Color theme by Frederic Giroud, created 2001-01-18.
-Black on wheat scheme. Based on infodoc (xemacs variant distribution),
-with my favorit fontlock color."
- (interactive)
- (color-theme-install
- '(color-theme-infodoc
- ((background-color . "wheat")
- (background-mode . light)
- (background-toolbar-color . "#000000000000")
- (border-color . "#000000000000")
- (bottom-toolbar-shadow-color . "#000000000000")
- (cursor-color . "red")
- (foreground-color . "black")
- (top-toolbar-shadow-color . "#ffffffffffff"))
- nil
- (default ((t (:bold t))))
- (blue ((t (:bold t :foreground "blue"))))
- (bold ((t (:background "wheat" :foreground "black"))))
- (bold-italic ((t (:bold t :background "wheat" :foreground "black"))))
- (border-glyph ((t (:bold t))))
- (calendar-today-face ((t (:underline t :bold t))))
- (custom-button-face ((t (nil))))
- (custom-changed-face ((t (:bold t :background "blue" :foreground "white"))))
- (custom-documentation-face ((t (:bold t :background "wheat" :foreground "purple4"))))
- (custom-face-tag-face ((t (:underline t :bold t))))
- (custom-group-tag-face ((t (:underline t :bold t :background "wheat" :foreground "blue"))))
- (custom-group-tag-face-1 ((t (:underline t :bold t :background "wheat" :foreground "red"))))
- (custom-invalid-face ((t (:bold t :background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:bold t :background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:bold t :background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t :bold t))))
- (custom-set-face ((t (:bold t :background "white" :foreground "blue"))))
- (custom-state-face ((t (:bold t :background "wheat" :foreground "dark green"))))
- (custom-variable-button-face ((t (:underline t))))
- (custom-variable-tag-face ((t (:underline t :bold t :background "wheat" :foreground "blue"))))
- (diary-face ((t (:bold t :foreground "red"))))
- (display-time-mail-balloon-enhance-face ((t (:bold t :background "wheat" :foreground "black"))))
- (display-time-mail-balloon-gnus-group-face ((t (:bold t :background "wheat" :foreground "blue"))))
- (display-time-time-balloon-face ((t (:bold t :background "light salmon" :foreground "dark green"))))
- (font-lock-comment-face ((t (:bold t :background "wheat" :foreground "turquoise4"))))
- (font-lock-doc-string-face ((t (:bold t :background "wheat" :foreground "purple4"))))
- (font-lock-function-name-face ((t (:bold t :background "wheat" :foreground "blue4"))))
- (font-lock-keyword-face ((t (:bold t :background "wheat" :foreground "dark orchid"))))
- (font-lock-preprocessor-face ((t (:bold t :background "wheat" :foreground "orchid4"))))
- (font-lock-reference-face ((t (:bold t :background "wheat" :foreground "red3"))))
- (font-lock-string-face ((t (:bold t :background "wheat" :foreground "dark goldenrod"))))
- (font-lock-type-face ((t (:bold t :background "wheat" :foreground "brown"))))
- (font-lock-variable-name-face ((t (:bold t :background "wheat" :foreground "chocolate"))))
- (font-lock-warning-face ((t (:bold t :background "wheat" :foreground "black"))))
- (gdb-arrow-face ((t (:bold t :background "LightGreen" :foreground "black"))))
- (green ((t (:bold t :foreground "green"))))
- (gui-button-face ((t (:bold t :background "wheat" :foreground "red"))))
- (gui-element ((t (:bold t :background "wheat" :foreground "black"))))
- (highlight ((t (:bold t :background "darkseagreen2" :foreground "dark green"))))
- (holiday-face ((t (:bold t :background "pink" :foreground "black"))))
- (hproperty:but-face ((t (:bold t :background "wheat" :foreground "medium violet red"))))
- (hproperty:flash-face ((t (:bold t :background "wheat" :foreground "gray80"))))
- (hproperty:highlight-face ((t (:bold t :background "wheat" :foreground "red"))))
- (hproperty:item-face ((t (:bold t))))
- (isearch ((t (:bold t :background "pale turquoise" :foreground "blue"))))
- (italic ((t (:bold t :background "wheat" :foreground "black"))))
- (left-margin ((t (:bold t :background "wheat" :foreground "black"))))
- (list-mode-item-selected ((t (:bold t :background "gray68" :foreground "black"))))
- (message-cited-text ((t (:bold t :background "wheat" :foreground "brown"))))
- (message-header-contents ((t (:bold t :background "wheat" :foreground "black"))))
- (message-headers ((t (:bold t :background "wheat" :foreground "black"))))
- (message-highlighted-header-contents ((t (:bold t :background "wheat" :foreground "blue"))))
- (message-url ((t (nil))))
- (modeline ((t (:bold t :background "light salmon" :foreground "dark green"))))
- (modeline-buffer-id ((t (:bold t :background "light salmon" :foreground "blue4"))))
- (modeline-mousable ((t (:bold t :background "light salmon" :foreground "firebrick"))))
- (modeline-mousable-minor-mode ((t (:bold t :background "light salmon" :foreground "green4"))))
- (pointer ((t (:bold t :background "wheat" :foreground "red"))))
- (primary-selection ((t (:bold t :background "medium sea green"))))
- (red ((t (:bold t :foreground "red"))))
- (right-margin ((t (:bold t :background "wheat" :foreground "black"))))
- (secondary-selection ((t (:bold t :background "paleturquoise" :foreground "black"))))
- (shell-input-face ((t (:bold t :background "wheat" :foreground "blue"))))
- (shell-option-face ((t (:bold t :background "wheat" :foreground "turquoise4"))))
- (shell-output-2-face ((t (:bold t :background "wheat" :foreground "dark goldenrod"))))
- (shell-output-3-face ((t (:bold t :background "wheat" :foreground "dark goldenrod"))))
- (shell-output-face ((t (:bold t :background "wheat" :foreground "black"))))
- (shell-prompt-face ((t (:bold t :background "wheat" :foreground "dark orchid"))))
- (text-cursor ((t (:bold t :background "red" :foreground "wheat"))))
- (toolbar ((t (:bold t :background "wheat" :foreground "black"))))
- (underline ((t (:underline t :bold t :background "wheat" :foreground "black"))))
- (vertical-divider ((t (:bold t))))
- (widget-button-face ((t (nil))))
- (widget-button-pressed-face ((t (:bold t :background "wheat" :foreground "red"))))
- (widget-documentation-face ((t (:bold t :background "wheat" :foreground "dark green"))))
- (widget-field-face ((t (:bold t :background "gray85"))))
- (widget-inactive-face ((t (:bold t :background "wheat" :foreground "dim gray"))))
- (x-face ((t (:bold t :background "wheat" :foreground "black"))))
- (yellow ((t (:bold t :foreground "yellow"))))
- (zmacs-region ((t (:bold t :background "lightyellow" :foreground "darkgreen")))))))
-
-(defun color-theme-classic ()
- "Color theme by Frederic Giroud, created 2001-01-18.
-AntiqueWhite on darkslategrey scheme. Based on Gnome 2, with my favorit
-color foreground-color and fontlock color."
- (interactive)
- (color-theme-blue-gnus)
- (let ((color-theme-is-cumulative t))
- (color-theme-install
- '(color-theme-classic
- ((foreground-color . "AntiqueWhite")
- (background-color . "darkslategrey")
- (mouse-color . "Grey")
- (cursor-color . "Red")
- (border-color . "black")
- (background-mode . dark))
- ((apropos-keybinding-face . underline)
- (apropos-label-face . italic)
- (apropos-match-face . secondary-selection)
- (apropos-property-face . bold-italic)
- (apropos-symbol-face . info-xref)
- (goto-address-mail-face . message-header-to-face)
- (goto-address-mail-mouse-face . secondary-selection)
- (goto-address-url-face . info-xref)
- (goto-address-url-mouse-face . highlight)
- (list-matching-lines-face . bold)
- (view-highlight-face . highlight))
- (default ((t (nil))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:italic t :bold t :foreground "beige"))))
- (calendar-today-face ((t (:underline t))))
- (cperl-array-face ((t (:foreground "Yellow"))))
- (cperl-hash-face ((t (:foreground "White"))))
- (cperl-nonoverridable-face ((t (:foreground "SkyBlue"))))
- (custom-button-face ((t (:underline t :foreground "MediumSlateBlue"))))
- (custom-documentation-face ((t (:foreground "Grey"))))
- (custom-group-tag-face ((t (:foreground "MediumAquamarine"))))
- (custom-state-face ((t (:foreground "LightSalmon"))))
- (custom-variable-tag-face ((t (:foreground "Aquamarine"))))
- (diary-face ((t (:foreground "IndianRed"))))
- (erc-action-face ((t (:bold t))))
- (erc-bold-face ((t (:bold t))))
- (erc-default-face ((t (nil))))
- (erc-direct-msg-face ((t (:foreground "LightSalmon"))))
- (erc-error-face ((t (:bold t :foreground "IndianRed"))))
- (erc-input-face ((t (:foreground "Beige"))))
- (erc-inverse-face ((t (:background "wheat" :foreground "darkslategrey"))))
- (erc-notice-face ((t (:foreground "MediumAquamarine"))))
- (erc-pal-face ((t (:foreground "pale green"))))
- (erc-prompt-face ((t (:foreground "MediumAquamarine"))))
- (erc-underline-face ((t (:underline t))))
- (eshell-ls-archive-face ((t (:bold t :foreground "IndianRed"))))
- (eshell-ls-backup-face ((t (:foreground "Grey"))))
- (eshell-ls-clutter-face ((t (:foreground "DimGray"))))
- (eshell-ls-directory-face ((t (:bold t :foreground "MediumSlateBlue"))))
- (eshell-ls-executable-face ((t (:foreground "Coral"))))
- (eshell-ls-missing-face ((t (:foreground "black"))))
- (eshell-ls-picture-face ((t (:foreground "Violet"))))
- (eshell-ls-product-face ((t (:foreground "LightSalmon"))))
- (eshell-ls-readonly-face ((t (:foreground "Aquamarine"))))
- (eshell-ls-special-face ((t (:foreground "Gold"))))
- (eshell-ls-symlink-face ((t (:foreground "White"))))
- (eshell-ls-unreadable-face ((t (:foreground "DimGray"))))
- (eshell-prompt-face ((t (:foreground "MediumAquamarine"))))
- (font-lock-builtin-face ((t (:bold t :foreground "PaleGreen"))))
- (font-lock-comment-face ((t (:foreground "tomato3"))))
- (font-lock-constant-face ((t (:foreground "Aquamarine"))))
- (font-lock-doc-string-face ((t (:foreground "LightSalmon3"))))
- (font-lock-function-name-face ((t (:foreground "SteelBlue1"))))
- (font-lock-keyword-face ((t (:foreground "cyan1"))))
- (font-lock-reference-face ((t (:foreground "LightSalmon2"))))
- (font-lock-string-face ((t (:foreground "LightSalmon3"))))
- (font-lock-type-face ((t (:foreground "PaleGreen3"))))
- (font-lock-variable-name-face ((t (:foreground "khaki1"))))
- (font-lock-warning-face ((t (:bold t :foreground "IndianRed"))))
- (font-lock-preprocessor-face ((t (:foreground "SkyBlue3"))))
- (widget-field-face ((t (:background "DarkCyan"))))
- (custom-group-tag-face ((t(:foreground "brown" :underline t))))
- (custom-state-face ((t (:foreground "khaki"))))
- (highlight ((t (:background "PaleGreen" :foreground "DarkGreen"))))
- (highline-face ((t (:background "SeaGreen"))))
- (holiday-face ((t (:background "DimGray"))))
- (info-menu-5 ((t (:underline t))))
- (info-node ((t (:underline t :bold t :foreground "DodgerBlue1"))))
- (info-xref ((t (:underline t :foreground "DodgerBlue1"))))
- (isearch ((t (:foreground "red" :background "CornflowerBlue"))))
- (italic ((t (:italic t))))
- (modeline ((t (:background "LightSlateGray" :foreground "AntiqueWhite"))))
- (modeline-buffer-id ((t (:background "LightSlateGray" :foreground "DarkBlue"))))
- (modeline-mousable ((t (:background "LightSlateGray" :foreground "firebrick"))))
- (modeline-mousable-minor-mode ((t (:background "LightSlateGray" :foreground "wheat"))))
- (region ((t (:background "dark cyan" :foreground "cyan"))))
- (secondary-selection ((t (:background "Aquamarine" :foreground "SlateBlue"))))
- (show-paren-match-face ((t (:background "Aquamarine" :foreground "SlateBlue"))))
- (show-paren-mismatch-face ((t (:background "Red" :foreground "White"))))
- (underline ((t (:underline t))))
- (widget-field-face ((t (:foreground "LightBlue"))))
- (widget-inactive-face ((t (:foreground "DimGray"))))
- (widget-single-line-field-face ((t (:foreground "LightBlue"))))
- (woman-bold-face ((t (:bold t))))
- (woman-italic-face ((t (:foreground "beige"))))
- (woman-unknown-face ((t (:foreground "LightSalmon"))))))))
-
-(defun color-theme-scintilla ()
- "Color theme by Gordon Messmer, created 2001-02-07.
-Based on the Scintilla editor.
-
-If you want to modify the font as well, you should customize variable
-`color-theme-legal-frame-parameters' to \"\\(color\\|mode\\|font\\|height\\|width\\)$\".
-The default setting will prevent color themes from installing specific
-fonts."
- (interactive)
- (color-theme-install
- ;; The light editor style doesn't seem to look right with
- ;; the same font that works in the dark editor style.
- ;; Dark letters on light background just isn't as visible.
- '(color-theme-scintilla
- ((font . "-monotype-courier new-bold-r-normal-*-*-140-*-*-m-*-iso8859-1")
- (width . 95)
- (height . 40)
- (background-color . "white")
- (foreground-color . "black")
- (background-mode . light)
- (mouse-color . "grey15")
- (cursor-color . "grey15"))
- (default ((t nil)))
- (font-lock-comment-face ((t (:italic t :foreground "ForestGreen"))))
- (font-lock-string-face ((t (:foreground "DarkMagenta"))))
- (font-lock-keyword-face ((t (:foreground "NavyBlue"))))
- (font-lock-warning-face ((t (:bold t :foreground "VioletRed"))))
- (font-lock-constant-face ((t (:foreground "Blue"))))
- (font-lock-type-face ((t (:foreground "NavyBlue"))))
- (font-lock-variable-name-face ((t (:foreground "DarkCyan"))))
- (font-lock-function-name-face ((t (:foreground "DarkCyan"))))
- (font-lock-builtin-face ((t (:foreground "NavyBlue"))))
- (highline-face ((t (:background "Grey95"))))
- (show-paren-match-face ((t (:background "Grey80"))))
- (region ((t (:background "Grey80"))))
- (highlight ((t (:foreground "ForestGreen"))))
- (secondary-selection ((t (:background "NavyBlue" :foreground "white"))))
- (widget-field-face ((t (:background "NavyBlue"))))
- (widget-single-line-field-face ((t (:background "RoyalBlue")))))) )
-
-(defun color-theme-gtk-ide ()
- "Color theme by Gordon Messmer, created 2001-02-07.
-Inspired by a GTK IDE whose name I've forgotten.
-
-If you want to modify the font as well, you should customize variable
-`color-theme-legal-frame-parameters' to \"\\(color\\|mode\\|font\\|height\\|width\\)$\".
-The default setting will prevent color themes from installing specific
-fonts."
- ;; The light editor style doesn't seem to look right with
- ;; the same font that works in the dark editor style.
- ;; Dark letters on light background just isn't as visible.
- (interactive)
- (color-theme-install
- '(color-theme-gtk-ide
- ((font . "-monotype-courier new-medium-r-normal-*-*-120-*-*-m-*-iso8859-15")
- (width . 95)
- (height . 45)
- (background-color . "white")
- (foreground-color . "black")
- (background-mode . light)
- (mouse-color . "grey15")
- (cursor-color . "grey15"))
- (default ((t nil)))
- (font-lock-comment-face ((t (:italic t :foreground "grey55"))))
- (font-lock-string-face ((t (:foreground "DarkRed"))))
- (font-lock-keyword-face ((t (:foreground "DarkBlue"))))
- (font-lock-warning-face ((t (:bold t :foreground "VioletRed"))))
- (font-lock-constant-face ((t (:foreground "OliveDrab"))))
- (font-lock-type-face ((t (:foreground "SteelBlue4"))))
- (font-lock-variable-name-face ((t (:foreground "DarkGoldenrod"))))
- (font-lock-function-name-face ((t (:foreground "SlateBlue"))))
- (font-lock-builtin-face ((t (:foreground "ForestGreen"))))
- (highline-face ((t (:background "grey95"))))
- (show-paren-match-face ((t (:background "grey80"))))
- (region ((t (:background "grey80"))))
- (highlight ((t (:background "LightSkyBlue"))))
- (secondary-selection ((t (:background "grey55"))))
- (widget-field-face ((t (:background "navy"))))
- (widget-single-line-field-face ((t (:background "royalblue")))))) )
-
-(defun color-theme-midnight ()
- "Color theme by Gordon Messmer, created 2001-02-07.
-A color theme inspired by a certain IDE for Windows. It's all from memory,
-since I only used that software in college.
-
-If you want to modify the font as well, you should customize variable
-`color-theme-legal-frame-parameters' to \"\\(color\\|mode\\|font\\|height\\|width\\)$\".
-The default setting will prevent color themes from installing specific
-fonts."
- (interactive)
- (color-theme-install
- '(color-theme-midnight
- ((font . "fixed")
- (width . 130)
- (height . 50)
- (background-color . "black")
- (foreground-color . "grey85")
- (background-mode . dark)
- (mouse-color . "grey85")
- (cursor-color . "grey85"))
- (default ((t (nil))))
- (font-lock-comment-face ((t (:italic t :foreground "grey60"))))
- (font-lock-string-face ((t (:foreground "Magenta"))))
- (font-lock-keyword-face ((t (:foreground "Cyan"))))
- (font-lock-warning-face ((t (:bold t :foreground "Pink"))))
- (font-lock-constant-face ((t (:foreground "OliveDrab"))))
- (font-lock-type-face ((t (:foreground "DarkCyan"))))
- (font-lock-variable-name-face ((t (:foreground "DarkGoldenrod"))))
- (font-lock-function-name-face ((t (:foreground "SlateBlue"))))
- (font-lock-builtin-face ((t (:foreground "SkyBlue"))))
- (highline-face ((t (:background "grey12"))))
- (setnu-line-number-face ((t (:background "Grey15" :foreground "White" :bold t))))
- (show-paren-match-face ((t (:background "grey30"))))
- (region ((t (:background "grey15"))))
- (highlight ((t (:background "blue"))))
- (secondary-selection ((t (:background "navy"))))
- (widget-field-face ((t (:background "navy"))))
- (widget-single-line-field-face ((t (:background "royalblue")))))) )
-
-(defun color-theme-jedit-grey ()
- "Color theme by Gordon Messmer, created 2001-02-07.
-Based on a screenshot of jedit.
-
-If you want to modify the font as well, you should customize variable
-`color-theme-legal-frame-parameters' to \"\\(color\\|mode\\|font\\|height\\|width\\)$\".
-The default setting will prevent color themes from installing specific
-fonts."
- (interactive)
- (color-theme-install
- '(color-theme-jedit-grey
- ((font . "fixed")
- (width . 130)
- (height . 50)
- (background-color . "grey77")
- (foreground-color . "black")
- (background-mode . light)
- (mouse-color . "black")
- (cursor-color . "black"))
- (default ((t (nil))))
- (font-lock-comment-face ((t (:italic t :foreground "RoyalBlue4"))))
- (font-lock-string-face ((t (:foreground "Gold4"))))
- (font-lock-keyword-face ((t (:bold t :foreground "DarkRed"))))
- (font-lock-warning-face ((t (:bold t :foreground "Pink"))))
- (font-lock-constant-face ((t (:foreground "DarkCyan"))))
- (font-lock-type-face ((t (:foreground "DarkRed"))))
- (font-lock-function-name-face ((t (:foreground "Green4"))))
- (font-lock-builtin-face ((t (:bold t :foreground "DarkRed"))))
- (highline-face ((t (:background "grey84"))))
- (setnu-line-number-face ((t (:background "White" :foreground "MediumPurple3" :italic t))))
- (show-paren-match-face ((t (:background "grey60"))))
- (region ((t (:background "grey70"))))
- (highlight ((t (:background "grey90"))))
- (secondary-selection ((t (:background "white"))))
- (widget-field-face ((t (:background "royalblue"))))
- (widget-single-line-field-face ((t (:background "royalblue")))))) )
-
-(defun color-theme-snow ()
- "Color theme by Nicolas Rist, created 2001-03-08.
-Black on gainsboro. In Emacs, the text background is a shade darker
-than the frame background: Gainsboro instead of snow. This makes the
-structure of the text clearer without being too agressive on the eyes.
-On XEmacs, this doesn't really work as the frame and the default face
-allways use the same foreground and background colors.
-The color theme includes gnus, message, font-lock, sgml, and speedbar."
- (interactive)
- (color-theme-install
- '(color-theme-snow
- ((background-color . "snow2")
- (background-mode . light)
- (border-color . "black")
- (cursor-color . "RoyalBlue2")
- (foreground-color . "black")
- (mouse-color . "black"))
- ((gnus-mouse-face . highlight)
- (list-matching-lines-face . bold)
- (view-highlight-face . highlight))
- (default ((t (:background "gainsboro" :foreground "dark slate gray"))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:italic t :bold t))))
- (calendar-today-face ((t (:underline t))))
- (custom-button-face ((t (:background "gainsboro" :foreground "dark cyan"))))
- (custom-documentation-face ((t (:background "gainsboro"))))
- (diary-face ((t (:foreground "red"))))
- (fg:black ((t (:foreground "black"))))
- (font-lock-builtin-face ((t (:background "gainsboro" :foreground "medium orchid"))))
- (font-lock-comment-face ((t (:background "gainsboro" :foreground "SteelBlue3"))))
- (font-lock-constant-face ((t (:background "gainsboro" :foreground "orange3"))))
- (font-lock-function-name-face ((t (:background "gainsboro" :foreground "blue3"))))
- (font-lock-keyword-face ((t (:background "gainsboro" :foreground "red3"))))
- (font-lock-string-face ((t (:background "gainsboro" :foreground "SpringGreen3"))))
- (font-lock-type-face ((t (:background "gainsboro" :foreground "dark cyan"))))
- (font-lock-variable-name-face ((t (:background "gainsboro" :foreground "purple2"))))
- (font-lock-warning-face ((t (:bold t :background "gainsboro" :foreground "red"))))
- (gnus-group-mail-1-empty-face ((t (:foreground "DeepPink3"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "DeepPink3"))))
- (gnus-group-mail-2-empty-face ((t (:foreground "HotPink3"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "HotPink3"))))
- (gnus-group-mail-3-empty-face ((t (:foreground "magenta4"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "magenta4"))))
- (gnus-group-mail-low-empty-face ((t (:foreground "DeepPink4"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "DeepPink4"))))
- (gnus-group-news-1-empty-face ((t (:foreground "ForestGreen"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "ForestGreen"))))
- (gnus-group-news-2-empty-face ((t (:foreground "CadetBlue4"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "CadetBlue4"))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (:bold t))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkGreen"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "DarkGreen"))))
- (gnus-splash-face ((t (:foreground "ForestGreen"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "RoyalBlue"))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "DarkGreen"))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "firebrick"))))
- (gnus-summary-high-unread-face ((t (:bold t))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "RoyalBlue"))))
- (gnus-summary-low-read-face ((t (:italic t :foreground "DarkGreen"))))
- (gnus-summary-low-ticked-face ((t (:italic t :foreground "firebrick"))))
- (gnus-summary-low-unread-face ((t (:italic t))))
- (gnus-summary-normal-ancient-face ((t (:foreground "RoyalBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "DarkGreen"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "firebrick"))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-selected-face ((t (:underline t))))
- (gui-button-face ((t (:foreground "light grey"))))
- (highlight ((t (:background "LightSteelBlue1"))))
- (holiday-face ((t (:background "pink"))))
- (ibuffer-marked-face ((t (:foreground "red"))))
- (italic ((t (:italic t))))
- (message-cited-text-face ((t (:foreground "red"))))
- (message-header-cc-face ((t (:foreground "MidnightBlue"))))
- (message-header-name-face ((t (:foreground "cornflower blue"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "blue4"))))
- (message-header-other-face ((t (:foreground "steel blue"))))
- (message-header-subject-face ((t (:bold t :foreground "navy blue"))))
- (message-header-to-face ((t (:bold t :foreground "MidnightBlue"))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-separator-face ((t (:foreground "brown"))))
- (modeline ((t (:background "dark slate gray" :foreground "gainsboro"))))
- (modeline-buffer-id ((t (:background "dark slate gray" :foreground "gainsboro"))))
- (modeline-mousable ((t (:background "dark slate gray" :foreground "gainsboro"))))
- (modeline-mousable-minor-mode ((t (:background "dark slate gray" :foreground "gainsboro"))))
- (region ((t (:background "lavender"))))
- (secondary-selection ((t (:background "paleturquoise"))))
- (sgml-comment-face ((t (:foreground "dark green"))))
- (sgml-doctype-face ((t (:foreground "maroon"))))
- (sgml-end-tag-face ((t (:foreground "blue2"))))
- (sgml-entity-face ((t (:foreground "red2"))))
- (sgml-ignored-face ((t (:background "gray90" :foreground "maroon"))))
- (sgml-ms-end-face ((t (:foreground "maroon"))))
- (sgml-ms-start-face ((t (:foreground "maroon"))))
- (sgml-pi-face ((t (:foreground "maroon"))))
- (sgml-sgml-face ((t (:foreground "maroon"))))
- (sgml-short-ref-face ((t (:foreground "goldenrod"))))
- (sgml-start-tag-face ((t (:foreground "blue2"))))
- (show-paren-match-face ((t (:background "SlateGray1"))))
- (show-paren-mismatch-face ((t (:background "purple" :foreground "white"))))
- (speedbar-button-face ((t (:foreground "green4"))))
- (speedbar-directory-face ((t (:foreground "blue4"))))
- (speedbar-file-face ((t (:foreground "cyan4"))))
- (speedbar-highlight-face ((t (:background "dark turquoise" :foreground "white"))))
- (speedbar-selected-face ((t (:underline t :foreground "red"))))
- (speedbar-tag-face ((t (:foreground "brown"))))
- (underline ((t (:underline t)))))))
-
-(defun color-theme-montz ()
- "Color theme by Brady Montz, created 2001-03-08.
-Black on Gray.
-Includes dired, bbdb, font-lock, gnus, message, viper, and widget."
- (interactive)
- (color-theme-install
- '(color-theme-montz
- ((background-color . "gray80")
- (background-mode . light)
- (background-toolbar-color . "#cccccccccccc")
- (border-color . "#000000000000")
- (bottom-toolbar-shadow-color . "#7a7a7a7a7a7a")
- (cursor-color . "Red3")
- (foreground-color . "black")
- (top-toolbar-shadow-color . "#f5f5f5f5f5f5")
- (viper-saved-cursor-color-in-replace-mode . "Red3"))
- ((gnus-mouse-face . highlight)
- (paren-match-face . paren-face-match)
- (paren-mismatch-face . paren-face-mismatch)
- (paren-no-match-face . paren-face-no-match)
- (smiley-mouse-face . highlight))
- (default ((t (nil))))
- (bbdb-company ((t (:italic t))))
- (bbdb-field-name ((t (:bold t))))
- (bbdb-field-value ((t (nil))))
- (bbdb-name ((t (:underline t))))
- (blue ((t (:foreground "blue"))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:italic t :bold t))))
- (border-glyph ((t (nil))))
- (dired-face-boring ((t (:foreground "Gray65"))))
- (dired-face-directory ((t (:bold t))))
- (dired-face-executable ((t (:foreground "SeaGreen"))))
- (dired-face-flagged ((t (:background "LightSlateGray"))))
- (dired-face-marked ((t (:background "PaleVioletRed"))))
- (dired-face-permissions ((t (:background "grey75" :foreground "black"))))
- (dired-face-setuid ((t (:foreground "Red"))))
- (dired-face-socket ((t (:foreground "magenta"))))
- (dired-face-symlink ((t (:foreground "cyan"))))
- (display-time-mail-balloon-enhance-face ((t (:background "orange"))))
- (display-time-mail-balloon-gnus-group-face ((t (:foreground "blue"))))
- (display-time-time-balloon-face ((t (:foreground "red"))))
- (font-lock-builtin-face ((t (:foreground "red3"))))
- (font-lock-comment-face ((t (:foreground "blue"))))
- (font-lock-constant-face ((t (:foreground "red3"))))
- (font-lock-doc-string-face ((t (:foreground "mediumvioletred"))))
- (font-lock-function-name-face ((t (:foreground "firebrick"))))
- (font-lock-keyword-face ((t (:bold t :foreground "black"))))
- (font-lock-preprocessor-face ((t (:foreground "blue3"))))
- (font-lock-reference-face ((t (:foreground "red3"))))
- (font-lock-string-face ((t (:foreground "mediumvioletred"))))
- (font-lock-type-face ((t (:foreground "darkgreen"))))
- (font-lock-variable-name-face ((t (:foreground "black"))))
- (font-lock-warning-face ((t (:bold t :foreground "Red"))))
- (gnus-cite-attribution-face ((t (:italic t))))
- (gnus-cite-face-1 ((t (:foreground "MidnightBlue"))))
- (gnus-cite-face-10 ((t (:foreground "medium purple"))))
- (gnus-cite-face-11 ((t (:foreground "turquoise"))))
- (gnus-cite-face-2 ((t (:foreground "firebrick"))))
- (gnus-cite-face-3 ((t (:foreground "dark green"))))
- (gnus-cite-face-4 ((t (:foreground "OrangeRed"))))
- (gnus-cite-face-5 ((t (:foreground "dark khaki"))))
- (gnus-cite-face-6 ((t (:foreground "dark violet"))))
- (gnus-cite-face-7 ((t (:foreground "SteelBlue4"))))
- (gnus-cite-face-8 ((t (:foreground "magenta"))))
- (gnus-cite-face-9 ((t (:foreground "violet"))))
- (gnus-emphasis-bold ((t (:bold t))))
- (gnus-emphasis-bold-italic ((t (:bold t))))
- (gnus-emphasis-highlight-words ((t (:background "black" :foreground "yellow"))))
- (gnus-emphasis-italic ((t (:italic t))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:underline t :bold t))))
- (gnus-emphasis-underline-bold-italic ((t (:underline t :bold t))))
- (gnus-emphasis-underline-italic ((t (:underline t :italic t))))
- (gnus-group-mail-1-empty-face ((t (:foreground "DeepPink3"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "DeepPink3"))))
- (gnus-group-mail-2-empty-face ((t (:foreground "HotPink3"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "HotPink3"))))
- (gnus-group-mail-3-empty-face ((t (:foreground "magenta4"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "magenta4"))))
- (gnus-group-mail-low-empty-face ((t (:foreground "DeepPink4"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "DeepPink4"))))
- (gnus-group-news-1-empty-face ((t (:foreground "ForestGreen"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "ForestGreen"))))
- (gnus-group-news-2-empty-face ((t (:foreground "CadetBlue4"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "CadetBlue4"))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (:bold t))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (:bold t))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (:bold t))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (:bold t))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkGreen"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "DarkGreen"))))
- (gnus-header-content-face ((t (:italic t :foreground "indianred4"))))
- (gnus-header-from-face ((t (:foreground "red3"))))
- (gnus-header-name-face ((t (:foreground "maroon"))))
- (gnus-header-newsgroups-face ((t (:italic t :foreground "MidnightBlue"))))
- (gnus-header-subject-face ((t (:foreground "red4"))))
- (gnus-picons-face ((t (:background "white" :foreground "black"))))
- (gnus-picons-xbm-face ((t (:background "white" :foreground "black"))))
- (gnus-signature-face ((t (:italic t))))
- (gnus-splash-face ((t (:foreground "Brown"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "RoyalBlue"))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "DarkGreen"))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "firebrick"))))
- (gnus-summary-high-unread-face ((t (:bold t))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "RoyalBlue"))))
- (gnus-summary-low-read-face ((t (:italic t :foreground "DarkGreen"))))
- (gnus-summary-low-ticked-face ((t (:italic t :foreground "firebrick"))))
- (gnus-summary-low-unread-face ((t (:italic t))))
- (gnus-summary-normal-ancient-face ((t (:foreground "RoyalBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "DarkGreen"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "firebrick"))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-selected-face ((t (:underline t))))
- (gnus-x-face ((t (:background "white" :foreground "black"))))
- (green ((t (:foreground "green"))))
- (gui-button-face ((t (:background "grey75" :foreground "black"))))
- (gui-element ((t (nil))))
- (highlight ((t (:background "darkseagreen2"))))
- (info-node ((t (:bold t))))
- (info-xref ((t (:bold t))))
- (isearch ((t (:background "paleturquoise"))))
- (italic ((t (:italic t))))
- (left-margin ((t (nil))))
- (list-mode-item-selected ((t (:background "gray68" :foreground "black"))))
- (message-cited-text-face ((t (:foreground "red"))))
- (message-header-cc-face ((t (:foreground "MidnightBlue"))))
- (message-header-name-face ((t (:foreground "cornflower blue"))))
- (message-header-newsgroups-face ((t (:bold t :foreground "blue4"))))
- (message-header-other-face ((t (:foreground "steel blue"))))
- (message-header-subject-face ((t (:bold t :foreground "navy blue"))))
- (message-header-to-face ((t (:bold t :foreground "MidnightBlue"))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-mml-face ((t (:foreground "ForestGreen"))))
- (message-separator-face ((t (:foreground "brown"))))
- (modeline ((t (nil))))
- (modeline-buffer-id ((t (:background "Gray80" :foreground "blue4"))))
- (modeline-mousable ((t (:background "Gray80" :foreground "firebrick"))))
- (modeline-mousable-minor-mode ((t (:background "Gray80" :foreground "green4"))))
- (paren-face-match ((t (:background "turquoise"))))
- (paren-face-mismatch ((t (:background "purple" :foreground "white"))))
- (paren-face-no-match ((t (:background "yellow" :foreground "black"))))
- (pointer ((t (nil))))
- (primary-selection ((t (:background "gray65"))))
- (red ((t (:foreground "red"))))
- (right-margin ((t (nil))))
- (secondary-selection ((t (:background "paleturquoise"))))
- (text-cursor ((t (:background "Red3" :foreground "gray80"))))
- (toolbar ((t (nil))))
- (underline ((t (:underline t))))
- (vertical-divider ((t (nil))))
- (viper-minibuffer-emacs-face ((t (:background "gray80" :foreground "black"))))
- (viper-minibuffer-insert-face ((t (:background "gray80" :foreground "black"))))
- (viper-minibuffer-vi-face ((t (:background "gray80" :foreground "black"))))
- (viper-replace-overlay-face ((t (:background "black" :foreground "white"))))
- (viper-search-face ((t (:background "black" :foreground "white"))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (yellow ((t (:foreground "yellow"))))
- (zmacs-region ((t (:background "black" :foreground "white")))))))
-
-(defun color-theme-aalto-light ()
- "Color theme by Jari Aalto, created 2001-03-08.
-Black on light yellow.
-Used for Win32 on a Nokia446Xpro monitor.
-Includes cvs, font-lock, gnus, message, sgml, widget"
- (interactive)
- (color-theme-install
- '(color-theme-aalto-light
- ((background-color . "#FFFFE0")
- (background-mode . light)
- (border-color . "black")
- (cursor-color . "black")
- (foreground-color . "black")
- (mouse-color . "LawnGreen"))
- ((gnus-mouse-face . highlight)
- (list-matching-lines-face . bold)
- (tinyreplace-:face . highlight)
- (view-highlight-face . highlight))
- (default ((t (nil))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:italic t :bold t))))
- (calendar-today-face ((t (:underline t))))
- (cvs-filename-face ((t (:foreground "blue4"))))
- (cvs-handled-face ((t (:foreground "pink"))))
- (cvs-header-face ((t (:bold t :foreground "blue4"))))
- (cvs-marked-face ((t (:bold t :foreground "green3"))))
- (cvs-msg-face ((t (:italic t))))
- (cvs-need-action-face ((t (:foreground "orange"))))
- (cvs-unknown-face ((t (:foreground "red"))))
- (diary-face ((t (:foreground "red"))))
- (eshell-test-failed-face ((t (:bold t :foreground "OrangeRed"))))
- (eshell-test-ok-face ((t (:bold t :foreground "Green"))))
- (font-lock-builtin-face ((t (:foreground "Orchid"))))
- (font-lock-comment-face ((t (:foreground "Firebrick"))))
- (font-lock-constant-face ((t (:foreground "CadetBlue"))))
- (font-lock-function-name-face ((t (:foreground "Blue"))))
- (font-lock-keyword-face ((t (:foreground "Purple"))))
- (font-lock-string-face ((t (:foreground "RosyBrown"))))
- (font-lock-type-face ((t (:foreground "ForestGreen"))))
- (font-lock-variable-name-face ((t (:foreground "DarkGoldenrod"))))
- (font-lock-warning-face ((t (:bold t :foreground "Red"))))
- (gnus-emphasis-bold ((t (:bold t))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t))))
- (gnus-emphasis-highlight-words ((t (:background "black" :foreground "yellow"))))
- (gnus-emphasis-italic ((t (:italic t))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:underline t :bold t))))
- (gnus-emphasis-underline-bold-italic ((t (:underline t :italic t :bold t))))
- (gnus-emphasis-underline-italic ((t (:underline t :italic t))))
- (gnus-group-mail-1-empty-face ((t (:foreground "DeepPink3"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "DeepPink3"))))
- (gnus-group-mail-2-empty-face ((t (:foreground "HotPink3"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "HotPink3"))))
- (gnus-group-mail-3-empty-face ((t (:foreground "magenta4"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "magenta4"))))
- (gnus-group-mail-low-empty-face ((t (:foreground "DeepPink4"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "DeepPink4"))))
- (gnus-group-news-1-empty-face ((t (:foreground "ForestGreen"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "ForestGreen"))))
- (gnus-group-news-2-empty-face ((t (:foreground "CadetBlue4"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "CadetBlue4"))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (:bold t))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (:bold t))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (:bold t))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (:bold t))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkGreen"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "DarkGreen"))))
- (gnus-header-content-face ((t (:italic t :foreground "indianred4"))))
- (gnus-header-from-face ((t (:foreground "red3"))))
- (gnus-header-name-face ((t (:foreground "maroon"))))
- (gnus-header-newsgroups-face ((t (:italic t :foreground "MidnightBlue"))))
- (gnus-header-subject-face ((t (:foreground "red4"))))
- (gnus-signature-face ((t (:italic t))))
- (gnus-splash-face ((t (:foreground "Brown"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "RoyalBlue"))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "DarkGreen"))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "firebrick"))))
- (gnus-summary-high-unread-face ((t (:bold t))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "RoyalBlue"))))
- (gnus-summary-low-read-face ((t (:italic t :foreground "DarkGreen"))))
- (gnus-summary-low-ticked-face ((t (:italic t :foreground "firebrick"))))
- (gnus-summary-low-unread-face ((t (:italic t))))
- (gnus-summary-normal-ancient-face ((t (:foreground "RoyalBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "DarkGreen"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "firebrick"))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-selected-face ((t (:underline t))))
- (highlight ((t (:background "darkseagreen2"))))
- (holiday-face ((t (:background "pink"))))
- (info-menu-5 ((t (:underline t))))
- (info-node ((t (:italic t :bold t))))
- (info-xref ((t (:bold t))))
- (italic ((t (:italic t))))
- (message-cited-text-face ((t (:foreground "red"))))
- (message-header-cc-face ((t (:foreground "MidnightBlue"))))
- (message-header-name-face ((t (:foreground "cornflower blue"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "blue4"))))
- (message-header-other-face ((t (:foreground "steel blue"))))
- (message-header-subject-face ((t (:bold t :foreground "navy blue"))))
- (message-header-to-face ((t (:bold t :foreground "MidnightBlue"))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-mml-face ((t (:foreground "ForestGreen"))))
- (message-separator-face ((t (:foreground "brown"))))
- (modeline ((t (:background "black" :foreground "white"))))
- (modeline-buffer-id ((t (:background "black" :foreground "white"))))
- (modeline-mousable ((t (:background "black" :foreground "white"))))
- (modeline-mousable-minor-mode ((t (:background "black" :foreground "white"))))
- (region ((t (:background "gray"))))
- (secondary-selection ((t (:background "paleturquoise"))))
- (sgml-comment-face ((t (:foreground "dark turquoise"))))
- (sgml-doctype-face ((t (:foreground "red"))))
- (sgml-end-tag-face ((t (:foreground "blue"))))
- (sgml-entity-face ((t (:foreground "magenta"))))
- (sgml-ignored-face ((t (:background "gray60" :foreground "gray40"))))
- (sgml-ms-end-face ((t (:foreground "green"))))
- (sgml-ms-start-face ((t (:foreground "green"))))
- (sgml-pi-face ((t (:foreground "lime green"))))
- (sgml-sgml-face ((t (:foreground "brown"))))
- (sgml-short-ref-face ((t (:foreground "deep sky blue"))))
- (sgml-start-tag-face ((t (:foreground "blue"))))
- (show-paren-match-face ((t (:background "turquoise"))))
- (show-paren-mismatch-face ((t (:background "purple" :foreground "white"))))
- (underline ((t (:underline t))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (widget-single-line-field-face ((t (:background "gray85")))))))
-
-(defun color-theme-aalto-dark ()
- "Color theme by Jari Aalto, created 2001-03-08.
-White on Deep Sky Blue 3.
-Used for Unix Exceed on a Nokia446Xpro monitor.
-Includes font-lock, info, and message."
- (interactive)
- (color-theme-install
- '(color-theme-aalto-dark
- ((background-color . "DeepSkyBlue3")
- (background-mode . dark)
- (border-color . "black")
- (cursor-color . "yellow")
- (foreground-color . "white")
- (mouse-color . "black"))
- ((ispell-highlight-face . highlight)
- (list-matching-lines-face . bold)
- (tinyreplace-:face . highlight)
- (view-highlight-face . highlight))
- (default ((t (nil))))
- (bold ((t (:bold t :background "blue3" :foreground "white"))))
- (bold-italic ((t (:italic t :bold t :foreground "blue3"))))
- (calendar-today-face ((t (:underline t))))
- (diary-face ((t (:foreground "red"))))
- (font-lock-builtin-face ((t (:foreground "LightSteelBlue"))))
- (font-lock-comment-face ((t (:foreground "OrangeRed"))))
- (font-lock-constant-face ((t (:foreground "Aquamarine"))))
- (font-lock-function-name-face ((t (:foreground "LightSkyBlue"))))
- (font-lock-keyword-face ((t (:foreground "Cyan"))))
- (font-lock-string-face ((t (:foreground "LightSalmon"))))
- (font-lock-type-face ((t (:foreground "PaleGreen"))))
- (font-lock-variable-name-face ((t (:foreground "LightGoldenrod"))))
- (font-lock-warning-face ((t (:bold t :foreground "Pink"))))
- (highlight ((t (:background "blue3" :foreground "white"))))
- (holiday-face ((t (:background "pink"))))
- (info-menu-5 ((t (:underline t))))
- (info-node ((t (:italic t :bold t))))
- (info-xref ((t (:bold t))))
- (italic ((t (:italic t :background "gray"))))
- (message-cited-text-face ((t (:foreground "red"))))
- (message-header-cc-face ((t (:bold t :foreground "green4"))))
- (message-header-name-face ((t (:foreground "DarkGreen"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "yellow"))))
- (message-header-other-face ((t (:foreground "#b00000"))))
- (message-header-subject-face ((t (:foreground "green3"))))
- (message-header-to-face ((t (:bold t :foreground "green2"))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-mml-face ((t (:foreground "ForestGreen"))))
- (message-separator-face ((t (:foreground "blue3"))))
- (modeline ((t (:background "white" :foreground "DeepSkyBlue3"))))
- (modeline-buffer-id ((t (:background "white" :foreground "DeepSkyBlue3"))))
- (modeline-mousable ((t (:background "white" :foreground "DeepSkyBlue3"))))
- (modeline-mousable-minor-mode ((t (:background "white" :foreground "DeepSkyBlue3"))))
- (region ((t (:background "gray"))))
- (secondary-selection ((t (:background "darkslateblue"))))
- (show-paren-match-face ((t (:background "turquoise"))))
- (show-paren-mismatch-face ((t (:background "purple" :foreground "white"))))
- (underline ((t (:underline t)))))))
-
-(defun color-theme-blippblopp ()
- "Color theme by Thomas Sicheritz-Ponten, created 2001-03-12.
-Used by researchers at Uppsala University and the Center for Biological
-Sequence Analysis at the Technical University of Denmark. (As some of my
-swedish friends couldn't pronounce Sicheritz - they choose to transform
-it to something more \"swedish\": Blippblopp :-)
-Includes font-lock and message."
- (interactive)
- (color-theme-install
- '(color-theme-blippblopp
- ((background-color . "white")
- (background-mode . light)
- (background-toolbar-color . "#cf3ccf3ccf3c")
- (border-color . "#000000000000")
- (bottom-toolbar-shadow-color . "#79e77df779e7")
- (cursor-color . "Red3")
- (foreground-color . "black")
- (mouse-color . "black")
- (top-toolbar-shadow-color . "#fffffbeeffff")
- (viper-saved-cursor-color-in-replace-mode . "Red3"))
- ((ispell-highlight-face . highlight))
- (default ((t (nil))))
- (blue ((t (:foreground "blue"))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:italic t :bold t))))
- (excerpt ((t (:italic t))))
- (ff-paths-non-existant-file-face ((t (:bold t :foreground "NavyBlue"))))
- (fg:black ((t (:foreground "black"))))
- (fixed ((t (:bold t))))
- (font-lock-builtin-face ((t (:foreground "red3"))))
- (font-lock-comment-face ((t (:foreground "orange"))))
- (font-lock-constant-face ((t (:foreground "red3"))))
- (font-lock-doc-string-face ((t (:foreground "darkgreen"))))
- (font-lock-exit-face ((t (:foreground "green"))))
- (font-lock-function-name-face ((t (:bold t :foreground "red"))))
- (font-lock-keyword-face ((t (:bold t :foreground "steelblue"))))
- (font-lock-preprocessor-face ((t (:foreground "blue3"))))
- (font-lock-reference-face ((t (:foreground "red3"))))
- (font-lock-string-face ((t (:foreground "green4"))))
- (font-lock-type-face ((t (:bold t :foreground "blue"))))
- (font-lock-variable-name-face ((t (:foreground "black"))))
- (font-lock-warning-face ((t (:bold t :foreground "Red"))))
- (green ((t (:foreground "green"))))
- (message-cited-text-face ((t (:foreground "red"))))
- (message-header-cc-face ((t (:foreground "MidnightBlue"))))
- (message-header-name-face ((t (:foreground "cornflower blue"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "blue4"))))
- (message-header-other-face ((t (:foreground "steel blue"))))
- (message-header-subject-face ((t (:bold t :foreground "navy blue"))))
- (message-header-to-face ((t (:bold t :foreground "MidnightBlue"))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-mml-face ((t (:foreground "ForestGreen"))))
- (message-separator-face ((t (:foreground "brown"))))
- (modeline ((t (:background "dimgray" :foreground "lemonchiffon"))))
- (modeline-buffer-id ((t (:background "dimgray" :foreground "green3"))))
- (modeline-mousable ((t (:background "dimgray" :foreground "orange"))))
- (modeline-mousable-minor-mode ((t (:background "dimgray" :foreground "blue4"))))
- (primary-selection ((t (:background "gray65"))))
- (red ((t (:foreground "red"))))
- (region ((t (:background "gray65"))))
- (secondary-selection ((t (:background "paleturquoise"))))
- (show-paren-match-face ((t (:background "turquoise"))))
- (show-paren-mismatch-face ((t (:background "purple" :foreground "white"))))
- (text-cursor ((t (:background "Red3" :foreground "white"))))
- (toolbar ((t (:background "Gray80"))))
- (underline ((t (:underline t))))
- (vcursor ((t (:underline t :background "cyan" :foreground "blue"))))
- (vertical-divider ((t (:background "Gray80"))))
- (xref-keyword-face ((t (:foreground "blue"))))
- (xref-list-pilot-face ((t (:foreground "navy"))))
- (xref-list-symbol-face ((t (:foreground "navy"))))
- (yellow ((t (:foreground "yellow"))))
- (zmacs-region ((t (:background "gray65")))))))
-
-(defun color-theme-hober (&optional preview)
- "Does all sorts of crazy stuff.
-Originally based on color-theme-standard, so I probably still have some
-setting that I haven't changed. I also liberally copied settings from
-the other themes in this package. The end result isn't much like the
-other ones; I hope you like it."
- (interactive)
- (color-theme-install
- '(color-theme-hober
- ((foreground-color . "#c0c0c0")
- (background-color . "black")
- (mouse-color . "black")
- (cursor-color . "medium turquoise")
- (border-color . "black")
- (background-mode . dark))
- (default ((t (nil))))
- (modeline ((t (:foreground "white" :background "darkslateblue"))))
- (modeline-buffer-id ((t (:foreground "white" :background "darkslateblue"))))
- (modeline-mousable ((t (:foreground "white" :background "darkslateblue"))))
- (modeline-mousable-minor-mode ((t (:foreground "white" :background "darkslateblue"))))
- (highlight ((t (:foreground "black" :background "#c0c0c0"))))
- (bold ((t (:bold t))))
- (italic ((t (:italic t))))
- (bold-italic ((t (:bold t :italic t))))
- (region ((t (:foreground "white" :background "darkslateblue"))))
- (zmacs-region ((t (:foreground "white" :background "darkslateblue"))))
- (secondary-selection ((t (:background "paleturquoise"))))
- (underline ((t (:underline t))))
- (diary-face ((t (:foreground "red"))))
- (calendar-today-face ((t (:underline t))))
- (holiday-face ((t (:background "pink"))))
- (widget-documentation-face ((t (:foreground "dark green" :background "white"))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red" :background "black"))))
- (widget-field-face ((t (:background "gray85" :foreground "black"))))
- (widget-single-line-field-face ((t (:background "gray85" :foreground "black"))))
- (widget-inactive-face ((t (:foreground "dim gray" :background "red"))))
- (fixed ((t (:bold t))))
- (excerpt ((t (:italic t))))
- (term-default-fg ((t (nil))))
- (term-default-bg ((t (nil))))
- (term-default-fg-inv ((t (nil))))
- (term-default-bg-inv ((t (nil))))
- (term-bold ((t (:bold t))))
- (term-underline ((t (:underline t))))
- (term-invisible ((t (nil))))
- (term-invisible-inv ((t (nil))))
- (term-white ((t (:foreground "#c0c0c0"))))
- (term-whitebg ((t (:background "#c0c0c0"))))
- (term-black ((t (:foreground "black"))))
- (term-blackbg ((t (:background "black"))))
- (term-red ((t (:foreground "#ef8171"))))
- (term-redbg ((t (:background "#ef8171"))))
- (term-green ((t (:foreground "#e5f779"))))
- (term-greenbg ((t (:background "#e5f779"))))
- (term-yellow ((t (:foreground "#fff796"))))
- (term-yellowbg ((t (:background "#fff796"))))
- (term-blue ((t (:foreground "#4186be"))))
- (term-bluebg ((t (:background "#4186be"))))
- (term-magenta ((t (:foreground "#ef9ebe"))))
- (term-magentabg ((t (:background "#ef9ebe"))))
- (term-cyan ((t (:foreground "#71bebe"))))
- (term-cyanbg ((t (:background "#71bebe"))))
- (font-lock-keyword-face ((t (:foreground "#00ffff"))))
- (font-lock-comment-face ((t (:foreground "Red"))))
- (font-lock-string-face ((t (:foreground "#ffff00"))))
- (font-lock-constant-face ((t (:foreground "#00ff00"))))
- (font-lock-builtin-face ((t (:foreground "#ffaa00"))))
- (font-lock-type-face ((t (:foreground "Coral"))))
- (font-lock-warning-face ((t (:foreground "Red" :bold t))))
- (font-lock-function-name-face ((t (:foreground "#4186be"))))
- (font-lock-variable-name-face ((t (:foreground "white" :bold t))))
- (message-header-to-face ((t (:foreground "#4186be" :bold t))))
- (message-header-cc-face ((t (:foreground "#4186be"))))
- (message-header-subject-face ((t (:foreground "#4186be" :bold t))))
- (message-header-newsgroups-face ((t (:foreground "Coral" :bold t))))
- (message-header-other-face ((t (:foreground "steel blue"))))
- (message-header-name-face ((t (:foreground "white"))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-separator-face ((t (:foreground "brown"))))
- (message-cited-text-face ((t (:foreground "white"))))
- (gnus-header-from-face ((t (:foreground "Coral"))))
- (gnus-header-subject-face ((t (:foreground "#4186be"))))
- (gnus-header-newsgroups-face ((t (:foreground "#4186be" :italic t))))
- (gnus-header-name-face ((t (:foreground "white"))))
- (gnus-header-content-face ((t (:foreground "#4186be" :italic t))))
- (gnus-cite-attribution-face ((t (:italic t))))
- (gnus-cite-face-list ((t (:bold nil :foreground "red"))))
- (gnus-group-news-1-face ((t (:foreground "ForestGreen" :bold t))))
- (gnus-group-news-1-empty-face ((t (:foreground "ForestGreen"))))
- (gnus-group-news-2-face ((t (:foreground "CadetBlue4" :bold t))))
- (gnus-group-news-2-empty-face ((t (:foreground "CadetBlue4"))))
- (gnus-group-news-3-face ((t (:bold t))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-low-face ((t (:foreground "DarkGreen" :bold t))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkGreen"))))
- (gnus-group-mail-1-face ((t (:foreground "DeepPink3" :bold t))))
- (gnus-group-mail-1-empty-face ((t (:foreground "DeepPink3"))))
- (gnus-group-mail-2-face ((t (:foreground "HotPink3" :bold t))))
- (gnus-group-mail-2-empty-face ((t (:foreground "HotPink3"))))
- (gnus-group-mail-3-face ((t (:foreground "magenta4" :bold t))))
- (gnus-group-mail-3-empty-face ((t (:foreground "magenta4"))))
- (gnus-group-mail-low-face ((t (:foreground "DeepPink4" :bold t))))
- (gnus-group-mail-low-empty-face ((t (:foreground "DeepPink4"))))
- (gnus-summary-selected-face ((t (:underline t))))
- (gnus-summary-cancelled-face ((t (:foreground "yellow" :background "black"))))
- (gnus-summary-high-ticked-face ((t (:foreground "firebrick" :bold t))))
- (gnus-summary-low-ticked-face ((t (:foreground "firebrick" :italic t))))
- (gnus-summary-normal-ticked-face ((t (:foreground "firebrick"))))
- (gnus-summary-high-ancient-face ((t (:foreground "RoyalBlue" :bold t))))
- (gnus-summary-low-ancient-face ((t (:foreground "RoyalBlue" :italic t))))
- (gnus-summary-normal-ancient-face ((t (:foreground "RoyalBlue"))))
- (gnus-summary-high-unread-face ((t (:bold t))))
- (gnus-summary-low-unread-face ((t (:italic t))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-high-read-face ((t (:foreground "DarkGreen" :bold t))))
- (gnus-summary-low-read-face ((t (:foreground "DarkGreen" :italic t))))
- (gnus-summary-normal-read-face ((t (:foreground "DarkGreen"))))
- (gnus-splash-face ((t (:foreground "ForestGreen"))))
- (gnus-emphasis-bold ((t (:bold t))))
- (gnus-emphasis-italic ((t (:italic t))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:bold t :underline t))))
- (gnus-emphasis-underline-italic ((t (:italic t :underline t))))
- (gnus-emphasis-bold-italic ((t (:bold t :italic t))))
- (gnus-emphasis-underline-bold-italic ((t (:bold t :italic t :underline t))))
- (gnus-signature-face ((t (:foreground "white"))))
- (gnus-cite-face-1 ((t (:foreground "Khaki"))))
- (gnus-cite-face-2 ((t (:foreground "Coral"))))
- (gnus-cite-face-3 ((t (:foreground "#4186be"))))
- (gnus-cite-face-4 ((t (:foreground "yellow green"))))
- (gnus-cite-face-5 ((t (:foreground "IndianRed"))))
- (highlight-changes-face ((t (:foreground "red"))))
- (highlight-changes-delete-face ((t (:foreground "red" :underline t))))
- (show-paren-match-face ((t (:foreground "white" :background "purple"))))
- (show-paren-mismatch-face ((t (:foreground "white" :background "red"))))
- (cperl-nonoverridable-face ((t (:foreground "chartreuse3"))))
- (cperl-array-face ((t (:foreground "Blue" :bold t :background "lightyellow2"))))
- (cperl-hash-face ((t (:foreground "Red" :bold t :italic t :background "lightyellow2"))))
- (makefile-space-face ((t (:background "hotpink"))))
- (sgml-start-tag-face ((t (:foreground "mediumspringgreen"))))
- (sgml-ignored-face ((t (:foreground "gray20" :background "gray60"))))
- (sgml-doctype-face ((t (:foreground "orange"))))
- (sgml-sgml-face ((t (:foreground "yellow"))))
- (sgml-end-tag-face ((t (:foreground "greenyellow"))))
- (sgml-entity-face ((t (:foreground "gold"))))
- (flyspell-incorrect-face ((t (:foreground "OrangeRed" :bold t :underline t))))
- (flyspell-duplicate-face ((t (:foreground "Gold3" :bold t :underline t)))))))
-
-(defun color-theme-bharadwaj ()
- "Color theme by Girish Bharadwaj, created 2001-03-28.
-Black on gainsboro. Includes BBDB, custom, cperl, cvs, dired, ediff,
-erc, eshell, font-latex, font-lock, gnus, info, message, paren, sgml,
-shell, speedbar, term, vhdl, viper, widget, woman, xref. Wow!"
- (interactive)
- (color-theme-install
- '(color-theme-bharadwaj
- ((background-color . "gainsboro")
- (background-mode . light)
- (background-toolbar-color . "#cf3ccf3ccf3c")
- (border-color . "black")
- (bottom-toolbar-shadow-color . "#79e77df779e7")
- (cursor-color . "grey15")
- (foreground-color . "black")
- (mouse-color . "grey15")
- (top-toolbar-shadow-color . "#fffffbeeffff")
- (viper-saved-cursor-color-in-replace-mode . "Red3"))
- ((gnus-mouse-face . highlight)
- (smiley-mouse-face . highlight))
- (default ((t (nil))))
- (bbdb-company ((t (nil))))
- (bbdb-field-name ((t (:bold t))))
- (bbdb-field-value ((t (nil))))
- (bbdb-name ((t (:underline t))))
- (blank-space-face ((t (nil))))
- (blank-tab-face ((t (nil))))
- (blue ((t (nil))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:bold t))))
- (border-glyph ((t (nil))))
- (calendar-today-face ((t (:underline t))))
- (comint-input-face ((t (:foreground "deepskyblue"))))
- (cperl-array-face ((t (:bold t :background "lightyellow2" :foreground "Blue"))))
- (cperl-hash-face ((t (:bold t :background "lightyellow2" :foreground "Red"))))
- (cperl-nonoverridable-face ((t (:foreground "chartreuse3"))))
- (custom-button-face ((t (:bold t))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:underline t))))
- (custom-group-tag-face ((t (:underline t :bold t :foreground "blue"))))
- (custom-group-tag-face-1 ((t (:underline t :foreground "red"))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "dark green"))))
- (custom-variable-button-face ((t (:underline t :bold t))))
- (custom-variable-tag-face ((t (:underline t :bold t :foreground "blue"))))
- (cvs-filename-face ((t (:foreground "blue4"))))
- (cvs-handled-face ((t (:foreground "pink"))))
- (cvs-header-face ((t (:bold t :foreground "blue4"))))
- (cvs-marked-face ((t (:bold t :foreground "green3"))))
- (cvs-msg-face ((t (nil))))
- (cvs-need-action-face ((t (:foreground "orange"))))
- (cvs-unknown-face ((t (:foreground "red"))))
- (diary-face ((t (:bold t :foreground "red"))))
- (dired-face-boring ((t (:foreground "Gray65"))))
- (dired-face-directory ((t (:bold t :foreground "forestgreen"))))
- (dired-face-executable ((t (:foreground "indianred"))))
- (dired-face-flagged ((t (:background "SlateGray"))))
- (dired-face-marked ((t (:background "darkblue" :foreground "deepskyblue"))))
- (dired-face-permissions ((t (nil))))
- (dired-face-setuid ((t (:foreground "Red"))))
- (dired-face-socket ((t (:foreground "magenta"))))
- (dired-face-symlink ((t (:foreground "grey95"))))
- (display-time-mail-balloon-enhance-face ((t (:background "orange"))))
- (display-time-mail-balloon-gnus-group-face ((t (:foreground "blue"))))
- (display-time-time-balloon-face ((t (:foreground "red"))))
- (ediff-current-diff-face-A ((t (:background "pale green" :foreground "firebrick"))))
- (ediff-current-diff-face-Ancestor ((t (:background "VioletRed" :foreground "Black"))))
- (ediff-current-diff-face-B ((t (:background "Yellow" :foreground "DarkOrchid"))))
- (ediff-current-diff-face-C ((t (:background "Pink" :foreground "Navy"))))
- (ediff-even-diff-face-A ((t (:background "light grey" :foreground "Black"))))
- (ediff-even-diff-face-Ancestor ((t (:background "Grey" :foreground "White"))))
- (ediff-even-diff-face-B ((t (:background "Grey" :foreground "White"))))
- (ediff-even-diff-face-C ((t (:background "light grey" :foreground "Black"))))
- (ediff-fine-diff-face-A ((t (:background "sky blue" :foreground "Navy"))))
- (ediff-fine-diff-face-Ancestor ((t (:background "Green" :foreground "Black"))))
- (ediff-fine-diff-face-B ((t (:background "cyan" :foreground "Black"))))
- (ediff-fine-diff-face-C ((t (:background "Turquoise" :foreground "Black"))))
- (ediff-odd-diff-face-A ((t (:background "Grey" :foreground "White"))))
- (ediff-odd-diff-face-Ancestor ((t (:background "light grey" :foreground "Black"))))
- (ediff-odd-diff-face-B ((t (:background "light grey" :foreground "Black"))))
- (ediff-odd-diff-face-C ((t (:background "Grey" :foreground "White"))))
- (erc-action-face ((t (:bold t))))
- (erc-bold-face ((t (:bold t))))
- (erc-default-face ((t (nil))))
- (erc-direct-msg-face ((t (nil))))
- (erc-error-face ((t (:bold t))))
- (erc-input-face ((t (nil))))
- (erc-inverse-face ((t (nil))))
- (erc-notice-face ((t (nil))))
- (erc-pal-face ((t (nil))))
- (erc-prompt-face ((t (nil))))
- (erc-underline-face ((t (nil))))
- (eshell-ls-archive-face ((t (:bold t :foreground "Orchid"))))
- (eshell-ls-backup-face ((t (:foreground "OrangeRed"))))
- (eshell-ls-clutter-face ((t (:bold t :foreground "OrangeRed"))))
- (eshell-ls-directory-face ((t (:bold t :foreground "Blue"))))
- (eshell-ls-executable-face ((t (:bold t :foreground "ForestGreen"))))
- (eshell-ls-missing-face ((t (:bold t :foreground "Red"))))
- (eshell-ls-picture-face ((t (nil))))
- (eshell-ls-product-face ((t (:foreground "OrangeRed"))))
- (eshell-ls-readonly-face ((t (:foreground "Brown"))))
- (eshell-ls-special-face ((t (:bold t :foreground "Magenta"))))
- (eshell-ls-symlink-face ((t (:bold t :foreground "DarkCyan"))))
- (eshell-ls-unreadable-face ((t (:foreground "Grey30"))))
- (eshell-prompt-face ((t (:bold t :foreground "Red"))))
- (eshell-test-failed-face ((t (:bold t :foreground "OrangeRed"))))
- (eshell-test-ok-face ((t (:bold t :foreground "Green"))))
- (excerpt ((t (nil))))
- (ff-paths-non-existant-file-face ((t (:bold t :foreground "NavyBlue"))))
- (fg:black ((t (:foreground "black"))))
- (fixed ((t (:bold t))))
- (flyspell-duplicate-face ((t (:underline t :bold t :foreground "Gold3"))))
- (flyspell-incorrect-face ((t (:underline t :bold t :foreground "OrangeRed"))))
- (font-latex-bold-face ((t (nil))))
- (font-latex-italic-face ((t (nil))))
- (font-latex-math-face ((t (nil))))
- (font-latex-sedate-face ((t (nil))))
- (font-latex-string-face ((t (nil))))
- (font-latex-warning-face ((t (nil))))
- (font-lock-builtin-face ((t (:foreground "ForestGreen"))))
- (font-lock-comment-face ((t (:foreground "grey55"))))
- (font-lock-constant-face ((t (:foreground "OliveDrab"))))
- (font-lock-doc-string-face ((t (:bold t :foreground "blue4"))))
- (font-lock-exit-face ((t (nil))))
- (font-lock-function-name-face ((t (:italic t :bold t :foreground "SlateBlue"))))
- (font-lock-keyword-face ((t (:foreground "DarkBlue"))))
- (font-lock-preprocessor-face ((t (:foreground "blue3"))))
- (font-lock-reference-face ((t (:foreground "red3"))))
- (font-lock-string-face ((t (:foreground "DarkRed"))))
- (font-lock-type-face ((t (:foreground "SteelBlue4"))))
- (font-lock-variable-name-face ((t (:foreground "DarkGoldenrod"))))
- (font-lock-warning-face ((t (:bold t :foreground "VioletRed"))))
- (fringe ((t (:background "grey95"))))
- (gnus-cite-attribution-face ((t (:bold t))))
- (gnus-cite-face-1 ((t (:foreground "MidnightBlue"))))
- (gnus-cite-face-10 ((t (:foreground "medium purple"))))
- (gnus-cite-face-11 ((t (:foreground "turquoise"))))
- (gnus-cite-face-2 ((t (:foreground "firebrick"))))
- (gnus-cite-face-3 ((t (:foreground "dark green"))))
- (gnus-cite-face-4 ((t (:foreground "OrangeRed"))))
- (gnus-cite-face-5 ((t (:foreground "dark khaki"))))
- (gnus-cite-face-6 ((t (:foreground "dark violet"))))
- (gnus-cite-face-7 ((t (:foreground "SteelBlue4"))))
- (gnus-cite-face-8 ((t (:foreground "magenta"))))
- (gnus-cite-face-9 ((t (:foreground "violet"))))
- (gnus-emphasis-bold ((t (:bold t))))
- (gnus-emphasis-bold-italic ((t (:bold t))))
- (gnus-emphasis-highlight-words ((t (nil))))
- (gnus-emphasis-italic ((t (nil))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:underline t :bold t))))
- (gnus-emphasis-underline-bold-italic ((t (:underline t :bold t))))
- (gnus-emphasis-underline-italic ((t (:underline t))))
- (gnus-filterhist-face-1 ((t (nil))))
- (gnus-group-mail-1-empty-face ((t (:foreground "DeepPink3"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "DeepPink3"))))
- (gnus-group-mail-2-empty-face ((t (:foreground "HotPink3"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "HotPink3"))))
- (gnus-group-mail-3-empty-face ((t (:foreground "magenta4"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "magenta4"))))
- (gnus-group-mail-low-empty-face ((t (:foreground "DeepPink4"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "DeepPink4"))))
- (gnus-group-news-1-empty-face ((t (:foreground "ForestGreen"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "ForestGreen"))))
- (gnus-group-news-2-empty-face ((t (:foreground "CadetBlue4"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "CadetBlue4"))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (:bold t))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (:bold t))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (:bold t))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (:bold t))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkGreen"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "DarkGreen"))))
- (gnus-header-content-face ((t (:foreground "indianred4"))))
- (gnus-header-from-face ((t (:bold t :foreground "red3"))))
- (gnus-header-name-face ((t (:bold t :foreground "maroon"))))
- (gnus-header-newsgroups-face ((t (:bold t :foreground "MidnightBlue"))))
- (gnus-header-subject-face ((t (:bold t :foreground "red4"))))
- (gnus-picons-face ((t (:background "white" :foreground "black"))))
- (gnus-picons-xbm-face ((t (:background "white" :foreground "black"))))
- (gnus-signature-face ((t (nil))))
- (gnus-splash ((t (nil))))
- (gnus-splash-face ((t (:foreground "ForestGreen"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "RoyalBlue"))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "DarkGreen"))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "firebrick"))))
- (gnus-summary-high-unread-face ((t (:bold t))))
- (gnus-summary-low-ancient-face ((t (:foreground "RoyalBlue"))))
- (gnus-summary-low-read-face ((t (:foreground "DarkGreen"))))
- (gnus-summary-low-ticked-face ((t (:bold t :foreground "firebrick"))))
- (gnus-summary-low-unread-face ((t (nil))))
- (gnus-summary-normal-ancient-face ((t (:foreground "RoyalBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "DarkGreen"))))
- (gnus-summary-normal-ticked-face ((t (:bold t :foreground "firebrick"))))
- (gnus-summary-normal-unread-face ((t (:bold t))))
- (gnus-summary-selected-face ((t (:underline t))))
- (gnus-x-face ((t (:background "white" :foreground "black"))))
- (green ((t (nil))))
- (gui-button-face ((t (:background "grey75"))))
- (gui-element ((t (:background "Gray80"))))
- (highlight ((t (:background "LightSkyBlue"))))
- (highlight-changes-delete-face ((t (:underline t :foreground "red"))))
- (highlight-changes-face ((t (:foreground "red"))))
- (highline-face ((t (:background "grey95"))))
- (holiday-face ((t (:background "pink"))))
- (html-helper-italic-face ((t (nil))))
- (info-menu-5 ((t (:underline t))))
- (info-node ((t (:bold t))))
- (info-xref ((t (:bold t))))
- (isearch ((t (:background "yellow"))))
- (isearch-secondary ((t (:foreground "red3"))))
- (italic ((t (nil))))
- (lazy-highlight-face ((t (:bold t :foreground "dark magenta"))))
- (left-margin ((t (nil))))
- (linemenu-face ((t (nil))))
- (list-mode-item-selected ((t (nil))))
- (makefile-space-face ((t (:background "hotpink"))))
- (message-cited-text-face ((t (:foreground "red"))))
- (message-header-cc-face ((t (:bold t :foreground "MidnightBlue"))))
- (message-header-name-face ((t (:foreground "cornflower blue"))))
- (message-header-newsgroups-face ((t (:bold t :foreground "blue4"))))
- (message-header-other-face ((t (:foreground "steel blue"))))
- (message-header-subject-face ((t (:bold t :foreground "navy blue"))))
- (message-header-to-face ((t (:bold t :foreground "MidnightBlue"))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-mml-face ((t (:bold t))))
- (message-separator-face ((t (:foreground "brown"))))
- (modeline ((t (:background "white" :foreground "black"))))
- (modeline-buffer-id ((t (:background "white" :foreground "black"))))
- (modeline-mousable ((t (:background "white" :foreground "black"))))
- (modeline-mousable-minor-mode ((t (:background "white" :foreground "black"))))
- (paren-blink-off ((t (:foreground "gray80"))))
- (paren-face-match ((t (:background "turquoise"))))
- (paren-face-mismatch ((t (:background "purple" :foreground "white"))))
- (paren-face-no-match ((t (:background "yellow" :foreground "black"))))
- (paren-match ((t (:background "darkseagreen2"))))
- (paren-mismatch ((t (:background "DeepPink" :foreground "black"))))
- (paren-mismatch-face ((t (:bold t))))
- (paren-no-match-face ((t (:bold t))))
- (pointer ((t (nil))))
- (primary-selection ((t (nil))))
- (red ((t (nil))))
- (region ((t (:background "grey80"))))
- (right-margin ((t (nil))))
- (secondary-selection ((t (:background "grey55"))))
- (sgml-comment-face ((t (:foreground "dark turquoise"))))
- (sgml-doctype-face ((t (nil))))
- (sgml-end-tag-face ((t (nil))))
- (sgml-entity-face ((t (nil))))
- (sgml-ignored-face ((t (nil))))
- (sgml-ms-end-face ((t (:foreground "green"))))
- (sgml-ms-start-face ((t (:foreground "green"))))
- (sgml-pi-face ((t (:foreground "lime green"))))
- (sgml-sgml-face ((t (nil))))
- (sgml-short-ref-face ((t (:foreground "deep sky blue"))))
- (sgml-start-tag-face ((t (nil))))
- (shell-option-face ((t (:foreground "blue"))))
- (shell-output-2-face ((t (:foreground "darkseagreen"))))
- (shell-output-3-face ((t (:foreground "slategrey"))))
- (shell-output-face ((t (:foreground "palegreen"))))
- (shell-prompt-face ((t (:foreground "red"))))
- (show-paren-match-face ((t (:background "grey80"))))
- (show-paren-mismatch-face ((t (:bold t :background "purple" :foreground "white"))))
- (speedbar-button-face ((t (:bold t :foreground "green4"))))
- (speedbar-directory-face ((t (:bold t :foreground "blue4"))))
- (speedbar-file-face ((t (:bold t :foreground "cyan4"))))
- (speedbar-highlight-face ((t (:background "green"))))
- (speedbar-selected-face ((t (:underline t :foreground "red"))))
- (speedbar-tag-face ((t (:foreground "brown"))))
- (swbuff-current-buffer-face ((t (:bold t))))
- (template-message-face ((t (:bold t))))
- (term-black ((t (:foreground "black"))))
- (term-blackbg ((t (:background "black"))))
- (term-blue ((t (:foreground "blue"))))
- (term-bluebg ((t (:background "blue"))))
- (term-bold ((t (:bold t))))
- (term-cyan ((t (:foreground "cyan"))))
- (term-cyanbg ((t (:background "cyan"))))
- (term-default-bg ((t (nil))))
- (term-default-bg-inv ((t (nil))))
- (term-default-fg ((t (nil))))
- (term-default-fg-inv ((t (nil))))
- (term-green ((t (:foreground "green"))))
- (term-greenbg ((t (:background "green"))))
- (term-invisible ((t (nil))))
- (term-invisible-inv ((t (nil))))
- (term-magenta ((t (:foreground "magenta"))))
- (term-magentabg ((t (:background "magenta"))))
- (term-red ((t (:foreground "red"))))
- (term-redbg ((t (:background "red"))))
- (term-underline ((t (:underline t))))
- (term-white ((t (:foreground "white"))))
- (term-whitebg ((t (:background "white"))))
- (term-yellow ((t (:foreground "yellow"))))
- (term-yellowbg ((t (:background "yellow"))))
- (text-cursor ((t (:background "grey15" :foreground "gainsboro"))))
- (toolbar ((t (nil))))
- (underline ((t (:underline t))))
- (vc-annotate-face-0046FF ((t (nil))))
- (vcursor ((t (:underline t :background "cyan" :foreground "blue"))))
- (vertical-divider ((t (nil))))
- (vhdl-font-lock-attribute-face ((t (:foreground "Orchid"))))
- (vhdl-font-lock-directive-face ((t (:foreground "CadetBlue"))))
- (vhdl-font-lock-enumvalue-face ((t (:foreground "Gold4"))))
- (vhdl-font-lock-function-face ((t (:foreground "Orchid4"))))
- (vhdl-font-lock-prompt-face ((t (:bold t :foreground "Red"))))
- (vhdl-font-lock-reserved-words-face ((t (:bold t :foreground "Orange"))))
- (vhdl-font-lock-translate-off-face ((t (:background "LightGray"))))
- (vhdl-speedbar-architecture-face ((t (:foreground "Blue"))))
- (vhdl-speedbar-architecture-selected-face ((t (:underline t :foreground "Blue"))))
- (vhdl-speedbar-configuration-face ((t (:foreground "DarkGoldenrod"))))
- (vhdl-speedbar-configuration-selected-face ((t (:underline t :foreground "DarkGoldenrod"))))
- (vhdl-speedbar-entity-face ((t (:foreground "ForestGreen"))))
- (vhdl-speedbar-entity-selected-face ((t (:underline t :foreground "ForestGreen"))))
- (vhdl-speedbar-instantiation-face ((t (:foreground "Brown"))))
- (vhdl-speedbar-instantiation-selected-face ((t (:underline t :foreground "Brown"))))
- (vhdl-speedbar-package-face ((t (:foreground "Grey50"))))
- (vhdl-speedbar-package-selected-face ((t (:underline t :foreground "Grey50"))))
- (viper-minibuffer-emacs-face ((t (:background "darkseagreen2" :foreground "Black"))))
- (viper-minibuffer-insert-face ((t (:background "pink" :foreground "Black"))))
- (viper-minibuffer-vi-face ((t (:background "grey" :foreground "DarkGreen"))))
- (viper-replace-overlay-face ((t (:background "darkseagreen2" :foreground "Black"))))
- (viper-search-face ((t (:background "khaki" :foreground "Black"))))
- (vvb-face ((t (:background "pink" :foreground "black"))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "navy" :foreground "white"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (widget-single-line-field-face ((t (:background "royalblue" :foreground "white"))))
- (woman-bold-face ((t (:bold t))))
- (woman-italic-face ((t (nil))))
- (woman-unknown-face ((t (nil))))
- (xref-keyword-face ((t (:foreground "blue"))))
- (xref-list-pilot-face ((t (:foreground "navy"))))
- (xref-list-symbol-face ((t (:foreground "navy"))))
- (yellow ((t (nil))))
- (zmacs-region ((t (:background "royalblue")))))))
-
-(defun color-theme-oswald ()
- "Color theme by Tom Oswald, created 2001-04-18.
-Green on black, includes font-lock, show-paren, and ediff."
- (interactive)
- (color-theme-install
- '(color-theme-oswald
- ((background-color . "black")
- (background-mode . dark)
- (border-color . "black")
- (cursor-color . "black")
- (foreground-color . "green")
- (mouse-color . "black"))
- ((blank-space-face . blank-space-face)
- (blank-tab-face . blank-tab-face)
- (list-matching-lines-face . bold)
- (view-highlight-face . highlight))
- (default ((t (nil))))
- (blank-space-face ((t (:background "LightGray"))))
- (blank-tab-face ((t (:background "green" :foreground "black"))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:italic t :bold t))))
- (ediff-current-diff-face-A ((t (:background "pale green" :foreground "firebrick"))))
- (ediff-current-diff-face-Ancestor ((t (:background "VioletRed" :foreground "Black"))))
- (ediff-current-diff-face-B ((t (:background "Yellow" :foreground "DarkOrchid"))))
- (ediff-current-diff-face-C ((t (:background "Pink" :foreground "Navy"))))
- (ediff-even-diff-face-A ((t (:background "light grey" :foreground "Black"))))
- (ediff-even-diff-face-Ancestor ((t (:background "Grey" :foreground "White"))))
- (ediff-even-diff-face-B ((t (:background "Grey" :foreground "White"))))
- (ediff-even-diff-face-C ((t (:background "light grey" :foreground "Black"))))
- (ediff-fine-diff-face-A ((t (:background "sky blue" :foreground "Navy"))))
- (ediff-fine-diff-face-Ancestor ((t (:background "Green" :foreground "Black"))))
- (ediff-fine-diff-face-B ((t (:background "cyan" :foreground "Black"))))
- (ediff-fine-diff-face-C ((t (:background "Turquoise" :foreground "Black"))))
- (ediff-odd-diff-face-A ((t (:background "Grey" :foreground "White"))))
- (ediff-odd-diff-face-Ancestor ((t (:background "light grey" :foreground "Black"))))
- (ediff-odd-diff-face-B ((t (:background "light grey" :foreground "Black"))))
- (ediff-odd-diff-face-C ((t (:background "Grey" :foreground "White"))))
- (font-lock-builtin-face ((t (:italic t :bold t :foreground "LightSteelBlue"))))
- (font-lock-comment-face ((t (:italic t :foreground "LightGoldenrod4"))))
- (font-lock-constant-face ((t (:italic t :foreground "HotPink"))))
- (font-lock-doc-string-face ((t (:italic t :foreground "orange"))))
- (font-lock-function-name-face ((t (:italic t :bold t :foreground "red"))))
- (font-lock-keyword-face ((t (:foreground "red"))))
- (font-lock-preprocessor-face ((t (:italic t :foreground "HotPink"))))
- (font-lock-string-face ((t (:italic t :foreground "orange"))))
- (font-lock-reference-face ((t (:italic t :bold t :foreground "LightSteelBlue"))))
- (font-lock-type-face ((t (:italic t :foreground "LightSlateBlue"))))
- (font-lock-variable-name-face ((t (:underline t :foreground "LightGoldenrod"))))
- (font-lock-warning-face ((t (:bold t :foreground "Pink"))))
- (highlight ((t (:background "yellow" :foreground "red"))))
- (isearch ((t (:background "dim gray" :foreground "aquamarine"))))
- (ispell-face ((t (:bold t :background "#3454b4" :foreground "yellow"))))
- (italic ((t (:italic t))))
- (modeline ((t (:background "green" :foreground "black"))))
- (modeline-buffer-id ((t (:background "green" :foreground "black"))))
- (modeline-mousable ((t (:background "green" :foreground "black"))))
- (modeline-mousable-minor-mode ((t (:background "green" :foreground "black"))))
- (region ((t (:background "dim gray" :foreground "aquamarine"))))
- (secondary-selection ((t (:background "darkslateblue" :foreground "light goldenrod"))))
- (show-paren-match-face ((t (:background "turquoise" :foreground "black"))))
- (show-paren-mismatch-face ((t (:background "purple" :foreground "white"))))
- (underline ((t (:underline t))))
- (zmacs-region ((t (:background "dim gray" :foreground "aquamarine")))))))
-
-(defun color-theme-salmon-diff ()
- "Salmon and aquamarine faces for diff and change-log modes.
-This is intended for other color themes to use (eg. `color-theme-gnome2')."
- (color-theme-install
- '(color-theme-salmon-diff
- nil
- (change-log-acknowledgement-face ((t (:foreground "LightBlue"))))
- (change-log-conditionals-face ((t (:bold t :weight bold :foreground "Aquamarine"))))
- (change-log-date-face ((t (:foreground "LightSalmon"))))
- (change-log-email-face ((t (:bold t :weight bold :foreground "Aquamarine"))))
- (change-log-file-face ((t (:bold t :weight bold :foreground "Aquamarine"))))
- (change-log-function-face ((t (:bold t :weight bold :foreground "Aquamarine"))))
- (change-log-list-face ((t (:foreground "Salmon"))))
- (change-log-name-face ((t (:foreground "Aquamarine"))))
- (diff-added-face ((t (nil))))
- (diff-changed-face ((t (nil))))
- (diff-context-face ((t (:foreground "grey70"))))
- (diff-file-header-face ((t (:bold t))))
- (diff-function-face ((t (:foreground "grey70"))))
- (diff-header-face ((t (:foreground "light salmon"))))
- (diff-hunk-header-face ((t (:foreground "light salmon"))))
- (diff-index-face ((t (:bold t))))
- (diff-nonexistent-face ((t (:bold t))))
- (diff-removed-face ((t (nil))))
- (log-view-message-face ((t (:foreground "light salmon")))))))
-
-(defun color-theme-robin-hood ()
- "`color-theme-gnome2' with navajo white on green.
-This theme tries to avoid underlined and italic faces, because
-the fonts either look ugly, or do not exist. The author himself
-uses neep, for example."
- (interactive)
- (color-theme-gnome2)
- (let ((color-theme-is-cumulative t))
- (color-theme-install
- '(color-theme-robin-hood
- ((foreground-color . "navajo white")
- (background-color . "#304020"))
- ((CUA-mode-read-only-cursor-color . "white")
- (help-highlight-face . info-xref)
- (list-matching-lines-buffer-name-face . bold))
- (default ((t (nil))))
- (button ((t (:bold t))))
- (calendar-today-face ((t (:foreground "lemon chiffon"))))
- (custom-button-face ((t (:bold t :foreground "DodgerBlue1"))))
- (diary-face ((t (:bold t :foreground "yellow"))))
- (fringe ((t (:background "#003700"))))
- (header-line ((t (:background "#030" :foreground "#AA7"))))
- (holiday-face ((t (:bold t :foreground "peru"))))
- (ido-subdir-face ((t (:foreground "MediumSlateBlue"))))
- (isearch ((t (:foreground "pink" :background "red"))))
- (isearch-lazy-highlight-face ((t (:foreground "red"))))
- (menu ((t (:background "#304020" :foreground "navajo white"))))
- (minibuffer-prompt ((t (:foreground "pale green"))))
- (modeline ((t (:background "dark olive green" :foreground "wheat" :box (:line-width 1 :style released-button)))))
- (mode-line-inactive ((t (:background "dark olive green" :foreground "khaki" :box (:line-width 1 :style released-button)))))
- (semantic-dirty-token-face ((t (:background "grey22"))))
- (tool-bar ((t (:background "#304020" :foreground "wheat" :box (:line-width 1 :style released-button)))))
- (tooltip ((t (:background "lemon chiffon" :foreground "black"))))))))
-
-(defun color-theme-snowish ()
- "Color theme by Girish Bharadwaj, created 2001-05-17.
-Dark slate gray on snow2, lots of blue colors.
-Includes custom, eshell, font-lock, gnus, html-helper,
-hyper-apropos, jde, message, paren, semantic, speedbar,
-term, widget."
- (interactive)
- (color-theme-install
- '(color-theme-snowish
- ((background-color . "snow2")
- (background-mode . light)
- (cursor-color . "Red3")
- (foreground-color . "darkslategray"))
- ((buffers-tab-face . buffers-tab)
- (gnus-mouse-face . highlight)
- (sgml-set-face . t)
- (smiley-mouse-face . highlight))
- (default ((t (nil))))
- (blue ((t (:foreground "blue"))))
- (bold ((t (:bold t :foreground "peru"))))
- (bold-italic ((t (:italic t :bold t))))
- (border-glyph ((t (nil))))
- (buffers-tab ((t (:background "snow2" :foreground "darkslategray"))))
- (custom-button-face ((t (:bold t))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-comment-face ((t (:background "gray85"))))
- (custom-comment-tag-face ((t (:foreground "blue4"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:underline t))))
- (custom-group-tag-face ((t (:underline t :foreground "blue"))))
- (custom-group-tag-face-1 ((t (:underline t :foreground "red"))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "dark green"))))
- (custom-variable-button-face ((t (:underline t :bold t))))
- (custom-variable-tag-face ((t (:underline t :foreground "blue"))))
- (cyan ((t (:foreground "cyan"))))
- (display-time-mail-balloon-enhance-face ((t (:background "orange"))))
- (display-time-mail-balloon-gnus-group-face ((t (:foreground "blue"))))
- (display-time-time-balloon-face ((t (:foreground "red"))))
- (eshell-ls-archive-face ((t (:bold t :foreground "Orchid"))))
- (eshell-ls-backup-face ((t (:foreground "OrangeRed"))))
- (eshell-ls-clutter-face ((t (:bold t :foreground "OrangeRed"))))
- (eshell-ls-directory-face ((t (:bold t :foreground "Blue"))))
- (eshell-ls-executable-face ((t (:bold t :foreground "ForestGreen"))))
- (eshell-ls-missing-face ((t (:bold t :foreground "Red"))))
- (eshell-ls-product-face ((t (:foreground "OrangeRed"))))
- (eshell-ls-readonly-face ((t (:foreground "Brown"))))
- (eshell-ls-special-face ((t (:bold t :foreground "Magenta"))))
- (eshell-ls-symlink-face ((t (:bold t :foreground "Dark Cyan"))))
- (eshell-ls-unreadable-face ((t (:foreground "Grey30"))))
- (eshell-prompt-face ((t (:bold t :foreground "Red"))))
- (font-lock-builtin-face ((t (:underline t :foreground "blue"))))
- (font-lock-comment-face ((t (:foreground "snow4"))))
- (font-lock-constant-face ((t (:foreground "CadetBlue"))))
- (font-lock-doc-string-face ((t (:foreground "mediumblue"))))
- (font-lock-function-name-face ((t (:bold t :foreground "darkblue"))))
- (font-lock-keyword-face ((t (:bold t :foreground "dodgerblue"))))
- (font-lock-preprocessor-face ((t (:underline t :foreground "blue3"))))
- (font-lock-reference-face ((t (:foreground "red3"))))
- (font-lock-string-face ((t (:foreground "darkviolet"))))
- (font-lock-type-face ((t (:foreground "goldenrod"))))
- (font-lock-variable-name-face ((t (:foreground "tomato"))))
- (font-lock-warning-face ((t (:bold t :foreground "Red"))))
- (gnus-cite-attribution-face ((t (nil))))
- (gnus-cite-face-1 ((t (:foreground "MidnightBlue"))))
- (gnus-cite-face-10 ((t (:foreground "medium purple"))))
- (gnus-cite-face-11 ((t (:foreground "turquoise"))))
- (gnus-cite-face-2 ((t (:foreground "firebrick"))))
- (gnus-cite-face-3 ((t (:foreground "dark green"))))
- (gnus-cite-face-4 ((t (:foreground "OrangeRed"))))
- (gnus-cite-face-5 ((t (:foreground "dark khaki"))))
- (gnus-cite-face-6 ((t (:foreground "dark violet"))))
- (gnus-cite-face-7 ((t (:foreground "SteelBlue4"))))
- (gnus-cite-face-8 ((t (:foreground "magenta"))))
- (gnus-cite-face-9 ((t (:foreground "violet"))))
- (gnus-emphasis-bold ((t (:bold t))))
- (gnus-emphasis-bold-italic ((t (nil))))
- (gnus-emphasis-highlight-words ((t (:background "black" :foreground "yellow"))))
- (gnus-emphasis-italic ((t (nil))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:underline t :bold t))))
- (gnus-emphasis-underline-bold-italic ((t (:underline t))))
- (gnus-emphasis-underline-italic ((t (:underline t))))
- (gnus-group-mail-1-empty-face ((t (:foreground "DeepPink3"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "DeepPink3"))))
- (gnus-group-mail-2-empty-face ((t (:foreground "HotPink3"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "HotPink3"))))
- (gnus-group-mail-3-empty-face ((t (:foreground "magenta4"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "magenta4"))))
- (gnus-group-mail-low-empty-face ((t (:foreground "DeepPink4"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "DeepPink4"))))
- (gnus-group-news-1-empty-face ((t (:foreground "ForestGreen"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "ForestGreen"))))
- (gnus-group-news-2-empty-face ((t (:foreground "CadetBlue4"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "CadetBlue4"))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (:bold t))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (:bold t))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (:bold t))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (:bold t))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkGreen"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "DarkGreen"))))
- (gnus-header-content-face ((t (:foreground "indianred4"))))
- (gnus-header-from-face ((t (:foreground "red3"))))
- (gnus-header-name-face ((t (:foreground "maroon"))))
- (gnus-header-newsgroups-face ((t (:foreground "MidnightBlue"))))
- (gnus-header-subject-face ((t (:foreground "red4"))))
- (gnus-picons-face ((t (:background "white" :foreground "black"))))
- (gnus-picons-xbm-face ((t (:background "white" :foreground "black"))))
- (gnus-signature-face ((t (nil))))
- (gnus-splash-face ((t (:foreground "Brown"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "RoyalBlue"))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "DarkGreen"))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "firebrick"))))
- (gnus-summary-high-unread-face ((t (:bold t))))
- (gnus-summary-low-ancient-face ((t (:foreground "RoyalBlue"))))
- (gnus-summary-low-read-face ((t (:foreground "DarkGreen"))))
- (gnus-summary-low-ticked-face ((t (:foreground "firebrick"))))
- (gnus-summary-low-unread-face ((t (nil))))
- (gnus-summary-normal-ancient-face ((t (:foreground "RoyalBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "DarkGreen"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "firebrick"))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-selected-face ((t (:underline t))))
- (gnus-x-face ((t (:background "white" :foreground "black"))))
- (green ((t (:foreground "green"))))
- (gui-button-face ((t (:background "grey75" :foreground "black"))))
- (gui-element ((t (:background "#D4D0C8" :foreground "black"))))
- (highlight ((t (:background "darkseagreen2"))))
- (html-helper-bold-face ((t (:bold t))))
- (html-helper-bold-italic-face ((t (nil))))
- (html-helper-builtin-face ((t (:underline t :foreground "blue3"))))
- (html-helper-italic-face ((t (:foreground "medium sea green"))))
- (html-helper-underline-face ((t (:underline t))))
- (html-tag-face ((t (:bold t))))
- (hyper-apropos-documentation ((t (:foreground "darkred"))))
- (hyper-apropos-heading ((t (:bold t))))
- (hyper-apropos-hyperlink ((t (:foreground "blue4"))))
- (hyper-apropos-major-heading ((t (:bold t))))
- (hyper-apropos-section-heading ((t (nil))))
- (hyper-apropos-warning ((t (:bold t :foreground "red"))))
- (info-menu-6 ((t (nil))))
- (isearch ((t (:background "paleturquoise"))))
- (isearch-secondary ((t (:foreground "red3"))))
- (italic ((t (nil))))
- (jde-bug-breakpoint-cursor ((t (:background "brown" :foreground "cyan"))))
- (jde-bug-breakpoint-marker ((t (:background "yellow" :foreground "red"))))
- (jde-java-font-lock-link-face ((t (:underline t :foreground "blue"))))
- (jde-java-font-lock-number-face ((t (:foreground "RosyBrown"))))
- (left-margin ((t (nil))))
- (list-mode-item-selected ((t (:background "gray68" :foreground "darkslategray"))))
- (magenta ((t (:foreground "magenta"))))
- (message-cited-text-face ((t (:foreground "red"))))
- (message-header-cc-face ((t (:foreground "MidnightBlue"))))
- (message-header-name-face ((t (:foreground "cornflower blue"))))
- (message-header-newsgroups-face ((t (:foreground "blue4"))))
- (message-header-other-face ((t (:foreground "steel blue"))))
- (message-header-subject-face ((t (:bold t :foreground "navy blue"))))
- (message-header-to-face ((t (:bold t :foreground "MidnightBlue"))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-mml-face ((t (:foreground "ForestGreen"))))
- (message-separator-face ((t (:foreground "brown"))))
- (modeline ((t (nil))))
- (modeline-buffer-id ((t (:background "#D4D0C8" :foreground "blue4"))))
- (modeline-mousable ((t (:background "#D4D0C8" :foreground "firebrick"))))
- (modeline-mousable-minor-mode ((t (:background "#D4D0C8" :foreground "green4"))))
- (paren-blink-off ((t (:foreground "snow2"))))
- (paren-match ((t (:background "darkseagreen2"))))
- (paren-mismatch ((t (:background "snow2" :foreground "darkslategray"))))
- (pointer ((t (nil))))
- (primary-selection ((t (:background "gray65"))))
- (red ((t (:foreground "red"))))
- (right-margin ((t (nil))))
- (secondary-selection ((t (:background "paleturquoise"))))
- (semantic-intangible-face ((t (:foreground "gray25"))))
- (semantic-read-only-face ((t (:background "gray25"))))
- (senator-momentary-highlight-face ((t (:background "gray70"))))
- (speedbar-button-face ((t (:foreground "green4"))))
- (speedbar-directory-face ((t (:foreground "blue4"))))
- (speedbar-file-face ((t (:foreground "cyan4"))))
- (speedbar-highlight-face ((t (:background "green"))))
- (speedbar-selected-face ((t (:underline t :foreground "red"))))
- (speedbar-tag-face ((t (:foreground "brown"))))
- (template-message-face ((t (:bold t))))
- (term-blue-bold-face ((t (:bold t :background "snow2" :foreground "blue"))))
- (term-blue-face ((t (:foreground "blue"))))
- (term-blue-inv-face ((t (:background "blue"))))
- (term-blue-ul-face ((t (:underline t :background "snow2" :foreground "blue"))))
- (term-cyan-bold-face ((t (:bold t :background "snow2" :foreground "cyan"))))
- (term-cyan-face ((t (:foreground "cyan"))))
- (term-cyan-inv-face ((t (:background "cyan"))))
- (term-cyan-ul-face ((t (:underline t :background "snow2" :foreground "cyan"))))
- (term-default-bold-face ((t (:bold t :background "snow2" :foreground "darkslategray"))))
- (term-default-face ((t (:background "snow2" :foreground "darkslategray"))))
- (term-default-inv-face ((t (:background "darkslategray" :foreground "snow2"))))
- (term-default-ul-face ((t (:underline t :background "snow2" :foreground "darkslategray"))))
- (term-green-bold-face ((t (:bold t :background "snow2" :foreground "green"))))
- (term-green-face ((t (:foreground "green"))))
- (term-green-inv-face ((t (:background "green"))))
- (term-green-ul-face ((t (:underline t :background "snow2" :foreground "green"))))
- (term-magenta-bold-face ((t (:bold t :background "snow2" :foreground "magenta"))))
- (term-magenta-face ((t (:foreground "magenta"))))
- (term-magenta-inv-face ((t (:background "magenta"))))
- (term-magenta-ul-face ((t (:underline t :background "snow2" :foreground "magenta"))))
- (term-red-bold-face ((t (:bold t :background "snow2" :foreground "red"))))
- (term-red-face ((t (:foreground "red"))))
- (term-red-inv-face ((t (:background "red"))))
- (term-red-ul-face ((t (:underline t :background "snow2" :foreground "red"))))
- (term-white-bold-face ((t (:bold t :background "snow2" :foreground "white"))))
- (term-white-face ((t (:foreground "white"))))
- (term-white-inv-face ((t (:background "snow2"))))
- (term-white-ul-face ((t (:underline t :background "snow2" :foreground "white"))))
- (term-yellow-bold-face ((t (:bold t :background "snow2" :foreground "yellow"))))
- (term-yellow-face ((t (:foreground "yellow"))))
- (term-yellow-inv-face ((t (:background "yellow"))))
- (term-yellow-ul-face ((t (:underline t :background "snow2" :foreground "yellow"))))
- (text-cursor ((t (:background "Red3" :foreground "snow2"))))
- (toolbar ((t (nil))))
- (underline ((t (:underline t))))
- (vertical-divider ((t (nil))))
- (white ((t (:foreground "white"))))
- (widget ((t (nil))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (yellow ((t (:foreground "yellow"))))
- (zmacs-region ((t (:background "gray65")))))))
-
-(defun color-theme-dark-laptop ()
- "Color theme by Laurent Michel, created 2001-05-24.
-Includes custom, fl, font-lock, gnus, message, widget."
- (interactive)
- (color-theme-install
- '(color-theme-dark-laptop
- ((background-color . "black")
- (background-mode . dark)
- (border-color . "black")
- (cursor-color . "yellow")
- (foreground-color . "white")
- (mouse-color . "sienna1"))
- ((gnus-mouse-face . highlight)
- (list-matching-lines-face . bold)
- (view-highlight-face . highlight))
- (default ((t (nil))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:italic t :bold t))))
- (custom-button-face ((t (nil))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:underline t))))
- (custom-group-tag-face ((t (:underline t :foreground "light blue"))))
- (custom-group-tag-face-1 ((t (:underline t :foreground "pink"))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "lime green"))))
- (custom-variable-button-face ((t (:underline t :bold t))))
- (custom-variable-tag-face ((t (:underline t :foreground "light blue"))))
- (fl-comment-face ((t (:foreground "pink"))))
- (fl-doc-string-face ((t (:foreground "purple"))))
- (fl-function-name-face ((t (:foreground "red"))))
- (fl-keyword-face ((t (:foreground "cyan"))))
- (fl-string-face ((t (:foreground "green"))))
- (fl-type-face ((t (:foreground "yellow"))))
- (font-lock-builtin-face ((t (:foreground "LightSteelBlue"))))
- (font-lock-comment-face ((t (:foreground "OrangeRed"))))
- (font-lock-constant-face ((t (:foreground "Aquamarine"))))
- (font-lock-doc-string-face ((t (:foreground "LightSalmon"))))
- (font-lock-function-name-face ((t (:foreground "LightSkyBlue"))))
- (font-lock-keyword-face ((t (:foreground "Cyan"))))
- (font-lock-preprocessor-face ((t (:foreground "Aquamarine"))))
- (font-lock-reference-face ((t (:foreground "LightSteelBlue"))))
- (font-lock-string-face ((t (:foreground "LightSalmon"))))
- (font-lock-type-face ((t (:foreground "PaleGreen"))))
- (font-lock-variable-name-face ((t (:foreground "LightGoldenrod"))))
- (font-lock-warning-face ((t (:bold t :foreground "Pink"))))
- (gnus-cite-attribution-face ((t (:italic t))))
- (gnus-cite-face-1 ((t (:bold t :foreground "deep sky blue"))))
- (gnus-cite-face-10 ((t (:foreground "medium purple"))))
- (gnus-cite-face-11 ((t (:foreground "turquoise"))))
- (gnus-cite-face-2 ((t (:bold t :foreground "cyan"))))
- (gnus-cite-face-3 ((t (:bold t :foreground "gold"))))
- (gnus-cite-face-4 ((t (:foreground "light pink"))))
- (gnus-cite-face-5 ((t (:foreground "pale green"))))
- (gnus-cite-face-6 ((t (:bold t :foreground "chocolate"))))
- (gnus-cite-face-7 ((t (:foreground "orange"))))
- (gnus-cite-face-8 ((t (:foreground "magenta"))))
- (gnus-cite-face-9 ((t (:foreground "violet"))))
- (gnus-emphasis-bold ((t (:bold t))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t))))
- (gnus-emphasis-highlight-words ((t (:background "black" :foreground "yellow"))))
- (gnus-emphasis-italic ((t (:italic t))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:underline t :bold t))))
- (gnus-emphasis-underline-bold-italic ((t (:underline t :italic t :bold t))))
- (gnus-emphasis-underline-italic ((t (:underline t :italic t))))
- (gnus-group-mail-1-empty-face ((t (:foreground "aquamarine1"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "aquamarine1"))))
- (gnus-group-mail-2-empty-face ((t (:foreground "aquamarine2"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "aquamarine2"))))
- (gnus-group-mail-3-empty-face ((t (:foreground "aquamarine3"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "aquamarine3"))))
- (gnus-group-mail-low-empty-face ((t (:foreground "aquamarine4"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "aquamarine4"))))
- (gnus-group-news-1-empty-face ((t (:foreground "PaleTurquoise"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "PaleTurquoise"))))
- (gnus-group-news-2-empty-face ((t (:foreground "turquoise"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "turquoise"))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (:bold t))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (:bold t))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (:bold t))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (:bold t))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkTurquoise"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "DarkTurquoise"))))
- (gnus-header-content-face ((t (:italic t :foreground "forest green"))))
- (gnus-header-from-face ((t (:bold t :foreground "spring green"))))
- (gnus-header-name-face ((t (:foreground "deep sky blue"))))
- (gnus-header-newsgroups-face ((t (:italic t :bold t :foreground "purple"))))
- (gnus-header-subject-face ((t (:bold t :foreground "orange"))))
- (gnus-signature-face ((t (:bold t :foreground "khaki"))))
- (gnus-splash-face ((t (:foreground "Brown"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "SkyBlue"))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "PaleGreen"))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "pink"))))
- (gnus-summary-high-unread-face ((t (:bold t))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "SkyBlue"))))
- (gnus-summary-low-read-face ((t (:italic t :foreground "PaleGreen"))))
- (gnus-summary-low-ticked-face ((t (:italic t :foreground "pink"))))
- (gnus-summary-low-unread-face ((t (:italic t))))
- (gnus-summary-normal-ancient-face ((t (:foreground "SkyBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "PaleGreen"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "pink"))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-selected-face ((t (:underline t))))
- (highlight ((t (:background "darkolivegreen"))))
- (italic ((t (:italic t))))
- (message-cited-text-face ((t (:bold t :foreground "red"))))
- (message-header-cc-face ((t (:bold t :foreground "green4"))))
- (message-header-name-face ((t (:bold t :foreground "orange"))))
- (message-header-newsgroups-face ((t (:bold t :foreground "violet"))))
- (message-header-other-face ((t (:bold t :foreground "chocolate"))))
- (message-header-subject-face ((t (:bold t :foreground "yellow"))))
- (message-header-to-face ((t (:bold t :foreground "cyan"))))
- (message-header-xheader-face ((t (:bold t :foreground "light blue"))))
- (message-mml-face ((t (:bold t :background "Green3"))))
- (message-separator-face ((t (:foreground "blue3"))))
- (modeline ((t (:background "white" :foreground "black"))))
- (modeline-buffer-id ((t (:background "white" :foreground "black"))))
- (modeline-mousable ((t (:background "white" :foreground "black"))))
- (modeline-mousable-minor-mode ((t (:background "white" :foreground "black"))))
- (region ((t (:background "blue"))))
- (primary-selection ((t (:background "blue"))))
- (isearch ((t (:background "blue"))))
- (zmacs-region ((t (:background "blue"))))
- (secondary-selection ((t (:background "darkslateblue"))))
- (underline ((t (:underline t))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "lime green"))))
- (widget-field-face ((t (:background "dim gray"))))
- (widget-inactive-face ((t (:foreground "light gray"))))
- (widget-single-line-field-face ((t (:background "dim gray")))))))
-
-(defun color-theme-taming-mr-arneson ()
- "Color theme by Erik Arneson, created 2001-06-12.
-Light sky blue on black. Includes bbdb, cperl, custom, cvs, diff,
-dired, font-lock, html-helper, hyper-apropos, info, isearch, man,
-message, paren, shell, and widget."
- (interactive)
- (color-theme-install
- '(color-theme-taming-mr-arneson
- ((background-color . "black")
- (background-mode . light)
- (background-toolbar-color . "#cf3ccf3ccf3c")
- (border-color . "#000000000000")
- (bottom-toolbar-shadow-color . "#79e77df779e7")
- (cursor-color . "Red3")
- (foreground-color . "LightSkyBlue")
- (top-toolbar-shadow-color . "#fffffbeeffff"))
- ((buffers-tab-face . buffers-tab)
- (cperl-here-face . font-lock-string-face)
- (cperl-invalid-face quote default)
- (cperl-pod-face . font-lock-comment-face)
- (cperl-pod-head-face . font-lock-variable-name-face)
- (ispell-highlight-face . highlight)
- (vc-mode-face . highlight)
- (vm-highlight-url-face . bold-italic)
- (vm-highlighted-header-face . bold)
- (vm-mime-button-face . gui-button-face)
- (vm-summary-highlight-face . bold))
- (default ((t (nil))))
- (bbdb-company ((t (nil))))
- (bbdb-field-name ((t (:bold t))))
- (bbdb-field-value ((t (nil))))
- (bbdb-name ((t (:underline t))))
- (blue ((t (:foreground "blue"))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:bold t :foreground "yellow"))))
- (border-glyph ((t (nil))))
- (buffers-tab ((t (:background "black" :foreground "LightSkyBlue"))))
- (cperl-array-face ((t (:bold t :foreground "SkyBlue2"))))
- (cperl-hash-face ((t (:foreground "LightBlue2"))))
- (cperl-invalid-face ((t (:foreground "white"))))
- (cperl-nonoverridable-face ((t (:foreground "chartreuse3"))))
- (custom-button-face ((t (:bold t))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-comment-face ((t (:foreground "white"))))
- (custom-comment-tag-face ((t (:foreground "white"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:underline t))))
- (custom-group-tag-face ((t (:underline t :foreground "blue"))))
- (custom-group-tag-face-1 ((t (:underline t :foreground "red"))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "white"))))
- (custom-variable-button-face ((t (:underline t :bold t))))
- (custom-variable-tag-face ((t (:underline t :foreground "blue"))))
- (cvs-filename-face ((t (:foreground "white"))))
- (cvs-handled-face ((t (:foreground "pink"))))
- (cvs-header-face ((t (:foreground "green"))))
- (cvs-marked-face ((t (:bold t :foreground "green3"))))
- (cvs-msg-face ((t (:foreground "red"))))
- (cvs-need-action-face ((t (:foreground "yellow"))))
- (cvs-unknown-face ((t (:foreground "grey"))))
- (diff-added-face ((t (nil))))
- (diff-changed-face ((t (nil))))
- (diff-file-header-face ((t (:bold t :background "grey70"))))
- (diff-hunk-header-face ((t (:background "grey85"))))
- (diff-index-face ((t (:bold t :background "grey70"))))
- (diff-removed-face ((t (nil))))
- (dired-face-boring ((t (:foreground "Gray65"))))
- (dired-face-directory ((t (:bold t :foreground "SkyBlue2"))))
- (dired-face-executable ((t (:foreground "Green"))))
- (dired-face-flagged ((t (:background "LightSlateGray"))))
- (dired-face-header ((t (:background "grey75" :foreground "black"))))
- (dired-face-marked ((t (:background "PaleVioletRed"))))
- (dired-face-permissions ((t (:background "grey75" :foreground "black"))))
- (dired-face-setuid ((t (:foreground "Red"))))
- (dired-face-socket ((t (:foreground "magenta"))))
- (dired-face-symlink ((t (:foreground "cyan"))))
- (excerpt ((t (nil))))
- (fixed ((t (:bold t))))
- (font-lock-builtin-face ((t (:foreground "red3"))))
- (font-lock-comment-face ((t (:foreground "red"))))
- (font-lock-constant-face ((t (nil))))
- (font-lock-doc-string-face ((t (:foreground "turquoise"))))
- (font-lock-function-name-face ((t (:foreground "white"))))
- (font-lock-keyword-face ((t (:foreground "green"))))
- (font-lock-preprocessor-face ((t (:foreground "green3"))))
- (font-lock-reference-face ((t (:foreground "red3"))))
- (font-lock-string-face ((t (:foreground "turquoise"))))
- (font-lock-type-face ((t (:foreground "steelblue"))))
- (font-lock-variable-name-face ((t (:foreground "magenta2"))))
- (font-lock-warning-face ((t (:bold t :foreground "Red"))))
- (green ((t (:foreground "green"))))
- (gui-button-face ((t (:background "grey75" :foreground "black"))))
- (gui-element ((t (nil))))
- (highlight ((t (:background "darkseagreen2" :foreground "blue"))))
- (html-helper-bold-face ((t (:bold t))))
- (html-helper-italic-face ((t (:bold t :foreground "yellow"))))
- (html-helper-underline-face ((t (:underline t))))
- (hyper-apropos-documentation ((t (:foreground "white"))))
- (hyper-apropos-heading ((t (:bold t))))
- (hyper-apropos-hyperlink ((t (:foreground "sky blue"))))
- (hyper-apropos-major-heading ((t (:bold t))))
- (hyper-apropos-section-heading ((t (:bold t))))
- (hyper-apropos-warning ((t (:bold t :foreground "red"))))
- (info-node ((t (:bold t :foreground "yellow"))))
- (info-xref ((t (:bold t))))
- (isearch ((t (:background "paleturquoise" :foreground "dark red"))))
- (isearch-secondary ((t (:foreground "red3"))))
- (italic ((t (:bold t :foreground "yellow"))))
- (left-margin ((t (nil))))
- (list-mode-item-selected ((t (:background "gray68" :foreground "dark green"))))
- (man-bold ((t (:bold t))))
- (man-heading ((t (:bold t))))
- (man-italic ((t (:foreground "yellow"))))
- (man-xref ((t (:underline t))))
- (message-cited-text ((t (:foreground "orange"))))
- (message-header-contents ((t (:foreground "white"))))
- (message-headers ((t (:bold t :foreground "orange"))))
- (message-highlighted-header-contents ((t (:bold t))))
- (message-url ((t (:bold t :foreground "pink"))))
- (mmm-face ((t (:background "black" :foreground "green"))))
- (modeline ((t (nil))))
- (modeline-buffer-id ((t (:background "Gray80" :foreground "blue4"))))
- (modeline-mousable ((t (:background "Gray80" :foreground "firebrick"))))
- (modeline-mousable-minor-mode ((t (:background "Gray80" :foreground "green4"))))
- (paren-blink-off ((t (:foreground "gray80"))))
- (paren-match ((t (:background "dark blue"))))
- (paren-mismatch ((t (:background "DeepPink" :foreground "LightSkyBlue"))))
- (pointer ((t (nil))))
- (primary-selection ((t (:background "gray65" :foreground "DarkBlue"))))
- (red ((t (:foreground "red"))))
- (region ((t (:background "gray65" :foreground "DarkBlue"))))
- (right-margin ((t (nil))))
- (secondary-selection ((t (:background "paleturquoise" :foreground "black"))))
- (shell-option-face ((t (:foreground "blue4"))))
- (shell-output-2-face ((t (:foreground "green4"))))
- (shell-output-3-face ((t (:foreground "green4"))))
- (shell-output-face ((t (:bold t))))
- (shell-prompt-face ((t (:foreground "red4"))))
- (text-cursor ((t (:background "Red3" :foreground "black"))))
- (toolbar ((t (:background "Gray80" :foreground "black"))))
- (underline ((t (:underline t))))
- (vertical-divider ((t (nil))))
- (vm-xface ((t (:background "white" :foreground "black"))))
- (vmpc-pre-sig-face ((t (:foreground "forestgreen"))))
- (vmpc-sig-face ((t (:foreground "steelblue"))))
- (widget ((t (nil))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85" :foreground "black"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (x-face ((t (:background "white" :foreground "black"))))
- (xrdb-option-name-face ((t (:foreground "red"))))
- (yellow ((t (:foreground "yellow"))))
- (zmacs-region ((t (:background "gray65")))))))
-
-(defun color-theme-digital-ofs1 ()
- "Color theme by Gareth Owen, created 2001-06-13.
-This works well on an old, beat-up Digital Unix box with its 256 colour
-display, on which other color themes hog too much of the palette.
-Black on some shade of dark peach. Includes bbdb, cperl, custom,
-cvs, diff, dired, ediff, erc, eshell, font-latex, font-lock, gnus,
-highlight, hproperty, html-helper, hyper-apropos, info, jde, man,
-message, paren, searchm, semantic, sgml, shell, speedbar, term,
-vhdl, viper, w3m, widget, woman, x-symbol, xref."
- (interactive)
- (color-theme-install
- '(color-theme-digital-ofs1
- ((background-color . "#CA94AA469193")
- (background-mode . light)
- (background-toolbar-color . "#cf3ccf3ccf3c")
- (border-color . "black")
- (bottom-toolbar-shadow-color . "#79e77df779e7")
- (cursor-color . "Black")
- (foreground-color . "Black")
- (mouse-color . "Black")
- (top-toolbar-shadow-color . "#fffffbeeffff")
- (viper-saved-cursor-color-in-replace-mode . "Red3"))
- ((Man-overstrike-face . bold)
- (Man-underline-face . underline)
- (gnus-mouse-face . highlight)
- (goto-address-mail-face . italic)
- (goto-address-mail-mouse-face . secondary-selection)
- (goto-address-url-face . bold)
- (goto-address-url-mouse-face . highlight)
- (ispell-highlight-face . highlight)
- (list-matching-lines-face . bold)
- (rmail-highlight-face . font-lock-function-name-face)
- (view-highlight-face . highlight))
- (default ((t (:bold t))))
- (bbdb-company ((t (:italic t))))
- (bbdb-field-name ((t (:bold t))))
- (bbdb-field-value ((t (nil))))
- (bbdb-name ((t (:underline t))))
- (blank-space-face ((t (nil))))
- (blank-tab-face ((t (nil))))
- (blue ((t (:bold t :foreground "blue"))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:italic t :bold t))))
- (border-glyph ((t (:bold t))))
- (buffers-tab ((t (:background "black" :foreground "LightSkyBlue"))))
- (calendar-today-face ((t (:underline t :bold t :foreground "white"))))
- (comint-input-face ((t (nil))))
- (cperl-array-face ((t (:bold t :background "lightyellow2" :foreground "Blue"))))
- (cperl-hash-face ((t (:italic t :bold t :background "lightyellow2" :foreground "Red"))))
- (cperl-here-face ((t (nil))))
- (cperl-invalid-face ((t (:foreground "white"))))
- (cperl-nonoverridable-face ((t (:foreground "chartreuse3"))))
- (cperl-pod-face ((t (nil))))
- (cperl-pod-head-face ((t (nil))))
- (custom-button-face ((t (:bold t))))
- (custom-changed-face ((t (:bold t :background "blue" :foreground "white"))))
- (custom-comment-face ((t (:foreground "white"))))
- (custom-comment-tag-face ((t (:foreground "white"))))
- (custom-documentation-face ((t (:bold t))))
- (custom-face-tag-face ((t (:underline t :bold t))))
- (custom-group-tag-face ((t (:underline t :bold t :foreground "DarkBlue"))))
- (custom-group-tag-face-1 ((t (:underline t :bold t :foreground "red"))))
- (custom-invalid-face ((t (:bold t :background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:bold t :background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:bold t :background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t :bold t))))
- (custom-set-face ((t (:bold t :background "white" :foreground "blue"))))
- (custom-state-face ((t (:bold t :foreground "dark green"))))
- (custom-variable-button-face ((t (:underline t :bold t))))
- (custom-variable-tag-face ((t (:underline t :bold t :foreground "blue"))))
- (cvs-filename-face ((t (:foreground "white"))))
- (cvs-handled-face ((t (:foreground "pink"))))
- (cvs-header-face ((t (:bold t :foreground "green"))))
- (cvs-marked-face ((t (:bold t :foreground "green3"))))
- (cvs-msg-face ((t (:italic t :foreground "red"))))
- (cvs-need-action-face ((t (:foreground "yellow"))))
- (cvs-unknown-face ((t (:foreground "grey"))))
- (cyan ((t (:foreground "cyan"))))
- (diary-face ((t (:bold t :foreground "red"))))
- (diff-added-face ((t (nil))))
- (diff-changed-face ((t (nil))))
- (diff-file-header-face ((t (:bold t :background "grey70"))))
- (diff-hunk-header-face ((t (:background "grey85"))))
- (diff-index-face ((t (:bold t :background "grey70"))))
- (diff-removed-face ((t (nil))))
- (dired-face-boring ((t (:foreground "Gray65"))))
- (dired-face-directory ((t (:bold t))))
- (dired-face-executable ((t (:foreground "SeaGreen"))))
- (dired-face-flagged ((t (:background "LightSlateGray"))))
- (dired-face-header ((t (:background "grey75" :foreground "black"))))
- (dired-face-marked ((t (:background "PaleVioletRed"))))
- (dired-face-permissions ((t (:background "grey75" :foreground "black"))))
- (dired-face-setuid ((t (:foreground "Red"))))
- (dired-face-socket ((t (:foreground "magenta"))))
- (dired-face-symlink ((t (:foreground "cyan"))))
- (display-time-mail-balloon-enhance-face ((t (:bold t :background "orange"))))
- (display-time-mail-balloon-gnus-group-face ((t (:bold t :foreground "blue"))))
- (display-time-time-balloon-face ((t (:bold t :foreground "red"))))
- (ediff-current-diff-face-A ((t (:background "pale green" :foreground "firebrick"))))
- (ediff-current-diff-face-Ancestor ((t (:background "VioletRed" :foreground "Black"))))
- (ediff-current-diff-face-B ((t (:background "Yellow" :foreground "DarkOrchid"))))
- (ediff-current-diff-face-C ((t (:background "Pink" :foreground "Navy"))))
- (ediff-even-diff-face-A ((t (:background "light grey" :foreground "Black"))))
- (ediff-even-diff-face-Ancestor ((t (:background "Grey" :foreground "White"))))
- (ediff-even-diff-face-B ((t (:background "Grey" :foreground "White"))))
- (ediff-even-diff-face-C ((t (:background "light grey" :foreground "Black"))))
- (ediff-fine-diff-face-A ((t (:background "sky blue" :foreground "Navy"))))
- (ediff-fine-diff-face-Ancestor ((t (:background "Green" :foreground "Black"))))
- (ediff-fine-diff-face-B ((t (:background "cyan" :foreground "Black"))))
- (ediff-fine-diff-face-C ((t (:background "Turquoise" :foreground "Black"))))
- (ediff-odd-diff-face-A ((t (:background "Grey" :foreground "White"))))
- (ediff-odd-diff-face-Ancestor ((t (:background "light grey" :foreground "Black"))))
- (ediff-odd-diff-face-B ((t (:background "light grey" :foreground "Black"))))
- (ediff-odd-diff-face-C ((t (:background "Grey" :foreground "White"))))
- (erc-action-face ((t (:bold t))))
- (erc-bold-face ((t (:bold t))))
- (erc-default-face ((t (nil))))
- (erc-direct-msg-face ((t (nil))))
- (erc-error-face ((t (:bold t))))
- (erc-input-face ((t (nil))))
- (erc-inverse-face ((t (nil))))
- (erc-notice-face ((t (nil))))
- (erc-pal-face ((t (nil))))
- (erc-prompt-face ((t (nil))))
- (erc-underline-face ((t (nil))))
- (eshell-ls-archive-face ((t (:bold t :foreground "Orchid"))))
- (eshell-ls-backup-face ((t (:foreground "OrangeRed"))))
- (eshell-ls-clutter-face ((t (:bold t :foreground "OrangeRed"))))
- (eshell-ls-directory-face ((t (:bold t :foreground "Blue"))))
- (eshell-ls-executable-face ((t (:bold t :foreground "ForestGreen"))))
- (eshell-ls-missing-face ((t (:bold t :foreground "Red"))))
- (eshell-ls-picture-face ((t (:foreground "Violet"))))
- (eshell-ls-product-face ((t (:foreground "OrangeRed"))))
- (eshell-ls-readonly-face ((t (:foreground "Brown"))))
- (eshell-ls-special-face ((t (:bold t :foreground "Magenta"))))
- (eshell-ls-symlink-face ((t (:bold t :foreground "DarkCyan"))))
- (eshell-ls-text-face ((t (:foreground "medium aquamarine"))))
- (eshell-ls-todo-face ((t (:bold t :foreground "aquamarine"))))
- (eshell-ls-unreadable-face ((t (:foreground "Grey30"))))
- (eshell-prompt-face ((t (:bold t :foreground "Red"))))
- (eshell-test-failed-face ((t (:bold t :foreground "OrangeRed"))))
- (eshell-test-ok-face ((t (:bold t :foreground "Green"))))
- (excerpt ((t (:italic t))))
- (ff-paths-non-existant-file-face ((t (:bold t :foreground "NavyBlue"))))
- (fg:black ((t (:foreground "black"))))
- (fixed ((t (:bold t))))
- (fl-comment-face ((t (:foreground "medium purple"))))
- (fl-doc-string-face ((t (nil))))
- (fl-function-name-face ((t (:foreground "green"))))
- (fl-keyword-face ((t (:foreground "LightGreen"))))
- (fl-string-face ((t (:foreground "light coral"))))
- (fl-type-face ((t (:foreground "cyan"))))
- (flyspell-duplicate-face ((t (:underline t :bold t :foreground "Gold3"))))
- (flyspell-incorrect-face ((t (:underline t :bold t :foreground "OrangeRed"))))
- (font-latex-bold-face ((t (:bold t))))
- (font-latex-italic-face ((t (:italic t))))
- (font-latex-math-face ((t (nil))))
- (font-latex-sedate-face ((t (nil))))
- (font-latex-string-face ((t (nil))))
- (font-latex-warning-face ((t (nil))))
- (font-lock-builtin-face ((t (:italic t :bold t :foreground "Orchid"))))
- (font-lock-comment-face ((t (:bold t :foreground "Firebrick"))))
- (font-lock-constant-face ((t (:italic t :bold t :foreground "CadetBlue"))))
- (font-lock-doc-string-face ((t (:italic t :bold t :foreground "green4"))))
- (font-lock-emphasized-face ((t (:bold t))))
- (font-lock-exit-face ((t (:foreground "green"))))
- (font-lock-function-name-face ((t (:italic t :bold t :foreground "Blue"))))
- (font-lock-keyword-face ((t (:bold t :foreground "dark olive green"))))
- (font-lock-other-emphasized-face ((t (:italic t :bold t))))
- (font-lock-other-type-face ((t (:bold t :foreground "DarkBlue"))))
- (font-lock-preprocessor-face ((t (:italic t :bold t :foreground "blue3"))))
- (font-lock-reference-face ((t (:italic t :bold t :foreground "red3"))))
- (font-lock-special-comment-face ((t (nil))))
- (font-lock-special-keyword-face ((t (nil))))
- (font-lock-string-face ((t (:italic t :bold t :foreground "DarkBlue"))))
- (font-lock-type-face ((t (:italic t :bold t :foreground "DarkGreen"))))
- (font-lock-variable-name-face ((t (:italic t :bold t :foreground "darkgreen"))))
- (font-lock-warning-face ((t (:bold t :foreground "Red"))))
- (fringe ((t (:background "grey95"))))
- (gdb-arrow-face ((t (:bold t))))
- (gnus-cite-attribution-face ((t (:italic t :bold t))))
- (gnus-cite-face-1 ((t (:bold t :foreground "MidnightBlue"))))
- (gnus-cite-face-10 ((t (:foreground "medium purple"))))
- (gnus-cite-face-11 ((t (:foreground "turquoise"))))
- (gnus-cite-face-2 ((t (:bold t :foreground "firebrick"))))
- (gnus-cite-face-3 ((t (:bold t :foreground "dark green"))))
- (gnus-cite-face-4 ((t (:foreground "OrangeRed"))))
- (gnus-cite-face-5 ((t (:foreground "dark khaki"))))
- (gnus-cite-face-6 ((t (:bold t :foreground "dark violet"))))
- (gnus-cite-face-7 ((t (:foreground "SteelBlue4"))))
- (gnus-cite-face-8 ((t (:foreground "magenta"))))
- (gnus-cite-face-9 ((t (:foreground "violet"))))
- (gnus-cite-face-list ((t (nil))))
- (gnus-emphasis-bold ((t (:bold t))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t))))
- (gnus-emphasis-highlight-words ((t (:background "black" :foreground "yellow"))))
- (gnus-emphasis-italic ((t (:italic t))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:underline t :bold t))))
- (gnus-emphasis-underline-bold-italic ((t (:underline t :italic t :bold t))))
- (gnus-emphasis-underline-italic ((t (:underline t :italic t))))
- (gnus-filterhist-face-1 ((t (nil))))
- (gnus-group-mail-1-empty-face ((t (:foreground "DeepPink3"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "DeepPink3"))))
- (gnus-group-mail-2-empty-face ((t (:foreground "HotPink3"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "HotPink3"))))
- (gnus-group-mail-3-empty-face ((t (:foreground "magenta4"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "magenta4"))))
- (gnus-group-mail-low-empty-face ((t (:foreground "DeepPink4"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "DeepPink4"))))
- (gnus-group-news-1-empty-face ((t (:foreground "ForestGreen"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "ForestGreen"))))
- (gnus-group-news-2-empty-face ((t (:foreground "CadetBlue4"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "CadetBlue4"))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (:bold t))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (:bold t))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (:bold t))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (:bold t))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkGreen"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "DarkGreen"))))
- (gnus-header-content-face ((t (:italic t :foreground "indianred4"))))
- (gnus-header-from-face ((t (:bold t :foreground "red3"))))
- (gnus-header-name-face ((t (:bold t :foreground "maroon"))))
- (gnus-header-newsgroups-face ((t (:italic t :bold t :foreground "MidnightBlue"))))
- (gnus-header-subject-face ((t (:bold t :foreground "red4"))))
- (gnus-picons-face ((t (:background "white" :foreground "black"))))
- (gnus-picons-xbm-face ((t (:background "white" :foreground "black"))))
- (gnus-signature-face ((t (:italic t :bold t))))
- (gnus-splash ((t (nil))))
- (gnus-splash-face ((t (:foreground "Brown"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "RoyalBlue"))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "DarkGreen"))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "firebrick"))))
- (gnus-summary-high-unread-face ((t (:italic t :bold t))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "RoyalBlue"))))
- (gnus-summary-low-read-face ((t (:italic t :foreground "DarkGreen"))))
- (gnus-summary-low-ticked-face ((t (:italic t :bold t :foreground "firebrick"))))
- (gnus-summary-low-unread-face ((t (:italic t))))
- (gnus-summary-normal-ancient-face ((t (:foreground "RoyalBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "DarkGreen"))))
- (gnus-summary-normal-ticked-face ((t (:bold t :foreground "firebrick"))))
- (gnus-summary-normal-unread-face ((t (:bold t))))
- (gnus-summary-selected-face ((t (:underline t))))
- (gnus-x-face ((t (:background "white" :foreground "black"))))
- (green ((t (:bold t :foreground "green"))))
- (gui-button-face ((t (:bold t :background "grey75" :foreground "black"))))
- (gui-element ((t (:bold t :background "Gray80"))))
- (highlight ((t (:bold t :background "darkseagreen2"))))
- (highlight-changes-delete-face ((t (:underline t :foreground "red"))))
- (highlight-changes-face ((t (:foreground "red"))))
- (highline-face ((t (:background "black" :foreground "white"))))
- (holiday-face ((t (:bold t :background "pink" :foreground "white"))))
- (hproperty:but-face ((t (:bold t))))
- (hproperty:flash-face ((t (:bold t))))
- (hproperty:highlight-face ((t (:bold t))))
- (hproperty:item-face ((t (:bold t))))
- (html-helper-bold-face ((t (:bold t))))
- (html-helper-bold-italic-face ((t (nil))))
- (html-helper-builtin-face ((t (:underline t :foreground "blue3"))))
- (html-helper-italic-face ((t (:italic t :bold t :foreground "yellow"))))
- (html-helper-underline-face ((t (:underline t))))
- (html-tag-face ((t (:bold t))))
- (hyper-apropos-documentation ((t (:foreground "white"))))
- (hyper-apropos-heading ((t (:bold t))))
- (hyper-apropos-hyperlink ((t (:foreground "sky blue"))))
- (hyper-apropos-major-heading ((t (:bold t))))
- (hyper-apropos-section-heading ((t (:bold t))))
- (hyper-apropos-warning ((t (:bold t :foreground "red"))))
- (ibuffer-marked-face ((t (:foreground "red"))))
- (info-menu-5 ((t (:underline t :bold t))))
- (info-menu-6 ((t (nil))))
- (info-node ((t (:italic t :bold t))))
- (info-xref ((t (:bold t))))
- (isearch ((t (:bold t :background "paleturquoise"))))
- (isearch-secondary ((t (:foreground "red3"))))
- (ispell-face ((t (:bold t))))
- (italic ((t (:italic t :bold t))))
- (jde-bug-breakpoint-cursor ((t (:background "brown" :foreground "cyan"))))
- (jde-bug-breakpoint-marker ((t (:background "yellow" :foreground "red"))))
- (jde-java-font-lock-link-face ((t (:underline t :foreground "blue"))))
- (jde-java-font-lock-number-face ((t (:foreground "RosyBrown"))))
- (lazy-highlight-face ((t (:bold t :foreground "dark magenta"))))
- (left-margin ((t (:bold t))))
- (linemenu-face ((t (nil))))
- (list-mode-item-selected ((t (:bold t :background "gray68"))))
- (magenta ((t (:foreground "magenta"))))
- (makefile-space-face ((t (:background "hotpink"))))
- (man-bold ((t (:bold t))))
- (man-heading ((t (:bold t))))
- (man-italic ((t (:foreground "yellow"))))
- (man-xref ((t (:underline t))))
- (message-cited-text ((t (:bold t :foreground "orange"))))
- (message-cited-text-face ((t (:bold t :foreground "red"))))
- (message-header-cc-face ((t (:bold t :foreground "MidnightBlue"))))
- (message-header-contents ((t (:italic t :bold t :foreground "white"))))
- (message-header-name-face ((t (:bold t :foreground "cornflower blue"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "blue4"))))
- (message-header-other-face ((t (:bold t :foreground "steel blue"))))
- (message-header-subject-face ((t (:bold t :foreground "navy blue"))))
- (message-header-to-face ((t (:bold t :foreground "MidnightBlue"))))
- (message-header-xheader-face ((t (:bold t :foreground "blue"))))
- (message-headers ((t (:bold t :foreground "orange"))))
- (message-highlighted-header-contents ((t (:bold t))))
- (message-mml-face ((t (:bold t :foreground "ForestGreen"))))
- (message-separator-face ((t (:foreground "brown"))))
- (message-url ((t (:bold t :foreground "pink"))))
- (mmm-face ((t (:background "black" :foreground "green"))))
- (modeline ((t (:bold t :background "Black" :foreground "#CA94AA469193"))))
- (modeline-buffer-id ((t (:bold t :background "Gray80" :foreground "blue4"))))
- (modeline-mousable ((t (:bold t :background "Gray80" :foreground "firebrick"))))
- (modeline-mousable-minor-mode ((t (:bold t :background "Gray80" :foreground "green4"))))
- (my-tab-face ((t (nil))))
- (nil ((t (nil))))
- (p4-diff-del-face ((t (:bold t))))
- (paren-blink-off ((t (:foreground "gray80"))))
- (paren-face ((t (nil))))
- (paren-face-match ((t (nil))))
- (paren-face-mismatch ((t (nil))))
- (paren-face-no-match ((t (nil))))
- (paren-match ((t (:background "darkseagreen2"))))
- (paren-mismatch ((t (:background "DeepPink" :foreground "black"))))
- (paren-mismatch-face ((t (:bold t :background "DeepPink" :foreground "white"))))
- (paren-no-match-face ((t (:bold t :background "yellow" :foreground "white"))))
- (pointer ((t (:bold t))))
- (primary-selection ((t (:bold t :background "gray65"))))
- (red ((t (:bold t :foreground "red"))))
- (region ((t (:bold t :background "gray"))))
- (right-margin ((t (:bold t))))
- (searchm-buffer ((t (:bold t))))
- (searchm-button ((t (:bold t))))
- (searchm-field ((t (nil))))
- (searchm-field-label ((t (:bold t))))
- (searchm-highlight ((t (:bold t))))
- (secondary-selection ((t (:bold t :background "paleturquoise"))))
- (semantic-intangible-face ((t (:foreground "gray25"))))
- (semantic-read-only-face ((t (:background "gray25"))))
- (senator-momentary-highlight-face ((t (:background "gray70"))))
- (setnu-line-number-face ((t (:italic t :bold t))))
- (sgml-comment-face ((t (:foreground "dark green"))))
- (sgml-doctype-face ((t (:foreground "maroon"))))
- (sgml-end-tag-face ((t (:foreground "blue2"))))
- (sgml-entity-face ((t (:foreground "red2"))))
- (sgml-ignored-face ((t (:background "gray90" :foreground "maroon"))))
- (sgml-ms-end-face ((t (:foreground "maroon"))))
- (sgml-ms-start-face ((t (:foreground "maroon"))))
- (sgml-pi-face ((t (:foreground "maroon"))))
- (sgml-sgml-face ((t (:foreground "maroon"))))
- (sgml-short-ref-face ((t (:foreground "goldenrod"))))
- (sgml-start-tag-face ((t (:foreground "blue2"))))
- (shell-input-face ((t (:bold t))))
- (shell-option-face ((t (:bold t :foreground "blue4"))))
- (shell-output-2-face ((t (:bold t :foreground "green4"))))
- (shell-output-3-face ((t (:bold t :foreground "green4"))))
- (shell-output-face ((t (:bold t))))
- (shell-prompt-face ((t (:bold t :foreground "red4"))))
- (show-paren-match-face ((t (:bold t :background "turquoise"))))
- (show-paren-mismatch-face ((t (:bold t :background "purple" :foreground "white"))))
- (speedbar-button-face ((t (:bold t :foreground "magenta"))))
- (speedbar-directory-face ((t (:bold t :foreground "orchid"))))
- (speedbar-file-face ((t (:bold t :foreground "pink"))))
- (speedbar-highlight-face ((t (:background "black"))))
- (speedbar-selected-face ((t (:underline t :foreground "cyan"))))
- (speedbar-tag-face ((t (:foreground "yellow"))))
- (swbuff-current-buffer-face ((t (:bold t :foreground "red"))))
- (template-message-face ((t (:bold t))))
- (term-black ((t (:foreground "black"))))
- (term-blackbg ((t (:background "black"))))
- (term-blue ((t (:foreground "blue"))))
- (term-blue-bold-face ((t (:bold t :background "snow2" :foreground "blue"))))
- (term-blue-face ((t (:foreground "blue"))))
- (term-blue-inv-face ((t (:background "blue"))))
- (term-blue-ul-face ((t (:underline t :background "snow2" :foreground "blue"))))
- (term-bluebg ((t (:background "blue"))))
- (term-bold ((t (:bold t))))
- (term-cyan ((t (:foreground "cyan"))))
- (term-cyan-bold-face ((t (:bold t :background "snow2" :foreground "cyan"))))
- (term-cyan-face ((t (:foreground "cyan"))))
- (term-cyan-inv-face ((t (:background "cyan"))))
- (term-cyan-ul-face ((t (:underline t :background "snow2" :foreground "cyan"))))
- (term-cyanbg ((t (:background "cyan"))))
- (term-default-bg ((t (nil))))
- (term-default-bg-inv ((t (nil))))
- (term-default-bold-face ((t (:bold t :background "snow2" :foreground "darkslategray"))))
- (term-default-face ((t (:background "snow2" :foreground "darkslategray"))))
- (term-default-fg ((t (nil))))
- (term-default-fg-inv ((t (nil))))
- (term-default-inv-face ((t (:background "darkslategray" :foreground "snow2"))))
- (term-default-ul-face ((t (:underline t :background "snow2" :foreground "darkslategray"))))
- (term-green ((t (:foreground "green"))))
- (term-green-bold-face ((t (:bold t :background "snow2" :foreground "green"))))
- (term-green-face ((t (:foreground "green"))))
- (term-green-inv-face ((t (:background "green"))))
- (term-green-ul-face ((t (:underline t :background "snow2" :foreground "green"))))
- (term-greenbg ((t (:background "green"))))
- (term-invisible ((t (nil))))
- (term-invisible-inv ((t (nil))))
- (term-magenta ((t (:foreground "magenta"))))
- (term-magenta-bold-face ((t (:bold t :background "snow2" :foreground "magenta"))))
- (term-magenta-face ((t (:foreground "magenta"))))
- (term-magenta-inv-face ((t (:background "magenta"))))
- (term-magenta-ul-face ((t (:underline t :background "snow2" :foreground "magenta"))))
- (term-magentabg ((t (:background "magenta"))))
- (term-red ((t (:foreground "red"))))
- (term-red-bold-face ((t (:bold t :background "snow2" :foreground "red"))))
- (term-red-face ((t (:foreground "red"))))
- (term-red-inv-face ((t (:background "red"))))
- (term-red-ul-face ((t (:underline t :background "snow2" :foreground "red"))))
- (term-redbg ((t (:background "red"))))
- (term-underline ((t (:underline t))))
- (term-white ((t (:foreground "white"))))
- (term-white-bold-face ((t (:bold t :background "snow2" :foreground "white"))))
- (term-white-face ((t (:foreground "white"))))
- (term-white-inv-face ((t (:background "snow2"))))
- (term-white-ul-face ((t (:underline t :background "snow2" :foreground "white"))))
- (term-whitebg ((t (:background "white"))))
- (term-yellow ((t (:foreground "yellow"))))
- (term-yellow-bold-face ((t (:bold t :background "snow2" :foreground "yellow"))))
- (term-yellow-face ((t (:foreground "yellow"))))
- (term-yellow-inv-face ((t (:background "yellow"))))
- (term-yellow-ul-face ((t (:underline t :background "snow2" :foreground "yellow"))))
- (term-yellowbg ((t (:background "yellow"))))
- (text-cursor ((t (:bold t :background "Red3" :foreground "gray80"))))
- (toolbar ((t (:bold t :background "Gray80"))))
- (underline ((t (:underline t :bold t))))
- (vc-annotate-face-0046FF ((t (nil))))
- (vcursor ((t (:underline t :background "cyan" :foreground "blue"))))
- (vertical-divider ((t (:bold t :background "Gray80"))))
- (vhdl-font-lock-attribute-face ((t (:foreground "Orchid"))))
- (vhdl-font-lock-directive-face ((t (:foreground "CadetBlue"))))
- (vhdl-font-lock-enumvalue-face ((t (:foreground "Gold4"))))
- (vhdl-font-lock-function-face ((t (:foreground "Orchid4"))))
- (vhdl-font-lock-generic-/constant-face ((t (nil))))
- (vhdl-font-lock-prompt-face ((t (:bold t :foreground "Red"))))
- (vhdl-font-lock-reserved-words-face ((t (:bold t :foreground "Orange"))))
- (vhdl-font-lock-translate-off-face ((t (:background "LightGray"))))
- (vhdl-font-lock-type-face ((t (nil))))
- (vhdl-font-lock-variable-face ((t (nil))))
- (vhdl-speedbar-architecture-face ((t (:foreground "Blue"))))
- (vhdl-speedbar-architecture-selected-face ((t (:underline t :foreground "Blue"))))
- (vhdl-speedbar-configuration-face ((t (:foreground "DarkGoldenrod"))))
- (vhdl-speedbar-configuration-selected-face ((t (:underline t :foreground "DarkGoldenrod"))))
- (vhdl-speedbar-entity-face ((t (:foreground "ForestGreen"))))
- (vhdl-speedbar-entity-selected-face ((t (:underline t :foreground "ForestGreen"))))
- (vhdl-speedbar-instantiation-face ((t (:foreground "Brown"))))
- (vhdl-speedbar-instantiation-selected-face ((t (:underline t :foreground "Brown"))))
- (vhdl-speedbar-package-face ((t (:foreground "Grey50"))))
- (vhdl-speedbar-package-selected-face ((t (:underline t :foreground "Grey50"))))
- (vhdl-speedbar-subprogram-face ((t (nil))))
- (viper-minibuffer-emacs-face ((t (:background "darkseagreen2" :foreground "Black"))))
- (viper-minibuffer-insert-face ((t (:background "pink" :foreground "Black"))))
- (viper-minibuffer-vi-face ((t (:background "grey" :foreground "DarkGreen"))))
- (viper-replace-overlay-face ((t (:background "darkseagreen2" :foreground "Black"))))
- (viper-search-face ((t (:background "khaki" :foreground "Black"))))
- (vm-xface ((t (:background "white" :foreground "black"))))
- (vmpc-pre-sig-face ((t (:foreground "forestgreen"))))
- (vmpc-sig-face ((t (:foreground "steelblue"))))
- (vvb-face ((t (nil))))
- (w3m-anchor-face ((t (:bold t :foreground "DodgerBlue1"))))
- (w3m-arrived-anchor-face ((t (:bold t :foreground "DodgerBlue3"))))
- (w3m-header-line-location-content-face ((t (:background "dark olive green" :foreground "wheat"))))
- (w3m-header-line-location-title-face ((t (:background "dark olive green" :foreground "beige"))))
- (white ((t (:foreground "white"))))
- (widget ((t (nil))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:bold t :foreground "red"))))
- (widget-documentation-face ((t (:bold t :foreground "dark green"))))
- (widget-field-face ((t (:bold t :background "gray85"))))
- (widget-inactive-face ((t (:bold t :foreground "dim gray"))))
- (widget-single-line-field-face ((t (:background "gray85"))))
- (woman-bold-face ((t (:bold t))))
- (woman-italic-face ((t (:foreground "beige"))))
- (woman-unknown-face ((t (:foreground "LightSalmon"))))
- (x-face ((t (:bold t :background "white" :foreground "black"))))
- (x-symbol-adobe-fontspecific-face ((t (nil))))
- (x-symbol-face ((t (nil))))
- (x-symbol-heading-face ((t (:bold t))))
- (x-symbol-info-face ((t (nil))))
- (x-symbol-invisible-face ((t (nil))))
- (x-symbol-revealed-face ((t (nil))))
- (xrdb-option-name-face ((t (:foreground "red"))))
- (xref-keyword-face ((t (:foreground "blue"))))
- (xref-list-default-face ((t (nil))))
- (xref-list-pilot-face ((t (:foreground "navy"))))
- (xref-list-symbol-face ((t (:foreground "navy"))))
- (yellow ((t (:bold t :foreground "yellow"))))
- (zmacs-region ((t (:bold t :background "gray65")))))))
-
-(defun color-theme-mistyday ()
- "Color theme by K.C. Hari Kumar, created 2001-06-13.
-Black on mistyrose. Includes CUA, calendar, diary, font-latex and
-font-lock. Uses backgrounds on some font-lock faces."
- (interactive)
- (color-theme-install
- '(color-theme-mistyday
- ((background-color . "mistyrose")
- (background-mode . light)
- (border-color . "black")
- (cursor-color . "deep pink")
- (foreground-color . "Black")
- (mouse-color . "black"))
- ((goto-address-mail-face . italic)
- (goto-address-mail-mouse-face . secondary-selection)
- (goto-address-url-face . bold)
- (goto-address-url-mouse-face . highlight)
- (list-matching-lines-face . bold)
- (paren-match-face . paren-face-match)
- (paren-mismatch-face . paren-face-mismatch)
- (paren-no-match-face . paren-face-no-match))
- (default ((t (nil))))
- (CUA-global-mark-face ((t (:background "cyan" :foreground "black"))))
- (CUA-rectangle-face ((t (:background "maroon" :foreground "white"))))
- (CUA-rectangle-noselect-face ((t (:background "dimgray" :foreground "white"))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:italic t :bold t))))
- (calendar-today-face ((t (:underline t :background "Spring Green" :foreground "Brown"))))
- (custom-button-face ((t (:background "dark slate grey" :foreground "azure"))))
- (custom-documentation-face ((t (:background "white" :foreground "blue"))))
- (diary-face ((t (:background "navy" :foreground "yellow"))))
- (font-latex-bold-face ((t (:bold t :foreground "DarkOliveGreen"))))
- (font-latex-italic-face ((t (:italic t :foreground "DarkOliveGreen"))))
- (font-latex-math-face ((t (:foreground "navy"))))
- (font-latex-sedate-face ((t (:foreground "DimGray"))))
- (font-latex-string-face ((t (nil))))
- (font-latex-warning-face ((t (nil))))
- (font-lock-builtin-face ((t (:background "DarkTurquoise" :foreground "Navy"))))
- (font-lock-comment-face ((t (:italic t :foreground "royal blue"))))
- (font-lock-constant-face ((t (:background "pale green" :foreground "dark slate blue"))))
- (font-lock-doc-string-face ((t (:background "medium aquamarine" :foreground "deep pink"))))
- (font-lock-function-name-face ((t (:background "SpringGreen" :foreground "MidnightBlue"))))
- (font-lock-keyword-face ((t (:foreground "dark magenta"))))
- (font-lock-preprocessor-face ((t (:background "pale green" :foreground "dark slate blue"))))
- (font-lock-reference-face ((t (:background "DarkTurquoise" :foreground "Navy"))))
- (font-lock-string-face ((t (:background "medium aquamarine" :foreground "deep pink"))))
- (font-lock-type-face ((t (:background "steel blue" :foreground "khaki"))))
- (font-lock-variable-name-face ((t (:background "thistle" :foreground "orange red"))))
- (font-lock-warning-face ((t (:background "LemonChiffon" :foreground "Red"))))
- (highlight ((t (:background "dark slate grey" :foreground "light cyan"))))
- (holiday-face ((t (:background "orangered" :foreground "lightyellow"))))
- (ido-first-match-face ((t (:bold t))))
- (ido-only-match-face ((t (:foreground "ForestGreen"))))
- (ido-subdir-face ((t (:foreground "red"))))
- (italic ((t (:italic t))))
- (isearch ((t (:background "sienna" :foreground "light cyan"))))
- (modeline ((t (:background "Royalblue4" :foreground "lawn green"))))
- (modeline-buffer-id ((t (:background "Royalblue4" :foreground "lawn green"))))
- (modeline-mousable ((t (:background "Royalblue4" :foreground "lawn green"))))
- (modeline-mousable-minor-mode ((t (:background "Royalblue4" :foreground "lawn green"))))
- (paren-face-match ((t (:background "turquoise"))))
- (paren-face-mismatch ((t (:background "purple" :foreground "white"))))
- (paren-face-no-match ((t (:background "yellow" :foreground "black"))))
- (primary-selection ((t (:background "sienna" :foreground "light cyan"))))
- (region ((t (:background "sienna" :foreground "light cyan"))))
- (secondary-selection ((t (:background "forest green" :foreground "white smoke"))))
- (underline ((t (:underline t))))
- (zmacs-region ((t (:background "sienna" :foreground "light cyan")))))))
-
-(defun color-theme-marine ()
- "Color theme by Girish Bharadwaj, created 2001-06-22.
-Matches the MS Windows Marine color theme.
-Includes custom, font-lock, paren, widget."
- (interactive)
- (color-theme-install
- '(color-theme-marine
- ((background-color . "#9dcec9")
- (background-mode . light)
- (border-color . "black")
- (cursor-color . "yellow")
- (foreground-color . "darkslategray")
- (mouse-color . "sienna1"))
- ((buffers-tab-face . buffers-tab)
- (gnus-mouse-face . highlight)
- (smiley-mouse-face . highlight))
- (default ((t (nil))))
- (blue ((t (:foreground "blue"))))
- (bold ((t (:bold t))))
- (bold-italic ((t (nil))))
- (border-glyph ((t (nil))))
- (buffers-tab ((t (:background "#9dcec9" :foreground "darkslategray"))))
- (custom-button-face ((t (nil))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-comment-face ((t (:background "gray85"))))
- (custom-comment-tag-face ((t (:foreground "blue4"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:underline t))))
- (custom-group-tag-face ((t (:underline t :foreground "blue"))))
- (custom-group-tag-face-1 ((t (:underline t :foreground "deeppink"))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "darkgreen"))))
- (custom-variable-button-face ((t (:underline t :bold t))))
- (custom-variable-tag-face ((t (:underline t :foreground "blue"))))
- (display-time-mail-balloon-enhance-face ((t (:background "orange"))))
- (display-time-mail-balloon-gnus-group-face ((t (:foreground "blue"))))
- (display-time-time-balloon-face ((t (:foreground "red"))))
- (font-lock-builtin-face ((t (:foreground "SteelBlue"))))
- (font-lock-comment-face ((t (:foreground "cadetblue"))))
- (font-lock-constant-face ((t (:foreground "OrangeRed"))))
- (font-lock-doc-string-face ((t (:foreground "Salmon"))))
- (font-lock-function-name-face ((t (:bold t :foreground "NavyBlue"))))
- (font-lock-keyword-face ((t (:bold t :foreground "purple"))))
- (font-lock-preprocessor-face ((t (:foreground "SteelBlue"))))
- (font-lock-reference-face ((t (:foreground "SteelBlue"))))
- (font-lock-string-face ((t (:foreground "royalblue"))))
- (font-lock-type-face ((t (:foreground "darkmagenta"))))
- (font-lock-variable-name-face ((t (:foreground "violetred"))))
- (font-lock-warning-face ((t (:bold t :foreground "red"))))
- (green ((t (:foreground "green"))))
- (gui-button-face ((t (:background "grey75" :foreground "black"))))
- (gui-element ((t (:background "#489088" :foreground "black"))))
- (highlight ((t (:background "darkolivegreen" :foreground "white"))))
- (isearch ((t (:background "blue"))))
- (isearch-secondary ((t (:foreground "red3"))))
- (italic ((t (nil))))
- (left-margin ((t (nil))))
- (list-mode-item-selected ((t (:background "gray68" :foreground "darkslategray"))))
- (modeline ((t (:background "black" :foreground "white"))))
- (modeline-buffer-id ((t (:background "black" :foreground "white"))))
- (modeline-mousable ((t (:background "black" :foreground "white"))))
- (modeline-mousable-minor-mode ((t (:background "black" :foreground "white"))))
- (paren-blink-off ((t (:foreground "black"))))
- (paren-match ((t (:background "darkolivegreen" :foreground "white"))))
- (paren-mismatch ((t (:background "#9dcec9" :foreground "darkslategray"))))
- (pointer ((t (nil))))
- (primary-selection ((t (:background "blue"))))
- (red ((t (:foreground "red"))))
- (region ((t (:background "blue"))))
- (right-margin ((t (nil))))
- (secondary-selection ((t (:background "darkslateblue" :foreground "white"))))
- (template-message-face ((t (:bold t))))
- (text-cursor ((t (:background "yellow" :foreground "#9dcec9"))))
- (toolbar ((t (nil))))
- (underline ((t (:underline t))))
- (vertical-divider ((t (nil))))
- (widget ((t (nil))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "forestgreen"))))
- (widget-field-face ((t (:background "gray"))))
- (widget-inactive-face ((t (:foreground "dimgray"))))
- (widget-single-line-field-face ((t (:background "dim gray" :foreground "white"))))
- (yellow ((t (:foreground "yellow"))))
- (zmacs-region ((t (:background "blue")))))))
-
-(defun color-theme-blue-erc ()
- "Color theme for erc faces only.
-This is intended for other color themes to use (eg. `color-theme-gnome2')."
- (color-theme-install
- '(color-theme-blue-erc
- nil
- (erc-action-face ((t (nil))))
- (erc-bold-face ((t (:bold t))))
- (erc-current-nick-face ((t (:bold t :foreground "yellow"))))
- (erc-default-face ((t (nil))))
- (erc-direct-msg-face ((t (:foreground "pale green"))))
- (erc-error-face ((t (:bold t :foreground "IndianRed"))))
- (erc-highlight-face ((t (:bold t :foreground "pale green"))))
- (erc-input-face ((t (:foreground "light blue"))))
- (erc-inverse-face ((t (:background "steel blue"))))
- (erc-keyword-face ((t (:foreground "orange" :bold t))))
- (erc-notice-face ((t (:foreground "light salmon"))))
- (erc-notice-face ((t (:foreground "MediumAquamarine"))))
- (erc-pal-face ((t (:foreground "pale green"))))
- (erc-prompt-face ((t (:foreground "light blue" :bold t))))
- (fg:erc-color-face0 ((t (:foreground "white"))))
- (fg:erc-color-face1 ((t (:foreground "beige"))))
- (fg:erc-color-face2 ((t (:foreground "lemon chiffon"))))
- (fg:erc-color-face3 ((t (:foreground "light cyan"))))
- (fg:erc-color-face4 ((t (:foreground "powder blue"))))
- (fg:erc-color-face5 ((t (:foreground "sky blue"))))
- (fg:erc-color-face6 ((t (:foreground "dark sea green"))))
- (fg:erc-color-face7 ((t (:foreground "pale green"))))
- (fg:erc-color-face8 ((t (:foreground "medium spring green"))))
- (fg:erc-color-face9 ((t (:foreground "khaki"))))
- (fg:erc-color-face10 ((t (:foreground "pale goldenrod"))))
- (fg:erc-color-face11 ((t (:foreground "light goldenrod yellow"))))
- (fg:erc-color-face12 ((t (:foreground "light yellow"))))
- (fg:erc-color-face13 ((t (:foreground "yellow"))))
- (fg:erc-color-face14 ((t (:foreground "light goldenrod"))))
- (fg:erc-color-face15 ((t (:foreground "lime green"))))
- (bg:erc-color-face0 ((t (nil))))
- (bg:erc-color-face1 ((t (nil))))
- (bg:erc-color-face2 ((t (nil))))
- (bg:erc-color-face3 ((t (nil))))
- (bg:erc-color-face4 ((t (nil))))
- (bg:erc-color-face5 ((t (nil))))
- (bg:erc-color-face6 ((t (nil))))
- (bg:erc-color-face7 ((t (nil))))
- (bg:erc-color-face8 ((t (nil))))
- (bg:erc-color-face9 ((t (nil))))
- (bg:erc-color-face10 ((t (nil))))
- (bg:erc-color-face11 ((t (nil))))
- (bg:erc-color-face12 ((t (nil))))
- (bg:erc-color-face13 ((t (nil))))
- (bg:erc-color-face14 ((t (nil))))
- (bg:erc-color-face15 ((t (nil)))))))
-
-(defun color-theme-dark-erc ()
- "Color theme for erc faces only.
-This is intended for other color themes to use (eg. `color-theme-late-night')."
- (interactive)
- (color-theme-install
- '(color-theme-dark-erc
- nil
- (erc-action-face ((t (nil))))
- (erc-bold-face ((t (:bold t))))
- (erc-current-nick-face ((t (:bold t))))
- (erc-default-face ((t (nil))))
- (erc-direct-msg-face ((t (nil))))
- (erc-error-face ((t (:bold t :foreground "IndianRed"))))
- (erc-highlight-face ((t (:bold t :foreground "pale green"))))
- (erc-input-face ((t (:foreground "#555"))))
- (erc-inverse-face ((t (:background "steel blue"))))
- (erc-keyword-face ((t (:foreground "#999" :bold t))))
- (erc-nick-msg-face ((t (:foreground "#888"))))
- (erc-notice-face ((t (:foreground "#444"))))
- (erc-pal-face ((t (:foreground "#888"))))
- (erc-prompt-face ((t (:foreground "#777" :bold t))))
- (erc-timestamp-face ((t (:foreground "#777" :bold t))))
- (fg:erc-color-face0 ((t (:foreground "white"))))
- (fg:erc-color-face1 ((t (:foreground "beige"))))
- (fg:erc-color-face2 ((t (:foreground "lemon chiffon"))))
- (fg:erc-color-face3 ((t (:foreground "light cyan"))))
- (fg:erc-color-face4 ((t (:foreground "powder blue"))))
- (fg:erc-color-face5 ((t (:foreground "sky blue"))))
- (fg:erc-color-face6 ((t (:foreground "dark sea green"))))
- (fg:erc-color-face7 ((t (:foreground "pale green"))))
- (fg:erc-color-face8 ((t (:foreground "medium spring green"))))
- (fg:erc-color-face9 ((t (:foreground "khaki"))))
- (fg:erc-color-face10 ((t (:foreground "pale goldenrod"))))
- (fg:erc-color-face11 ((t (:foreground "light goldenrod yellow"))))
- (fg:erc-color-face12 ((t (:foreground "light yellow"))))
- (fg:erc-color-face13 ((t (:foreground "yellow"))))
- (fg:erc-color-face14 ((t (:foreground "light goldenrod"))))
- (fg:erc-color-face15 ((t (:foreground "lime green"))))
- (bg:erc-color-face0 ((t (nil))))
- (bg:erc-color-face1 ((t (nil))))
- (bg:erc-color-face2 ((t (nil))))
- (bg:erc-color-face3 ((t (nil))))
- (bg:erc-color-face4 ((t (nil))))
- (bg:erc-color-face5 ((t (nil))))
- (bg:erc-color-face6 ((t (nil))))
- (bg:erc-color-face7 ((t (nil))))
- (bg:erc-color-face8 ((t (nil))))
- (bg:erc-color-face9 ((t (nil))))
- (bg:erc-color-face10 ((t (nil))))
- (bg:erc-color-face11 ((t (nil))))
- (bg:erc-color-face12 ((t (nil))))
- (bg:erc-color-face13 ((t (nil))))
- (bg:erc-color-face14 ((t (nil))))
- (bg:erc-color-face15 ((t (nil)))))))
-
-(defun color-theme-subtle-blue ()
- "Color theme by Chris McMahan, created 2001-09-06.
-Light blue background. Includes bbdb, comint, cperl, custom, cvs,
-diary, dired, display-time, ecb, ediff, erc, eshell, font-lock,
-gnus, html-helper, info, isearch, jde, message, paren, semantic,
-sgml, speedbar, term, vhdl, viper, vm, widget, woman, xref, xxml."
- (interactive)
- (color-theme-install
- '(color-theme-subtle-blue
- ((background-color . "#65889C")
- (background-mode . dark)
- (background-toolbar-color . "#cf3ccf3ccf3c")
- (border-color . "black")
- (bottom-toolbar-shadow-color . "#79e77df779e7")
- (cursor-color . "white")
- (foreground-color . "#eedfcc")
- (mouse-color . "Grey")
- (top-toolbar-shadow-color . "#fffffbeeffff")
- (viper-saved-cursor-color-in-replace-mode . "Red3"))
- ((blank-space-face . blank-space-face)
- (blank-tab-face . blank-tab-face)
- (ecb-source-in-directories-buffer-face . ecb-sources-face)
- (gnus-mouse-face . highlight)
- (list-matching-lines-face . bold)
- (view-highlight-face . highlight)
- (vm-highlight-url-face . my-url-face)
- (vm-highlighted-header-face . my-url-face)
- (vm-mime-button-face . gui-button-face)
- (vm-summary-highlight-face . my-summary-highlight-face))
- (default ((t (nil))))
- (bbdb-company ((t (:italic t))))
- (bbdb-field-name ((t (:bold t :foreground "MediumAquamarine"))))
- (bbdb-field-value ((t (nil))))
- (bbdb-name ((t (:underline t))))
- (blank-space-face ((t (:background "gray80"))))
- (blank-tab-face ((t (:background "LightBlue" :foreground "DarkSlateGray"))))
- (blue ((t (:foreground "blue"))))
- (bold ((t (:bold t :foreground "MediumAquamarine"))))
- (bold-italic ((t (:italic t :bold t :foreground "SkyBlue"))))
- (border ((t (:background "black"))))
- (border-glyph ((t (nil))))
- (calendar-today-face ((t (:underline t))))
- (comint-highlight-input ((t (:bold t))))
- (comint-highlight-prompt ((t (:foreground "cyan"))))
- (comint-input-face ((t (:foreground "deepskyblue"))))
- (cperl-array-face ((t (:bold t :foreground "Yellow"))))
- (cperl-hash-face ((t (:italic t :bold t :foreground "White"))))
- (cperl-nonoverridable-face ((t (:foreground "SkyBlue"))))
- (cursor ((t (:background "white"))))
- (custom-button-face ((t (:underline t :bold t :foreground "MediumAquaMarine"))))
- (custom-button-pressed-face ((t (:background "lightgrey" :foreground "black"))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-comment-face ((t (:background "dim gray"))))
- (custom-comment-tag-face ((t (:foreground "gray80"))))
- (custom-documentation-face ((t (:foreground "Grey"))))
- (custom-face-tag-face ((t (:underline t))))
- (custom-group-tag-face ((t (:bold t :foreground "MediumAquamarine"))))
- (custom-group-tag-face-1 ((t (:foreground "MediumAquaMarine"))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "yellow"))))
- (custom-variable-button-face ((t (:underline t :bold t))))
- (custom-variable-tag-face ((t (:bold t :foreground "Aquamarine"))))
- (cvs-filename-face ((t (:foreground "blue4"))))
- (cvs-handled-face ((t (:foreground "pink"))))
- (cvs-header-face ((t (:bold t :foreground "blue4"))))
- (cvs-marked-face ((t (:bold t :foreground "green3"))))
- (cvs-msg-face ((t (:italic t))))
- (cvs-need-action-face ((t (:foreground "orange"))))
- (cvs-unknown-face ((t (:foreground "red"))))
- (diary-face ((t (:bold t :foreground "cyan"))))
- (dired-face-boring ((t (:foreground "Gray65"))))
- (dired-face-directory ((t (:bold t :foreground "sky blue"))))
- (dired-face-executable ((t (:foreground "MediumAquaMarine"))))
- (dired-face-flagged ((t (:foreground "Cyan"))))
- (dired-face-marked ((t (:foreground "cyan"))))
- (dired-face-permissions ((t (:foreground "aquamarine"))))
- (dired-face-setuid ((t (:foreground "LightSalmon"))))
- (dired-face-socket ((t (:foreground "LightBlue"))))
- (dired-face-symlink ((t (:foreground "gray95"))))
- (display-time-mail-balloon-enhance-face ((t (:background "orange"))))
- (display-time-mail-balloon-gnus-group-face ((t (:foreground "blue"))))
- (display-time-time-balloon-face ((t (:foreground "red"))))
- (ecb-sources-face ((t (:foreground "LightBlue1"))))
- (ediff-current-diff-face-A ((t (:background "pale green" :foreground "firebrick"))))
- (ediff-current-diff-face-Ancestor ((t (:background "VioletRed" :foreground "Black"))))
- (ediff-current-diff-face-B ((t (:background "Yellow" :foreground "DarkOrchid"))))
- (ediff-current-diff-face-C ((t (:background "indianred" :foreground "white"))))
- (ediff-even-diff-face-A ((t (:background "light gray" :foreground "Black"))))
- (ediff-even-diff-face-Ancestor ((t (:background "Gray" :foreground "White"))))
- (ediff-even-diff-face-B ((t (:background "Gray" :foreground "White"))))
- (ediff-even-diff-face-C ((t (:background "light gray" :foreground "Black"))))
- (ediff-fine-diff-face-A ((t (:background "sky blue" :foreground "Navy"))))
- (ediff-fine-diff-face-Ancestor ((t (:background "Green" :foreground "Black"))))
- (ediff-fine-diff-face-B ((t (:background "cyan" :foreground "Black"))))
- (ediff-fine-diff-face-C ((t (:background "Turquoise" :foreground "Black"))))
- (ediff-odd-diff-face-A ((t (:background "Gray" :foreground "White"))))
- (ediff-odd-diff-face-Ancestor ((t (:background "light gray" :foreground "Black"))))
- (ediff-odd-diff-face-B ((t (:background "light gray" :foreground "Black"))))
- (ediff-odd-diff-face-C ((t (:background "Gray" :foreground "White"))))
- (erc-action-face ((t (:bold t))))
- (erc-bold-face ((t (:bold t))))
- (erc-default-face ((t (nil))))
- (erc-direct-msg-face ((t (:foreground "LightSalmon"))))
- (erc-error-face ((t (:bold t :foreground "yellow"))))
- (erc-input-face ((t (:foreground "Beige"))))
- (erc-inverse-face ((t (:background "wheat" :foreground "darkslategrey"))))
- (erc-notice-face ((t (:foreground "MediumAquamarine"))))
- (erc-pal-face ((t (:foreground "PaleGreen"))))
- (erc-prompt-face ((t (:foreground "MediumAquamarine"))))
- (erc-underline-face ((t (:underline t))))
- (eshell-ls-archive-face ((t (:bold t :foreground "wheat"))))
- (eshell-ls-backup-face ((t (:foreground "Grey"))))
- (eshell-ls-clutter-face ((t (:bold t :foreground "wheat"))))
- (eshell-ls-directory-face ((t (:bold t :foreground "Yellow"))))
- (eshell-ls-executable-face ((t (:bold t :foreground "wheat"))))
- (eshell-ls-missing-face ((t (:bold t :foreground "wheat"))))
- (eshell-ls-picture-face ((t (:foreground "wheat"))))
- (eshell-ls-product-face ((t (:foreground "wheat"))))
- (eshell-ls-readonly-face ((t (:foreground "wheat"))))
- (eshell-ls-special-face ((t (:bold t :foreground "wheat"))))
- (eshell-ls-symlink-face ((t (:bold t :foreground "White"))))
- (eshell-ls-text-face ((t (:foreground "wheat"))))
- (eshell-ls-todo-face ((t (:foreground "wheat"))))
- (eshell-ls-unreadable-face ((t (:foreground "wheat3"))))
- (eshell-prompt-face ((t (:bold t :foreground "PaleGreen"))))
- (eshell-test-failed-face ((t (:bold t :foreground "OrangeRed"))))
- (eshell-test-ok-face ((t (:bold t :foreground "Green"))))
- (excerpt ((t (:italic t))))
- (ff-paths-non-existant-file-face ((t (:bold t :foreground "NavyBlue"))))
- (flyspell-duplicate-face ((t (:underline t :bold t :foreground "Gold3"))))
- (flyspell-incorrect-face ((t (:underline t :bold t :foreground "OrangeRed"))))
- (font-latex-italic-face ((t (nil))))
- (font-latex-math-face ((t (nil))))
- (font-latex-sedate-face ((t (:foreground "Gray85"))))
- (font-latex-string-face ((t (:foreground "orange"))))
- (font-latex-warning-face ((t (:foreground "gold"))))
- (font-lock-builtin-face ((t (:foreground "PaleGreen"))))
- (font-lock-comment-face ((t (:italic t :foreground "Wheat3"))))
- (font-lock-constant-face ((t (:foreground "LightBlue"))))
- (font-lock-doc-face ((t (:bold t :foreground "DarkSeaGreen"))))
- (font-lock-doc-string-face ((t (:bold t :foreground "DarkSeaGreen"))))
- (font-lock-exit-face ((t (:foreground "green"))))
- (font-lock-function-name-face ((t (:italic t :bold t :foreground "cyan"))))
- (font-lock-keyword-face ((t (:bold t :foreground "LightBlue"))))
- (font-lock-preprocessor-face ((t (:foreground "blue3"))))
- (font-lock-reference-face ((t (:foreground "PaleGreen"))))
- (font-lock-string-face ((t (:italic t :foreground "MediumAquamarine"))))
- (font-lock-type-face ((t (:bold t :foreground "LightBlue"))))
- (font-lock-variable-name-face ((t (:italic t :bold t :foreground "LightBlue"))))
- (font-lock-warning-face ((t (:bold t :foreground "LightSalmon"))))
- (fringe ((t (:background "darkslategrey"))))
- (gnus-cite-attribution-face ((t (:italic t :bold t))))
- (gnus-cite-face-1 ((t (:foreground "LightBlue"))))
- (gnus-cite-face-10 ((t (:foreground "LightBlue"))))
- (gnus-cite-face-11 ((t (:foreground "LightBlue"))))
- (gnus-cite-face-2 ((t (:foreground "LightBlue"))))
- (gnus-cite-face-3 ((t (:foreground "LightBlue"))))
- (gnus-cite-face-4 ((t (:foreground "LightBlue"))))
- (gnus-cite-face-5 ((t (:foreground "LightBlue"))))
- (gnus-cite-face-6 ((t (:foreground "LightBlue"))))
- (gnus-cite-face-7 ((t (:foreground "LightBlue"))))
- (gnus-cite-face-8 ((t (:foreground "LightBlue"))))
- (gnus-cite-face-9 ((t (:foreground "LightBlue"))))
- (gnus-emphasis-bold ((t (:bold t))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t))))
- (gnus-emphasis-highlight-words ((t (:background "black" :foreground "yellow"))))
- (gnus-emphasis-italic ((t (:italic t))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:underline t :bold t))))
- (gnus-emphasis-underline-bold-italic ((t (:underline t :italic t :bold t))))
- (gnus-emphasis-underline-italic ((t (:underline t :italic t))))
- (gnus-filterhist-face-1 ((t (nil))))
- (gnus-group-mail-1-empty-face ((t (:foreground "gray80"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "light cyan"))))
- (gnus-group-mail-2-empty-face ((t (:foreground "gray80"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "turquoise"))))
- (gnus-group-mail-3-empty-face ((t (:foreground "gray80"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "LightBlue"))))
- (gnus-group-mail-low-empty-face ((t (:foreground "gray80"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "LightBlue"))))
- (gnus-group-news-1-empty-face ((t (:foreground "gray80"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "green yellow"))))
- (gnus-group-news-2-empty-face ((t (:foreground "gray80"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "Aquamarine"))))
- (gnus-group-news-3-empty-face ((t (:foreground "gray80"))))
- (gnus-group-news-3-face ((t (:bold t :foreground "LightBlue"))))
- (gnus-group-news-4-empty-face ((t (:foreground "gray80"))))
- (gnus-group-news-4-face ((t (:bold t :foreground "Wheat"))))
- (gnus-group-news-5-empty-face ((t (:foreground "gray80"))))
- (gnus-group-news-5-face ((t (:bold t :foreground "MediumAquamarine"))))
- (gnus-group-news-6-empty-face ((t (:foreground "gray80"))))
- (gnus-group-news-6-face ((t (:bold t :foreground "MediumAquamarine"))))
- (gnus-group-news-low-empty-face ((t (:foreground "gray80"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "yellow green"))))
- (gnus-header-content-face ((t (:italic t :foreground "LightSkyBlue3"))))
- (gnus-header-from-face ((t (:bold t :foreground "light cyan"))))
- (gnus-header-name-face ((t (:bold t :foreground "LightBlue"))))
- (gnus-header-newsgroups-face ((t (:italic t :bold t :foreground "LightSkyBlue3"))))
- (gnus-header-subject-face ((t (:bold t :foreground "light cyan"))))
- (gnus-picons-face ((t (:background "white" :foreground "black"))))
- (gnus-picons-xbm-face ((t (:background "white" :foreground "black"))))
- (gnus-signature-face ((t (:italic t :foreground "LightBlue"))))
- (gnus-splash ((t (:foreground "Brown"))))
- (gnus-splash-face ((t (:foreground "LightBlue"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "gray80"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "LightBlue"))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "gray80"))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "burlywood"))))
- (gnus-summary-high-unread-face ((t (:italic t :bold t :foreground "wheat"))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "LightBlue"))))
- (gnus-summary-low-read-face ((t (:italic t :foreground "light sea green"))))
- (gnus-summary-low-ticked-face ((t (:italic t :bold t :foreground "LightBlue"))))
- (gnus-summary-low-unread-face ((t (:italic t :foreground "light sea green"))))
- (gnus-summary-normal-ancient-face ((t (:foreground "gray80"))))
- (gnus-summary-normal-read-face ((t (:foreground "gray80"))))
- (gnus-summary-normal-ticked-face ((t (:bold t :foreground "sandy brown"))))
- (gnus-summary-normal-unread-face ((t (:bold t :foreground "wheat"))))
- (gnus-summary-selected-face ((t (:underline t))))
- (gnus-x-face ((t (:background "white" :foreground "black"))))
- (green ((t (:foreground "green"))))
- (gui-button-face ((t (:background "cyan" :foreground "#65889C"))))
- (gui-element ((t (:background "Gray"))))
- (header-line ((t (:background "grey20" :foreground "grey90"))))
- (highlight ((t (:background "PaleGreen" :foreground "DarkGreen"))))
- (highlight-changes-delete-face ((t (:underline t :foreground "red"))))
- (highlight-changes-face ((t (:foreground "red"))))
- (highline-face ((t (:background "SeaGreen"))))
- (holiday-face ((t (:background "DimGray"))))
- (html-helper-bold-face ((t (:foreground "DarkRed"))))
- (html-helper-italic-face ((t (:foreground "DarkBlue"))))
- (html-helper-underline-face ((t (:underline t :foreground "Black"))))
- (html-tag-face ((t (:foreground "Blue"))))
- (info-menu-5 ((t (:underline t))))
- (info-node ((t (:underline t :italic t :bold t :foreground "light blue"))))
- (info-xref ((t (:bold t :foreground "light blue"))))
- (isearch ((t (:background "Aquamarine" :foreground "SteelBlue"))))
- (isearch-lazy-highlight-face ((t (:background "paleturquoise4"))))
- (isearch-secondary ((t (:foreground "red3"))))
- (italic ((t (:italic t))))
- (jde-bug-breakpoint-cursor ((t (:background "brown" :foreground "cyan"))))
- (jde-bug-breakpoint-marker ((t (:background "yellow" :foreground "red"))))
- (jde-java-font-lock-api-face ((t (:foreground "LightBlue"))))
- (jde-java-font-lock-bold-face ((t (:bold t))))
- (jde-java-font-lock-code-face ((t (nil))))
- (jde-java-font-lock-constant-face ((t (:foreground "LightBlue"))))
- (jde-java-font-lock-doc-tag-face ((t (:foreground "LightBlue"))))
- (jde-java-font-lock-italic-face ((t (:italic t))))
- (jde-java-font-lock-link-face ((t (:underline t :foreground "LightBlue"))))
- (jde-java-font-lock-modifier-face ((t (:foreground "LightBlue"))))
- (jde-java-font-lock-number-face ((t (:foreground "LightBlue"))))
- (jde-java-font-lock-package-face ((t (:foreground "LightBlue"))))
- (jde-java-font-lock-pre-face ((t (nil))))
- (jde-java-font-lock-underline-face ((t (:underline t))))
- (lazy-highlight-face ((t (:bold t :foreground "dark magenta"))))
- (left-margin ((t (nil))))
- (linemenu-face ((t (:background "gray30"))))
- (list-mode-item-selected ((t (nil))))
- (makefile-space-face ((t (:background "hotpink"))))
- (menu ((t (:background "wheat" :foreground "gray30"))))
- (message-cited-text-face ((t (:foreground "White"))))
- (message-header-cc-face ((t (:bold t :foreground "light cyan"))))
- (message-header-name-face ((t (:foreground "LightBlue"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "LightSkyBlue3"))))
- (message-header-other-face ((t (:foreground "LightSkyBlue3"))))
- (message-header-subject-face ((t (:bold t :foreground "light cyan"))))
- (message-header-to-face ((t (:bold t :foreground "light cyan"))))
- (message-header-xheader-face ((t (:foreground "LightBlue"))))
- (message-mml-face ((t (:bold t :foreground "LightBlue"))))
- (message-separator-face ((t (:foreground "LightBlue"))))
- (mmm-default-submode-face ((t (:background "#c0c0c5"))))
- (modeline ((t (:background "#4f657d" :foreground "gray80"))))
- (modeline-buffer-id ((t (:background "#4f657d" :foreground "gray80"))))
- (modeline-mousable ((t (:background "#4f657d" :foreground "gray80"))))
- (modeline-mousable-minor-mode ((t (:background "#4f657d" :foreground "gray80"))))
- (mouse ((t (:background "Grey"))))
- (my-summary-highlight-face ((t (:foreground "White"))))
- (my-url-face ((t (:foreground "PaleTurquoise"))))
- (nil ((t (nil))))
- (paren-blink-off ((t (:foreground "gray"))))
- (paren-face-match ((t (:background "turquoise"))))
- (paren-face-mismatch ((t (:background "purple" :foreground "white"))))
- (paren-face-no-match ((t (:background "yellow" :foreground "black"))))
- (paren-match ((t (:background "darkseagreen2"))))
- (paren-mismatch ((t (:background "DeepPink" :foreground "black"))))
- (paren-mismatch-face ((t (:bold t))))
- (paren-no-match-face ((t (:bold t))))
- (pointer ((t (nil))))
- (primary-selection ((t (:background "gray65"))))
- (red ((t (:foreground "red"))))
- (region ((t (:background "CadetBlue" :foreground "gray80"))))
- (right-margin ((t (nil))))
- (scroll-bar ((t (nil))))
- (secondary-selection ((t (:background "LightBlue" :foreground "#4f657d"))))
- (semantic-dirty-token-face ((t (:background "gray10"))))
- (semantic-intangible-face ((t (:foreground "gray25"))))
- (semantic-read-only-face ((t (:background "gray25"))))
- (senator-intangible-face ((t (:foreground "gray75"))))
- (senator-momentary-highlight-face ((t (:background "gray80"))))
- (senator-read-only-face ((t (:background "#664444"))))
- (sgml-comment-face ((t (:foreground "dark turquoise"))))
- (sgml-doctype-face ((t (:foreground "red"))))
- (sgml-end-tag-face ((t (:foreground "blue"))))
- (sgml-entity-face ((t (:foreground "magenta"))))
- (sgml-ignored-face ((t (:background "gray60" :foreground "gray40"))))
- (sgml-ms-end-face ((t (:foreground "green"))))
- (sgml-ms-start-face ((t (:foreground "yellow"))))
- (sgml-pi-face ((t (:foreground "lime green"))))
- (sgml-sgml-face ((t (:foreground "brown"))))
- (sgml-short-ref-face ((t (:foreground "deep sky blue"))))
- (sgml-start-tag-face ((t (:foreground "dark green"))))
- (shell-option-face ((t (:foreground "blue"))))
- (shell-output-2-face ((t (:foreground "darkseagreen"))))
- (shell-output-3-face ((t (:foreground "slategray"))))
- (shell-output-face ((t (:foreground "palegreen"))))
- (shell-prompt-face ((t (:foreground "red"))))
- (show-paren-match-face ((t (:background "Aquamarine" :foreground "steel blue"))))
- (show-paren-mismatch-face ((t (:bold t :background "IndianRed" :foreground "White"))))
- (speedbar-button-face ((t (:bold t :foreground "LightBlue"))))
- (speedbar-directory-face ((t (:bold t :foreground "yellow"))))
- (speedbar-file-face ((t (:bold t :foreground "wheat"))))
- (speedbar-highlight-face ((t (:background "sea green"))))
- (speedbar-selected-face ((t (:underline t))))
- (speedbar-tag-face ((t (:foreground "LightBlue"))))
- (swbuff-current-buffer-face ((t (:bold t :foreground "red"))))
- (template-message-face ((t (:bold t))))
- (term-black ((t (:foreground "black"))))
- (term-blackbg ((t (:background "black"))))
- (term-blue ((t (:foreground "blue"))))
- (term-bluebg ((t (:background "blue"))))
- (term-bold ((t (:bold t))))
- (term-cyan ((t (:foreground "cyan"))))
- (term-cyanbg ((t (:background "cyan"))))
- (term-default-bg ((t (nil))))
- (term-default-bg-inv ((t (nil))))
- (term-default-fg ((t (nil))))
- (term-default-fg-inv ((t (nil))))
- (term-green ((t (:foreground "green"))))
- (term-greenbg ((t (:background "green"))))
- (term-invisible ((t (nil))))
- (term-invisible-inv ((t (nil))))
- (term-magenta ((t (:foreground "magenta"))))
- (term-magentabg ((t (:background "magenta"))))
- (term-red ((t (:foreground "red"))))
- (term-redbg ((t (:background "red"))))
- (term-underline ((t (:underline t))))
- (term-white ((t (:foreground "white"))))
- (term-whitebg ((t (:background "white"))))
- (term-yellow ((t (:foreground "yellow"))))
- (term-yellowbg ((t (:background "yellow"))))
- (text-cursor ((t (:background "Red3" :foreground "white"))))
- (tool-bar ((t (:background "grey75" :foreground "black"))))
- (toolbar ((t (:background "Gray"))))
- (trailing-whitespace ((t (:background "red"))))
- (underline ((t (:underline t))))
- (variable-pitch ((t (nil))))
- (vc-annotate-face-0046FF ((t (:background "black" :foreground "wheat"))))
- (vcursor ((t (:underline t :background "cyan" :foreground "blue"))))
- (vertical-divider ((t (:background "Gray"))))
- (vhdl-font-lock-attribute-face ((t (:foreground "Orchid"))))
- (vhdl-font-lock-directive-face ((t (:foreground "CadetBlue"))))
- (vhdl-font-lock-enumvalue-face ((t (:foreground "Gold4"))))
- (vhdl-font-lock-function-face ((t (:foreground "Orchid4"))))
- (vhdl-font-lock-prompt-face ((t (:bold t :foreground "Red"))))
- (vhdl-font-lock-reserved-words-face ((t (:bold t :foreground "Orange"))))
- (vhdl-font-lock-translate-off-face ((t (:background "LightGray"))))
- (vhdl-speedbar-architecture-face ((t (:foreground "Blue"))))
- (vhdl-speedbar-architecture-selected-face ((t (:underline t :foreground "Blue"))))
- (vhdl-speedbar-configuration-face ((t (:foreground "DarkGoldenrod"))))
- (vhdl-speedbar-configuration-selected-face ((t (:underline t :foreground "DarkGoldenrod"))))
- (vhdl-speedbar-entity-face ((t (:foreground "ForestGreen"))))
- (vhdl-speedbar-entity-selected-face ((t (:underline t :foreground "ForestGreen"))))
- (vhdl-speedbar-instantiation-face ((t (:foreground "Brown"))))
- (vhdl-speedbar-instantiation-selected-face ((t (:underline t :foreground "Brown"))))
- (vhdl-speedbar-package-face ((t (:foreground "Gray50"))))
- (vhdl-speedbar-package-selected-face ((t (:underline t :foreground "Gray50"))))
- (viper-minibuffer-emacs-face ((t (:background "darkseagreen2" :foreground "Black"))))
- (viper-minibuffer-insert-face ((t (:background "pink" :foreground "Black"))))
- (viper-minibuffer-vi-face ((t (:background "gray" :foreground "DarkGreen"))))
- (viper-replace-overlay-face ((t (:background "darkseagreen2" :foreground "Black"))))
- (viper-search-face ((t (:background "khaki" :foreground "Black"))))
- (vm-header-content-face ((t (:italic t :foreground "gray80"))))
- (vm-header-from-face ((t (:italic t :background "#65889C" :foreground "cyan"))))
- (vm-header-name-face ((t (:foreground "cyan"))))
- (vm-header-subject-face ((t (:foreground "cyan"))))
- (vm-header-to-face ((t (:italic t :foreground "cyan"))))
- (vm-message-cited-face ((t (:foreground "Gray80"))))
- (vm-summary-face-1 ((t (:foreground "MediumAquamarine"))))
- (vm-summary-face-2 ((t (:foreground "MediumAquamarine"))))
- (vm-summary-face-3 ((t (:foreground "MediumAquamarine"))))
- (vm-summary-face-4 ((t (:foreground "MediumAquamarine"))))
- (vm-summary-highlight-face ((t (:foreground "White"))))
- (vmpc-pre-sig-face ((t (:foreground "Aquamarine"))))
- (vmpc-sig-face ((t (:foreground "LightBlue"))))
- (vvb-face ((t (:background "pink" :foreground "black"))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "cyan"))))
- (widget-documentation-face ((t (:foreground "LightBlue"))))
- (widget-field-face ((t (:foreground "LightBlue"))))
- (widget-inactive-face ((t (:foreground "Wheat3"))))
- (widget-single-line-field-face ((t (:foreground "LightBlue"))))
- (woman-bold-face ((t (:bold t))))
- (woman-italic-face ((t (:foreground "beige"))))
- (woman-unknown-face ((t (:foreground "LightSalmon"))))
- (xref-keyword-face ((t (:foreground "Cyan"))))
- (xref-list-pilot-face ((t (:foreground "navy"))))
- (xref-list-symbol-face ((t (:foreground "navy"))))
- (xxml-emph-1-face ((t (:background "lightyellow"))))
- (xxml-emph-2-face ((t (:background "lightyellow"))))
- (xxml-header-1-face ((t (:background "seashell1" :foreground "MediumAquamarine"))))
- (xxml-header-2-face ((t (:background "seashell1" :foreground "SkyBlue"))))
- (xxml-header-3-face ((t (:background "seashell1"))))
- (xxml-header-4-face ((t (:background "seashell1"))))
- (xxml-interaction-face ((t (:background "lightcyan"))))
- (xxml-rug-face ((t (:background "cyan"))))
- (xxml-sparkle-face ((t (:background "yellow"))))
- (xxml-unbreakable-space-face ((t (:underline t :foreground "grey"))))
- (yellow ((t (:foreground "yellow"))))
- (zmacs-region ((t (:background "#4f657d")))))))
-
-(defun color-theme-dark-blue ()
- "Color theme by Chris McMahan, created 2001-09-09.
-Based on `color-theme-subtle-blue' with a slightly darker background."
- (interactive)
- (color-theme-subtle-blue)
- (let ((color-theme-is-cumulative t))
- (color-theme-install
- '(color-theme-dark-blue
- ((background-color . "#537182")
- (foreground-color . "AntiqueWhite2"))
- nil
- (default ((t (nil))))
- (blank-space-face ((t (:background "LightGray"))))
- (blank-tab-face ((t (:background "Wheat" :foreground "DarkSlateGray"))))
- (cursor ((t (:background "LightGray"))))
- (dired-face-executable ((t (:foreground "green yellow"))))
- (dired-face-flagged ((t (:foreground "tomato"))))
- (dired-face-marked ((t (:foreground "light salmon"))))
- (dired-face-setuid ((t (:foreground "Red"))))
- (dired-face-socket ((t (:foreground "magenta"))))
- (fixed ((t (:bold t))))
- (font-lock-comment-face ((t (:italic t :foreground "Gray80"))))
- (font-lock-doc-face ((t (:bold t))))
- (font-lock-function-name-face ((t (:italic t :bold t :foreground "Yellow"))))
- (font-lock-string-face ((t (:italic t :foreground "DarkSeaGreen"))))
- (font-lock-type-face ((t (:bold t :foreground "YellowGreen"))))
- (gui-button-face ((t (:background "DarkSalmon" :foreground "white"))))
- (modeline ((t (:background "#c1ccd9" :foreground "#4f657d"))))
- (modeline-buffer-id ((t (:background "#c1ccd9" :foreground "#4f657d"))))
- (modeline-mousable ((t (:background "#c1ccd9" :foreground "#4f657d"))))
- (modeline-mousable-minor-mode ((t (:background "#c1ccd9" :foreground "#4f657d"))))
- (my-url-face ((t (:foreground "LightBlue"))))
- (region ((t (:background "PaleTurquoise4" :foreground "gray80"))))
- (secondary-selection ((t (:background "sea green" :foreground "yellow"))))
- (vm-header-content-face ((t (:italic t :foreground "wheat"))))
- (vm-header-from-face ((t (:italic t :foreground "wheat"))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (xref-keyword-face ((t (:foreground "blue"))))
- (zmacs-region ((t (:background "SlateGray"))))))))
-
-(defun color-theme-jonadabian-slate ()
- "Another slate-and-wheat color theme by Jonadab the Unsightly One.
-Updated 2001-10-12."
- (interactive)
- (color-theme-install
- '(color-theme-jonadabian-slate
- ((background-color . "#305050")
- (background-mode . dark)
- (border-color . "black")
- (cursor-color . "medium turquoise")
- (foreground-color . "#CCBB77")
- (mouse-color . "black"))
- ((list-matching-lines-face . bold)
- (ued-mode-keyname-face . modeline)
- (view-highlight-face . highlight))
- (default ((t (nil))))
- (fringe ((t (:background "#007080"))))
- (bold ((t (:bold t :foreground "#EEDDAA"))))
- (gnus-emphasis-bold ((t (:bold t :foreground "#EEDDAA"))))
- (gnus-emphasis-underline-bold ((t (:underline t :bold t :foreground "#EEDDAA"))))
- (bold-italic ((t (:italic t :bold t :foreground "#AA0000"))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t :foreground "#AA0000"))))
- (gnus-emphasis-underline-bold-italic ((t (:underline t :italic t :bold t :foreground "#AA0000"))))
- (gnus-emphasis-underline-italic ((t (:underline t :italic t :bold t :foreground "#AA0000"))))
- (calendar-today-face ((t (:underline t :background "darkslategrey"))))
- (cperl-array-face ((t (:background "#004060"))))
- (cperl-hash-face ((t (:background "#004400"))))
- (custom-button-face ((t (:background "dark blue" :foreground "rgbi:1.00/1.00/0.00"))))
- (custom-documentation-face ((t (:foreground "#10D010"))))
- (custom-face-tag-face ((t (:underline t :foreground "goldenrod"))))
- (custom-group-tag-face ((t (:underline t :foreground "light blue"))))
- (custom-group-tag-face-1 ((t (:underline t :foreground "pink"))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:foreground "#6666dd"))))
- (custom-state-face ((t (:foreground "mediumaquamarine"))))
- (custom-variable-button-face ((t (:underline t :bold t))))
- (custom-variable-tag-face ((t (:underline t :foreground "light blue"))))
- (diary-face ((t (:foreground "red"))))
- (eshell-ls-archive-face ((t (:foreground "green"))))
- (eshell-ls-backup-face ((t (:foreground "grey60"))))
- (eshell-ls-clutter-face ((t (:bold t :foreground "OrangeRed"))))
- (eshell-ls-directory-face ((t (:bold t :foreground "SkyBlue"))))
- (eshell-ls-executable-face ((t (:foreground "white"))))
- (eshell-ls-missing-face ((t (:foreground "red"))))
- (eshell-ls-product-face ((t (:foreground "LightSalmon"))))
- (eshell-ls-readonly-face ((t (:foreground "indian red"))))
- (eshell-ls-special-face ((t (:foreground "yellow"))))
- (eshell-ls-symlink-face ((t (:foreground "#6666dd"))))
- (eshell-ls-unreadable-face ((t (:foreground "red"))))
- (eshell-prompt-face ((t (:bold t :background "#305050" :foreground "#EEDD99"))))
- (font-lock-builtin-face ((t (:foreground "LightSteelBlue"))))
- (font-lock-comment-face ((t (:italic t :bold t :foreground "grey66"))))
- (font-lock-constant-face ((t (:foreground "indian red"))))
- (font-lock-function-name-face ((t (:foreground "#D0D000"))))
- (font-lock-keyword-face ((t (:foreground "#00BBBB"))))
- (font-lock-string-face ((t (:foreground "#10D010"))))
- (font-lock-type-face ((t (:bold t :foreground "#ff7788"))))
- (font-lock-variable-name-face ((t (:foreground "#eeddaa"))))
- (font-lock-warning-face ((t (:bold t :foreground "Pink"))))
- (header-line ((t (:box (:line-width 1 :style released-button)))))
- (highlight ((t (:background "#226644"))))
- (highlight-changes-delete-face ((t (:background "navy" :foreground "red"))))
- (highlight-changes-face ((t (:background "navy"))))
- (holiday-face ((t (:foreground "#ff7744"))))
- (italic ((t (:italic t :foreground "#AA0000"))))
- (gnus-emphasis-italic ((t (:italic t :foreground "#AA0000"))))
- (modeline ((t (:background "#007080" :foreground "cyan"))))
- (modeline-buffer-id ((t (:background "#007080" :foreground "cyan"))))
- (modeline-mousable ((t (:background "#007080" :foreground "cyan"))))
- (modeline-mousable-minor-mode ((t (:background "#007080" :foreground "cyan"))))
- (region ((t (:background "#226644"))))
- (secondary-selection ((t (:background "darkslategrey"))))
- (sgml-comment-face ((t (:foreground "grey60"))))
- (sgml-doctype-face ((t (:foreground "red"))))
- (sgml-end-tag-face ((t (:foreground "#00D0D0"))))
- (sgml-entity-face ((t (:foreground "indian red"))))
- (sgml-ignored-face ((t (:background "gray60" :foreground "gray40"))))
- (sgml-ms-end-face ((t (:foreground "green"))))
- (sgml-ms-start-face ((t (:foreground "green"))))
- (sgml-pi-face ((t (:foreground "lime green"))))
- (sgml-sgml-face ((t (:foreground "brown"))))
- (sgml-short-ref-face ((t (:foreground "deep sky blue"))))
- (sgml-start-tag-face ((t (:foreground "#D0D000"))))
- (show-paren-match-face ((t (:background "#400055" :foreground "cyan"))))
- (show-paren-mismatch-face ((t (:background "red"))))
- (special-string-face ((t (:foreground "light green"))))
- (term-black ((t (:background "#000055" :foreground "black"))))
- (term-blackbg ((t (:background "black" :foreground "#CCBB77"))))
- (term-blue ((t (:background "#000055" :foreground "blue"))))
- (term-bluebg ((t (:background "blue" :foreground "#CCBB77"))))
- (term-bold ((t (:bold t :background "#000055" :foreground "#CCBB77"))))
- (term-cyan ((t (:background "#000055" :foreground "cyan"))))
- (term-cyanbg ((t (:background "darkcyan"))))
- (term-default-bg ((t (:foreground "#CCBB77"))))
- (term-default-bg-inv ((t (:foreground "#CCBB77"))))
- (term-default-fg ((t (:background "#000055"))))
- (term-default-fg-inv ((t (:background "#000055"))))
- (term-green ((t (:background "#000055" :foreground "green"))))
- (term-greenbg ((t (:background "darkgreen"))))
- (term-invisible ((t (:foreground "#CCBB77"))))
- (term-invisible-inv ((t (:foreground "#CCBB77"))))
- (term-magenta ((t (:background "#000055" :foreground "magenta"))))
- (term-magentabg ((t (:background "darkmagenta"))))
- (term-red ((t (:background "#000055" :foreground "red"))))
- (term-redbg ((t (:background "darkred"))))
- (term-underline ((t (:underline t :background "#000055" :foreground "#CCBB77"))))
- (term-white ((t (:background "#000055" :foreground "white"))))
- (term-whitebg ((t (:background "grey50"))))
- (term-yellow ((t (:background "#000055" :foreground "yellow"))))
- (term-yellowbg ((t (:background "#997700"))))
- (trailing-whitespace ((t (:background "#23415A"))))
- (underline ((t (:underline t))))
- (gnus-emphasis-underline ((t (:underline t))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "green"))))
- (widget-field-face ((t (:background "grey35" :foreground "black"))))
- (widget-inactive-face ((t (:foreground "gray"))))
- (widget-single-line-field-face ((t (:background "dim gray")))))))
-
-(defun color-theme-gray1 ()
- "Color theme by Paul Pulli, created 2001-10-19."
- (interactive)
- (color-theme-install
- '(color-theme-gray1
- ((background-color . "darkgray")
- (background-mode . light)
- (background-toolbar-color . "#949494949494")
- (border-color . "#000000000000")
- (bottom-toolbar-shadow-color . "#595959595959")
- (cursor-color . "Yellow")
- (foreground-color . "black")
- (top-toolbar-shadow-color . "#b2b2b2b2b2b2"))
- nil
- (default ((t (nil))))
- (blue ((t (:foreground "blue"))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:italic t :bold t))))
- (border-glyph ((t (nil))))
- (cperl-here-face ((t (:background "gray68" :foreground "DeepPink"))))
- (font-lock-builtin-face ((t (:bold t :foreground "red3"))))
- (font-lock-comment-face ((t (:foreground "gray50"))))
- (font-lock-constant-face ((t (:bold t :foreground "blue3"))))
- (font-lock-doc-string-face ((t (:foreground "black"))))
- (font-lock-function-name-face ((t (:bold t :foreground "DeepPink3"))))
- (font-lock-keyword-face ((t (:bold t :foreground "red"))))
- (font-lock-other-type-face ((t (:bold t :foreground "green4"))))
- (font-lock-preprocessor-face ((t (:bold t :foreground "blue3"))))
- (font-lock-reference-face ((t (:bold t :foreground "red3"))))
- (font-lock-string-face ((t (:foreground "red"))))
- (font-lock-type-face ((t (:bold t :foreground "white"))))
- (font-lock-variable-name-face ((t (:bold t :foreground "blue3"))))
- (font-lock-warning-face ((t (:bold t :foreground "Red"))))
- (green ((t (:foreground "green4"))))
- (gui-button-face ((t (:background "black" :foreground "red"))))
- (gui-element ((t (:background "gray58"))))
- (highlight ((t (:background "magenta" :foreground "yellow"))))
- (isearch ((t (:background "red" :foreground "yellow"))))
- (italic ((t (:italic t))))
- (left-margin ((t (nil))))
- (list-mode-item-selected ((t (:background "gray90" :foreground "purple"))))
- (m4-face ((t (:background "gray90" :foreground "orange3"))))
- (message-cited-text ((t (nil))))
- (message-header-contents ((t (nil))))
- (message-headers ((t (nil))))
- (message-highlighted-header-contents ((t (nil))))
- (modeline ((t (:background "#aa80aa" :foreground "White"))))
- (modeline-buffer-id ((t (:background "#aa80aa" :foreground "linen"))))
- (modeline-mousable ((t (:background "#aa80aa" :foreground "cyan"))))
- (modeline-mousable-minor-mode ((t (:background "#aa80aa" :foreground "yellow"))))
- (paren-blink-off ((t (:foreground "gray58"))))
- (paren-blink-on ((t (:foreground "purple"))))
- (paren-match ((t (:background "gray68" :foreground "white"))))
- (paren-mismatch ((t (:background "DeepPink" :foreground "black"))))
- (pointer ((t (nil))))
- (primary-selection ((t (:background "gray"))))
- (red ((t (:foreground "red"))))
- (right-margin ((t (nil))))
- (secondary-selection ((t (:background "paleturquoise"))))
- (text-cursor ((t (:background "Yellow" :foreground "darkgray"))))
- (toolbar ((t (:background "#aa80aa" :foreground "linen"))))
- (underline ((t (:underline t))))
- (vertical-divider ((t (nil))))
- (x-face ((t (:background "black" :foreground "lavenderblush"))))
- (yellow ((t (:foreground "yellow3"))))
- (zmacs-region ((t (:background "paleturquoise" :foreground "black")))))))
-
-(defun color-theme-word-perfect ()
- "White on blue background, based on WordPerfect 5.1.
-Color theme by Thomas Gehrlein, created 2001-10-21."
- (interactive)
- (color-theme-install
- '(color-theme-word-perfect
- ((background-color . "blue4")
- (background-mode . dark)
- (border-color . "black")
- (cursor-color . "gold")
- (foreground-color . "white")
- (mouse-color . "black"))
- ((ecb-source-in-directories-buffer-face . ecb-sources-face)
- (gnus-mouse-face . highlight)
- (goto-address-mail-face . italic)
- (goto-address-mail-mouse-face . secondary-selection)
- (goto-address-url-face . bold)
- (goto-address-url-mouse-face . highlight)
- (list-matching-lines-face . bold)
- (view-highlight-face . highlight))
- (default ((t (nil))))
- (bbdb-field-name ((t (:foreground "lime green"))))
- (bbdb-field-value ((t (:foreground "white"))))
- (bbdb-name ((t (:underline t :foreground "lime green"))))
- (bold ((t (:bold t :foreground "white"))))
- (bold-italic ((t (:italic t :bold t :foreground "yellow"))))
- (calendar-today-face ((t (:underline t :foreground "deep sky blue"))))
- (diary-face ((t (:foreground "gold"))))
- (ecb-sources-face ((t (:foreground "LightBlue1"))))
- (edb-inter-field-face ((t (:foreground "deep sky blue"))))
- (edb-normal-summary-face ((t (:foreground "gold"))))
- (emacs-wiki-bad-link-face ((t (:underline "coral" :bold t :foreground "coral"))))
- (emacs-wiki-link-face ((t (:underline "cyan" :bold t :foreground "cyan"))))
- (font-lock-builtin-face ((t (:foreground "LightSteelBlue"))))
- (font-lock-comment-face ((t (:foreground "deep sky blue"))))
- (font-lock-constant-face ((t (:foreground "lime green"))))
- (font-lock-doc-face ((t (:foreground "gold"))))
- (font-lock-doc-string-face ((t (:foreground "gold"))))
- (font-lock-function-name-face ((t (:background "blue4" :foreground "IndianRed"))))
- (font-lock-keyword-face ((t (:foreground "lime green"))))
- (font-lock-preprocessor-face ((t (:foreground "lime green"))))
- (font-lock-reference-face ((t (:foreground "LightSteelBlue"))))
- (font-lock-string-face ((t (:foreground "gold"))))
- (font-lock-type-face ((t (:foreground "lime green"))))
- (font-lock-variable-name-face ((t (:foreground "LightGoldenrod"))))
- (font-lock-warning-face ((t (:bold t :foreground "firebrick"))))
- (gnus-emphasis-bold ((t (:foreground "yellow2"))))
- (gnus-emphasis-bold-italic ((t (:foreground "yellow2"))))
- (gnus-emphasis-italic ((t (:foreground "yellow2"))))
- (gnus-emphasis-underline ((t (:foreground "yellow2"))))
- (gnus-emphasis-underline-bold ((t (:foreground "yellow2"))))
- (gnus-emphasis-underline-bold-italic ((t (:foreground "yellow2"))))
- (gnus-emphasis-underline-italic ((t (:foreground "yellow2"))))
- (gnus-group-mail-1-empty-face ((t (:foreground "aquamarine1"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "aquamarine1"))))
- (gnus-group-mail-2-empty-face ((t (:foreground "aquamarine2"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "aquamarine2"))))
- (gnus-group-mail-3-empty-face ((t (:foreground "aquamarine3"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "aquamarine3"))))
- (gnus-group-mail-low-empty-face ((t (:foreground "aquamarine4"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "aquamarine4"))))
- (gnus-group-news-1-empty-face ((t (:foreground "PaleTurquoise"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "PaleTurquoise"))))
- (gnus-group-news-2-empty-face ((t (:foreground "turquoise"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "turquoise"))))
- (gnus-group-news-3-empty-face ((t (:foreground "deep sky blue"))))
- (gnus-group-news-3-face ((t (:bold t :foreground "deep sky blue"))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkTurquoise"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "DarkTurquoise"))))
- (gnus-header-content-face ((t (:foreground "gold"))))
- (gnus-header-from-face ((t (:foreground "gold"))))
- (gnus-header-name-face ((t (:foreground "deep sky blue"))))
- (gnus-header-newsgroups-face ((t (:foreground "gold"))))
- (gnus-header-subject-face ((t (:foreground "gold"))))
- (gnus-signature-face ((t (:foreground "gold"))))
- (gnus-splash-face ((t (:foreground "firebrick"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "deep sky blue"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "deep sky blue"))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "deep sky blue"))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "deep sky blue"))))
- (gnus-summary-high-unread-face ((t (:bold t :foreground "lime green"))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "deep sky blue"))))
- (gnus-summary-low-read-face ((t (:italic t :foreground "deep sky blue"))))
- (gnus-summary-low-ticked-face ((t (:italic t :foreground "deep sky blue"))))
- (gnus-summary-low-unread-face ((t (:italic t :foreground "lime green"))))
- (gnus-summary-normal-ancient-face ((t (:foreground "deep sky blue"))))
- (gnus-summary-normal-read-face ((t (:foreground "deep sky blue"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "deep sky blue"))))
- (gnus-summary-normal-unread-face ((t (:foreground "lime green"))))
- (gnus-summary-selected-face ((t (:underline t :foreground "gold"))))
- (highlight ((t (:background "steel blue" :foreground "black"))))
- (holiday-face ((t (:background "blue4" :foreground "IndianRed1"))))
- (info-menu-5 ((t (:underline t :foreground "gold"))))
- (info-node ((t (:italic t :bold t :foreground "gold"))))
- (info-xref ((t (:bold t :foreground "gold"))))
- (isearch ((t (:background "firebrick" :foreground "white"))))
- (italic ((t (:italic t :foreground "yellow2"))))
- (message-cited-text-face ((t (:foreground "gold"))))
- (message-header-cc-face ((t (:bold t :foreground "green4"))))
- (message-header-name-face ((t (:foreground "deep sky blue"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "gold"))))
- (message-header-other-face ((t (:foreground "gold"))))
- (message-header-subject-face ((t (:foreground "gold"))))
- (message-header-to-face ((t (:bold t :foreground "gold"))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-separator-face ((t (:foreground "lime green"))))
- (modeline ((t (:foreground "white" :background "black"))))
- (modeline-buffer-id ((t (:foreground "white" :background "black"))))
- (modeline-mousable ((t (:foreground "white" :background "black"))))
- (modeline-mousable-minor-mode ((t (:foreground "white" :background "black"))))
- (overlay-empty-face ((t (nil))))
- (primary-selection ((t (:background "firebrick" :foreground "white"))))
- (region ((t (:background "firebrick" :foreground "white"))))
- (secondary-selection ((t (:background "yellow2" :foreground "black"))))
- (semantic-dirty-token-face ((t (:background "gray10"))))
- (show-paren-match-face ((t (:background "deep sky blue" :foreground "black"))))
- (show-paren-mismatch-face ((t (:background "firebrick" :foreground "white"))))
- (underline ((t (:underline t :background "blue4" :foreground "white")))))))
-
-;; In order to produce this, follow these steps:
-;;
-;; 0. Make sure .Xresources and .Xdefaults don't have any Emacs related
-;; entries.
-;;
-;; 1. cd into the Emacs lisp directory and run the following command:
-;; ( for d in `find -type d`; \
-;; do grep --files-with-matches 'defface[ ]' $d/*.el; \
-;; done ) | sort | uniq
-;; Put the result in a lisp block, using load-library calls.
-;;
-;; Repeat this for any directories on your load path which you want to
-;; include in the standard. This might include W3, eshell, etc.
-;;
-;; Add some of the libraries that don't use defface:
-;;
-;; 2. Start emacs using the --no-init-file and --no-site-file command line
-;; arguments. Evaluate the lisp block you prepared.
-;; 3. Load color-theme and run color-theme-print. Save the output and use it
-;; to define color-theme-standard.
-;;
-;; (progn
-;; (load-library "add-log")
-;; (load-library "calendar")
-;; (load-library "comint")
-;; (load-library "cus-edit")
-;; (load-library "cus-face")
-;; (load-library "custom")
-;; (load-library "diff-mode")
-;; (load-library "ediff-init")
-;; (load-library "re-builder")
-;; (load-library "viper-init")
-;; (load-library "enriched")
-;; (load-library "em-ls")
-;; (load-library "em-prompt")
-;; (load-library "esh-test")
-;; (load-library "faces")
-;; (load-library "font-lock")
-;; (load-library "generic-x")
-;; (load-library "gnus-art")
-;; (load-library "gnus-cite")
-;; (load-library "gnus")
-;; (load-library "message")
-;; (load-library "hilit-chg")
-;; (load-library "hi-lock")
-;; (load-library "info")
-;; (load-library "isearch")
-;; (load-library "log-view")
-;; (load-library "paren")
-;; (load-library "pcvs-info")
-;; (load-library "antlr-mode")
-;; (load-library "cperl-mode")
-;; (load-library "ebrowse")
-;; (load-library "idlwave")
-;; (load-library "idlw-shell")
-;; (load-library "make-mode")
-;; (load-library "sh-script")
-;; (load-library "vhdl-mode")
-;; (load-library "smerge-mode")
-;; (load-library "speedbar")
-;; (load-library "strokes")
-;; (load-library "artist")
-;; (load-library "flyspell")
-;; (load-library "texinfo")
-;; (load-library "tex-mode")
-;; (load-library "tooltip")
-;; (load-library "vcursor")
-;; (load-library "wid-edit")
-;; (load-library "woman")
-;; (load-library "term")
-;; (load-library "man")
-;; (load-file "/home/alex/elisp/color-theme.el")
-;; (color-theme-print))
-;;
-;; 4. Make the color theme usable on Xemacs (add more faces, resolve
-;; :inherit attributes)
-;;
-(defun color-theme-emacs-21 ()
- "Color theme used by Emacs 21.1.
-Added and adapted for XEmacs by Alex Schroeder. Adaptation mostly
-consisted of resolving :inherit attributes and adding missing faces.
-This theme includes faces from the following Emacs libraries: add-log
-calendar comint cus-edit cus-face custom diff-mode ediff-init re-builder
-viper-init enriched em-ls em-prompt esh-test faces font-lock generic-x
-gnus-art gnus-cite gnus message hilit-chg hi-lock info isearch log-view
-paren pcvs-info antlr-mode cperl-mode ebrowse idlwave idlw-shell
-make-mode sh-script vhdl-mode smerge-mode speedbar strokes artist
-flyspell texinfo tex-mode tooltip vcursor wid-edit woman term man"
- (interactive)
- (color-theme-install
- '(color-theme-emacs-21
- ((background-color . "white")
- (background-mode . light)
- (border-color . "black")
- (cursor-color . "black")
- (foreground-color . "black")
- (mouse-color . "black"))
- ((Man-overstrike-face . bold)
- (Man-underline-face . underline)
- (cperl-here-face . font-lock-string-face)
- (cperl-invalid-face . underline)
- (cperl-pod-face . font-lock-comment-face)
- (cperl-pod-head-face . font-lock-variable-name-face)
- (gnus-article-button-face . bold)
- (gnus-article-mouse-face . highlight)
- (gnus-cite-attribution-face . gnus-cite-attribution-face)
- (gnus-mouse-face . highlight)
- (gnus-signature-face . gnus-signature-face)
- (gnus-summary-selected-face . gnus-summary-selected-face)
- (help-highlight-face . underline)
- (idlwave-class-arrow-face . bold)
- (idlwave-shell-breakpoint-face . idlwave-shell-bp-face)
- (idlwave-shell-expression-face . secondary-selection)
- (idlwave-shell-stop-line-face . highlight)
- (ispell-highlight-face . highlight)
- (list-matching-lines-face . bold)
- (view-highlight-face . highlight)
- (viper-insert-state-cursor-color . "Green")
- (viper-replace-overlay-cursor-color . "Red")
- (widget-mouse-face . highlight))
- (default ((t (:stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (Info-title-1-face ((t (:bold t :weight bold :family "helv" :height 1.728))))
- (Info-title-2-face ((t (:bold t :family "helv" :weight bold :height 1.44))))
- (Info-title-3-face ((t (:bold t :weight bold :family "helv" :height 1.2))))
- (Info-title-4-face ((t (:bold t :family "helv" :weight bold))))
- (antlr-font-lock-keyword-face ((t (:bold t :foreground "black" :weight bold))))
- (antlr-font-lock-literal-face ((t (:bold t :foreground "brown4" :weight bold))))
- (antlr-font-lock-ruledef-face ((t (:bold t :foreground "blue" :weight bold))))
- (antlr-font-lock-ruleref-face ((t (:foreground "blue4"))))
- (antlr-font-lock-tokendef-face ((t (:bold t :foreground "blue" :weight bold))))
- (antlr-font-lock-tokenref-face ((t (:foreground "orange4"))))
- (bold ((t (:bold t :weight bold))))
- (bold-italic ((t (:italic t :bold t :slant italic :weight bold))))
- (border ((t (:background "black"))))
- (calendar-today-face ((t (:underline t))))
- (change-log-acknowledgement-face ((t (:foreground "Firebrick"))))
- (change-log-conditionals-face ((t (:foreground "DarkGoldenrod"))))
- (change-log-date-face ((t (:foreground "RosyBrown"))))
- (change-log-email-face ((t (:foreground "DarkGoldenrod"))))
- (change-log-file-face ((t (:foreground "Blue"))))
- (change-log-function-face ((t (:foreground "DarkGoldenrod"))))
- (change-log-list-face ((t (:foreground "Purple"))))
- (change-log-name-face ((t (:foreground "CadetBlue"))))
- (comint-highlight-input ((t (:bold t :weight bold))))
- (comint-highlight-prompt ((t (:foreground "dark blue"))))
- (cperl-array-face ((t (:bold t :background "lightyellow2" :foreground "Blue" :weight bold))))
- (cperl-hash-face ((t (:italic t :bold t :background "lightyellow2" :foreground "Red" :slant italic :weight bold))))
- (cperl-nonoverridable-face ((t (:foreground "chartreuse3"))))
- (cursor ((t (:background "black"))))
- (custom-button-face ((t (:background "lightgrey" :foreground "black" :box (:line-width 2 :style released-button)))))
- (custom-button-pressed-face ((t (:background "lightgrey" :foreground "black" :box (:line-width 2 :style pressed-button)))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-comment-face ((t (:background "gray85"))))
- (custom-comment-tag-face ((t (:foreground "blue4"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:bold t :family "helv" :weight bold :height 1.2))))
- (custom-group-tag-face ((t (:bold t :foreground "blue" :weight bold :height 1.2))))
- (custom-group-tag-face-1 ((t (:bold t :family "helv" :foreground "red" :weight bold :height 1.2))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "dark green"))))
- (custom-variable-button-face ((t (:bold t :underline t :weight bold))))
- (custom-variable-tag-face ((t (:bold t :family "helv" :foreground "blue" :weight bold :height 1.2))))
- (cvs-filename-face ((t (:foreground "blue4"))))
- (cvs-handled-face ((t (:foreground "pink"))))
- (cvs-header-face ((t (:bold t :foreground "blue4" :weight bold))))
- (cvs-marked-face ((t (:bold t :foreground "green3" :weight bold))))
- (cvs-msg-face ((t (:italic t :slant italic))))
- (cvs-need-action-face ((t (:foreground "orange"))))
- (cvs-unknown-face ((t (:foreground "red"))))
- (diary-face ((t (:foreground "red"))))
- (diff-added-face ((t (nil))))
- (diff-changed-face ((t (nil))))
- (diff-context-face ((t (:foreground "grey50"))))
- (diff-file-header-face ((t (:bold t :background "grey70" :weight bold))))
- (diff-function-face ((t (:foreground "grey50"))))
- (diff-header-face ((t (:background "grey85"))))
- (diff-hunk-header-face ((t (:background "grey85"))))
- (diff-index-face ((t (:bold t :weight bold :background "grey70"))))
- (diff-nonexistent-face ((t (:bold t :weight bold :background "grey70"))))
- (diff-removed-face ((t (nil))))
- (dired-face-boring ((t (:foreground "RosyBrown"))))
- (dired-face-directory ((t (:foreground "Blue"))))
- (dired-face-executable ((t (nil))))
- (dired-face-flagged ((t (:foreground "Red" :weight bold))))
- (dired-face-marked ((t (:foreground "Red" :weight bold))))
- (dired-face-permissions ((t (nil))))
- (dired-face-setuid ((t (nil))))
- (dired-face-socket ((t (nil))))
- (dired-face-symlink ((t (:foreground "Purple"))))
- (ebrowse-default-face ((t (nil))))
- (ebrowse-file-name-face ((t (:italic t :slant italic))))
- (ebrowse-member-attribute-face ((t (:foreground "red"))))
- (ebrowse-member-class-face ((t (:foreground "purple"))))
- (ebrowse-progress-face ((t (:background "blue"))))
- (ebrowse-root-class-face ((t (:bold t :foreground "blue" :weight bold))))
- (ebrowse-tree-mark-face ((t (:foreground "red"))))
- (ediff-current-diff-face-A ((t (:background "pale green" :foreground "firebrick"))))
- (ediff-current-diff-face-Ancestor ((t (:background "VioletRed" :foreground "Black"))))
- (ediff-current-diff-face-B ((t (:background "Yellow" :foreground "DarkOrchid"))))
- (ediff-current-diff-face-C ((t (:background "Pink" :foreground "Navy"))))
- (ediff-even-diff-face-A ((t (:background "light grey" :foreground "Black"))))
- (ediff-even-diff-face-Ancestor ((t (:background "Grey" :foreground "White"))))
- (ediff-even-diff-face-B ((t (:background "Grey" :foreground "White"))))
- (ediff-even-diff-face-C ((t (:background "light grey" :foreground "Black"))))
- (ediff-fine-diff-face-A ((t (:background "sky blue" :foreground "Navy"))))
- (ediff-fine-diff-face-Ancestor ((t (:background "Green" :foreground "Black"))))
- (ediff-fine-diff-face-B ((t (:background "cyan" :foreground "Black"))))
- (ediff-fine-diff-face-C ((t (:background "Turquoise" :foreground "Black"))))
- (ediff-odd-diff-face-A ((t (:background "Grey" :foreground "White"))))
- (ediff-odd-diff-face-Ancestor ((t (:background "light grey" :foreground "Black"))))
- (ediff-odd-diff-face-B ((t (:background "light grey" :foreground "Black"))))
- (ediff-odd-diff-face-C ((t (:background "Grey" :foreground "White"))))
- (eshell-ls-archive-face ((t (:bold t :foreground "Orchid" :weight bold))))
- (eshell-ls-backup-face ((t (:foreground "OrangeRed"))))
- (eshell-ls-clutter-face ((t (:bold t :foreground "OrangeRed" :weight bold))))
- (eshell-ls-directory-face ((t (:bold t :foreground "Blue" :weight bold))))
- (eshell-ls-executable-face ((t (:bold t :foreground "ForestGreen" :weight bold))))
- (eshell-ls-missing-face ((t (:bold t :foreground "Red" :weight bold))))
- (eshell-ls-product-face ((t (:foreground "OrangeRed"))))
- (eshell-ls-readonly-face ((t (:foreground "Brown"))))
- (eshell-ls-special-face ((t (:bold t :foreground "Magenta" :weight bold))))
- (eshell-ls-symlink-face ((t (:bold t :foreground "Dark Cyan" :weight bold))))
- (eshell-ls-unreadable-face ((t (:foreground "Grey30"))))
- (eshell-prompt-face ((t (:bold t :foreground "Red" :weight bold))))
- (eshell-test-failed-face ((t (:bold t :foreground "OrangeRed" :weight bold))))
- (eshell-test-ok-face ((t (:bold t :foreground "Green" :weight bold))))
- (excerpt ((t (:italic t :slant italic))))
- (fixed ((t (:bold t :weight bold))))
- (fixed-pitch ((t (:family "courier"))))
- (flyspell-duplicate-face ((t (:bold t :foreground "Gold3" :underline t :weight bold))))
- (flyspell-incorrect-face ((t (:bold t :foreground "OrangeRed" :underline t :weight bold))))
- (font-lock-builtin-face ((t (:foreground "Orchid"))))
- (font-lock-comment-face ((t (:foreground "Firebrick"))))
- (font-lock-constant-face ((t (:foreground "CadetBlue"))))
- (font-lock-doc-face ((t (:foreground "RosyBrown"))))
- (font-lock-doc-string-face ((t (:foreground "RosyBrown"))))
- (font-lock-function-name-face ((t (:foreground "Blue"))))
- (font-lock-keyword-face ((t (:foreground "Purple"))))
- (font-lock-preprocessor-face ((t (:foreground "CadetBlue"))))
- (font-lock-reference-face ((t (:foreground "Orchid"))))
- (font-lock-string-face ((t (:foreground "RosyBrown"))))
- (font-lock-type-face ((t (:foreground "ForestGreen"))))
- (font-lock-variable-name-face ((t (:foreground "DarkGoldenrod"))))
- (font-lock-warning-face ((t (:bold t :foreground "Red" :weight bold))))
- (fringe ((t (:background "grey95"))))
- (gnus-cite-attribution-face ((t (:italic t :slant italic))))
- (gnus-cite-face-1 ((t (:foreground "MidnightBlue"))))
- (gnus-cite-face-10 ((t (:foreground "medium purple"))))
- (gnus-cite-face-11 ((t (:foreground "turquoise"))))
- (gnus-cite-face-2 ((t (:foreground "firebrick"))))
- (gnus-cite-face-3 ((t (:foreground "dark green"))))
- (gnus-cite-face-4 ((t (:foreground "OrangeRed"))))
- (gnus-cite-face-5 ((t (:foreground "dark khaki"))))
- (gnus-cite-face-6 ((t (:foreground "dark violet"))))
- (gnus-cite-face-7 ((t (:foreground "SteelBlue4"))))
- (gnus-cite-face-8 ((t (:foreground "magenta"))))
- (gnus-cite-face-9 ((t (:foreground "violet"))))
- (gnus-emphasis-bold ((t (:bold t :weight bold))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t :slant italic :weight bold))))
- (gnus-emphasis-highlight-words ((t (:background "black" :foreground "yellow"))))
- (gnus-emphasis-italic ((t (:italic t :slant italic))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:bold t :underline t :weight bold))))
- (gnus-emphasis-underline-bold-italic ((t (:italic t :bold t :underline t :slant italic :weight bold))))
- (gnus-emphasis-underline-italic ((t (:italic t :underline t :slant italic))))
- (gnus-group-mail-1-empty-face ((t (:foreground "DeepPink3"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "DeepPink3" :weight bold))))
- (gnus-group-mail-2-empty-face ((t (:foreground "HotPink3"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "HotPink3" :weight bold))))
- (gnus-group-mail-3-empty-face ((t (:foreground "magenta4"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "magenta4" :weight bold))))
- (gnus-group-mail-low-empty-face ((t (:foreground "DeepPink4"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "DeepPink4" :weight bold))))
- (gnus-group-news-1-empty-face ((t (:foreground "ForestGreen"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "ForestGreen" :weight bold))))
- (gnus-group-news-2-empty-face ((t (:foreground "CadetBlue4"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "CadetBlue4" :weight bold))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (:bold t :weight bold))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (:bold t :weight bold))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (:bold t :weight bold))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (:bold t :weight bold))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkGreen"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "DarkGreen" :weight bold))))
- (gnus-header-content-face ((t (:italic t :foreground "indianred4" :slant italic))))
- (gnus-header-from-face ((t (:foreground "red3"))))
- (gnus-header-name-face ((t (:foreground "maroon"))))
- (gnus-header-newsgroups-face ((t (:italic t :foreground "MidnightBlue" :slant italic))))
- (gnus-header-subject-face ((t (:foreground "red4"))))
- (gnus-signature-face ((t (:italic t :slant italic))))
- (gnus-splash-face ((t (:foreground "Brown"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "RoyalBlue" :weight bold))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "DarkGreen" :weight bold))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "firebrick" :weight bold))))
- (gnus-summary-high-unread-face ((t (:bold t :weight bold))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "RoyalBlue" :slant italic))))
- (gnus-summary-low-read-face ((t (:italic t :foreground "DarkGreen" :slant italic))))
- (gnus-summary-low-ticked-face ((t (:italic t :foreground "firebrick" :slant italic))))
- (gnus-summary-low-unread-face ((t (:italic t :slant italic))))
- (gnus-summary-normal-ancient-face ((t (:foreground "RoyalBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "DarkGreen"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "firebrick"))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-selected-face ((t (:underline t))))
- (header-line ((t (:box (:line-width -1 :style released-button) :background "grey90" :foreground "grey20" :box nil))))
- (hi-black-b ((t (:bold t :weight bold))))
- (hi-black-hb ((t (:bold t :family "helv" :weight bold :height 1.67))))
- (hi-blue ((t (:background "light blue"))))
- (hi-blue-b ((t (:bold t :foreground "blue" :weight bold))))
- (hi-green ((t (:background "green"))))
- (hi-green-b ((t (:bold t :foreground "green" :weight bold))))
- (hi-pink ((t (:background "pink"))))
- (hi-red-b ((t (:bold t :foreground "red" :weight bold))))
- (hi-yellow ((t (:background "yellow"))))
- (highlight ((t (:background "darkseagreen2"))))
- (highlight-changes-delete-face ((t (:foreground "red" :underline t))))
- (highlight-changes-face ((t (:foreground "red"))))
- (holiday-face ((t (:background "pink"))))
- (idlwave-help-link-face ((t (:foreground "Blue"))))
- (idlwave-shell-bp-face ((t (:background "Pink" :foreground "Black"))))
- (info-header-node ((t (:italic t :bold t :weight bold :slant italic :foreground "brown"))))
- (info-header-xref ((t (:bold t :weight bold :foreground "magenta4"))))
- (info-menu-5 ((t (:foreground "red1"))))
- (info-menu-header ((t (:bold t :family "helv" :weight bold))))
- (info-node ((t (:italic t :bold t :foreground "brown" :slant italic :weight bold))))
- (info-xref ((t (:bold t :foreground "magenta4" :weight bold))))
- (isearch ((t (:background "magenta4" :foreground "lightskyblue1"))))
- (isearch-lazy-highlight-face ((t (:background "paleturquoise"))))
- (italic ((t (:italic t :slant italic))))
- (log-view-file-face ((t (:bold t :background "grey70" :weight bold))))
- (log-view-message-face ((t (:background "grey85"))))
- (makefile-space-face ((t (:background "hotpink"))))
- (menu ((t (nil))))
- (message-cited-text-face ((t (:foreground "red"))))
- (message-header-cc-face ((t (:foreground "MidnightBlue"))))
- (message-header-name-face ((t (:foreground "cornflower blue"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "blue4" :slant italic :weight bold))))
- (message-header-other-face ((t (:foreground "steel blue"))))
- (message-header-subject-face ((t (:bold t :foreground "navy blue" :weight bold))))
- (message-header-to-face ((t (:bold t :foreground "MidnightBlue" :weight bold))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-mml-face ((t (:foreground "ForestGreen"))))
- (message-separator-face ((t (:foreground "brown"))))
- (modeline ((t (:background "grey75" :foreground "black" :box (:line-width -1 :style released-button)))))
- (modeline-buffer-id ((t (:bold t :background "grey75" :foreground "black" :box (:line-width -1 :style released-button)))))
- (modeline-mousable ((t (:background "grey75" :foreground "black" :box (:line-width -1 :style released-button)))))
- (modeline-mousable-minor-mode ((t (:background "grey75" :foreground "black" :box (:line-width -1 :style released-button)))))
- (mouse ((t (:background "black"))))
- (primary-selection ((t (:background "lightgoldenrod2"))))
- (reb-match-0 ((t (:background "lightblue"))))
- (reb-match-1 ((t (:background "aquamarine"))))
- (reb-match-2 ((t (:background "springgreen"))))
- (reb-match-3 ((t (:background "yellow"))))
- (region ((t (:background "lightgoldenrod2"))))
- (scroll-bar ((t (:background "grey75"))))
- (secondary-selection ((t (:background "yellow"))))
- (sh-heredoc-face ((t (:foreground "tan"))))
- (show-paren-match-face ((t (:background "turquoise"))))
- (show-paren-mismatch-face ((t (:background "purple" :foreground "white"))))
- (show-tabs-space-face ((t (:foreground "yellow"))))
- (show-tabs-tab-face ((t (:foreground "red"))))
- (smerge-base-face ((t (:foreground "red"))))
- (smerge-markers-face ((t (:background "grey85"))))
- (smerge-mine-face ((t (:foreground "blue"))))
- (smerge-other-face ((t (:foreground "darkgreen"))))
- (speedbar-button-face ((t (:foreground "green4"))))
- (speedbar-directory-face ((t (:foreground "blue4"))))
- (speedbar-file-face ((t (:foreground "cyan4"))))
- (speedbar-highlight-face ((t (:background "green"))))
- (speedbar-selected-face ((t (:foreground "red" :underline t))))
- (speedbar-tag-face ((t (:foreground "brown"))))
- (strokes-char-face ((t (:background "lightgray"))))
- (term-black ((t (:stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-blackbg ((t (:stipple nil :background "black" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-blue ((t (:stipple nil :background "white" :foreground "blue" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-bluebg ((t (:stipple nil :background "blue" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-bold ((t (:bold t :stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight bold :width normal :family "adobe-courier"))))
- (term-cyan ((t (:stipple nil :background "white" :foreground "cyan" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-cyanbg ((t (:stipple nil :background "cyan" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-default ((t (:stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-default-bg ((t (:stipple nil :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-default-bg-inv ((t (:stipple nil :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-default-fg ((t (:stipple nil :background "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-default-fg-inv ((t (:stipple nil :background "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-green ((t (:stipple nil :background "white" :foreground "green" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-greenbg ((t (:stipple nil :background "green" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-invisible ((t (:stipple nil :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-invisible-inv ((t (:stipple nil :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-magenta ((t (:stipple nil :background "white" :foreground "magenta" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-magentabg ((t (:stipple nil :background "magenta" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-red ((t (:stipple nil :background "white" :foreground "red" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-redbg ((t (:stipple nil :background "red" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-underline ((t (:stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline t :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-white ((t (:stipple nil :background "white" :foreground "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-whitebg ((t (:stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-yellow ((t (:stipple nil :background "white" :foreground "yellow" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-yellowbg ((t (:stipple nil :background "yellow" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (tex-math-face ((t (:foreground "RosyBrown"))))
- (texinfo-heading-face ((t (:foreground "Blue"))))
- (tool-bar ((t (:background "grey75" :foreground "black" :box (:line-width 1 :style released-button)))))
- (tooltip ((t (:background "lightyellow" :foreground "black"))))
- (trailing-whitespace ((t (:background "red"))))
- (underline ((t (:underline t))))
- (variable-pitch ((t (:family "helv"))))
- (vcursor ((t (:background "cyan" :foreground "blue" :underline t))))
- (vhdl-font-lock-attribute-face ((t (:foreground "Orchid"))))
- (vhdl-font-lock-directive-face ((t (:foreground "CadetBlue"))))
- (vhdl-font-lock-enumvalue-face ((t (:foreground "Gold4"))))
- (vhdl-font-lock-function-face ((t (:foreground "Orchid4"))))
- (vhdl-font-lock-prompt-face ((t (:bold t :foreground "Red" :weight bold))))
- (vhdl-font-lock-reserved-words-face ((t (:bold t :foreground "Orange" :weight bold))))
- (vhdl-font-lock-translate-off-face ((t (:background "LightGray"))))
- (vhdl-speedbar-architecture-face ((t (:foreground "Blue"))))
- (vhdl-speedbar-architecture-selected-face ((t (:foreground "Blue" :underline t))))
- (vhdl-speedbar-configuration-face ((t (:foreground "DarkGoldenrod"))))
- (vhdl-speedbar-configuration-selected-face ((t (:foreground "DarkGoldenrod" :underline t))))
- (vhdl-speedbar-entity-face ((t (:foreground "ForestGreen"))))
- (vhdl-speedbar-entity-selected-face ((t (:foreground "ForestGreen" :underline t))))
- (vhdl-speedbar-instantiation-face ((t (:foreground "Brown"))))
- (vhdl-speedbar-instantiation-selected-face ((t (:foreground "Brown" :underline t))))
- (vhdl-speedbar-package-face ((t (:foreground "Grey50"))))
- (vhdl-speedbar-package-selected-face ((t (:foreground "Grey50" :underline t))))
- (viper-minibuffer-emacs-face ((t (:background "darkseagreen2" :foreground "Black"))))
- (viper-minibuffer-insert-face ((t (:background "pink" :foreground "Black"))))
- (viper-minibuffer-vi-face ((t (:background "grey" :foreground "DarkGreen"))))
- (viper-replace-overlay-face ((t (:background "darkseagreen2" :foreground "Black"))))
- (viper-search-face ((t (:background "khaki" :foreground "Black"))))
- (widget-button-face ((t (:bold t :weight bold))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (widget-single-line-field-face ((t (:background "gray85"))))
- (woman-addition-face ((t (:foreground "orange"))))
- (woman-bold-face ((t (:bold t :foreground "blue" :weight bold))))
- (woman-italic-face ((t (:italic t :foreground "red" :underline t :slant italic))))
- (woman-unknown-face ((t (:foreground "brown"))))
- (zmacs-region ((t (:background "lightgoldenrod2")))))))
-
-(defun color-theme-jsc-light2 ()
- "Color theme by John S Cooper, created 2001-10-29.
-This builds on `color-theme-jsc-light'."
- (interactive)
- (color-theme-jsc-light)
- (let ((color-theme-is-cumulative t))
- (color-theme-install
- '(color-theme-jsc-light2
- ((vc-annotate-very-old-color . "#0046FF")
- (senator-eldoc-use-color . t))
- nil
- (bold ((t (:bold t :weight bold))))
- (bold-italic ((t (:italic t :bold t :slant italic :weight bold))))
- (change-log-file-face ((t (:foreground "Blue"))))
- (change-log-name-face ((t (:foreground "Maroon"))))
- (comint-highlight-prompt ((t (:foreground "dark blue"))))
- (custom-button-face ((t (:background "lightgrey" :foreground "black" :box (:line-width 2 :style released-button)))))
- (custom-face-tag-face ((t (:bold t :family "helv" :weight bold :height 1.2))))
- (custom-group-tag-face ((t (:bold t :foreground "blue" :weight bold :height 1.2))))
- (custom-group-tag-face-1 ((t (:bold t :family "helv" :foreground "red" :weight bold :height 1.2))))
- (custom-variable-tag-face ((t (:bold t :family "helv" :foreground "blue" :weight bold :height 1.2))))
- (font-lock-constant-face ((t (:foreground "Maroon"))))
- (font-lock-function-name-face ((t (:foreground "Blue"))))
- (font-lock-type-face ((t (:italic t :foreground "Navy" :slant italic))))
- (fringe ((t (:background "grey88"))))
- (gnus-group-mail-1-empty-face ((t (:foreground "Blue2"))))
- (gnus-group-news-1-empty-face ((t (:foreground "ForestGreen"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "ForestGreen" :weight bold))))
- (gnus-header-content-face ((t (:italic t :foreground "indianred4" :slant italic))))
- (gnus-header-name-face ((t (:bold t :foreground "maroon" :weight bold))))
- (gnus-header-subject-face ((t (:foreground "red4"))))
- (gnus-signature-face ((t (:italic t :slant italic))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "DarkGreen" :weight bold))))
- (gnus-summary-high-unread-face ((t (:bold t :weight bold))))
- (gnus-summary-normal-read-face ((t (:foreground "DarkGreen"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "Navy"))))
- (gnus-summary-normal-unread-face ((t (:bold t :foreground "DarkGreen" :weight bold))))
- (header-line ((t (:background "grey90" :foreground "grey20" :box nil))))
- (highlight ((t (:background "darkseagreen2"))))
- (ido-subdir-face ((t (:foreground "red"))))
- (isearch ((t (:background "magenta4" :foreground "lightskyblue1"))))
- (mode-line ((t (:background "grey88" :foreground "black" :box (:line-width -1 :style released-button)))))
- (region ((t (:background "lightgoldenrod2"))))
- (scroll-bar ((t (nil))))
- (secondary-selection ((t (:background "yellow"))))
- (show-paren-match-face ((t (:background "turquoise"))))
- (show-paren-mismatch-face ((t (:background "purple" :foreground "white"))))
- (tooltip ((t (:background "lightyellow" :foreground "black"))))))))
-
-(defun color-theme-ld-dark ()
- "Dark Color theme by Linh Dang, created 2001-11-06."
- (interactive)
- (color-theme-install
- '(color-theme-ld-dark
- ((background-color . "black")
- (background-mode . dark)
- (border-color . "black")
- (cursor-color . "yellow")
- (foreground-color . "white")
- (mouse-color . "white"))
- ((align-highlight-change-face . highlight)
- (align-highlight-nochange-face . secondary-selection)
- (apropos-keybinding-face . underline)
- (apropos-label-face . italic)
- (apropos-match-face . secondary-selection)
- (apropos-property-face . bold-italic)
- (apropos-symbol-face . bold)
- (ebnf-except-border-color . "Black")
- (ebnf-line-color . "Black")
- (ebnf-non-terminal-border-color . "Black")
- (ebnf-repeat-border-color . "Black")
- (ebnf-special-border-color . "Black")
- (ebnf-terminal-border-color . "Black")
- (gnus-article-button-face . bold)
- (gnus-article-mouse-face . highlight)
- (gnus-carpal-button-face . bold)
- (gnus-carpal-header-face . bold-italic)
- (gnus-cite-attribution-face . gnus-cite-attribution-face)
- (gnus-mouse-face . highlight)
- (gnus-selected-tree-face . modeline)
- (gnus-signature-face . gnus-signature-face)
- (gnus-summary-selected-face . gnus-summary-selected-face)
- (help-highlight-face . underline)
- (list-matching-lines-face . bold)
- (ps-line-number-color . "black")
- (ps-zebra-color . 0.95)
- (tags-tag-face . default)
- (vc-annotate-very-old-color . "#0046FF")
- (view-highlight-face . highlight)
- (widget-mouse-face . highlight))
- (default ((t (:stipple nil :background "black" :foreground "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "outline-courier new"))))
- (Info-title-1-face ((t (:bold t :weight bold :family "helv" :height 1.728))))
- (Info-title-2-face ((t (:bold t :family "helv" :weight bold :height 1.44))))
- (Info-title-3-face ((t (:bold t :weight bold :family "helv" :height 1.2))))
- (Info-title-4-face ((t (:bold t :family "helv" :weight bold))))
- (bbdb-company ((t (:italic t :slant italic))))
- (bbdb-field-name ((t (:bold t :weight bold))))
- (bbdb-field-value ((t (nil))))
- (bbdb-name ((t (:underline t))))
- (bold ((t (:bold t :weight bold))))
- (bold-italic ((t (:italic t :bold t :slant italic :weight bold))))
- (border ((t (:background "black"))))
- (change-log-acknowledgement-face ((t (:italic t :slant oblique :foreground "AntiqueWhite3"))))
- (change-log-conditionals-face ((t (:foreground "Aquamarine"))))
- (change-log-date-face ((t (:italic t :slant oblique :foreground "BurlyWood"))))
- (change-log-email-face ((t (:foreground "Aquamarine"))))
- (change-log-file-face ((t (:bold t :family "Verdana" :weight bold :foreground "LightSkyBlue" :height 0.9))))
- (change-log-function-face ((t (:foreground "Aquamarine"))))
- (change-log-list-face ((t (:foreground "LightSkyBlue"))))
- (change-log-name-face ((t (:bold t :weight bold :foreground "Gold"))))
- (clear-case-mode-string-face ((t (:bold t :family "Arial" :box (:line-width 2 :color "grey" :style released-button) :foreground "black" :background "grey" :weight bold :height 0.9))))
- (comint-highlight-input ((t (:bold t :weight bold))))
- (comint-highlight-prompt ((t (:foreground "cyan"))))
- (cursor ((t (:background "yellow"))))
- (custom-button-face ((t (:background "lightgrey" :foreground "black" :box (:line-width 2 :style released-button)))))
- (custom-button-pressed-face ((t (:background "lightgrey" :foreground "black" :box (:line-width 2 :style pressed-button)))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-comment-face ((t (:background "dim gray"))))
- (custom-comment-tag-face ((t (:foreground "gray80"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:bold t :family "helv" :weight bold :height 1.1))))
- (custom-group-tag-face ((t (:bold t :family "helv" :foreground "light blue" :weight bold :height 1.1))))
- (custom-group-tag-face-1 ((t (:bold t :family "helv" :foreground "pink" :weight bold :height 1.1))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "lime green"))))
- (custom-variable-button-face ((t (:bold t :underline t :weight bold))))
- (custom-variable-tag-face ((t (:bold t :family "helv" :foreground "light blue" :weight bold :height 1.2))))
- (diff-added-face ((t (nil))))
- (diff-changed-face ((t (nil))))
- (diff-context-face ((t (:foreground "grey70"))))
- (diff-file-header-face ((t (:bold t :background "grey60" :weight bold))))
- (diff-function-face ((t (:foreground "grey70"))))
- (diff-header-face ((t (:background "grey45"))))
- (diff-hunk-header-face ((t (:background "grey45"))))
- (diff-index-face ((t (:bold t :weight bold :background "grey60"))))
- (diff-nonexistent-face ((t (:bold t :weight bold :background "grey60"))))
- (diff-removed-face ((t (nil))))
- (fixed-pitch ((t (:family "courier"))))
- (font-lock-builtin-face ((t (:foreground "SteelBlue"))))
- (font-lock-comment-face ((t (:italic t :foreground "AntiqueWhite3" :slant oblique))))
- (font-lock-constant-face ((t (:bold t :foreground "Gold" :weight bold))))
- (font-lock-doc-face ((t (:italic t :slant oblique :foreground "BurlyWood"))))
- (font-lock-doc-string-face ((t (:italic t :slant oblique :foreground "BurlyWood"))))
- (font-lock-function-name-face ((t (:bold t :foreground "LightSkyBlue" :weight bold :height 0.9 :family "Verdana"))))
- (font-lock-keyword-face ((t (:foreground "LightSkyBlue"))))
- (font-lock-preprocessor-face ((t (:bold t :foreground "Gold" :weight bold))))
- (font-lock-reference-face ((t (:foreground "SteelBlue"))))
- (font-lock-string-face ((t (:italic t :foreground "BurlyWood" :slant oblique))))
- (font-lock-type-face ((t (:bold t :foreground "PaleGreen" :weight bold :height 0.9 :family "Verdana"))))
- (font-lock-variable-name-face ((t (:foreground "Aquamarine"))))
- (font-lock-warning-face ((t (:bold t :foreground "chocolate" :weight bold))))
- (fringe ((t (:family "outline-courier new" :width normal :weight normal :slant normal :underline nil :overline nil :strike-through nil :box nil :inverse-video nil :stipple nil :background "grey4" :foreground "Wheat"))))
- (gnus-cite-attribution-face ((t (:italic t :slant italic))))
- (gnus-cite-face-1 ((t (:foreground "light blue"))))
- (gnus-cite-face-10 ((t (:foreground "medium purple"))))
- (gnus-cite-face-11 ((t (:foreground "turquoise"))))
- (gnus-cite-face-2 ((t (:foreground "light cyan"))))
- (gnus-cite-face-3 ((t (:foreground "light yellow"))))
- (gnus-cite-face-4 ((t (:foreground "light pink"))))
- (gnus-cite-face-5 ((t (:foreground "pale green"))))
- (gnus-cite-face-6 ((t (:foreground "beige"))))
- (gnus-cite-face-7 ((t (:foreground "orange"))))
- (gnus-cite-face-8 ((t (:foreground "magenta"))))
- (gnus-cite-face-9 ((t (:foreground "violet"))))
- (gnus-emphasis-bold ((t (:bold t :weight bold))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t :slant italic :weight bold))))
- (gnus-emphasis-highlight-words ((t (:background "black" :foreground "yellow"))))
- (gnus-emphasis-italic ((t (:italic t :slant italic))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:bold t :underline t :weight bold))))
- (gnus-emphasis-underline-bold-italic ((t (:italic t :bold t :underline t :slant italic :weight bold))))
- (gnus-emphasis-underline-italic ((t (:italic t :underline t :slant italic))))
- (gnus-group-mail-1-empty-face ((t (:foreground "aquamarine1"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "aquamarine1" :weight bold))))
- (gnus-group-mail-2-empty-face ((t (:foreground "aquamarine2"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "aquamarine2" :weight bold))))
- (gnus-group-mail-3-empty-face ((t (:foreground "aquamarine3"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "aquamarine3" :weight bold))))
- (gnus-group-mail-low-empty-face ((t (:foreground "aquamarine4"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "aquamarine4" :weight bold))))
- (gnus-group-news-1-empty-face ((t (:foreground "PaleTurquoise"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "PaleTurquoise" :weight bold))))
- (gnus-group-news-2-empty-face ((t (:foreground "turquoise"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "turquoise" :weight bold))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (:bold t :weight bold))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (:bold t :weight bold))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (:bold t :weight bold))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (:bold t :weight bold))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkTurquoise"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "DarkTurquoise" :weight bold))))
- (gnus-header-content-face ((t (:italic t :foreground "forest green" :slant italic))))
- (gnus-header-from-face ((t (:foreground "spring green"))))
- (gnus-header-name-face ((t (:foreground "SeaGreen"))))
- (gnus-header-newsgroups-face ((t (:italic t :foreground "yellow" :slant italic))))
- (gnus-header-subject-face ((t (:foreground "SeaGreen3"))))
- (gnus-signature-face ((t (:italic t :slant italic))))
- (gnus-splash-face ((t (:foreground "Brown"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "SkyBlue" :weight bold))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "PaleGreen" :weight bold))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "pink" :weight bold))))
- (gnus-summary-high-unread-face ((t (:bold t :weight bold))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "SkyBlue" :slant italic))))
- (gnus-summary-low-read-face ((t (:italic t :foreground "PaleGreen" :slant italic))))
- (gnus-summary-low-ticked-face ((t (:italic t :foreground "pink" :slant italic))))
- (gnus-summary-low-unread-face ((t (:italic t :slant italic))))
- (gnus-summary-normal-ancient-face ((t (:foreground "SkyBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "PaleGreen"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "pink"))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-selected-face ((t (:underline t))))
- (header-line ((t (:family "Arial" :background "grey20" :foreground "grey75" :box (:line-width 3 :color "grey20" :style released-button) :height 0.9))))
- (highlight ((t (:background "darkolivegreen"))))
- (info-header-node ((t (:italic t :bold t :weight bold :slant italic :foreground "white"))))
- (info-header-xref ((t (:bold t :weight bold :foreground "cyan"))))
- (info-menu-5 ((t (:foreground "red1"))))
- (info-menu-header ((t (:bold t :family "helv" :weight bold))))
- (info-node ((t (:italic t :bold t :foreground "white" :slant italic :weight bold))))
- (info-xref ((t (:bold t :foreground "cyan" :weight bold))))
- (isearch ((t (:background "palevioletred2"))))
- (isearch-lazy-highlight-face ((t (:background "paleturquoise4"))))
- (italic ((t (:italic t :slant italic))))
- (makefile-space-face ((t (:background "hotpink"))))
- (menu ((t (nil))))
- (message-cited-text-face ((t (:foreground "red"))))
- (message-header-cc-face ((t (:bold t :foreground "green4" :weight bold))))
- (message-header-name-face ((t (:foreground "DarkGreen"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "yellow" :slant italic :weight bold))))
- (message-header-other-face ((t (:foreground "#b00000"))))
- (message-header-subject-face ((t (:foreground "green3"))))
- (message-header-to-face ((t (:bold t :foreground "green2" :weight bold))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-mml-face ((t (:foreground "ForestGreen"))))
- (message-separator-face ((t (:foreground "blue3"))))
- (modeline ((t (:background "grey" :foreground "black" :box (:line-width 2 :color "grey" :style released-button) :height 0.9 :family "Arial"))))
- (modeline-mousable-minor-mode ((t (:background "grey" :foreground "black" :box (:line-width 2 :color "grey" :style released-button) :height 0.9 :family "Arial"))))
- (modeline-mousable ((t (:background "grey" :foreground "black" :box (:line-width 2 :color "grey" :style released-button) :height 0.9 :family "Arial"))))
- (modeline-buffer-id ((t (:background "grey" :foreground "black" :box (:line-width 2 :color "grey" :style released-button) :height 0.9 :family "Arial"))))
- (mouse ((t (:background "white"))))
- (primary-selection ((t (:background "DarkSlateGray"))))
- (region ((t (:background "DarkSlateGray"))))
- (scroll-bar ((t (nil))))
- (secondary-selection ((t (:background "SkyBlue4"))))
- (tool-bar ((t (:background "grey75" :foreground "black" :box (:line-width 1 :style released-button)))))
- (trailing-whitespace ((t (:background "white"))))
- (underline ((t (:underline t))))
- (variable-pitch ((t (:family "helv"))))
- (widget-button-face ((t (:bold t :weight bold))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "lime green"))))
- (widget-field-face ((t (:background "dim gray"))))
- (widget-inactive-face ((t (:foreground "light gray"))))
- (widget-single-line-field-face ((t (:background "dim gray"))))
- (zmacs-region ((t (:background "DarkSlateGray")))))))
-
-(defun color-theme-deep-blue ()
- "Color theme by Tomas Cerha, created 2001-11-13."
- (interactive)
- (color-theme-install
- '(color-theme-deep-blue
- ((background-color . "#102e4e")
- (background-mode . dark)
- (border-color . "black")
- (cursor-color . "green")
- (foreground-color . "#eeeeee")
- (mouse-color . "white"))
- ((browse-kill-ring-separator-face . bold)
- (display-time-mail-face . mode-line)
- (help-highlight-face . underline)
- (list-matching-lines-face . secondary-selection)
- (vc-annotate-very-old-color . "#0046FF")
- (view-highlight-face . highlight)
- (widget-mouse-face . highlight))
- (default ((t (:stipple nil :background "#102e4e" :foreground "#eeeeee" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "misc-fixed"))))
- (Info-title-1-face ((t (:bold t :weight bold :family "helv" :height 1.728))))
- (Info-title-2-face ((t (:bold t :family "helv" :weight bold :height 1.44))))
- (Info-title-3-face ((t (:bold t :weight bold :family "helv" :height 1.2))))
- (Info-title-4-face ((t (:bold t :family "helv" :weight bold))))
- (bold ((t (:bold t :weight bold))))
- (bold-italic ((t (:italic t :bold t :slant italic :weight bold))))
- (border ((t (:background "black"))))
- (calendar-today-face ((t (:background "blue"))))
- (change-log-acknowledgement-face ((t (:italic t :slant italic :foreground "CadetBlue"))))
- (change-log-conditionals-face ((t (:foreground "SeaGreen2"))))
- (change-log-date-face ((t (:foreground "burlywood"))))
- (change-log-email-face ((t (:foreground "SeaGreen2"))))
- (change-log-file-face ((t (:bold t :weight bold :foreground "goldenrod"))))
- (change-log-function-face ((t (:foreground "SeaGreen2"))))
- (change-log-list-face ((t (:bold t :weight bold :foreground "DeepSkyBlue1"))))
- (change-log-name-face ((t (:foreground "gold"))))
- (comint-highlight-input ((t (:bold t :weight bold))))
- (comint-highlight-prompt ((t (:foreground "cyan"))))
- (cursor ((t (:background "green" :foreground "black"))))
- (cvs-filename-face ((t (:foreground "lightblue"))))
- (cvs-handled-face ((t (:foreground "pink"))))
- (cvs-header-face ((t (:bold t :foreground "lightyellow" :weight bold))))
- (cvs-marked-face ((t (:bold t :foreground "green" :weight bold))))
- (cvs-msg-face ((t (:italic t :slant italic))))
- (cvs-need-action-face ((t (:foreground "orange"))))
- (cvs-unknown-face ((t (:foreground "red"))))
- (diary-face ((t (:foreground "orange red"))))
- (diff-added-face ((t (nil))))
- (diff-changed-face ((t (nil))))
- (diff-context-face ((t (:foreground "grey70"))))
- (diff-file-header-face ((t (:bold t :background "grey60" :weight bold))))
- (diff-function-face ((t (:foreground "grey70"))))
- (diff-header-face ((t (:background "grey45"))))
- (diff-hunk-header-face ((t (:background "grey45"))))
- (diff-index-face ((t (:bold t :weight bold :background "grey60"))))
- (diff-nonexistent-face ((t (:bold t :weight bold :background "grey60"))))
- (diff-removed-face ((t (nil))))
- (fixed-pitch ((t (:family "fixed"))))
- (font-latex-bold-face ((t (:bold t :foreground "OliveDrab" :weight bold))))
- (font-latex-italic-face ((t (:italic t :foreground "OliveDrab" :slant italic))))
- (font-latex-math-face ((t (:foreground "burlywood"))))
- (font-latex-sedate-face ((t (:foreground "LightGray"))))
- (font-latex-string-face ((t (:foreground "LightSalmon"))))
- (font-latex-warning-face ((t (:bold t :foreground "Pink" :weight bold))))
- (font-lock-builtin-face ((t (:foreground "LightCoral"))))
- (font-lock-comment-face ((t (:italic t :foreground "CadetBlue" :slant italic))))
- (font-lock-constant-face ((t (:foreground "gold"))))
- (font-lock-doc-face ((t (:foreground "BlanchedAlmond"))))
- (font-lock-doc-string-face ((t (:foreground "BlanchedAlmond"))))
- (font-lock-function-name-face ((t (:bold t :foreground "goldenrod" :weight bold))))
- (font-lock-keyword-face ((t (:bold t :foreground "DeepSkyBlue1" :weight bold))))
- (font-lock-preprocessor-face ((t (:foreground "gold"))))
- (font-lock-reference-face ((t (:foreground "LightCoral"))))
- (font-lock-string-face ((t (:foreground "burlywood"))))
- (font-lock-type-face ((t (:foreground "CadetBlue1"))))
- (font-lock-variable-name-face ((t (:foreground "SeaGreen2"))))
- (font-lock-warning-face ((t (:foreground "yellow"))))
- (fringe ((t (:background "#405060"))))
- (header-line ((t (:box (:line-width 2 :style released-button) :background "grey20" :foreground "grey90" :box nil))))
- (highlight ((t (:background "darkgreen"))))
- (holiday-face ((t (:foreground "green"))))
- (info-header-node ((t (:foreground "DeepSkyBlue1"))))
- (info-header-xref ((t (:bold t :weight bold :foreground "SeaGreen2"))))
- (info-menu-5 ((t (:foreground "wheat"))))
- (info-menu-header ((t (:bold t :family "helv" :weight bold))))
- (info-node ((t (:foreground "DeepSkyBlue1"))))
- (info-xref ((t (:bold t :foreground "SeaGreen2" :weight bold))))
- (isearch ((t (:background "palevioletred2" :foreground "brown4"))))
- (isearch-lazy-highlight-face ((t (:background "paleturquoise4"))))
- (italic ((t (:italic t :slant italic))))
- (menu ((t (:background "gray" :foreground "black" :family "helvetica"))))
- (modeline ((t (:background "gray" :foreground "black" :box (:line-width 2 :style released-button)))))
- (modeline-buffer-id ((t (:background "gray" :foreground "black" :box (:line-width 2 :style released-button)))))
- (modeline-mousable ((t (:background "gray" :foreground "black" :box (:line-width 2 :style released-button)))))
- (modeline-mousable-minor-mode ((t (:background "gray" :foreground "black" :box (:line-width 2 :style released-button)))))
- (mouse ((t (:background "white"))))
- (region ((t (:background "DarkCyan"))))
- (scroll-bar ((t (:background "gray" :foreground "#506070"))))
- (secondary-selection ((t (:background "yellow" :foreground "gray10"))))
- (show-paren-match-face ((t (:bold t :foreground "yellow" :weight bold))))
- (show-paren-mismatch-face ((t (:bold t :foreground "red" :weight bold))))
- (tool-bar ((t (:background "grey75" :foreground "black" :box (:line-width 1 :style released-button)))))
- (tooltip ((t (:background "lightyellow" :foreground "black"))))
- (trailing-whitespace ((t (:background "#102e4e"))))
- (underline ((t (:underline t))))
- (variable-pitch ((t (:family "helv"))))
- (widget-button-face ((t (:bold t :weight bold))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "lime green"))))
- (widget-field-face ((t (:background "dim gray"))))
- (widget-inactive-face ((t (:foreground "light gray"))))
- (widget-single-line-field-face ((t (:background "dim gray")))))))
-
-(defun color-theme-kingsajz ()
- "Color theme by Olgierd \"Kingsajz\" Ziolko, created 2001-12-04.
-Another theme with wheat on DarkSlatGrey. Based on Subtle Hacker.
-Used on Emacs 21.1 @ WinMe. Not tested on any other systems.
-
-Some faces uses Andale mono font (nice fixed-width font).
-It is available at: http://www.microsoft.com/typography/downloads/andale32.exe
-
-Hail Eris! All hail Discordia!"
- (interactive)
- (color-theme-install
- '(color-theme-kingsajz
- ((background-color . "darkslategrey")
- (background-mode . dark)
- (border-color . "black")
- (cursor-color . "LightGray")
- (foreground-color . "wheat")
- (mouse-color . "Grey"))
- ((apropos-keybinding-face . underline)
- (apropos-label-face face italic mouse-face highlight)
- (apropos-match-face . secondary-selection)
- (apropos-property-face . bold-italic)
- (apropos-symbol-face . info-xref)
- (display-time-mail-face . mode-line)
- (gnus-article-button-face . bold)
- (gnus-article-mouse-face . highlight)
- (gnus-carpal-button-face . bold)
- (gnus-carpal-header-face . bold-italic)
- (gnus-cite-attribution-face . gnus-cite-attribution-face)
- (gnus-mouse-face . highlight)
- (gnus-selected-tree-face . modeline)
- (gnus-signature-face . gnus-signature-face)
- (gnus-summary-selected-face . gnus-summary-selected-face)
- (gnus-treat-display-xface . head)
- (help-highlight-face . underline)
- (list-matching-lines-face . bold)
- (view-highlight-face . highlight)
- (widget-mouse-face . highlight))
- (default ((t (:stipple nil :background "darkslategrey" :foreground "wheat" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "outline-andale mono"))))
- (bbdb-field-name ((t (:foreground "green"))))
- (bg:erc-color-face0 ((t (:background "White"))))
- (bg:erc-color-face1 ((t (:background "black"))))
- (bg:erc-color-face10 ((t (:background "lightblue1"))))
- (bg:erc-color-face11 ((t (:background "cyan"))))
- (bg:erc-color-face12 ((t (:background "blue"))))
- (bg:erc-color-face13 ((t (:background "deeppink"))))
- (bg:erc-color-face14 ((t (:background "gray50"))))
- (bg:erc-color-face15 ((t (:background "gray90"))))
- (bg:erc-color-face2 ((t (:background "blue4"))))
- (bg:erc-color-face3 ((t (:background "green4"))))
- (bg:erc-color-face4 ((t (:background "red"))))
- (bg:erc-color-face5 ((t (:background "brown"))))
- (bg:erc-color-face6 ((t (:background "purple"))))
- (bg:erc-color-face7 ((t (:background "orange"))))
- (bg:erc-color-face8 ((t (:background "yellow"))))
- (bg:erc-color-face9 ((t (:background "green"))))
- (blue ((t (:foreground "cyan"))))
- (bold ((t (:bold t :foreground "OrangeRed" :weight bold :family "Arial"))))
- (bold-italic ((t (:italic t :bold t :slant italic :weight bold :family "Arial"))))
- (border ((t (:background "black"))))
- (calendar-today-face ((t (:underline t))))
- (comint-highlight-input ((t (:bold t :weight bold))))
- (comint-highlight-prompt ((t (:foreground "cyan"))))
- (cperl-array-face ((t (:foreground "Yellow"))))
- (cperl-hash-face ((t (:foreground "White"))))
- (cperl-nonoverridable-face ((t (:foreground "SkyBlue"))))
- (cursor ((t (:background "LightGray"))))
- (custom-button-face ((t (:foreground "MediumSlateBlue" :underline t))))
- (custom-button-pressed-face ((t (:background "lightgrey" :foreground "black" :box (:line-width 2 :style pressed-button)))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-comment-face ((t (:background "dim gray"))))
- (custom-comment-tag-face ((t (:foreground "gray80"))))
- (custom-documentation-face ((t (:foreground "Grey"))))
- (custom-face-tag-face ((t (:bold t :family "Arial" :weight bold :height 1.2))))
- (custom-group-tag-face ((t (:foreground "MediumAquamarine"))))
- (custom-group-tag-face-1 ((t (:bold t :family "Arial" :foreground "pink" :weight bold :height 1.2))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "Coral"))))
- (custom-variable-button-face ((t (:underline t))))
- (custom-variable-tag-face ((t (:foreground "Aquamarine"))))
- (date ((t (:foreground "green"))))
- (diary-face ((t (:bold t :foreground "IndianRed" :weight bold))))
- (dired-face-directory ((t (:bold t :foreground "sky blue" :weight bold))))
- (dired-face-executable ((t (:foreground "green yellow"))))
- (dired-face-flagged ((t (:foreground "tomato"))))
- (dired-face-marked ((t (:foreground "light salmon"))))
- (dired-face-permissions ((t (:foreground "aquamarine"))))
- (erc-action-face ((t (:bold t :weight bold))))
- (erc-bold-face ((t (:bold t :weight bold))))
- (erc-default-face ((t (nil))))
- (erc-direct-msg-face ((t (:foreground "pale green"))))
- (erc-error-face ((t (:bold t :foreground "IndianRed" :weight bold))))
- (erc-highlight-face ((t (:bold t :foreground "pale green" :weight bold))))
- (erc-host-danger-face ((t (:foreground "red"))))
- (erc-input-face ((t (:foreground "light blue"))))
- (erc-inverse-face ((t (:background "steel blue"))))
- (erc-notice-face ((t (:foreground "light salmon"))))
- (erc-pal-face ((t (:foreground "pale green"))))
- (erc-prompt-face ((t (:bold t :foreground "light blue" :weight bold))))
- (erc-underline-face ((t (:underline t))))
- (eshell-ls-archive-face ((t (:bold t :foreground "IndianRed" :weight bold))))
- (eshell-ls-backup-face ((t (:foreground "Grey"))))
- (eshell-ls-clutter-face ((t (:bold t :foreground "DimGray" :weight bold))))
- (eshell-ls-directory-face ((t (:bold t :foreground "MediumSlateBlue" :weight bold))))
- (eshell-ls-executable-face ((t (:bold t :foreground "Coral" :weight bold))))
- (eshell-ls-missing-face ((t (:bold t :foreground "black" :weight bold))))
- (eshell-ls-picture-face ((t (:foreground "Violet"))))
- (eshell-ls-product-face ((t (:foreground "LightSalmon"))))
- (eshell-ls-readonly-face ((t (:foreground "Aquamarine"))))
- (eshell-ls-special-face ((t (:bold t :foreground "Gold" :weight bold))))
- (eshell-ls-symlink-face ((t (:bold t :foreground "White" :weight bold))))
- (eshell-ls-text-face ((t (:foreground "medium aquamarine"))))
- (eshell-ls-todo-face ((t (:bold t :foreground "aquamarine" :weight bold))))
- (eshell-ls-unreadable-face ((t (:foreground "DimGray"))))
- (eshell-prompt-face ((t (:foreground "powder blue"))))
- (face-1 ((t (:stipple nil :foreground "royal blue" :family "andale mono"))))
- (face-2 ((t (:stipple nil :foreground "DeepSkyBlue1" :overline nil :underline nil :slant normal :family "outline-andale mono"))))
- (face-3 ((t (:stipple nil :foreground "NavajoWhite3"))))
- (fg:erc-color-face0 ((t (:foreground "white"))))
- (fg:erc-color-face1 ((t (:foreground "beige"))))
- (fg:erc-color-face10 ((t (:foreground "pale goldenrod"))))
- (fg:erc-color-face11 ((t (:foreground "light goldenrod yellow"))))
- (fg:erc-color-face12 ((t (:foreground "light yellow"))))
- (fg:erc-color-face13 ((t (:foreground "yellow"))))
- (fg:erc-color-face14 ((t (:foreground "light goldenrod"))))
- (fg:erc-color-face15 ((t (:foreground "lime green"))))
- (fg:erc-color-face2 ((t (:foreground "lemon chiffon"))))
- (fg:erc-color-face3 ((t (:foreground "light cyan"))))
- (fg:erc-color-face4 ((t (:foreground "powder blue"))))
- (fg:erc-color-face5 ((t (:foreground "sky blue"))))
- (fg:erc-color-face6 ((t (:foreground "dark sea green"))))
- (fg:erc-color-face7 ((t (:foreground "pale green"))))
- (fg:erc-color-face8 ((t (:foreground "medium spring green"))))
- (fg:erc-color-face9 ((t (:foreground "khaki"))))
- (fixed-pitch ((t (:family "courier"))))
- (font-lock-builtin-face ((t (:bold t :foreground "PaleGreen" :weight bold))))
- (font-lock-comment-face ((t (:foreground "White"))))
- (font-lock-constant-face ((t (:bold t :foreground "Aquamarine" :weight bold))))
- (font-lock-doc-face ((t (:italic t :slant italic :foreground "LightSalmon"))))
- (font-lock-doc-string-face ((t (:foreground "LightSalmon"))))
- (font-lock-function-name-face ((t (:bold t :foreground "MediumSlateBlue" :weight bold))))
- (font-lock-keyword-face ((t (:foreground "Salmon"))))
- (font-lock-preprocessor-face ((t (:foreground "Salmon"))))
- (font-lock-reference-face ((t (:foreground "pale green"))))
- (font-lock-string-face ((t (:italic t :foreground "LightSalmon" :slant italic))))
- (font-lock-type-face ((t (:bold t :foreground "YellowGreen" :weight bold))))
- (font-lock-variable-name-face ((t (:italic t :bold t :foreground "Aquamarine" :slant italic :weight bold))))
- (font-lock-warning-face ((t (:bold t :foreground "IndianRed" :weight bold))))
- (fringe ((t (:background "darkslategrey"))))
- (gnus-cite-attribution-face ((t (:family "arial"))))
- (gnus-cite-face-1 ((t (:foreground "DarkGoldenrod3"))))
- (gnus-cite-face-10 ((t (nil))))
- (gnus-cite-face-11 ((t (nil))))
- (gnus-cite-face-2 ((t (:foreground "IndianRed3"))))
- (gnus-cite-face-3 ((t (:foreground "tomato"))))
- (gnus-cite-face-4 ((t (:foreground "yellow green"))))
- (gnus-cite-face-5 ((t (:foreground "SteelBlue3"))))
- (gnus-cite-face-6 ((t (:foreground "Azure3"))))
- (gnus-cite-face-7 ((t (:foreground "Azure4"))))
- (gnus-cite-face-8 ((t (:foreground "SpringGreen4"))))
- (gnus-cite-face-9 ((t (:foreground "SlateGray4"))))
- (gnus-emphasis-bold ((t (:bold t :foreground "greenyellow" :weight bold :family "Arial"))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t :foreground "OrangeRed1" :slant italic :weight bold :family "arial"))))
- (gnus-emphasis-highlight-words ((t (:background "black" :foreground "khaki"))))
- (gnus-emphasis-italic ((t (:italic t :bold t :foreground "orange" :slant italic :weight bold :family "Arial"))))
- (gnus-emphasis-underline ((t (:foreground "greenyellow" :underline t))))
- (gnus-emphasis-underline-bold ((t (:bold t :foreground "khaki" :underline t :weight bold :family "Arial"))))
- (gnus-emphasis-underline-bold-italic ((t (:italic t :bold t :underline t :slant italic :weight bold :family "Arial"))))
- (gnus-emphasis-underline-italic ((t (:italic t :foreground "orange" :underline t :slant italic :family "Arial"))))
- (gnus-group-mail-1-empty-face ((t (:foreground "Salmon4"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "firebrick1" :weight bold))))
- (gnus-group-mail-2-empty-face ((t (:foreground "turquoise4"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "turquoise" :weight bold))))
- (gnus-group-mail-3-empty-face ((t (:foreground "LightCyan4"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "LightCyan1" :weight bold))))
- (gnus-group-mail-low-empty-face ((t (:foreground "SteelBlue4"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "SteelBlue2" :weight bold))))
- (gnus-group-news-1-empty-face ((t (:foreground "Salmon4"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "FireBrick1" :weight bold))))
- (gnus-group-news-2-empty-face ((t (:foreground "darkorange3"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "dark orange" :weight bold))))
- (gnus-group-news-3-empty-face ((t (:foreground "turquoise4"))))
- (gnus-group-news-3-face ((t (:bold t :foreground "Aquamarine" :weight bold))))
- (gnus-group-news-4-empty-face ((t (:foreground "SpringGreen4"))))
- (gnus-group-news-4-face ((t (:bold t :foreground "SpringGreen2" :weight bold))))
- (gnus-group-news-5-empty-face ((t (:foreground "OliveDrab4"))))
- (gnus-group-news-5-face ((t (:bold t :foreground "OliveDrab2" :weight bold))))
- (gnus-group-news-6-empty-face ((t (:foreground "DarkGoldenrod4"))))
- (gnus-group-news-6-face ((t (:bold t :foreground "DarkGoldenrod3" :weight bold))))
- (gnus-group-news-low-empty-face ((t (:foreground "wheat4"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "tan4" :weight bold))))
- (gnus-header-content-face ((t (:foreground "LightSkyBlue3"))))
- (gnus-header-from-face ((t (:bold t :foreground "light cyan" :weight bold))))
- (gnus-header-name-face ((t (:bold t :foreground "DodgerBlue1" :weight bold))))
- (gnus-header-newsgroups-face ((t (:italic t :bold t :foreground "LightSkyBlue3" :slant italic :weight bold))))
- (gnus-header-subject-face ((t (:bold t :foreground "light cyan" :weight bold))))
- (gnus-signature-face ((t (:italic t :foreground "salmon" :slant italic))))
- (gnus-splash-face ((t (:foreground "Firebrick1"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "MistyRose4" :weight bold))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "tomato3" :weight bold))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "coral" :weight bold))))
- (gnus-summary-high-unread-face ((t (:italic t :bold t :foreground "red1" :slant italic :weight bold))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "DarkSeaGreen4" :slant italic))))
- (gnus-summary-low-read-face ((t (:foreground "SeaGreen4"))))
- (gnus-summary-low-ticked-face ((t (:italic t :foreground "Green4" :slant italic))))
- (gnus-summary-low-unread-face ((t (:italic t :foreground "green3" :slant italic))))
- (gnus-summary-normal-ancient-face ((t (:foreground "RoyalBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "khaki4"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "khaki3"))))
- (gnus-summary-normal-unread-face ((t (:foreground "khaki"))))
- (gnus-summary-selected-face ((t (:foreground "gold" :underline t))))
- (green ((t (:foreground "green"))))
- (gui-button-face ((t (:foreground "red" :background "black"))))
- (gui-element ((t (:bold t :background "#ffffff" :foreground "#000000" :weight bold))))
- (header-line ((t (:box (:line-width -1 :style released-button) :background "grey20" :foreground "grey90" :box nil))))
- (highlight ((t (:background "PaleGreen" :foreground "DarkGreen"))))
- (highline-face ((t (:background "SeaGreen"))))
- (holiday-face ((t (:background "DimGray"))))
- (info-menu-5 ((t (:underline t))))
- (info-node ((t (:bold t :foreground "DodgerBlue1" :underline t :weight bold))))
- (info-xref ((t (:bold t :foreground "DodgerBlue3" :weight bold))))
- (isearch ((t (:background "sea green" :foreground "black"))))
- (isearch-lazy-highlight-face ((t (:background "paleturquoise4"))))
- (italic ((t (:italic t :foreground "chocolate3" :slant italic))))
- (menu ((t (nil))))
- (message-cited-text-face ((t (:foreground "White"))))
- (message-header-cc-face ((t (:foreground "light cyan"))))
- (message-header-name-face ((t (:foreground "DodgerBlue1"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "LightSkyBlue3" :slant italic :weight bold))))
- (message-header-other-face ((t (:foreground "LightSkyBlue3"))))
- (message-header-subject-face ((t (:bold t :foreground "light cyan" :weight bold))))
- (message-header-to-face ((t (:bold t :foreground "light cyan" :weight bold))))
- (message-header-xheader-face ((t (:foreground "DodgerBlue3"))))
- (message-mml-face ((t (:foreground "ForestGreen"))))
- (message-separator-face ((t (:background "cornflower blue" :foreground "chocolate"))))
- (modeline ((t (:background "dark olive green" :foreground "wheat" :box (:line-width -1 :style released-button)))))
- (modeline-buffer-id ((t (:bold t :background "dark olive green" :foreground "beige" :weight bold :family "arial"))))
- (modeline-mousable ((t (:bold t :background "dark olive green" :foreground "yellow green" :weight bold :family "arial"))))
- (modeline-mousable-minor-mode ((t (:bold t :background "dark olive green" :foreground "wheat" :weight bold :family "arial"))))
- (mouse ((t (:background "Grey"))))
- (paren-blink-off ((t (:foreground "brown"))))
- (region ((t (:background "dark cyan" :foreground "cyan"))))
- (ruler-mode-column-number-face ((t (:box (:color "grey76" :line-width 1 :style released-button) :background "grey76" :stipple nil :inverse-video nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "outline-andale mono" :foreground "black"))))
- (ruler-mode-current-column-face ((t (:bold t :box (:color "grey76" :line-width 1 :style released-button) :background "grey76" :stipple nil :inverse-video nil :strike-through nil :overline nil :underline nil :slant normal :width normal :family "outline-andale mono" :foreground "yellow" :weight bold))))
- (ruler-mode-default-face ((t (:family "outline-andale mono" :width normal :weight normal :slant normal :underline nil :overline nil :strike-through nil :inverse-video nil :stipple nil :background "grey76" :foreground "grey64" :box (:color "grey76" :line-width 1 :style released-button)))))
- (ruler-mode-fill-column-face ((t (:box (:color "grey76" :line-width 1 :style released-button) :background "grey76" :stipple nil :inverse-video nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "outline-andale mono" :foreground "red"))))
- (ruler-mode-margins-face ((t (:box (:color "grey76" :line-width 1 :style released-button) :foreground "grey64" :stipple nil :inverse-video nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "outline-andale mono" :background "grey64"))))
- (ruler-mode-tab-stop-face ((t (:box (:color "grey76" :line-width 1 :style released-button) :background "grey76" :stipple nil :inverse-video nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "outline-andale mono" :foreground "steelblue"))))
- (scroll-bar ((t (nil))))
- (secondary-selection ((t (:background "Aquamarine" :foreground "SlateBlue"))))
- (show-paren-match-face ((t (:bold t :background "Aquamarine" :foreground "steel blue" :weight bold))))
- (show-paren-mismatch-face ((t (:background "Red" :foreground "White"))))
- (swbuff-current-buffer-face ((t (:bold t :foreground "red" :weight bold))))
- (text-cursor ((t (:background "Red" :foreground "white"))))
- (tool-bar ((t (:background "grey75" :foreground "black" :box (:line-width 1 :style released-button)))))
- (trailing-whitespace ((t (:background "red"))))
- (underline ((t (:underline t))))
- (variable-pitch ((t (:family "Arial"))))
- (w3m-anchor-face ((t (:bold t :foreground "DodgerBlue1" :weight bold))))
- (w3m-arrived-anchor-face ((t (:bold t :foreground "DodgerBlue3" :weight bold))))
- (w3m-header-line-location-content-face ((t (:background "dark olive green" :foreground "wheat"))))
- (w3m-header-line-location-title-face ((t (:background "dark olive green" :foreground "beige"))))
- (widget-button-face ((t (:bold t :foreground "green" :weight bold :family "courier"))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "lime green"))))
- (widget-field-face ((t (:foreground "LightBlue"))))
- (widget-inactive-face ((t (:foreground "DimGray"))))
- (widget-single-line-field-face ((t (:foreground "LightBlue"))))
- (woman-bold-face ((t (:bold t :weight bold :family "Arial"))))
- (woman-italic-face ((t (:italic t :foreground "beige" :slant italic :family "Arial"))))
- (woman-unknown-face ((t (:foreground "LightSalmon"))))
- (zmacs-region ((t (:background "dark cyan" :foreground "cyan")))))))
-
-(defun color-theme-comidia ()
- "Color theme by Marcelo Dias de Toledo, created 2001-12-17.
-Steel blue on black."
- (interactive)
- (color-theme-install
- '(color-theme-comidia
- ((background-color . "Black")
- (background-mode . dark)
- (border-color . "black")
- (cursor-color . "SteelBlue")
- (foreground-color . "SteelBlue")
- (mouse-color . "SteelBlue"))
- ((display-time-mail-face . mode-line)
- (gnus-mouse-face . highlight)
- (gnus-summary-selected-face . gnus-summary-selected-face)
- (help-highlight-face . underline)
- (ispell-highlight-face . highlight)
- (list-matching-lines-face . bold)
- (view-highlight-face . highlight)
- (widget-mouse-face . highlight))
- (default ((t (:stipple nil :background "Black" :foreground "SteelBlue" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width semi-condensed :family "misc-fixed"))))
- (bg:erc-color-face0 ((t (:background "White"))))
- (bg:erc-color-face1 ((t (:background "black"))))
- (bg:erc-color-face10 ((t (:background "lightblue1"))))
- (bg:erc-color-face11 ((t (:background "cyan"))))
- (bg:erc-color-face12 ((t (:background "blue"))))
- (bg:erc-color-face13 ((t (:background "deeppink"))))
- (bg:erc-color-face14 ((t (:background "gray50"))))
- (bg:erc-color-face15 ((t (:background "gray90"))))
- (bg:erc-color-face2 ((t (:background "blue4"))))
- (bg:erc-color-face3 ((t (:background "green4"))))
- (bg:erc-color-face4 ((t (:background "red"))))
- (bg:erc-color-face5 ((t (:background "brown"))))
- (bg:erc-color-face6 ((t (:background "purple"))))
- (bg:erc-color-face7 ((t (:background "orange"))))
- (bg:erc-color-face8 ((t (:background "yellow"))))
- (bg:erc-color-face9 ((t (:background "green"))))
- (bold ((t (:bold t :weight bold))))
- (bold-italic ((t (:italic t :bold t :slant italic :weight bold))))
- (border ((t (:background "black"))))
- (comint-highlight-input ((t (:bold t :weight bold))))
- (comint-highlight-prompt ((t (:foreground "cyan"))))
- (cursor ((t (:background "SteelBlue"))))
- (erc-action-face ((t (:bold t :weight bold))))
- (erc-bold-face ((t (:bold t :weight bold))))
- (erc-dangerous-host-face ((t (:foreground "red"))))
- (erc-default-face ((t (nil))))
- (erc-direct-msg-face ((t (:foreground "IndianRed"))))
- (erc-error-face ((t (:background "Red" :foreground "White"))))
- (erc-fool-face ((t (:foreground "dim gray"))))
- (erc-input-face ((t (:foreground "brown"))))
- (erc-inverse-face ((t (:background "Black" :foreground "White"))))
- (erc-keyword-face ((t (:bold t :foreground "pale green" :weight bold))))
- (erc-notice-face ((t (:bold t :foreground "SlateBlue" :weight bold))))
- (erc-pal-face ((t (:bold t :foreground "Magenta" :weight bold))))
- (erc-prompt-face ((t (:bold t :background "lightBlue2" :foreground "Black" :weight bold))))
- (erc-timestamp-face ((t (:bold t :foreground "green" :weight bold))))
- (erc-underline-face ((t (:underline t))))
- (fg:erc-color-face0 ((t (:foreground "White"))))
- (fg:erc-color-face1 ((t (:foreground "black"))))
- (fg:erc-color-face10 ((t (:foreground "lightblue1"))))
- (fg:erc-color-face11 ((t (:foreground "cyan"))))
- (fg:erc-color-face12 ((t (:foreground "blue"))))
- (fg:erc-color-face13 ((t (:foreground "deeppink"))))
- (fg:erc-color-face14 ((t (:foreground "gray50"))))
- (fg:erc-color-face15 ((t (:foreground "gray90"))))
- (fg:erc-color-face2 ((t (:foreground "blue4"))))
- (fg:erc-color-face3 ((t (:foreground "green4"))))
- (fg:erc-color-face4 ((t (:foreground "red"))))
- (fg:erc-color-face5 ((t (:foreground "brown"))))
- (fg:erc-color-face6 ((t (:foreground "purple"))))
- (fg:erc-color-face7 ((t (:foreground "orange"))))
- (fg:erc-color-face8 ((t (:foreground "yellow"))))
- (fg:erc-color-face9 ((t (:foreground "green"))))
- (fixed-pitch ((t (:family "courier"))))
- (font-lock-builtin-face ((t (:foreground "LightSteelBlue"))))
- (font-lock-comment-face ((t (:foreground "chocolate1"))))
- (font-lock-constant-face ((t (:foreground "Aquamarine"))))
- (font-lock-doc-face ((t (:foreground "LightSalmon"))))
- (font-lock-doc-string-face ((t (:foreground "LightSalmon"))))
- (font-lock-function-name-face ((t (:foreground "LightSkyBlue"))))
- (font-lock-keyword-face ((t (:foreground "Cyan"))))
- (font-lock-preprocessor-face ((t (:foreground "Aquamarine"))))
- (font-lock-reference-face ((t (:foreground "LightSteelBlue"))))
- (font-lock-string-face ((t (:foreground "LightSalmon"))))
- (font-lock-type-face ((t (:foreground "PaleGreen"))))
- (font-lock-variable-name-face ((t (:foreground "LightGoldenrod"))))
- (font-lock-warning-face ((t (:bold t :foreground "Pink" :weight bold))))
- (fringe ((t (:background "grey10"))))
- (gnus-group-mail-1-empty-face ((t (:foreground "aquamarine1"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "aquamarine1" :weight bold))))
- (gnus-group-mail-2-empty-face ((t (:foreground "aquamarine2"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "aquamarine2" :weight bold))))
- (gnus-group-mail-3-empty-face ((t (:foreground "aquamarine3"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "aquamarine3" :weight bold))))
- (gnus-group-mail-low-empty-face ((t (:foreground "aquamarine4"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "aquamarine4" :weight bold))))
- (gnus-group-news-1-empty-face ((t (:foreground "PaleTurquoise"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "PaleTurquoise" :weight bold))))
- (gnus-group-news-2-empty-face ((t (:foreground "turquoise"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "turquoise" :weight bold))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (:bold t :weight bold))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (:bold t :weight bold))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (:bold t :weight bold))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (:bold t :weight bold))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkTurquoise"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "DarkTurquoise" :weight bold))))
- (gnus-splash-face ((t (:foreground "Brown"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "SkyBlue" :weight bold))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "PaleGreen" :weight bold))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "pink" :weight bold))))
- (gnus-summary-high-unread-face ((t (:bold t :weight bold))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "SkyBlue" :slant italic))))
- (gnus-summary-low-read-face ((t (:italic t :foreground "PaleGreen" :slant italic))))
- (gnus-summary-low-ticked-face ((t (:italic t :foreground "pink" :slant italic))))
- (gnus-summary-low-unread-face ((t (:italic t :slant italic))))
- (gnus-summary-normal-ancient-face ((t (:foreground "SkyBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "PaleGreen"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "pink"))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-selected-face ((t (:underline t))))
- (header-line ((t (:family "neep" :width condensed :box (:line-width 1 :style none) :background "grey20" :foreground "grey90" :box nil))))
- (highlight ((t (:background "darkolivegreen"))))
- (isearch ((t (:background "palevioletred2" :foreground "brown4"))))
- (isearch-lazy-highlight-face ((t (:background "paleturquoise4"))))
- (italic ((t (:italic t :slant italic))))
- (menu ((t (nil))))
- (message-cited-text-face ((t (:foreground "red"))))
- (message-header-cc-face ((t (:bold t :foreground "green4" :weight bold))))
- (message-header-name-face ((t (:foreground "DarkGreen"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "yellow" :slant italic :weight bold))))
- (message-header-other-face ((t (:foreground "#b00000"))))
- (message-header-subject-face ((t (:foreground "green3"))))
- (message-header-to-face ((t (:bold t :foreground "green2" :weight bold))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-mml-face ((t (:foreground "ForestGreen"))))
- (message-separator-face ((t (:foreground "blue3"))))
- (modeline ((t (:background "Gray10" :foreground "SteelBlue" :box (:line-width 1 :style none) :width condensed :family "neep"))))
- (modeline-buffer-id ((t (:background "Gray10" :foreground "SteelBlue" :box (:line-width 1 :style none) :width condensed :family "neep"))))
- (modeline-mousable-minor-mode ((t (:background "Gray10" :foreground "SteelBlue" :box (:line-width 1 :style none) :width condensed :family "neep"))))
- (modeline-mousable ((t (:background "Gray10" :foreground "SteelBlue" :box (:line-width 1 :style none) :width condensed :family "neep"))))
- (mouse ((t (:background "SteelBlue"))))
- (primary-selection ((t (:background "blue3"))))
- (region ((t (:background "blue3"))))
- (scroll-bar ((t (:background "grey75"))))
- (secondary-selection ((t (:background "SkyBlue4"))))
- (speedbar-button-face ((t (:foreground "green3"))))
- (speedbar-directory-face ((t (:foreground "light blue"))))
- (speedbar-file-face ((t (:foreground "cyan"))))
- (speedbar-highlight-face ((t (:background "sea green"))))
- (speedbar-selected-face ((t (:foreground "red" :underline t))))
- (speedbar-tag-face ((t (:foreground "yellow"))))
- (tool-bar ((t (:background "grey75" :foreground "black" :box (:line-width 1 :style released-button)))))
- (tooltip ((t (:background "lightyellow" :foreground "black"))))
- (trailing-whitespace ((t (:background "red"))))
- (underline ((t (:underline t))))
- (variable-pitch ((t (:family "helv"))))
- (widget-button-face ((t (:bold t :weight bold))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "lime green"))))
- (widget-field-face ((t (:background "dim gray"))))
- (widget-inactive-face ((t (:foreground "light gray"))))
- (widget-single-line-field-face ((t (:background "dim gray"))))
- (zmacs-region ((t (:background "blue3")))))))
-
-(defun color-theme-katester ()
- "Color theme by walterh@rocketmail.com, created 2001-12-12.
-A pastelly-mac like color-theme."
- (interactive)
- (color-theme-standard)
- (let ((color-theme-is-cumulative t))
- (color-theme-install
- '(color-theme-katester
- ((background-color . "ivory")
- (cursor-color . "slateblue")
- (foreground-color . "black")
- (mouse-color . "slateblue"))
- (default ((t ((:background "ivory" :foreground "black")))))
- (bold ((t (:bold t))))
- (font-lock-string-face ((t (:foreground "maroon"))))
- (font-lock-keyword-face ((t (:foreground "blue"))))
- (font-lock-constant-face ((t (:foreground "darkblue"))))
- (font-lock-type-face ((t (:foreground "black"))))
- (font-lock-variable-name-face ((t (:foreground "black"))))
- (font-lock-function-name-face ((t (:bold t :underline t))))
- (font-lock-comment-face ((t (:background "seashell"))))
- (highlight ((t (:background "lavender"))))
- (italic ((t (:italic t))))
- (modeline ((t (:background "moccasin" :foreground "black"))))
- (region ((t (:background "lavender" ))))
- (underline ((t (:underline t))))))))
-
-(defun color-theme-arjen ()
- "Color theme by awiersma, created 2001-08-27."
- (interactive)
- (color-theme-install
- '(color-theme-arjen
- ((background-color . "black")
- (background-mode . dark)
- (border-color . "black")
- (cursor-color . "yellow")
- (foreground-color . "White")
- (mouse-color . "sienna1"))
- ((buffers-tab-face . buffers-tab)
- (cperl-here-face . font-lock-string-face)
- (cperl-invalid-face quote underline)
- (cperl-pod-face . font-lock-comment-face)
- (cperl-pod-head-face . font-lock-variable-name-face)
- (vc-mode-face . highlight))
- (default ((t (:background "black" :foreground "white"))))
- (blue ((t (:foreground "blue"))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:bold t))))
- (border-glyph ((t (nil))))
- (buffers-tab ((t (:background "black" :foreground "white"))))
- (calendar-today-face ((t (:underline t))))
- (cperl-array-face ((t (:foreground "darkseagreen"))))
- (cperl-hash-face ((t (:foreground "darkseagreen"))))
- (cperl-nonoverridable-face ((t (:foreground "SkyBlue"))))
- (custom-button-face ((t (nil))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:underline t))))
- (custom-group-tag-face ((t (:underline t :foreground "light blue"))))
- (custom-group-tag-face-1 ((t (:underline t :foreground "pink"))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "lime green"))))
- (custom-variable-button-face ((t (:underline t :bold t))))
- (custom-variable-tag-face ((t (:underline t :foreground "light blue"))))
- (diary-face ((t (:foreground "IndianRed"))))
- (erc-action-face ((t (:bold t))))
- (erc-bold-face ((t (:bold t))))
- (erc-default-face ((t (nil))))
- (erc-direct-msg-face ((t (:foreground "sandybrown"))))
- (erc-error-face ((t (:bold t :foreground "IndianRed"))))
- (erc-input-face ((t (:foreground "Beige"))))
- (erc-inverse-face ((t (:background "wheat" :foreground "darkslategrey"))))
- (erc-notice-face ((t (:foreground "MediumAquamarine"))))
- (erc-pal-face ((t (:foreground "pale green"))))
- (erc-prompt-face ((t (:foreground "MediumAquamarine"))))
- (erc-underline-face ((t (:underline t))))
- (eshell-ls-archive-face ((t (:bold t :foreground "IndianRed"))))
- (eshell-ls-backup-face ((t (:foreground "Grey"))))
- (eshell-ls-clutter-face ((t (:foreground "DimGray"))))
- (eshell-ls-directory-face ((t (:bold t :foreground "MediumSlateBlue"))))
- (eshell-ls-executable-face ((t (:foreground "Coral"))))
- (eshell-ls-missing-face ((t (:foreground "black"))))
- (eshell-ls-picture-face ((t (:foreground "Violet"))))
- (eshell-ls-product-face ((t (:foreground "sandybrown"))))
- (eshell-ls-readonly-face ((t (:foreground "Aquamarine"))))
- (eshell-ls-special-face ((t (:foreground "Gold"))))
- (eshell-ls-symlink-face ((t (:foreground "White"))))
- (eshell-ls-unreadable-face ((t (:foreground "DimGray"))))
- (eshell-prompt-face ((t (:foreground "MediumAquamarine"))))
- (fl-comment-face ((t (:foreground "pink"))))
- (fl-doc-string-face ((t (:foreground "purple"))))
- (fl-function-name-face ((t (:foreground "red"))))
- (fl-keyword-face ((t (:foreground "cadetblue"))))
- (fl-string-face ((t (:foreground "green"))))
- (fl-type-face ((t (:foreground "yellow"))))
- (font-lock-builtin-face ((t (:foreground "LightSteelBlue"))))
- (font-lock-comment-face ((t (:foreground "IndianRed"))))
- (font-lock-constant-face ((t (:foreground "Aquamarine"))))
- (font-lock-doc-string-face ((t (:foreground "DarkOrange"))))
- (font-lock-function-name-face ((t (:foreground "YellowGreen"))))
- (font-lock-keyword-face ((t (:foreground "PaleYellow"))))
- (font-lock-preprocessor-face ((t (:foreground "Aquamarine"))))
- (font-lock-reference-face ((t (:foreground "SlateBlue"))))
- (font-lock-string-face ((t (:foreground "Orange"))))
- (font-lock-type-face ((t (:foreground "Green"))))
- (font-lock-variable-name-face ((t (:foreground "darkseagreen"))))
- (font-lock-warning-face ((t (:bold t :foreground "Pink"))))
- (qt-classes-face ((t (:foreground "Red"))))
- (gnus-cite-attribution-face ((t (nil))))
- (gnus-cite-face-1 ((t (:bold nil :foreground "deep sky blue"))))
- (gnus-cite-face-10 ((t (:foreground "medium purple"))))
- (gnus-cite-face-11 ((t (:foreground "turquoise"))))
- (gnus-cite-face-2 ((t (:bold nil :foreground "cadetblue"))))
- (gnus-cite-face-3 ((t (:bold nil :foreground "gold"))))
- (gnus-cite-face-4 ((t (:foreground "light pink"))))
- (gnus-cite-face-5 ((t (:foreground "pale green"))))
- (gnus-cite-face-6 ((t (:bold nil :foreground "chocolate"))))
- (gnus-cite-face-7 ((t (:foreground "orange"))))
- (gnus-cite-face-8 ((t (:foreground "magenta"))))
- (gnus-cite-face-9 ((t (:foreground "violet"))))
- (gnus-emphasis-bold ((t (:bold nil))))
- (gnus-emphasis-bold-italic ((t (:bold nil))))
- (gnus-emphasis-highlight-words ((t (:background "black" :foreground "yellow"))))
- (gnus-emphasis-italic ((t (nil))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:underline t :bold nil))))
- (gnus-emphasis-underline-bold-italic ((t (:underline t :bold nil))))
- (gnus-emphasis-underline-italic ((t (:underline t))))
- (gnus-group-mail-1-empty-face ((t (:foreground "aquamarine1"))))
- (gnus-group-mail-1-face ((t (:bold nil :foreground "aquamarine1"))))
- (gnus-group-mail-2-empty-face ((t (:foreground "aquamarine2"))))
- (gnus-group-mail-2-face ((t (:bold nil :foreground "aquamarine2"))))
- (gnus-group-mail-3-empty-face ((t (:foreground "aquamarine3"))))
- (gnus-group-mail-3-face ((t (:bold nil :foreground "aquamarine3"))))
- (gnus-group-mail-low-empty-face ((t (:foreground "aquamarine4"))))
- (gnus-group-mail-low-face ((t (:bold nil :foreground "aquamarine4"))))
- (gnus-group-news-1-empty-face ((t (:foreground "PaleTurquoise"))))
- (gnus-group-news-1-face ((t (:bold nil :foreground "PaleTurquoise"))))
- (gnus-group-news-2-empty-face ((t (:foreground "turquoise"))))
- (gnus-group-news-2-face ((t (:bold nil :foreground "turquoise"))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (:bold nil))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (:bold nil))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (:bold nil))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (:bold nil))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkTurquoise"))))
- (gnus-group-news-low-face ((t (:bold nil :foreground "DarkTurquoise"))))
- (gnus-header-content-face ((t (:foreground "forest green"))))
- (gnus-header-from-face ((t (:bold nil :foreground "spring green"))))
- (gnus-header-name-face ((t (:foreground "deep sky blue"))))
- (gnus-header-newsgroups-face ((t (:bold nil :foreground "purple"))))
- (gnus-header-subject-face ((t (:bold nil :foreground "orange"))))
- (gnus-signature-face ((t (:bold nil :foreground "khaki"))))
- (gnus-splash-face ((t (:foreground "Brown"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold nil :foreground "SkyBlue"))))
- (gnus-summary-high-read-face ((t (:bold nil :foreground "PaleGreen"))))
- (gnus-summary-high-ticked-face ((t (:bold nil :foreground "pink"))))
- (gnus-summary-high-unread-face ((t (:bold nil))))
- (gnus-summary-low-ancient-face ((t (:foreground "SkyBlue"))))
- (gnus-summary-low-read-face ((t (:foreground "PaleGreen"))))
- (gnus-summary-low-ticked-face ((t (:foreground "pink"))))
- (gnus-summary-low-unread-face ((t (nil))))
- (gnus-summary-normal-ancient-face ((t (:foreground "SkyBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "PaleGreen"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "pink"))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-selected-face ((t (:underline t))))
- (green ((t (:foreground "green"))))
- (gui-button-face ((t (:background "grey75" :foreground "black"))))
- (gui-element ((t (:background "#D4D0C8" :foreground "black"))))
- (highlight ((t (:background "darkolivegreen"))))
- (highline-face ((t (:background "SeaGreen"))))
- (holiday-face ((t (:background "DimGray"))))
- (info-menu-5 ((t (:underline t))))
- (info-node ((t (:underline t :bold t :foreground "DodgerBlue1"))))
- (info-xref ((t (:underline t :foreground "DodgerBlue1"))))
- (isearch ((t (:background "blue"))))
- (isearch-secondary ((t (:foreground "red3"))))
- (italic ((t (nil))))
- (left-margin ((t (nil))))
- (list-mode-item-selected ((t (:background "gray68" :foreground "white"))))
- (message-cited-text-face ((t (:bold t :foreground "green"))))
- (message-header-cc-face ((t (:bold t :foreground "green4"))))
- (message-header-name-face ((t (:bold t :foreground "orange"))))
- (message-header-newsgroups-face ((t (:bold t :foreground "violet"))))
- (message-header-other-face ((t (:bold t :foreground "chocolate"))))
- (message-header-subject-face ((t (:bold t :foreground "yellow"))))
- (message-header-to-face ((t (:bold t :foreground "cadetblue"))))
- (message-header-xheader-face ((t (:bold t :foreground "light blue"))))
- (message-mml-face ((t (:bold t :foreground "Green3"))))
- (message-separator-face ((t (:foreground "blue3"))))
- (modeline ((t (:background "DarkRed" :foreground "white" :box (:line-width 1 :style released-button)))))
- (modeline-buffer-id ((t (:background "DarkRed" :foreground "white"))))
- (modeline-mousable ((t (:background "DarkRed" :foreground "white"))))
- (modeline-mousable-minor-mode ((t (:background "DarkRed" :foreground "white"))))
- (p4-depot-added-face ((t (:foreground "blue"))))
- (p4-depot-deleted-face ((t (:foreground "red"))))
- (p4-depot-unmapped-face ((t (:foreground "grey30"))))
- (p4-diff-change-face ((t (:foreground "dark green"))))
- (p4-diff-del-face ((t (:foreground "red"))))
- (p4-diff-file-face ((t (:background "gray90"))))
- (p4-diff-head-face ((t (:background "gray95"))))
- (p4-diff-ins-face ((t (:foreground "blue"))))
- (pointer ((t (nil))))
- (primary-selection ((t (:background "blue"))))
- (red ((t (:foreground "red"))))
- (region ((t (:background "blue"))))
- (right-margin ((t (nil))))
- (secondary-selection ((t (:background "darkslateblue"))))
- (show-paren-match-face ((t (:background "Aquamarine" :foreground "SlateBlue"))))
- (show-paren-mismatch-face ((t (:background "Red" :foreground "White"))))
- (text-cursor ((t (:background "yellow" :foreground "black"))))
- (toolbar ((t (nil))))
- (underline ((nil (:underline nil))))
- (vertical-divider ((t (nil))))
- (widget ((t (nil))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "lime green"))))
- (widget-field-face ((t (:background "dim gray"))))
- (widget-inactive-face ((t (:foreground "light gray"))))
- (widget-single-line-field-face ((t (:background "dim gray"))))
- (woman-bold-face ((t (:bold t))))
- (woman-italic-face ((t (:foreground "beige"))))
- (woman-unknown-face ((t (:foreground "LightSalmon"))))
- (yellow ((t (:foreground "yellow"))))
- (zmacs-region ((t (:background "snow" :foreground "blue")))))))
-
-(defun color-theme-tty-dark ()
- "Color theme by Oivvio Polite, created 2002-02-01. Good for tty display."
- (interactive)
- (color-theme-install
- '(color-theme-tty-dark
- ((background-color . "black")
- (background-mode . dark)
- (border-color . "blue")
- (cursor-color . "red")
- (foreground-color . "white")
- (mouse-color . "black"))
- ((ispell-highlight-face . highlight)
- (list-matching-lines-face . bold)
- (tinyreplace-:face . highlight)
- (view-highlight-face . highlight))
- (default ((t (nil))))
- (bold ((t (:underline t :background "black" :foreground "white"))))
- (bold-italic ((t (:underline t :foreground "white"))))
- (calendar-today-face ((t (:underline t))))
- (diary-face ((t (:foreground "red"))))
- (font-lock-builtin-face ((t (:foreground "blue"))))
- (font-lock-comment-face ((t (:foreground "cyan"))))
- (font-lock-constant-face ((t (:foreground "magenta"))))
- (font-lock-function-name-face ((t (:foreground "cyan"))))
- (font-lock-keyword-face ((t (:foreground "red"))))
- (font-lock-string-face ((t (:foreground "green"))))
- (font-lock-type-face ((t (:foreground "yellow"))))
- (font-lock-variable-name-face ((t (:foreground "blue"))))
- (font-lock-warning-face ((t (:bold t :foreground "magenta"))))
- (highlight ((t (:background "blue" :foreground "yellow"))))
- (holiday-face ((t (:background "cyan"))))
- (info-menu-5 ((t (:underline t))))
- (info-node ((t (:italic t :bold t))))
- (info-xref ((t (:bold t))))
- (italic ((t (:underline t :background "red"))))
- (message-cited-text-face ((t (:foreground "red"))))
- (message-header-cc-face ((t (:bold t :foreground "green"))))
- (message-header-name-face ((t (:foreground "green"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "yellow"))))
- (message-header-other-face ((t (:foreground "#b00000"))))
- (message-header-subject-face ((t (:foreground "green"))))
- (message-header-to-face ((t (:bold t :foreground "green"))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-mml-face ((t (:foreground "green"))))
- (message-separator-face ((t (:foreground "blue"))))
-
- (modeline ((t (:background "white" :foreground "blue"))))
- (modeline-buffer-id ((t (:background "white" :foreground "red"))))
- (modeline-mousable ((t (:background "white" :foreground "magenta"))))
- (modeline-mousable-minor-mode ((t (:background "white" :foreground "yellow"))))
- (region ((t (:background "white" :foreground "black"))))
- (zmacs-region ((t (:background "cyan" :foreground "black"))))
- (secondary-selection ((t (:background "blue"))))
- (show-paren-match-face ((t (:background "red"))))
- (show-paren-mismatch-face ((t (:background "magenta" :foreground "white"))))
- (underline ((t (:underline t)))))))
-
-(defun color-theme-aliceblue ()
- "Color theme by Girish Bharadwaj, created 2002-03-27.
-Includes comint prompt, custom, font-lock, isearch,
-jde, senator, speedbar, and widget."
- (interactive)
- (color-theme-install
- '(color-theme-aliceblue
- ((background-color . "AliceBlue")
- (background-mode . light)
- (border-color . "black")
- (cursor-color . "black")
- (foreground-color . "DarkSlateGray4")
- (mouse-color . "black"))
- ((help-highlight-face . underline)
- (list-matching-lines-face . bold)
- (semantic-which-function-use-color . t)
- (senator-eldoc-use-color . t)
- (view-highlight-face . highlight)
- (widget-mouse-face . highlight))
- (default ((t (:stipple nil :background "AliceBlue" :foreground "DarkSlateGray4" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "outline-courier new"))))
- (bold ((t (:bold t :weight bold))))
- (bold-italic ((t (:italic t :bold t :slant italic :weight bold))))
- (border ((t (:background "black"))))
- (comint-highlight-input ((t (:bold t :weight bold))))
- (comint-highlight-prompt ((t (:foreground "dark blue"))))
- (cursor ((t (:background "black"))))
- (custom-button-face ((t (:background "lightgrey" :foreground "black" :box (:line-width 2 :style released-button)))))
- (custom-button-pressed-face ((t (:background "lightgrey" :foreground "black" :box (:line-width 2 :style pressed-button)))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-comment-face ((t (:background "gray85"))))
- (custom-comment-tag-face ((t (:foreground "blue4"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:bold t :family "helv" :weight bold :height 1.2))))
- (custom-group-tag-face ((t (:bold t :foreground "blue" :weight bold :height 1.2))))
- (custom-group-tag-face-1 ((t (:bold t :family "helv" :foreground "red" :weight bold :height 1.2))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "dark green"))))
- (custom-variable-button-face ((t (:bold t :underline t :weight bold))))
- (custom-variable-tag-face ((t (:bold t :family "helv" :foreground "blue" :weight bold :height 1.2))))
- (fixed-pitch ((t (:family "courier"))))
- (font-lock-builtin-face ((t (:foreground "Orchid"))))
- (font-lock-comment-face ((t (:italic t :foreground "Firebrick" :slant oblique))))
- (font-lock-constant-face ((t (:foreground "CadetBlue"))))
- (font-lock-function-name-face ((t (:bold t :foreground "Blue" :weight extra-bold :family "outline-verdana"))))
- (font-lock-keyword-face ((t (:bold t :foreground "Purple" :weight semi-bold :family "outline-verdana"))))
- (font-lock-preprocessor-face ((t (:foreground "CadetBlue"))))
- (font-lock-reference-face ((t (:foreground "Orchid"))))
- (font-lock-string-face ((t (:foreground "RosyBrown"))))
- (font-lock-type-face ((t (:italic t :foreground "ForestGreen" :slant italic))))
- (font-lock-variable-name-face ((t (:foreground "DarkGoldenrod" :width condensed))))
- (font-lock-warning-face ((t (:bold t :foreground "Red" :weight bold))))
- (fringe ((t (:background "DarkSlateBlue"))))
- (header-line ((t (:box (:line-width -1 :style released-button) :background "grey90" :foreground "grey20" :box nil))))
- (highlight ((t (:background "darkseagreen2"))))
- (isearch ((t (:background "magenta4" :foreground "lightskyblue1"))))
- (isearch-lazy-highlight-face ((t (:background "paleturquoise"))))
- (italic ((t (:italic t :slant italic))))
- (jde-bug-breakpoint-cursor ((t (:background "brown" :foreground "cyan"))))
- (jde-db-active-breakpoint-face ((t (:background "red" :foreground "black"))))
- (jde-db-requested-breakpoint-face ((t (:background "yellow" :foreground "black"))))
- (jde-db-spec-breakpoint-face ((t (:background "green" :foreground "black"))))
- (jde-java-font-lock-api-face ((t (:foreground "dark goldenrod"))))
- (jde-java-font-lock-bold-face ((t (:bold t :weight bold))))
- (jde-java-font-lock-code-face ((t (nil))))
- (jde-java-font-lock-constant-face ((t (:foreground "CadetBlue"))))
- (jde-java-font-lock-doc-tag-face ((t (:foreground "green4"))))
- (jde-java-font-lock-italic-face ((t (:italic t :slant italic))))
- (jde-java-font-lock-link-face ((t (:foreground "blue" :underline t :slant normal))))
- (jde-java-font-lock-modifier-face ((t (:foreground "Orchid"))))
- (jde-java-font-lock-number-face ((t (:foreground "RosyBrown"))))
- (jde-java-font-lock-operator-face ((t (:foreground "medium blue"))))
- (jde-java-font-lock-package-face ((t (:foreground "blue3"))))
- (jde-java-font-lock-pre-face ((t (nil))))
- (jde-java-font-lock-underline-face ((t (:underline t))))
- (menu ((t (nil))))
- (modeline ((t (:background "grey75" :foreground "black" :box (:line-width -1 :style released-button)))))
- (modeline-buffer-id ((t (:background "grey75" :foreground "black"))))
- (modeline-mousable ((t (:background "grey75" :foreground "black"))))
- (modeline-mousable-minor-mode ((t (:background "grey75" :foreground "black"))))
- (mouse ((t (:background "black"))))
- (primary-selection ((t (:background "lightgoldenrod2"))))
- (region ((t (:background "lightgoldenrod2"))))
- (scroll-bar ((t (nil))))
- (secondary-selection ((t (:background "yellow"))))
- (semantic-dirty-token-face ((t (:background "lightyellow"))))
- (semantic-unmatched-syntax-face ((t (:underline "red"))))
- (senator-intangible-face ((t (:foreground "gray25"))))
- (senator-momentary-highlight-face ((t (:background "gray70"))))
- (senator-read-only-face ((t (:background "#CCBBBB"))))
- (show-paren-match-face ((t (:background "turquoise"))))
- (show-paren-mismatch-face ((t (:background "purple" :foreground "white"))))
- (speedbar-button-face ((t (:foreground "green4"))))
- (speedbar-directory-face ((t (:foreground "blue4"))))
- (speedbar-file-face ((t (:foreground "cyan4"))))
- (speedbar-highlight-face ((t (:background "green"))))
- (speedbar-selected-face ((t (:foreground "red" :underline t))))
- (speedbar-tag-face ((t (:foreground "brown"))))
- (template-message-face ((t (:bold t :weight bold))))
- (tool-bar ((t (:background "grey75" :foreground "black" :box (:line-width 1 :style released-button)))))
- (trailing-whitespace ((t (:background "red"))))
- (underline ((t (:underline t))))
- (variable-pitch ((t (:family "helv"))))
- (widget-button-face ((t (:bold t :weight bold))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (widget-single-line-field-face ((t (:background "gray85"))))
- (trailing-whitespace ((t (:background "red"))))
- (underline ((t (:underline t))))
- (variable-pitch ((t (:family "helv"))))
- (widget-button-face ((t (:bold t :weight bold))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (widget-single-line-field-face ((t (:background "gray85"))))
- (zmacs-region ((t (:background "lightgoldenrod2")))))))
-
-(defun color-theme-black-on-gray ()
- "Color theme by sbhojwani, created 2002-04-03.
-Includes ecb, font-lock, paren, semantic, and widget faces.
-Some of the font-lock faces are disabled, ie. they look just
-like the default face. This is for people that don't like
-the look of \"angry fruit salad\" when editing."
- (interactive)
- (color-theme-install
- '(color-theme-black-on-gray
- ((background-color . "white")
- (background-mode . light)
- (border-color . "blue")
- (foreground-color . "black"))
- ((buffers-tab-face . buffers-tab)
- (ecb-directories-general-face . ecb-default-general-face)
- (ecb-directory-face . ecb-default-highlight-face)
- (ecb-history-face . ecb-default-highlight-face)
- (ecb-history-general-face . ecb-default-general-face)
- (ecb-method-face . ecb-default-highlight-face)
- (ecb-methods-general-face . ecb-default-general-face)
- (ecb-source-face . ecb-default-highlight-face)
- (ecb-source-in-directories-buffer-face . ecb-source-in-directories-buffer-face)
- (ecb-sources-general-face . ecb-default-general-face)
- (ecb-token-header-face . ecb-token-header-face))
- (default ((t (nil))))
- (blue ((t (:foreground "blue"))))
- (bold ((t (:bold t :size "10pt"))))
- (bold-italic ((t (:italic t :bold t :size "10pt"))))
- (border-glyph ((t (:size "11pt"))))
- (buffers-tab ((t (:background "gray75"))))
- (display-time-mail-balloon-enhance-face ((t (:background "orange"))))
- (display-time-mail-balloon-gnus-group-face ((t (:foreground "blue"))))
- (display-time-time-balloon-face ((t (:foreground "red"))))
- (ecb-bucket-token-face ((t (:bold t :size "10pt"))))
- (ecb-default-general-face ((t (nil))))
- (ecb-default-highlight-face ((t (:background "cornflower blue" :foreground "yellow"))))
- (ecb-directories-general-face ((t (nil))))
- (ecb-directory-face ((t (:background "cornflower blue" :foreground "yellow"))))
- (ecb-history-face ((t (:background "cornflower blue" :foreground "yellow"))))
- (ecb-history-general-face ((t (nil))))
- (ecb-method-face ((t (:background "cornflower blue" :foreground "yellow"))))
- (ecb-methods-general-face ((t (nil))))
- (ecb-source-face ((t (:background "cornflower blue" :foreground "yellow"))))
- (ecb-source-in-directories-buffer-face ((t (:foreground "medium blue"))))
- (ecb-sources-general-face ((t (nil))))
- (ecb-token-header-face ((t (:background "SeaGreen1"))))
- (ecb-type-token-class-face ((t (:bold t :size "10pt"))))
- (ecb-type-token-enum-face ((t (:bold t :size "10pt"))))
- (ecb-type-token-group-face ((t (:bold t :size "10pt" :foreground "dimgray"))))
- (ecb-type-token-interface-face ((t (:bold t :size "10pt"))))
- (ecb-type-token-struct-face ((t (:bold t :size "10pt"))))
- (ecb-type-token-typedef-face ((t (:bold t :size "10pt"))))
- (font-lock-builtin-face ((t (:foreground "red3"))))
- (font-lock-constant-face ((t (:foreground "blue3"))))
- (font-lock-comment-face ((t (:foreground "blue"))))
- (font-lock-doc-face ((t (:foreground "green4"))))
- (font-lock-doc-string-face ((t (:foreground "green4"))))
- (font-lock-function-name-face ((t (nil))))
- (font-lock-keyword-face ((t (nil))))
- (font-lock-preprocessor-face ((t (:foreground "blue3"))))
- (font-lock-reference-face ((t (:foreground "red3"))))
- (font-lock-string-face ((t (nil))))
- (font-lock-type-face ((t (nil))))
- (font-lock-variable-name-face ((t (nil))))
- (font-lock-warning-face ((t (nil))))
- (green ((t (:foreground "green"))))
- (gui-button-face ((t (:background "grey75"))))
- (gui-element ((t (:size "8pt" :background "gray75"))))
- (highlight ((t (:background "darkseagreen2"))))
- (isearch ((t (:background "paleturquoise"))))
- (isearch-secondary ((t (:foreground "red3"))))
- (italic ((t (:size "10pt"))))
- (left-margin ((t (nil))))
- (list-mode-item-selected ((t (:background "gray68"))))
- (modeline ((t (:background "gray75"))))
- (modeline-buffer-id ((t (:background "gray75" :foreground "blue4"))))
- (modeline-mousable ((t (:background "gray75" :foreground "firebrick"))))
- (modeline-mousable-minor-mode ((t (:background "gray75" :foreground "green4"))))
- (paren-blink-off ((t (:foreground "gray"))))
- (paren-match ((t (:background "darkseagreen2"))))
- (paren-mismatch ((t (nil))))
- (pointer ((t (nil))))
- (primary-selection ((t (:background "gray65"))))
- (red ((t (:foreground "red"))))
- (region ((t (:background "gray65"))))
- (right-margin ((t (nil))))
- (secondary-selection ((t (:background "paleturquoise"))))
- (semantic-dirty-token-face ((t (nil))))
- (semantic-unmatched-syntax-face ((t (nil))))
- (text-cursor ((t (:background "red" :foreground "gray"))))
- (toolbar ((t (:background "gray75"))))
- (underline ((t (:underline t))))
- (vertical-divider ((t (:background "gray75"))))
- (widget ((t (:size "8pt" :background "gray75"))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85"))))
- (widget-inactive-face ((t (nil))))
- (yellow ((t (:foreground "yellow"))))
- (zmacs-region ((t (:background "gray65")))))))
-
-(defun color-theme-dark-blue2 ()
- "Color theme by Chris McMahan, created 2002-04-12.
-Includes antlr, bbdb, change-log, comint, cperl, custom cvs, diff,
-dired, display-time, ebrowse, ecb, ediff, erc, eshell, fl, font-lock,
-gnus, hi, highlight, html-helper, hyper-apropos, info, isearch, jde,
-message, mmm, paren, semantic, senator, sgml, smerge, speedbar,
-strokes, term, vhdl, viper, vm, widget, xref, xsl, xxml. Yes, it is
-a large theme."
- (interactive)
- (color-theme-install
- '(color-theme-dark-blue2
- ((background-color . "#233b5a")
- (background-mode . dark)
- (background-toolbar-color . "#cf3ccf3ccf3c")
- (border-color . "black")
- (bottom-toolbar-shadow-color . "#79e77df779e7")
- (cursor-color . "Yellow")
- (foreground-color . "#fff8dc")
- (mouse-color . "Grey")
- (top-toolbar-shadow-color . "#fffffbeeffff")
- (viper-saved-cursor-color-in-replace-mode . "Red3"))
- ((blank-space-face . blank-space-face)
- (blank-tab-face . blank-tab-face)
- (cperl-invalid-face . underline)
- (ecb-directories-general-face . ecb-directories-general-face)
- (ecb-directory-face . ecb-directory-face)
- (ecb-history-face . ecb-history-face)
- (ecb-history-general-face . ecb-history-general-face)
- (ecb-method-face . ecb-method-face)
- (ecb-methods-general-face . ecb-methods-general-face)
- (ecb-source-face . ecb-source-face)
- (ecb-source-in-directories-buffer-face . ecb-sources-face)
- (ecb-sources-general-face . ecb-sources-general-face)
- (ecb-token-header-face . ecb-token-header-face)
- (gnus-article-button-face . bold)
- (gnus-article-mouse-face . highlight)
- (gnus-cite-attribution-face . gnus-cite-attribution-face)
- (gnus-signature-face . gnus-signature-face)
- (gnus-summary-selected-face . gnus-summary-selected-face)
- (help-highlight-face . underline)
- (highline-face . highline-face)
- (highline-vertical-face . highline-vertical-face)
- (list-matching-lines-face . bold)
- (ps-zebra-color . 0.95)
- (senator-eldoc-use-color . t)
- (sgml-set-face . t)
- (tags-tag-face . default)
- (view-highlight-face . highlight)
- (vm-highlight-url-face . bold-italic)
- (vm-highlighted-header-face . bold)
- (vm-mime-button-face . gui-button-face)
- (vm-summary-highlight-face . bold)
- (widget-mouse-face . highlight))
- (default ((t (:stipple nil :background "#233b5a" :foreground "#fff8dc" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "outline-lucida console"))))
- (Info-title-1-face ((t (:bold t :weight bold :height 1.728 :family "helv"))))
- (Info-title-2-face ((t (:bold t :weight bold :height 1.44 :family "helv"))))
- (Info-title-3-face ((t (:bold t :weight bold :height 1.2 :family "helv"))))
- (Info-title-4-face ((t (:bold t :weight bold :family "helv"))))
- (antlr-font-lock-keyword-face ((t (:bold t :foreground "Gray85" :weight bold))))
- (antlr-font-lock-literal-face ((t (:bold t :foreground "Gray85" :weight bold))))
- (antlr-font-lock-ruledef-face ((t (:bold t :foreground "Gray85" :weight bold))))
- (antlr-font-lock-ruleref-face ((t (:foreground "Gray85"))))
- (antlr-font-lock-tokendef-face ((t (:bold t :foreground "Gray85" :weight bold))))
- (antlr-font-lock-tokenref-face ((t (:foreground "Gray85"))))
- (bbdb-company ((t (:italic t :slant italic))))
- (bbdb-field-name ((t (:bold t :weight bold))))
- (bbdb-field-value ((t (nil))))
- (bbdb-name ((t (:underline t))))
- (bg:erc-color-face0 ((t (:background "White"))))
- (bg:erc-color-face1 ((t (:background "black"))))
- (bg:erc-color-face10 ((t (:background "lightblue1"))))
- (bg:erc-color-face11 ((t (:background "cyan"))))
- (bg:erc-color-face12 ((t (:background "blue"))))
- (bg:erc-color-face13 ((t (:background "deeppink"))))
- (bg:erc-color-face14 ((t (:background "gray50"))))
- (bg:erc-color-face15 ((t (:background "gray90"))))
- (bg:erc-color-face2 ((t (:background "blue4"))))
- (bg:erc-color-face3 ((t (:background "green4"))))
- (bg:erc-color-face4 ((t (:background "red"))))
- (bg:erc-color-face5 ((t (:background "brown"))))
- (bg:erc-color-face6 ((t (:background "purple"))))
- (bg:erc-color-face7 ((t (:background "orange"))))
- (bg:erc-color-face8 ((t (:background "yellow"))))
- (bg:erc-color-face9 ((t (:background "green"))))
- (blank-space-face ((t (:background "LightGray"))))
- (blank-tab-face ((t (:background "Wheat"))))
- (blue ((t (:foreground "blue"))))
- (bold ((t (:bold t :foreground "cyan" :weight bold))))
- (bold-italic ((t (:italic t :bold t :foreground "cyan2" :slant italic :weight bold))))
- (border ((t (:background "black"))))
- (border-glyph ((t (nil))))
- (buffers-tab ((t (:background "gray30" :foreground "LightSkyBlue"))))
- (calendar-today-face ((t (:underline t))))
- (change-log-acknowledgement-face ((t (:foreground "firebrick"))))
- (change-log-conditionals-face ((t (:background "sienna" :foreground "khaki"))))
- (change-log-date-face ((t (:foreground "gold"))))
- (change-log-email-face ((t (:foreground "khaki" :underline t))))
- (change-log-file-face ((t (:bold t :foreground "lemon chiffon" :weight bold))))
- (change-log-function-face ((t (:background "sienna" :foreground "khaki"))))
- (change-log-list-face ((t (:foreground "wheat"))))
- (change-log-name-face ((t (:bold t :foreground "light goldenrod" :weight bold))))
- (comint-highlight-input ((t (:bold t :weight bold))))
- (comint-highlight-prompt ((t (:foreground "cyan"))))
- (comint-input-face ((t (:foreground "deepskyblue"))))
- (cperl-array-face ((t (:bold t :background "lightyellow2" :foreground "Blue" :weight bold))))
- (cperl-hash-face ((t (:italic t :bold t :background "lightyellow2" :foreground "Red" :slant italic :weight bold))))
- (cperl-invalid-face ((t (:foreground "white"))))
- (cperl-nonoverridable-face ((t (:foreground "chartreuse3"))))
- (cursor ((t (:background "Yellow"))))
- (custom-button-face ((t (:bold t :weight bold))))
- (custom-button-pressed-face ((t (:background "lightgrey" :foreground "gray30"))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-comment-face ((t (:foreground "white"))))
- (custom-comment-tag-face ((t (:foreground "white"))))
- (custom-documentation-face ((t (:foreground "light blue"))))
- (custom-face-tag-face ((t (:underline t))))
- (custom-group-tag-face ((t (:bold t :foreground "gray85" :underline t :weight bold))))
- (custom-group-tag-face-1 ((t (:foreground "gray85" :underline t))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "gray30" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "gray85"))))
- (custom-variable-button-face ((t (:bold t :underline t :weight bold))))
- (custom-variable-tag-face ((t (:bold t :foreground "gray85" :underline t :weight bold))))
- (cvs-filename-face ((t (:foreground "white"))))
- (cvs-handled-face ((t (:foreground "pink"))))
- (cvs-header-face ((t (:foreground "green"))))
- (cvs-marked-face ((t (:bold t :foreground "green3" :weight bold))))
- (cvs-msg-face ((t (:foreground "gray85"))))
- (cvs-need-action-face ((t (:foreground "yellow"))))
- (cvs-unknown-face ((t (:foreground "grey"))))
- (cyan ((t (:foreground "cyan"))))
- (diary-face ((t (:bold t :foreground "gray85" :weight bold))))
- (diff-added-face ((t (nil))))
- (diff-changed-face ((t (nil))))
- (diff-context-face ((t (:foreground "grey50"))))
- (diff-file-header-face ((t (:bold t :background "grey70" :weight bold))))
- (diff-function-face ((t (:foreground "grey50"))))
- (diff-header-face ((t (:foreground "lemon chiffon"))))
- (diff-hunk-header-face ((t (:background "grey85"))))
- (diff-index-face ((t (:bold t :background "grey70" :weight bold))))
- (diff-nonexistent-face ((t (:bold t :background "grey70" :weight bold))))
- (diff-removed-face ((t (nil))))
- (dired-face-boring ((t (:foreground "Gray65"))))
- (dired-face-directory ((t (:bold t :weight bold))))
- (dired-face-executable ((t (:foreground "gray85"))))
- (dired-face-flagged ((t (:background "LightSlateGray"))))
- (dired-face-header ((t (:background "grey75" :foreground "gray30"))))
- (dired-face-marked ((t (:background "PaleVioletRed"))))
- (dired-face-permissions ((t (:background "grey75" :foreground "gray30"))))
- (dired-face-setuid ((t (:foreground "gray85"))))
- (dired-face-socket ((t (:foreground "gray85"))))
- (dired-face-symlink ((t (:foreground "cyan"))))
- (display-time-mail-balloon-enhance-face ((t (:background "orange"))))
- (display-time-mail-balloon-gnus-group-face ((t (:foreground "blue"))))
- (display-time-time-balloon-face ((t (:foreground "gray85"))))
- (ebrowse-default-face ((t (nil))))
- (ebrowse-file-name-face ((t (:italic t :slant italic))))
- (ebrowse-member-attribute-face ((t (:foreground "red"))))
- (ebrowse-member-class-face ((t (:foreground "Gray85"))))
- (ebrowse-progress-face ((t (:background "blue"))))
- (ebrowse-root-class-face ((t (:bold t :foreground "Gray85" :weight bold))))
- (ebrowse-tree-mark-face ((t (:foreground "Gray85"))))
- (ecb-bucket-token-face ((t (:bold t :weight bold))))
- (ecb-default-general-face ((t (:height 1.0))))
- (ecb-default-highlight-face ((t (:background "magenta" :height 1.0))))
- (ecb-directories-general-face ((t (:height 0.9))))
- (ecb-directory-face ((t (:background "Cyan4"))))
- (ecb-history-face ((t (:background "Cyan4"))))
- (ecb-history-general-face ((t (:height 0.9))))
- (ecb-method-face ((t (:background "Cyan4" :slant normal :weight normal))))
- (ecb-methods-general-face ((t (:slant normal))))
- (ecb-source-face ((t (:background "Cyan4"))))
- (ecb-source-in-directories-buffer-face ((t (:foreground "LightBlue1"))))
- (ecb-sources-face ((t (:foreground "LightBlue1"))))
- (ecb-sources-general-face ((t (:height 0.9))))
- (ecb-token-header-face ((t (:background "Steelblue4"))))
- (ecb-type-token-class-face ((t (:bold t :weight bold))))
- (ecb-type-token-enum-face ((t (:bold t :weight bold))))
- (ecb-type-token-group-face ((t (:bold t :foreground "dim gray" :weight bold))))
- (ecb-type-token-interface-face ((t (:bold t :weight bold))))
- (ecb-type-token-struct-face ((t (:bold t :weight bold))))
- (ecb-type-token-typedef-face ((t (:bold t :weight bold))))
- (ediff-current-diff-face-A ((t (:background "pale green" :foreground "firebrick"))))
- (ediff-current-diff-face-Ancestor ((t (:background "VioletRed" :foreground "Gray30"))))
- (ediff-current-diff-face-B ((t (:background "Yellow" :foreground "DarkOrchid"))))
- (ediff-current-diff-face-C ((t (:background "Pink" :foreground "Navy"))))
- (ediff-even-diff-face-A ((t (:background "light grey" :foreground "Gray30"))))
- (ediff-even-diff-face-Ancestor ((t (:background "Grey" :foreground "White"))))
- (ediff-even-diff-face-B ((t (:background "Grey" :foreground "White"))))
- (ediff-even-diff-face-C ((t (:background "light grey" :foreground "Gray30"))))
- (ediff-fine-diff-face-A ((t (:background "sky blue" :foreground "Navy"))))
- (ediff-fine-diff-face-Ancestor ((t (:background "Green" :foreground "Gray30"))))
- (ediff-fine-diff-face-B ((t (:background "cyan" :foreground "Gray30"))))
- (ediff-fine-diff-face-C ((t (:background "Turquoise" :foreground "Gray30"))))
- (ediff-odd-diff-face-A ((t (:background "Grey" :foreground "White"))))
- (ediff-odd-diff-face-Ancestor ((t (:background "light grey" :foreground "Gray30"))))
- (ediff-odd-diff-face-B ((t (:background "light grey" :foreground "Gray30"))))
- (ediff-odd-diff-face-C ((t (:background "Grey" :foreground "White"))))
- (erc-action-face ((t (:bold t :weight bold))))
- (erc-bold-face ((t (:bold t :weight bold))))
- (erc-dangerous-host-face ((t (:foreground "red"))))
- (erc-default-face ((t (nil))))
- (erc-direct-msg-face ((t (:foreground "pale green"))))
- (erc-error-face ((t (:bold t :foreground "gray85" :weight bold))))
- (erc-fool-face ((t (:foreground "Gray85"))))
- (erc-highlight-face ((t (:bold t :foreground "pale green" :weight bold))))
- (erc-input-face ((t (:foreground "light blue"))))
- (erc-inverse-face ((t (:background "Black" :foreground "White"))))
- (erc-keyword-face ((t (:bold t :foreground "pale green" :weight bold))))
- (erc-notice-face ((t (:foreground "light salmon"))))
- (erc-pal-face ((t (:foreground "pale green"))))
- (erc-prompt-face ((t (:bold t :foreground "light blue" :weight bold))))
- (erc-timestamp-face ((t (:bold t :foreground "green" :weight bold))))
- (erc-underline-face ((t (:underline t))))
- (eshell-ls-archive-face ((t (:bold t :weight bold))))
- (eshell-ls-backup-face ((t (:foreground "gray85"))))
- (eshell-ls-clutter-face ((t (:bold t :foreground "gray85" :weight bold))))
- (eshell-ls-directory-face ((t (:bold t :foreground "Cyan" :weight bold))))
- (eshell-ls-executable-face ((t (:bold t :weight bold))))
- (eshell-ls-missing-face ((t (:bold t :weight bold))))
- (eshell-ls-picture-face ((t (:foreground "gray85"))))
- (eshell-ls-product-face ((t (:foreground "gray85"))))
- (eshell-ls-readonly-face ((t (:foreground "gray70"))))
- (eshell-ls-special-face ((t (:bold t :weight bold))))
- (eshell-ls-symlink-face ((t (:bold t :weight bold))))
- (eshell-ls-text-face ((t (:foreground "gray85"))))
- (eshell-ls-todo-face ((t (:bold t :weight bold))))
- (eshell-ls-unreadable-face ((t (:foreground "gray85"))))
- (eshell-prompt-face ((t (:bold t :foreground "Yellow" :weight bold))))
- (eshell-test-failed-face ((t (:bold t :weight bold))))
- (eshell-test-ok-face ((t (:bold t :weight bold))))
- (excerpt ((t (:italic t :slant italic))))
- (ff-paths-non-existant-file-face ((t (:bold t :foreground "gray85" :weight bold))))
- (fg:black ((t (:foreground "black"))))
- (fg:erc-color-face0 ((t (:foreground "White"))))
- (fg:erc-color-face1 ((t (:foreground "black"))))
- (fg:erc-color-face10 ((t (:foreground "lightblue1"))))
- (fg:erc-color-face11 ((t (:foreground "cyan"))))
- (fg:erc-color-face12 ((t (:foreground "blue"))))
- (fg:erc-color-face13 ((t (:foreground "deeppink"))))
- (fg:erc-color-face14 ((t (:foreground "gray50"))))
- (fg:erc-color-face15 ((t (:foreground "gray90"))))
- (fg:erc-color-face2 ((t (:foreground "blue4"))))
- (fg:erc-color-face3 ((t (:foreground "green4"))))
- (fg:erc-color-face4 ((t (:foreground "red"))))
- (fg:erc-color-face5 ((t (:foreground "brown"))))
- (fg:erc-color-face6 ((t (:foreground "purple"))))
- (fg:erc-color-face7 ((t (:foreground "orange"))))
- (fg:erc-color-face8 ((t (:foreground "yellow"))))
- (fg:erc-color-face9 ((t (:foreground "green"))))
- (fixed ((t (:bold t :weight bold))))
- (fixed-pitch ((t (:family "outline-lucida console"))))
- (fl-comment-face ((t (:foreground "gray85"))))
- (fl-function-name-face ((t (:foreground "green"))))
- (fl-keyword-face ((t (:foreground "LightGreen"))))
- (fl-string-face ((t (:foreground "light coral"))))
- (fl-type-face ((t (:foreground "cyan"))))
- (flyspell-duplicate-face ((t (:bold t :foreground "Gold3" :underline t :weight bold))))
- (flyspell-incorrect-face ((t (:bold t :foreground "OrangeRed" :underline t :weight bold))))
- (font-latex-bold-face ((t (nil))))
- (font-latex-italic-face ((t (nil))))
- (font-latex-math-face ((t (nil))))
- (font-latex-sedate-face ((t (:foreground "Gray85"))))
- (font-latex-string-face ((t (:foreground "orange"))))
- (font-latex-warning-face ((t (:foreground "gold"))))
- (font-lock-builtin-face ((t (:bold t :foreground "LightSteelBlue" :weight bold))))
- (font-lock-comment-face ((t (:italic t :foreground "medium aquamarine" :slant italic))))
- (font-lock-constant-face ((t (:bold t :foreground "Aquamarine" :weight bold))))
- (font-lock-doc-face ((t (:bold t :weight bold))))
- (font-lock-doc-string-face ((t (:bold t :foreground "aquamarine" :weight bold))))
- (font-lock-exit-face ((t (:foreground "green"))))
- (font-lock-function-name-face ((t (:italic t :bold t :foreground "LightSkyBlue" :slant italic :weight bold))))
- (font-lock-keyword-face ((t (:bold t :foreground "Cyan" :weight bold))))
- (font-lock-preprocessor-face ((t (:foreground "Gray85"))))
- (font-lock-reference-face ((t (:foreground "cyan"))))
- (font-lock-string-face ((t (:italic t :foreground "aquamarine" :slant italic))))
- (font-lock-type-face ((t (:bold t :foreground "PaleGreen" :weight bold))))
- (font-lock-variable-name-face ((t (:italic t :bold t :foreground "LightGoldenrod" :slant italic :weight bold))))
- (font-lock-warning-face ((t (:bold t :foreground "Salmon" :weight bold))))
- (fringe ((t (:background "#3c5473"))))
- (gnus-cite-attribution-face ((t (:italic t :bold t :foreground "beige" :underline t :slant italic :weight bold))))
- (gnus-cite-face-1 ((t (:foreground "gold"))))
- (gnus-cite-face-10 ((t (:foreground "coral"))))
- (gnus-cite-face-11 ((t (:foreground "turquoise"))))
- (gnus-cite-face-2 ((t (:foreground "wheat"))))
- (gnus-cite-face-3 ((t (:foreground "light pink"))))
- (gnus-cite-face-4 ((t (:foreground "khaki"))))
- (gnus-cite-face-5 ((t (:foreground "pale green"))))
- (gnus-cite-face-6 ((t (:foreground "beige"))))
- (gnus-cite-face-7 ((t (:foreground "orange"))))
- (gnus-cite-face-8 ((t (:foreground "magenta"))))
- (gnus-cite-face-9 ((t (:foreground "violet"))))
- (gnus-emphasis-bold ((t (:bold t :foreground "light gray" :weight bold))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t :foreground "cyan" :slant italic :weight bold))))
- (gnus-emphasis-highlight-words ((t (:background "gray30" :foreground "gold"))))
- (gnus-emphasis-italic ((t (:italic t :foreground "cyan" :slant italic))))
- (gnus-emphasis-underline ((t (:foreground "white" :underline t))))
- (gnus-emphasis-underline-bold ((t (:bold t :foreground "white" :underline t :weight bold))))
- (gnus-emphasis-underline-bold-italic ((t (:italic t :bold t :foreground "white" :underline t :slant italic :weight bold))))
- (gnus-emphasis-underline-italic ((t (:italic t :foreground "white" :underline t :slant italic))))
- (gnus-filterhist-face-1 ((t (nil))))
- (gnus-group-mail-1-empty-face ((t (:foreground "Magenta"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "Magenta" :weight bold))))
- (gnus-group-mail-2-empty-face ((t (:foreground "aquamarine2"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "aquamarine2" :weight bold))))
- (gnus-group-mail-3-empty-face ((t (:foreground "Cyan"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "Cyan" :weight bold))))
- (gnus-group-mail-low-empty-face ((t (:foreground "Wheat"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "Gray85" :weight bold))))
- (gnus-group-news-1-empty-face ((t (:foreground "PaleTurquoise"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "PaleTurquoise" :weight bold))))
- (gnus-group-news-2-empty-face ((t (:foreground "turquoise"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "turquoise" :weight bold))))
- (gnus-group-news-3-empty-face ((t (:foreground "wheat"))))
- (gnus-group-news-3-face ((t (:bold t :foreground "Wheat" :weight bold))))
- (gnus-group-news-4-empty-face ((t (:foreground "Aquamarine"))))
- (gnus-group-news-4-face ((t (:bold t :weight bold))))
- (gnus-group-news-5-empty-face ((t (:foreground "MediumAquamarine"))))
- (gnus-group-news-5-face ((t (:bold t :weight bold))))
- (gnus-group-news-6-empty-face ((t (:foreground "MediumAquamarine"))))
- (gnus-group-news-6-face ((t (:bold t :weight bold))))
- (gnus-group-news-low-empty-face ((t (:foreground "MediumAquamarine"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "MediumAquamarine" :weight bold))))
- (gnus-header-content-face ((t (:italic t :foreground "Wheat" :slant italic))))
- (gnus-header-from-face ((t (:bold t :foreground "light yellow" :weight bold))))
- (gnus-header-name-face ((t (:bold t :foreground "Wheat" :weight bold))))
- (gnus-header-newsgroups-face ((t (:italic t :bold t :foreground "gold" :slant italic :weight bold))))
- (gnus-header-subject-face ((t (:bold t :foreground "Gold" :weight bold))))
- (gnus-picons-face ((t (:background "white" :foreground "gray30"))))
- (gnus-picons-xbm-face ((t (:background "white" :foreground "gray30"))))
- (gnus-signature-face ((t (:italic t :foreground "white" :slant italic))))
- (gnus-splash ((t (:foreground "Brown"))))
- (gnus-splash-face ((t (:foreground "orange"))))
- (gnus-summary-cancelled-face ((t (:background "gray30" :foreground "orange"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "SkyBlue" :weight bold))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "gray85" :weight bold))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "coral" :weight bold))))
- (gnus-summary-high-unread-face ((t (:italic t :bold t :foreground "gold" :slant italic :weight bold))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "SkyBlue" :slant italic))))
- (gnus-summary-low-read-face ((t (:italic t :foreground "gray85" :slant italic))))
- (gnus-summary-low-ticked-face ((t (:italic t :bold t :foreground "coral" :slant italic :weight bold))))
- (gnus-summary-low-unread-face ((t (:italic t :foreground "white" :slant italic))))
- (gnus-summary-normal-ancient-face ((t (:foreground "SkyBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "gray70"))))
- (gnus-summary-normal-ticked-face ((t (:bold t :foreground "pink" :weight bold))))
- (gnus-summary-normal-unread-face ((t (:bold t :foreground "gray85" :weight bold))))
- (gnus-summary-selected-face ((t (:foreground "white" :underline t))))
- (gnus-x-face ((t (:background "white" :foreground "gray30"))))
- (green ((t (:foreground "green"))))
- (gui-button-face ((t (:background "grey75" :foreground "gray30"))))
- (gui-element ((t (:background "Gray80"))))
- (header-line ((t (:background "grey20" :foreground "grey90"))))
- (hi-black-b ((t (:bold t :weight bold))))
- (hi-black-hb ((t (:bold t :weight bold :height 1.67 :family "helv"))))
- (hi-blue ((t (:background "light blue"))))
- (hi-blue-b ((t (:bold t :foreground "blue" :weight bold))))
- (hi-green ((t (:background "green"))))
- (hi-green-b ((t (:bold t :foreground "green" :weight bold))))
- (hi-pink ((t (:background "pink"))))
- (hi-red-b ((t (:bold t :foreground "red" :weight bold))))
- (hi-yellow ((t (:background "yellow"))))
- (highlight ((t (:background "SkyBlue3"))))
- (highlight-changes-delete-face ((t (:foreground "gray85" :underline t))))
- (highlight-changes-face ((t (:foreground "gray85"))))
- (highline-face ((t (:background "#3c5473"))))
- (highline-vertical-face ((t (:background "lightcyan"))))
- (holiday-face ((t (:background "pink" :foreground "gray30"))))
- (html-helper-bold-face ((t (:bold t :weight bold))))
- (html-helper-bold-italic-face ((t (nil))))
- (html-helper-builtin-face ((t (:foreground "gray85" :underline t))))
- (html-helper-italic-face ((t (:bold t :foreground "yellow" :weight bold))))
- (html-helper-underline-face ((t (:underline t))))
- (html-tag-face ((t (:bold t :weight bold))))
- (hyper-apropos-documentation ((t (:foreground "white"))))
- (hyper-apropos-heading ((t (:bold t :weight bold))))
- (hyper-apropos-hyperlink ((t (:foreground "sky blue"))))
- (hyper-apropos-major-heading ((t (:bold t :weight bold))))
- (hyper-apropos-section-heading ((t (:bold t :weight bold))))
- (hyper-apropos-warning ((t (:bold t :foreground "gray85" :weight bold))))
- (ibuffer-marked-face ((t (:foreground "gray85"))))
- (idlwave-help-link-face ((t (:foreground "Blue"))))
- (idlwave-shell-bp-face ((t (:background "Pink" :foreground "Black"))))
- (info-header-node ((t (:italic t :bold t :foreground "brown" :slant italic :weight bold))))
- (info-header-xref ((t (:bold t :foreground "magenta4" :weight bold))))
- (info-menu-5 ((t (:underline t))))
- (info-menu-6 ((t (nil))))
- (info-menu-header ((t (:bold t :weight bold :family "helv"))))
- (info-node ((t (:italic t :bold t :slant italic :weight bold))))
- (info-xref ((t (:bold t :weight bold))))
- (isearch ((t (:background "LightSeaGreen"))))
- (isearch-lazy-highlight-face ((t (:background "cyan4"))))
- (isearch-secondary ((t (:foreground "red3"))))
- (italic ((t (:italic t :bold t :slant italic :weight bold))))
- (jde-bug-breakpoint-cursor ((t (:background "brown" :foreground "cyan"))))
- (jde-bug-breakpoint-marker ((t (:background "yellow" :foreground "red"))))
- (jde-java-font-lock-api-face ((t (:foreground "LightBlue"))))
- (jde-java-font-lock-bold-face ((t (:bold t :weight bold))))
- (jde-java-font-lock-code-face ((t (nil))))
- (jde-java-font-lock-constant-face ((t (:foreground "LightBlue"))))
- (jde-java-font-lock-doc-tag-face ((t (:foreground "LightBlue"))))
- (jde-java-font-lock-italic-face ((t (:italic t :slant italic))))
- (jde-java-font-lock-link-face ((t (:foreground "cyan3" :underline t))))
- (jde-java-font-lock-modifier-face ((t (:foreground "LightBlue"))))
- (jde-java-font-lock-number-face ((t (:foreground "RosyBrown"))))
- (jde-java-font-lock-operator-face ((t (:foreground "cyan3"))))
- (jde-java-font-lock-package-face ((t (:foreground "LightBlue"))))
- (jde-java-font-lock-pre-face ((t (nil))))
- (jde-java-font-lock-underline-face ((t (:underline t))))
- (lazy-highlight-face ((t (:bold t :foreground "yellow" :weight bold))))
- (left-margin ((t (nil))))
- (linemenu-face ((t (:background "gray30"))))
- (list-mode-item-selected ((t (:background "gray68"))))
- (log-view-file-face ((t (:bold t :background "grey70" :weight bold))))
- (log-view-message-face ((t (:background "grey85"))))
- (magenta ((t (:foreground "gray85"))))
- (makefile-space-face ((t (:background "hotpink" :foreground "white"))))
- (man-bold ((t (:bold t :weight bold))))
- (man-heading ((t (:bold t :weight bold))))
- (man-italic ((t (:foreground "yellow"))))
- (man-xref ((t (:underline t))))
- (menu ((t (:background "wheat" :foreground "gray30"))))
- (message-cited-text ((t (:foreground "orange"))))
- (message-cited-text-face ((t (:foreground "medium aquamarine"))))
- (message-header-cc-face ((t (:bold t :foreground "gray85" :weight bold))))
- (message-header-contents ((t (:foreground "white"))))
- (message-header-name-face ((t (:foreground "gray85"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "yellow" :slant italic :weight bold))))
- (message-header-other-face ((t (:foreground "gray85"))))
- (message-header-subject-face ((t (:bold t :foreground "green3" :weight bold))))
- (message-header-to-face ((t (:bold t :foreground "green2" :weight bold))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-headers ((t (:bold t :foreground "orange" :weight bold))))
- (message-highlighted-header-contents ((t (:bold t :weight bold))))
- (message-mml-face ((t (:bold t :foreground "gray85" :weight bold))))
- (message-separator-face ((t (:foreground "gray85"))))
- (message-url ((t (:bold t :foreground "pink" :weight bold))))
- (mmm-default-submode-face ((t (:background "#c0c0c5"))))
- (mmm-face ((t (:background "black" :foreground "green"))))
- (modeline ((t (:background "#3c5473" :foreground "lightgray" :box (:line-width -1 :style released-button :family "helv")))))
- (modeline-buffer-id ((t (:background "white" :foreground "DeepSkyBlue3" :slant normal :weight normal :width normal :family "outline-verdana"))))
- (modeline-mousable ((t (:background "white" :foreground "DeepSkyBlue3"))))
- (modeline-mousable-minor-mode ((t (:background "white" :foreground "DeepSkyBlue3"))))
- (mouse ((t (:background "Grey"))))
- (my-summary-highlight-face ((t (:background "PaleTurquoise4" :foreground "White"))))
- (my-url-face ((t (:foreground "LightBlue"))))
- (nil ((t (nil))))
- (paren-blink-off ((t (:foreground "gray80"))))
- (paren-face-match ((t (:background "turquoise"))))
- (paren-face-mismatch ((t (:background "purple" :foreground "white"))))
- (paren-face-no-match ((t (:background "yellow" :foreground "gray30"))))
- (paren-match ((t (:background "darkseagreen2"))))
- (paren-mismatch ((t (:background "RosyBrown" :foreground "gray30"))))
- (paren-mismatch-face ((t (:bold t :background "white" :foreground "red" :weight bold))))
- (paren-no-match-face ((t (:bold t :background "white" :foreground "red" :weight bold))))
- (pointer ((t (nil))))
- (primary-selection ((t (:background "gray40"))))
- (reb-match-0 ((t (:background "lightblue"))))
- (reb-match-1 ((t (:background "aquamarine"))))
- (reb-match-2 ((t (:background "springgreen"))))
- (reb-match-3 ((t (:background "yellow"))))
- (red ((t (:foreground "red"))))
- (region ((t (:background "Cyan4"))))
- (right-margin ((t (nil))))
- (scroll-bar ((t (:background "grey75"))))
- (secondary-selection ((t (:background "gray60"))))
- (semantic-dirty-token-face ((t (:background "gray10"))))
- (semantic-intangible-face ((t (:foreground "gray25"))))
- (semantic-read-only-face ((t (:background "gray25"))))
- (semantic-unmatched-syntax-face ((t (:underline "red"))))
- (senator-intangible-face ((t (:foreground "gray75"))))
- (senator-momentary-highlight-face ((t (:background "gray70"))))
- (senator-read-only-face ((t (:background "#664444"))))
- (sgml-comment-face ((t (:foreground "dark turquoise"))))
- (sgml-doctype-face ((t (:foreground "turquoise"))))
- (sgml-end-tag-face ((t (:foreground "aquamarine"))))
- (sgml-entity-face ((t (:foreground "gray85"))))
- (sgml-ignored-face ((t (:background "gray60" :foreground "gray40"))))
- (sgml-ms-end-face ((t (:foreground "green"))))
- (sgml-ms-start-face ((t (:foreground "yellow"))))
- (sgml-pi-face ((t (:foreground "lime green"))))
- (sgml-sgml-face ((t (:foreground "brown"))))
- (sgml-short-ref-face ((t (:foreground "deep sky blue"))))
- (sgml-start-tag-face ((t (:foreground "aquamarine"))))
- (sh-heredoc-face ((t (:foreground "tan"))))
- (shell-option-face ((t (:foreground "gray85"))))
- (shell-output-2-face ((t (:foreground "gray85"))))
- (shell-output-3-face ((t (:foreground "gray85"))))
- (shell-output-face ((t (:bold t :weight bold))))
- (shell-prompt-face ((t (:foreground "yellow"))))
- (show-paren-match-face ((t (:bold t :background "turquoise" :weight bold))))
- (show-paren-mismatch-face ((t (:bold t :background "RosyBrown" :foreground "white" :weight bold))))
- (show-tabs-space-face ((t (:foreground "yellow"))))
- (show-tabs-tab-face ((t (:foreground "red"))))
- (smerge-base-face ((t (:foreground "red"))))
- (smerge-markers-face ((t (:background "grey85"))))
- (smerge-mine-face ((t (:foreground "Gray85"))))
- (smerge-other-face ((t (:foreground "darkgreen"))))
- (speedbar-button-face ((t (:bold t :weight bold))))
- (speedbar-directory-face ((t (:bold t :weight bold))))
- (speedbar-file-face ((t (:bold t :weight bold))))
- (speedbar-highlight-face ((t (:background "sea green"))))
- (speedbar-selected-face ((t (:underline t))))
- (speedbar-tag-face ((t (:foreground "yellow"))))
- (strokes-char-face ((t (:background "lightgray"))))
- (swbuff-current-buffer-face ((t (:bold t :foreground "gray85" :weight bold))))
- (template-message-face ((t (:bold t :weight bold))))
- (term-black ((t (:foreground "black"))))
- (term-blackbg ((t (:background "black"))))
- (term-blue ((t (:foreground "blue"))))
- (term-bluebg ((t (:background "blue"))))
- (term-bold ((t (:bold t :weight bold))))
- (term-cyan ((t (:foreground "cyan"))))
- (term-cyanbg ((t (:background "cyan"))))
- (term-default ((t (:background "gray80" :foreground "gray30" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "outline-lucida console"))))
- (term-default-bg ((t (nil))))
- (term-default-bg-inv ((t (nil))))
- (term-default-fg ((t (nil))))
- (term-default-fg-inv ((t (nil))))
- (term-green ((t (:foreground "green"))))
- (term-greenbg ((t (:background "green"))))
- (term-invisible ((t (nil))))
- (term-invisible-inv ((t (nil))))
- (term-magenta ((t (:foreground "magenta"))))
- (term-magentabg ((t (:background "magenta"))))
- (term-red ((t (:foreground "red"))))
- (term-redbg ((t (:background "red"))))
- (term-underline ((t (:underline t))))
- (term-white ((t (:foreground "white"))))
- (term-whitebg ((t (:background "white"))))
- (term-yellow ((t (:foreground "yellow"))))
- (term-yellowbg ((t (:background "yellow"))))
- (tex-math-face ((t (:foreground "RosyBrown"))))
- (texinfo-heading-face ((t (:foreground "Blue"))))
- (text-cursor ((t (:background "Red3" :foreground "gray80"))))
- (tool-bar ((t (:background "grey75" :foreground "black"))))
- (toolbar ((t (:background "Gray80"))))
- (tooltip ((t (:background "lightyellow" :foreground "black"))))
- (trailing-whitespace ((t (:background "red"))))
- (underline ((t (:underline t))))
- (variable-pitch ((t (:family "helv"))))
- (vc-annotate-face-0046FF ((t (:background "black" :foreground "wheat"))))
- (vcursor ((t (:background "cyan" :foreground "blue" :underline t))))
- (vertical-divider ((t (:background "Gray80"))))
- (vhdl-font-lock-attribute-face ((t (:foreground "gray85"))))
- (vhdl-font-lock-directive-face ((t (:foreground "gray85"))))
- (vhdl-font-lock-enumvalue-face ((t (:foreground "gray85"))))
- (vhdl-font-lock-function-face ((t (:foreground "gray85"))))
- (vhdl-font-lock-prompt-face ((t (:bold t :foreground "gray85" :weight bold))))
- (vhdl-font-lock-reserved-words-face ((t (:bold t :foreground "gray85" :weight bold))))
- (vhdl-font-lock-translate-off-face ((t (:background "LightGray"))))
- (vhdl-speedbar-architecture-face ((t (:foreground "gray85"))))
- (vhdl-speedbar-architecture-selected-face ((t (:foreground "gray85" :underline t))))
- (vhdl-speedbar-configuration-face ((t (:foreground "gray85"))))
- (vhdl-speedbar-configuration-selected-face ((t (:foreground "gray85" :underline t))))
- (vhdl-speedbar-entity-face ((t (:foreground "gray85"))))
- (vhdl-speedbar-entity-selected-face ((t (:foreground "gray85" :underline t))))
- (vhdl-speedbar-instantiation-face ((t (:foreground "gray85"))))
- (vhdl-speedbar-instantiation-selected-face ((t (:foreground "gray85" :underline t))))
- (vhdl-speedbar-package-face ((t (:foreground "gray85"))))
- (vhdl-speedbar-package-selected-face ((t (:foreground "gray85" :underline t))))
- (viper-minibuffer-emacs-face ((t (:background "darkseagreen2" :foreground "Black"))))
- (viper-minibuffer-insert-face ((t (:background "pink" :foreground "Black"))))
- (viper-minibuffer-vi-face ((t (:background "grey" :foreground "DarkGreen"))))
- (viper-replace-overlay-face ((t (:background "darkseagreen2" :foreground "Black"))))
- (viper-search-face ((t (:background "khaki" :foreground "Black"))))
- (vm-header-content-face ((t (:italic t :foreground "wheat" :slant italic))))
- (vm-header-from-face ((t (:italic t :foreground "wheat" :slant italic))))
- (vm-header-name-face ((t (:foreground "cyan"))))
- (vm-header-subject-face ((t (:foreground "cyan"))))
- (vm-header-to-face ((t (:italic t :foreground "cyan" :slant italic))))
- (vm-message-cited-face ((t (:foreground "Gray80"))))
- (vm-monochrome-image ((t (:background "white" :foreground "gray30"))))
- (vm-summary-face-1 ((t (:foreground "MediumAquamarine"))))
- (vm-summary-face-2 ((t (:foreground "MediumAquamarine"))))
- (vm-summary-face-3 ((t (:foreground "MediumAquamarine"))))
- (vm-summary-face-4 ((t (:foreground "MediumAquamarine"))))
- (vm-summary-highlight-face ((t (:foreground "White"))))
- (vm-xface ((t (:background "white" :foreground "gray30"))))
- (vmpc-pre-sig-face ((t (:foreground "gray85"))))
- (vmpc-sig-face ((t (:foreground "gray85"))))
- (vvb-face ((t (:background "pink" :foreground "gray30"))))
- (w3m-anchor-face ((t (:bold t :foreground "gray85" :weight bold))))
- (w3m-arrived-anchor-face ((t (:bold t :foreground "gray85" :weight bold))))
- (w3m-header-line-location-content-face ((t (:background "dark olive green" :foreground "wheat"))))
- (w3m-header-line-location-title-face ((t (:background "dark olive green" :foreground "beige"))))
- (white ((t (:foreground "white"))))
- (widget ((t (nil))))
- (widget-button-face ((t (:bold t :weight bold))))
- (widget-button-pressed-face ((t (:foreground "gray85"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85" :foreground "gray30"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (widget-single-line-field-face ((t (:background "dim gray" :foreground "white"))))
- (woman-addition-face ((t (:foreground "orange"))))
- (woman-bold-face ((t (:bold t :weight bold))))
- (woman-italic-face ((t (:foreground "beige"))))
- (woman-unknown-face ((t (:foreground "LightSalmon"))))
- (x-face ((t (:background "white" :foreground "gray30"))))
- (xrdb-option-name-face ((t (:foreground "gray85"))))
- (xref-keyword-face ((t (:foreground "gray85"))))
- (xref-list-default-face ((t (nil))))
- (xref-list-pilot-face ((t (:foreground "gray85"))))
- (xref-list-symbol-face ((t (:foreground "navy"))))
- (xsl-fo-alternate-face ((t (:foreground "Yellow"))))
- (xsl-fo-main-face ((t (:foreground "PaleGreen"))))
- (xsl-other-element-face ((t (:foreground "Coral"))))
- (xsl-xslt-alternate-face ((t (:foreground "LightGray"))))
- (xsl-xslt-main-face ((t (:foreground "Wheat"))))
- (xxml-emph-1-face ((t (:background "lightyellow"))))
- (xxml-emph-2-face ((t (:background "lightyellow"))))
- (xxml-header-1-face ((t (:background "seashell1" :foreground "MediumAquamarine"))))
- (xxml-header-2-face ((t (:background "seashell1" :foreground "SkyBlue"))))
- (xxml-header-3-face ((t (:background "seashell1"))))
- (xxml-header-4-face ((t (:background "seashell1"))))
- (xxml-interaction-face ((t (:background "lightcyan"))))
- (xxml-rug-face ((t (:background "cyan"))))
- (xxml-sparkle-face ((t (:background "yellow"))))
- (xxml-unbreakable-space-face ((t (:foreground "grey" :underline t))))
- (yellow ((t (:foreground "yellow"))))
- (zmacs-region ((t (:background "Cyan4")))))))
-
-(defun color-theme-blue-mood ()
- "Color theme by Nelson Loyola, created 2002-04-15.
-Includes cperl, custom, font-lock, p4, speedbar, widget."
- (interactive)
- (color-theme-install
- '(color-theme-blue-mood
- ((background-color . "DodgerBlue4")
- (background-mode . dark)
- (background-toolbar-color . "#bfbfbfbfbfbf")
- (border-color . "Blue")
- (border-color . "#000000000000")
- (bottom-toolbar-shadow-color . "#6c6c68686868")
- (cursor-color . "DarkGoldenrod1")
- (foreground-color . "white smoke")
- (mouse-color . "black")
- (top-toolbar-shadow-color . "#e5e5e0e0e1e1"))
- ((vc-annotate-very-old-color . "#0046FF"))
- (default ((t (nil))))
- (blue ((t (:foreground "blue"))))
- (bold ((t (:bold t))))
- (bold-italic ((t (nil))))
- (border-glyph ((t (nil))))
- (cmode-bracket-face ((t (:bold t))))
- (cperl-array-face ((t (:bold t :foreground "wheat"))))
- (cperl-hash-face ((t (:bold t :foreground "chartreuse"))))
- (custom-button-face ((t (nil))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:underline t))))
- (custom-group-tag-face ((t (:underline t :foreground "blue"))))
- (custom-group-tag-face-1 ((t (:underline t :foreground "red"))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:bold t :foreground "cyan"))))
- (custom-variable-button-face ((t (:underline t :bold t))))
- (custom-variable-tag-face ((t (:underline t :foreground "blue"))))
- (ff-paths-non-existant-file-face ((t (:bold t :foreground "NavyBlue"))))
- (font-lock-builtin-face ((t (:bold t :foreground "wheat"))))
- (font-lock-comment-face ((t (:bold t :foreground "gray72"))))
- (font-lock-constant-face ((t (:bold t :foreground "cyan3"))))
- (font-lock-doc-string-face ((t (:foreground "#00C000"))))
- (font-lock-function-name-face ((t (:bold t :foreground "chartreuse"))))
- (font-lock-keyword-face ((t (:bold t :foreground "gold1"))))
- (font-lock-other-emphasized-face ((t (:bold t :foreground "gold1"))))
- (font-lock-other-type-face ((t (:bold t :foreground "gold1"))))
- (font-lock-preprocessor-face ((t (:foreground "plum"))))
- (font-lock-reference-face ((t (:bold t :foreground "orangered"))))
- (font-lock-string-face ((t (:foreground "tomato"))))
- (font-lock-type-face ((t (:bold t :foreground "gold1"))))
- (font-lock-variable-name-face ((t (:foreground "light yellow"))))
- (font-lock-warning-face ((t (:foreground "tomato"))))
- (green ((t (:foreground "green"))))
- (gui-button-face ((t (:background "grey75" :foreground "black"))))
- (gui-element ((t (:size "nil" :background "#e7e3d6" :foreground" #000000"))))
- (highlight ((t (:background "red" :foreground "yellow"))))
- (isearch ((t (:bold t :background "pale turquoise" :foreground "blue"))))
- (italic ((t (nil))))
- (lazy-highlight-face ((t (:bold t :foreground "dark magenta"))))
- (left-margin ((t (nil))))
- (list-mode-item-selected ((t (:bold t :background "gray68" :foreground "yellow"))))
- (modeline ((t (:background "goldenrod" :foreground "darkblue"))))
- (modeline-buffer-id ((t (:background "goldenrod" :foreground "darkblue"))))
- (modeline-mousable ((t (:background "goldenrod" :foreground "darkblue"))))
- (modeline-mousable-minor-mode ((t (:background "goldenrod" :foreground "darkblue"))))
- (my-tab-face ((t (:background "SlateBlue1"))))
- (p4-depot-added-face ((t (:foreground "steelblue1"))))
- (p4-depot-deleted-face ((t (:foreground "red"))))
- (p4-depot-unmapped-face ((t (:foreground "grey90"))))
- (p4-diff-change-face ((t (:foreground "dark green"))))
- (p4-diff-del-face ((t (:bold t :foreground "salmon"))))
- (p4-diff-file-face ((t (:background "blue"))))
- (p4-diff-head-face ((t (:background "blue"))))
- (p4-diff-ins-face ((t (:foreground "steelblue1"))))
- (paren-blink-off ((t (:foreground "DodgerBlue4"))))
- (paren-match ((t (:background "red" :foreground "yellow"))))
- (paren-mismatch ((t (:background "DeepPink"))))
- (pointer ((t (:background "white"))))
- (primary-selection ((t (:bold t :background "medium sea green"))))
- (red ((t (:foreground "red"))))
- (region ((t (:background "red" :foreground "yellow"))))
- (right-margin ((t (nil))))
- (secondary-selection ((t (:background "gray91" :foreground "sienna3"))))
- (show-paren-match-face ((t (:background "cyan3" :foreground "blue"))))
- (show-paren-mismatch-face ((t (:background "red" :foreground "blue"))))
- (show-trailing-whitespace ((t (:background "red" :foreground "blue"))))
- (speedbar-button-face ((t (:foreground "white"))))
- (speedbar-directory-face ((t (:foreground "gray"))))
- (speedbar-file-face ((t (:foreground "gold1"))))
- (speedbar-highlight-face ((t (:background "lightslateblue" :foreground "gold1"))))
- (speedbar-selected-face ((t (:underline t :foreground "red"))))
- (speedbar-tag-face ((t (:foreground "chartreuse"))))
- (text-cursor ((t (:background "DarkGoldenrod1" :foreground "DodgerBlue4"))))
- (toolbar ((t (:background "#e7e3d6" :foreground "#000000"))))
- (underline ((t (:underline t))))
- (vertical-divider ((t (:background "#e7e3d6" :foreground "#000000"))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (widget-single-line-field-face ((t (:background "gray85"))))
- (yellow ((t (:foreground "yellow"))))
- (zmacs-region ((t (:background "white" :foreground "midnightblue")))))))
-
-(defun color-theme-euphoria ()
- "Color theme by oGLOWo, created 2000-04-19.
-Green on black theme including font-lock, speedbar, and widget."
- (interactive)
- (color-theme-install
- '(color-theme-euphoria
- ((background-color . "black")
- (background-mode . dark)
- (border-color . "black")
- (cursor-color . "yellow")
- (foreground-color . "#00ff00")
- (mouse-color . "yellow"))
- ((help-highlight-face . underline)
- (list-matching-lines-face . bold)
- (widget-mouse-face . highlight))
- (default ((t (:stipple nil :background "black" :foreground "#00ff00" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "misc-fixed"))))
- (bold ((t (:bold t :weight bold))))
- (bold-italic ((t (:italic t :bold t :slant italic :weight bold))))
- (border ((t (:background "black"))))
- (comint-highlight-input ((t (:bold t :weight bold))))
- (comint-highlight-prompt ((t (:foreground "cyan"))))
- (cursor ((t (:background "yellow"))))
- (fixed-pitch ((t (:family "courier"))))
- (font-lock-builtin-face ((t (:foreground "magenta"))))
- (font-lock-comment-face ((t (:foreground "deeppink"))))
- (font-lock-constant-face ((t (:foreground "blue"))))
- (font-lock-doc-face ((t (:foreground "cyan"))))
- (font-lock-doc-string-face ((t (:foreground "cyan"))))
- (font-lock-function-name-face ((t (:foreground "purple"))))
- (font-lock-keyword-face ((t (:foreground "red"))))
- (font-lock-preprocessor-face ((t (:foreground "blue1"))))
- (font-lock-reference-face ((t (nil))))
- (font-lock-string-face ((t (:foreground "cyan"))))
- (font-lock-type-face ((t (:foreground "yellow"))))
- (font-lock-variable-name-face ((t (:foreground "violet"))))
- (font-lock-warning-face ((t (:bold t :foreground "red" :weight bold))))
- (fringe ((t (:background "gray16" :foreground "#00ff00"))))
- (header-line ((t (:box (:line-width -1 :style released-button) :background "grey20" :foreground "grey90" :box nil))))
- (highlight ((t (:background "darkolivegreen"))))
- (horizontal-divider ((t (:background "gray16" :foreground "#00ff00"))))
- (isearch ((t (:background "palevioletred2" :foreground "brown4"))))
- (isearch-lazy-highlight-face ((t (:background "paleturquoise4"))))
- (italic ((t (:italic t :slant italic))))
- (menu ((t (:background "gray16" :foreground "green"))))
- (modeline ((t (:background "gray16" :foreground "#00ff00" :box (:line-width -1 :style released-button)))))
- (modeline-buffer-id ((t (:background "gray16" :foreground "#00ff00"))))
- (modeline-mousable ((t (:background "gray16" :foreground "#00ff00"))))
- (modeline-mousable-minor-mode ((t (:background "gray16" :foreground "#00ff00"))))
- (mouse ((t (:background "yellow"))))
- (primary-selection ((t (:background "#00ff00" :foreground "black"))))
- (region ((t (:background "steelblue" :foreground "white"))))
- (scroll-bar ((t (:background "gray16" :foreground "#00ff00"))))
- (secondary-selection ((t (:background "#00ff00" :foreground "black"))))
- (show-paren-match-face ((t (:background "turquoise"))))
- (show-paren-mismatch-face ((t (:background "purple" :foreground "white"))))
- (speedbar-button-face ((t (:foreground "#00ff00"))))
- (speedbar-directory-face ((t (:foreground "#00ff00"))))
- (speedbar-file-face ((t (:foreground "cyan"))))
- (speedbar-highlight-face ((t (:background "#00ff00" :foreground "purple"))))
- (speedbar-selected-face ((t (:foreground "deeppink" :underline t))))
- (speedbar-tag-face ((t (:foreground "yellow"))))
- (tool-bar ((t (:background "gray16" :foreground "green" :box (:line-width 1 :style released-button)))))
- (tooltip ((t (:background "gray16" :foreground "#00ff00"))))
- (trailing-whitespace ((t (:background "red"))))
- (underline ((t (:underline t))))
- (variable-pitch ((t (:family "helv"))))
- (vertical-divider ((t (:background "gray16" :foreground "#00ff00"))))
- (widget-button-face ((t (:bold t :weight bold))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "lime green"))))
- (widget-field-face ((t (:background "dim gray"))))
- (widget-inactive-face ((t (:foreground "light gray"))))
- (widget-single-line-field-face ((t (:background "dim gray"))))
- (zmacs-region ((t (:background "steelblue" :foreground "white")))))))
-
-(defun color-theme-resolve ()
- "Color theme by Damien Elmes, created 2002-04-24.
-A white smoke on blue color theme."
- (interactive)
- (color-theme-install
- '(color-theme-resolve
- ((background-color . "#00457f")
- (background-mode . dark)
- (border-color . "black")
- (cursor-color . "DarkGoldenrod1")
- (foreground-color . "white smoke")
- (mouse-color . "white"))
- ((display-time-mail-face . mode-line)
- (help-highlight-face . underline)
- (list-matching-lines-face . bold)
- (view-highlight-face . highlight)
- (widget-mouse-face . highlight))
- (default ((t (:stipple nil :background "#00457f" :foreground "white smoke" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "b&h-lucidatypewriter"))))
- (bold ((t (:bold t :foreground "snow2" :weight bold))))
- (bold-italic ((t (:italic t :bold t :slant italic :weight bold))))
- (border ((t (:background "black"))))
- (calendar-today-face ((t (:underline t))))
- (comint-highlight-input ((t (:bold t :weight bold))))
- (comint-highlight-prompt ((t (:foreground "cyan"))))
- (cperl-array-face ((t (:bold t :foreground "wheat" :weight bold))))
- (cperl-hash-face ((t (:bold t :foreground "chartreuse" :weight bold))))
- (cursor ((t (:background "DarkGoldenrod1"))))
- (diary-face ((t (:foreground "yellow"))))
- (erc-input-face ((t (:foreground "lightblue2"))))
- (erc-notice-face ((t (:foreground "lightyellow3"))))
- (fixed-pitch ((t (:family "courier"))))
- (font-latex-bold-face ((t (:bold t :foreground "DarkOliveGreen" :weight bold))))
- (font-latex-italic-face ((t (:italic t :foreground "DarkOliveGreen" :slant italic))))
- (font-latex-math-face ((t (:foreground "burlywood"))))
- (font-latex-sedate-face ((t (:foreground "LightGray"))))
- (font-latex-string-face ((t (:foreground "RosyBrown"))))
- (font-latex-warning-face ((t (:bold t :foreground "Red" :weight bold))))
- (font-lock-builtin-face ((t (:foreground "wheat"))))
- (font-lock-comment-face ((t (:foreground "light steel blue"))))
- (font-lock-constant-face ((t (:foreground "seashell3"))))
- (font-lock-doc-face ((t (:foreground "plum"))))
- (font-lock-doc-string-face ((t (:foreground "#008000"))))
- (font-lock-function-name-face ((t (:foreground "thistle1"))))
- (font-lock-keyword-face ((t (:foreground "wheat"))))
- (font-lock-other-emphasized-face ((t (:bold t :foreground "gold1" :weight bold))))
- (font-lock-other-type-face ((t (:bold t :foreground "gold1" :weight bold))))
- (font-lock-preprocessor-face ((t (:foreground "#800080"))))
- (font-lock-reference-face ((t (:foreground "wheat"))))
- (font-lock-string-face ((t (:foreground "plum"))))
- (font-lock-type-face ((t (:foreground "lawn green"))))
- (font-lock-variable-name-face ((t (:foreground "light yellow"))))
- (font-lock-warning-face ((t (:foreground "plum"))))
- (fringe ((t (:background "#000000"))))
- (gnus-cite-attribution-face ((t (:italic t :slant italic))))
- (gnus-cite-face-1 ((t (:foreground "light blue"))))
- (gnus-cite-face-10 ((t (:foreground "medium purple"))))
- (gnus-cite-face-11 ((t (:foreground "turquoise"))))
- (gnus-cite-face-2 ((t (:foreground "light cyan"))))
- (gnus-cite-face-3 ((t (:foreground "light yellow"))))
- (gnus-cite-face-4 ((t (:foreground "light pink"))))
- (gnus-cite-face-5 ((t (:foreground "pale green"))))
- (gnus-cite-face-6 ((t (:foreground "beige"))))
- (gnus-cite-face-7 ((t (:foreground "orange"))))
- (gnus-cite-face-8 ((t (:foreground "magenta"))))
- (gnus-cite-face-9 ((t (:foreground "violet"))))
- (gnus-emphasis-bold ((t (:bold t :weight bold))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t :slant italic :weight bold))))
- (gnus-emphasis-highlight-words ((t (:background "black" :foreground "yellow"))))
- (gnus-emphasis-italic ((t (:italic t :slant italic))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:bold t :underline t :weight bold))))
- (gnus-emphasis-underline-bold-italic ((t (:italic t :bold t :underline t :slant italic :weight bold))))
- (gnus-emphasis-underline-italic ((t (:italic t :underline t :slant italic))))
- (gnus-group-mail-1-empty-face ((t (:foreground "aquamarine1"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "aquamarine1" :weight bold))))
- (gnus-group-mail-2-empty-face ((t (:foreground "aquamarine2"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "aquamarine2" :weight bold))))
- (gnus-group-mail-3-empty-face ((t (:foreground "aquamarine3"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "aquamarine3" :weight bold))))
- (gnus-group-mail-low-empty-face ((t (:foreground "aquamarine4"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "aquamarine4" :weight bold))))
- (gnus-group-news-1-empty-face ((t (:foreground "PaleTurquoise"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "PaleTurquoise" :weight bold))))
- (gnus-group-news-2-empty-face ((t (:foreground "turquoise"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "turquoise" :weight bold))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (:bold t :weight bold))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (:bold t :weight bold))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (:bold t :weight bold))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (:bold t :weight bold))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkTurquoise"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "DarkTurquoise" :weight bold))))
- (gnus-header-content-face ((t (:italic t :foreground "snow2" :slant italic))))
- (gnus-header-from-face ((t (:foreground "spring green"))))
- (gnus-header-name-face ((t (:bold t :foreground "snow2" :weight bold))))
- (gnus-header-newsgroups-face ((t (:italic t :foreground "yellow" :slant italic))))
- (gnus-header-subject-face ((t (:bold t :foreground "peach puff" :weight bold))))
- (gnus-signature-face ((t (:italic t :slant italic))))
- (gnus-splash-face ((t (:foreground "Brown"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "SkyBlue" :weight bold))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "PaleGreen" :weight bold))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "pink" :weight bold))))
- (gnus-summary-high-unread-face ((t (:bold t :weight bold))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "SkyBlue" :slant italic))))
- (gnus-summary-low-read-face ((t (:italic t :foreground "PaleGreen" :slant italic))))
- (gnus-summary-low-ticked-face ((t (:italic t :foreground "pink" :slant italic))))
- (gnus-summary-low-unread-face ((t (:italic t :slant italic))))
- (gnus-summary-normal-ancient-face ((t (:foreground "SkyBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "PaleGreen"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "pink"))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-selected-face ((t (:underline t))))
- (header-line ((t (:background "grey20" :foreground "grey90"))))
- (highlight ((t (:background "gray91" :foreground "firebrick"))))
- (highline-face ((t (:background "paleturquoise" :foreground "black"))))
- (holiday-face ((t (:background "chocolate4"))))
- (isearch ((t (:background "palevioletred2" :foreground "brown4"))))
- (isearch-lazy-highlight-face ((t (:background "paleturquoise4"))))
- (italic ((t (:italic t :slant italic))))
- (menu ((t (nil))))
- (message-cited-text-face ((t (:foreground "seashell3"))))
- (message-header-cc-face ((t (:bold t :foreground "snow2" :weight bold))))
- (message-header-name-face ((t (:bold t :foreground "snow1" :weight bold))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "blue4" :slant italic :weight bold))))
- (message-header-other-face ((t (:foreground "snow2"))))
- (message-header-subject-face ((t (:bold t :foreground "snow2" :weight bold))))
- (message-header-to-face ((t (:bold t :foreground "snow2" :weight bold))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-mml-face ((t (:foreground "ForestGreen"))))
- (message-separator-face ((t (:foreground "misty rose"))))
- (modeline ((t (:foreground "white" :background "#001040" :box (:line-width -1 :style released-button)))))
- (modeline-buffer-id ((t (:foreground "white" :background "#001040"))))
- (modeline-mousable ((t (:foreground "white" :background "#001040"))))
- (modeline-mousable-minor-mode ((t (:foreground "white" :background "#001040"))))
- (mouse ((t (:background "white"))))
- (my-tab-face ((t (:background "SlateBlue1"))))
- (p4-diff-del-face ((t (:bold t :foreground "salmon" :weight bold))))
- (primary-selection ((t (:background "gray91" :foreground "DodgerBlue4"))))
- (region ((t (:background "gray91" :foreground "DodgerBlue4"))))
- (scroll-bar ((t (:background "grey75"))))
- (secondary-selection ((t (:background "gray91" :foreground "sienna3"))))
- (show-paren-match-face ((t (:background "cyan3" :foreground "blue"))))
- (show-paren-mismatch-face ((t (:background "red" :foreground "blue"))))
- (tool-bar ((t (:background "grey75" :foreground "black"))))
- (tooltip ((t (:background "lightyellow" :foreground "black"))))
- (trailing-whitespace ((t (:background "red"))))
- (underline ((t (:underline t))))
- (variable-pitch ((t (:family "helv"))))
- (widget-button-face ((t (:bold t :weight bold))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "steel blue"))))
- (widget-inactive-face ((t (:foreground "grey"))))
- (widget-single-line-field-face ((t (:background "gray85"))))
- (zmacs-region ((t (:background "gray91" :foreground "DodgerBlue4")))))))
-
-(defun color-theme-xp ()
- "Color theme by Girish Bharadwaj, created 2002-04-25.
-Includes custom, erc, font-lock, jde, semantic, speedbar, widget."
- (interactive)
- (color-theme-install
- '(color-theme-xp
- ((background-color . "lightyellow2")
- (background-mode . light)
- (border-color . "black")
- (cursor-color . "black")
- (foreground-color . "gray20")
- (mouse-color . "black"))
- ((help-highlight-face . underline)
- (list-matching-lines-face . bold)
- (semantic-which-function-use-color . t)
- (senator-eldoc-use-color . t)
- (view-highlight-face . highlight)
- (widget-mouse-face . highlight))
- (default ((t (:stipple nil :background "lightyellow2" :foreground "gray20" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "outline-courier new"))))
- (bg:erc-color-face0 ((t (:background "White"))))
- (bg:erc-color-face1 ((t (:background "black"))))
- (bg:erc-color-face10 ((t (:background "lightblue1"))))
- (bg:erc-color-face11 ((t (:background "cyan"))))
- (bg:erc-color-face12 ((t (:background "blue"))))
- (bg:erc-color-face13 ((t (:background "deeppink"))))
- (bg:erc-color-face14 ((t (:background "gray50"))))
- (bg:erc-color-face15 ((t (:background "gray90"))))
- (bg:erc-color-face2 ((t (:background "blue4"))))
- (bg:erc-color-face3 ((t (:background "green4"))))
- (bg:erc-color-face4 ((t (:background "red"))))
- (bg:erc-color-face5 ((t (:background "brown"))))
- (bg:erc-color-face6 ((t (:background "purple"))))
- (bg:erc-color-face7 ((t (:background "orange"))))
- (bg:erc-color-face8 ((t (:background "yellow"))))
- (bg:erc-color-face9 ((t (:background "green"))))
- (bold ((t (:bold t :weight bold))))
- (bold-italic ((t (:italic t :bold t :slant italic :weight bold))))
- (border ((t (:background "black"))))
- (button ((t (:underline t))))
- (comint-highlight-input ((t (:bold t :weight bold))))
- (comint-highlight-prompt ((t (:foreground "dark blue"))))
- (cursor ((t (:background "black"))))
- (custom-button-face ((t (:background "lightgrey" :foreground "black" :box (:line-width 2 :style released-button)))))
- (custom-button-pressed-face ((t (:background "lightgrey" :foreground "black" :box (:line-width 2 :style pressed-button)))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-comment-face ((t (:background "gray85"))))
- (custom-comment-tag-face ((t (:foreground "blue4"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:bold t :family "helv" :weight bold :height 1.2))))
- (custom-group-tag-face ((t (:bold t :foreground "blue" :weight bold :height 1.2))))
- (custom-group-tag-face-1 ((t (:bold t :family "helv" :foreground "red" :weight bold :height 1.2))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "dark green"))))
- (custom-variable-button-face ((t (:bold t :underline t :weight bold))))
- (custom-variable-tag-face ((t (:bold t :family "helv" :foreground "blue" :weight bold :height 1.2))))
- (erc-action-face ((t (:bold t :weight bold))))
- (erc-bold-face ((t (:bold t :weight bold))))
- (erc-default-face ((t (nil))))
- (erc-direct-msg-face ((t (:foreground "IndianRed"))))
- (erc-error-face ((t (:background "Red" :foreground "White"))))
- (erc-input-face ((t (:foreground "brown"))))
- (erc-inverse-face ((t (:background "Black" :foreground "White"))))
- (erc-notice-face ((t (:bold t :foreground "SlateBlue" :weight bold))))
- (erc-prompt-face ((t (:bold t :background "lightBlue2" :foreground "Black" :weight bold))))
- (erc-timestamp-face ((t (:bold t :foreground "green" :weight bold))))
- (erc-underline-face ((t (:underline t))))
- (fg:erc-color-face0 ((t (:foreground "White"))))
- (fg:erc-color-face1 ((t (:foreground "black"))))
- (fg:erc-color-face10 ((t (:foreground "lightblue1"))))
- (fg:erc-color-face11 ((t (:foreground "cyan"))))
- (fg:erc-color-face12 ((t (:foreground "blue"))))
- (fg:erc-color-face13 ((t (:foreground "deeppink"))))
- (fg:erc-color-face14 ((t (:foreground "gray50"))))
- (fg:erc-color-face15 ((t (:foreground "gray90"))))
- (fg:erc-color-face2 ((t (:foreground "blue4"))))
- (fg:erc-color-face3 ((t (:foreground "green4"))))
- (fg:erc-color-face4 ((t (:foreground "red"))))
- (fg:erc-color-face5 ((t (:foreground "brown"))))
- (fg:erc-color-face6 ((t (:foreground "purple"))))
- (fg:erc-color-face7 ((t (:foreground "orange"))))
- (fg:erc-color-face8 ((t (:foreground "yellow"))))
- (fg:erc-color-face9 ((t (:foreground "green"))))
- (fixed-pitch ((t (:family "courier"))))
- (font-lock-builtin-face ((t (:foreground "magenta3" :underline t :height 0.9))))
- (font-lock-comment-face ((t (:italic t :foreground "gray60" :slant oblique :height 0.9))))
- (font-lock-constant-face ((t (:bold t :foreground "medium purple" :weight bold :height 0.9))))
- (font-lock-function-name-face ((t (:bold t :foreground "black" :weight bold))))
- (font-lock-keyword-face ((t (:bold t :foreground "blue" :weight bold))))
- (font-lock-string-face ((t (:foreground "red" :height 0.9))))
- (font-lock-type-face ((t (:foreground "Royalblue"))))
- (font-lock-variable-name-face ((t (:bold t :foreground "maroon" :weight bold :height 0.9))))
- (font-lock-warning-face ((t (:bold t :foreground "Red" :weight bold))))
- (fringe ((t (:background "dodgerblue"))))
- (header-line ((t (:underline "red" :overline "red" :background "grey90" :foreground "grey20" :box nil))))
- (highlight ((t (:background "darkseagreen2"))))
- (isearch ((t (:background "magenta2" :foreground "lightskyblue1"))))
- (isearch-lazy-highlight-face ((t (:background "paleturquoise"))))
- (italic ((t (:italic t :slant italic))))
- (jde-bug-breakpoint-cursor ((t (:background "brown" :foreground "cyan"))))
- (jde-db-active-breakpoint-face ((t (:background "red" :foreground "black"))))
- (jde-db-requested-breakpoint-face ((t (:background "yellow" :foreground "black"))))
- (jde-db-spec-breakpoint-face ((t (:background "green" :foreground "black"))))
- (jde-java-font-lock-api-face ((t (:foreground "dark goldenrod"))))
- (jde-java-font-lock-bold-face ((t (:bold t :weight bold))))
- (jde-java-font-lock-code-face ((t (nil))))
- (jde-java-font-lock-constant-face ((t (:foreground "CadetBlue"))))
- (jde-java-font-lock-doc-tag-face ((t (:foreground "green4"))))
- (jde-java-font-lock-italic-face ((t (:italic t :slant italic))))
- (jde-java-font-lock-link-face ((t (:foreground "cadetblue" :underline t :slant normal))))
- (jde-java-font-lock-modifier-face ((t (:foreground "Orchid"))))
- (jde-java-font-lock-number-face ((t (:foreground "RosyBrown"))))
- (jde-java-font-lock-operator-face ((t (:foreground "medium blue"))))
- (jde-java-font-lock-package-face ((t (:foreground "blue3"))))
- (jde-java-font-lock-pre-face ((t (nil))))
- (jde-java-font-lock-underline-face ((t (:underline t))))
- (menu ((t (nil))))
- (minibuffer-prompt ((t (:foreground "dark blue"))))
- (modeline ((t (:background "dodgerblue" :foreground "black" :overline "red" :underline "red"))))
- (modeline-buffer-id ((t (:background "dodgerblue" :foreground "black"))))
- (modeline-mousable ((t (:background "dodgerblue" :foreground "black"))))
- (modeline-mousable-minor-mode ((t (:background "dodgerblue" :foreground "black"))))
- (mode-line-inactive ((t (:italic t :underline "red" :overline "red" :background "white" :foreground "cadetblue" :box (:line-width -1 :color "grey75") :slant oblique :weight light))))
- (mouse ((t (:background "black"))))
- (primary-selection ((t (:background "lightgoldenrod2"))))
- (region ((t (:background "lightgoldenrod2"))))
- (scroll-bar ((t (nil))))
- (secondary-selection ((t (:background "yellow"))))
- (semantic-dirty-token-face ((t (:background "lightyellow"))))
- (semantic-unmatched-syntax-face ((t (:underline "red"))))
- (senator-intangible-face ((t (:foreground "gray25"))))
- (senator-momentary-highlight-face ((t (:background "gray70"))))
- (senator-read-only-face ((t (:background "#CCBBBB"))))
- (show-paren-match-face ((t (:background "turquoise"))))
- (show-paren-mismatch-face ((t (:background "purple" :foreground "white"))))
- (speedbar-button-face ((t (:foreground "green4"))))
- (speedbar-directory-face ((t (:foreground "blue4"))))
- (speedbar-file-face ((t (:foreground "cyan4"))))
- (speedbar-highlight-face ((t (:background "green"))))
- (speedbar-selected-face ((t (:foreground "red" :underline t))))
- (speedbar-tag-face ((t (:foreground "brown"))))
- (template-message-face ((t (:bold t :weight bold))))
- (tool-bar ((t (:background "grey75" :foreground "black" :box (:line-width 1 :style released-button)))))
- (tooltip ((t (:background "lightyellow" :foreground "black"))))
- (trailing-whitespace ((t (:background "red"))))
- (underline ((t (:underline t))))
- (variable-pitch ((t (:family "helv"))))
- (widget-button-face ((t (:bold t :weight bold))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (widget-single-line-field-face ((t (:background "gray85"))))
- (zmacs-region ((t (:background "lightgoldenrod2")))))))
-
-(defun color-theme-gray30 ()
- "Color theme by Girish Bharadwaj, created 2002-04-22."
- (interactive)
- (color-theme-install
- '(color-theme-gray30
- ((background-color . "grey30")
- (background-mode . dark)
- (border-color . "black")
- (cursor-color . "black")
- (foreground-color . "gainsboro")
- (mouse-color . "black"))
- ((help-highlight-face . underline)
- (list-matching-lines-face . bold)
- (semantic-which-function-use-color . t)
- (senator-eldoc-use-color . t)
- (widget-mouse-face . highlight))
- (default ((t (:stipple nil :background "grey30" :foreground "gainsboro" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "outline-courier new"))))
- (bg:erc-color-face0 ((t (:background "White"))))
- (bg:erc-color-face1 ((t (:background "black"))))
- (bg:erc-color-face10 ((t (:background "lightblue1"))))
- (bg:erc-color-face11 ((t (:background "cyan"))))
- (bg:erc-color-face12 ((t (:background "blue"))))
- (bg:erc-color-face13 ((t (:background "deeppink"))))
- (bg:erc-color-face14 ((t (:background "gray50"))))
- (bg:erc-color-face15 ((t (:background "gray90"))))
- (bg:erc-color-face2 ((t (:background "blue4"))))
- (bg:erc-color-face3 ((t (:background "green4"))))
- (bg:erc-color-face4 ((t (:background "red"))))
- (bg:erc-color-face5 ((t (:background "brown"))))
- (bg:erc-color-face6 ((t (:background "purple"))))
- (bg:erc-color-face7 ((t (:background "orange"))))
- (bg:erc-color-face8 ((t (:background "yellow"))))
- (bg:erc-color-face9 ((t (:background "green"))))
- (bold ((t (:bold t :weight bold))))
- (bold-italic ((t (:italic t :bold t :slant italic :weight bold))))
- (border ((t (:background "black"))))
- (button ((t (:underline t))))
- (comint-highlight-input ((t (:bold t :weight bold))))
- (comint-highlight-prompt ((t (:foreground "cyan"))))
- (cursor ((t (:background "black"))))
- (custom-button-face ((t (:background "lightgrey" :foreground "black" :box (:line-width 2 :style released-button)))))
- (custom-button-pressed-face ((t (:background "lightgrey" :foreground "black" :box (:line-width 2 :style pressed-button)))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-comment-face ((t (:background "dim gray"))))
- (custom-comment-tag-face ((t (:foreground "gray80"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:bold t :family "helv" :weight bold :height 1.2))))
- (custom-group-tag-face ((t (:bold t :foreground "light blue" :weight bold :height 1.2))))
- (custom-group-tag-face-1 ((t (:bold t :family "helv" :foreground "pink" :weight bold :height 1.2))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "lime green"))))
- (custom-variable-button-face ((t (:bold t :underline t :weight bold))))
- (custom-variable-tag-face ((t (:bold t :family "helv" :foreground "light blue" :weight bold :height 1.2))))
- (erc-action-face ((t (:bold t :weight bold))))
- (erc-bold-face ((t (:bold t :weight bold))))
- (erc-default-face ((t (nil))))
- (erc-direct-msg-face ((t (:foreground "IndianRed"))))
- (erc-error-face ((t (:background "Red" :foreground "White"))))
- (erc-input-face ((t (:foreground "brown"))))
- (erc-inverse-face ((t (:background "Black" :foreground "White"))))
- (erc-notice-face ((t (:bold t :foreground "SlateBlue" :weight bold))))
- (erc-prompt-face ((t (:bold t :background "lightBlue2" :foreground "Black" :weight bold))))
- (erc-timestamp-face ((t (:bold t :foreground "green" :weight bold))))
- (erc-underline-face ((t (:underline t))))
- (eshell-ls-archive-face ((t (:bold t :foreground "Orchid" :weight bold))))
- (eshell-ls-backup-face ((t (:foreground "LightSalmon"))))
- (eshell-ls-clutter-face ((t (:bold t :foreground "OrangeRed" :weight bold))))
- (eshell-ls-directory-face ((t (:bold t :foreground "SkyBlue" :weight bold))))
- (eshell-ls-executable-face ((t (:bold t :foreground "Green" :weight bold))))
- (eshell-ls-missing-face ((t (:bold t :foreground "Red" :weight bold))))
- (eshell-ls-product-face ((t (:foreground "LightSalmon"))))
- (eshell-ls-readonly-face ((t (:foreground "Pink"))))
- (eshell-ls-special-face ((t (:bold t :foreground "Magenta" :weight bold))))
- (eshell-ls-symlink-face ((t (:bold t :foreground "Cyan" :weight bold))))
- (eshell-ls-unreadable-face ((t (:foreground "DarkGrey"))))
- (fg:erc-color-face0 ((t (:foreground "White"))))
- (fg:erc-color-face1 ((t (:foreground "black"))))
- (fg:erc-color-face10 ((t (:foreground "lightblue1"))))
- (fg:erc-color-face11 ((t (:foreground "cyan"))))
- (fg:erc-color-face12 ((t (:foreground "blue"))))
- (fg:erc-color-face13 ((t (:foreground "deeppink"))))
- (fg:erc-color-face14 ((t (:foreground "gray50"))))
- (fg:erc-color-face15 ((t (:foreground "gray90"))))
- (fg:erc-color-face2 ((t (:foreground "blue4"))))
- (fg:erc-color-face3 ((t (:foreground "green4"))))
- (fg:erc-color-face4 ((t (:foreground "red"))))
- (fg:erc-color-face5 ((t (:foreground "brown"))))
- (fg:erc-color-face6 ((t (:foreground "purple"))))
- (fg:erc-color-face7 ((t (:foreground "orange"))))
- (fg:erc-color-face8 ((t (:foreground "yellow"))))
- (fg:erc-color-face9 ((t (:foreground "green"))))
- (fixed-pitch ((t (:family "courier"))))
- (font-lock-builtin-face ((t (:foreground "LightSkyBlue" :underline t))))
- (font-lock-comment-face ((t (:italic t :foreground "lightgreen" :slant oblique))))
- (font-lock-constant-face ((t (:foreground "Aquamarine"))))
- (font-lock-function-name-face ((t (:bold t :foreground "DodgerBlue" :weight bold :height 1.05))))
- (font-lock-keyword-face ((t (:foreground "LightPink" :height 1.05))))
- (font-lock-string-face ((t (:foreground "LightSalmon"))))
- (font-lock-type-face ((t (:foreground "yellow" :height 1.05))))
- (font-lock-variable-name-face ((t (:foreground "gold"))))
- (font-lock-warning-face ((t (:bold t :foreground "Pink" :weight bold))))
- (fringe ((t (:background "grey10"))))
- (header-line ((t (:box (:line-width -1 :style released-button) :background "grey20" :foreground "grey90" :box nil))))
- (highlight ((t (:background "darkolivegreen"))))
- (isearch ((t (:background "palevioletred2" :foreground "brown4"))))
- (isearch-lazy-highlight-face ((t (:background "paleturquoise4"))))
- (italic ((t (:italic t :slant italic))))
- (jde-bug-breakpoint-cursor ((t (:background "brown" :foreground "cyan"))))
- (jde-db-active-breakpoint-face ((t (:background "red" :foreground "black"))))
- (jde-db-requested-breakpoint-face ((t (:background "yellow" :foreground "black"))))
- (jde-db-spec-breakpoint-face ((t (:background "green" :foreground "black"))))
- (jde-java-font-lock-api-face ((t (:foreground "light goldenrod"))))
- (jde-java-font-lock-bold-face ((t (:bold t :weight bold))))
- (jde-java-font-lock-code-face ((t (nil))))
- (jde-java-font-lock-constant-face ((t (:foreground "Aquamarine"))))
- (jde-java-font-lock-doc-tag-face ((t (:foreground "light coral"))))
- (jde-java-font-lock-italic-face ((t (:italic t :slant italic))))
- (jde-java-font-lock-link-face ((t (:foreground "cadetblue" :underline t :slant normal))))
- (jde-java-font-lock-modifier-face ((t (:foreground "LightSteelBlue"))))
- (jde-java-font-lock-number-face ((t (:foreground "LightSalmon"))))
- (jde-java-font-lock-operator-face ((t (:foreground "medium blue"))))
- (jde-java-font-lock-package-face ((t (:foreground "steelblue1"))))
- (jde-java-font-lock-pre-face ((t (nil))))
- (jde-java-font-lock-underline-face ((t (:underline t))))
- (menu ((t (nil))))
- (minibuffer-prompt ((t (:foreground "cyan"))))
- (mode-line ((t (:background "grey75" :foreground "black" :box (:line-width -1 :style released-button)))))
- (mode-line-inactive ((t (:background "grey30" :foreground "grey80" :box (:line-width -1 :color "grey40" :style nil) :weight light))))
- (mouse ((t (:background "black"))))
- (primary-selection ((t (:background "blue3"))))
- (region ((t (:background "blue3"))))
- (scroll-bar ((t (nil))))
- (secondary-selection ((t (:background "SkyBlue4"))))
- (semantic-dirty-token-face ((t (:background "lightyellow"))))
- (semantic-unmatched-syntax-face ((t (:underline "red"))))
- (senator-intangible-face ((t (:foreground "gray75"))))
- (senator-momentary-highlight-face ((t (:background "gray30"))))
- (senator-read-only-face ((t (:background "#664444"))))
- (show-paren-match-face ((t (:background "steelblue3"))))
- (show-paren-mismatch-face ((t (:background "purple" :foreground "white"))))
- (speedbar-button-face ((t (:foreground "green3"))))
- (speedbar-directory-face ((t (:foreground "light blue"))))
- (speedbar-file-face ((t (:foreground "cyan"))))
- (speedbar-highlight-face ((t (:background "sea green"))))
- (speedbar-selected-face ((t (:foreground "red" :underline t))))
- (speedbar-tag-face ((t (:foreground "yellow"))))
- (template-message-face ((t (:bold t :weight bold))))
- (tool-bar ((t (:background "grey75" :foreground "black" :box (:line-width 1 :style released-button)))))
- (tooltip ((t (:background "lightyellow" :foreground "black"))))
- (trailing-whitespace ((t (:background "red"))))
- (underline ((t (:underline t))))
- (variable-pitch ((t (:family "helv"))))
- (widget-button-face ((t (:bold t :weight bold))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "lime green"))))
- (widget-field-face ((t (:background "dim gray"))))
- (widget-inactive-face ((t (:foreground "light gray"))))
- (widget-single-line-field-face ((t (:background "dim gray"))))
- (zmacs-region ((t (:background "blue3")))))))
-
-(defun color-theme-dark-green ()
- "Color theme by ces93, created 2002-03-30."
- (interactive)
- (color-theme-install
- '(color-theme-dark-green
- ((background-mode . light)
- (background-toolbar-color . "#e79ddf7ddf7d")
- (border-color . "#000000000000")
- (bottom-toolbar-shadow-color . "#8e3886178617")
- (top-toolbar-shadow-color . "#ffffffffffff"))
- nil
- (default ((t (nil))))
- (blue ((t (:foreground "blue"))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:italic t :bold t))))
- (border-glyph ((t (nil))))
- (fringe ((t (nil))))
- (green ((t (:foreground "green"))))
- (gui-button-face ((t (:background "grey75" :foreground "black"))))
- (gui-element ((t (:background "#ffffff" :foreground "#000000"))))
- (highlight ((t (:background "gray" :foreground "darkred"))))
- (isearch ((t (:background "LightSlateGray" :foreground "red"))))
- (italic ((t (:italic t))))
- (left-margin ((t (nil))))
- (list-mode-item-selected ((t (:background "gray68"))))
- (mode-line ((t (:background "LightSlateGray" :foreground "black"))))
- (modeline ((t (:background "LightSlateGray" :foreground "black"))))
- (modeline-buffer-id ((t (:background "LightSlateGray" :foreground "blue4"))))
- (modeline-mousable ((t (:background "LightSlateGray" :foreground "firebrick"))))
- (modeline-mousable-minor-mode ((t (:background "LightSlateGray" :foreground "green4"))))
- (pointer ((t (:background "#ffffff" :foreground "#000000"))))
- (primary-selection ((t (:background "gray65"))))
- (red ((t (:foreground "red"))))
- (region ((t (:background "gray65"))))
- (right-margin ((t (nil))))
- (rpm-spec-dir-face ((t (:foreground "green"))))
- (rpm-spec-doc-face ((t (:foreground "magenta"))))
- (rpm-spec-ghost-face ((t (:foreground "red"))))
- (rpm-spec-macro-face ((t (:foreground "purple"))))
- (rpm-spec-package-face ((t (:foreground "red"))))
- (rpm-spec-tag-face ((t (:foreground "blue"))))
- (secondary-selection ((t (:background "paleturquoise"))))
- (text-cursor ((t (:background "Red3" :foreground "DarkSlateGray"))))
- (tool-bar ((t (nil))))
- (toolbar ((t (:background "#ffffff" :foreground "#000000"))))
- (underline ((t (:underline t))))
- (vertical-divider ((t (:background "#ffffff" :foreground "#000000"))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (yellow ((t (:foreground "yellow"))))
- (zmacs-region ((t (:background "darkorange" :foreground "black")))))))
-
-(defun color-theme-whateveryouwant ()
- "Color theme by Fabien Penso, created 2002-05-02."
- (interactive)
- (color-theme-install
- '(color-theme-whateveryouwant
- ((background-color . "white")
- (background-mode . light)
- (border-color . "black")
- (cursor-color . "black")
- (foreground-color . "black")
- (mouse-color . "black"))
- ((cperl-here-face . font-lock-string-face)
- (cperl-invalid-face . underline)
- (cperl-pod-face . font-lock-comment-face)
- (cperl-pod-head-face . font-lock-variable-name-face)
- (display-time-mail-face . mode-line)
- (gnus-article-button-face . bold)
- (gnus-article-mouse-face . highlight)
- (gnus-carpal-button-face . bold)
- (gnus-carpal-header-face . bold-italic)
- (gnus-cite-attribution-face . gnus-cite-attribution-face)
- (gnus-mouse-face . highlight)
- (gnus-selected-tree-face . modeline)
- (gnus-signature-face . gnus-signature-face)
- (gnus-summary-selected-face . gnus-summary-selected-face)
- (gnus-treat-display-xface . head)
- (help-highlight-face . underline)
- (ispell-highlight-face . flyspell-incorrect-face)
- (list-matching-lines-face . bold)
- (sgml-set-face . t)
- (view-highlight-face . highlight)
- (widget-mouse-face . highlight)
- (x-face-mouse-face . highlight))
- (default ((t (:stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 116 :width normal :family "monotype-courier new"))))
- (Info-title-1-face ((t (:bold t :weight bold :height 1.728 :family "helv"))))
- (Info-title-2-face ((t (:bold t :weight bold :height 1.44 :family "helv"))))
- (Info-title-3-face ((t (:bold t :weight bold :height 1.2 :family "helv"))))
- (Info-title-4-face ((t (:bold t :weight bold :family "helv"))))
- (antlr-font-lock-keyword-face ((t (:bold t :foreground "black" :weight bold))))
- (antlr-font-lock-literal-face ((t (:bold t :foreground "brown4" :weight bold))))
- (antlr-font-lock-ruledef-face ((t (:bold t :foreground "blue" :weight bold))))
- (antlr-font-lock-ruleref-face ((t (:foreground "blue4"))))
- (antlr-font-lock-tokendef-face ((t (:bold t :foreground "blue" :weight bold))))
- (antlr-font-lock-tokenref-face ((t (:foreground "orange4"))))
- (bbdb-company ((t (:italic t :slant italic))))
- (bbdb-field-name ((t (:bold t :foreground "gray40" :weight bold))))
- (bbdb-field-value ((t (nil))))
- (bbdb-name ((t (:underline t))))
- (bold ((t (:bold t :foreground "gray40" :weight bold))))
- (bold-italic ((t (:italic t :bold t :slant italic :weight bold))))
- (border ((t (:background "black"))))
- (calendar-today-face ((t (:underline t))))
- (change-log-acknowledgement-face ((t (:foreground "Firebrick"))))
- (change-log-conditionals-face ((t (:foreground "DarkGoldenrod"))))
- (change-log-date-face ((t (:foreground "RosyBrown"))))
- (change-log-email-face ((t (:foreground "DarkGoldenrod"))))
- (change-log-file-face ((t (:foreground "Blue"))))
- (change-log-function-face ((t (:foreground "DarkGoldenrod"))))
- (change-log-list-face ((t (:foreground "Purple"))))
- (change-log-name-face ((t (:foreground "CadetBlue"))))
- (comint-highlight-input ((t (:bold t :weight bold))))
- (comint-highlight-prompt ((t (:foreground "dark blue"))))
- (cperl-array-face ((t (:bold t :background "lightyellow2" :foreground "Blue" :weight bold))))
- (cperl-hash-face ((t (:italic t :bold t :background "lightyellow2" :foreground "Red" :slant italic :weight bold))))
- (cperl-nonoverridable-face ((t (:foreground "chartreuse3"))))
- (cursor ((t (:background "black"))))
- (custom-button-face ((t (:background "lightgrey" :foreground "black" :box (:line-width 2 :style released-button)))))
- (custom-button-pressed-face ((t (:background "lightgrey" :foreground "black" :box (:line-width 2 :style pressed-button)))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-comment-face ((t (:background "gray85"))))
- (custom-comment-tag-face ((t (:foreground "blue4"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:bold t :weight bold :height 1.2 :family "helv"))))
- (custom-group-tag-face ((t (:bold t :foreground "blue" :weight bold :height 1.2))))
- (custom-group-tag-face-1 ((t (:bold t :foreground "red" :weight bold :height 1.2 :family "helv"))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "dark green"))))
- (custom-variable-button-face ((t (:bold t :underline t :weight bold))))
- (custom-variable-tag-face ((t (:bold t :foreground "blue" :weight bold :height 1.2 :family "helv"))))
- (cvs-filename-face ((t (:foreground "blue4"))))
- (cvs-handled-face ((t (:foreground "pink"))))
- (cvs-header-face ((t (:bold t :foreground "blue4" :weight bold))))
- (cvs-marked-face ((t (:bold t :foreground "green3" :weight bold))))
- (cvs-msg-face ((t (:italic t :slant italic))))
- (cvs-need-action-face ((t (:foreground "orange"))))
- (cvs-unknown-face ((t (:foreground "red"))))
- (diary-face ((t (:foreground "red"))))
- (diff-added-face ((t (nil))))
- (diff-changed-face ((t (nil))))
- (diff-context-face ((t (:foreground "grey50"))))
- (diff-file-header-face ((t (:bold t :background "grey70" :weight bold))))
- (diff-function-face ((t (:foreground "grey50"))))
- (diff-header-face ((t (:background "grey85"))))
- (diff-hunk-header-face ((t (:background "grey85"))))
- (diff-index-face ((t (:bold t :background "grey70" :weight bold))))
- (diff-nonexistent-face ((t (:bold t :background "grey70" :weight bold))))
- (diff-removed-face ((t (nil))))
- (dired-face-boring ((t (:foreground "RosyBrown"))))
- (dired-face-directory ((t (:foreground "Blue"))))
- (dired-face-executable ((t (nil))))
- (dired-face-flagged ((t (:bold t :foreground "Red" :weight bold))))
- (dired-face-marked ((t (:bold t :foreground "Red" :weight bold))))
- (dired-face-permissions ((t (nil))))
- (dired-face-setuid ((t (nil))))
- (dired-face-socket ((t (nil))))
- (dired-face-symlink ((t (:foreground "Purple"))))
- (ebrowse-default-face ((t (nil))))
- (ebrowse-file-name-face ((t (:italic t :slant italic))))
- (ebrowse-member-attribute-face ((t (:foreground "red"))))
- (ebrowse-member-class-face ((t (:foreground "purple"))))
- (ebrowse-progress-face ((t (:background "blue"))))
- (ebrowse-root-class-face ((t (:bold t :foreground "blue" :weight bold))))
- (ebrowse-tree-mark-face ((t (:foreground "red"))))
- (ediff-current-diff-face-A ((t (:background "pale green" :foreground "firebrick"))))
- (ediff-current-diff-face-Ancestor ((t (:background "VioletRed" :foreground "Black"))))
- (ediff-current-diff-face-B ((t (:background "Yellow" :foreground "DarkOrchid"))))
- (ediff-current-diff-face-C ((t (:background "Pink" :foreground "Navy"))))
- (ediff-even-diff-face-A ((t (:background "light grey" :foreground "Black"))))
- (ediff-even-diff-face-Ancestor ((t (:background "Grey" :foreground "White"))))
- (ediff-even-diff-face-B ((t (:background "Grey" :foreground "White"))))
- (ediff-even-diff-face-C ((t (:background "light grey" :foreground "Black"))))
- (ediff-fine-diff-face-A ((t (:background "sky blue" :foreground "Navy"))))
- (ediff-fine-diff-face-Ancestor ((t (:background "Green" :foreground "Black"))))
- (ediff-fine-diff-face-B ((t (:background "cyan" :foreground "Black"))))
- (ediff-fine-diff-face-C ((t (:background "Turquoise" :foreground "Black"))))
- (ediff-odd-diff-face-A ((t (:background "Grey" :foreground "White"))))
- (ediff-odd-diff-face-Ancestor ((t (:background "light grey" :foreground "Black"))))
- (ediff-odd-diff-face-B ((t (:background "light grey" :foreground "Black"))))
- (ediff-odd-diff-face-C ((t (:background "Grey" :foreground "White"))))
- (erc-action-face ((t (:bold t :weight bold))))
- (erc-bold-face ((t (:bold t :weight bold))))
- (erc-default-face ((t (nil))))
- (erc-direct-msg-face ((t (:foreground "LightSalmon"))))
- (erc-error-face ((t (:bold t :foreground "IndianRed" :weight bold))))
- (erc-input-face ((t (:foreground "Beige"))))
- (erc-inverse-face ((t (:background "wheat" :foreground "darkslategrey"))))
- (erc-notice-face ((t (:foreground "MediumAquamarine"))))
- (erc-pal-face ((t (:foreground "pale green"))))
- (erc-prompt-face ((t (:foreground "MediumAquamarine"))))
- (erc-underline-face ((t (:underline t))))
- (eshell-ls-archive-face ((t (:bold t :foreground "Orchid" :weight bold))))
- (eshell-ls-backup-face ((t (:foreground "OrangeRed"))))
- (eshell-ls-clutter-face ((t (:bold t :foreground "OrangeRed" :weight bold))))
- (eshell-ls-directory-face ((t (:bold t :foreground "Blue" :weight bold))))
- (eshell-ls-executable-face ((t (:bold t :foreground "ForestGreen" :weight bold))))
- (eshell-ls-missing-face ((t (:bold t :foreground "Red" :weight bold))))
- (eshell-ls-picture-face ((t (:foreground "Violet"))))
- (eshell-ls-product-face ((t (:foreground "OrangeRed"))))
- (eshell-ls-readonly-face ((t (:foreground "Brown"))))
- (eshell-ls-special-face ((t (:bold t :foreground "Magenta" :weight bold))))
- (eshell-ls-symlink-face ((t (:bold t :foreground "Dark Cyan" :weight bold))))
- (eshell-ls-unreadable-face ((t (:foreground "Grey30"))))
- (eshell-prompt-face ((t (:bold t :foreground "#aa0000" :weight bold :width condensed :family "neep-alt"))))
- (eshell-test-failed-face ((t (:bold t :foreground "OrangeRed" :weight bold))))
- (eshell-test-ok-face ((t (:bold t :foreground "Green" :weight bold))))
- (excerpt ((t (:italic t :slant italic))))
- (fixed ((t (:bold t :weight bold))))
- (fixed-pitch ((t (:family "courier"))))
- (flyspell-duplicate-face ((t (:bold t :foreground "Gold3" :underline t :weight bold))))
- (flyspell-incorrect-face ((t (:bold t :foreground "OrangeRed" :underline t :weight bold))))
- (font-latex-bold-face ((t (:bold t :foreground "DarkOliveGreen" :weight bold))))
- (font-latex-italic-face ((t (:italic t :foreground "DarkOliveGreen" :slant italic))))
- (font-latex-math-face ((t (:foreground "SaddleBrown"))))
- (font-latex-sedate-face ((t (:foreground "DimGray"))))
- (font-latex-string-face ((t (:foreground "RosyBrown"))))
- (font-latex-warning-face ((t (:bold t :foreground "Red" :weight bold))))
- (font-lock-builtin-face ((t (:foreground "dodgerblue3"))))
- (font-lock-comment-face ((t (:foreground "#cc0000" :width semi-condensed :family "helvetica"))))
- (font-lock-constant-face ((t (:foreground "CadetBlue"))))
- (font-lock-doc-face ((t (:foreground "RosyBrown"))))
- (font-lock-doc-string-face ((t (:foreground "RosyBrown"))))
- (font-lock-function-name-face ((t (:bold t :foreground "navy" :weight bold :height 100))))
- (font-lock-keyword-face ((t (:bold t :foreground "red4" :weight bold))))
- (font-lock-preprocessor-face ((t (:foreground "CadetBlue"))))
- (font-lock-reference-face ((t (:foreground "Orchid"))))
- (font-lock-string-face ((t (:foreground "navy"))))
- (font-lock-type-face ((t (:bold t :foreground "black" :weight bold))))
- (font-lock-variable-name-face ((t (:foreground "black"))))
- (font-lock-warning-face ((t (:foreground "orange2"))))
- (fringe ((t (:background "white"))))
- (gnus-cite-attribution-face ((t (:italic t :slant italic))))
- (gnus-cite-face-1 ((t (:foreground "MidnightBlue"))))
- (gnus-cite-face-10 ((t (:foreground "medium purple"))))
- (gnus-cite-face-11 ((t (:foreground "turquoise"))))
- (gnus-cite-face-2 ((t (:foreground "firebrick"))))
- (gnus-cite-face-3 ((t (:foreground "dark green"))))
- (gnus-cite-face-4 ((t (:foreground "OrangeRed"))))
- (gnus-cite-face-5 ((t (:foreground "dark khaki"))))
- (gnus-cite-face-6 ((t (:foreground "dark violet"))))
- (gnus-cite-face-7 ((t (:foreground "SteelBlue4"))))
- (gnus-cite-face-8 ((t (:foreground "magenta"))))
- (gnus-cite-face-9 ((t (:foreground "violet"))))
- (gnus-emphasis-bold ((t (:bold t :weight bold))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t :slant italic :weight bold))))
- (gnus-emphasis-highlight-words ((t (:background "black" :foreground "yellow"))))
- (gnus-emphasis-italic ((t (:italic t :slant italic))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:bold t :underline t :weight bold))))
- (gnus-emphasis-underline-bold-italic ((t (:italic t :bold t :underline t :slant italic :weight bold))))
- (gnus-emphasis-underline-italic ((t (:italic t :underline t :slant italic))))
- (gnus-group-mail-1-empty-face ((t (:foreground "DeepPink3"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "DeepPink3" :weight bold))))
- (gnus-group-mail-2-empty-face ((t (:foreground "HotPink3"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "HotPink3" :weight bold))))
- (gnus-group-mail-3-empty-face ((t (:foreground "magenta4"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "magenta4" :weight bold))))
- (gnus-group-mail-low-empty-face ((t (:foreground "DeepPink4"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "DeepPink4" :weight bold))))
- (gnus-group-news-1-empty-face ((t (:foreground "red" :weight normal :height 120 :family "courier"))))
- (gnus-group-news-1-face ((t (:foreground "red" :weight normal :height 120 :family "courier"))))
- (gnus-group-news-2-empty-face ((t (:foreground "CadetBlue4"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "CadetBlue4" :weight bold))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (:bold t :weight bold))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (:bold t :weight bold))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (:bold t :weight bold))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (:bold t :weight bold))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkGreen"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "DarkGreen" :weight bold))))
- (gnus-header-content-face ((t (:foreground "goldenrod" :slant normal :family "helvetica"))))
- (gnus-header-from-face ((t (:bold t :foreground "grey75" :weight bold :height 140 :family "helvetica"))))
- (gnus-header-name-face ((t (:foreground "grey75" :height 120 :family "helvetica"))))
- (gnus-header-newsgroups-face ((t (:italic t :foreground "MidnightBlue" :slant italic))))
- (gnus-header-subject-face ((t (:bold t :foreground "firebrick" :weight bold :height 160 :family "helvetica"))))
- (gnus-picon-face ((t (:background "white" :foreground "black"))))
- (gnus-picon-xbm-face ((t (:background "white" :foreground "black"))))
- (gnus-signature-face ((t (:italic t :slant italic))))
- (gnus-splash-face ((t (:foreground "Brown"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "RoyalBlue" :weight bold))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "DarkGreen" :weight bold))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "firebrick" :weight bold))))
- (gnus-summary-high-unread-face ((t (:bold t :weight bold))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "RoyalBlue" :slant italic))))
- (gnus-summary-low-read-face ((t (:italic t :foreground "DarkGreen" :slant italic))))
- (gnus-summary-low-ticked-face ((t (:italic t :foreground "firebrick" :slant italic))))
- (gnus-summary-low-unread-face ((t (:italic t :slant italic))))
- (gnus-summary-normal-ancient-face ((t (:foreground "grey65" :height 110 :width condensed :family "neep"))))
- (gnus-summary-normal-read-face ((t (:foreground "grey75" :height 110 :width condensed :family "neep"))))
- (gnus-summary-normal-ticked-face ((t (:bold t :foreground "firebrick" :weight bold :height 110 :width condensed :family "neep"))))
- (gnus-summary-normal-unread-face ((t (:foreground "firebrick" :height 110 :width condensed :family "neep"))))
- (gnus-summary-selected-face ((t (:background "gold" :foreground "black" :box (:line-width 1 :color "yellow" :style released-button) :height 140 :width condensed :family "neep"))))
- (header-line ((t (:background "grey90" :foreground "grey20" :box nil))))
- (hi-black-b ((t (:bold t :weight bold))))
- (hi-black-hb ((t (:bold t :weight bold :height 1.67 :family "helv"))))
- (hi-blue ((t (:background "light blue"))))
- (hi-blue-b ((t (:bold t :foreground "blue" :weight bold))))
- (hi-green ((t (:background "green"))))
- (hi-green-b ((t (:bold t :foreground "green" :weight bold))))
- (hi-pink ((t (:background "pink"))))
- (hi-red-b ((t (:bold t :foreground "red" :weight bold))))
- (hi-yellow ((t (:background "yellow"))))
- (highlight ((t (:background "black" :foreground "white"))))
- (highlight-changes-delete-face ((t (:foreground "red" :underline t))))
- (highlight-changes-face ((t (:foreground "red"))))
- (highline-face ((t (:background "gray80"))))
- (holiday-face ((t (:background "pink"))))
- (idlwave-help-link-face ((t (:foreground "Blue"))))
- (idlwave-shell-bp-face ((t (:background "Pink" :foreground "Black"))))
- (info-header-node ((t (:italic t :bold t :foreground "brown" :slant italic :weight bold))))
- (info-header-xref ((t (:bold t :foreground "magenta4" :weight bold))))
- (info-menu-5 ((t (:foreground "red1"))))
- (info-menu-header ((t (:bold t :weight bold :family "helv"))))
- (info-node ((t (:italic t :bold t :foreground "brown" :slant italic :weight bold))))
- (info-xref ((t (:bold t :foreground "magenta4" :weight bold))))
- (isearch ((t (:background "magenta4" :foreground "lightskyblue1"))))
- (isearch-lazy-highlight-face ((t (:background "paleturquoise"))))
- (italic ((t (:italic t :slant italic))))
- (log-view-file-face ((t (:bold t :background "grey70" :weight bold))))
- (log-view-message-face ((t (:background "grey85"))))
- (makefile-space-face ((t (:background "hotpink"))))
- (menu ((t (nil))))
- (message-cited-text-face ((t (:foreground "red"))))
- (message-header-cc-face ((t (:foreground "grey45" :weight normal :family "helvetica"))))
- (message-header-name-face ((t (:foreground "cornflower blue"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "blue4" :slant italic :weight bold))))
- (message-header-other-face ((t (:foreground "steel blue"))))
- (message-header-subject-face ((t (:bold t :foreground "navy blue" :weight bold))))
- (message-header-to-face ((t (:bold t :foreground "grey60" :weight bold :height 120 :family "helvetica"))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-mml-face ((t (:foreground "ForestGreen"))))
- (message-separator-face ((t (:foreground "brown"))))
- (mode-line ((t (:background "grey90" :foreground "black" :box (:line-width 1 :style none) :width condensed :family "neep"))))
- (modeline-buffer-id ((t (:bold t :background "grey75" :foreground "black" :box (:line-width -1 :style released-button) :weight bold))))
- (modeline-mousable ((t (:background "grey75" :foreground "black" :box (:line-width -1 :style released-button)))))
- (modeline-mousable-minor-mode ((t (:background "grey75" :foreground "black" :box (:line-width -1 :style released-button)))))
- (mouse ((t (:background "black"))))
- (mpg123-face-cur ((t (:background "#004080" :foreground "yellow"))))
- (mpg123-face-slider ((t (:background "yellow" :foreground "black"))))
- (primary-selection ((t (:background "lightgoldenrod2"))))
- (reb-match-0 ((t (:background "lightblue"))))
- (reb-match-1 ((t (:background "aquamarine"))))
- (reb-match-2 ((t (:background "springgreen"))))
- (reb-match-3 ((t (:background "yellow"))))
- (region ((t (:background "#aa0000" :foreground "white"))))
- (scroll-bar ((t (:background "grey75"))))
- (secondary-selection ((t (:background "yellow"))))
- (sgml-comment-face ((t (:italic t :foreground "SeaGreen" :slant italic))))
- (sgml-doctype-face ((t (:bold t :foreground "FireBrick" :weight bold))))
- (sgml-end-tag-face ((t (:stipple nil :background "white" :foreground "SlateBlue" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 116 :width normal :family "monotype-courier new"))))
- (sgml-entity-face ((t (:stipple nil :background "SlateBlue" :foreground "Red" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 116 :width normal :family "monotype-courier new"))))
- (sgml-ignored-face ((t (nil))))
- (sgml-ms-end-face ((t (nil))))
- (sgml-ms-start-face ((t (nil))))
- (sgml-pi-face ((t (:bold t :foreground "gray40" :weight bold))))
- (sgml-sgml-face ((t (:bold t :foreground "gray40" :weight bold))))
- (sgml-short-ref-face ((t (nil))))
- (sgml-shortref-face ((t (:bold t :foreground "gray40" :weight bold))))
- (sgml-start-tag-face ((t (:stipple nil :background "white" :foreground "SlateBlue" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 116 :width normal :family "monotype-courier new"))))
- (sh-heredoc-face ((t (:foreground "tan"))))
- (show-paren-match-face ((t (:background "gray80" :foreground "black"))))
- (show-paren-mismatch-face ((t (:background "red" :foreground "yellow"))))
- (show-tabs-space-face ((t (:foreground "yellow"))))
- (show-tabs-tab-face ((t (:foreground "red"))))
- (smerge-base-face ((t (:foreground "red"))))
- (smerge-markers-face ((t (:background "grey85"))))
- (smerge-mine-face ((t (:foreground "blue"))))
- (smerge-other-face ((t (:foreground "darkgreen"))))
- (speedbar-button-face ((t (:foreground "green4"))))
- (speedbar-directory-face ((t (:foreground "blue4"))))
- (speedbar-file-face ((t (:foreground "cyan4"))))
- (speedbar-highlight-face ((t (:background "green"))))
- (speedbar-selected-face ((t (:foreground "red" :underline t))))
- (speedbar-tag-face ((t (:foreground "brown"))))
- (strokes-char-face ((t (:background "lightgray"))))
- (term-black ((t (:stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-blackbg ((t (:stipple nil :background "black" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-blue ((t (:stipple nil :background "white" :foreground "blue" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-bluebg ((t (:stipple nil :background "blue" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-bold ((t (:bold t :stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight bold :width normal :family "adobe-courier"))))
- (term-cyan ((t (:stipple nil :background "white" :foreground "cyan" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-cyanbg ((t (:stipple nil :background "cyan" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-default ((t (:stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-default-bg ((t (:stipple nil :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-default-bg-inv ((t (:stipple nil :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-default-fg ((t (:stipple nil :background "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-default-fg-inv ((t (:stipple nil :background "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-green ((t (:stipple nil :background "white" :foreground "green" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-greenbg ((t (:stipple nil :background "green" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-invisible ((t (:stipple nil :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-invisible-inv ((t (:stipple nil :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-magenta ((t (:stipple nil :background "white" :foreground "magenta" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-magentabg ((t (:stipple nil :background "magenta" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-red ((t (:stipple nil :background "white" :foreground "red" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-redbg ((t (:stipple nil :background "red" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-underline ((t (:stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline t :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-white ((t (:stipple nil :background "white" :foreground "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-whitebg ((t (:stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-yellow ((t (:stipple nil :background "white" :foreground "yellow" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-yellowbg ((t (:stipple nil :background "yellow" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (tex-math-face ((t (:foreground "RosyBrown"))))
- (texinfo-heading-face ((t (:foreground "Blue"))))
- (tool-bar ((t (:background "grey75" :foreground "black" :box (:line-width 1 :style released-button)))))
- (tooltip ((t (:background "lightyellow" :foreground "black"))))
- (trailing-whitespace ((t (:background "red"))))
- (underline ((t (:foreground "navy" :underline t))))
- (variable-pitch ((t (:family "helv"))))
- (vcursor ((t (:background "cyan" :foreground "blue" :underline t))))
- (vhdl-font-lock-attribute-face ((t (:foreground "Orchid"))))
- (vhdl-font-lock-directive-face ((t (:foreground "CadetBlue"))))
- (vhdl-font-lock-enumvalue-face ((t (:foreground "Gold4"))))
- (vhdl-font-lock-function-face ((t (:foreground "Orchid4"))))
- (vhdl-font-lock-prompt-face ((t (:bold t :foreground "Red" :weight bold))))
- (vhdl-font-lock-reserved-words-face ((t (:bold t :foreground "Orange" :weight bold))))
- (vhdl-font-lock-translate-off-face ((t (:background "LightGray"))))
- (vhdl-speedbar-architecture-face ((t (:foreground "Blue"))))
- (vhdl-speedbar-architecture-selected-face ((t (:foreground "Blue" :underline t))))
- (vhdl-speedbar-configuration-face ((t (:foreground "DarkGoldenrod"))))
- (vhdl-speedbar-configuration-selected-face ((t (:foreground "DarkGoldenrod" :underline t))))
- (vhdl-speedbar-entity-face ((t (:foreground "ForestGreen"))))
- (vhdl-speedbar-entity-selected-face ((t (:foreground "ForestGreen" :underline t))))
- (vhdl-speedbar-instantiation-face ((t (:foreground "Brown"))))
- (vhdl-speedbar-instantiation-selected-face ((t (:foreground "Brown" :underline t))))
- (vhdl-speedbar-package-face ((t (:foreground "Grey50"))))
- (vhdl-speedbar-package-selected-face ((t (:foreground "Grey50" :underline t))))
- (viper-minibuffer-emacs-face ((t (:background "darkseagreen2" :foreground "Black"))))
- (viper-minibuffer-insert-face ((t (:background "pink" :foreground "Black"))))
- (viper-minibuffer-vi-face ((t (:background "grey" :foreground "DarkGreen"))))
- (viper-replace-overlay-face ((t (:background "darkseagreen2" :foreground "Black"))))
- (viper-search-face ((t (:background "khaki" :foreground "Black"))))
- (widget-button-face ((t (:bold t :weight bold))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (widget-single-line-field-face ((t (:background "gray85"))))
- (woman-addition-face ((t (:foreground "orange"))))
- (woman-bold-face ((t (:bold t :foreground "blue" :weight bold))))
- (woman-italic-face ((t (:italic t :foreground "red" :underline t :slant italic))))
- (woman-unknown-face ((t (:foreground "brown"))))
- (zmacs-region ((t (:background "lightgoldenrod2")))))))
-
-(defun color-theme-bharadwaj-slate ()
- "Color theme by Girish Bharadwaj, created 2002-05-06."
- (interactive)
- (color-theme-install
- '(color-theme-bharadwaj-slate
- ((background-color . "DarkSlateGray")
- (background-mode . dark)
- (border-color . "black")
- (cursor-color . "khaki")
- (foreground-color . "palegreen")
- (mouse-color . "black"))
- ((display-time-mail-face . mode-line)
- (gnus-article-button-face . bold)
- (gnus-article-mouse-face . highlight)
- (gnus-mouse-face . highlight)
- (help-highlight-face . underline)
- (ibuffer-deletion-face . font-lock-type-face)
- (ibuffer-filter-group-name-face . bold)
- (ibuffer-marked-face . font-lock-warning-face)
- (ibuffer-title-face . font-lock-type-face)
- (list-matching-lines-buffer-name-face . underline)
- (list-matching-lines-face . bold)
- (semantic-which-function-use-color . t)
- (senator-eldoc-use-color . t)
- (view-highlight-face . highlight)
- (widget-mouse-face . highlight))
- (default ((t (:stipple nil :background "DarkSlateGray" :foreground "palegreen" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "outline-lucida sans typewriter"))))
- (bg:erc-color-face0 ((t (:background "White"))))
- (bg:erc-color-face1 ((t (:background "black"))))
- (bg:erc-color-face10 ((t (:background "lightblue1"))))
- (bg:erc-color-face11 ((t (:background "cyan"))))
- (bg:erc-color-face12 ((t (:background "blue"))))
- (bg:erc-color-face13 ((t (:background "deeppink"))))
- (bg:erc-color-face14 ((t (:background "gray50"))))
- (bg:erc-color-face15 ((t (:background "gray90"))))
- (bg:erc-color-face2 ((t (:background "blue4"))))
- (bg:erc-color-face3 ((t (:background "green4"))))
- (bg:erc-color-face4 ((t (:background "red"))))
- (bg:erc-color-face5 ((t (:background "brown"))))
- (bg:erc-color-face6 ((t (:background "purple"))))
- (bg:erc-color-face7 ((t (:background "orange"))))
- (bg:erc-color-face8 ((t (:background "yellow"))))
- (bg:erc-color-face9 ((t (:background "green"))))
- (bold ((t (:bold t :weight bold))))
- (bold-italic ((t (:italic t :bold t :slant italic :weight bold))))
- (border ((t (:background "black"))))
- (button ((t (:underline t))))
- (comint-highlight-input ((t (:bold t :weight bold))))
- (comint-highlight-prompt ((t (:foreground "cyan"))))
- (cursor ((t (:background "khaki"))))
- (custom-button-face ((t (:background "lightgrey" :foreground "black" :box (:line-width 2 :style released-button)))))
- (custom-button-pressed-face ((t (:background "lightgrey" :foreground "black" :box (:line-width 2 :style pressed-button)))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-comment-face ((t (:background "dim gray"))))
- (custom-comment-tag-face ((t (:foreground "gray80"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:bold t :family "helv" :weight bold :height 1.2))))
- (custom-group-tag-face ((t (:bold t :foreground "light blue" :weight bold :height 1.2))))
- (custom-group-tag-face-1 ((t (:bold t :family "helv" :foreground "pink" :weight bold :height 1.2))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "lime green"))))
- (custom-variable-button-face ((t (:bold t :underline t :weight bold))))
- (custom-variable-tag-face ((t (:bold t :family "helv" :foreground "light blue" :weight bold :height 1.2))))
- (erc-action-face ((t (:bold t :box (:line-width 2 :color "grey75") :weight bold))))
- (erc-bold-face ((t (:bold t :weight bold))))
- (erc-default-face ((t (nil))))
- (erc-direct-msg-face ((t (:foreground "IndianRed"))))
- (erc-error-face ((t (:background "Red" :foreground "White"))))
- (erc-input-face ((t (:foreground "lightblue"))))
- (erc-inverse-face ((t (:background "Black" :foreground "White"))))
- (erc-notice-face ((t (:bold t :foreground "dodgerblue" :weight bold))))
- (erc-prompt-face ((t (:bold t :background "black" :foreground "white" :weight bold))))
- (erc-timestamp-face ((t (:bold t :foreground "green" :weight bold))))
- (erc-underline-face ((t (:underline t))))
- (eshell-ls-archive-face ((t (:bold t :foreground "Orchid" :weight bold))))
- (eshell-ls-backup-face ((t (:foreground "LightSalmon"))))
- (eshell-ls-clutter-face ((t (:bold t :foreground "OrangeRed" :weight bold))))
- (eshell-ls-directory-face ((t (:bold t :foreground "SkyBlue" :weight bold))))
- (eshell-ls-executable-face ((t (:bold t :foreground "Green" :weight bold))))
- (eshell-ls-missing-face ((t (:bold t :foreground "Red" :weight bold))))
- (eshell-ls-product-face ((t (:foreground "LightSalmon"))))
- (eshell-ls-readonly-face ((t (:foreground "Pink"))))
- (eshell-ls-special-face ((t (:bold t :foreground "Magenta" :weight bold))))
- (eshell-ls-symlink-face ((t (:bold t :foreground "Cyan" :weight bold))))
- (eshell-ls-unreadable-face ((t (:foreground "DarkGrey"))))
- (eshell-prompt-face ((t (:bold t :foreground "Pink" :weight bold))))
- (fg:erc-color-face0 ((t (:foreground "White"))))
- (fg:erc-color-face1 ((t (:foreground "black"))))
- (fg:erc-color-face10 ((t (:foreground "lightblue1"))))
- (fg:erc-color-face11 ((t (:foreground "cyan"))))
- (fg:erc-color-face12 ((t (:foreground "blue"))))
- (fg:erc-color-face13 ((t (:foreground "deeppink"))))
- (fg:erc-color-face14 ((t (:foreground "gray50"))))
- (fg:erc-color-face15 ((t (:foreground "gray90"))))
- (fg:erc-color-face2 ((t (:foreground "blue4"))))
- (fg:erc-color-face3 ((t (:foreground "green4"))))
- (fg:erc-color-face4 ((t (:foreground "red"))))
- (fg:erc-color-face5 ((t (:foreground "brown"))))
- (fg:erc-color-face6 ((t (:foreground "purple"))))
- (fg:erc-color-face7 ((t (:foreground "orange"))))
- (fg:erc-color-face8 ((t (:foreground "yellow"))))
- (fg:erc-color-face9 ((t (:foreground "green"))))
- (fixed-pitch ((t (:family "courier"))))
- (font-lock-builtin-face ((t (:bold t :foreground "pink" :weight bold :height 1.1))))
- (font-lock-comment-face ((t (:foreground "violet" :height 1.0))))
- (font-lock-constant-face ((t (:bold t :foreground "tomato" :weight bold :height 1.0))))
- (font-lock-function-name-face ((t (:bold t :foreground "DodgerBlue" :weight bold))))
- (font-lock-keyword-face ((t (:bold t :foreground "turquoise" :weight bold))))
- (font-lock-preprocessor-face ((t (:bold t :foreground "tomato" :weight bold :height 1.0))))
- (font-lock-reference-face ((t (:bold t :foreground "pink" :weight bold :height 1.1))))
- (font-lock-string-face ((t (:foreground "red" :height 1.0))))
- (font-lock-type-face ((t (:foreground "lightblue3"))))
- (font-lock-variable-name-face ((t (:bold t :foreground "gray" :weight bold :height 1.0))))
- (font-lock-warning-face ((t (:bold t :foreground "Pink" :weight bold))))
- (fringe ((t (:background "DarkSlateGray"))))
- (gnus-cite-attribution-face ((t (:italic t :slant italic))))
- (gnus-cite-face-1 ((t (:foreground "light blue"))))
- (gnus-cite-face-10 ((t (:foreground "medium purple"))))
- (gnus-cite-face-11 ((t (:foreground "turquoise"))))
- (gnus-cite-face-2 ((t (:foreground "light cyan"))))
- (gnus-cite-face-3 ((t (:foreground "light yellow"))))
- (gnus-cite-face-4 ((t (:foreground "light pink"))))
- (gnus-cite-face-5 ((t (:foreground "pale green"))))
- (gnus-cite-face-6 ((t (:foreground "beige"))))
- (gnus-cite-face-7 ((t (:foreground "orange"))))
- (gnus-cite-face-8 ((t (:foreground "magenta"))))
- (gnus-cite-face-9 ((t (:foreground "violet"))))
- (gnus-emphasis-bold ((t (:bold t :weight bold))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t :slant italic :weight bold))))
- (gnus-emphasis-highlight-words ((t (:background "black" :foreground "yellow"))))
- (gnus-emphasis-italic ((t (:italic t :slant italic))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:bold t :underline t :weight bold))))
- (gnus-emphasis-underline-bold-italic ((t (:italic t :bold t :underline t :slant italic :weight bold))))
- (gnus-emphasis-underline-italic ((t (:italic t :underline t :slant italic))))
- (gnus-group-mail-1-empty-face ((t (:foreground "aquamarine1"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "aquamarine1" :weight bold))))
- (gnus-group-mail-2-empty-face ((t (:foreground "aquamarine2"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "aquamarine2" :weight bold))))
- (gnus-group-mail-3-empty-face ((t (:foreground "aquamarine3"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "aquamarine3" :weight bold))))
- (gnus-group-mail-low-empty-face ((t (:foreground "aquamarine4"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "aquamarine4" :weight bold))))
- (gnus-group-news-1-empty-face ((t (:foreground "PaleTurquoise"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "PaleTurquoise" :weight bold))))
- (gnus-group-news-2-empty-face ((t (:foreground "turquoise"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "turquoise" :weight bold))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (:bold t :weight bold))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (:bold t :weight bold))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (:bold t :weight bold))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (:bold t :weight bold))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkTurquoise"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "DarkTurquoise" :weight bold))))
- (gnus-header-content-face ((t (:italic t :foreground "forest green" :slant italic))))
- (gnus-header-from-face ((t (:foreground "spring green"))))
- (gnus-header-name-face ((t (:foreground "SeaGreen"))))
- (gnus-header-newsgroups-face ((t (:italic t :foreground "yellow" :slant italic))))
- (gnus-header-subject-face ((t (:foreground "SeaGreen3"))))
- (gnus-signature-face ((t (:italic t :slant italic))))
- (gnus-splash-face ((t (:foreground "Brown"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "SkyBlue" :weight bold))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "PaleGreen" :weight bold))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "pink" :weight bold))))
- (gnus-summary-high-unread-face ((t (:bold t :weight bold))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "SkyBlue" :slant italic))))
- (gnus-summary-low-read-face ((t (:italic t :foreground "PaleGreen" :slant italic))))
- (gnus-summary-low-ticked-face ((t (:italic t :foreground "pink" :slant italic))))
- (gnus-summary-low-unread-face ((t (:italic t :slant italic))))
- (gnus-summary-normal-ancient-face ((t (:foreground "SkyBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "PaleGreen"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "pink"))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-selected-face ((t (:underline t))))
- (header-line ((t (:underline "blueviolet" :overline "blueviolet" :box (:line-width -1 :style released-button) :background "grey20" :foreground "grey90" :box nil))))
- (highlight ((t (:background "darkolivegreen"))))
- (html-helper-bold-face ((t (:bold t :foreground "wheat" :weight bold))))
- (html-helper-italic-face ((t (:italic t :foreground "spring green" :slant italic))))
- (html-helper-underline-face ((t (:foreground "cornsilk" :underline t))))
- (html-tag-face ((t (:bold t :foreground "deep sky blue" :weight bold))))
- (info-menu-6 ((t (nil))))
- (isearch ((t (:background "palevioletred2" :foreground "brown4"))))
- (isearch-lazy-highlight-face ((t (:background "paleturquoise4"))))
- (italic ((t (:italic t :slant italic))))
- (jde-bug-breakpoint-cursor ((t (:background "brown" :foreground "cyan"))))
- (jde-db-active-breakpoint-face ((t (:background "red" :foreground "black"))))
- (jde-db-requested-breakpoint-face ((t (:background "yellow" :foreground "black"))))
- (jde-db-spec-breakpoint-face ((t (:background "green" :foreground "black"))))
- (jde-java-font-lock-api-face ((t (:foreground "light goldenrod"))))
- (jde-java-font-lock-bold-face ((t (:bold t :weight bold))))
- (jde-java-font-lock-code-face ((t (nil))))
- (jde-java-font-lock-constant-face ((t (:foreground "Aquamarine"))))
- (jde-java-font-lock-doc-tag-face ((t (:foreground "light coral"))))
- (jde-java-font-lock-italic-face ((t (:italic t :slant italic))))
- (jde-java-font-lock-link-face ((t (:foreground "blue" :underline t :slant normal))))
- (jde-java-font-lock-modifier-face ((t (:foreground "LightSteelBlue"))))
- (jde-java-font-lock-number-face ((t (:foreground "LightSalmon"))))
- (jde-java-font-lock-operator-face ((t (:foreground "medium blue"))))
- (jde-java-font-lock-package-face ((t (:foreground "steelblue1"))))
- (jde-java-font-lock-pre-face ((t (nil))))
- (jde-java-font-lock-underline-face ((t (:underline t))))
- (menu ((t (nil))))
- (message-cited-text-face ((t (:foreground "red"))))
- (message-header-cc-face ((t (:bold t :foreground "green4" :weight bold))))
- (message-header-name-face ((t (:foreground "DarkGreen"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "yellow" :slant italic :weight bold))))
- (message-header-other-face ((t (:foreground "#b00000"))))
- (message-header-subject-face ((t (:foreground "green3"))))
- (message-header-to-face ((t (:bold t :foreground "green2" :weight bold))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-mml-face ((t (:foreground "ForestGreen"))))
- (message-separator-face ((t (:foreground "blue3"))))
- (minibuffer-prompt ((t (:foreground "cyan"))))
- (mode-line ((t (:background "Darkslategray" :foreground "white" :box (:line-width -1 :style released-button) :overline "blueviolet" :underline "blueviolet"))))
- (mode-line-inactive ((t (:italic t :underline "blueviolet" :overline "blueviolet" :background "white" :foreground "cadetblue" :box (:line-width -1 :color "grey75") :slant oblique :weight light))))
- (modeline ((t (:background "Darkslategray" :foreground "white" :box (:line-width -1 :style released-button) :overline "blueviolet" :underline "blueviolet"))))
- (modeline-buffer-id ((t (:background "Darkslategray" :foreground "white" :box (:line-width -1 :style released-button) :overline "blueviolet" :underline "blueviolet"))))
- (modeline-mousable ((t (:background "Darkslategray" :foreground "white" :box (:line-width -1 :style released-button) :overline "blueviolet" :underline "blueviolet"))))
- (modeline-mousable-minor-mode ((t (:background "Darkslategray" :foreground "white" :box (:line-width -1 :style released-button) :overline "blueviolet" :underline "blueviolet"))))
- (mouse ((t (:background "black"))))
- (primary-selection ((t (:background "dimgray"))))
- (region ((t (:background "dimgray"))))
- (scroll-bar ((t (nil))))
- (secondary-selection ((t (:background "SkyBlue4"))))
- (semantic-dirty-token-face ((t (:background "lightyellow"))))
- (semantic-unmatched-syntax-face ((t (:underline "red"))))
- (senator-intangible-face ((t (:foreground "gray75"))))
- (senator-momentary-highlight-face ((t (:background "gray30"))))
- (senator-read-only-face ((t (:background "#664444"))))
- (show-paren-match-face ((t (:bold t :foreground "lightblue" :weight bold :height 1.1))))
- (show-paren-mismatch-face ((t (:bold t :foreground "red" :weight bold :height 1.1))))
- (show-tabs-space-face ((t (:foreground "yellow"))))
- (show-tabs-tab-face ((t (:foreground "red"))))
- (speedbar-button-face ((t (:foreground "green3"))))
- (speedbar-directory-face ((t (:foreground "light blue"))))
- (speedbar-file-face ((t (:foreground "cyan"))))
- (speedbar-highlight-face ((t (:background "sea green"))))
- (speedbar-selected-face ((t (:foreground "red" :underline t))))
- (speedbar-tag-face ((t (:foreground "yellow"))))
- (template-message-face ((t (:bold t :weight bold))))
- (term-black ((t (:foreground "black"))))
- (term-blackbg ((t (:background "black"))))
- (term-blue ((t (:foreground "blue"))))
- (term-bluebg ((t (:background "blue"))))
- (term-bold ((t (:bold t :weight bold))))
- (term-cyan ((t (:foreground "cyan"))))
- (term-cyanbg ((t (:background "cyan"))))
- (term-default ((t (:stipple nil :background "DarkSlateGray" :foreground "palegreen" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "outline-lucida sans typewriter"))))
- (term-default-bg ((t (nil))))
- (term-default-bg-inv ((t (nil))))
- (term-default-fg ((t (nil))))
- (term-default-fg-inv ((t (nil))))
- (term-green ((t (:foreground "green"))))
- (term-greenbg ((t (:background "green"))))
- (term-invisible ((t (nil))))
- (term-invisible-inv ((t (nil))))
- (term-magenta ((t (:foreground "magenta"))))
- (term-magentabg ((t (:background "magenta"))))
- (term-red ((t (:foreground "red"))))
- (term-redbg ((t (:background "red"))))
- (term-underline ((t (:underline t))))
- (term-white ((t (:foreground "white"))))
- (term-whitebg ((t (:background "white"))))
- (term-yellow ((t (:foreground "yellow"))))
- (term-yellowbg ((t (:background "yellow"))))
- (tool-bar ((t (:background "DarkSlateGray" :foreground "White" :box (:line-width 1 :color "blue")))))
- (tooltip ((t (:background "lightyellow" :foreground "black"))))
- (trailing-whitespace ((t (:background "red"))))
- (underline ((t (:underline t))))
- (variable-pitch ((t (:family "helv"))))
- (widget-button-face ((t (:bold t :weight bold))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "lime green"))))
- (widget-field-face ((t (:background "dim gray"))))
- (widget-inactive-face ((t (:foreground "light gray"))))
- (widget-single-line-field-face ((t (:background "dim gray"))))
- (zmacs-region ((t (:background "dimgray")))))))
-
-(defun color-theme-lethe ()
- "Color theme by Ivica Loncar, created 2002-08-02.
-Some additional X resources as suggested by the author:
-
-Emacs*menubar.Foreground: Yellow
-Emacs*menubar.Background: #1a2b3c
-Emacs*menubar.topShadowColor: gray
-Emacs*menubar.bottomShadowColor: dimgray
-
-Some fonts I really like (note: this fonts are not highly
-available):
-
-Emacs.default.attributeFont: -letl-*-medium-r-*-*-*-*-*-*-*-*-iso8859-2
-Emacs*menubar*Font: -etl-fixed-medium-r-normal--14-*-*-*-*-*-iso8859-1
-
-Mouse fix:
-
-Emacs*dialog*XmPushButton.translations:#override\n\
- <Btn1Down>: Arm()\n\
- <Btn1Down>,<Btn1Up>: Activate()\
- Disarm()\n\
- <Btn1Down>(2+): MultiArm()\n\
- <Btn1Up>(2+): MultiActivate()\n\
- <Btn1Up>: Activate()\
- Disarm()\n\
- <Key>osfSelect: ArmAndActivate()\n\
- <Key>osfActivate: ArmAndActivate()\n\
- <Key>osfHelp: Help()\n\
- ~Shift ~Meta ~Alt <Key>Return: ArmAndActivate()\n\
- <EnterWindow>: Enter()\n\
- <LeaveWindow>: Leave()\n
-
-Bonus: do not use 3D modeline."
- (interactive)
- (color-theme-install
- '(color-theme-lethe
- ((background-color . "black")
- (background-mode . dark)
- (background-toolbar-color . "#000000000000")
- (border-color . "#000000000000")
- (bottom-toolbar-shadow-color . "red")
- (cursor-color . "red")
- (foreground-color . "peachpuff")
- (mouse-color . "red")
- (top-toolbar-shadow-color . "#f5f5f5f5f5f5"))
- ((buffers-tab-face . buffers-tab)
- (cscope-use-face . t)
- (gnus-mouse-face . highlight))
- (default ((t (nil))))
- (bg:erc-color-face0 ((t (:background "White"))))
- (bg:erc-color-face1 ((t (nil))))
- (bg:erc-color-face10 ((t (:background "lightblue1"))))
- (bg:erc-color-face11 ((t (:background "cyan"))))
- (bg:erc-color-face12 ((t (:background "blue"))))
- (bg:erc-color-face13 ((t (:background "deeppink"))))
- (bg:erc-color-face14 ((t (:background "gray50"))))
- (bg:erc-color-face15 ((t (:background "gray90"))))
- (bg:erc-color-face2 ((t (:background "blue4"))))
- (bg:erc-color-face3 ((t (:background "green4"))))
- (bg:erc-color-face4 ((t (:background "red"))))
- (bg:erc-color-face5 ((t (:background "brown"))))
- (bg:erc-color-face6 ((t (:background "purple"))))
- (bg:erc-color-face7 ((t (:background "orange"))))
- (bg:erc-color-face8 ((t (:background "yellow"))))
- (bg:erc-color-face9 ((t (:background "green"))))
- (blue ((t (:foreground "blue"))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:italic t :bold t))))
- (border ((t (nil))))
- (border-glyph ((t (nil))))
- (buffers-tab ((t (:bold t :foreground "red"))))
- (button ((t (:underline t))))
- (calendar-today-face ((t (:underline t))))
- (comint-highlight-input ((t (:bold t))))
- (comint-highlight-prompt ((t (:foreground "cyan"))))
- (cperl-array-face ((t (:bold t :background "lightyellow2" :foreground "Blue"))))
- (cperl-hash-face ((t (:italic t :bold t :background "lightyellow2" :foreground "Red"))))
- (cperl-nonoverridable-face ((t (:foreground "chartreuse3"))))
- (cscope-file-face ((t (:foreground "blue"))))
- (cscope-function-face ((t (:foreground "magenta"))))
- (cscope-line-face ((t (:foreground "green"))))
- (cscope-line-number-face ((t (:foreground "red"))))
- (cscope-mouse-face ((t (:background "blue" :foreground "white"))))
- (cursor ((t (nil))))
- (custom-button-face ((t (nil))))
- (custom-button-pressed-face ((t (:background "lightgrey" :foreground "black"))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-comment-face ((t (:background "dim gray"))))
- (custom-comment-tag-face ((t (:foreground "gray80"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:underline t))))
- (custom-group-tag-face ((t (:underline t :foreground "blue"))))
- (custom-group-tag-face-1 ((t (:underline t :foreground "red"))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "dark green"))))
- (custom-variable-button-face ((t (:underline t :bold t))))
- (custom-variable-tag-face ((t (:underline t :foreground "blue"))))
- (cyan ((t (:foreground "cyan"))))
- (diary-face ((t (:foreground "red"))))
- (dired-face-boring ((t (:foreground "Gray65"))))
- (dired-face-directory ((t (:bold t))))
- (dired-face-executable ((t (:foreground "SeaGreen"))))
- (dired-face-flagged ((t (:background "LightSlateGray"))))
- (dired-face-marked ((t (:background "PaleVioletRed"))))
- (dired-face-permissions ((t (:background "grey75" :foreground "black"))))
- (dired-face-setuid ((t (:foreground "Red"))))
- (dired-face-socket ((t (:foreground "magenta"))))
- (dired-face-symlink ((t (:foreground "cyan"))))
- (display-time-mail-balloon-enhance-face ((t (:background "orange"))))
- (display-time-mail-balloon-gnus-group-face ((t (:foreground "blue"))))
- (display-time-time-balloon-face ((t (:foreground "red"))))
- (ediff-current-diff-face-A ((t (:background "pale green" :foreground "firebrick"))))
- (ediff-current-diff-face-Ancestor ((t (:background "VioletRed" :foreground "Black"))))
- (ediff-current-diff-face-B ((t (:background "Yellow" :foreground "DarkOrchid"))))
- (ediff-current-diff-face-C ((t (:background "Pink" :foreground "Navy"))))
- (ediff-even-diff-face-A ((t (:background "light grey" :foreground "Black"))))
- (ediff-even-diff-face-Ancestor ((t (:background "Grey" :foreground "White"))))
- (ediff-even-diff-face-B ((t (:background "Grey" :foreground "White"))))
- (ediff-even-diff-face-C ((t (:background "light grey" :foreground "Black"))))
- (ediff-fine-diff-face-A ((t (:background "sky blue" :foreground "Navy"))))
- (ediff-fine-diff-face-Ancestor ((t (:background "Green" :foreground "Black"))))
- (ediff-fine-diff-face-B ((t (:background "cyan" :foreground "Black"))))
- (ediff-fine-diff-face-C ((t (:background "Turquoise" :foreground "Black"))))
- (ediff-odd-diff-face-A ((t (:background "Grey" :foreground "White"))))
- (ediff-odd-diff-face-Ancestor ((t (:background "light grey" :foreground "Black"))))
- (ediff-odd-diff-face-B ((t (:background "light grey" :foreground "Black"))))
- (ediff-odd-diff-face-C ((t (:background "Grey" :foreground "White"))))
- (erc-action-face ((t (:bold t))))
- (erc-bold-face ((t (:bold t))))
- (erc-default-face ((t (nil))))
- (erc-direct-msg-face ((t (:foreground "IndianRed"))))
- (erc-error-face ((t (:background "Red" :foreground "White"))))
- (erc-input-face ((t (:foreground "brown"))))
- (erc-inverse-face ((t (:background "Black" :foreground "White"))))
- (erc-notice-face ((t (:bold t :foreground "SlateBlue"))))
- (erc-prompt-face ((t (:bold t :background "lightBlue2" :foreground "Black"))))
- (erc-timestamp-face ((t (:bold t :foreground "green"))))
- (erc-underline-face ((t (:underline t))))
- (eshell-ls-archive-face ((t (:bold t :foreground "Orchid"))))
- (eshell-ls-backup-face ((t (:foreground "OrangeRed"))))
- (eshell-ls-clutter-face ((t (:bold t :foreground "OrangeRed"))))
- (eshell-ls-directory-face ((t (:bold t :foreground "Blue"))))
- (eshell-ls-executable-face ((t (:bold t :foreground "ForestGreen"))))
- (eshell-ls-missing-face ((t (:bold t :foreground "Red"))))
- (eshell-ls-product-face ((t (:foreground "OrangeRed"))))
- (eshell-ls-readonly-face ((t (:foreground "Brown"))))
- (eshell-ls-special-face ((t (:bold t :foreground "Magenta"))))
- (eshell-ls-symlink-face ((t (:bold t :foreground "DarkCyan"))))
- (eshell-ls-unreadable-face ((t (:foreground "Grey30"))))
- (eshell-prompt-face ((t (:bold t :foreground "Red"))))
- (eshell-test-failed-face ((t (:bold t :foreground "OrangeRed"))))
- (eshell-test-ok-face ((t (:bold t :foreground "Green"))))
- (excerpt ((t (:italic t))))
- (fg:erc-color-face0 ((t (:foreground "White"))))
- (fg:erc-color-face1 ((t (:foreground "black"))))
- (fg:erc-color-face10 ((t (:foreground "lightblue1"))))
- (fg:erc-color-face11 ((t (:foreground "cyan"))))
- (fg:erc-color-face12 ((t (:foreground "blue"))))
- (fg:erc-color-face13 ((t (:foreground "deeppink"))))
- (fg:erc-color-face14 ((t (:foreground "gray50"))))
- (fg:erc-color-face15 ((t (:foreground "gray90"))))
- (fg:erc-color-face2 ((t (:foreground "blue4"))))
- (fg:erc-color-face3 ((t (:foreground "green4"))))
- (fg:erc-color-face4 ((t (:foreground "red"))))
- (fg:erc-color-face5 ((t (:foreground "brown"))))
- (fg:erc-color-face6 ((t (:foreground "purple"))))
- (fg:erc-color-face7 ((t (:foreground "orange"))))
- (fg:erc-color-face8 ((t (:foreground "yellow"))))
- (fg:erc-color-face9 ((t (:foreground "green"))))
- (fixed ((t (:bold t))))
- (fixed-pitch ((t (:size "16"))))
- (flyspell-duplicate-face ((t (:underline t :bold t :foreground "Gold3"))))
- (flyspell-incorrect-face ((t (:underline t :bold t :foreground "OrangeRed"))))
- (font-lock-builtin-face ((t (:foreground "Orchid"))))
- (font-lock-comment-face ((t (:bold t :foreground "cyan"))))
- (font-lock-constant-face ((t (:foreground "CadetBlue"))))
- (font-lock-doc-face ((t (:bold t :foreground "red"))))
- (font-lock-doc-string-face ((t (:bold t :foreground "red"))))
- (font-lock-function-name-face ((t (:bold t :foreground "white"))))
- (font-lock-keyword-face ((t (:bold t :foreground "yellow"))))
- (font-lock-preprocessor-face ((t (:bold t :foreground "blue"))))
- (font-lock-reference-face ((t (:foreground "red3"))))
- (font-lock-string-face ((t (:bold t :foreground "magenta"))))
- (font-lock-type-face ((t (:bold t :foreground "lightgreen"))))
- (font-lock-variable-name-face ((t (:bold t :foreground "white"))))
- (font-lock-warning-face ((t (:bold t :foreground "Red"))))
- (fringe ((t (:background "grey95"))))
- (gdb-arrow-face ((t (:bold t :background "yellow" :foreground "red"))))
- (gnus-cite-attribution-face ((t (:italic t))))
- (gnus-cite-face-1 ((t (:foreground "MidnightBlue"))))
- (gnus-cite-face-10 ((t (:foreground "medium purple"))))
- (gnus-cite-face-11 ((t (:foreground "turquoise"))))
- (gnus-cite-face-2 ((t (:foreground "firebrick"))))
- (gnus-cite-face-3 ((t (:foreground "dark green"))))
- (gnus-cite-face-4 ((t (:foreground "OrangeRed"))))
- (gnus-cite-face-5 ((t (:foreground "dark khaki"))))
- (gnus-cite-face-6 ((t (:foreground "dark violet"))))
- (gnus-cite-face-7 ((t (:foreground "SteelBlue4"))))
- (gnus-cite-face-8 ((t (:foreground "magenta"))))
- (gnus-cite-face-9 ((t (:foreground "violet"))))
- (gnus-emphasis-bold ((t (:bold t))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t))))
- (gnus-emphasis-highlight-words ((t (:foreground "yellow"))))
- (gnus-emphasis-italic ((t (:italic t))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:underline t :bold t))))
- (gnus-emphasis-underline-bold-italic ((t (:underline t :italic t :bold t))))
- (gnus-emphasis-underline-italic ((t (:underline t :italic t))))
- (gnus-group-mail-1-empty-face ((t (:foreground "DeepPink3"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "DeepPink3"))))
- (gnus-group-mail-2-empty-face ((t (:foreground "HotPink3"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "HotPink3"))))
- (gnus-group-mail-3-empty-face ((t (:foreground "magenta4"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "magenta4"))))
- (gnus-group-mail-low-empty-face ((t (:foreground "DeepPink4"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "DeepPink4"))))
- (gnus-group-news-1-empty-face ((t (:foreground "ForestGreen"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "ForestGreen"))))
- (gnus-group-news-2-empty-face ((t (:foreground "CadetBlue4"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "CadetBlue4"))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (:bold t))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (:bold t))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (:bold t))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (:bold t))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkGreen"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "DarkGreen"))))
- (gnus-header-content-face ((t (:italic t :foreground "indianred4"))))
- (gnus-header-from-face ((t (:foreground "red3"))))
- (gnus-header-name-face ((t (:foreground "maroon"))))
- (gnus-header-newsgroups-face ((t (:italic t :foreground "MidnightBlue"))))
- (gnus-header-subject-face ((t (:foreground "red4"))))
- (gnus-picons-face ((t (:background "white" :foreground "black"))))
- (gnus-picons-xbm-face ((t (:background "white" :foreground "black"))))
- (gnus-signature-face ((t (:italic t))))
- (gnus-splash-face ((t (:foreground "ForestGreen"))))
- (gnus-summary-cancelled-face ((t (:foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "RoyalBlue"))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "DarkGreen"))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "firebrick"))))
- (gnus-summary-high-unread-face ((t (:bold t))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "RoyalBlue"))))
- (gnus-summary-low-read-face ((t (:italic t :foreground "DarkGreen"))))
- (gnus-summary-low-ticked-face ((t (:italic t :foreground "firebrick"))))
- (gnus-summary-low-unread-face ((t (:italic t))))
- (gnus-summary-normal-ancient-face ((t (:foreground "RoyalBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "DarkGreen"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "firebrick"))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-selected-face ((t (:underline t))))
- (gnus-x-face ((t (:background "white" :foreground "black"))))
- (green ((t (:foreground "green"))))
- (gui-button-face ((t (:background "grey75" :foreground "black"))))
- (gui-element ((t (:size "12" :background "Gray80" :foreground "black"))))
- (header-line ((t (:background "grey20" :foreground "grey90"))))
- (highlight ((t (:bold t :background "yellow" :foreground "red"))))
- (highlight-changes-delete-face ((t (:underline t :foreground "red"))))
- (highlight-changes-face ((t (:foreground "red"))))
- (highline-face ((t (:background "paleturquoise"))))
- (holiday-face ((t (:background "pink"))))
- (hyper-apropos-documentation ((t (:foreground "#aaaaaa"))))
- (hyper-apropos-heading ((t (:bold t :foreground "#999999"))))
- (hyper-apropos-hyperlink ((t (:foreground "Violet"))))
- (hyper-apropos-major-heading ((t (:bold t :foreground "#ff0000"))))
- (hyper-apropos-section-heading ((t (:italic t :bold t :foreground "#33aa55"))))
- (hyper-apropos-warning ((t (:bold t :foreground "red"))))
- (info-menu-5 ((t (:underline t))))
- (info-node ((t (:italic t :bold t))))
- (info-xref ((t (:bold t))))
- (isearch ((t (:background "paleturquoise"))))
- (isearch-lazy-highlight-face ((t (:background "paleturquoise4"))))
- (isearch-secondary ((t (:foreground "red3"))))
- (italic ((t (:italic t))))
- (jde-bug-breakpoint-cursor ((t (:background "brown" :foreground "cyan"))))
- (jde-db-active-breakpoint-face ((t (:background "red" :foreground "black"))))
- (jde-db-requested-breakpoint-face ((t (:background "yellow" :foreground "black"))))
- (jde-db-spec-breakpoint-face ((t (:background "green" :foreground "black"))))
- (jde-java-font-lock-api-face ((t (:foreground "light goldenrod"))))
- (jde-java-font-lock-bold-face ((t (:bold t))))
- (jde-java-font-lock-code-face ((t (nil))))
- (jde-java-font-lock-constant-face ((t (:foreground "Aquamarine"))))
- (jde-java-font-lock-doc-tag-face ((t (:foreground "light coral"))))
- (jde-java-font-lock-italic-face ((t (:italic t))))
- (jde-java-font-lock-link-face ((t (:underline t :foreground "cadetblue"))))
- (jde-java-font-lock-modifier-face ((t (:foreground "LightSteelBlue"))))
- (jde-java-font-lock-number-face ((t (:foreground "LightSalmon"))))
- (jde-java-font-lock-operator-face ((t (:foreground "medium blue"))))
- (jde-java-font-lock-package-face ((t (:foreground "steelblue1"))))
- (jde-java-font-lock-pre-face ((t (nil))))
- (jde-java-font-lock-underline-face ((t (:underline t))))
- (left-margin ((t (nil))))
- (list-mode-item-selected ((t (:background "gray68"))))
- (magenta ((t (:foreground "magenta"))))
- (makefile-space-face ((t (:background "hotpink"))))
- (menu ((t (nil))))
- (message-cited-text-face ((t (:foreground "red"))))
- (message-header-cc-face ((t (:foreground "MidnightBlue"))))
- (message-header-name-face ((t (:foreground "cornflower blue"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "blue4"))))
- (message-header-other-face ((t (:foreground "steel blue"))))
- (message-header-subject-face ((t (:bold t :foreground "navy blue"))))
- (message-header-to-face ((t (:bold t :foreground "MidnightBlue"))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-mml-face ((t (:bold t :foreground "cyan"))))
- (message-separator-face ((t (:foreground "brown"))))
- (minibuffer-prompt ((t (:foreground "cyan"))))
- (mode-line ((t (:background "grey75" :foreground "black"))))
- (mode-line-inactive ((t (:background "grey30" :foreground "grey80"))))
- (modeline ((t (:bold t :background "red" :foreground "yellow"))))
- (modeline-buffer-id ((t (:bold t :background "red" :foreground "yellow"))))
- (modeline-mousable ((t (:background "red" :foreground "yellow"))))
- (modeline-mousable-minor-mode ((t (:background "red" :foreground "green4"))))
- (mouse ((t (nil))))
- (paren-blink-off ((t (:foreground "black"))))
- (paren-match ((t (:bold t :background "yellow" :foreground "red"))))
- (paren-mismatch ((t (:background "DeepPink"))))
- (pointer ((t (nil))))
- (primary-selection ((t (:background "gray65"))))
- (red ((t (:foreground "red"))))
- (region ((t (:background "gray75"))))
- (right-margin ((t (nil))))
- (scroll-bar ((t (nil))))
- (secondary-selection ((t (:background "paleturquoise"))))
- (semantic-dirty-token-face ((t (:background "lightyellow"))))
- (semantic-unmatched-syntax-face ((t (nil))))
- (senator-intangible-face ((t (:foreground "gray75"))))
- (senator-momentary-highlight-face ((t (:background "gray30"))))
- (senator-read-only-face ((t (:background "#664444"))))
- (show-paren-match-face ((t (:background "turquoise"))))
- (show-paren-mismatch-face ((t (:background "purple" :foreground "white"))))
- (speedbar-button-face ((t (:foreground "green4"))))
- (speedbar-directory-face ((t (:foreground "blue4"))))
- (speedbar-file-face ((t (:foreground "cyan4"))))
- (speedbar-highlight-face ((t (:background "green"))))
- (speedbar-selected-face ((t (:underline t :foreground "red"))))
- (speedbar-tag-face ((t (:foreground "brown"))))
- (template-message-face ((t (:bold t))))
- (term-black ((t (:foreground "black"))))
- (term-blackbg ((t (nil))))
- (term-blue ((t (:foreground "blue"))))
- (term-blue-bold-face ((t (:bold t :foreground "blue"))))
- (term-blue-face ((t (:foreground "blue"))))
- (term-blue-inv-face ((t (:background "blue"))))
- (term-blue-ul-face ((t (:underline t :foreground "blue"))))
- (term-bluebg ((t (:background "blue"))))
- (term-bold ((t (:bold t))))
- (term-cyan ((t (:foreground "cyan"))))
- (term-cyan-bold-face ((t (:bold t :foreground "cyan"))))
- (term-cyan-face ((t (:foreground "cyan"))))
- (term-cyan-inv-face ((t (:background "cyan"))))
- (term-cyan-ul-face ((t (:underline t :foreground "cyan"))))
- (term-cyanbg ((t (:background "cyan"))))
- (term-default-bg ((t (nil))))
- (term-default-bg-inv ((t (nil))))
- (term-default-bold-face ((t (:bold t))))
- (term-default-face ((t (nil))))
- (term-default-fg ((t (nil))))
- (term-default-fg-inv ((t (nil))))
- (term-default-inv-face ((t (:background "peachpuff" :foreground "black"))))
- (term-default-ul-face ((t (:underline t))))
- (term-green ((t (:foreground "green"))))
- (term-green-bold-face ((t (:bold t :foreground "green"))))
- (term-green-face ((t (:foreground "green"))))
- (term-green-inv-face ((t (:background "green"))))
- (term-green-ul-face ((t (:underline t :foreground "green"))))
- (term-greenbg ((t (:background "green"))))
- (term-invisible ((t (nil))))
- (term-invisible-inv ((t (nil))))
- (term-magenta ((t (:foreground "magenta"))))
- (term-magenta-bold-face ((t (:bold t :foreground "magenta"))))
- (term-magenta-face ((t (:foreground "magenta"))))
- (term-magenta-inv-face ((t (:background "magenta"))))
- (term-magenta-ul-face ((t (:underline t :foreground "magenta"))))
- (term-magentabg ((t (:background "magenta"))))
- (term-red ((t (:foreground "red"))))
- (term-red-bold-face ((t (:bold t :foreground "red"))))
- (term-red-face ((t (:foreground "red"))))
- (term-red-inv-face ((t (:background "red"))))
- (term-red-ul-face ((t (:underline t :foreground "red"))))
- (term-redbg ((t (:background "red"))))
- (term-underline ((t (:underline t))))
- (term-white ((t (:foreground "white"))))
- (term-white-bold-face ((t (:bold t :foreground "white"))))
- (term-white-face ((t (:foreground "white"))))
- (term-white-inv-face ((t (nil))))
- (term-white-ul-face ((t (:underline t :foreground "white"))))
- (term-whitebg ((t (:background "white"))))
- (term-yellow ((t (:foreground "yellow"))))
- (term-yellow-bold-face ((t (:bold t :foreground "yellow"))))
- (term-yellow-face ((t (:foreground "yellow"))))
- (term-yellow-inv-face ((t (:background "yellow"))))
- (term-yellow-ul-face ((t (:underline t :foreground "yellow"))))
- (term-yellowbg ((t (:background "yellow"))))
- (text-cursor ((t (:background "red" :foreground "black"))))
- (tool-bar ((t (:background "grey75" :foreground "black"))))
- (toolbar ((t (:background "Gray80" :foreground "black"))))
- (tooltip ((t (:background "lightyellow" :foreground "black"))))
- (trailing-whitespace ((t (:background "red"))))
- (underline ((t (:underline t))))
- (variable-pitch ((t (nil))))
- (vcursor ((t (:underline t :background "cyan" :foreground "blue"))))
- (vertical-divider ((t (:background "Gray80" :foreground "black"))))
- (vhdl-font-lock-attribute-face ((t (:foreground "Orchid"))))
- (vhdl-font-lock-directive-face ((t (:foreground "CadetBlue"))))
- (vhdl-font-lock-enumvalue-face ((t (:foreground "Gold4"))))
- (vhdl-font-lock-function-face ((t (:foreground "Orchid4"))))
- (vhdl-font-lock-prompt-face ((t (:bold t :foreground "Red"))))
- (vhdl-font-lock-reserved-words-face ((t (:bold t :foreground "Orange"))))
- (vhdl-font-lock-translate-off-face ((t (:background "LightGray"))))
- (vhdl-speedbar-architecture-face ((t (:foreground "Blue"))))
- (vhdl-speedbar-architecture-selected-face ((t (:underline t :foreground "Blue"))))
- (vhdl-speedbar-configuration-face ((t (:foreground "DarkGoldenrod"))))
- (vhdl-speedbar-configuration-selected-face ((t (:underline t :foreground "DarkGoldenrod"))))
- (vhdl-speedbar-entity-face ((t (:foreground "ForestGreen"))))
- (vhdl-speedbar-entity-selected-face ((t (:underline t :foreground "ForestGreen"))))
- (vhdl-speedbar-instantiation-face ((t (:foreground "Brown"))))
- (vhdl-speedbar-instantiation-selected-face ((t (:underline t :foreground "Brown"))))
- (vhdl-speedbar-package-face ((t (:foreground "Grey50"))))
- (vhdl-speedbar-package-selected-face ((t (:underline t :foreground "Grey50"))))
- (viper-minibuffer-emacs-face ((t (:background "darkseagreen2" :foreground "Black"))))
- (viper-minibuffer-insert-face ((t (:background "pink" :foreground "Black"))))
- (viper-minibuffer-vi-face ((t (:background "grey" :foreground "DarkGreen"))))
- (viper-replace-overlay-face ((t (:background "darkseagreen2" :foreground "Black"))))
- (viper-search-face ((t (:background "khaki" :foreground "Black"))))
- (white ((t (:foreground "white"))))
- (widget ((t (:size "12" :background "Gray80" :foreground "black"))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (nil))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (widget-single-line-field-face ((t (:background "gray85"))))
- (x-face ((t (:bold t :background "wheat" :foreground "black"))))
- (xrdb-option-name-face ((t (:bold t :foreground "yellow"))))
- (xrdb-option-value-face ((t (:bold t :foreground "magenta"))))
- (yellow ((t (:foreground "yellow"))))
- (zmacs-region ((t (:background "white" :foreground "black")))))))
-
-(defun color-theme-shaman ()
- "Color theme by shaman, created 2002-11-11."
- (interactive)
- (color-theme-install
- '(color-theme-shaman
- ((background-color . "#456345")
- (background-mode . dark)
- (background-toolbar-color . "#cf3ccf3ccf3c")
- (border-color . "#000000000000")
- (bottom-toolbar-shadow-color . "#79e77df779e7")
- (foreground-color . "White")
- (top-toolbar-shadow-color . "#f7defbeef7de"))
- ((buffers-tab-face . buffers-tab))
- (default ((t (nil))))
- (blue ((t (:foreground "blue"))))
- (bold ((t (:bold t :size "12"))))
- (bold-italic ((t (:italic t :bold t :size "12"))))
- (border-glyph ((t (nil))))
- (buffers-tab ((t (:background "Gray80" :foreground "black"))))
- (font-lock-builtin-face ((t (:foreground "cadetblue2"))))
- (font-lock-comment-face ((t (:foreground "gray80"))))
- (font-lock-constant-face ((t (:foreground "steelblue1"))))
- (font-lock-doc-face ((t (:foreground "light coral"))))
- (font-lock-doc-string-face ((t (:foreground "light coral"))))
- (font-lock-function-name-face ((t (:foreground "aquamarine"))))
- (font-lock-keyword-face ((t (:foreground "cyan"))))
- (font-lock-preprocessor-face ((t (:foreground "steelblue1"))))
- (font-lock-reference-face ((t (:foreground "cadetblue2"))))
- (font-lock-string-face ((t (:foreground "tan"))))
- (font-lock-type-face ((t (:foreground "wheat"))))
- (font-lock-variable-name-face ((t (:foreground "cyan3"))))
- (font-lock-warning-face ((t (:bold t :size "12" :foreground "Pink"))))
- (fringe ((t (nil))))
- (gnus-x-face ((t (:background "white" :foreground "black"))))
- (green ((t (:foreground "green"))))
- (gui-button-face ((t (:background "grey75" :foreground "black"))))
- (gui-element ((t (:size "12" :background "Gray80" :foreground "black"))))
- (highlight ((t (:background "darkseagreen2"))))
- (isearch ((t (:background "paleturquoise"))))
- (isearch-secondary ((t (:foreground "red3"))))
- (italic ((t (:italic t :size "12"))))
- (left-margin ((t (nil))))
- (list-mode-item-selected ((t (:background "gray68"))))
- (message-cited-text-face ((t (:foreground "red"))))
- (message-header-cc-face ((t (:bold t :foreground "green4"))))
- (message-header-name-face ((t (:foreground "DarkGreen"))))
- (message-header-newsgroups-face ((t (:bold t :foreground "yellow"))))
- (message-header-other-face ((t (:foreground "#b00000"))))
- (message-header-subject-face ((t (:foreground "green3"))))
- (message-header-to-face ((t (:bold t :foreground "green2"))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-mml-face ((t (:foreground "ForestGreen"))))
- (message-separator-face ((t (:foreground "blue3"))))
- (mode-line ((t (:background "Gray80" :foreground "black"))))
- (modeline ((t (:background "Gray80" :foreground "black"))))
- (modeline-buffer-id ((t (:background "Gray80" :foreground "blue4"))))
- (modeline-mousable ((t (:background "Gray80" :foreground "firebrick"))))
- (modeline-mousable-minor-mode ((t (:background "Gray80" :foreground "green4"))))
- (pointer ((t (:foreground "White"))))
- (primary-selection ((t (:background "gray65"))))
- (red ((t (:foreground "red"))))
- (region ((t (:background "gray65"))))
- (right-margin ((t (nil))))
- (rpm-spec-dir-face ((t (:foreground "green"))))
- (rpm-spec-doc-face ((t (:foreground "magenta"))))
- (rpm-spec-ghost-face ((t (:foreground "red"))))
- (rpm-spec-macro-face ((t (:foreground "yellow"))))
- (rpm-spec-package-face ((t (:foreground "red"))))
- (rpm-spec-tag-face ((t (:foreground "blue"))))
- (rpm-spec-var-face ((t (:foreground "maroon"))))
- (secondary-selection ((t (:background "paleturquoise"))))
- (text-cursor ((t (:background "Pink" :foreground "Black"))))
- (tool-bar ((t (nil))))
- (toolbar ((t (:background "Gray80" :foreground "black"))))
- (underline ((t (:underline t))))
- (vertical-divider ((t (:background "Gray80" :foreground "black"))))
- (widget ((t (:size "12" :background "Gray80" :foreground "black"))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "lime green"))))
- (widget-field-face ((t (:background "dim gray"))))
- (widget-inactive-face ((t (:foreground "light gray"))))
- (yellow ((t (:foreground "yellow"))))
- (zmacs-region ((t (:background "gray65")))))))
-
-(defun color-theme-emacs-nw ()
- "Follow emacs21's color-theme, with -nw getting 100% compatibility.
-
-Alex's `color-theme-emacs-21' follows emacs21's theme, but in the
-current scheme of things, that means that when it works on X, it won't
-work in -nw perfectly. The modeline and menuline will have same
-colors as the rest of emacs, which can be particularly disturbing when
-there are multiple windows.
-
-OTOH, `color-theme-emacs-nw' follows emacs21's theme but the goal is
-100% -nw compatibility, and in X; we shall try for decent color
-scheme, and as much compability default emacs21's X as possble.
-Bugs to deego@gnufans.org.
-
-TODO: Try to make this theme relative to color-theme-emacs-21 rather
-than absolute, viz: call that first and then tweak minor stuff."
- (interactive)
- (color-theme-install
- '(color-theme-emacs-nw
- ((background-color . "white")
- (background-mode . light)
- (border-color . "black")
- (cursor-color . "black")
- (foreground-color . "black")
- (mouse-color . "black"))
- ((Man-overstrike-face . bold)
- (Man-underline-face . underline)
- (cperl-here-face . font-lock-string-face)
- (cperl-invalid-face . underline)
- (cperl-pod-face . font-lock-comment-face)
- (cperl-pod-head-face . font-lock-variable-name-face)
- (gnus-article-button-face . bold)
- (gnus-article-mouse-face . highlight)
- (gnus-cite-attribution-face . gnus-cite-attribution-face)
- (gnus-mouse-face . highlight)
- (gnus-signature-face . gnus-signature-face)
- (gnus-summary-selected-face . gnus-summary-selected-face)
- (help-highlight-face . underline)
- (idlwave-class-arrow-face . bold)
- (idlwave-shell-breakpoint-face . idlwave-shell-bp-face)
- (idlwave-shell-expression-face . secondary-selection)
- (idlwave-shell-stop-line-face . highlight)
- (ispell-highlight-face . highlight)
- (list-matching-lines-face . bold)
- (view-highlight-face . highlight)
- (viper-insert-state-cursor-color . "Green")
- (viper-replace-overlay-cursor-color . "Red")
- (widget-mouse-face . highlight))
- (default ((t (:stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (Info-title-1-face ((t (:bold t :weight bold :family "helv" :height 1.728))))
- (Info-title-2-face ((t (:bold t :family "helv" :weight bold :height 1.44))))
- (Info-title-3-face ((t (:bold t :weight bold :family "helv" :height 1.2))))
- (Info-title-4-face ((t (:bold t :family "helv" :weight bold))))
- (antlr-font-lock-keyword-face ((t (:bold t :foreground "black" :weight bold))))
- (antlr-font-lock-literal-face ((t (:bold t :foreground "brown4" :weight bold))))
- (antlr-font-lock-ruledef-face ((t (:bold t :foreground "blue" :weight bold))))
- (antlr-font-lock-ruleref-face ((t (:foreground "blue4"))))
- (antlr-font-lock-tokendef-face ((t (:bold t :foreground "blue" :weight bold))))
- (antlr-font-lock-tokenref-face ((t (:foreground "orange4"))))
- (bold ((t (:bold t :weight bold))))
- (bold-italic ((t (:italic t :bold t :slant italic :weight bold))))
- (border ((t (:background "black"))))
- (calendar-today-face ((t (:underline t))))
- (change-log-acknowledgement-face ((t (:foreground "Firebrick"))))
- (change-log-conditionals-face ((t (:foreground "DarkGoldenrod"))))
- (change-log-date-face ((t (:foreground "RosyBrown"))))
- (change-log-email-face ((t (:foreground "DarkGoldenrod"))))
- (change-log-file-face ((t (:foreground "Blue"))))
- (change-log-function-face ((t (:foreground "DarkGoldenrod"))))
- (change-log-list-face ((t (:foreground "Purple"))))
- (change-log-name-face ((t (:foreground "CadetBlue"))))
- (comint-highlight-input ((t (:bold t :weight bold))))
- (comint-highlight-prompt ((t (:foreground "dark blue"))))
- (cperl-array-face ((t (:bold t :background "lightyellow2" :foreground "Blue" :weight bold))))
- (cperl-hash-face ((t (:italic t :bold t :background "lightyellow2" :foreground "Red" :slant italic :weight bold))))
- (cperl-nonoverridable-face ((t (:foreground "chartreuse3"))))
- (cursor ((t (:background "black"))))
- (custom-button-face ((t (:background "lightgrey" :foreground "black" :box (:line-width 2 :style released-button)))))
- (custom-button-pressed-face ((t (:background "lightgrey" :foreground "black" :box (:line-width 2 :style pressed-button)))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-comment-face ((t (:background "gray85"))))
- (custom-comment-tag-face ((t (:foreground "blue4"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:bold t :family "helv" :weight bold :height 1.2))))
- (custom-group-tag-face ((t (:bold t :foreground "blue" :weight bold :height 1.2))))
- (custom-group-tag-face-1 ((t (:bold t :family "helv" :foreground "red" :weight bold :height 1.2))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "dark green"))))
- (custom-variable-button-face ((t (:bold t :underline t :weight bold))))
- (custom-variable-tag-face ((t (:bold t :family "helv" :foreground "blue" :weight bold :height 1.2))))
- (cvs-filename-face ((t (:foreground "blue4"))))
- (cvs-handled-face ((t (:foreground "pink"))))
- (cvs-header-face ((t (:bold t :foreground "blue4" :weight bold))))
- (cvs-marked-face ((t (:bold t :foreground "green3" :weight bold))))
- (cvs-msg-face ((t (:italic t :slant italic))))
- (cvs-need-action-face ((t (:foreground "orange"))))
- (cvs-unknown-face ((t (:foreground "red"))))
- (diary-face ((t (:foreground "red"))))
- (diff-added-face ((t (nil))))
- (diff-changed-face ((t (nil))))
- (diff-context-face ((t (:foreground "grey50"))))
- (diff-file-header-face ((t (:bold t :background "grey70" :weight bold))))
- (diff-function-face ((t (:foreground "grey50"))))
- (diff-header-face ((t (:background "grey85"))))
- (diff-hunk-header-face ((t (:background "grey85"))))
- (diff-index-face ((t (:bold t :weight bold :background "grey70"))))
- (diff-nonexistent-face ((t (:bold t :weight bold :background "grey70"))))
- (diff-removed-face ((t (nil))))
- (dired-face-boring ((t (:foreground "RosyBrown"))))
- (dired-face-directory ((t (:foreground "Blue"))))
- (dired-face-executable ((t (nil))))
- (dired-face-flagged ((t (:foreground "Red" :weight bold))))
- (dired-face-marked ((t (:foreground "Red" :weight bold))))
- (dired-face-permissions ((t (nil))))
- (dired-face-setuid ((t (nil))))
- (dired-face-socket ((t (nil))))
- (dired-face-symlink ((t (:foreground "Purple"))))
- (ebrowse-default-face ((t (nil))))
- (ebrowse-file-name-face ((t (:italic t :slant italic))))
- (ebrowse-member-attribute-face ((t (:foreground "red"))))
- (ebrowse-member-class-face ((t (:foreground "purple"))))
- (ebrowse-progress-face ((t (:background "blue"))))
- (ebrowse-root-class-face ((t (:bold t :foreground "blue" :weight bold))))
- (ebrowse-tree-mark-face ((t (:foreground "red"))))
- (ediff-current-diff-face-A ((t (:background "pale green" :foreground "firebrick"))))
- (ediff-current-diff-face-Ancestor ((t (:background "VioletRed" :foreground "Black"))))
- (ediff-current-diff-face-B ((t (:background "Yellow" :foreground "DarkOrchid"))))
- (ediff-current-diff-face-C ((t (:background "Pink" :foreground "Navy"))))
- (ediff-even-diff-face-A ((t (:background "light grey" :foreground "Black"))))
- (ediff-even-diff-face-Ancestor ((t (:background "Grey" :foreground "White"))))
- (ediff-even-diff-face-B ((t (:background "Grey" :foreground "White"))))
- (ediff-even-diff-face-C ((t (:background "light grey" :foreground "Black"))))
- (ediff-fine-diff-face-A ((t (:background "sky blue" :foreground "Navy"))))
- (ediff-fine-diff-face-Ancestor ((t (:background "Green" :foreground "Black"))))
- (ediff-fine-diff-face-B ((t (:background "cyan" :foreground "Black"))))
- (ediff-fine-diff-face-C ((t (:background "Turquoise" :foreground "Black"))))
- (ediff-odd-diff-face-A ((t (:background "Grey" :foreground "White"))))
- (ediff-odd-diff-face-Ancestor ((t (:background "light grey" :foreground "Black"))))
- (ediff-odd-diff-face-B ((t (:background "light grey" :foreground "Black"))))
- (ediff-odd-diff-face-C ((t (:background "Grey" :foreground "White"))))
- (eshell-ls-archive-face ((t (:bold t :foreground "Orchid" :weight bold))))
- (eshell-ls-backup-face ((t (:foreground "OrangeRed"))))
- (eshell-ls-clutter-face ((t (:bold t :foreground "OrangeRed" :weight bold))))
- (eshell-ls-directory-face ((t (:bold t :foreground "Blue" :weight bold))))
- (eshell-ls-executable-face ((t (:bold t :foreground "ForestGreen" :weight bold))))
- (eshell-ls-missing-face ((t (:bold t :foreground "Red" :weight bold))))
- (eshell-ls-product-face ((t (:foreground "OrangeRed"))))
- (eshell-ls-readonly-face ((t (:foreground "Brown"))))
- (eshell-ls-special-face ((t (:bold t :foreground "Magenta" :weight bold))))
- (eshell-ls-symlink-face ((t (:bold t :foreground "Dark Cyan" :weight bold))))
- (eshell-ls-unreadable-face ((t (:foreground "Grey30"))))
- (eshell-prompt-face ((t (:bold t :foreground "Red" :weight bold))))
- (eshell-test-failed-face ((t (:bold t :foreground "OrangeRed" :weight bold))))
- (eshell-test-ok-face ((t (:bold t :foreground "Green" :weight bold))))
- (excerpt ((t (:italic t :slant italic))))
- (fixed ((t (:bold t :weight bold))))
- (fixed-pitch ((t (:family "courier"))))
- (flyspell-duplicate-face ((t (:bold t :foreground "Gold3" :underline t :weight bold))))
- (flyspell-incorrect-face ((t (:bold t :foreground "OrangeRed" :underline t :weight bold))))
- (font-lock-builtin-face ((t (:foreground "Orchid"))))
- (font-lock-comment-face ((t (:foreground "Firebrick"))))
- (font-lock-constant-face ((t (:foreground "CadetBlue"))))
- (font-lock-doc-face ((t (:foreground "RosyBrown"))))
- (font-lock-doc-string-face ((t (:foreground "RosyBrown"))))
- (font-lock-function-name-face ((t (:foreground "Blue"))))
- (font-lock-keyword-face ((t (:foreground "Purple"))))
- (font-lock-preprocessor-face ((t (:foreground "CadetBlue"))))
- (font-lock-reference-face ((t (:foreground "Orchid"))))
- (font-lock-string-face ((t (:foreground "RosyBrown"))))
- (font-lock-type-face ((t (:foreground "ForestGreen"))))
- (font-lock-variable-name-face ((t (:foreground "DarkGoldenrod"))))
- (font-lock-warning-face ((t (:bold t :foreground "Red" :weight bold))))
- (fringe ((t (:background "grey95"))))
- (gnus-cite-attribution-face ((t (:italic t :slant italic))))
- (gnus-cite-face-1 ((t (:foreground "MidnightBlue"))))
- (gnus-cite-face-10 ((t (:foreground "medium purple"))))
- (gnus-cite-face-11 ((t (:foreground "turquoise"))))
- (gnus-cite-face-2 ((t (:foreground "firebrick"))))
- (gnus-cite-face-3 ((t (:foreground "dark green"))))
- (gnus-cite-face-4 ((t (:foreground "OrangeRed"))))
- (gnus-cite-face-5 ((t (:foreground "dark khaki"))))
- (gnus-cite-face-6 ((t (:foreground "dark violet"))))
- (gnus-cite-face-7 ((t (:foreground "SteelBlue4"))))
- (gnus-cite-face-8 ((t (:foreground "magenta"))))
- (gnus-cite-face-9 ((t (:foreground "violet"))))
- (gnus-emphasis-bold ((t (:bold t :weight bold))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t :slant italic :weight bold))))
- (gnus-emphasis-highlight-words ((t (:background "black" :foreground "yellow"))))
- (gnus-emphasis-italic ((t (:italic t :slant italic))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:bold t :underline t :weight bold))))
- (gnus-emphasis-underline-bold-italic ((t (:italic t :bold t :underline t :slant italic :weight bold))))
- (gnus-emphasis-underline-italic ((t (:italic t :underline t :slant italic))))
- (gnus-group-mail-1-empty-face ((t (:foreground "DeepPink3"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "DeepPink3" :weight bold))))
- (gnus-group-mail-2-empty-face ((t (:foreground "HotPink3"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "HotPink3" :weight bold))))
- (gnus-group-mail-3-empty-face ((t (:foreground "magenta4"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "magenta4" :weight bold))))
- (gnus-group-mail-low-empty-face ((t (:foreground "DeepPink4"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "DeepPink4" :weight bold))))
- (gnus-group-news-1-empty-face ((t (:foreground "ForestGreen"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "ForestGreen" :weight bold))))
- (gnus-group-news-2-empty-face ((t (:foreground "CadetBlue4"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "CadetBlue4" :weight bold))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (:bold t :weight bold))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (:bold t :weight bold))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (:bold t :weight bold))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (:bold t :weight bold))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkGreen"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "DarkGreen" :weight bold))))
- (gnus-header-content-face ((t (:italic t :foreground "indianred4" :slant italic))))
- (gnus-header-from-face ((t (:foreground "red3"))))
- (gnus-header-name-face ((t (:foreground "maroon"))))
- (gnus-header-newsgroups-face ((t (:italic t :foreground "MidnightBlue" :slant italic))))
- (gnus-header-subject-face ((t (:foreground "red4"))))
- (gnus-signature-face ((t (:italic t :slant italic))))
- (gnus-splash-face ((t (:foreground "Brown"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "RoyalBlue" :weight bold))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "DarkGreen" :weight bold))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "firebrick" :weight bold))))
- (gnus-summary-high-unread-face ((t (:bold t :weight bold))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "RoyalBlue" :slant italic))))
- (gnus-summary-low-read-face ((t (:italic t :foreground "DarkGreen" :slant italic))))
- (gnus-summary-low-ticked-face ((t (:italic t :foreground "firebrick" :slant italic))))
- (gnus-summary-low-unread-face ((t (:italic t :slant italic))))
- (gnus-summary-normal-ancient-face ((t (:foreground "RoyalBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "DarkGreen"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "firebrick"))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-selected-face ((t (:underline t))))
- (header-line ((t (:box (:line-width -1 :style released-button) :background "grey90" :foreground "grey20" :box nil))))
- (hi-black-b ((t (:bold t :weight bold))))
- (hi-black-hb ((t (:bold t :family "helv" :weight bold :height 1.67))))
- (hi-blue ((t (:background "light blue"))))
- (hi-blue-b ((t (:bold t :foreground "blue" :weight bold))))
- (hi-green ((t (:background "green"))))
- (hi-green-b ((t (:bold t :foreground "green" :weight bold))))
- (hi-pink ((t (:background "pink"))))
- (hi-red-b ((t (:bold t :foreground "red" :weight bold))))
- (hi-yellow ((t (:background "yellow"))))
- (highlight ((t (:background "darkseagreen2"))))
- (highlight-changes-delete-face ((t (:foreground "red" :underline t))))
- (highlight-changes-face ((t (:foreground "red"))))
- (holiday-face ((t (:background "pink"))))
- (idlwave-help-link-face ((t (:foreground "Blue"))))
- (idlwave-shell-bp-face ((t (:background "Pink" :foreground "Black"))))
- (info-header-node ((t (:italic t :bold t :weight bold :slant italic :foreground "brown"))))
- (info-header-xref ((t (:bold t :weight bold :foreground "magenta4"))))
- (info-menu-5 ((t (:foreground "red1"))))
- (info-menu-header ((t (:bold t :family "helv" :weight bold))))
- (info-node ((t (:italic t :bold t :foreground "brown" :slant italic :weight bold))))
- (info-xref ((t (:bold t :foreground "magenta4" :weight bold))))
- (isearch ((t (:background "magenta4" :foreground "lightskyblue1"))))
- (isearch-lazy-highlight-face ((t (:background "paleturquoise"))))
- (italic ((t (:italic t :slant italic))))
- (log-view-file-face ((t (:bold t :background "grey70" :weight bold))))
- (log-view-message-face ((t (:background "grey85"))))
- (makefile-space-face ((t (:background "hotpink"))))
- (menu ((t (:background "grey50" :foreground "white" :box (:line-width -1 :style released-button)))))
- (message-cited-text-face ((t (:foreground "red"))))
- (message-header-cc-face ((t (:foreground "MidnightBlue"))))
- (message-header-name-face ((t (:foreground "cornflower blue"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "blue4" :slant italic :weight bold))))
- (message-header-other-face ((t (:foreground "steel blue"))))
- (message-header-subject-face ((t (:bold t :foreground "navy blue" :weight bold))))
- (message-header-to-face ((t (:bold t :foreground "MidnightBlue" :weight bold))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-mml-face ((t (:foreground "ForestGreen"))))
- (message-separator-face ((t (:foreground "brown"))))
- (mode-line ((t (:background "grey50" :foreground "white" :box (:line-width -1 :style released-button)))))
- (modeline ((t (:background "grey50" :foreground "white" :box (:line-width -1 :style released-button)))))
- (modeline-buffer-id ((t (:bold t :background "grey75" :foreground "black" :box (:line-width -1 :style released-button)))))
- (modeline-mousable ((t (:background "grey75" :foreground "black" :box (:line-width -1 :style released-button)))))
- (modeline-mousable-minor-mode ((t (:background "grey75" :foreground "black" :box (:line-width -1 :style released-button)))))
- (mouse ((t (:background "black"))))
- (primary-selection ((t (:background "lightgoldenrod2"))))
- (reb-match-0 ((t (:background "lightblue"))))
- (reb-match-1 ((t (:background "aquamarine"))))
- (reb-match-2 ((t (:background "springgreen"))))
- (reb-match-3 ((t (:background "yellow"))))
- (region ((t (:background "lightgoldenrod2"))))
- (scroll-bar ((t (:background "grey75"))))
- (secondary-selection ((t (:background "yellow"))))
- (sh-heredoc-face ((t (:foreground "tan"))))
- (show-paren-match-face ((t (:background "turquoise"))))
- (show-paren-mismatch-face ((t (:background "purple" :foreground "white"))))
- (show-tabs-space-face ((t (:foreground "yellow"))))
- (show-tabs-tab-face ((t (:foreground "red"))))
- (smerge-base-face ((t (:foreground "red"))))
- (smerge-markers-face ((t (:background "grey85"))))
- (smerge-mine-face ((t (:foreground "blue"))))
- (smerge-other-face ((t (:foreground "darkgreen"))))
- (speedbar-button-face ((t (:foreground "green4"))))
- (speedbar-directory-face ((t (:foreground "blue4"))))
- (speedbar-file-face ((t (:foreground "cyan4"))))
- (speedbar-highlight-face ((t (:background "green"))))
- (speedbar-selected-face ((t (:foreground "red" :underline t))))
- (speedbar-tag-face ((t (:foreground "brown"))))
- (strokes-char-face ((t (:background "lightgray"))))
- (term-black ((t (:stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-blackbg ((t (:stipple nil :background "black" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-blue ((t (:stipple nil :background "white" :foreground "blue" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-bluebg ((t (:stipple nil :background "blue" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-bold ((t (:bold t :stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight bold :width normal :family "adobe-courier"))))
- (term-cyan ((t (:stipple nil :background "white" :foreground "cyan" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-cyanbg ((t (:stipple nil :background "cyan" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-default ((t (:stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-default-bg ((t (:stipple nil :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-default-bg-inv ((t (:stipple nil :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-default-fg ((t (:stipple nil :background "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-default-fg-inv ((t (:stipple nil :background "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-green ((t (:stipple nil :background "white" :foreground "green" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-greenbg ((t (:stipple nil :background "green" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-invisible ((t (:stipple nil :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-invisible-inv ((t (:stipple nil :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-magenta ((t (:stipple nil :background "white" :foreground "magenta" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-magentabg ((t (:stipple nil :background "magenta" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-red ((t (:stipple nil :background "white" :foreground "red" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-redbg ((t (:stipple nil :background "red" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-underline ((t (:stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline t :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-white ((t (:stipple nil :background "white" :foreground "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-whitebg ((t (:stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-yellow ((t (:stipple nil :background "white" :foreground "yellow" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (term-yellowbg ((t (:stipple nil :background "yellow" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :family "adobe-courier"))))
- (tex-math-face ((t (:foreground "RosyBrown"))))
- (texinfo-heading-face ((t (:foreground "Blue"))))
- (tool-bar ((t (:background "grey75" :foreground "black" :box (:line-width 1 :style released-button)))))
- (tooltip ((t (:background "lightyellow" :foreground "black"))))
- (trailing-whitespace ((t (:background "red"))))
- (underline ((t (:underline t))))
- (variable-pitch ((t (:family "helv"))))
- (vcursor ((t (:background "cyan" :foreground "blue" :underline t))))
- (vhdl-font-lock-attribute-face ((t (:foreground "Orchid"))))
- (vhdl-font-lock-directive-face ((t (:foreground "CadetBlue"))))
- (vhdl-font-lock-enumvalue-face ((t (:foreground "Gold4"))))
- (vhdl-font-lock-function-face ((t (:foreground "Orchid4"))))
- (vhdl-font-lock-prompt-face ((t (:bold t :foreground "Red" :weight bold))))
- (vhdl-font-lock-reserved-words-face ((t (:bold t :foreground "Orange" :weight bold))))
- (vhdl-font-lock-translate-off-face ((t (:background "LightGray"))))
- (vhdl-speedbar-architecture-face ((t (:foreground "Blue"))))
- (vhdl-speedbar-architecture-selected-face ((t (:foreground "Blue" :underline t))))
- (vhdl-speedbar-configuration-face ((t (:foreground "DarkGoldenrod"))))
- (vhdl-speedbar-configuration-selected-face ((t (:foreground "DarkGoldenrod" :underline t))))
- (vhdl-speedbar-entity-face ((t (:foreground "ForestGreen"))))
- (vhdl-speedbar-entity-selected-face ((t (:foreground "ForestGreen" :underline t))))
- (vhdl-speedbar-instantiation-face ((t (:foreground "Brown"))))
- (vhdl-speedbar-instantiation-selected-face ((t (:foreground "Brown" :underline t))))
- (vhdl-speedbar-package-face ((t (:foreground "Grey50"))))
- (vhdl-speedbar-package-selected-face ((t (:foreground "Grey50" :underline t))))
- (viper-minibuffer-emacs-face ((t (:background "darkseagreen2" :foreground "Black"))))
- (viper-minibuffer-insert-face ((t (:background "pink" :foreground "Black"))))
- (viper-minibuffer-vi-face ((t (:background "grey" :foreground "DarkGreen"))))
- (viper-replace-overlay-face ((t (:background "darkseagreen2" :foreground "Black"))))
- (viper-search-face ((t (:background "khaki" :foreground "Black"))))
- (widget-button-face ((t (:bold t :weight bold))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (widget-single-line-field-face ((t (:background "gray85"))))
- (woman-addition-face ((t (:foreground "orange"))))
- (woman-bold-face ((t (:bold t :foreground "blue" :weight bold))))
- (woman-italic-face ((t (:italic t :foreground "red" :underline t :slant italic))))
- (woman-unknown-face ((t (:foreground "brown"))))
- (zmacs-region ((t (:background "lightgoldenrod2")))))))
-
-(defun color-theme-late-night ()
- "Color theme by Alex Schroeder, created 2003-08-07.
-This theme is for use late at night, with only little light in the room.
-The goal was to make something as dark and subtle as the text console in
-its default 80x25 state -- dark grey on black."
- (interactive)
- (let ((color-theme-is-cumulative t))
- (color-theme-dark-erc)
- (color-theme-dark-gnus)
- ;; (color-theme-dark-diff)
- ;; (color-theme-dark-eshell)
- (color-theme-dark-info)
- (color-theme-dark-font-lock)
- (color-theme-install
- '(color-theme-late-night
- ((background-color . "#000")
- (background-mode . dark)
- (background-toolbar-color . "#000")
- (border-color . "#000")
- (bottom-toolbar-shadow-color . "#000")
- (cursor-color . "#888")
- (foreground-color . "#666")
- (top-toolbar-shadow-color . "#111"))
- (default ((t (nil))))
- (bold ((t (:bold t))))
- (button ((t (:bold t))))
- (custom-button-face ((t (:bold t :foreground "#999"))))
- (fringe ((t (:background "#111" :foreground "#444"))))
- (header-line ((t (:background "#333" :foreground "#000"))))
- (highlight ((t (:background "dark slate blue" :foreground "light blue"))))
- (holiday-face ((t (:background "#000" :foreground "#777"))))
- (isearch ((t (:foreground "pink" :background "red"))))
- (isearch-lazy-highlight-face ((t (:foreground "red"))))
- (italic ((t (:bold t))))
- (menu ((t (:background "#111" :foreground "#444"))))
- (minibuffer-prompt ((t (:foreground "555"))))
- (modeline ((t (:background "#111" :foreground "#444"))))
- (mode-line-inactive ((t (:background "#000" :foreground "#444"))))
- (modeline-buffer-id ((t (:background "#000" :foreground "#555"))))
- (modeline-mousable ((t (:background "#000" :foreground "#555"))))
- (modeline-mousable-minor-mode ((t (:background "#000" :foreground "#555"))))
- (region ((t (:background "dark cyan" :foreground "cyan"))))
- (secondary-selection ((t (:background "Aquamarine" :foreground "SlateBlue"))))
- (show-paren-match-face ((t (:foreground "white" :background "light slate blue"))))
- (show-paren-mismatch-face ((t (:foreground "white" :background "red"))))
- (tool-bar ((t (:background "#111" :foreground "#777"))))
- (tooltip ((t (:background "#333" :foreground "#777"))))
- (underline ((t (:bold t))))
- (variable-pitch ((t (nil))))
- (widget-button-face ((t (:bold t :foreground "#888"))))
- (widget-field-face ((t (:bold t :foreground "#999"))))))))
-
-(defun color-theme-clarity ()
- "White on black color theme by Richard Wellum, created 2003-01-16."
- (interactive)
- (color-theme-install
- '(color-theme-clarity
- ((background-color . "black")
- (background-mode . dark)
- (border-color . "white")
- (cursor-color . "yellow")
- (foreground-color . "white")
- (mouse-color . "white"))
- ((CUA-mode-global-mark-cursor-color . "cyan")
- (CUA-mode-normal-cursor-color . "yellow")
- (CUA-mode-overwrite-cursor-color . "red")
- (CUA-mode-read-only-cursor-color . "green")
- (help-highlight-face . underline)
- (ibuffer-dired-buffer-face . font-lock-function-name-face)
- (ibuffer-help-buffer-face . font-lock-comment-face)
- (ibuffer-hidden-buffer-face . font-lock-warning-face)
- (ibuffer-occur-match-face . font-lock-warning-face)
- (ibuffer-read-only-buffer-face . font-lock-type-face)
- (ibuffer-special-buffer-face . font-lock-keyword-face)
- (ibuffer-title-face . font-lock-type-face)
- (list-matching-lines-face . bold)
- (ps-line-number-color . "black")
- (ps-zebra-color . 0.95)
- (tags-tag-face . default)
- (view-highlight-face . highlight)
- (widget-mouse-face . highlight))
- (default ((t (nil))))
- (CUA-global-mark-face ((t (:background "cyan" :foreground "black"))))
- (CUA-rectangle-face ((t (:background "maroon" :foreground "white"))))
- (CUA-rectangle-noselect-face ((t (:background "dimgray" :foreground "white"))))
- (bold ((t (:bold t :weight bold))))
- (bold-italic ((t (:italic t :bold t :slant italic :weight bold))))
- (border ((t (:background "white"))))
- (clearcase-dired-checkedout-face ((t (:foreground "red"))))
- (comint-highlight-input ((t (:bold t :weight bold))))
- (comint-highlight-prompt ((t (:foreground "cyan"))))
- (cursor ((t (:background "yellow"))))
- (fixed-pitch ((t (:family "courier"))))
- (flash-paren-face-off ((t (nil))))
- (flash-paren-face-on ((t (nil))))
- (flash-paren-face-region ((t (nil))))
- (font-lock-builtin-face ((t (:foreground "LightSteelBlue"))))
- (font-lock-comment-face ((t (:foreground "OrangeRed"))))
- (font-lock-constant-face ((t (:foreground "Aquamarine"))))
- (font-lock-doc-face ((t (:foreground "LightSalmon"))))
- (font-lock-function-name-face ((t (:foreground "LightSkyBlue"))))
- (font-lock-keyword-face ((t (:foreground "Cyan"))))
- (font-lock-string-face ((t (:foreground "LightSalmon"))))
- (font-lock-type-face ((t (:foreground "PaleGreen"))))
- (font-lock-variable-name-face ((t (:foreground "LightGoldenrod"))))
- (font-lock-warning-face ((t (:bold t :foreground "Pink" :weight bold))))
- (fringe ((t (:background "grey10"))))
- (header-line ((t (:box (:line-width -1 :style released-button) :foreground "grey20" :background "grey90" :box nil))))
- (highlight ((t (:background "darkolivegreen"))))
- (ibuffer-deletion-face ((t (:foreground "red"))))
- (ibuffer-marked-face ((t (:foreground "green"))))
- (isearch ((t (:background "palevioletred2" :foreground "brown4"))))
- (isearch-lazy-highlight-face ((t (:background "paleturquoise4"))))
- (italic ((t (:italic t :slant italic))))
- (menu ((t (nil))))
- (mode-line ((t (:foreground "yellow" :background "darkslateblue" :box (:line-width -1 :style released-button)))))
- (mouse ((t (:background "white"))))
- (region ((t (:background "blue"))))
- (scroll-bar ((t (nil))))
- (secondary-selection ((t (:background "darkslateblue"))))
- (show-block-face1 ((t (:background "gray10"))))
- (show-block-face2 ((t (:background "gray15"))))
- (show-block-face3 ((t (:background "gray20"))))
- (show-block-face4 ((t (:background "gray25"))))
- (show-block-face5 ((t (:background "gray30"))))
- (show-block-face6 ((t (:background "gray35"))))
- (show-block-face7 ((t (:background "gray40"))))
- (show-block-face8 ((t (:background "gray45"))))
- (show-block-face9 ((t (:background "gray50"))))
- (show-paren-match-face ((t (:background "turquoise"))))
- (show-paren-mismatch-face ((t (:background "purple" :foreground "white"))))
- (tool-bar ((t (:background "grey75" :foreground "black" :box (:line-width 1 :style released-button)))))
- (tooltip ((t (:background "lightyellow" :foreground "black"))))
- (trailing-whitespace ((t (:background "red"))))
- (underline ((t (:underline t))))
- (variable-pitch ((t (:family "helv"))))
- (widget-button-face ((t (:bold t :weight bold))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "lime green"))))
- (widget-field-face ((t (:background "dim gray"))))
- (widget-inactive-face ((t (:foreground "light gray"))))
- (widget-single-line-field-face ((t (:background "dim gray")))))))
-
-(defun color-theme-andreas ()
- "Color theme by Andreas Busch, created 2003-02-06."
- (interactive)
- (color-theme-install
- '(color-theme-andreas
- ((background-mode . light)
- (background-color . "white")
- (background-toolbar-color . "#cccccccccccc")
- (border-color . "#000000000000")
- (bottom-toolbar-shadow-color . "#7a7a7a7a7a7a")
- (foreground-color . "black")
- (top-toolbar-shadow-color . "#f5f5f5f5f5f5"))
- ((gnus-mouse-face . highlight)
- (ispell-highlight-face . highlight))
- (default ((t (nil))))
- (OrangeRed ((t (nil))))
- (blue ((t (:foreground "blue"))))
- (bold ((t (:bold t))))
- (bold-italic ((t (:italic t :bold t))))
- (border-glyph ((t (nil))))
- (calendar-today-face ((t (:underline t))))
- (color-mode-face-@ ((t (:foreground "orange"))))
- (color-mode-face-a ((t (:foreground "blue"))))
- (color-mode-face-b ((t (:foreground "red"))))
- (color-mode-face-c ((t (:foreground "green3"))))
- (color-mode-face-d ((t (:background "red" :foreground "white"))))
- (color-mode-face-e ((t (:background "orange" :foreground "blue"))))
- (color-mode-face-f ((t (:background "blue" :foreground "yellow"))))
- (color-mode-face-g ((t (:background "lightblue" :foreground "brown"))))
- (color-mode-face-h ((t (:background "brown" :foreground "white"))))
- (custom-button-face ((t (:bold t))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:underline t))))
- (custom-group-tag-face ((t (:underline t :foreground "blue"))))
- (custom-group-tag-face-1 ((t (:underline t :foreground "red"))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "dark green"))))
- (custom-variable-button-face ((t (:underline t :bold t :background "gray90"))))
- (custom-variable-tag-face ((t (:underline t :background "gray95" :foreground "blue"))))
- (diary-face ((t (:foreground "red"))))
- (display-time-mail-balloon-enhance-face ((t (:background "orange"))))
- (display-time-mail-balloon-gnus-group-face ((t (:foreground "blue"))))
- (display-time-time-balloon-face ((t (:foreground "red"))))
- (emacs-wiki-bad-link-face ((t (:bold t :foreground "red"))))
- (emacs-wiki-link-face ((t (:bold t :foreground "green"))))
- (font-lock-comment-face ((t (:foreground "orange1"))))
- (font-lock-doc-string-face ((t (:foreground "green4"))))
- (font-lock-function-name-face ((t (:foreground "blue3"))))
- (font-lock-keyword-face ((t (:foreground "red1"))))
- (font-lock-preprocessor-face ((t (:foreground "blue3"))))
- (font-lock-reference-face ((t (:foreground "red3"))))
- (font-lock-string-face ((t (:foreground "green4"))))
- (font-lock-type-face ((t (:foreground "#6920ac"))))
- (font-lock-variable-name-face ((t (:foreground "blue3"))))
- (font-lock-warning-face ((t (:bold t :foreground "Red"))))
- (gnu-cite-face-3 ((t (nil))))
- (gnu-cite-face-4 ((t (nil))))
- (gnus-cite-attribution-face ((t (:underline t))))
- (gnus-cite-face-1 ((t (:foreground "MidnightBlue"))))
- (gnus-cite-face-10 ((t (:foreground "medium purple"))))
- (gnus-cite-face-11 ((t (:foreground "turquoise"))))
- (gnus-cite-face-2 ((t (:foreground "firebrick"))))
- (gnus-cite-face-3 ((t (:foreground "dark green"))))
- (gnus-cite-face-4 ((t (:foreground "OrangeRed"))))
- (gnus-cite-face-5 ((t (:foreground "dark khaki"))))
- (gnus-cite-face-6 ((t (:foreground "dark violet"))))
- (gnus-cite-face-7 ((t (:foreground "SteelBlue4"))))
- (gnus-cite-face-8 ((t (:foreground "magenta"))))
- (gnus-cite-face-9 ((t (:foreground "violet"))))
- (gnus-emphasis-bold ((t (:bold t))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t))))
- (gnus-emphasis-italic ((t (:italic t))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:underline t :bold t))))
- (gnus-emphasis-underline-bold-italic ((t (:underline t :italic t :bold t))))
- (gnus-emphasis-underline-italic ((t (:underline t :italic t))))
- (gnus-group-mail-1-empty-face ((t (:foreground "DeepPink3"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "DeepPink3"))))
- (gnus-group-mail-2-empty-face ((t (:foreground "HotPink3"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "HotPink3"))))
- (gnus-group-mail-3-empty-face ((t (:foreground "magenta4"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "magenta4"))))
- (gnus-group-mail-low-empty-face ((t (:foreground "DeepPink4"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "DeepPink4"))))
- (gnus-group-news-1-empty-face ((t (:foreground "ForestGreen"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "ForestGreen"))))
- (gnus-group-news-2-empty-face ((t (:foreground "CadetBlue4"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "CadetBlue4"))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (:bold t))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (:bold t))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (:bold t))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (:bold t))))
- (gnus-group-news-low-empty-face ((t (:foreground "DarkGreen"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "DarkGreen"))))
- (gnus-header-content-face ((t (:italic t :foreground "indianred4"))))
- (gnus-header-from-face ((t (:bold t :foreground "red3"))))
- (gnus-header-name-face ((t (:foreground "maroon"))))
- (gnus-header-newsgroups-face ((t (:italic t :bold t :foreground "MidnightBlue"))))
- (gnus-header-subject-face ((t (:bold t :foreground "red4"))))
- (gnus-splash-face ((t (:foreground "red"))))
- (gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "RoyalBlue"))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "DarkGreen"))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "DarkRed"))))
- (gnus-summary-high-unread-face ((t (:bold t))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "RoyalBlue"))))
- (gnus-summary-low-read-face ((t (:italic t :foreground "DarkGreen"))))
- (gnus-summary-low-ticked-face ((t (:italic t :foreground "firebrick"))))
- (gnus-summary-low-unread-face ((t (:italic t))))
- (gnus-summary-normal-ancient-face ((t (:foreground "RoyalBlue"))))
- (gnus-summary-normal-read-face ((t (:foreground "DarkGreen"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "Red"))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-selected-face ((t (:underline t))))
- (gnus-x-face ((t (nil))))
- (green ((t (:foreground "green"))))
- (gui-button-face ((t (:background "grey75"))))
- (gui-element ((t (:background "Gray80"))))
- (highlight ((t (nil))))
- (holiday-face ((t (:background "pink"))))
- (hyper-apropos-documentation ((t (:foreground "darkred"))))
- (hyper-apropos-heading ((t (:bold t))))
- (hyper-apropos-hyperlink ((t (:foreground "blue4"))))
- (hyper-apropos-major-heading ((t (:bold t))))
- (hyper-apropos-section-heading ((t (:italic t :bold t))))
- (hyper-apropos-warning ((t (:bold t :foreground "red"))))
- (info-node ((t (:italic t :bold t))))
- (info-xref ((t (:bold t))))
- (isearch ((t (:background "yellow" :foreground "red"))))
- (italic ((t (:italic t))))
- (kai-gnus-cite-face-1 ((t (:foreground "LightCyan4"))))
- (kai-gnus-cite-face-2 ((t (:foreground "LightSkyBlue2"))))
- (kai-gnus-cite-face-3 ((t (:foreground "DodgerBlue3"))))
- (kai-gnus-group-mail-face ((t (:foreground "darkslategrey"))))
- (kai-gnus-group-nonempty-mail-face ((t (:foreground "DarkRed"))))
- (kai-gnus-group-starred-face ((t (:foreground "grey50"))))
- (left-margin ((t (nil))))
- (list-mode-item-selected ((t (:background "gray68"))))
- (message-cited-text ((t (:italic t))))
- (message-cited-text-face ((t (:foreground "red"))))
- (message-header-cc-face ((t (:foreground "MidnightBlue"))))
- (message-header-contents ((t (:italic t))))
- (message-header-name-face ((t (:foreground "cornflower blue"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "blue4"))))
- (message-header-other-face ((t (:foreground "steel blue"))))
- (message-header-subject-face ((t (:bold t :foreground "navy blue"))))
- (message-header-to-face ((t (:bold t :foreground "MidnightBlue"))))
- (message-header-xheader-face ((t (:foreground "blue"))))
- (message-headers ((t (:bold t))))
- (message-highlighted-header-contents ((t (:italic t :bold t))))
- (message-mml-face ((t (:foreground "ForestGreen"))))
- (message-separator-face ((t (:foreground "brown"))))
- (modeline ((t (:background "Gray75" :foreground "Black"))))
- (modeline-buffer-id ((t (:background "Gray75" :foreground "blue4"))))
- (modeline-mousable ((t (:background "Gray75" :foreground "firebrick"))))
- (modeline-mousable-minor-mode ((t (:background "Gray75" :foreground "green4"))))
- (paren-blink-off ((t (:foreground "gray80"))))
- (paren-match ((t (:background "red" :foreground "white"))))
- (paren-mismatch ((t (:background "DeepPink"))))
- (pointer ((t (:foreground "blue"))))
- (primary-selection ((t (:background "gray65"))))
- (red ((t (:foreground "red"))))
- (region ((t (:background "gray75"))))
- (right-margin ((t (nil))))
- (secondary-selection ((t (:background "paleturquoise"))))
- (text-cursor ((t (:background "red" :foreground "LightYellow1"))))
- (toolbar ((t (:background "Gray80"))))
- (underline ((t (:underline t))))
- (vertical-divider ((t (:background "Gray80"))))
- (widget-button-face ((t (:bold t))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (x-face ((t (:background "white"))))
- (yellow ((t (:foreground "yellow"))))
- (zmacs-region ((t (:background "gray65" :foreground "yellow")))))))
-
-(defun color-theme-charcoal-black ()
- "Color theme by Lars Chr. Hausmann, created 2003-03-24."
- (interactive)
- (color-theme-install
- '(color-theme-charcoal-black
- ((background-color . "Grey15")
- (background-mode . dark)
- (border-color . "Grey")
- (cursor-color . "Grey")
- (foreground-color . "Grey")
- (mouse-color . "Grey"))
- ((display-time-mail-face . mode-line)
- (gnus-article-button-face . bold)
- (gnus-article-mouse-face . highlight)
- (gnus-mouse-face . highlight)
- (gnus-server-agent-face . gnus-server-agent-face)
- (gnus-server-closed-face . gnus-server-closed-face)
- (gnus-server-denied-face . gnus-server-denied-face)
- (gnus-server-offline-face . gnus-server-offline-face)
- (gnus-server-opened-face . gnus-server-opened-face)
- (gnus-signature-face . gnus-signature-face)
- (gnus-summary-selected-face . gnus-summary-selected-face)
- (help-highlight-face . underline)
- (list-matching-lines-face . bold)
- (mime-button-face . bold)
- (mime-button-mouse-face . highlight)
- (sgml-set-face . t)
- (tags-tag-face . default)
- (view-highlight-face . highlight)
- (widget-mouse-face . highlight))
- (default ((t (:stipple nil :background "Grey15" :foreground "Grey" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 87 :width semi-condensed :family "misc-fixed"))))
- (Info-title-1-face ((t (:bold t :weight bold :family "helv" :height 1.728))))
- (Info-title-2-face ((t (:bold t :family "helv" :weight bold :height 1.44))))
- (Info-title-3-face ((t (:bold t :weight bold :family "helv" :height 1.2))))
- (Info-title-4-face ((t (:bold t :family "helv" :weight bold))))
- (bg:erc-color-face0 ((t (nil))))
- (bg:erc-color-face1 ((t (nil))))
- (bg:erc-color-face10 ((t (nil))))
- (bg:erc-color-face11 ((t (nil))))
- (bg:erc-color-face12 ((t (nil))))
- (bg:erc-color-face13 ((t (nil))))
- (bg:erc-color-face14 ((t (nil))))
- (bg:erc-color-face15 ((t (nil))))
- (bg:erc-color-face2 ((t (nil))))
- (bg:erc-color-face3 ((t (nil))))
- (bg:erc-color-face4 ((t (nil))))
- (bg:erc-color-face5 ((t (nil))))
- (bg:erc-color-face6 ((t (nil))))
- (bg:erc-color-face7 ((t (nil))))
- (bg:erc-color-face8 ((t (nil))))
- (bg:erc-color-face9 ((t (nil))))
- (bold ((t (:bold t :weight bold))))
- (bold-italic ((t (:bold t :foreground "beige" :weight bold))))
- (border ((t (:background "Grey"))))
- (calendar-today-face ((t (:underline t))))
- (comint-highlight-input ((t (:bold t :weight bold))))
- (comint-highlight-prompt ((t (:foreground "cyan"))))
- (cperl-array-face ((t (:bold t :foreground "light salmon" :weight bold))))
- (cperl-hash-face ((t (:italic t :bold t :foreground "beige" :slant italic :weight bold))))
- (cperl-nonoverridable-face ((t (:foreground "aquamarine"))))
- (cursor ((t (:background "Grey"))))
- (custom-button-face ((t (:foreground "gainsboro"))))
- (custom-button-pressed-face ((t (:background "lightgrey" :foreground "black" :box (:line-width 2 :style pressed-button)))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-comment-face ((t (:background "dim gray"))))
- (custom-comment-tag-face ((t (:foreground "gray80"))))
- (custom-documentation-face ((t (:foreground "light blue"))))
- (custom-face-tag-face ((t (:underline t))))
- (custom-group-tag-face ((t (:bold t :foreground "pale turquoise" :weight bold))))
- (custom-group-tag-face-1 ((t (:foreground "pale turquoise" :underline t))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "light salmon"))))
- (custom-variable-button-face ((t (:bold t :underline t :weight bold))))
- (custom-variable-tag-face ((t (:bold t :foreground "turquoise" :weight bold))))
- (diary-face ((t (:foreground "red"))))
- (dired-face-directory ((t (:bold t :foreground "sky blue" :weight bold))))
- (dired-face-executable ((t (:foreground "green yellow"))))
- (dired-face-flagged ((t (:foreground "tomato"))))
- (dired-face-marked ((t (:foreground "light salmon"))))
- (dired-face-permissions ((t (:foreground "aquamarine"))))
- (erc-action-face ((t (nil))))
- (erc-bold-face ((t (:bold t :weight bold))))
- (erc-default-face ((t (nil))))
- (erc-direct-msg-face ((t (:foreground "pale green"))))
- (erc-error-face ((t (:bold t :foreground "IndianRed" :weight bold))))
- (erc-highlight-face ((t (:bold t :foreground "pale green" :weight bold))))
- (erc-input-face ((t (:foreground "light blue"))))
- (erc-inverse-face ((t (:background "steel blue"))))
- (erc-notice-face ((t (:foreground "light salmon"))))
- (erc-pal-face ((t (:foreground "pale green"))))
- (erc-prompt-face ((t (:bold t :foreground "light blue" :weight bold))))
- (eshell-ls-archive-face ((t (:bold t :foreground "medium purple" :weight bold))))
- (eshell-ls-backup-face ((t (:foreground "dim gray"))))
- (eshell-ls-clutter-face ((t (:foreground "dim gray"))))
- (eshell-ls-directory-face ((t (:bold t :foreground "medium slate blue" :weight bold))))
- (eshell-ls-executable-face ((t (:bold t :foreground "aquamarine" :weight bold))))
- (eshell-ls-missing-face ((t (:foreground "black"))))
- (eshell-ls-picture-face ((t (:foreground "violet"))))
- (eshell-ls-product-face ((t (:foreground "light steel blue"))))
- (eshell-ls-readonly-face ((t (:foreground "aquamarine"))))
- (eshell-ls-special-face ((t (:foreground "gold"))))
- (eshell-ls-symlink-face ((t (:foreground "white"))))
- (eshell-ls-unreadable-face ((t (:foreground "dim gray"))))
- (eshell-prompt-face ((t (:bold t :foreground "light sky blue" :weight bold))))
- (excerpt ((t (:italic t :slant italic))))
- (fg:erc-color-face0 ((t (:foreground "white"))))
- (fg:erc-color-face1 ((t (:foreground "beige"))))
- (fg:erc-color-face10 ((t (:foreground "pale goldenrod"))))
- (fg:erc-color-face11 ((t (:foreground "light goldenrod yellow"))))
- (fg:erc-color-face12 ((t (:foreground "light yellow"))))
- (fg:erc-color-face13 ((t (:foreground "yellow"))))
- (fg:erc-color-face14 ((t (:foreground "light goldenrod"))))
- (fg:erc-color-face15 ((t (:foreground "lime green"))))
- (fg:erc-color-face2 ((t (:foreground "lemon chiffon"))))
- (fg:erc-color-face3 ((t (:foreground "light cyan"))))
- (fg:erc-color-face4 ((t (:foreground "powder blue"))))
- (fg:erc-color-face5 ((t (:foreground "sky blue"))))
- (fg:erc-color-face6 ((t (:foreground "dark sea green"))))
- (fg:erc-color-face7 ((t (:foreground "pale green"))))
- (fg:erc-color-face8 ((t (:foreground "medium spring green"))))
- (fg:erc-color-face9 ((t (:foreground "khaki"))))
- (fixed ((t (:bold t :weight bold))))
- (fixed-pitch ((t (:family "courier"))))
- (flyspell-duplicate-face ((t (:bold t :foreground "Gold3" :underline t :weight bold))))
- (flyspell-incorrect-face ((t (:bold t :foreground "OrangeRed" :underline t :weight bold))))
- (font-lock-builtin-face ((t (:foreground "aquamarine"))))
- (font-lock-comment-face ((t (:foreground "light blue"))))
- (font-lock-constant-face ((t (:foreground "pale green"))))
- (font-lock-doc-face ((t (:foreground "light sky blue"))))
- (font-lock-doc-string-face ((t (:foreground "sky blue"))))
- (font-lock-function-name-face ((t (:bold t :foreground "aquamarine" :weight bold))))
- (font-lock-keyword-face ((t (:bold t :foreground "pale turquoise" :weight bold))))
- (font-lock-reference-face ((t (:foreground "pale green"))))
- (font-lock-string-face ((t (:foreground "light sky blue"))))
- (font-lock-type-face ((t (:bold t :foreground "sky blue" :weight bold))))
- (font-lock-variable-name-face ((t (:bold t :foreground "turquoise" :weight bold))))
- (font-lock-warning-face ((t (:bold t :foreground "Red" :weight bold))))
- (fringe ((t (:background "Grey15"))))
- (gnus-cite-face-1 ((t (:foreground "LightSalmon"))))
- (gnus-cite-face-2 ((t (:foreground "Khaki"))))
- (gnus-cite-face-3 ((t (:foreground "Coral"))))
- (gnus-cite-face-4 ((t (:foreground "yellow green"))))
- (gnus-cite-face-5 ((t (:foreground "dark khaki"))))
- (gnus-cite-face-6 ((t (:foreground "bisque"))))
- (gnus-cite-face-7 ((t (:foreground "peru"))))
- (gnus-cite-face-8 ((t (:foreground "light coral"))))
- (gnus-cite-face-9 ((t (:foreground "plum"))))
- (gnus-emphasis-bold ((t (:bold t :weight bold))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t :slant italic :weight bold))))
- (gnus-emphasis-highlight-words ((t (:background "black" :foreground "yellow"))))
- (gnus-emphasis-italic ((t (:italic t :slant italic))))
- (gnus-emphasis-strikethru ((t (nil))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:bold t :underline t :weight bold))))
- (gnus-emphasis-underline-bold-italic ((t (:italic t :bold t :underline t :slant italic :weight bold))))
- (gnus-emphasis-underline-italic ((t (:italic t :underline t :slant italic))))
- (gnus-group-mail-1-empty-face ((t (:foreground "White"))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "White" :weight bold))))
- (gnus-group-mail-2-empty-face ((t (:foreground "light cyan"))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "light cyan" :weight bold))))
- (gnus-group-mail-3-empty-face ((t (:foreground "LightBlue"))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "LightBlue" :weight bold))))
- (gnus-group-mail-low-empty-face ((t (:foreground "Aquamarine"))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "Aquamarine" :weight bold))))
- (gnus-group-news-1-empty-face ((t (:foreground "White"))))
- (gnus-group-news-1-face ((t (:bold t :foreground "White" :weight bold))))
- (gnus-group-news-2-empty-face ((t (:foreground "light cyan"))))
- (gnus-group-news-2-face ((t (:bold t :foreground "light cyan" :weight bold))))
- (gnus-group-news-3-empty-face ((t (:foreground "LightBlue"))))
- (gnus-group-news-3-face ((t (:bold t :foreground "LightBlue" :weight bold))))
- (gnus-group-news-4-empty-face ((t (:foreground "Aquamarine"))))
- (gnus-group-news-4-face ((t (:bold t :foreground "Aquamarine" :weight bold))))
- (gnus-group-news-5-empty-face ((t (:foreground "MediumAquamarine"))))
- (gnus-group-news-5-face ((t (:bold t :foreground "MediumAquamarine" :weight bold))))
- (gnus-group-news-6-empty-face ((t (:foreground "MediumAquamarine"))))
- (gnus-group-news-6-face ((t (:bold t :foreground "MediumAquamarine" :weight bold))))
- (gnus-group-news-low-empty-face ((t (:foreground "MediumAquamarine"))))
- (gnus-group-news-low-face ((t (:bold t :foreground "MediumAquamarine" :weight bold))))
- (gnus-header-content-face ((t (:foreground "LightSkyBlue3"))))
- (gnus-header-from-face ((t (:bold t :foreground "light cyan" :weight bold))))
- (gnus-header-name-face ((t (:bold t :foreground "LightBlue" :weight bold))))
- (gnus-header-newsgroups-face ((t (:italic t :bold t :foreground "MediumAquamarine" :slant italic :weight bold))))
- (gnus-header-subject-face ((t (:bold t :foreground "light cyan" :weight bold))))
- (gnus-server-agent-face ((t (:bold t :foreground "PaleTurquoise" :weight bold))))
- (gnus-server-closed-face ((t (:italic t :foreground "Light Steel Blue" :slant italic))))
- (gnus-server-denied-face ((t (:bold t :foreground "Pink" :weight bold))))
- (gnus-server-offline-face ((t (:bold t :foreground "Yellow" :weight bold))))
- (gnus-server-opened-face ((t (:bold t :foreground "Green1" :weight bold))))
- (gnus-signature-face ((t (:foreground "Grey"))))
- (gnus-splash-face ((t (:foreground "ForestGreen"))))
- (gnus-summary-cancelled-face ((t (:background "Black" :foreground "Yellow"))))
- (gnus-summary-high-ancient-face ((t (:bold t :foreground "MediumAquamarine" :weight bold))))
- (gnus-summary-high-read-face ((t (:bold t :foreground "Aquamarine" :weight bold))))
- (gnus-summary-high-ticked-face ((t (:bold t :foreground "LightSalmon" :weight bold))))
- (gnus-summary-high-unread-face ((t (:italic t :bold t :foreground "beige" :slant italic :weight bold))))
- (gnus-summary-low-ancient-face ((t (:italic t :foreground "DimGray" :slant italic))))
- (gnus-summary-low-read-face ((t (:foreground "slate gray"))))
- (gnus-summary-low-ticked-face ((t (:foreground "Pink"))))
- (gnus-summary-low-unread-face ((t (:foreground "LightGray"))))
- (gnus-summary-normal-ancient-face ((t (:foreground "MediumAquamarine"))))
- (gnus-summary-normal-read-face ((t (:foreground "Aquamarine"))))
- (gnus-summary-normal-ticked-face ((t (:foreground "LightSalmon"))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-selected-face ((t (:underline t))))
- (header-line ((t (:box (:line-width -1 :style released-button) :background "grey20" :foreground "grey90" :box nil))))
- (highlight ((t (:background "dark slate blue" :foreground "light blue"))))
- (highline-face ((t (:background "DeepSkyBlue4"))))
- (holiday-face ((t (:background "pink"))))
- (info-header-node ((t (:bold t :weight bold))))
- (info-header-xref ((t (:bold t :weight bold :foreground "sky blue"))))
- (info-menu-5 ((t (:underline t))))
- (info-menu-header ((t (:bold t :family "helv" :weight bold))))
- (info-node ((t (:bold t :weight bold))))
- (info-xref ((t (:bold t :foreground "sky blue" :weight bold))))
- (isearch ((t (:background "slate blue"))))
- (isearch-lazy-highlight-face ((t (:background "paleturquoise4"))))
- (italic ((t (:foreground "sky blue"))))
- (jde-bug-breakpoint-cursor ((t (:background "brown" :foreground "cyan"))))
- (jde-bug-breakpoint-marker ((t (:background "yellow" :foreground "red"))))
- (jde-java-font-lock-api-face ((t (:foreground "light goldenrod"))))
- (jde-java-font-lock-bold-face ((t (:bold t :weight bold))))
- (jde-java-font-lock-code-face ((t (nil))))
- (jde-java-font-lock-constant-face ((t (:foreground "Aquamarine"))))
- (jde-java-font-lock-doc-tag-face ((t (:foreground "light coral"))))
- (jde-java-font-lock-italic-face ((t (:italic t :slant italic))))
- (jde-java-font-lock-link-face ((t (:foreground "blue" :underline t :slant normal))))
- (jde-java-font-lock-modifier-face ((t (:foreground "LightSteelBlue"))))
- (jde-java-font-lock-number-face ((t (:foreground "LightSalmon"))))
- (jde-java-font-lock-package-face ((t (:foreground "steelblue1"))))
- (jde-java-font-lock-pre-face ((t (nil))))
- (jde-java-font-lock-underline-face ((t (:underline t))))
- (makefile-space-face ((t (:background "hotpink"))))
- (menu ((t (:background "MidnightBlue" :foreground "Grey"))))
- (message-cited-text-face ((t (:foreground "LightSalmon"))))
- (message-header-cc-face ((t (:foreground "light cyan"))))
- (message-header-name-face ((t (:foreground "LightBlue"))))
- (message-header-newsgroups-face ((t (:italic t :bold t :foreground "MediumAquamarine" :slant italic :weight bold))))
- (message-header-other-face ((t (:foreground "MediumAquamarine"))))
- (message-header-subject-face ((t (:bold t :foreground "light cyan" :weight bold))))
- (message-header-to-face ((t (:bold t :foreground "light cyan" :weight bold))))
- (message-header-xheader-face ((t (:foreground "MediumAquamarine"))))
- (message-mml-face ((t (:foreground "ForestGreen"))))
- (message-separator-face ((t (:foreground "chocolate"))))
- (mode-line ((t (:background "grey75" :foreground "black" :box (:line-width -1 :style released-button)))))
- (mouse ((t (:background "Grey"))))
- (region ((t (:background "DarkSlateBlue"))))
- (scroll-bar ((t (:background "grey75"))))
- (secondary-selection ((t (:background "steel blue"))))
- (semantic-dirty-token-face ((t (:background "gray10"))))
- (semantic-unmatched-syntax-face ((t (:underline "red"))))
- (show-paren-match-face ((t (:background "light slate blue" :foreground "white"))))
- (show-paren-mismatch-face ((t (:background "red" :foreground "white"))))
- (speedbar-button-face ((t (:foreground "seashell2"))))
- (speedbar-directory-face ((t (:foreground "seashell3"))))
- (speedbar-file-face ((t (:foreground "seashell4"))))
- (speedbar-highlight-face ((t (:background "dark slate blue" :foreground "wheat"))))
- (speedbar-selected-face ((t (:foreground "seashell1" :underline t))))
- (speedbar-separator-face ((t (:background "blue" :foreground "white" :overline "gray"))))
- (speedbar-tag-face ((t (:foreground "antique white"))))
- (tool-bar ((t (:background "grey75" :foreground "black" :box (:line-width 1 :style released-button)))))
- (tooltip ((t (:background "lightyellow" :foreground "black"))))
- (trailing-whitespace ((t (:background "red"))))
- (underline ((t (:underline t))))
- (variable-pitch ((t (:family "helv"))))
- (widget-button-face ((t (:bold t :weight bold))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "light blue"))))
- (widget-field-face ((t (:background "RoyalBlue4" :foreground "wheat"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (widget-single-line-field-face ((t (:background "slate blue" :foreground "wheat"))))
- (woman-bold-face ((t (:bold t :foreground "sky blue" :weight bold))))
- (woman-italic-face ((t (:foreground "deep sky blue"))))
- (woman-unknown-face ((t (:foreground "LightSalmon"))))
- (zmacs-region ((t (:background "DarkSlateBlue")))))))
-
-(defun color-theme-vim-colors ()
- "Color theme by Michael Soulier, created 2003-03-26."
- (interactive)
- (color-theme-install
- '(color-theme-vim-colors
- ((background-color . "#ffffff")
- (background-mode . light)
- (border-color . "black")
- (cursor-color . "#000000")
- (foreground-color . "#000000")
- (mouse-color . "#000000"))
- ((Man-overstrike-face . bold)
- (Man-underline-face . underline)
- (apropos-keybinding-face . underline)
- (apropos-label-face . italic)
- (apropos-match-face . secondary-selection)
- (apropos-property-face . bold-italic)
- (apropos-symbol-face . bold)
- (cperl-here-face . font-lock-string-face)
- (cperl-invalid-face quote underline)
- (cperl-pod-face . font-lock-comment-face)
- (cperl-pod-head-face . font-lock-variable-name-face)
- (help-highlight-face . underline)
- (ispell-highlight-face . highlight)
- (list-matching-lines-face . bold)
- (rpm-spec-dir-face . rpm-spec-dir-face)
- (rpm-spec-doc-face . rpm-spec-doc-face)
- (rpm-spec-ghost-face . rpm-spec-ghost-face)
- (rpm-spec-macro-face . rpm-spec-macro-face)
- (rpm-spec-package-face . rpm-spec-package-face)
- (rpm-spec-tag-face . rpm-spec-tag-face)
- (tags-tag-face . default)
- (view-highlight-face . highlight)
- (widget-mouse-face . highlight))
- (default ((t (:background "#ffffff" :foreground "#000000"))))
- (Info-title-1-face ((t (nil))))
- (Info-title-2-face ((t (nil))))
- (Info-title-3-face ((t (nil))))
- (Info-title-4-face ((t (:bold (bold extra-bold ultra-bold)))))
- (bold ((t (:bold (bold extra-bold ultra-bold)))))
- (bold-italic ((t (:italic (italic oblique) :bold (bold extra-bold ultra-bold)))))
- (border ((t (:background "black"))))
- (comint-highlight-input ((t (:bold (bold extra-bold ultra-bold)))))
- (comint-highlight-prompt ((t (:foreground "dark blue"))))
- (cperl-array-face ((t (:foreground "brown"))))
- (cperl-hash-face ((t (:foreground "red"))))
- (cperl-nonoverridable-face ((t (:foreground "#008b8b"))))
- (cursor ((t (:background "#000000"))))
- (fixed-pitch ((t (nil))))
- (font-lock-builtin-face ((t (:foreground "purple"))))
- (font-lock-comment-face ((t (:foreground "blue"))))
- (font-lock-constant-face ((t (:foreground "green4"))))
- (font-lock-doc-face ((t (:background "#f2f2f2"))))
- (font-lock-function-name-face ((t (:foreground "#008b8b"))))
- (font-lock-keyword-face ((t (:bold (bold extra-bold ultra-bold) :foreground "#a52a2a"))))
- (font-lock-string-face ((t (:background "#f2f2f2" :foreground "#ff00ff"))))
- (font-lock-type-face ((t (:foreground "ForestGreen"))))
- (font-lock-variable-name-face ((t (:foreground "#008b8b"))))
- (font-lock-warning-face ((t (:bold (bold extra-bold ultra-bold) :foreground "Red"))))
- (fringe ((t (:background "#e5e5e5"))))
- (header-line ((t (:background "grey90" :foreground "grey20"))))
- (highlight ((t (:background "darkseagreen2"))))
- (info-header-node ((t (nil))))
- (info-header-xref ((t (nil))))
- (info-menu-5 ((t (:foreground "red1"))))
- (info-menu-header ((t (:bold (bold extra-bold ultra-bold)))))
- (info-node ((t (:italic (italic oblique) :bold (bold extra-bold ultra-bold) :foreground "brown"))))
- (info-xref ((t (:bold (bold extra-bold ultra-bold) :foreground "magenta4"))))
- (isearch ((t (:background "magenta4" :foreground "lightskyblue1"))))
- (isearch-lazy-highlight-face ((t (:background "paleturquoise"))))
- (italic ((t (:italic (italic oblique)))))
- (menu ((t (nil))))
- (mode-line ((t (:background "grey75" :foreground "black"))))
- (mouse ((t (:background "#000000"))))
- (region ((t (:background "lightgoldenrod2"))))
- (rpm-spec-dir-face ((t (:foreground "green"))))
- (rpm-spec-doc-face ((t (:foreground "magenta"))))
- (rpm-spec-ghost-face ((t (:foreground "red"))))
- (rpm-spec-macro-face ((t (:foreground "purple"))))
- (rpm-spec-package-face ((t (:foreground "red"))))
- (rpm-spec-tag-face ((t (:foreground "blue"))))
- (scroll-bar ((t (:background "grey75" :foreground "#000000"))))
- (secondary-selection ((t (:background "yellow"))))
- (sh-heredoc-face ((t (:foreground "tan"))))
- (show-paren-match-face ((t (:background "turquoise"))))
- (show-paren-mismatch-face ((t (:background "purple" :foreground "white"))))
- (tool-bar ((t (:background "grey75" :foreground "black"))))
- (tooltip ((t (:background "lightyellow" :foreground "black"))))
- (trailing-whitespace ((t (:background "red"))))
- (underline ((t (:underline t))))
- (variable-pitch ((t (nil))))
- (widget-button-face ((t (:bold (bold extra-bold ultra-bold)))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (widget-single-line-field-face ((t (:background "gray85")))))))
-
-(defun color-theme-calm-forest ()
- "Color theme by Artur Hefczyc, created 2003-04-18."
- (interactive)
- (color-theme-install
- '(color-theme-calm-forest
- ((background-color . "gray12")
- (background-mode . dark)
- (border-color . "black")
- (cursor-color . "orange")
- (foreground-color . "green")
- (mouse-color . "yellow"))
- ((help-highlight-face . underline)
- (list-matching-lines-face . bold)
- (senator-eldoc-use-color . t)
- (view-highlight-face . highlight)
- (widget-mouse-face . highlight))
- (default ((t (:stipple nil :background "gray12" :foreground "green" :inverse-video nil :box nil
-:strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width
-normal :family "outline-courier new"))))
- (Info-title-1-face ((t (:bold t :weight bold :family "helv" :height 1.728))))
- (Info-title-2-face ((t (:bold t :family "helv" :weight bold :height 1.44))))
- (Info-title-3-face ((t (:bold t :weight bold :family "helv" :height 1.2))))
- (Info-title-4-face ((t (:bold t :family "helv" :weight bold))))
- (bold ((t (:bold t :weight bold))))
- (bold-italic ((t (:italic t :bold t :slant italic :weight bold))))
- (border ((t (:background "black"))))
- (comint-highlight-input ((t (:bold t :weight bold))))
- (comint-highlight-prompt ((t (:foreground "cyan"))))
- (cparen-around-andor-face ((t (:bold t :foreground "maroon" :weight bold))))
- (cparen-around-begin-face ((t (:foreground "maroon"))))
- (cparen-around-conditional-face ((t (:bold t :foreground "RoyalBlue" :weight bold))))
- (cparen-around-define-face ((t (:bold t :foreground "Blue" :weight bold))))
- (cparen-around-lambda-face ((t (:foreground "LightSeaGreen"))))
- (cparen-around-letdo-face ((t (:bold t :foreground "LightSeaGreen" :weight bold))))
- (cparen-around-quote-face ((t (:foreground "SaddleBrown"))))
- (cparen-around-set!-face ((t (:foreground "OrangeRed"))))
- (cparen-around-syntax-rules-face ((t (:foreground "Magenta"))))
- (cparen-around-vector-face ((t (:foreground "chocolate"))))
- (cparen-binding-face ((t (:foreground "ForestGreen"))))
- (cparen-binding-list-face ((t (:bold t :foreground "ForestGreen" :weight bold))))
- (cparen-conditional-clause-face ((t (:foreground "RoyalBlue"))))
- (cparen-normal-paren-face ((t (:foreground "grey50"))))
- (cursor ((t (:background "orange"))))
- (custom-button-face ((t (:background "lightgrey" :foreground "black" :box (:line-width 2 :style
-released-button)))))
- (custom-button-pressed-face ((t (:background "lightgrey" :foreground "black" :box (:line-width
-2 :style pressed-button)))))
- (custom-changed-face ((t (:background "blue" :foreground "white"))))
- (custom-comment-face ((t (:background "dim gray"))))
- (custom-comment-tag-face ((t (:foreground "gray80"))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (:bold t :family "helv" :weight bold :height 1.2))))
- (custom-group-tag-face ((t (:bold t :foreground "light blue" :weight bold :height 1.2))))
- (custom-group-tag-face-1 ((t (:bold t :family "helv" :foreground "pink" :weight bold :height
-1.2))))
- (custom-invalid-face ((t (:background "red" :foreground "yellow"))))
- (custom-modified-face ((t (:background "blue" :foreground "white"))))
- (custom-rogue-face ((t (:background "black" :foreground "pink"))))
- (custom-saved-face ((t (:underline t))))
- (custom-set-face ((t (:background "white" :foreground "blue"))))
- (custom-state-face ((t (:foreground "lime green"))))
- (custom-variable-button-face ((t (:bold t :underline t :weight bold))))
- (custom-variable-tag-face ((t (:bold t :family "helv" :foreground "light blue" :weight bold
-:height 1.2))))
- (eieio-custom-slot-tag-face ((t (:foreground "light blue"))))
- (extra-whitespace-face ((t (:background "pale green"))))
- (fixed-pitch ((t (:family "courier"))))
- (font-latex-bold-face ((t (:bold t :foreground "OliveDrab" :weight bold))))
- (font-latex-italic-face ((t (:italic t :foreground "OliveDrab" :slant italic))))
- (font-latex-math-face ((t (:foreground "burlywood"))))
- (font-latex-sedate-face ((t (:foreground "LightGray"))))
- (font-latex-string-face ((t (:foreground "RosyBrown"))))
- (font-latex-warning-face ((t (:bold t :foreground "Red" :weight bold))))
- (font-lock-builtin-face ((t (:foreground "LightSteelBlue"))))
- (font-lock-comment-face ((t (:foreground "chocolate1"))))
- (font-lock-constant-face ((t (:foreground "Aquamarine"))))
- (font-lock-doc-face ((t (:foreground "LightSalmon"))))
- (font-lock-function-name-face ((t (:foreground "LightSkyBlue"))))
- (font-lock-keyword-face ((t (:foreground "Cyan"))))
- (font-lock-string-face ((t (:foreground "LightSalmon"))))
- (font-lock-type-face ((t (:foreground "PaleGreen"))))
- (font-lock-variable-name-face ((t (:foreground "LightGoldenrod"))))
- (font-lock-warning-face ((t (:bold t :foreground "Pink" :weight bold))))
- (fringe ((t (:background "grey10"))))
- (header-line ((t (:box (:line-width -1 :style released-button) :background "grey20" :foreground
-"grey90" :box nil))))
- (highlight ((t (:background "darkolivegreen"))))
- (info-header-node ((t (:italic t :bold t :weight bold :slant italic :foreground "white"))))
- (info-header-xref ((t (:bold t :weight bold :foreground "cyan"))))
- (info-menu-5 ((t (:foreground "red1"))))
- (info-menu-header ((t (:bold t :family "helv" :weight bold))))
- (info-node ((t (:italic t :bold t :foreground "white" :slant italic :weight bold))))
- (info-xref ((t (:bold t :foreground "cyan" :weight bold))))
- (isearch ((t (:background "palevioletred2" :foreground "brown4"))))
- (isearch-lazy-highlight-face ((t (:background "paleturquoise4"))))
- (italic ((t (:italic t :slant italic))))
- (jde-bug-breakpoint-cursor ((t (:background "brown" :foreground "cyan"))))
- (jde-db-active-breakpoint-face ((t (:background "red" :foreground "black"))))
- (jde-db-requested-breakpoint-face ((t (:background "yellow" :foreground "black"))))
- (jde-db-spec-breakpoint-face ((t (:background "green" :foreground "black"))))
- (jde-java-font-lock-api-face ((t (:foreground "light goldenrod"))))
- (jde-java-font-lock-bold-face ((t (:bold t :weight bold))))
- (jde-java-font-lock-code-face ((t (nil))))
- (jde-java-font-lock-constant-face ((t (:foreground "Aquamarine"))))
- (jde-java-font-lock-doc-tag-face ((t (:foreground "light coral"))))
- (jde-java-font-lock-italic-face ((t (:italic t :slant italic))))
- (jde-java-font-lock-link-face ((t (:foreground "blue" :underline t :slant normal))))
- (jde-java-font-lock-modifier-face ((t (:foreground "LightSteelBlue"))))
- (jde-java-font-lock-number-face ((t (:foreground "LightSalmon"))))
- (jde-java-font-lock-operator-face ((t (:foreground "medium blue"))))
- (jde-java-font-lock-package-face ((t (:foreground "steelblue1"))))
- (jde-java-font-lock-pre-face ((t (nil))))
- (jde-java-font-lock-underline-face ((t (:underline t))))
- (menu ((t (nil))))
- (mode-line ((t (:background "grey75" :foreground "black" :box (:line-width -1 :style
-released-button)))))
- (mouse ((t (:background "yellow"))))
- (region ((t (:background "blue3"))))
- (scroll-bar ((t (nil))))
- (secondary-selection ((t (:background "SkyBlue4"))))
- (semantic-dirty-token-face ((t (:background "gray10"))))
- (semantic-unmatched-syntax-face ((t (:underline "red"))))
- (senator-intangible-face ((t (:foreground "gray75"))))
- (senator-momentary-highlight-face ((t (:background "gray30"))))
- (senator-read-only-face ((t (:background "#664444"))))
- (show-paren-match-face ((t (:background "turquoise"))))
- (show-paren-mismatch-face ((t (:background "purple" :foreground "white"))))
- (speedbar-button-face ((t (:foreground "green3"))))
- (speedbar-directory-face ((t (:foreground "light blue"))))
- (speedbar-file-face ((t (:foreground "cyan"))))
- (speedbar-highlight-face ((t (:background "sea green"))))
- (speedbar-selected-face ((t (:foreground "red" :underline t))))
- (speedbar-separator-face ((t (:background "blue" :foreground "white" :overline "gray"))))
- (speedbar-tag-face ((t (:foreground "yellow"))))
- (tool-bar ((t (:background "grey75" :foreground "black" :box (:line-width 1 :style
-released-button)))))
- (trailing-whitespace ((t (:background "red"))))
- (underline ((t (:underline t))))
- (variable-pitch ((t (:family "helv"))))
- (widget-button-face ((t (:bold t :weight bold))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "lime green"))))
- (widget-field-face ((t (:background "dim gray"))))
- (widget-inactive-face ((t (:foreground "light gray"))))
- (widget-single-line-field-face ((t (:background "dim gray")))))))
-
-(defun color-theme-lawrence ()
- "Color theme by lawrence mitchell <wence@gmx.li>.
-Mainly shades of green.
-Contains faces for erc, gnus, most of jde."
- (interactive)
- (color-theme-install
- '(color-theme-lawrence
- ((background-color . "black")
- (background-mode . dark)
- (border-color . "black")
- (cursor-color . "green")
- (foreground-color . "#00CC00")
- (mouse-color . "black"))
- ((erc-button-face . bold)
- (erc-button-mouse-face . highlight)
- (gnus-article-button-face . bold)
- (gnus-article-mouse-face . highlight)
- (gnus-cite-attribution-face . gnus-cite-attribution-face)
- (gnus-mouse-face . highlight)
- (gnus-server-agent-face . gnus-server-agent-face)
- (gnus-server-closed-face . gnus-server-closed-face)
- (gnus-server-denied-face . gnus-server-denied-face)
- (gnus-server-offline-face . gnus-server-offline-face)
- (gnus-server-opened-face . gnus-server-opened-face)
- (gnus-signature-face . gnus-signature-face)
- (gnus-summary-selected-face . gnus-summary-selected-face)
- (gnus-treat-display-face . head)
- (gnus-treat-display-xface . head)
- (list-matching-lines-buffer-name-face . underline)
- (list-matching-lines-face . bold)
- (paren-match-face . paren-face-match)
- (paren-mismatch-face . paren-face-mismatch)
- (paren-no-match-face . paren-face-no-match)
- (sgml-set-face . t)
- (tags-tag-face . default)
- (view-highlight-face . highlight)
- (widget-mouse-face . highlight))
- (default ((t (nil))))
- (Buffer-menu-buffer-face ((t (:bold t :weight bold))))
- (bg:erc-color-face0 ((t (:background "White"))))
- (bg:erc-color-face1 ((t (:background "black"))))
- (bg:erc-color-face10 ((t (:background "lightblue1"))))
- (bg:erc-color-face11 ((t (:background "cyan"))))
- (bg:erc-color-face12 ((t (:background "blue"))))
- (bg:erc-color-face13 ((t (:background "deeppink"))))
- (bg:erc-color-face14 ((t (:background "gray50"))))
- (bg:erc-color-face15 ((t (:background "gray90"))))
- (bg:erc-color-face2 ((t (:background "blue4"))))
- (bg:erc-color-face3 ((t (:background "green4"))))
- (bg:erc-color-face4 ((t (:background "red"))))
- (bg:erc-color-face5 ((t (:background "brown"))))
- (bg:erc-color-face6 ((t (:background "purple"))))
- (bg:erc-color-face7 ((t (:background "orange"))))
- (bg:erc-color-face8 ((t (:background "yellow"))))
- (bg:erc-color-face9 ((t (:background "green"))))
- (bold ((t (:bold t :foreground "#00CC00" :background "black"))))
- (bold-italic ((t (:italic t :bold t :slant oblique :weight semi-bold))))
- (border ((t (:background "black"))))
- (button ((t (:underline t))))
- (comint-highlight-input ((t (nil))))
- (comint-highlight-prompt ((t (:bold t :foreground "#00CC00" :background "black" :weight bold))))
- (cursor ((t (:background "green"))))
- (custom-button-face ((t (:bold t :foreground "#00CC00" :background "black"))))
- (custom-button-pressed-face ((t (nil))))
- (custom-changed-face ((t (:italic t :foreground "#00CC00" :background "black" :slant oblique))))
- (custom-comment-face ((t (nil))))
- (custom-comment-tag-face ((t (nil))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (nil))))
- (custom-group-tag-face ((t (nil))))
- (custom-group-tag-face-1 ((t (nil))))
- (custom-invalid-face ((t (:foreground "#00CC00" :background "black" :strike-through t))))
- (custom-modified-face ((t (nil))))
- (custom-rogue-face ((t (nil))))
- (custom-saved-face ((t (nil))))
- (custom-set-face ((t (nil))))
- (custom-state-face ((t (nil))))
- (custom-variable-button-face ((t (nil))))
- (custom-variable-tag-face ((t (nil))))
- (erc-action-face ((t (:bold t :weight semi-bold))))
- (erc-bold-face ((t (:bold t :weight bold))))
- (erc-current-nick-face ((t (:bold t :foreground "LightSeaGreen" :weight semi-bold))))
- (erc-dangerous-host-face ((t (:foreground "red"))))
- (erc-default-face ((t (nil))))
- (erc-direct-msg-face ((t (:foreground "IndianRed"))))
- (erc-error-face ((t (:bold t :weight semi-bold :background "darkblue" :foreground "#00CC00"))))
- (erc-fool-face ((t (:foreground "dim gray"))))
- (erc-input-face ((t (:foreground "springgreen"))))
- (erc-inverse-face ((t (:bold t :background "Darkgreen" :foreground "Black" :weight semi-bold))))
- (erc-keyword-face ((t (:bold t :foreground "pale green" :weight bold))))
- (erc-nick-default-face ((t (:bold t :weight semi-bold))))
- (erc-nick-msg-face ((t (:bold t :foreground "springgreen" :weight semi-bold))))
- (erc-notice-face ((t (:foreground "seagreen" :weight normal))))
- (erc-pal-face ((t (:bold t :foreground "Magenta" :weight bold))))
- (erc-prompt-face ((t (:bold t :background "lightBlue2" :foreground "Black" :weight semi-bold))))
- (erc-timestamp-face ((t (:foreground "seagreen" :weight normal))))
- (erc-underline-face ((t (:underline t))))
- (fg:erc-color-face0 ((t (:foreground "White"))))
- (fg:erc-color-face1 ((t (:foreground "black"))))
- (fg:erc-color-face10 ((t (:foreground "lightblue1"))))
- (fg:erc-color-face11 ((t (:foreground "cyan"))))
- (fg:erc-color-face12 ((t (:foreground "blue"))))
- (fg:erc-color-face13 ((t (:foreground "deeppink"))))
- (fg:erc-color-face14 ((t (:foreground "gray50"))))
- (fg:erc-color-face15 ((t (:foreground "gray90"))))
- (fg:erc-color-face2 ((t (:foreground "blue4"))))
- (fg:erc-color-face3 ((t (:foreground "green4"))))
- (fg:erc-color-face4 ((t (:foreground "red"))))
- (fg:erc-color-face5 ((t (:foreground "brown"))))
- (fg:erc-color-face6 ((t (:foreground "purple"))))
- (fg:erc-color-face7 ((t (:foreground "orange"))))
- (fg:erc-color-face8 ((t (:foreground "yellow"))))
- (fg:erc-color-face9 ((t (:foreground "green"))))
- (fixed-pitch ((t (nil))))
- (font-latex-string-face ((t (:bold t :weight semi-bold :foreground "seagreen" :background "black"))))
- (font-latex-warning-face ((t (:bold t :weight semi-bold :background "darkblue" :foreground "#00CC00"))))
- (font-lock-builtin-face ((t (:foreground "seagreen1"))))
- (font-lock-comment-face ((t (:background "black" :foreground "medium spring green"))))
- (font-lock-constant-face ((t (nil))))
- (font-lock-doc-face ((t (:bold t :background "black" :foreground "seagreen" :weight semi-bold))))
- (font-lock-function-name-face ((t (:bold t :foreground "#00CC00" :background "black"))))
- (font-lock-keyword-face ((t (:bold t :background "black" :foreground "green" :underline t :weight semi-bold))))
- (font-lock-preprocessor-face ((t (:foreground "#00ccdd"))))
- (font-lock-string-face ((t (:bold t :background "black" :foreground "seagreen" :weight semi-bold))))
- (font-lock-type-face ((t (nil))))
- (font-lock-variable-name-face ((t (nil))))
- (font-lock-warning-face ((t (:bold t :foreground "#00CC00" :background "darkblue" :weight semi-bold))))
- (fringe ((t (:foreground "#00CC00" :background "#151515"))))
- (gnus-cite-attribution-face ((t (:italic t :foreground "#00CC00" :background "black" :slant italic))))
- (gnus-cite-face-1 ((t (:background "black" :foreground "springgreen"))))
- (gnus-cite-face-10 ((t (nil))))
- (gnus-cite-face-11 ((t (nil))))
- (gnus-cite-face-2 ((t (:background "black" :foreground "lightseagreen"))))
- (gnus-cite-face-3 ((t (:background "black" :foreground "darkseagreen"))))
- (gnus-cite-face-4 ((t (:background "black" :foreground "forestgreen"))))
- (gnus-cite-face-5 ((t (:background "black" :foreground "springgreen"))))
- (gnus-cite-face-6 ((t (:background "black" :foreground "springgreen"))))
- (gnus-cite-face-7 ((t (:background "black" :foreground "springgreen"))))
- (gnus-cite-face-8 ((t (:background "black" :foreground "springgreen"))))
- (gnus-cite-face-9 ((t (:background "black" :foreground "springgreen"))))
- (gnus-emphasis-bold ((t (:bold t :weight semi-bold))))
- (gnus-emphasis-bold-italic ((t (:italic t :bold t :slant italic :weight semi-bold))))
- (gnus-emphasis-highlight-words ((t (:bold t :foreground "#00CC00" :background "black" :underline t :weight bold))))
- (gnus-emphasis-italic ((t (:italic t :slant italic))))
- (gnus-emphasis-strikethru ((t (nil))))
- (gnus-emphasis-underline ((t (:underline t))))
- (gnus-emphasis-underline-bold ((t (:bold t :underline t :weight semi-bold))))
- (gnus-emphasis-underline-bold-italic ((t (:italic t :bold t :underline t :slant italic :weight semi-bold))))
- (gnus-emphasis-underline-italic ((t (:italic t :underline t :slant italic))))
- (gnus-group-mail-1-empty-face ((t (nil))))
- (gnus-group-mail-1-face ((t (:bold t :foreground "#00CC00" :background "black" :weight bold))))
- (gnus-group-mail-2-empty-face ((t (nil))))
- (gnus-group-mail-2-face ((t (:bold t :foreground "#00CC00" :background "black" :weight bold))))
- (gnus-group-mail-3-empty-face ((t (nil))))
- (gnus-group-mail-3-face ((t (:bold t :foreground "#00CC00" :background "black" :weight bold))))
- (gnus-group-mail-low-empty-face ((t (nil))))
- (gnus-group-mail-low-face ((t (:bold t :foreground "#00CC00" :background "black" :weight bold))))
- (gnus-group-news-1-empty-face ((t (nil))))
- (gnus-group-news-1-face ((t (:bold t :foreground "#00CC00" :background "black" :weight bold))))
- (gnus-group-news-2-empty-face ((t (nil))))
- (gnus-group-news-2-face ((t (:bold t :foreground "#00CC00" :background "black" :weight bold))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (:bold t :foreground "#00CC00" :background "black" :weight bold))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (:bold t :foreground "#00CC00" :background "black" :weight bold))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (:bold t :foreground "#00CC00" :background "black" :weight bold))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (:bold t :foreground "#00CC00" :background "black" :weight bold))))
- (gnus-group-news-low-empty-face ((t (nil))))
- (gnus-group-news-low-face ((t (:bold t :foreground "#00CC00" :background "black" :weight bold))))
- (gnus-header-content-face ((t (:background "black" :foreground "springgreen"))))
- (gnus-header-from-face ((t (nil))))
- (gnus-header-name-face ((t (nil))))
- (gnus-header-newsgroups-face ((t (nil))))
- (gnus-header-subject-face ((t (nil))))
- (gnus-server-agent-face ((t (:bold t :foreground "PaleTurquoise" :weight bold))))
- (gnus-server-closed-face ((t (:italic t :foreground "Light Steel Blue" :slant italic))))
- (gnus-server-denied-face ((t (:bold t :foreground "Pink" :weight semi-bold))))
- (gnus-server-offline-face ((t (:bold t :foreground "Yellow" :weight bold))))
- (gnus-server-opened-face ((t (:bold t :foreground "Green1" :weight semi-bold))))
- (gnus-signature-face ((t (:background "black" :foreground "springgreen" :slant normal))))
- (gnus-splash-face ((t (:bold t :foreground "#00CC00" :background "black" :weight bold))))
- (gnus-summary-cancelled-face ((t (:foreground "#00CC00" :background "black" :strike-through t))))
- (gnus-summary-high-ancient-face ((t (nil))))
- (gnus-summary-high-read-face ((t (nil))))
- (gnus-summary-high-ticked-face ((t (:background "black" :foreground "seagreen"))))
- (gnus-summary-high-undownloaded-face ((t (:bold t :foreground "LightGray" :weight bold))))
- (gnus-summary-high-unread-face ((t (:bold t :foreground "#00CC00" :background "black" :weight bold))))
- (gnus-summary-low-ancient-face ((t (nil))))
- (gnus-summary-low-read-face ((t (nil))))
- (gnus-summary-low-ticked-face ((t (nil))))
- (gnus-summary-low-undownloaded-face ((t (:italic t :foreground "LightGray" :slant italic :weight normal))))
- (gnus-summary-low-unread-face ((t (:bold t :foreground "#00CC00" :background "black" :weight bold))))
- (gnus-summary-normal-ancient-face ((t (nil))))
- (gnus-summary-normal-read-face ((t (nil))))
- (gnus-summary-normal-ticked-face ((t (:bold t :foreground "#00CC00" :background "black"))))
- (gnus-summary-normal-undownloaded-face ((t (:foreground "LightGray" :weight normal))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-selected-face ((t (:background "#101010"))))
- (gnus-x-face ((t (:background "white" :foreground "black"))))
- (header-line ((t (nil))))
- (highlight ((t (:foreground "#00CC00" :background "darkgreen"))))
- (ido-first-match-face ((t (:bold t :weight bold))))
- (ido-indicator-face ((t (:background "red" :foreground "yellow" :width condensed))))
- (ido-only-match-face ((t (:foreground "ForestGreen"))))
- (ido-subdir-face ((t (:foreground "red"))))
- (isearch ((t (:background "seagreen" :foreground "black"))))
- (isearch-lazy-highlight-face ((t (:background "darkseagreen" :foreground "black"))))
- (italic ((t (:italic t :foreground "#00CC00" :background "black" :slant oblique))))
- (menu ((t (:bold t :background "black" :foreground "green" :box (:line-width -1 :color "#606060") :weight semi-bold))))
- (message-cited-text-face ((t (:italic t :foreground "#00CC00" :background "black" :slant oblique))))
- (message-header-cc-face ((t (nil))))
- (message-header-name-face ((t (nil))))
- (message-header-newsgroups-face ((t (:bold t :foreground "#00CC00" :background "black"))))
- (message-header-other-face ((t (:bold t :foreground "#00CC00" :background "black"))))
- (message-header-subject-face ((t (:bold t :foreground "#00CC00" :background "black"))))
- (message-header-to-face ((t (:bold t :foreground "#00CC00" :background "black"))))
- (message-header-xheader-face ((t (nil))))
- (message-mml-face ((t (:italic t :foreground "#00CC00" :background "black" :slant oblique))))
- (message-separator-face ((t (nil))))
- (minibuffer-prompt ((t (:background "black" :foreground "seagreen"))))
- (mode-line ((t (:bold t :background "#404040" :foreground "green" :box (:line-width -1 :color "#606060") :weight semi-bold))))
- (mode-line-inactive ((t (:bold t :weight semi-bold :box (:line-width -1 :color "#606060") :foreground "green" :background "#101010"))))
- (mouse ((t (:background "black"))))
- (paren-face ((t (:background "black" :foreground "darkgreen"))))
- (paren-face-match ((t (:background "black" :foreground "springgreen"))))
- (paren-face-mismatch ((t (:foreground "#00CC00" :background "black" :strike-through t))))
- (paren-face-no-match ((t (:background "black" :foreground "red"))))
- (region ((t (:background "seagreen" :foreground "black"))))
- (scroll-bar ((t (nil))))
- (secondary-selection ((t (:background "darkseagreen" :foreground "black"))))
- (semantic-dirty-token-face ((t (:background "gray10"))))
- (semantic-unmatched-syntax-face ((t (:underline "red"))))
- (sgml-end-tag-face ((t (:foreground "seagreen"))))
- (sgml-start-tag-face ((t (:foreground "seagreen"))))
- (tabbar-button-face ((t (:background "black" :foreground "#00cc00" :box (:line-width 2 :color "black" :style released-button)))))
- (tabbar-default-face ((t (:background "black" :foreground "#00cc00"))))
- (tabbar-selected-face ((t (:background "black" :foreground "springgreen" :box (:line-width 2 :color "black" :style released-button)))))
- (tabbar-separator-face ((t (:foreground "#00cc00" :background "black"))))
- (tabbar-unselected-face ((t (:background "black" :foreground "seagreen" :box (:line-width 2 :color "black" :style pressed-button)))))
- (tool-bar ((t (:box (:line-width 1 :style released-button)))))
- (tooltip ((t (nil))))
- (trailing-whitespace ((t (:background "lightseagreen" :foreground "black"))))
- (underline ((t (:foreground "#00CC00" :background "black" :underline t))))
- (variable-pitch ((t (:underline nil :foreground "#00CC00" :background "black"))))
- (widget-button-face ((t (:bold t :foreground "#00CC00" :background "black"))))
- (widget-button-pressed-face ((t (nil))))
- (widget-documentation-face ((t (nil))))
- (widget-field-face ((t (:italic t :foreground "#00CC00" :background "black" :slant oblique))))
- (widget-inactive-face ((t (nil))))
- (widget-single-line-field-face ((t (nil)))))))
-
-(defun color-theme-matrix ()
- "Color theme by walterh@rocketmail.com, created 2003-10-16."
- (interactive)
- (color-theme-install
- '(color-theme-matrix
- ((background-color . "black")
- (background-mode . dark)
- (background-toolbar-color . "bisque")
- (border-color . "orange")
- (bottom-toolbar-shadow-color . "#909099999999")
- (cursor-color . "#7eff00")
- (foreground-color . "#7eff00")
- (mouse-color . "#7eff00")
- (top-toolbar-shadow-color . "#ffffffffffff"))
- ((help-highlight-face . underline)
- (list-matching-lines-face . bold)
- (rmail-highlight-face . font-lock-function-name-face)
- (view-highlight-face . highlight)
- (widget-mouse-face . highlight))
- (default ((t (:stipple nil :background "black" :foreground
-"#7eff00" :inverse-video nil :box nil :strike-through nil :overline nil
-:underline nil :slant normal :weight normal :height 90 :width normal
-:family "outline-courier new"))))
- (Buffer-menu-buffer-face ((t (nil))))
- (CUA-global-mark-face ((t (nil))))
- (CUA-rectangle-face ((t (nil))))
- (CUA-rectangle-noselect-face ((t (nil))))
- (Info-title-1-face ((t (nil))))
- (Info-title-2-face ((t (nil))))
- (Info-title-3-face ((t (nil))))
- (Info-title-4-face ((t (nil))))
- (antlr-font-lock-keyword-face ((t (nil))))
- (antlr-font-lock-literal-face ((t (nil))))
- (antlr-font-lock-ruledef-face ((t (nil))))
- (antlr-font-lock-ruleref-face ((t (nil))))
- (antlr-font-lock-tokendef-face ((t (nil))))
- (antlr-font-lock-tokenref-face ((t (nil))))
- (bbdb-company ((t (nil))))
- (bbdb-field-name ((t (nil))))
- (bbdb-field-value ((t (nil))))
- (bbdb-name ((t (nil))))
- (bg:erc-color-face0 ((t (nil))))
- (bg:erc-color-face1 ((t (nil))))
- (bg:erc-color-face10 ((t (nil))))
- (bg:erc-color-face11 ((t (nil))))
- (bg:erc-color-face12 ((t (nil))))
- (bg:erc-color-face13 ((t (nil))))
- (bg:erc-color-face14 ((t (nil))))
- (bg:erc-color-face15 ((t (nil))))
- (bg:erc-color-face2 ((t (nil))))
- (bg:erc-color-face3 ((t (nil))))
- (bg:erc-color-face4 ((t (nil))))
- (bg:erc-color-face5 ((t (nil))))
- (bg:erc-color-face6 ((t (nil))))
- (bg:erc-color-face7 ((t (nil))))
- (bg:erc-color-face8 ((t (nil))))
- (bg:erc-color-face9 ((t (nil))))
- (blank-space-face ((t (nil))))
- (blank-tab-face ((t (nil))))
- (blue ((t (nil))))
- (bold ((t (:bold t :weight bold))))
- (bold-italic ((t (:bold t :weight bold))))
- (border ((t (:background "orange"))))
- (border-glyph ((t (nil))))
- (buffers-tab ((t (nil))))
- (button ((t (nil))))
- (calendar-today-face ((t (nil))))
- (change-log-acknowledgement-face ((t (nil))))
- (change-log-conditionals-face ((t (nil))))
- (change-log-date-face ((t (nil))))
- (change-log-email-face ((t (nil))))
- (change-log-file-face ((t (nil))))
- (change-log-function-face ((t (nil))))
- (change-log-list-face ((t (nil))))
- (change-log-name-face ((t (nil))))
- (clearcase-dired-checkedout-face ((t (nil))))
- (comint-highlight-input ((t (nil))))
- (comint-highlight-prompt ((t (nil))))
- (cparen-around-andor-face ((t (nil))))
- (cparen-around-begin-face ((t (nil))))
- (cparen-around-conditional-face ((t (nil))))
- (cparen-around-define-face ((t (nil))))
- (cparen-around-lambda-face ((t (nil))))
- (cparen-around-letdo-face ((t (nil))))
- (cparen-around-quote-face ((t (nil))))
- (cparen-around-set!-face ((t (nil))))
- (cparen-around-syntax-rules-face ((t (nil))))
- (cparen-around-vector-face ((t (nil))))
- (cparen-binding-face ((t (nil))))
- (cparen-binding-list-face ((t (nil))))
- (cparen-conditional-clause-face ((t (nil))))
- (cparen-normal-paren-face ((t (nil))))
- (cperl-array-face ((t (nil))))
- (cperl-hash-face ((t (nil))))
- (cperl-invalid-face ((t (nil))))
- (cperl-nonoverridable-face ((t (nil))))
- (cursor ((t (:background "#7eff00" :foreground "black"))))
- (custom-button-face ((t (nil))))
- (custom-button-pressed-face ((t (nil))))
- (custom-changed-face ((t (nil))))
- (custom-comment-face ((t (nil))))
- (custom-comment-tag-face ((t (nil))))
- (custom-documentation-face ((t (nil))))
- (custom-face-tag-face ((t (nil))))
- (custom-group-tag-face ((t (nil))))
- (custom-group-tag-face-1 ((t (nil))))
- (custom-invalid-face ((t (nil))))
- (custom-modified-face ((t (nil))))
- (custom-rogue-face ((t (nil))))
- (custom-saved-face ((t (nil))))
- (custom-set-face ((t (nil))))
- (custom-state-face ((t (nil))))
- (custom-variable-button-face ((t (nil))))
- (custom-variable-tag-face ((t (nil))))
- (cvs-filename-face ((t (nil))))
- (cvs-handled-face ((t (nil))))
- (cvs-header-face ((t (nil))))
- (cvs-marked-face ((t (nil))))
- (cvs-msg-face ((t (nil))))
- (cvs-need-action-face ((t (nil))))
- (cvs-unknown-face ((t (nil))))
- (cyan ((t (nil))))
- (diary-face ((t (nil))))
- (diff-added-face ((t (nil))))
- (diff-changed-face ((t (nil))))
- (diff-context-face ((t (nil))))
- (diff-file-header-face ((t (nil))))
- (diff-function-face ((t (nil))))
- (diff-header-face ((t (nil))))
- (diff-hunk-header-face ((t (nil))))
- (diff-index-face ((t (nil))))
- (diff-nonexistent-face ((t (nil))))
- (diff-removed-face ((t (nil))))
- (dired-face-boring ((t (nil))))
- (dired-face-directory ((t (nil))))
- (dired-face-executable ((t (nil))))
- (dired-face-flagged ((t (nil))))
- (dired-face-header ((t (nil))))
- (dired-face-marked ((t (nil))))
- (dired-face-permissions ((t (nil))))
- (dired-face-setuid ((t (nil))))
- (dired-face-socket ((t (nil))))
- (dired-face-symlink ((t (nil))))
- (display-time-mail-balloon-enhance-face ((t (nil))))
- (display-time-mail-balloon-gnus-group-face ((t (nil))))
- (display-time-time-balloon-face ((t (nil))))
- (ebrowse-default-face ((t (nil))))
- (ebrowse-file-name-face ((t (nil))))
- (ebrowse-member-attribute-face ((t (nil))))
- (ebrowse-member-class-face ((t (nil))))
- (ebrowse-progress-face ((t (nil))))
- (ebrowse-root-class-face ((t (nil))))
- (ebrowse-tree-mark-face ((t (nil))))
- (ecb-sources-face ((t (nil))))
- (edb-inter-field-face ((t (nil))))
- (edb-normal-summary-face ((t (nil))))
- (ediff-current-diff-face-A ((t (nil))))
- (ediff-current-diff-face-Ancestor ((t (nil))))
- (ediff-current-diff-face-B ((t (nil))))
- (ediff-current-diff-face-C ((t (nil))))
- (ediff-even-diff-face-A ((t (nil))))
- (ediff-even-diff-face-Ancestor ((t (nil))))
- (ediff-even-diff-face-B ((t (nil))))
- (ediff-even-diff-face-C ((t (nil))))
- (ediff-fine-diff-face-A ((t (nil))))
- (ediff-fine-diff-face-Ancestor ((t (nil))))
- (ediff-fine-diff-face-B ((t (nil))))
- (ediff-fine-diff-face-C ((t (nil))))
- (ediff-odd-diff-face-A ((t (nil))))
- (ediff-odd-diff-face-Ancestor ((t (nil))))
- (ediff-odd-diff-face-B ((t (nil))))
- (ediff-odd-diff-face-C ((t (nil))))
- (eieio-custom-slot-tag-face ((t (nil))))
- (emacs-wiki-bad-link-face ((t (nil))))
- (emacs-wiki-link-face ((t (nil))))
- (erc-action-face ((t (nil))))
- (erc-bold-face ((t (nil))))
- (erc-current-nick-face ((t (nil))))
- (erc-dangerous-host-face ((t (nil))))
- (erc-default-face ((t (nil))))
- (erc-direct-msg-face ((t (nil))))
- (erc-error-face ((t (nil))))
- (erc-fool-face ((t (nil))))
- (erc-highlight-face ((t (nil))))
- (erc-input-face ((t (nil))))
- (erc-inverse-face ((t (nil))))
- (erc-keyword-face ((t (nil))))
- (erc-nick-default-face ((t (nil))))
- (erc-nick-msg-face ((t (nil))))
- (erc-notice-face ((t (nil))))
- (erc-pal-face ((t (nil))))
- (erc-prompt-face ((t (nil))))
- (erc-timestamp-face ((t (nil))))
- (erc-underline-face ((t (nil))))
- (eshell-ls-archive-face ((t (nil))))
- (eshell-ls-backup-face ((t (nil))))
- (eshell-ls-clutter-face ((t (nil))))
- (eshell-ls-directory-face ((t (nil))))
- (eshell-ls-executable-face ((t (nil))))
- (eshell-ls-missing-face ((t (nil))))
- (eshell-ls-picture-face ((t (nil))))
- (eshell-ls-product-face ((t (nil))))
- (eshell-ls-readonly-face ((t (nil))))
- (eshell-ls-special-face ((t (nil))))
- (eshell-ls-symlink-face ((t (nil))))
- (eshell-ls-text-face ((t (nil))))
- (eshell-ls-todo-face ((t (nil))))
- (eshell-ls-unreadable-face ((t (nil))))
- (eshell-prompt-face ((t (nil))))
- (eshell-test-failed-face ((t (nil))))
- (eshell-test-ok-face ((t (nil))))
- (excerpt ((t (nil))))
- (extra-whitespace-face ((t (nil))))
- (ff-paths-non-existant-file-face ((t (nil))))
- (fg:black ((t (nil))))
- (fg:erc-color-face0 ((t (nil))))
- (fg:erc-color-face1 ((t (nil))))
- (fg:erc-color-face10 ((t (nil))))
- (fg:erc-color-face11 ((t (nil))))
- (fg:erc-color-face12 ((t (nil))))
- (fg:erc-color-face13 ((t (nil))))
- (fg:erc-color-face14 ((t (nil))))
- (fg:erc-color-face15 ((t (nil))))
- (fg:erc-color-face2 ((t (nil))))
- (fg:erc-color-face3 ((t (nil))))
- (fg:erc-color-face4 ((t (nil))))
- (fg:erc-color-face5 ((t (nil))))
- (fg:erc-color-face6 ((t (nil))))
- (fg:erc-color-face7 ((t (nil))))
- (fg:erc-color-face8 ((t (nil))))
- (fg:erc-color-face9 ((t (nil))))
- (fixed ((t (nil))))
- (fixed-pitch ((t (nil))))
- (fl-comment-face ((t (nil))))
- (fl-function-name-face ((t (nil))))
- (fl-keyword-face ((t (nil))))
- (fl-string-face ((t (nil))))
- (fl-type-face ((t (nil))))
- (flash-paren-face-off ((t (nil))))
- (flash-paren-face-on ((t (nil))))
- (flash-paren-face-region ((t (nil))))
- (flyspell-duplicate-face ((t (nil))))
- (flyspell-incorrect-face ((t (nil))))
- (font-latex-bold-face ((t (nil))))
- (font-latex-italic-face ((t (nil))))
- (font-latex-math-face ((t (nil))))
- (font-latex-sedate-face ((t (nil))))
- (font-latex-string-face ((t (nil))))
- (font-latex-warning-face ((t (nil))))
- (font-lock-builtin-face ((t (:foreground "pink2"))))
- (font-lock-comment-face ((t (:italic t :background "black" :slant
-italic))))
- (font-lock-constant-face ((t (:foreground "magenta"))))
- (font-lock-doc-face ((t (nil))))
- (font-lock-doc-string-face ((t (nil))))
- (font-lock-exit-face ((t (nil))))
- (font-lock-function-name-face ((t (:bold t :underline t :weight
-bold))))
- (font-lock-keyword-face ((t (:foreground "yellow1"))))
- (font-lock-other-emphasized-face ((t (nil))))
- (font-lock-other-type-face ((t (nil))))
- (font-lock-preprocessor-face ((t (nil))))
- (font-lock-reference-face ((t (nil))))
- (font-lock-special-comment-face ((t (nil))))
- (font-lock-special-keyword-face ((t (nil))))
- (font-lock-string-face ((t (:foreground "yellow2"))))
- (font-lock-type-face ((t (:foreground "LightYellow1"))))
- (font-lock-variable-name-face ((t (:foreground "light green"))))
- (font-lock-warning-face ((t (nil))))
- (fringe ((t (nil))))
- (gnus-cite-attribution-face ((t (nil))))
- (gnus-cite-face-1 ((t (nil))))
- (gnus-cite-face-10 ((t (nil))))
- (gnus-cite-face-11 ((t (nil))))
- (gnus-cite-face-2 ((t (nil))))
- (gnus-cite-face-3 ((t (nil))))
- (gnus-cite-face-4 ((t (nil))))
- (gnus-cite-face-5 ((t (nil))))
- (gnus-cite-face-6 ((t (nil))))
- (gnus-cite-face-7 ((t (nil))))
- (gnus-cite-face-8 ((t (nil))))
- (gnus-cite-face-9 ((t (nil))))
- (gnus-emphasis-bold ((t (nil))))
- (gnus-emphasis-bold-italic ((t (nil))))
- (gnus-emphasis-highlight-words ((t (nil))))
- (gnus-emphasis-italic ((t (nil))))
- (gnus-emphasis-strikethru ((t (nil))))
- (gnus-emphasis-underline ((t (nil))))
- (gnus-emphasis-underline-bold ((t (nil))))
- (gnus-emphasis-underline-bold-italic ((t (nil))))
- (gnus-emphasis-underline-italic ((t (nil))))
- (gnus-filterhist-face-1 ((t (nil))))
- (gnus-group-mail-1-empty-face ((t (nil))))
- (gnus-group-mail-1-face ((t (nil))))
- (gnus-group-mail-2-empty-face ((t (nil))))
- (gnus-group-mail-2-face ((t (nil))))
- (gnus-group-mail-3-empty-face ((t (nil))))
- (gnus-group-mail-3-face ((t (nil))))
- (gnus-group-mail-low-empty-face ((t (nil))))
- (gnus-group-mail-low-face ((t (nil))))
- (gnus-group-news-1-empty-face ((t (nil))))
- (gnus-group-news-1-face ((t (nil))))
- (gnus-group-news-2-empty-face ((t (nil))))
- (gnus-group-news-2-face ((t (nil))))
- (gnus-group-news-3-empty-face ((t (nil))))
- (gnus-group-news-3-face ((t (nil))))
- (gnus-group-news-4-empty-face ((t (nil))))
- (gnus-group-news-4-face ((t (nil))))
- (gnus-group-news-5-empty-face ((t (nil))))
- (gnus-group-news-5-face ((t (nil))))
- (gnus-group-news-6-empty-face ((t (nil))))
- (gnus-group-news-6-face ((t (nil))))
- (gnus-group-news-low-empty-face ((t (nil))))
- (gnus-group-news-low-face ((t (nil))))
- (gnus-header-content-face ((t (nil))))
- (gnus-header-from-face ((t (nil))))
- (gnus-header-name-face ((t (nil))))
- (gnus-header-newsgroups-face ((t (nil))))
- (gnus-header-subject-face ((t (nil))))
- (gnus-picon-face ((t (nil))))
- (gnus-picon-xbm-face ((t (nil))))
- (gnus-picons-face ((t (nil))))
- (gnus-picons-xbm-face ((t (nil))))
- (gnus-server-agent-face ((t (nil))))
- (gnus-server-closed-face ((t (nil))))
- (gnus-server-denied-face ((t (nil))))
- (gnus-server-offline-face ((t (nil))))
- (gnus-server-opened-face ((t (nil))))
- (gnus-signature-face ((t (nil))))
- (gnus-splash ((t (nil))))
- (gnus-splash-face ((t (nil))))
- (gnus-summary-cancelled-face ((t (nil))))
- (gnus-summary-high-ancient-face ((t (nil))))
- (gnus-summary-high-read-face ((t (nil))))
- (gnus-summary-high-ticked-face ((t (nil))))
- (gnus-summary-high-undownloaded-face ((t (nil))))
- (gnus-summary-high-unread-face ((t (nil))))
- (gnus-summary-low-ancient-face ((t (nil))))
- (gnus-summary-low-read-face ((t (nil))))
- (gnus-summary-low-ticked-face ((t (nil))))
- (gnus-summary-low-undownloaded-face ((t (nil))))
- (gnus-summary-low-unread-face ((t (nil))))
- (gnus-summary-normal-ancient-face ((t (nil))))
- (gnus-summary-normal-read-face ((t (nil))))
- (gnus-summary-normal-ticked-face ((t (nil))))
- (gnus-summary-normal-undownloaded-face ((t (nil))))
- (gnus-summary-normal-unread-face ((t (nil))))
- (gnus-summary-selected-face ((t (nil))))
- (gnus-x-face ((t (nil))))
- (green ((t (nil))))
- (gui-button-face ((t (nil))))
- (gui-element ((t (nil))))
- (header-line ((t (nil))))
- (hi-black-b ((t (nil))))
- (hi-black-hb ((t (nil))))
- (hi-blue ((t (nil))))
- (hi-blue-b ((t (nil))))
- (hi-green ((t (nil))))
- (hi-green-b ((t (nil))))
- (hi-pink ((t (nil))))
- (hi-red-b ((t (nil))))
- (hi-yellow ((t (nil))))
- (highlight ((t (:background "#7eff00" :foreground "black"))))
- (highlight-changes-delete-face ((t (nil))))
- (highlight-changes-face ((t (nil))))
- (highline-face ((t (nil))))
- (holiday-face ((t (nil))))
- (html-helper-bold-face ((t (nil))))
- (html-helper-bold-italic-face ((t (nil))))
- (html-helper-builtin-face ((t (nil))))
- (html-helper-italic-face ((t (nil))))
- (html-helper-underline-face ((t (nil))))
- (html-tag-face ((t (nil))))
- (hyper-apropos-documentation ((t (nil))))
- (hyper-apropos-heading ((t (nil))))
- (hyper-apropos-hyperlink ((t (nil))))
- (hyper-apropos-major-heading ((t (nil))))
- (hyper-apropos-section-heading ((t (nil))))
- (hyper-apropos-warning ((t (nil))))
- (ibuffer-deletion-face ((t (nil))))
- (ibuffer-marked-face ((t (nil))))
- (idlwave-help-link-face ((t (nil))))
- (idlwave-shell-bp-face ((t (nil))))
- (ido-first-match-face ((t (nil))))
- (ido-indicator-face ((t (nil))))
- (ido-only-match-face ((t (nil))))
- (ido-subdir-face ((t (nil))))
- (info-header-node ((t (nil))))
- (info-header-xref ((t (nil))))
- (info-menu-5 ((t (nil))))
- (info-menu-6 ((t (nil))))
- (info-menu-header ((t (nil))))
- (info-node ((t (nil))))
- (info-xref ((t (nil))))
- (isearch ((t (nil))))
- (isearch-lazy-highlight-face ((t (nil))))
- (isearch-secondary ((t (nil))))
- (italic ((t (:underline t))))
- (jde-bug-breakpoint-cursor ((t (nil))))
- (jde-bug-breakpoint-marker ((t (nil))))
- (jde-db-active-breakpoint-face ((t (nil))))
- (jde-db-requested-breakpoint-face ((t (nil))))
- (jde-db-spec-breakpoint-face ((t (nil))))
- (jde-java-font-lock-api-face ((t (nil))))
- (jde-java-font-lock-bold-face ((t (nil))))
- (jde-java-font-lock-code-face ((t (nil))))
- (jde-java-font-lock-constant-face ((t (nil))))
- (jde-java-font-lock-doc-tag-face ((t (nil))))
- (jde-java-font-lock-italic-face ((t (nil))))
- (jde-java-font-lock-link-face ((t (nil))))
- (jde-java-font-lock-modifier-face ((t (nil))))
- (jde-java-font-lock-number-face ((t (nil))))
- (jde-java-font-lock-operator-face ((t (nil))))
- (jde-java-font-lock-package-face ((t (nil))))
- (jde-java-font-lock-pre-face ((t (nil))))
- (jde-java-font-lock-underline-face ((t (nil))))
- (lazy-highlight-face ((t (nil))))
- (left-margin ((t (nil))))
- (linemenu-face ((t (nil))))
- (list-mode-item-selected ((t (nil))))
- (log-view-file-face ((t (nil))))
- (log-view-message-face ((t (nil))))
- (magenta ((t (nil))))
- (makefile-space-face ((t (nil))))
- (man-bold ((t (nil))))
- (man-heading ((t (nil))))
- (man-italic ((t (nil))))
- (man-xref ((t (nil))))
- (menu ((t (nil))))
- (message-cited-text ((t (nil))))
- (message-cited-text-face ((t (nil))))
- (message-header-cc-face ((t (nil))))
- (message-header-contents ((t (nil))))
- (message-header-name-face ((t (nil))))
- (message-header-newsgroups-face ((t (nil))))
- (message-header-other-face ((t (nil))))
- (message-header-subject-face ((t (nil))))
- (message-header-to-face ((t (nil))))
- (message-header-xheader-face ((t (nil))))
- (message-headers ((t (nil))))
- (message-highlighted-header-contents ((t (nil))))
- (message-mml-face ((t (nil))))
- (message-separator-face ((t (nil))))
- (message-url ((t (nil))))
- (minibuffer-prompt ((t (nil))))
- (mmm-face ((t (nil))))
- (mode-line ((t (:bold t :background "gray" :foreground "black"
-:weight bold))))
- (mode-line-inactive ((t (nil))))
- (modeline-buffer-id ((t (:background "orange" :foreground
-"black"))))
- (modeline-mousable ((t (:background "orange" :foreground
-"black"))))
- (modeline-mousable-minor-mode ((t (:background "orange"
-:foreground "black"))))
- (mouse ((t (nil))))
- (mpg123-face-cur ((t (nil))))
- (mpg123-face-slider ((t (nil))))
- (my-tab-face ((t (nil))))
- (nil ((t (nil))))
- (overlay-empty-face ((t (nil))))
- (p4-diff-del-face ((t (nil))))
- (paren-blink-off ((t (nil))))
- (paren-face ((t (nil))))
- (paren-face-match ((t (nil))))
- (paren-face-mismatch ((t (nil))))
- (paren-face-no-match ((t (nil))))
- (paren-match ((t (nil))))
- (paren-mismatch ((t (nil))))
- (paren-mismatch-face ((t (nil))))
- (paren-no-match-face ((t (nil))))
- (pointer ((t (nil))))
- (primary-selection ((t (nil))))
- (reb-match-0 ((t (nil))))
- (reb-match-1 ((t (nil))))
- (reb-match-2 ((t (nil))))
- (reb-match-3 ((t (nil))))
- (red ((t (nil))))
- (region ((t (:background "#7eff00" :foreground "black"))))
- (right-margin ((t (nil))))
- (rpm-spec-dir-face ((t (nil))))
- (rpm-spec-doc-face ((t (nil))))
- (rpm-spec-ghost-face ((t (nil))))
- (rpm-spec-macro-face ((t (nil))))
- (rpm-spec-package-face ((t (nil))))
- (rpm-spec-tag-face ((t (nil))))
- (rpm-spec-var-face ((t (nil))))
- (scroll-bar ((t (nil))))
- (secondary-selection ((t (:background "orange" :foreground
-"black"))))
- (semantic-dirty-token-face ((t (nil))))
- (semantic-intangible-face ((t (nil))))
- (semantic-read-only-face ((t (nil))))
- (semantic-unmatched-syntax-face ((t (nil))))
- (senator-intangible-face ((t (nil))))
- (senator-momentary-highlight-face ((t (nil))))
- (senator-read-only-face ((t (nil))))
- (sgml-comment-face ((t (nil))))
- (sgml-doctype-face ((t (nil))))
- (sgml-end-tag-face ((t (nil))))
- (sgml-entity-face ((t (nil))))
- (sgml-ignored-face ((t (nil))))
- (sgml-ms-end-face ((t (nil))))
- (sgml-ms-start-face ((t (nil))))
- (sgml-pi-face ((t (nil))))
- (sgml-sgml-face ((t (nil))))
- (sgml-short-ref-face ((t (nil))))
- (sgml-shortref-face ((t (nil))))
- (sgml-start-tag-face ((t (nil))))
- (sh-heredoc-face ((t (nil))))
- (shell-option-face ((t (nil))))
- (shell-output-2-face ((t (nil))))
- (shell-output-3-face ((t (nil))))
- (shell-output-face ((t (nil))))
- (shell-prompt-face ((t (nil))))
- (show-block-face1 ((t (nil))))
- (show-block-face2 ((t (nil))))
- (show-block-face3 ((t (nil))))
- (show-block-face4 ((t (nil))))
- (show-block-face5 ((t (nil))))
- (show-block-face6 ((t (nil))))
- (show-block-face7 ((t (nil))))
- (show-block-face8 ((t (nil))))
- (show-block-face9 ((t (nil))))
- (show-paren-match-face ((t (:background "orange" :foreground
-"black"))))
- (show-paren-mismatch-face ((t (:underline t))))
- (show-tabs-space-face ((t (nil))))
- (show-tabs-tab-face ((t (nil))))
- (smerge-base-face ((t (nil))))
- (smerge-markers-face ((t (nil))))
- (smerge-mine-face ((t (nil))))
- (smerge-other-face ((t (nil))))
- (speedbar-button-face ((t (nil))))
- (speedbar-directory-face ((t (nil))))
- (speedbar-file-face ((t (nil))))
- (speedbar-highlight-face ((t (nil))))
- (speedbar-selected-face ((t (nil))))
- (speedbar-separator-face ((t (nil))))
- (speedbar-tag-face ((t (nil))))
- (strokes-char-face ((t (nil))))
- (swbuff-current-buffer-face ((t (nil))))
- (tabbar-button-face ((t (nil))))
- (tabbar-default-face ((t (nil))))
- (tabbar-selected-face ((t (nil))))
- (tabbar-separator-face ((t (nil))))
- (tabbar-unselected-face ((t (nil))))
- (template-message-face ((t (nil))))
- (term-black ((t (nil))))
- (term-blackbg ((t (nil))))
- (term-blue ((t (nil))))
- (term-blue-bold-face ((t (nil))))
- (term-blue-face ((t (nil))))
- (term-blue-inv-face ((t (nil))))
- (term-blue-ul-face ((t (nil))))
- (term-bluebg ((t (nil))))
- (term-bold ((t (nil))))
- (term-cyan ((t (nil))))
- (term-cyan-bold-face ((t (nil))))
- (term-cyan-face ((t (nil))))
- (term-cyan-inv-face ((t (nil))))
- (term-cyan-ul-face ((t (nil))))
- (term-cyanbg ((t (nil))))
- (term-default ((t (nil))))
- (term-default-bg ((t (nil))))
- (term-default-bg-inv ((t (nil))))
- (term-default-bold-face ((t (nil))))
- (term-default-face ((t (nil))))
- (term-default-fg ((t (nil))))
- (term-default-fg-inv ((t (nil))))
- (term-default-inv-face ((t (nil))))
- (term-default-ul-face ((t (nil))))
- (term-green ((t (nil))))
- (term-green-bold-face ((t (nil))))
- (term-green-face ((t (nil))))
- (term-green-inv-face ((t (nil))))
- (term-green-ul-face ((t (nil))))
- (term-greenbg ((t (nil))))
- (term-invisible ((t (nil))))
- (term-invisible-inv ((t (nil))))
- (term-magenta ((t (nil))))
- (term-magenta-bold-face ((t (nil))))
- (term-magenta-face ((t (nil))))
- (term-magenta-inv-face ((t (nil))))
- (term-magenta-ul-face ((t (nil))))
- (term-magentabg ((t (nil))))
- (term-red ((t (nil))))
- (term-red-bold-face ((t (nil))))
- (term-red-face ((t (nil))))
- (term-red-inv-face ((t (nil))))
- (term-red-ul-face ((t (nil))))
- (term-redbg ((t (nil))))
- (term-underline ((t (nil))))
- (term-white ((t (nil))))
- (term-white-bold-face ((t (nil))))
- (term-white-face ((t (nil))))
- (term-white-inv-face ((t (nil))))
- (term-white-ul-face ((t (nil))))
- (term-whitebg ((t (nil))))
- (term-yellow ((t (nil))))
- (term-yellow-bold-face ((t (nil))))
- (term-yellow-face ((t (nil))))
- (term-yellow-inv-face ((t (nil))))
- (term-yellow-ul-face ((t (nil))))
- (term-yellowbg ((t (nil))))
- (tex-math-face ((t (nil))))
- (texinfo-heading-face ((t (nil))))
- (text-cursor ((t (nil))))
- (tool-bar ((t (nil))))
- (tooltip ((t (nil))))
- (trailing-whitespace ((t (nil))))
- (underline ((t (:underline t))))
- (variable-pitch ((t (nil))))
- (vc-annotate-face-0046FF ((t (nil))))
- (vcursor ((t (nil))))
- (vertical-divider ((t (nil))))
- (vhdl-font-lock-attribute-face ((t (nil))))
- (vhdl-font-lock-directive-face ((t (nil))))
- (vhdl-font-lock-enumvalue-face ((t (nil))))
- (vhdl-font-lock-function-face ((t (nil))))
- (vhdl-font-lock-generic-/constant-face ((t (nil))))
- (vhdl-font-lock-prompt-face ((t (nil))))
- (vhdl-font-lock-reserved-words-face ((t (nil))))
- (vhdl-font-lock-translate-off-face ((t (nil))))
- (vhdl-font-lock-type-face ((t (nil))))
- (vhdl-font-lock-variable-face ((t (nil))))
- (vhdl-speedbar-architecture-face ((t (nil))))
- (vhdl-speedbar-architecture-selected-face ((t (nil))))
- (vhdl-speedbar-configuration-face ((t (nil))))
- (vhdl-speedbar-configuration-selected-face ((t (nil))))
- (vhdl-speedbar-entity-face ((t (nil))))
- (vhdl-speedbar-entity-selected-face ((t (nil))))
- (vhdl-speedbar-instantiation-face ((t (nil))))
- (vhdl-speedbar-instantiation-selected-face ((t (nil))))
- (vhdl-speedbar-package-face ((t (nil))))
- (vhdl-speedbar-package-selected-face ((t (nil))))
- (vhdl-speedbar-subprogram-face ((t (nil))))
- (viper-minibuffer-emacs-face ((t (nil))))
- (viper-minibuffer-insert-face ((t (nil))))
- (viper-minibuffer-vi-face ((t (nil))))
- (viper-replace-overlay-face ((t (nil))))
- (viper-search-face ((t (nil))))
- (vm-xface ((t (nil))))
- (vmpc-pre-sig-face ((t (nil))))
- (vmpc-sig-face ((t (nil))))
- (w3m-anchor-face ((t (nil))))
- (w3m-arrived-anchor-face ((t (nil))))
- (w3m-header-line-location-content-face ((t (nil))))
- (w3m-header-line-location-title-face ((t (nil))))
- (white ((t (nil))))
- (widget ((t (nil))))
- (widget-button-face ((t (nil))))
- (widget-button-pressed-face ((t (nil))))
- (widget-documentation-face ((t (nil))))
- (widget-field-face ((t (nil))))
- (widget-inactive-face ((t (nil))))
- (widget-single-line-field-face ((t (nil))))
- (woman-addition-face ((t (nil))))
- (woman-bold-face ((t (nil))))
- (woman-italic-face ((t (nil))))
- (woman-unknown-face ((t (nil))))
- (x-face ((t (nil))))
- (xrdb-option-name-face ((t (nil))))
- (xref-keyword-face ((t (nil))))
- (xref-list-default-face ((t (nil))))
- (xref-list-pilot-face ((t (nil))))
- (xref-list-symbol-face ((t (nil))))
- (yellow ((t (nil))))
- (zmacs-region ((t (nil)))))))
-
-(defun color-theme-feng-shui ()
- "Color theme by walterh@rocketmail.com (www.xanadb.com), created
- 2003-10-16. Evolved from color-theme-katester"
- (interactive)
- (color-theme-install
- '(color-theme-feng-shui
- ((background-color . "ivory")
- (background-mode . light)
- (border-color . "black")
- (cursor-color . "slateblue")
- (foreground-color . "black")
- (mouse-color . "slateblue"))
- ((help-highlight-face . underline)
- (list-matching-lines-face . bold)
- (view-highlight-face . highlight)
- (widget-mouse-face . highlight))
- (default ((t (:stipple nil :background "ivory" :foreground "black"
-:inverse-video nil :box nil :strike-through nil :overline nil
-:underline nil :slant normal :weight normal :height 90 :width normal
-:family "outline-courier new"))))
- (bold ((t (:bold t :weight bold))))
- (bold-italic ((t (:italic t :bold t :slant italic :weight bold))))
- (border ((t (:background "black"))))
- (cursor ((t (:background "slateblue" :foreground "black"))))
- (fixed-pitch ((t (:family "courier"))))
- (font-lock-builtin-face ((t (:foreground "black"))))
- (font-lock-comment-face ((t (:italic t :background "seashell"
-:slant italic))))
- (font-lock-constant-face ((t (:foreground "darkblue"))))
- (font-lock-doc-face ((t (:background "lemonChiffon"))))
- (font-lock-function-name-face ((t (:bold t :underline t :weight
-bold))))
- (font-lock-keyword-face ((t (:foreground "blue"))))
- (font-lock-string-face ((t (:background "lemonChiffon"))))
- (font-lock-type-face ((t (:foreground "black"))))
- (font-lock-variable-name-face ((t (:foreground "black"))))
- (font-lock-warning-face ((t (:bold t :foreground "Red" :weight
-bold))))
- (fringe ((t (:background "grey95"))))
- (header-line ((t (:bold t :weight bold :underline t :background
-"grey90" :foreground "grey20" :box nil))))
- (highlight ((t (:background "mistyRose" :foreground "black"))))
- (isearch ((t (:background "magenta4" :foreground
-"lightskyblue1"))))
- (isearch-lazy-highlight-face ((t (:background "paleturquoise"))))
- (italic ((t (:italic t :slant italic))))
- (menu ((t (nil))))
- (mode-line ((t (:bold t :background "mistyRose" :foreground "navy"
-:underline t :weight bold))))
- (mouse ((t (:background "slateblue"))))
- (region ((t (:background "lavender" :foreground "black"))))
- (scroll-bar ((t (nil))))
- (secondary-selection ((t (:background "yellow"))))
- (tool-bar ((t (:background "grey75" :foreground "black" :box
-(:line-width 1 :style released-button)))))
- (trailing-whitespace ((t (:background "red"))))
- (underline ((t (:underline t))))
- (variable-pitch ((t (:family "helv"))))
- (widget-button-face ((t (:bold t :weight bold))))
- (widget-button-pressed-face ((t (:foreground "red"))))
- (widget-documentation-face ((t (:foreground "dark green"))))
- (widget-field-face ((t (:background "gray85"))))
- (widget-inactive-face ((t (:foreground "dim gray"))))
- (widget-single-line-field-face ((t (:background "gray85")))))))
-
-
-(defun color-theme-renegade ()
- "Renegade BBS styled color theme. Works well in X and terminals.
-Created by Dave Benjamin <ramen@ramenfest.com> Dec 23 2005."
- (interactive)
- (color-theme-install
- '(color-theme-renegade
- ((background-color . "black")
- (background-mode . dark)
- (border-color . "black")
- (cursor-color . "black")
- (foreground-color . "cyan3")
- (mouse-color . "white"))
- (default ((t (nil))))
- (bold ((t (:bold t :foreground "cyan" :weight bold))))
- (bold-italic ((t (:italic t :bold t :foreground "cyan" :slant italic :weight bold))))
- (fixed-pitch ((t (:family "courier"))))
- (font-lock-builtin-face ((t (:bold t :foreground "cornflower blue" :weight bold))))
- (font-lock-comment-face ((t (:bold t :foreground "yellow" :weight bold))))
- (font-lock-constant-face ((t (:foreground "magenta3"))))
- (font-lock-doc-face ((t (:bold t :weight bold :foreground "red"))))
- (font-lock-function-name-face ((t (:foreground "gray"))))
- (font-lock-keyword-face ((t (:bold t :foreground "cyan" :weight bold))))
- (font-lock-string-face ((t (:bold t :foreground "red" :weight bold))))
- (font-lock-type-face ((t (:bold t :foreground "cyan" :weight bold))))
- (font-lock-variable-name-face ((t (:foreground "cyan3"))))
- (font-lock-warning-face ((t (:bold t :foreground "red" :weight bold))))
- (fringe ((t (:background "gray32"))))
- (highlight ((t (:background "blue"))))
- (isearch ((t (:background "blue" :foreground "cyan3"))))
- (isearch-lazy-highlight-face ((t (:background "turquoise3" :foreground "black"))))
- (menu ((t (nil))))
- (mode-line ((t (:bold t :background "blue3" :foreground "white" :box (:line-width -1 :style released-button) :weight bold))))
- (mouse ((t (:background "white"))))
- (region ((t (:bold t :background "white" :foreground "blue" :weight bold))))
- (scroll-bar ((t (nil))))
- (trailing-whitespace ((t (:background "red"))))
- (underline ((t (:underline t))))
- (variable-pitch ((t (:family "helv")))))))
-
-;;; color-theme-library.el ends here
diff --git a/.emacs.d/color-theme-solarized.el b/.emacs.d/color-theme-solarized.el
deleted file mode 100644
index 02b8ad8..0000000
--- a/.emacs.d/color-theme-solarized.el
+++ /dev/null
@@ -1,139 +0,0 @@
-;;; Author: Ethan Schoonover, Solarized; Greg Pfeil, Emacs adaptation
-;;; URL: http://ethanschoonover.com/solarized
-
-;;; This file is not (YET) part of GNU Emacs.
-
-;;; # Usage
-
-;;; 1. Install the color-theme package
-;;; (http://www.emacswiki.org/cgi-bin/wiki/ColorTheme)
-;;; 2. Load this file
-;;; 3. M-x color-theme-solarized-[dark|light]
-
-(eval-when-compile
- (require 'color-theme))
-
-;; `((normal (:foreground ,base0 :background ,base03))
-;; (comment (:foreground ,base01 :italic t))
-;; ((constant string character number boolean float) (:foreground ,cyan))
-;; ((identifier function directory) (:foreground ,blue))
-;; ((statement conditional repeat label operator keyword exception)
-;; (:foreground ,green))
-;; ((pre-proc include define macro pre-condit) (:foreground orange))
-;; ((type storage-class structure typedef (:foreground yellow)))
-;; ((special special-char tag delimiter special-comment debug)
-;; (:foreground ,red))
-;; (underlined (:foreground ,violet))
-;; (error (:foreground ,red :bold t))
-;; (todo (:foreground ,magenta :bold t))
-;; (special-key (:foreground ,base02))
-;; (non-text (:foreground ,base02 :bold t))
-;; ())
-
-(defun color-theme-solarized (mode)
- "Color theme by Ethan Schoonover, created 2011-03-24.
-Ported to Emacs by Greg Pfeil, http://ethanschoonover.com/solarized."
- (interactive "Slight or dark? ")
- (let ((base03 "#002b36")
- (base02 "#073642")
- (base01 "#586e75")
- (base00 "#657b83")
- (base0 "#839496")
- (base1 "#93a1a1")
- (base2 "#eee8d5")
- (base3 "#fdf6e3")
- (yellow "#b58900")
- (orange "#cb4b16")
- (red "#dc322f")
- (magenta "#d33682")
- (violet "#6c71c4")
- (blue "#268bd2")
- (cyan "#2aa198")
- (green "#859900"))
- (when (eq 'light mode)
- (rotatef base03 base3)
- (rotatef base02 base2)
- (rotatef base01 base1)
- (rotatef base00 base0))
- (color-theme-install
- `(color-theme-solarized
- ((foreground-color . ,base0)
- (background-color . ,base03)
- (background-mode . ,mode)
- (cursor-color . ,base0))
- ;; basic
- (default ((t (:foreground ,base0))))
- (cursor ((t (:foreground ,base0 :background ,base03 :inverse-video t))))
- (escape-glyph-face ((t (:foreground ,red))))
- (fringe ((t (:foreground ,base01 :background ,base02))))
- (header-line ((t (:foreground ,base0 :background ,base2))))
- (highlight ((t (:background ,base02))))
- (isearch ((t (:foreground ,yellow :inverse-video t))))
- (menu ((t (:foreground ,base0 :background ,base02))))
- (minibuffer-prompt ((t (:foreground ,blue))))
- (mode-line
- ((t (:foreground ,base1 :background ,base02
- :box (:line-width 1 :color ,base1)))))
- (mode-line-buffer-id ((t (:foreground ,base1))))
- (mode-line-inactive
- ((t (:foreground ,base0 :background ,base02
- :box (:line-width 1 :color ,base02)))))
- (region ((t (:background ,base02))))
- (secondary-selection ((t (:background ,base02))))
- (trailing-whitespace ((t (:foreground ,red :inverse-video t))))
- (vertical-border ((t (:foreground ,base0))))
- ;; compilation
- (compilation-info ((t (:forground ,green :bold t))))
- (compilation-warning ((t (:foreground ,orange :bold t))))
- ;; customize
- (custom-button
- ((t (:background ,base02 :box (:line-width 2 :style released-button)))))
- (custom-button-mouse ((t (:inherit custom-button :foreground ,base1))))
- (custom-button-pressed
- ((t (:inherit custom-button-mouse
- :box (:line-width 2 :style pressed-button)))))
- (custom-comment-tag ((t (:background ,base02))))
- (custom-comment-tag ((t (:background ,base02))))
- (custom-documentation ((t (:inherit default))))
- (custom-group-tag ((t (:foreground ,orange :bold t))))
- (custom-link ((t (:foreground ,violet))))
- (custom-state ((t (:foreground ,green))))
- (custom-variable-tag ((t (:foreground ,orange :bold t))))
- ;; diff
- (diff-added ((t (:foreground ,green :inverse-video t))))
- (diff-changed ((t (:foreground ,yellow :inverse-video t))))
- (diff-removed ((t (:foreground ,red :inverse-video t))))
- ;; emacs-wiki
- (emacs-wiki-bad-link-face ((t (:foreground ,red :underline t))))
- (emacs-wiki-link-face ((t (:foreground ,blue :underline t))))
- (emacs-wiki-verbatim-face ((t (:foreground ,base00 :underline t))))
- ;; font-lock
- (font-lock-builtin-face ((t (:foreground ,green))))
- (font-lock-comment-face ((t (:foreground ,base01 :italic t))))
- (font-lock-constant-face ((t (:foreground ,cyan))))
- (font-lock-function-name-face ((t (:foreground ,blue))))
- (font-lock-keyword-face ((t (:foreground ,green))))
- (font-lock-string-face ((t (:foreground ,cyan))))
- (font-lock-type-face ((t (:foreground ,yellow))))
- (font-lock-variable-name-face ((t (:foreground ,blue))))
- (font-lock-warning-face ((t (:foreground ,red :bold t))))
- ;; info
- (info-xref ((t (:foreground ,blue :underline t))))
- (info-xref-visited ((t (:inherit info-xref :foreground ,magenta))))
- ;; org
- (org-hide ((t (:foreground ,base03))))
- (org-todo ((t (:foreground ,red :bold t))))
- (org-done ((t (:foreground ,green :bold t))))
- ;; show-paren
- (show-paren-match-face ((t (:background ,cyan :foreground ,base3))))
- (show-paren-mismatch-face ((t (:background ,red :foreground ,base3))))))))
-
-(defun color-theme-solarized-dark ()
- (interactive)
- (color-theme-solarized 'dark))
-
-(defun color-theme-solarized-light ()
- (interactive)
- (color-theme-solarized 'light))
-
-(provide 'color-theme-solarized)
diff --git a/.emacs.d/conkeror.el b/.emacs.d/conkeror.el
deleted file mode 100644
index ea1aec1..0000000
--- a/.emacs.d/conkeror.el
+++ /dev/null
@@ -1,5 +0,0 @@
-(
- (insert "xwidgetdemo<<< a button. another button\n")
- (goto-char (point-min))
- (put-text-property (point) (+ 1 (point)) 'display '(xwidget :xwidget-id 1 :type 1 :title "1" :width 40 :height 50))
-) \ No newline at end of file
diff --git a/.emacs.d/ezbl.el b/.emacs.d/ezbl.el
deleted file mode 100644
index c8ebf71..0000000
--- a/.emacs.d/ezbl.el
+++ /dev/null
@@ -1,1246 +0,0 @@
-;;; ezbl.el --- Emacs interface for Uzbl (uzbl.org)
-;;
-;; Version: 0.4
-;; URL: http://github.com/dhax/ezbl
-
-;; This file is free software; you can redistribute it and/or modify it under
-;; the terms of the GNU General Public License as published by the Free Software
-;; Foundation; either version 3, or (at your option) any later version.
-
-;; This file is distributed in the hope that it will be useful, but WITHOUT ANY
-;; WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-;; A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License along with
-;; GNU Emacs; see the file COPYING. If not, write to the Free Software
-;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-;; USA.
-
-;;; Commentary:
-;;
-;; Uzbl version 2009.11.30 or greater is required. Ezbl will not work with
-;; older versions.
-;;
-;; Run `ezbl-open' to start a Uzbl instance and browse to a URL. Also, check
-;; `ezbl-mode' for a listing of the key bindings of Ezbl.
-
-(eval-when-compile
- (require 'cl))
-(require 'url-cookie)
-
-(defgroup ezbl nil "Settings for Ezbl, the Emacs frontend for Uzbl.")
-
-(defcustom ezbl-exec-path (or (executable-find "uzbl-core") "/usr/bin/uzbl-core")
- "The location of the Uzbl executable."
- :group 'ezbl
- :type 'file)
-
-(defcustom ezbl-cookie-socket "/tmp/ezbl-cookies"
- "The location of the socket through which to handle cookies."
- :group 'ezbl
- :type 'file)
-
-(defvar ezbl-inst-list nil
- "An alist of Uzbl instances and their pids.
-
-Has the format:
-
- ((pid . instance)
- (pid2 . instance2))
-
-The values are instances of the `ezbl-inst' struct.")
-
-(defvar ezbl-inst nil
- "A buffer-local variable storing the current Ezbl instance.
-
-It is an instance of the `ezbl-inst' struct.")
-
-(defvar ezbl-cookie-process nil
- "The process which is listening for cookie requests from Uzbl
-processes.")
-
-(defvar ezbl-initialized nil
- "Keeps track of whether or not Ezbl has been initialized. This
-should only be set by `ezbl-init'.")
-
-(defconst ezbl-inst-slots
- '(args
- process
- pid
- output-buffer
- display-buffer
- vars)
- "A list of the slot names in the `ezbl-inst' structure.
-
-`defstruct' does not keep a list of the fields of the struct for
-later use, so do this manually.")
-
-(eval `(defstruct ezbl-inst
- "A structure containing the properties of an Ezbl instance."
- ,@ezbl-inst-slots))
-
-(defconst ezbl-inst-get-first
- '(ezbl-inst-get-first
- nil ;; protected
- t ;; enabled
- (advice . (lambda ()
- (ad-set-arg 0 (ezbl-inst-get (ad-get-arg 0))))))
- "Computed advice to apply to each of the `ezbl-inst' slot
-accessors.")
-
-(defconst ezbl-output-buffer-format " *ezbl-output-%s*"
- "The format used for transforming ezbl instance names into
-buffer names.")
-
-(defconst ezbl-display-buffer-format "*ezbl-display-%s*"
- "The format used for transforming ezbl instance names into
-buffer names.")
-
-(defvar ezbl-commands
- '(((name . "back")
- (format . "back")
- (interactive . "U")
- (key-binding . "C-c C-b")
- (doc . "Move backwards in the browser history."))
-
- ((name . "forward")
- (format . "forward")
- (interactive . "U")
- (key-binding . "C-c C-f")
- (doc . "Move forwards in the browser history."))
-
- ((name . "scroll")
- (format . "scroll <direction> <argument>")
- (interactive . "U\nnScroll amount: ")
- (key-binding . "C-c C-v")
- (doc . "Scroll in DIRECTION by ARGUMENT.
-
-* argument can be `begin`, `end`, or an amount given in pixels or
- as a percentage of the size of the view.
-
-* set the amount to 100% to scroll a whole page"))
-
- ((name . "reload")
- (format . "reload")
- (interactive . "U")
- (key-binding . "C-c C-r")
- (doc . "Reload the current page."))
-
- ((name . "reload_ign_cache")
- (format . "reload_ign_cache")
- (interactive . "U")
- (doc . "Reload the current page, clearing the cache."))
-
- ((name . "stop")
- (format . "stop")
- (interactive . "U")
- (key-binding . "C-c C-g")
- (doc . "Stop the currently loading page."))
-
- ((name . "zoom_in")
- (format . "zoom_in")
- (interactive . "U")
- (key-binding . "C-c z i")
- (doc . "Increase the zoom level."))
-
- ((name . "zoom_out")
- (format . "zoom_out")
- (interactive . "U")
- (key-binding . "C-c z o")
- (doc . "Decrease the zoom level."))
-
- ((name . "toggle_zoom_type")
- (format . "toggle_zoom_type")
- (interactive)
- (doc . "Toggles the variable 'zoom_type' between
-'full-content' and 'text-only' zoom. In 'text-only' zoom, only
-the text of the page is zoomed, while in 'full-content' zoom,
-images and other page elements are zoomed along with the text."))
-
- ((name . "uri")
- (format . "uri <address>")
- (interactive . "U\nsAddress: ")
- (key-binding . "C-c C-o")
- (doc . "Visit the Uri ADDRESS"))
-
- ((name . "js")
- (format . "js <body>")
- (interactive . "U\nsJavascript to execute: ")
- (doc . "Execute JavaScript within the browser.
-
-* execute the javascript in BODY.
-* remember that the commands must not contain line breaks."))
-
- ((name . "script")
- (format . "script <file>")
- (interactive . "U\nfJavascript file to execute: ")
- (key-binding . "C-c C-j")
- (doc . "execute the JavaScript in FILE."))
-
- ((name . "toggle_status")
- (format . "toggle_status")
- (interactive . "U")
- (doc . "Toggle the display of the status bar."))
-
- ((name . "spawn")
- (format . "spawn <executable> <additonal_args>")
- (interactive . "U\nFFile to spawn\nsAdditional arguments:")
- (doc . "Runs a command.
-
-* See the \"external scripts\" section of the Uzbl readme for
- details.
-
-* PATH is searched so giving the full path to commands is not
- necessary.
-
-* note that the arguments as specified in \"external scripts\"
- are appended at the end, so the argument numbers will be
- higher."))
-
- ((name . "sync_spawn")
- (format . "sync_spawn <executable> <additional_args>")
- (interactive . "U\nFFile to spawn\nsAdditional arguments:")
- (doc . "Tell Uzbl to synchronously spawn a command.
-
-See `ezbl-command-spawn' for details.
-
-* these are synchronous variants of spawn and sh, which means
- uzbl will wait for them to return.
-
-* you should only need to use these manually if you want to use a
- chain command in a handler that wants output from the command
- it runs"))
-
- ((name . "sh")
- (format . "sh <command>")
- (interactive . "U\nsCommand to execute: ")
- (doc . "Run a shell command.
-
-* runs a shell command by expanding %s in the shell_cmd variable
- with the specified command; primarily useful as a shortcut for
- \"spawn sh -c BODY\"
-
-* note that the arguments as specified in \"external scripts\"
- are appended at the end, so the argument numbers will be
- higher."))
-
- ((name . "sync_sh")
- (format . "sync_sh <command>")
- (interactive . "U\nsCommand to run: ")
- (doc . "Tell Uzbl to synchronously run a shell command.
-
-See `ezbl-command-sh' for details.
-
-* these are synchronous variants of spawn and sh, which means
- uzbl will wait for them to return.
-
-* you should only need to use these manually if you want to use a
- chain command in a handler that wants output from the command
- it runs"))
-
- ((name . "talk_to_socket")
- (format . "talk_to_socket <socketfile> <args>")
- (doc . "Lets uzbl talk to a socketfile."))
-
- ((name . "exit")
- (format . "exit")
- (interactive . "U")
- (key-binding . "C-c C-q")
- (doc . "Close this instance of Uzbl."))
-
- ((name . "search")
- (format . "search <string>")
- (interactive . "U\nsSearch: ")
- (key-binding . "C-s")
- (doc . "Search for STRING within the content of the current
-Uzbl page.
-
-* search with no string will search for the next/previous
- occurrence of the string previously searched for."))
-
- ((name . "search_reverse")
- (format . "search_reverse <string>")
- (interactive . "U\nsSearch backward: ")
- (key-binding . "C-r")
- (doc . "Search backwards for STRING in the current page.
-
-* search with no string will search for the next/previous
- occurrence of the string previously searched for."))
-
- ((name . "search_clear")
- (format . "search_clear")
- (interactive . "U")
- (doc . "Unmark and clear the search string"))
-
- ((name . "dehilight")
- (format . "dehilight")
- (interactive)
- (doc . "Remove highlighting of search matches."))
-
- ((name . "set")
- (format . "set <key> = <value>")
- (interactive . (let* ((var-name
- (completing-read "Variable to set: "
- (mapcar '(lambda (item)
- (cdr-safe (assq 'name item))) ezbl-variables)
- nil ;; predicate
- t ;; require-match
- nil ;; initial-input
- 'ezbl-command-set-history)) ;; hist
- (default (ezbl-variable-get nil var-name))
- (new-val (read-string (format "New value (%s): " default) nil nil default)))
- (list nil var-name new-val)))
- (key-binding . "C-c C-s")
- (doc . "Used for changing variables on the fly. Sets KEY
- equal to VALUE.
-
-* the changes are effective immediately; for example, setting the
- variable uri will make uzbl start loading, and changing
- status_format will make the status bar react immediately
-
-* if you want to unset a string, use `set' with one space as the
- value."))
-
- ((name . "dump_config")
- (format . "dump_config")
- (doc . "Dump the current Uzbl configuration.
-
-* dumps your current config (which may have been changed at
- runtime) to stdout, in a format you can use to pipe into uzbl
- again (or use as config file)"))
-
- ((name . "dump_config_as_events")
- (format . "dump_config_as_events")
- (doc . "Dump the current config as a series of
-'VARIABLE_SET' events, which can be handled by an event manager."))
-
- ((name . "chain")
- (format . "chain <command> <command2>")
- (interactive . "U\nsCommand 1: \nsCommand 2: ")
- (doc . "Use for chaining multiple commands.
-
-* remember to quote the commands; one command must come as one
- parameter.
-
-* If you use chain with a handler script which must return some
- output (such as a cookie handler -- uzbl will wait for and use
- its output), use 'sync_spawn' or 'sync_sh' instead of 'spawn'
- or 'sh' in the command that should give the output."))
-
- ((name . "print")
- (format . "print <key>")
- (doc . "Print the value of KEY.
-
-If KEY contains a string of the form '@var', the value of the Uzl
-variable 'var' is printed.
-
-* use this to print the value of a variable."))
-
- ((name . "event")
- (format . "event <name> <details>")
- (interactive . "U")
- (doc . "Send custom event.
-NAME is the event name and DETAILS is additional information to include."))
-
- ((name . "request")
- (format . "request <name> <details>")
- (interactive . "U")
- (doc . "Send custom request.
-Same idea as events, but to be processed by EM, not uzbl-core."))
-
- ((name . "menu_add")
- (format . "menu_add <label> = <command>"))
-
- ((name . "menu_link_add")
- (format . "menu_link_add <label> = <command>"))
-
- ((name . "menu_image_add")
- (format . "menu_image_add <label> = <command>"))
-
- ((name . "menu_editable_add")
- (format . "menu_editable_add <label> = <command>")
- (doc . "add a new entry LABEL that will execute COMMAND to one
-of the right click context menus."))
-
- ((name . "menu_separator")
- (format . "menu_separator <label>"))
-
- ((name . "menu_link_separator")
- (format . "menu_link_separator <label>"))
-
- ((name . "menu_image_separator")
- (format . "menu_image_separator <label>"))
-
- ((name . "menu_editable_separator")
- (format . "menu_editable_separator <label>")
- (doc . "Adds a separator line to one of the right click context menus."))
-
- ((name . "menu_remove")
- (format . "menu_remove <label>"))
-
- ((name . "menu_link_remove")
- (format . "menu_link_remove <label>"))
-
- ((name . "menu_image_remove")
- (format . "menu_image_remove <label>"))
-
- ((name . "menu_editable_remove")
- (format . "menu_editable_remove <label>")
- (doc . "Removes the entry LABEL from one of the right click context menus."))
-
- ((name . "hardcopy")
- (format . "hardcopy")
- (doc . "open print dialog"))
-
- ((name . "include")
- (format . "include <file>")
- (doc . "read contents of file and interpret commands")))
- "A list of commands which Uzbl accepts. These are used to
-generate the functions to call each command.
-
-The following attributes can be used in each alist:
-
-- name (mandatory)
-
- The name of the command. This is the string that is passed to
- Uzbl when invoking the command.
-
-- format (mandatory)
-
- The format of the command, for example
-
- scroll <direction> <amount>
-
-- interactive (optional)
-
- The interactive spec for the function. If this attribute is not
- present, then the function will not be interactive.
-
-- doc (optional)
-
- The documentation string to provide for the function.
-
-- key-binding (optional)
-
- The key binding in `ezbl-mode-map' of the function. If it is
- not included, no keybinding is set for that command. The value
- must be a string to be supplied to the `kbd' macro.
-
-All variables must be enclosed in angle brackets.")
-
-(defvar ezbl-variables
- '(((name . "uri")
- (doc . "(callback: load the uri)"))
-
- ((name . "verbose")
- (doc . "affects output on stdout"))
-
- ((name . "inject_html")
- (doc . "base_url: used when passing html through stdin"))
-
- ((name . "geometry")
- (doc . "Geometry and position of the Uzbl window. Format is \"<width>x<height>+<x-offset>+<y-offset>\"."))
-
- ((name . "keycmd")
- (doc . "Holds the input buffer (callback: update input buffer)"))
-
- ((name . "show_status")
- (doc . "show statusbar or not"))
-
- ((name . "status_top")
- (doc . "statusbar on top?"))
-
- ((name . "status_format")
- (doc . "marked up, to be expanded string for statusbar (callback: update statusbar)"))
-
- ((name . "status_background")
- (doc . "color which can be used to override Gtk theme."))
-
- ((name . "title_format_long")
- (doc . "titlebar string when no statusbar shown (will be expanded"))
-
- ((name . "title_format_short")
- (doc . "titlebar string when statusbar shown (will be expanded)"))
-
- ((name . "icon")
- (doc . "path to icon for Gtk"))
-
- ((name . "forward_keys")
- (doc . "whether uzbl-core should send key events to the webkit view")
- (default . "1"))
-
- ((name . "download_handler")
- (doc . "The command to call (usually a shell script) when the page requests a download"))
-
- ((name . "cookie_handler")
- (doc . "The command to call to handle cookies.")
- (default . (eval (format "talk_to_socket %s" ezbl-cookie-socket))))
-
- ((name . "new_window")
- (doc . "handler to execute to invoke new uzbl window (TODO better name)"))
-
- ((name . "scheme_handler")
- (doc . "handler to execute for each URI navigated
-to - the navigation request will be ignored if handler prints USED."))
-
- ((name . "fifo_dir")
- (doc . "location to store fifo's"))
-
- ((name . "socket_dir")
- (doc . "location to store sockets"))
-
- ((name . "http_debug")
- (doc . "http debug mode (value 0-3)"))
-
- ((name . "shell_cmd")
- (doc . "alias which will be expanded to use shell commands (eg sh -c)"))
-
- ((name . "proxy_url")
- (doc . "http traffic socks proxy (eg: http://<host>:<port>)"))
-
- ((name . "max_conns")
- (doc . "max simultaneous connections (default: 100)"))
-
- ((name . "max_conns_host")
- (doc . "max simultaneous connections per hostname (default: 6)"))
-
- ((name . "view_source")
- (doc . "View the page source."))
-
- ((name . "useragent")
- (doc . "to be expanded string"))
-
- ((name . "zoom_level")
- (doc . "The level of zoom of the page."))
-
- ((name . "zoom_type")
- (doc . "The type of zoom."))
-
- ((name . "font_size")
- (doc . "The current font size."))
-
- ((name . "default_font_family")
- (doc . "sans-serif"))
-
- ((name . "monospace_font_family")
- (doc . "monospace (example Aerial Mono)"))
-
- ((name . "cursive_font_family")
- (doc . "sans"))
-
- ((name . "sans_serif_font_family")
- (doc . "sans (example DejaVu Sans)"))
-
- ((name . "serif_font_family")
- (doc . "serif (example DejaVu Serif)"))
-
- ((name . "fantasy_font_family")
- (doc . "Pterra"))
-
- ((name . "monospace_size")
- (doc . "Default monospace font size."))
-
- ((name . "minimum_font_size")
- (doc . "The minimum font size."))
-
- ((name . "disable_plugins")
- (doc . "(TODO rename to enable)"))
-
- ((name . "disable_scripts")
- (doc . "(TODO rename to enable)"))
-
- ((name . "autoload_images")
- (doc . "Images are automatically loaded."))
-
- ((name . "autoshrink_images")
- (doc . "shrink images to window size (default 0)"))
-
- ((name . "enable_spellcheck")
- (doc . "Spellcheck is enabled."))
-
- ((name . "enable_private")
- (doc . "Private mode is enabled."))
-
- ((name . "print_backgrounds")
- (doc . "print background images? (default 0)"))
-
- ((name . "stylesheet_uri")
- (doc . "use this to override the pagelayout with a custom stylesheet"))
-
- ((name . "resizable_text_areas")
- (doc . "Are text areas resizable?"))
-
- ((name . "default_encoding")
- (doc . "iso-8859-1 by default"))
-
- ((name . "enforce_96_dpi")
- (doc . "1 by default"))
-
- ((name . "caret_browsing")
- (doc . "Whether to use caret browsing.")))
- "The variables available from Uzbl.
-
-This is a list of alists, where each alist has the attributes:
-
-- name (mandatory)
-
- The name of the variable. Must exactly match the name used by
- Uzbl.
-
-- doc (mandatory)
-
- A description of the variable. Usually taken straight from the
- Uzbl README.
-
-- default (optional)
-
- An optional default value for the variable. Note that this is
- not the same as Uzbl's default values; values here will
- overwrite Uzbl defaults.
-
- Either a string to be sent to Uzbl or a list of the form (eval
- FORM), where FORM is a Lisp expression, evaluated after each
- Uzbl instance is started, which returns a string to use as the
- default value.")
-
-(defvar ezbl-xwidget-id-counter 0
- "Keeps track of the current value to assign to newly-created xwidgets.
-
-IDs must be unique, or Emacs will crash.")
-
-(defconst ezbl-xwidget-type 3
- "The type attribute for xwidget embedded widgets.
-
-For whatever reason, the Xwidget patch specifies that embedded X windows have
-this type.")
-
-(defvar ezbl-xembed-ready-hook nil
- "Commands to run when an ezbl instance receives the
-
-`xembed-ready' signal.")
-
-(defun ezbl-command-get-args (command)
- "Extracts the arguments (as symbols) from a Uzbl command specification.
-
-For example, the spec
-
- scroll_vert <amount>
-
-Would return (amount)."
- (let ((start 0)
- (args nil))
- (while (string-match "<\\([[:alnum:]_-]+\\)>" command start)
- (setq args (add-to-list 'args (intern (match-string 1 command)) t))
- (setq start (match-end 1)))
- args))
-
-(defun ezbl-command-make-func (spec)
- "Creates a function which produces the Uzbl command string described by SPEC.
-
-The function created takes a number of arguments specified by the
-`format' attribute of SPEC and returns a string suitable for
-`ezbl-command-exec'.
-
-Sets the `interactive' declaration to the `interactive' attribute
-of SPEC.
-
-It also defines a variable `ezbl-command-NAME-history' which can
-be used by the function to record the input history of the
-function when called interactively.
-
-See `ezbl-commands' for a description of the format of SPEC."
- (let* ((name (cdr (assq 'name spec)))
- (format (cdr (assq 'format spec)))
- (args (ezbl-command-get-args format))
- (doc (cdr (assq 'doc spec)))
- (output-format (replace-regexp-in-string "<[[:alnum:]_-]+>" "%s" format))
- (interactive-spec (cdr (assq 'interactive spec)))
- (command-name (intern (concat "ezbl-command-" name)))
- (history-list (intern (format "%s-history" command-name))))
- ;; Make the symbol contained in `history-list' bound.
- (set history-list nil)
- (fset command-name
- `(lambda (inst ,@args)
- ,doc
- ,(when interactive-spec `(interactive ,interactive-spec))
- (ezbl-command-exec inst (format ,output-format ,@args))))))
-
-(defun ezbl-command-init ()
- "Create Emacs functions from `ezbl-commands' and `ezbl-instance-spec'.
-
-Read through `ezbl-commands' and call `ezbl-command-make-func' on
-each one. Also, run through `ezbl-instance-spec' and call
-`ezbl-make-instance-accessor-func' on each one."
- (interactive)
- (append (mapcar 'ezbl-command-make-func ezbl-commands)))
-
-(defun ezbl-variable-set-defaults (&optional inst)
- "Set the variable defaults according to `ezbl-variables'."
- (mapc '(lambda (spec)
- (let ((name (cdr (assq 'name spec)))
- (default (cdr-safe (assq 'default spec))))
- (when default
- (if (and (consp default) (eq (car default) 'eval))
- (setq default (eval (cadr default))))
- (ezbl-command-set inst name default))))
- ezbl-variables))
-
-(defun ezbl-init ()
- "Starts up the services needed for Ezbl to run."
- (unless ezbl-initialized
- (when (or (not (boundp 'server-name)) (null server-name))
- (error "Emacs server is required for Ezbl, but `server-name' is nil."))
- (when (null server-process)
- (error "Emacs server is required for Ezbl, but the server is not started."))
- (unless (featurep 'xwidget)
- (error "This version of Emacs does not support embedding windows. Please get a patched version from http://github.com/jave/emacs"))
- (unless (featurep 'make-network-process '(:type seqpacket))
- (error "This version of Emacs does not support SEQPACKET sockets"))
- (ezbl-cookie-socket-listen nil t)
- (ezbl-inst-define-advice)
- (setq ezbl-initialized t)))
-
-(defun ezbl-inst-start (&rest args)
- "Start an instance of Uzbl. ARGS is a keyword list of
-options and values to pass to the Uzbl instance.
-
-The following keywords are used:
-
-:class VALUE
- Program class as used by the window manager
-:gtk-name NAME
- Program name as used by the window manager
-:screen SCREEN
- X screen to use
-:sync nil
- Make X calls synchronous. Must include `nil' as the argument.
-:gtk-module MODULES
- Load additional GTK+ modules. MODULES should be a list of
- string names of modules.
-:g-fatal-warnings nil
- Make all warnings fatal. Must include `nil' as the argument.
-:uri URI
- Uri to load at startup (equivalent to 'set uri = URI')
-:verbose nil
- Whether to print all messages or just errors. Must
- include `nil' as the argument.
-:name NAME
- Name of the current instance (defaults to Xorg window id)
-:config FILE
- Config file (this is pretty much equivalent to 'uzbl < FILE' )
-:socket SOCKET
- Socket ID for GtkSocket.
-:display DISPLAY
- X display to use
-
-Returns an `ezbl-inst' struct."
- (let (program-args)
- ;; Process keywords
- (while args
- (let ((arg (car args)))
- (setq args (cdr args))
- (unless (symbolp arg)
- (error "Junk in args %S" args))
- (let ((keyword arg)
- (value (car args)))
- (unless args
- (error "Keyword %s is missing an argument" keyword))
- (setq args (cdr args))
- (cond
- ((eq keyword :class)
- (setq program-args (append program-args (list "--class") (list value))))
- ((eq keyword :gtk-name)
- (setq program-args (append program-args (list "--gtk-name") (list value))))
- ((eq keyword :screen)
- (setq program-args (append program-args (list "--screen") (list value))))
- ((eq keyword :sync)
- (setq program-args (append program-args (list "--sync"))))
- ((eq keyword :gtk-module)
- (setq program-args (append program-args (list "--gtk-module")
- (list (mapconcat 'identity value ",")))))
- ((eq keyword :g-fatal-warnings)
- (setq program-args (append program-args (list "--g-fatal-warnings "))))
- ((eq keyword :uri)
- (setq program-args (append program-args (list "--uri") (list value))))
- ((eq keyword :verbose)
- (setq program-args (append program-args (list "--verbose"))))
- ((eq keyword :name)
- (setq program-args (append program-args (list "--name") (list value))))
- ((eq keyword :config)
- (setq program-args (append program-args (list "--config") (list value))))
- ((eq keyword :socket)
- (setq program-args (append program-args (list "--socket") (list value))))
- ((eq keyword :display)
- (setq program-args (append program-args (list "--display") (list value))))))))
-
- ;; Start process
- (let* (inst
- (proc-name "ezbl-process")
- (output-buffer (generate-new-buffer "*ezbl-output*"))
- (proc (apply 'start-process
- (append (list proc-name
- output-buffer
- ezbl-exec-path)
- program-args)))
- (pid (process-id proc)))
-
- (setq inst (make-ezbl-inst
- :args program-args
- :process proc
- :pid pid
- :output-buffer output-buffer
- :display-buffer (current-buffer)
- :vars (make-hash-table)))
- (set-process-filter proc 'ezbl-event-listener)
-
- (with-current-buffer output-buffer
- (rename-buffer (format ezbl-output-buffer-format (int-to-string pid)))
- (set (make-local-variable 'ezbl-inst) inst))
- (rename-buffer (format ezbl-display-buffer-format pid))
- (set (make-local-variable 'ezbl-inst) inst)
-
- ;; Make `ezbl-inst' survive `kill-all-local-variables'
- (put 'ezbl-inst 'permanent-local t)
-
- (add-to-list 'ezbl-inst-list (cons pid inst))
- (ezbl-mode)
- inst)))
-
-(defun ezbl-inst-get (&optional inst strict)
- "Returns the ezbl instance from INST.
-
-If INST is an ezbl instance, then it is returned unchanged. If it
-is a buffer, then the local variable of `ezbl-inst' is
-returned. If it is an integer, then `ezbl-inst-list' is searched
-for an instance with a matching pid. If it is nil or not
-supplied, then the value of `ezbl-inst' in the current buffer
-is returned.
-
-If STRICT is non-nil, raise an error if INST is not resolvable to
-an instance.
-
-Returns an `ezbl-inst'."
- (when (null inst)
- (set 'inst ezbl-inst))
-
- (let ((instance
- (cond
- ((ezbl-inst-p inst)
- inst)
- ((bufferp inst)
- (with-current-buffer inst
- ezbl-inst))
- ((integerp inst)
- (cdr-safe (assq inst
- ezbl-inst-list)))
- ((processp inst)
- (cdr-safe (assq (process-id inst)
- ezbl-inst-list)))
- ((stringp inst)
- (if (and (bufferp (get-buffer inst))
- (not (null (with-current-buffer inst
- ezbl-inst))))
- (with-current-buffer inst
- ezbl-inst)
- ;; Is the name of an instance, so open the output buffer which
- ;; corresponds to this name.
- (when (get-buffer (format ezbl-output-buffer-format inst))
- (with-current-buffer (format ezbl-output-buffer-format inst)
- ezbl-inst)))))))
- (if (ezbl-inst-p instance)
- instance
- (when strict
- (error (format "`%s' is not an Ezbl instance or resolvable to an Ezbl instance" inst))))))
-
-(defun ezbl-inst-define-advice ()
- "Define and activate the advice for each slot in `ezbl-inst'.
-
-Makes the accessors call `ezbl-inst-get' before operating, so
-that the accessors work on things which are resolvable to an
-`ezbl-inst', rather than only allowing the insts themselves.
-
-Also redefines the `setf-method' for each slot, since `setf'
-doesn't actually call the slot accessor, so it wouldn't resolve
-its argument to an `ezbl-inst'."
- (mapc '(lambda (item)
- (let ((func (intern (concat "ezbl-inst-" (symbol-name item)))))
- (ad-add-advice func
- ezbl-inst-get-first 'before 'first)
- (ad-activate func)
-
- ;; This is tricky. Redefines the `setf-method' to be the same as
- ;; the old one, except that it is passed the result of
- ;; `ezbl-inst-get' on the `eval'ed argument.
- (eval (list 'define-setf-method
- func
- '(cl-x)
- `(apply ,(get func 'setf-method)
- (list (ezbl-inst-get (eval cl-x) t)))))))
- ezbl-inst-slots))
-
-(defun ezbl-command-exec (inst command)
- "Sends the string COMMAND to the Uzbl instance INST.
-
-If INST is a buffer, use the value of `ezbl-inst' in that
-buffer. If COMMAND is a Uzbl command as described by the Uzbl
-Readme (http://www.uzbl.org/readme.php).
-
-See `ezbl-inst-start' for a description of the format of INST."
- ;; Append a newline (\n) to the end of COMMAND if one is not already there.
- (when (not (string= "\n" (substring command -1)))
- (setq command (concat command "\n")))
- (process-send-string (ezbl-inst-process inst) command))
-
-(defun ezbl-sync-request (inst req)
- "Request Uzl to evaluate a request string REQ and wait for the result.
-
-Uses the Uzbl \"print\" command to make a request to the Uzbl
-process specified by INST. Waits until Uzbl replies and returns
-the response that Uzbl produces.
-
-The following substitutions are supported (see the Uzbl readme
-for more info):
-
- @var: Returns the value of the variable \"var\".
-
- @{var}: Returns the value of the variable \"var\". Used to
- denote the beginning and end of a variable name.
-
- @(command)@: Executes the shell command \"command\" and returns
- its result.
-
- @<code>@: Executes the string \"code\" as javascript in the
- current page and returns the result.
-
- @[xml]@: Escapes any XML in the brackets."
- (let ((tag (sha1 (int-to-string (random)))))
- (with-current-buffer (ezbl-inst-output-buffer inst)
- (ezbl-command-print inst
- (format "%s{%s}%s" tag req tag))
- (goto-char (point-max))
- ;; Keep trying until tag is found. TODO: avoid searching backwards through
- ;; the whole buffer.
- (while (not (re-search-backward (format "%s{\\(.*\\)}%s" tag tag) (point-min) t))
- (goto-char (point-max))
- ;; Sleep for 1 millisecond
- (sleep-for 0 1))
- (match-string 1))))
-
-(defun ezbl-variable-get (inst var)
- "Return the value of VAR from the ezbl instance INST."
- (gethash (intern-soft var) (ezbl-inst-vars inst)))
-
-(defun ezbl-run-js (inst js)
- "Execute the Javascript in JS on the Uzbl instance INST and
-return the result."
- (ezbl-sync-request inst (concat "@<" js ">@")))
-
-(defun ezbl-xwidget-insert (where id type title width height)
- "Insert an embedded widget.into the current buffer.
-
-WHERE - The point at which to insert the widget.
-ID - The id of the widget. MUST be unique and < 100!
-TYPE - 1=button, 2=toggle btn, 3=xembed socket(id will be printed to stdout)
-TITLE - The title of the embedded widget
-WIDTH - The width of the widget
-HEIGHT - The height of the widget"
- (save-excursion
- (goto-char where)
- (put-text-property
- (point)
- (1+ (point))
- 'display
- (list 'xwidget ':xwidget-id id ':type type ':title title ':width width ':height height))))
-
-(defun ezbl-embed ()
- "Insert an xwidget into the current buffer.
-
-Also, set a callback (using the `xwidget-event' \"keybinding\")
-to launch Uzbl once the widget is fully initialized."
- (save-excursion
- (use-local-map (make-sparse-keymap))
- (define-key (current-local-map) [(xwidget-event)] 'ezbl-xwidget-handler)
- (ezbl-xwidget-insert
- (point) ;; Where
- (ezbl-xwidget-next-id) ;; ID
- ezbl-xwidget-type ;; Type
- "ezbl" ;; Name
- 600 ;; Width
- 600))) ;; Height
-
-(defun ezbl-xwidget-next-id ()
- "Returns the next xwidget id based on the value of `ezbl-xwidget-id-counter'."
- (incf ezbl-xwidget-id-counter))
-
-(defun ezbl-xwidget-handler ()
- "Respond to the creation of an xwidget.
-
-Once the xwidget is set up, start a Uzbl process and give it the
-xwidget's socket id."
- (interactive)
- (let* ((xwidget-event-type (nth 2 last-input-event))
- (xwidget-id (nth 1 last-input-event)))
- (cond
- ((eq xwidget-event-type 'xembed-ready)
- (let* ((xembed-id (nth 3 last-input-event)))
- (ezbl-inst-start :socket (number-to-string xembed-id)
- :config "-") ;; Use stdin for config
- (run-hooks 'ezbl-xembed-ready-hook))))))
-
-(defun ezbl-open (uri)
- "Create a new Uzbl instance in a new buffer and browse to URI."
- (interactive "sUri: ")
-
- (ezbl-init)
- (switch-to-buffer (generate-new-buffer uri))
- ;; Currently has problems embedding into an empty buffer, so insert a space.
- (insert " ")
- (backward-char)
- (ezbl-embed)
-
- (add-hook 'ezbl-xembed-ready-hook
- `(lambda () (ezbl-command-uri ezbl-inst ,uri))
- nil t)
- (put 'ezbl-xembed-ready-hook 'permanent-local t)
- (current-buffer))
-
-(defun ezbl-cookie-listener (proc answer)
- "Handle a cookie request over a socket.
-
-This function is intended to be set as the filter of the
-server-process listening on the cookie socket. It receives the
-process PROC with which it is communicating and ANSWER, the text
-sent by Uzbl."
- (let* ((args (split-string answer "\0"))
- (result (apply 'ezbl-cookie-handler args)))
- (when (and result
- (> 0 (length (split-string result))))
- (process-send-string proc result))
- (process-send-eof proc)))
-
-(defun ezbl-cookie-handler (op scheme host path &optional data &rest ignored)
- "Process a single cookie.
-
-OP - either \"PUT\" or \"GET\", indicating whether a cookie
- should be stored or retrieved, respectively.
-
-SCHEME - The URL scheme of the request, usually \"http\".
-
-HOST - The host requesting the cookie.
-
-PATH - The path of the cookie.
-
-DATA - In a \"PUT\" request, this is the data to store."
- (let ((secure (if (equal scheme "https")
- t
- nil))
- (url-current-object (url-parse-make-urlobj scheme nil nil host nil path)))
- (when (equal op "PUT")
- (url-cookie-handle-set-cookie data))
- (when (equal op "GET")
- (url-cookie-generate-header-lines host path secure))))
-
-(defun ezbl-cookie-socket-listen (&optional path force)
- "Begin listening for Uzbl cookie requests.
-
-Creates a server process on a local socket at PATH, or
-`ezbl-cookie-socket' if PATH is nil.
-
-Starts a process and stores it in `ezbl-cookie-process' if it is
-nil. If `ezbl-cookie-process' is non-nil, then don't create a
-process unless FORCE is non-nil, in which case kill the existing
-process and start a new one."
- (when (processp ezbl-cookie-process)
- (unless force
- (error "A cookie process already exists")))
-
- (let* ((sock-path (or path ezbl-cookie-socket)))
- (when (file-exists-p sock-path)
- (if force
- (delete-file sock-path)
- (error (format "Cannot listen on `%s', file exists" sock-path))))
-
- (setq ezbl-cookie-process
- (make-network-process :name "ezbl-cookie"
- :type 'seqpacket
- :server t
- :service sock-path
- :family 'local
- :filter 'ezbl-cookie-listener))))
-
-(defun ezbl-update-mode-line-format ()
- "Updates the mode-line format in each ezbl display-window,
-
-according to `ezbl-mode-line-format'."
- (mapc '(lambda (inst)
- (with-current-buffer (ezbl-inst-display-buffer (car inst))
- (setq mode-line-format ezbl-mode-line-format)))
- ezbl-inst-list))
-
-(defun ezbl-set-mode-line-format (symbol value)
- "Used for setting `ezbl-mode-line-format'; sets SYMBOL's value
-to VALUE and runs `ezbl-update-mode-line-format'."
- (set-default symbol value)
- (ezbl-update-mode-line-format))
-
-(defcustom ezbl-mode-line-format
- '("-"
- mode-line-mule-info
- mode-line-modified
- mode-line-frame-identification
- (:propertize (:eval (ezbl-variable-get ezbl-inst 'title))
- face bold)
- " -- "
- (:eval (ezbl-variable-get ezbl-inst 'uri))
- " "
- mode-line-modes
- (which-func-mode ("" which-func-format "--"))
- "-%-")
- "The format of the mode line in an Ezbl display buffer."
- :group 'ezbl
- :type 'sexp
- :set 'ezbl-set-mode-line-format)
-
-(defvar ezbl-mode-map
- (let ((map (make-sparse-keymap)))
- (mapc '(lambda (item)
- (let* ((binding (cdr (assq 'key-binding item)))
- (name (cdr (assq 'name item)))
- (func (intern (concat "ezbl-command-" name))))
- (when binding
- (define-key map (read-kbd-macro binding) func))))
- ezbl-commands)
- map)
- "Keymap for `ezbl-mode'.")
-
-(define-derived-mode ezbl-mode nil "Ezbl"
- "Mode for interacting with Ezbl processes.
-
-\\{ezbl-mode-map}"
- :group 'ezbl
- (toggle-read-only t)
- (set-buffer-modified-p nil)
- (add-hook 'window-configuration-change-hook 'ezbl-fill-window nil t))
-
-(add-hook 'ezbl-mode-hook 'ezbl-variable-set-defaults)
-(add-hook 'ezbl-mode-hook 'ezbl-fill-window)
-(add-hook 'ezbl-mode-hook 'ezbl-update-mode-line-format)
-
-(defun ezbl-xwidget-resize-at (pos width height)
- "Resize xwidget at postion POS to WIDTH and HEIGHT.
-
-There is no corresponding resize-id fn yet, because of display
-property/xwidget id impedance mismatch."
- (let* ((xwidget-prop (cdr (get-text-property pos 'display)))
- (id (plist-get xwidget-prop ':xwidget-id)))
-
- (setq xwidget-prop (plist-put xwidget-prop ':width width))
- (setq xwidget-prop (plist-put xwidget-prop ':height height))
-
- (put-text-property pos (+ 1 pos) 'display (cons 'xwidget xwidget-prop))
- (xwidget-resize id width height)))
-
-(defun ezbl-fill-window (&optional inst)
- "Re-sizes the xwidget in the display-buffer of INST to fill its
-entire window."
- (let ((buffer (ezbl-inst-display-buffer inst)))
- (with-current-buffer buffer
- (let* ((edges-list (window-inside-pixel-edges (get-buffer-window buffer)))
- (left (nth 0 edges-list))
- (top (nth 1 edges-list))
- (right (nth 2 edges-list))
- (bottom (nth 3 edges-list))
- (height (- bottom top))
- (width (- right left)))
- ;; Turn read-only off while modifying the size of the xwidget, then
- ;; reactivate it.
- (toggle-read-only -1)
- (ezbl-xwidget-resize-at 1 width height)
- (toggle-read-only t)
- (set-buffer-modified-p nil)))))
-
-(defun ezbl-event-listener (inst answer)
- "Filter for ezbl processes.
-
-INST should be the `ezbl-inst' of the associated Uzbl process
-and ANSWER is the string returned by the process."
- (let ((answers (split-string answer "\n" t)))
- (dolist (ans answers)
- (if (string-match "^EVENT \\[\\([[:alnum:]]+\\)\\] \\([A-Z_]+\\) ?\\(.*\\)$" ans)
- (let ((app-name (match-string-no-properties 1 ans))
- (event (intern (match-string-no-properties 2 ans)))
- (detail (match-string-no-properties 3 ans)))
- (ezbl-event-handler inst event detail app-name))
- (ezbl-process-append inst (concat ans "\n"))))))
-
-(defun ezbl-event-handler (inst event detail &optional app-name)
- "Respond to a Uzbl-generated event.
-
-EVENT is the interned symbol of the event Uzbl returned, while
-DETAIL is a (possibly-empty) string containing any additional
-information included with the event.
-
-INST is resolvable to an ezbl instance."
- (cond
- ((eq event 'INSTANCE_START))
- ((eq event 'INSTANCE_EXIT))
- ((eq event 'VARIABLE_SET)
- (if (string-match "\\([a-z0-9_]+\\) \\(str\\|int\\|float\\) \\(.*\\)" detail)
- (let ((var-name (intern (match-string-no-properties 1 detail)))
- (type (match-string-no-properties 2 detail))
- (value (match-string-no-properties 3 detail)))
- (puthash var-name value (ezbl-inst-vars inst)))
- (error "VARIABLE_SET event had invalid details: `%s'" detail)))
- ((eq event 'COMMAND_EXECUTED))
- ;; ((eq event 'COMMAND_ERROR))
- ;; ((eq event 'GEOMETRY_CHANGED))
- ;; ((eq event 'FIFO_SET))
- ;; ((eq event 'SOCKET_SET))
- ((eq event 'LOAD_COMMIT)
- (puthash 'uri detail (ezbl-inst-vars inst)))
- ((eq event 'LOAD_START))
- ((eq event 'LOAD_FINISH))
- ;; ((eq event 'LOAD_ERROR))
- ((eq event 'LOAD_PROGRESS))
- ((eq event 'TITLE_CHANGED)
- (puthash 'title detail (ezbl-inst-vars inst)))
- ;; ((eq event 'DOWNLOAD_REQUEST))
- ((eq event 'LINK_HOVER))
- ((eq event 'LINK_UNHOVER))
- ;; ((eq event 'KEY_PRESS))
- ;; ((eq event 'KEY_RELEASE))
- ;; ((eq event 'SELECTION_CHANGED))
- ;; ((eq event 'NEW_WINDOW))
- ;; ((eq event 'WEBINSPECTOR))
- ;; ((eq event 'WEBINSPECTOR))
- ;; ((eq event 'FOCUS_GAINED))
- ;; ((eq event 'FOCUS_LOST))
- ;; ((eq event 'FORM_ACTIVE))
- ;; ((eq event 'ROOT_ACTIVE))
- ;; ((eq event 'FILE_INCLUDED))
- ((eq event 'PLUG_CREATED))
- ((eq event 'BUILTINS))
- (t
- (ezbl-process-append inst (format "EVENT [%s] %s %s\n" app-name event detail)))))
-
-(defun ezbl-process-append (inst string)
- "Insert STRING at the end of the process buffer of INST.
-
-Takes into account the current position of process-mark for the
-process owning buffer."
- (with-current-buffer (ezbl-inst-output-buffer inst)
- (let* ((proc (ezbl-inst-process inst))
- (moving (= (point) (process-mark proc))))
- (save-excursion
- ;; Insert the text, advancing the process marker.
- (goto-char (process-mark proc))
- (insert string)
- (set-marker (process-mark proc) (point)))
- (if moving (goto-char (process-mark proc))))))
-
-;; Should always remain at the end, just before "(provide 'ezbl)".
-(ezbl-command-init)
-
-(provide 'ezbl)
-
-;;; ezbl.el ends here
diff --git a/.emacs.d/folding.el b/.emacs.d/folding.el
deleted file mode 100644
index c90a4f9..0000000
--- a/.emacs.d/folding.el
+++ /dev/null
@@ -1,5396 +0,0 @@
-;;; folding.el --- A folding-editor-like minor mode.
-
-;; This file is not part of Emacs
-
-;; Copyright (C) 2000-2010
-;; Jari Aalto
-;; Copyright (C) 1995, 1996, 1997, 1998, 1999
-;; Jari Aalto, Anders Lindgren.
-;; Copyright (C) 1994
-;; Jari Aalto
-;; Copyright (C) 1992, 1993
-;; Jamie Lokier, All rights reserved.
-;;
-;; Author: Jamie Lokier <jamie A T imbolc.ucc dt ie>
-;; Jari Aalto <jari aalto A T cante dt net>
-;; Anders Lindgren <andersl A T csd.uu dt se>
-;; Maintainer: Jari Aalto <jari aalto A T cante dt net>
-;; Created: 1992
-;; Keywords: tools
-;;
-;; [Latest XEmacs CVS tree commit and revision]
-;; Vcs-Version: $Revision: 3.42 $
-;; Vcs-Date: $Date: 2007/05/07 10:50:05 $
-;;
-;; [Latest devel version]
-;; Vcs-URL: http://savannah.nongnu.org/projects/emacs-tiny-tools
-
-(defconst folding-version-time "2009.0905.0811"
- "Last edit time in format YYYY.MMDD.HHMM.")
-
-;;{{{ GPL
-
-;; This program is free software; you can redistribute it and/or
-;; modify it under the terms of the GNU General Public License as
-;; published by the Free Software Foundation,
-;; or (at your option) any later version.
-;;
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with this program. If not, see <http://www.gnu.org/licenses/>.
-;;
-;; Visit <http://www.gnu.org/copyleft/gpl.html> for more information
-
-;;}}}
-
-;;; Commentary:
-
-;;{{{ Introduction
-
-;; Preface
-;;
-;; This package provides a minor mode, compatible with all major
-;; editing modes, for folding (hiding) parts of the edited text or
-;; program.
-;;
-;; Folding mode handles a document as a tree, where each branch
-;; is bounded by special markers `{{{' and `}}}'. A branch can be
-;; placed inside another branch, creating a complete hierarchical
-;; structure.
-;;
-;; Folding mode can CLOSE a fold, leaving only the initial `{{{'
-;; and possibly a comment visible.
-;;
-;; It can also ENTER a fold, which means that only the current
-;; fold will be visible, all text above `{{{' and below `}}}'
-;; will be invisible.
-;;
-;; Please note, that the maintainers do not recommend to use only
-;; folding for you your code layout and navigation. Folding.el is
-;; on its best when it can "chunk" large sections of code inside
-;; folds. The larger the chunks, the more the usability of
-;; folding will increase. Folding.el is not meant to hide
-;; individual functions: you may be better served by hideshow.el
-;; or imenu.el (which can parse the function indexes)
-
-;;}}}
-;;{{{ Installation
-
-;; Installation
-;;
-;; To install Folding mode, put this file (folding.el) on your
-;; Emacs `load-path' (or extend the load path to include the
-;; directory containing this file) and optionally byte compile it.
-;;
-;; The best way to install folding is the autoload installation,
-;; so that folding is loaded into your emacs only when you turn on
-;; `folding-mode'. This statement speeds up loading your .emacs
-;;
-;; (autoload 'folding-mode "folding" "Folding mode" t)
-;; (autoload 'turn-off-folding-mode "folding" "Folding mode" t)
-;; (autoload 'turn-on-folding-mode "folding" "Folding mode" t)
-;;
-;; But if you always use folding, then perhaps you want more
-;; traditional installation. Here Folding mode starts
-;; automatically when you load a folded file.
-;;
-;; ;; (setq folding-default-keys-function
-;; ;; 'folding-bind-backward-compatible-keys)
-;;
-;; (if (load "folding" 'nomessage 'noerror)
-;; (folding-mode-add-find-file-hook))
-;;
-;; Folding uses a keymap which conforms with the new Emacs
-;; (started 19.29) style. The key bindings are prefixed with
-;; "C-c@" instead of old "C-c". To use the old keyboard bindings,
-;; uncomment the lines in the the above installation example
-;;
-;; The same folding marks can be used in `vim' editor command
-;; "set fdm=marker".
-;;
-;; Uninstallation
-;;
-;; To remove folding, call `M-x' `folding-uninstall'.
-;;
-;; To read the manual
-;;
-;; At any point you can reach the manual with `M-x'
-;; `finder-commentary' RET folding RET.
-
-;;}}}
-;;{{{ DOCUMENTATION
-
-;; Compatibility
-;;
-;; Folding supports following Emacs flavors:
-;;
-;; Unix Emacs 19.28+ and Win32 Emacs 19.34+
-;; Unix XEmacs 19.14+ and Win32 XEmacs 21.0+
-;;
-;; Compatibility not for old NT Emacs releases
-;;
-;; NOTE: folding version starting from 2.47 gets around this bug
-;; by using adviced kill/yank functions. The advice functions are
-;; only instantiated under problematic NT Emacs versions.
-;;
-;; Windows NT/9x 19.34 - 20.3.1 (i386-*-nt4.0) versions contained
-;; a bug which affected using folding. At the time the bug was
-;; reported by Trey Jackson <trey A T cs berkeley edu>
-;;
-;; If you kill folded area and yank it back, the ^M marks are
-;; removed for some reason.
-;;
-;; Before kill
-;; ;;{{{ fold...
-;;
-;; After yank
-;; ;;{{{ fold all lines together }}}
-;;
-;; Relates packages or modes
-;;
-;; Folding.el was designed to be a content organizer and it is most
-;; suitable for big files. Sometimes people misunderstand the
-;; package's capabilities and try to use folding.el in wrong places,
-;; where some other package would do a better job. Trying to wrap
-;; individual functions inside fold-marks is not where folding is
-;; it's best. Grouping several functions inside a logical fold-block
-;; in the other is. So, to choose a best tool for your need,
-;; here are some suggestions,:
-;;
-;; o Navigating between or hiding individual functions -
-;; use combination of imenu.el, speedbar.el and
-;; hideshow.el
-;; o Organizing large blocks - use folding.el
-;; o For text, `outline-mode' is more non-intrusive than folding.
-;; Look at Emacs NEWS file (`C-x' `n') and you can see beatifully
-;; laid content.
-;;
-;; Tutorial
-;;
-;; To start folding mode, give the command: `M-x' `folding-mode'
-;; `RET'. The mode line should contain the string "Fld" indicating
-;; that folding mode is activated.
-;;
-;; When loading a document containing fold marks, Folding mode is
-;; automatically started and all folds are closed. For example when
-;; loading my init file, only the following lines (plus a few lines
-;; of comments) are visible:
-;;
-;; ;;{{{ General...
-;; ;;{{{ Keyboard...
-;; ;;{{{ Packages...
-;; ;;{{{ Major modes...
-;; ;;{{{ Minor modes...
-;; ;;{{{ Debug...
-;;
-;; To enter a fold, use `C-c @ >'. To show it without entering,
-;; use `C-c @ C-s', which produces this display:
-;;
-;; ;;{{{ Minor modes
-;;
-;; ;;{{{ Follow mode...
-;; ;;{{{ Font-lock mode...
-;; ;;{{{ Folding...
-;;
-;; ;;}}}
-;;
-;; To show everything, just as the file would look like if
-;; Folding mode hadn't been activated, give the command `M-x'
-;; `folding-open-buffer' `RET', normally bound to `C-c' `@'
-;; `C-o'. To close all folds and go to the top level, the
-;; command `folding-whole-buffer' could be used.
-;;
-;; Mouse support
-;;
-;; Folding mode v2.0 introduced mouse support. Folds can be shown
-;; or hidden by simply clicking on a fold mark using mouse button
-;; 3. The mouse routines have been designed to call the original
-;; function bound to button 3 when the user didn't click on a
-;; fold mark.
-;;
-;; The menu
-;;
-;; A menu is placed in the "Tools" menu. Should no Tools menu exist
-;; (Emacs 19.28) the menu will be placed in the menu bar.
-;;
-;; ISearch
-;;
-;; When searching using the incremental search (C-s) facilities,
-;; folds will be automagically entered and closed.
-;;
-;; Problems
-;;
-;; Uneven fold marks
-;;
-;; Oops, I just deleted some text, and a fold mark got deleted!
-;; What should I do? Trust me, you will eventually do this
-;; sometime. the easiest way is to open the buffer using
-;; `folding-open-buffer' (C-c @ C-o) and add the fold mark by
-;; hand. To find mismatching fold marks, the package `occur' is
-;; useful. The command:
-;;
-;; M-x occur RET {{{\|}}} RET
-;;
-;; will extract all lines containing folding marks and present
-;; them in a separate buffer.
-;;
-;; Even though all folding marks are correct, Folding mode
-;; sometimes gets confused, especially when entering and leaving
-;; folds very often. To get it back on track, press C-g a few
-;; times and give the command `folding-open-buffer' (C-c @ C-o).
-;;
-;; Fold must have a label
-;;
-;; When you make a fold, be sure to write some text for the name
-;; of the fold, otherwise there may be an error "extraneous fold
-;; mark..." Write like this:
-;;
-;; ;;{{{ Note
-;; ;;}}}
-;;
-;; instead of
-;;
-;; ;;{{{
-;; ;;}}}
-;;
-;; folding-whole-buffer doesn't fold whole buffer
-;;
-;; If you call commands `folding-open-buffer' and
-;; `folding-whole-buffer' and notice that there are open fold
-;; sections in the buffer, then you have mismatch of folds
-;; somewhere. Run ` M-x' `occur' and type regexp `{{{\|}}}' to
-;; check where is the extra open or closing fold mark.
-;;
-;; Folding and outline modes
-;;
-;; Folding mode is not the same as Outline mode, a major and
-;; minor mode which is part of the Emacs distribution. The two
-;; packages do, however, resemble each other very much. The main
-;; differences between the two packages are:
-;;
-;; o Folding mode uses explicit marks, `{{{' and `}}}', to
-;; mark the beginning and the end of a branch.
-;; Outline, on the other other hand, tries to use already
-;; existing marks, like the `\section' string in a TeX
-;; document.
-;;
-;; o Outline mode has no end marker which means that it is
-;; impossible for text to follow a sub-branch.
-;;
-;; o Folding mode use the same markers for branches on all depths,
-;; Outline mode requires that marks should be longer the
-;; further, down in the tree you go, e.g `\chap', \section',
-;; `\subsection', `\subsubsection'. This is needed to
-;; distinguish the next mark at the current or higher levels
-;; from a sub-branch, a problem caused by the lack of
-;; end-markers.
-;;
-;; o Folding mode has mouse support, you can navigate through a
-;; folded document by clicking on fold marks. (The XEmacs version
-;; of Outline mode has mouse support.)
-;;
-;; o The Isearch facilities of Folding is capable of
-;; automatically to open folds. Under Outline, the the entire
-;; document must be opened prior isearch.
-;;
-;; In conclusion, Outline mode is useful when the document being
-;; edited contains natural markers, like LaTeX. When writing code
-;; natural markers are hard to find, except if you're happy with
-;; one function per fold.
-;;
-;; Future development ideas
-;;
-;; The plan was from the beginning to rewrite the entire package.
-;; Including replacing the core of the program, written using
-;; old Emacs technology (selective display), and replace it with
-;; modern equivalences, like overlays or text-properties for
-;; Emacs and extents for XEmacs.
-;;
-;; It is not likely that any of this will come true considering
-;; the time required to rewrite the core of the package. Since
-;; the package, in it's current state, is much more powerful than
-;; the original, it would be appropriate to write such package
-;; from scratch instead of doing surgery on this one.
-
-;;}}}
-
-;;{{{ Customization
-
-;; Customization: general
-;;
-;; The behavior of Folding mode is controlled mainly by a set of
-;; Emacs Lisp variables. This section will discuss the most
-;; useful ones, for more details please see the code. The
-;; descriptions below assumes that you know a bit about how to
-;; use simple Emacs Lisp and knows how to edit ~/.emacs, your
-;; init file.
-;;
-;; Customization: hooks
-;;
-;; The normal procedure when customizing a package is to write a
-;; function doing the customization. The function is then added
-;; to a hook which is called at an appropriate time. (Please see
-;; the example section below.) The following hooks are
-;; available:
-;;
-;; o `folding-mode-hook'
-;; Called when folding mode is activated.
-;; o `<major mode>-folding-hook'
-;; Called when starting folding mode in a buffer with major
-;; mode set to <major mode>. (e.g. When editing C code
-;; the hook `c-mode-folding-hook' is called.)
-;; o `folding-load-hook'
-;; Called when folding mode is loaded into Emacs.
-;;
-;; Customization: The Mouse
-;;
-;; The variable `folding-behave-table' contains the actions which
-;; should be performed when the user clicks on an open fold, a
-;; closed fold etc. For example, if you prefer to `enter' a fold
-;; rather than `open' it you should rebind this variable.
-;;
-;; The variable `folding-default-mouse-keys-function' contains
-;; the name of the function used to bind your mouse keys. To use
-;; your own mouse bindings, create a function, say
-;; `my-folding-bind-mouse', and set this variable to it.
-;;
-;; Customization: Keymaps
-;;
-;; When Emacs 19.29 was released, the keymap was divided into
-;; strict parts. (This division existed before, but a lot of
-;; packages, even the ones delivered with Emacs, ignored them.)
-;;
-;; C-c <letter> -- Reserved for the users private keymap.
-;; C-c C-<letter> -- Major mode. (Some other keys are
-;; reserved as well.)
-;; C-c <Punctuation Char> <Whatever>
-;; -- Reserved for minor modes.
-;;
-;; The reason why `C-c@' was chosen as the default prefix is that
-;; it is used by outline-minor-mode. It is not likely that few
-;; people will try to use folding and outline at the same time.
-;;
-;; However, old key bindings have been kept if possible. The
-;; variable `folding-default-keys-function' specifies which
-;; function should be called to bind the keys. There are various
-;; function to choose from how user can select the keybindings.
-;; To use the old key bindings, add the following line to your
-;; init file:
-;;
-;; (setq folding-default-keys-function
-;; 'folding-bind-backward-compatible-keys)
-;;
-;; To define keys similar to the keys used by Outline mode, use:
-;;
-;; (setq folding-default-keys-function
-;; 'folding-bind-outline-compatible-keys)
-;;
-;; Customization: adding new major modes
-;;
-;; To add fold marks for a new major mode, use the function
-;; `folding-add-to-marks-list'. The command also replaces
-;; existing marks. An example:
-;;
-;; (folding-add-to-marks-list
-;; 'c-mode "/* {{{ " "/* }}} */" " */" t)
-;;
-;; Customization: ISearch
-;;
-;; If you don't like the extension folding.el applies to isearch,
-;; set the variable `folding-isearch-install' to nil before
-;; loading this package.
-
-;;}}}
-;;{{{ Examples
-
-;; Example: personal setup
-;;
-;; To define your own key binding instead of using the standard
-;; ones, you can do like this:
-;;
-;; (setq folding-mode-prefix-key "\C-c")
-;; ;;
-;; (setq folding-default-keys-function
-;; '(folding-bind-backward-compatible-keys))
-;; ;;
-;; (setq folding-load-hook 'my-folding-load-hook)
-;;
-;;
-;; (defun my-folding-load-hook ()
-;; "Folding setup."
-;;
-;; (folding-install) ;; just to be sure
-;;
-;; ;; ............................................... markers ...
-;;
-;; ;; Change text-mode fold marks. Handy for quick
-;; ;; sh/perl/awk code
-;;
-;; (defvar folding-mode-marks-alist nil)
-;;
-;; (let* ((ptr (assq 'text-mode folding-mode-marks-alist)))
-;; (setcdr ptr (list "# {{{" "# }}}")))
-;;
-;; ;; ........................................ bindings ...
-;;
-;; ;; Put `folding-whole-buffer' and `folding-open-buffer'
-;; ;; close together.
-;;
-;; (defvar folding-mode-prefix-map nil)
-;;
-;; (define-key folding-mode-prefix-map "\C-w" nil)
-;; (define-key folding-mode-prefix-map "\C-s"
-;; 'folding-show-current-entry)
-;; (define-key folding-mode-prefix-map "\C-p"
-;; 'folding-whole-buffer))
-;;
-;; Example: changing default fold marks
-;;
-;; In case you're not happy with the default folding marks, you
-;; can change them easily. Here is an example
-;;
-;; (setq folding-load-hook 'my-folding-load-hook)
-;;
-;; (defun my-folding-load-hook ()
-;; "Folding vars setup."
-;; ;; Change marks for 'text-mode'
-;; (let* ((ptr (assq 'text-mode folding-mode-marks-alist)))
-;; (setcdr ptr (list "# {{{" "# }}}"))))
-;;
-;; Example: choosing different fold marks for mode
-;;
-;; Suppose you sometimes want to use different fold marks for the
-;; major mode: e.g. to alternate between "# {{{" and "{{{" in
-;; `text-mode' Call `M-x' `my-folding-text-mode-setup' to change
-;; the marks.
-;;
-;; (defun my-folding-text-mode-setup (&optional use-custom-folding-marks)
-;; (interactive
-;; (list (y-or-n-p "Use Custom fold marks now? ")))
-;; (let* ((ptr (assq major-mode folding-mode-marks-alist))
-;; (default-begin "# {{{")
-;; (default-end "# }}}")
-;; (begin "{{{")
-;; (end "}}}"))
-;; (when (eq major-mode 'text-mode)
-;; (unless use-custom-folding-marks
-;; (setq begin default-begin end default-end)))
-;; (setcdr ptr (list begin end))
-;; (folding-set-marks begin end)))
-;;
-;; Example: AucTex setup
-;;
-;; Suppose you're using comment.sty with AucTeX for editing
-;; LaTeX2e documents and you have these comment types. You would
-;; like to be able to set which of these 3 is to be folded at any
-;; one time, using a simple key sequence: move back and forth
-;; easily between the different comment types, e.g., "unfold
-;; everything then fold on \x".
-;;
-;; \O ... \endO
-;; \L ... \endL
-;; \B ... \endB
-;;
-;; (setq folding-load-hook 'my-folding-load-hook)
-;;
-;; (defun my-folding-load-hook ()
-;; "Folding vars setup."
-;; (let ((ptr (assq 'text-mode folding-mode-marks-alist)))
-;; (setcdr ptr (list "\\O" "\\endO"))
-;; (define-key folding-mode-prefix-map "C"
-;; 'my-folding-marks-change)))
-;;
-;; (defun my-folding-marks-change (&optional selection)
-;; "Select folding marks: prefixes nil, C-u and C-u C-u."
-;; (interactive "P")
-;; (let ((ptr (assq major-mode folding-mode-marks-alist))
-;; input)
-;; (when (string-match "^\\(plain-\\|la\\|auc\\)?tex-"
-;; (symbol-name major-mode))
-;; (setq input
-;; (read-string "Latex \\end(X) Marker (default O): "
-;; nil nil "O" nil))
-;; (setq input (upcase input))
-;; (turn-off-folding-mode)
-;; (folding-add-to-marks-list
-;; major-mode
-;; (concat "\\" input) (concat "\\end" input) nil nil t)
-;; ;; (setcdr ptr (list (concat "\\" input) (concat "\\end" input)))
-;; (turn-on-folding-mode))))
-;; ;; End of example
-;;
-;; Bugs: Lazy-shot.el conflict in XEmacs
-;;
-;; [XEmacs 20.4 lazy-shot-mode]
-;; 1998-05-28 Reported by Solofo Ramangalahy <solofo A T mpi-sb mpg de>
-;;
-;; % xemacs -q folding.el
-;; M-x eval-buffer
-;; M-x folding-mode
-;; M-x font-lock-mode
-;; M-x lazy-shot-mode
-;; C-s mouse
-;;
-;; then search for mouse again and again. At some point you will
-;; see "Deleting extent" in the minibuffer and XEmacs freezes.
-;;
-;; The strange point is that I have this bug only under Solaris
-;; 2.5 sparc (binaries from ftp.xemacs.org) but not under Solaris
-;; 2.6 x86. (XEmacs 20.4, folding 2.35). I will try to access
-;; more machines to see if it's the same.
-;;
-;; I suspect that the culprit is lazy-shot as it is beta, but
-;; maybe you will be able to describe the bug more precisely to
-;; the XEmacs people I you can reproduce it.
-
-;;}}}
-;;{{{ Old Documentation
-
-;; Old documentation
-;;
-;; The following text was written by Jamie Lokier for the release
-;; of Folding V1.6. It is included here for no particular reason:
-;;
-;; Emacs 18:
-;; Folding mode has been tested with versions 18.55 and
-;; 18.58 of Emacs.
-;;
-;; Epoch:
-;; Folding mode has been tested on Epoch 4.0p2.
-;;
-;; [X]Emacs:
-;; There is code in here to handle some aspects of XEmacs.
-;; However, up to version 19.6, there appears to be no way to
-;; display folds. Selective-display does not work, and neither do
-;; invisible extents, so Folding mode has no chance of
-;; working. This is likely to change in future versions of
-;; XEmacs.
-;;
-;; Emacs 19:
-;; Tested on version 19.8, appears to be fine. Minor bug:
-;; display the buffer in several different frames, then move in
-;; and out of folds in the buffer. The frames are automatically
-;; moved to the top of the stacking order.
-;;
-;; Some of the code is quite horrible, generally in order to
-;; avoid some Emacs display "features". Some of it is specific to
-;; certain versions of Emacs. By the time Emacs 19 is around and
-;; everyone is using it, hopefully most of it won't be necessary.
-;;
-;; More known bugs
-;;
-;; *** Needs folding-fold-region to be more intelligent about
-;; finding a good region. Check folding a whole current fold.
-;;
-;; *** Now works with 19! But check out what happens when you
-;; exit a fold with the file displayed in two frames. Both
-;; windows get fronted. Better fix that sometime.
-;;
-;; Future features
-;;
-;; *** I will add a `folding-next-error' sometime. It will only
-;; work with Emacs versions later than 18.58, because compile.el
-;; in earlier versions does not count line-numbers in the right
-;; way, when selective display is active.
-;;
-;; *** Fold titles should be optionally allowed on the closing
-;; fold marks, and `folding-tidy-inside' should check that the
-;; opening title matches the closing title.
-;;
-;; *** `folded-file' set in the local variables at the end of a
-;; file could encode the type of fold marks used in that file,
-;; and other things, like the margins inside folds.
-;;
-;; *** I can see a lot of use for the newer features of Emacs 19:
-;;
-;; Using invisible text-properties (I hope they are intended to
-;; make text invisible; it isn't implemented like that yet), it
-;; will be possible to hide folded text without affecting the
-;; text of the buffer. At the moment, Folding mode uses selective
-;; display to hide text, which involves substituting
-;; carriage-returns for line-feeds in the buffer. This isn't such
-;; a good way. It may also be possible to display different folds
-;; in different windows in Emacs 19.
-;;
-;; Using even more text-properties, it may be possible to track
-;; pointer movements in and out of folds, and have Folding mode
-;; automatically enter or exit folds as necessary to maintain a
-;; sensible display. Because the text itself is not modified (if
-;; overlays are used to hide text), this is quite safe. It would
-;; make it unnecessary to provide functions like
-;; `folding-forward-char', `folding-goto-line' or
-;; `folding-next-error', and things like I-search would
-;; automatically move in and out of folds as necessary.
-;;
-;; Yet more text-properties/overlays might make it possible to
-;; avoid using narrowing. This might allow some major modes to
-;; indent text properly, e.g., C++ mode.
-
-;;}}}
-
-;;; Change Log:
-
-;;{{{ History
-
-;; [person version] = developer and his revision tree number.
-;;
-;; Sep 20 2009 23.1 [jari git a80c2d6]
-;; - Remove 'defmacro custom' for very old Emacs version that did
-;; not have custom.
-;; - Modernize all macros to use new backquote syntax,
-;; - Move `folding-narrow-by-default' variable
-;; definition before `folding-advice-instantiate' which
-;; refers to it.
-;;
-;; Feb 20 2009 22.2.1 [jari git 51ada03..56b3089]
-;; - Make XEmacs CVS and Savannah git revisions at header more clear
-;; - Unify html-mode folds as in other modes: change [[[ ]]] to {{{ }}}
-;;
-;; Feb 09 2009 22.2.1 [jari git e0c2e92..6a3cff7]
-;; - Minor documentaton fixes.
-;; - Add new `python-mode' using `folding-add-to-marks-list'.
-;; - Add new variable `folding-version-time' to record edit time.
-;; Value is automatically updated by developer's Emacs setup.
-;;
-;; May 06 2007 21.4 [jari 3.38-3.41 2007.0506]
-;; - Cleanup. Eol whitespaces removed, extra newlines cleaned.
-;; Paren positions corrected.
-;; - 'Personal reflections by Anders Lindgren' topic
-;; rephrased 'Future development ideas'
-;; - (folding-show-current-entry): Run `font-lock-fontify-region'
-;; after opening the fold. Font-lock.el treated all closed folds
-;; as comments.
-;;
-;; Nov 16 2006 21.4 [jari 3.36-3.37 2006.1118]
-;; - Jeremy Hankins <nowan A T nowan org> sent a patch, which
-;; adds variable `folding-narrow-by-default'. The patch affects
-;; mostly `folding-shift-in'. This makes it possible to
-;; advise viper-search to open folds. Thanks.
-;; - Added VCS URL header to the beginning for canonnical location.
-;; Updated maintainer section.
-;; - Fixed Copyright years.
-;;
-;; Nov 25 2004 21.3 [jari 3.35 2004.1125]
-;; - non-ascii character removed from bibtex-mode.
-;; Changed bib-mode '@comment' => '%'. Closes Debian
-;; Bug#282388
-;;
-;; Sep 10 2004 21.3 [jari 2.116 2004.0910]
-;; - (folding-fold-region): caused to indent bottom fold
-;; some 50 spaces forward in auctex:latex-mode. Disabled
-;; running `indent-according-to-mode' while in latex-mode.
-;; Bug reported by Uwe Brauer; oub A T mat dot ucm dot es
-;; - Removed extra newlines from whole buffer.
-;; - Changed version scheme to date based YYYY.MMDD
-;; - Removed unnecessary 'all rights reserved'.
-;; - (folding-check-folded): Added check for \r character, which
-;; - protected all email addresses by removing AT-signs.
-;;
-;; Apr 01 2004 21.3 [jari 2.111-2.115]
-;; - Merged in changes made by 2003-11-12 Adrian Aichner
-;; from XEmacs tree 1.15; Typo fixes for docstrings and comments.
-;; - Returned to old bug and solved it in a better way (preserve region) by
-;; using different expansion macros for XEmacs and Emacs.
-;; See See http://list-archive.xemacs.org/xemacs-beta/199810/msg00039.html
-;; - (folding-forward-char-1): 2.112 Renamed.
-;; Was `folding-forward-char'.
-;; (folding-backward-char-1): 2.112 Renamed.
-;; Was `folding-backward-char'.
-;; (folding-forward-char-macro): 2.112 New. Fix XEmacs
-;; region preservation with '_p' interactive spec.
-;; (folding-backward-char-macro): 2.112 New. Fix XEmacs
-;; region preservation with '_p' interactive spec.
-;; (folding-interactive-spec-p): 2.112 New.
-;;
-;; Sep 11 2003 21.2 [jari 2.107-2.111]
-;; - Added new sections "Uninstallation" and "To read the manual".
-;; M-x finder can invoke folding too provided that patch to
-;; lisp-mnt.el and finder.el is installed. Sent patch to XEmacs and
-;; Emacs developers.
-;; - Moved fold-mark ";;{{{ Introduction" after the Commentary:
-;; tag to have it included in M-x finder-commentary.
-;; - If called like this: `folding-uninstall' and immediately
-;; `folding-mode', the keybindings were not there any more. Added
-;; call to `folding-install' in `folding-mode'.
-;; - Completely rewrote `folding-install'. It's now divided into
-;; `folding-install-keymaps' and `folding-uninstall-keymaps'
-;; - Added support for `php-mode', `javascript-mode',
-;; `change-log-mode' and `finder-mode'.
-;; - Documentation changes (fit all to 80 characters).
-;;
-;; Aug 21 2002 21.2 [jari 2.105-2.106]
-;; - Added user function `folding-uninstall'.
-;; - Removed `interactive' status: `folding-install-hooks' and
-;; `folding-uninstall-hooks'
-;;
-;; Aug 02 2002 20.7 [jari 2.101-2.104]
-;; - Added font lock support. Now beginning and end markers are
-;; highlighted with user variables `folding-font-lock-begin-mark'
-;; `folding-font-lock-end-mark'. Feature suggested by
-;; <Claude BOUCHER A T astrium-space com>
-;; - Removed LCD entry - unnecessary.
-;;
-;; Jan 24 2002 20.7 [jari 2.100]
-;; - (folding-context-next-action):New user function.
-;; Code by Scott Evans <gse A T antisleep com>
-;; - (folding-bind-default-keys): Added
-;; C-x . to run `folding-context-next-action'
-;; - (folding-mouse-call-original): Added `car-safe' to read
-;; EVENT, which may be nil.
-;;
-;; Jul 31 2001 20.7 [jari 2.98-2.99]
-;; - Gleb Arshinov <gleb A T barsook com> fixed the broken XEmacs
-;; isearch support and sent nice patch.
-;;
-;; Jul 19 2001 20.7 [jari 2.92-2.97]
-;; - Beautified lisp code by removing parens that were alone.
-;; - XEmacs latex-mode fix. The folds were strangely indented too
-;; far right. The cause was `indent-according-to-mode' which is
-;; now disabled in latex. bug reported by
-;; Uwe Brauer; oub A T maraton sim ucm es
-;; - 2.96 Erroneous `:' in `folding-mode-write-file'
-;; when it should have been `;'. Bug reported by
-;; Brand Michael; michael brand A T siemens com
-;;
-;; Apr 04 2001 20.7 [jari 2.89-2.91]
-;; - Small corrections to find-func.el::find-function-search-for-symbol
-;; implementation.
-;;
-;; Mar 08 2001 20.6 [jari 2.88]
-;; - Dave Masterson <dmasters A T rational com> reported that jumping to a
-;; url displayed by the C-h f FUNCTION which told where the function
-;; was located died. The reason was that the buffer was folded and
-;; find-func.el::find-function-search-for-symbol used regexps that
-;; do not take into account folded buffers. The regexps used there
-;; rely on syntax tables.
-;; - Added two new advices to catch find-func.el and unfold the buffer
-;; prior searching: (advice find-file-noselect after) and (advice
-;; find-function-search-for-symbol around)
-;;
-;; Mar 04 2001 20.6 [jari 2.83-2.87]
-;; - Added ###autoload statements, tidied up empty lines and lisp syntax.
-;; - Run checkdoc.el 0.6.1 and corrected errors.
-;;
-;; Jan 04 2001 20.6 [jari 2.82]
-;; - Added FOLD highlight feature for XEmacs:
-;; `folding-mode-motion-highlight-fold'
-;; and package `mode-motion' Suggested by
-;; Thomas Ruhnau <thomas ruhnau A T intermetall de>
-;; - (folding-bind-default-keys): 2.81 New binding C-k
-;; `folding-marks-kill'
-;; (fold-marks-kill): 2.81 New.
-;;
-;; Jan 03 2001 20.6 [jari 2.81]
-;; - (folding-folding-region): 2.80 Renamed to `folding-fold-region'
-;; - (folding-mark-look-at-top-mark-p): 2.80 New.
-;; - (folding-mark-look-at-bottom-mark-p): 2.80 New.
-;; - (folding-tidy-inside): 2.80 Use `folding-mark-look-at-top-mark-p'
-;; and `folding-mark-look-at-bottom-mark-p'.
-;; - Didn't accept spaces in front of fold markers.
-;; - (folding-fold-region): 2.80 Added `indent-according-to-mode'
-;; to indent folds as needed.
-;;
-;; Dec 16 2000 20.6 [jari 2.79-2.80]
-;; - `folding-xemacs-p' now test (featurep 'xemacs)
-;; - Added missing folding functions to the menubar
-;; - `folding-package-url-location' new variable used by function
-;; `folding-insert-advertise-folding-mode'
-;; - `folding-keep-hooked' was commented out in `folding-mode'. Added
-;; back.
-;;
-;; Jul 25 2000 20.6 [jari 2.76-2.78]
-;; - 2.75 Added support for modes:
-;; xrdb-mode, ksh-mode and sql-mode contributed by
-;; Juhapekka Tolvanen <juhtolv A T st jyu fi>. Scanned systematically
-;; all modes under Emacs 20.6 progmodes and added support for:
-;; ada-mode, asm-mode, awk-mode, cperl-mode, fortran-mode, f90-mode,
-;; icon-mode, m4-mode, meta-mode, pascal-mode, prolog-mode,
-;; simula-mode, vhdl-mode, bibtex-mode, nroff-mode, scribe-mode(*),
-;; sgml-mode
-;; - Mode marked with (*) was not added.
-;; - (folding-insert-advertise-folding-mode): 2.76 New. Suggested by
-;; Juhapekka Tolvanen <juhtolv A T st jyu fi>
-;; - (folding-bind-default-keys): 2.76
-;; folding-insert-advertise-folding-mode Bound to key "I"
-;;
-;; Apr 24 1999 20.4 [jari 2.73-2.75]
-;; - (folding-bind-terminal-keys): 2.74 New. Bind C-f and C-b only at
-;; non-window system where they are really needed. Someone may use
-;; C-f for `isearch-forward' in windowed Emacs.
-;; - (folding-bind-default-keys): 2.74 Use `folding-bind-terminal-keys'
-;; - (folding-bind-outline-compatible-keys): 2.74
-;; Use `folding-bind-terminal-keys'
-;;
-;; Feb 13 1999 20.4 [jari 2.71-2.72]
-;; - (folding-event-posn): 2.70 Wrong
-;; place of paren and the following was malformed call:
-;; (let* ((el (funcall (symbol-function 'event-start) event)))
-;;
-;; Jan 13 1999 20.4 [jari 2.70]
-;; - 2.69 The `looking-at' is now smarter with
-;; fold beginning marks. The tradition has been the the fold always
-;; has a name, so the requirement to search fold is "{{{ ". Now
-;; the " " is searched as " *", not requiring a space --> not requiring
-;; a fold name.
-;; - (folding-skip-folds): >>feature not not enabled<<
-;; 2.69 Do not require trailing " " any more.'
-;; (folding-tidy-inside): >>feature not not enabled<<
-;; 2.69 Do not require trailing " " any more.
-;; - (folding-install): 2.69 Fixed indentation.
-;; - (folding-mark-look-at): 2.69 The "em" missed "*" and thus pressing
-;; mouse-3 at the end-fold didn't collapse the whole fold.
-;;
-;; Jan 12 1999 20.4 [jari 2.69]
-;; (folding-bind-default-mouse): 2.68
-;; XEmacs and Emacs Mouse binding was different. Now use common
-;; bindings: The S-mouse-2 was superfluous, because mouse-3 already
-;; did that, so the binding was removed.
-;; mouse-3 folding-mouse-context-sensitive
-;; S-mouse-2 folding-hide-current-entry
-;; C-S-mouse-2 folding-mouse-pick-move
-;;
-;;;; Jan 09 1999 20.4 [jari 2.67-2.68]
-;; - (folding-event-posn): 2.66 Hide `event-start' From XEmacs
-;; (byte compile silencer)
-;;
-;; Jan 07 1999 20.4 [jari 2.65-2.66]
-;; - The Folding begin and AND mark was not case sensitive;
-;; that's why a latex styles "\B" and "\endB" fold marks couldn't
-;; be used. Added relevant `case-fold-search' settings. Not tested
-;; very well, though.
-;; - Added standard "turn-on" "turn-off" functions.
-;; - (folding-whole-buffer): 2.65 Better
-;; Error message. Show used folding-mark on error.
-;; - (folding-skip-folds): 2.65 Moved docs in function.
-;; - (turn-off-folding-mode): 2.65 New.
-;; - (turn-on-folding-mode): 2.65 New.
-;; - (folding-mark-look-at): 2.65 `case-fold-search'
-;; - (folding-next-visible-heading): 2.65 `case-fold-search'
-;; - (folding-find-folding-mark): 2.65 `case-fold-search'
-;; - (folding-pick-move): 2.65 `case-fold-search'
-;; - (folding-skip-folds): 2.65 `case-fold-search'
-;; - (folding-tidy-inside): 2.65 `case-fold-search'
-;; - (folding-convert-to-major-folds): 2.65 `case-fold-search'
-;;
-;; Jan 04 1999 20.4 [jari 2.62-2.64]
-;; - (folding-set-local-variables): 2.61 New. Now it is possible to
-;; change the folding marks dynamically.
-;; - (folding-mode): 2.61 Call `folding-set-local-variables'
-;; (folding-mode-marks-alist): 2.61 mention
-;; - `folding-set-local-variables'
-;; Added documentation section: "Example: AucTex setup"
-;; - NT Emacs fix wrapped inside `eval-and-compile'. hs-discard-overlays
-;; are now hidden from byte compiler (since the code is not
-;; executed anyway)
-;;
-;; May 24 1999 19.34 [jari 2.59-2.61]
-;; - New function `folding-all-comment-blocks-in-region'. Requested by
-;; Uwe Brauer <oub A T eucmos sim ucm es>. Bound under "/" key.
-;; - (folding-all-comment-blocks-in-region):
-;; Check non-whitespace `comment-end'. Added `matlab-mode' to
-;; fold list
-;; - (folding-event-posn): 2.63 Got rid of the XEmacs/Emacs
-;; posn-/event- byte compiler warnings
-;; - (folding-mouse-call-original): 2.63 Got rid of the XEmacs
-;; `event-button' byte compiler warning.
-;;
-;; Apr 15 1999 19.34 [jari 2.57]
-;; - (folding-mouse-call-original): Samuel Mikes
-;; <smikes A T alumni hmc edu> reported that the `concat' function was
-;; used to add an integer to "button" event. Applied patch to use
-;; `format' instead.
-;;
-;; Mar 03 1999 19.34 [andersl]
-;; - (folding-install): had extra paren. Removed.
-;;
-;; Feb 22 1999 19.34 [jari 2.56]
-;; - folding-install):
-;; Check if `folding-mode-prefix-map' is nil and call
-;;
-;; Feb 19 1999 19.34 [jari 2.55]
-;; - (folding-mode-hook-no-re):
-;; Renamed to `folding-mode-hook-no-regexp'
-;; - (fold-inside-mode-name): Renames to `folding-inside-mode-name'
-;; (fold-mode-string): Renamed to `folding-mode-string'
-;; - Renamed all `fold-' prefixes to `folding-'
-;; - Rewrote chapter `Example: personal setup'
-;;
-;; Jan 01 1999 19.34 [jari 2.54]
-;; - Byte compiler error fix: (folding-bind-outline-compatible-keys):
-;; 'folding-show-all lacked the quote.
-;;
-;; Dec 30 1998 19.34 [jari 2.53]
-;; - Jesper Pedersen <blackie A T imada ou dk> reported bug that hiding
-;; subtree was broken. This turned out to be a bigger problem in fold
-;; handling in general. This release has big relatively big error
-;; fixes.
-;; - Many of the folding functions were also renamed to mimic Emacs 20.3
-;; allout.el names. Outline keybindings were rewritten too.
-;; - folding.el (folding-mouse-yank-at-point): Renamed from
-;; `folding-mouse-operate-at-point'. The name is similar to Emacs
-;; standard variable name. The default value changed from nil --> t
-;; according to suggestion by Jesper Pedersen <blackie A T imada ou dk>
-;; Message "Info, Ignore [X]Emacs specific..." is now displayed only
-;; while byte compiling file.
-;; (folding-bind-outline-compatible-keys):
-;; Checked the Emacs 20.3 allout.el outline bindings and made
-;; folding mimic them
-;; (folding-show-subtree): Renamed to `folding-show-current-subtree'
-;; according to allout.el
-;; (folding-hide-subtree): Renamed to `folding-hide-current-subtree'
-;; according to allout.el
-;; (folding-enter): Renamed to `folding-shift-in'
-;; according to allout.el
-;; (folding-exit): Renamed to `folding-shift-out'
-;; according to allout.el
-;; (folding-move-up): Renamed to `folding-previous-visible-heading'
-;; according to allout.el
-;; (folding-move): Renamed to `folding-next-visible-heading'
-;; according to allout.el
-;; (folding-top-level): Renamed to `folding-show-all'
-;; according to allout.el
-;; (folding-show): Renamed to `folding-show-current-entry'
-;; according to allout.el
-;; (folding-hide): Renamed to `folding-hide-current-entry'
-;; according to allout.el
-;; (folding-region-open-close): While loop rewritten so that if user
-;; is already on a fold mark, then close current fold. This also
-;; fixed the show/hide subtree problem.
-;; (folding-hide-current-subtree): If use hide subtree that only had
-;; one fold, then calling this function caused error. The reason was
-;; error in `folding-pick-move' (folding-pick-move): Test that
-;; `moved' variable is integer and only then move point. This is the
-;; status indicator from `folding-find-folding-mark'
-;; (folding-find-folding-mark): Fixed. mistakenly moved point when
-;; checking TOP level marker, status 11. the point was permanently
-;; moved to point-min.
-;;
-;; Dec 29 1998 19.34 [jari 2.51]
-;; - Jesper Pedersen <blackie A T imada ou dk> reported that prefix key
-;; cannot take vector notation [(key)]. This required changing the way
-;; how folding maps the keys. Now uses intermediate keymap
-;; `folding-mode-prefix-map'
-;; - `folding-kbd' is new.
-;; - `folding-mode' function description has better layout.
-;; - `folding-get-mode-marks' is now defsubst.
-;;
-;; Dec 13 1998 19.34 [jari 2.49-2.50]
-;; - Gleb Arshinov <gleb A T CS Stanford EDU> reported that the XEmacs 21.0
-;; `concat' function won't accept integer argument any more and
-;; provided patch for `folding-set-mode-line'.
-;;
-;; Nov 28 1998 19.34 [jari 2.49-2.50]
-;; - Gleb Arshinov <gleb A T CS Stanford EDU> reported that the
-;; zmacs-region-stays must not be set globally but in the functions
-;; that need it. He tested the change on tested on XEmacs 21.0 beta
-;; and FSF Emacs 19.34.6 on NT and sent a patch . Thank you.
-;; - (folding-preserve-active-region): New macro to set
-;; `zmacs-region-stays' to t in XEmacs.
-;; - (folding-forward-char): Use `folding-preserve-active-region'
-;; - (folding-backward-char): Use `folding-preserve-active-region'
-;; - (folding-end-of-line): Use `folding-preserve-active-region'
-;; - (folding-isearch-general): Variables `is-fold' and
-;; `is narrowed' removed, because they were not used. (Byte
-;; Compilation fix)
-;; - Later: interestingly using `defmacro'
-;; folding-preserve-active-region does not work in XEmacs 21.0 beta,
-;; but `defsubst' does. Reported and corrected by Gleb.
-;;
-;; Oct 22 1998 19.34 [jari 2.47-2.48]
-;; - NT Emacs has had long time a bug where it strips away ^M when
-;; closed fold is copied to kill ring. When pasted, then ^M are
-;; gone. This cover NT Emacs releases 19.34 - 20.3. Bug report has
-;; been filed.
-;; - to cope with the situation I added new advice functions that
-;; get instantiated only for these versions of NT Emacs. See
-;; `kill-new' and `current-kill'
-;;
-;; Oct 21 1998 19.34 [jari 2.46]
-;; - `folding-isearch-general' now enters folds as usual with isearch.
-;; The only test needed was to check `quit-isearch' before calling
-;; `folding-goto-char', because the narrow case was already taken
-;; cared of in the condition case.
-;;
-;; Oct 19 1998 19.34 [jari 2.44]
-;; - 1998-10-19 Uwe Brauer <oub A T sunma4 mat ucm es> reported that
-;; In Netscape version > 4 the {{{ marks cannot be used. For IE they
-;; were fine, but not for Netscape. Some bug there.
-;; --> Marks changed to [[[ ]]]
-;;
-;; Oct 5 1998 19.34 [jari 2.43]
-;; - The "_p" flag does not exist in Emacs 19.34, so the previous patch
-;; was removed. <greg A T alphatech com> (Greg Klanderman) suggested using
-;; `zmacs-region-stays'. Added to the beginning of file.
-;; - todo: folding does not seem to open folds any more with Isearch.
-;;
-;; Oct 5 1998 19.34 [jari 2.42]
-;; - Gleb Arshinov <gleb A T cs stanford edu> reported (and supplied patch):
-;; I am using the latest beta of folding.el with XEmacs 21.0 "Finnish
-;; Landrace" [Lucid] (i386-pc-win32) (same bug is present with folding.el
-;; included with XEmacs). Being a big fan of zmacs-region, I was
-;; disappointed to find that folding mode caused my usual way of
-;; selecting regions (e.g. to select a line C-space, C-a, C-e) to break
-;; :( I discovered that the following 3 functions would unset my mark.
-;; Upon reading some documentation, this seems to be caused by an
-;; argument to interactive used by these functions. With the following
-;; tiny patch, the undesirable behaviour is gone.
-;; - Patch was applied as is. Function affected:
-;; `folding-forward-char' `folding-backward-char'
-;; `folding-end-of-line'. Interactive spec changed from "p" to "_p"
-;;
-;; Sep 28 1998 19.34 [jari 2.41]
-;; - Wrote section "folding-whole-buffer doesn't fold whole buffer" to
-;; Problems topic. Fixed some indentation in documentation so that
-;; command ripdoc.pl folding.el | t2html.pl --simple > folding.html
-;; works properly.
-;;
-;; Sep 24 1998 19.34 [jari 2.40]
-;; - Stephen Smith <steve A T fmrib ox ac uk> wished that the
-;; `folding-comment-fold' should handle modes that have comment-start
-;; and comment-end too. That lead to rewriting the comment function so
-;; that it can be adapted to new modes.
-;; - `folding-pick-move' didn't work in C-mode. Fixed.
-;; (folding-find-folding-mark):
-;; m and re must be protected with `regexp-quote'. This
-;; corrected error eg. in C-mode where `folding-pick-move'
-;; didn't move at all.
-;; (folding-comment-fold): Added support for major modes that
-;; have `comment-start' and `comment-end'. Use
-;; `folding-comment-folding-table'
-;; (folding-comment-c-mode): New.
-;; (folding-uncomment-c-mode): New.
-;; (folding-comment-folding-table): New. To adapt to any major-mode.
-;; (folding-uncomment-mode-generic): New.
-;; (folding-comment-mode-generic): New.
-;;
-;; Aug 08 1998 19.34 [jari 2.39]
-;; - Andrew Maccormack <andrewm A T bristol st com> reported that the
-;; `em' end marker that was defined in the `let' should also have
-;; `[ \t\n]' which is in par with the `bm'. This way fold markers do
-;; not need to be parked to the left any more.
-;;
-;; Jun 05 1998 19.34 [jari 2.37-2.38]
-;; - Alf-Ivar Holm <affi A T osc no> send functions
-;; `folding-toggle-enter-exit' and `folding-toggle-show-hide' which
-;; were integrated. Alf also suggested that Fold marks should now
-;; necessarily be located at the beginning of line, but allow spaces
-;; at front. The patch was applied to `folding-mark-look-at'
-;;
-;; Mar 17 1998 19.34 [Anders]
-;; - Anders: This patch fixes one problem that was reported in the
-;; beginning of May by Ryszard Kubiak <R Kubia A T ipipan gda pl>.
-;; - Finally, I think that I have gotten mouse-context-sensitive
-;; right. Now, when you click on a fold that fold rather than the
-;; one the cursor is on is used, while still not breaking commands
-;; like `mouse-save-then-kill' which assumes that the point hasn't
-;; been moved.
-;; - Jari: Added topic "Fold must have a label" to the Problem section.
-;; as reported by Solofo Ramangalahy <solofo A T mpi-sb mpg de>
-;; - 1998-05-04 Ryszard Kubiak <R Kubiak A T ipipan gda pl> reported: I am
-;; just curious if it is possible to make Emacs' cursor
-;; automatically follow a mouse-click on the {{{ and }}} lines. I
-;; mean by this that a [S-mouse-3] (as defined in my settings below
-;; --- I keep not liking overloading [mouse-3]) first moves the
-;; cursor to where the click happened and then hides or shows a
-;; folded area. I presume that i can write a two-lines long
-;; interactive function to do this. Still, may be this kind of mouse
-;; behaviour is already available.
-;;
-;; Mar 17 1998 19.34 [Jari 2.34-2.35]
-;; - Added "Example: choosing different fold marks for mode"
-;; - corrected `my-folding-text-mode-setup' example.
-;;
-;; Mar 10 1998 19.34 [Jari 2.32-2.33]
-;; - [Anders] responds to mouse-3 handling problem: I have found the
-;; cause of the problem, and I have a suggestion for a fix.
-;;
-;; The problem is caused by two things:
-;; * The "mouse-save-then-kill" checks that the previous command also
-;; was "mouse-save-then-kill".
-;;
-;; * The second (more severe) problem is that
-;; "folding-mouse-context-sensitive" sets the point to the
-;; location of the click, effectively making
-;; "mouse-save-then-kill" mark the area between the point and the
-;; point! (This is why no region appears.)
-;;
-;; The first problem can be easily fixed by setting "this-command"
-;; in "folding-mouse-call-original":
-;;
-;; - Now the good old mouse-3 binding is back again.
-;; - (folding-mouse-context-sensitive): Added `save-excursion' as
-;; Anders suggested before setting `state'.
-;; (folding-mouse-call-original): commented out experimental code and
-;; used (setq this-command orig-func) as Anders suggested.
-;;
-;; Mar 10 1998 19.34 [Jari 2.31]
-;; - (folding-act): Added `event' to `folding-behave-table' calls.
-;; Input argument takes now `event' too
-;; - (folding-mouse-context-sensitive): Added argument `event'
-;; - (folding-mouse-call-original): Added (this-command orig-func)
-;; when calling original command.
-;; - (folding-bind-default-mouse): Changed mouse bindings. The
-;; button-3 can't be mapped by folding, because folding is unable to
-;; call the original function `mouse-save-then-kill'. Passing simple
-;; element to `mouse-save-then-kill' won't do the job. Eg if I
-;; (clicked mouse-1) moved mouse pointer to place X and pressed
-;; mouse-3, the area was not highlighted in folding mode. If folding
-;; mode was off the are was highlighted. I traced the
-;; `folding-mouse-call-original' and it was passing exactly the same
-;; event as without folding mode. I have no clue what to do about
-;; it...That's why I removed default mouse-3 binding and left it to
-;; emacs. This bug was reported by Ryszard Kubiak"
-;; <R Kubiak A T ipipan gda pl>
-;;
-;; Feb 12 1998 19.34 [Jari 2.30]
-;; - (html-mode): New mode added to `folding-mode-marks-alist'
-;; - (folding-get-mode-marks): Rewritten, now return 3rd element too.
-;; - (folding-comment-fold): Added note that function with `comment-end'
-;; is not supported. Function will flag error in those cases.
-;; - (folding-convert-to-major-folds): Conversion failed if eg; you
-;; switched between modes that has 2 and 1 comments, like
-;; /* */ (C) and //(C++). Now the conversion is bit smarter, but it's
-;; impossible to convert from /* */ to // directly because we don't
-;; know how to remove */ mark, you see:
-;;
-;; Original mode was C
-;;
-;; /* {{{ */
-;;
-;; And now used changed it to C++ mode, and ran command
-;; `folding-convert-to-major-folds'. We no longer have information
-;; about old mode's beginning or end comment markers, so we only
-;; can convert the folds to format
-;;
-;; // {{{ */
-;;
-;; Where the ending comment mark from old mode is left there.
-;; This is slightly imperfect situation, but at least the fold
-;; conversion works.
-;;
-;; Jan 28 1998 19.34 [Jari 2.25-2.29]
-;; - Added `generic-mode' to fold list, suggested by Wayne Adams
-;; <wadams A T galaxy sps mot com>
-;; - Finally rewrote the awesome menu-bar code: now uses standard
-;; easy-menu Which works in both XEmacs and Emacs. The menu is no
-;; longer under "Tools", but appear when minor mode is turned on.
-;; - Radical changes: Decided to remove all old lucid and epoch
-;; dependencies. Lot of code removed and reprogrammed.
-;; - I also got rid of the `folding-has-minor-mode-map-alist-p' variable
-;; and old 18.xx function `folding-merge-keymaps'.
-;; - Symbol's value as variable is void ((folding-xemacs-p)) error fixed.
-;; - Optimized 60 `folding-use-overlays-p' calls to only 4 within
-;; `folding-subst-regions'. (Used elp.el). It seems that half of the
-;; time is spent in the function `folding-narrow-to-region'
-;; function. Could it be optimized somehow?
-;; - Changed "lucid" tests to `folding-xemacs-p' variable tests.
-;; - Removed `folding-hack' and print message 'Info, ignore missing
-;; functions.." instead. It's better that we see the missing
-;; functions and not define dummy hacks for them.
-;;
-;; Nov 13 1997 19.34 [Jari 2.18-2.24]
-;; - Added tcl-mode fold marks, suggested by Petteri Kettunen
-;; <Petteri Kettunen A T oulu fi>
-;; - Removed some old code and modified the hook functions a bit.
-;; - Added new user function `folding-convert-to-major-folds', key "%".
-;; - Added missing items to Emacs menubar, didn't dare to touch the
-;; XEmacs part.
-;; - `folding-comment-fold': Small fix. commenting didn't work on
-;; closed folds. or if point was on topmost fold.
-;; - Added `folding-advice-instantiate' And corrected byte compiler
-;; message: Warning: variable oldposn bound but not referenced
-;; Warning: reference to free variable folding-stack
-;; - updated (require 'custom) code
-;;
-;; Nov 6 1997 19.34 [Jari 2.17]
-;; - Uwe Brauer <oub A T sunma4 mat ucm es> used folding for Latex files
-;; and he wished a feature that would allow him to comment away ext
-;; that was inside fold; when compiling the TeX file.
-;; - Added new user function `folding-comment-fold'. And new
-;; keybinding ";".
-;;
-;; Oct 8 1997 19.34 [Jari 2.16]
-;; - Now the minor mode map is always re-installed when this file is
-;; loaded. If user accidentally made mistake in
-;; `folding-default-keys-function', he can simply try again and
-;; reload this file to have the new key definitions.
-;; - Previously user had to manually go and delete the previous map
-;; from the `minor-mode-map-alist' before he could try again.
-;;
-;; Sep 29 1997 19.34 [Jari 2.14-2.15]
-;; - Robert Marshall <rxmarsha A T bechtel com> Sent enhancement to goto-line
-;; code. Now M-g works more intuitively.
-;; - Reformatted totally the documentation so that it can be ripped to
-;; html with jari's ema-doc.pls and t2html.pls Perl scripts.
-;; - Run through checkdoc.el 1.55 and Elint 1.10 and corrected code.
-;; - Added defcustom support. (not tested)
-;;
-;; Sep 19 1997 19.28 [Jari 2.13]
-;; - Robert Marshall <rxmarsha A T bechtel com> Sent small correction to
-;; overlay code, where the 'owner tag was set wrong.
-;;
-;; Aug 14 1997 19.28 [Jari 2.12 ]
-;; - A small regexp bug (extra whitespace was required after closing
-;; fold) cause failing of folding-convert-buffer-for-printing in the
-;; following situation
-;; - Reported by Guide. Fixed now.
-;;
-;; {{{ Main topic
-;; {{{ Subsection
-;; }}} << no space or end tag here!
-;; }}} Main topic
-;;
-;; Aug 14 1997 19.28 [Jari 2.11]
-;; - Guide Van Hoecke <Guido Van Hoecke A T bigfoot com> reported that
-;; he was using closing text for fold like:
-;;
-;; {{{ Main topic
-;; {{{ Subsection
-;; }}} Subsection
-;; }}} Main topic
-;;
-;; And when he did folding-convert-buffer-for-printing, it couldn't
-;; remove those closing marks but threw an error. I modified the
-;; function so that the regexp accepts anything after closing fold.
-;;
-;; Apr 18 1997 19.28 [Jari 2.10]
-;; - Corrected function folding-show-current-subtree, which didn't
-;; find the correct end region, because folding-pick-move needed
-;; point at the top of beginning fold. Bug was reported by Uwe
-;; Brauer <oub A T sunma4 mat ucm es> Also changed folding-mark-look-at,
-;; which now has new call parameter 'move.
-;;
-;; Mar 22 1997 19.28 [Jari 2.9]
-;; - Made the XEmacs20 match more stricter, so that
-;; folding-emacs-version gets value 'XEmacs19. Also added note about
-;; folding in WinNT in the compatibility section.
-;; - Added sh-script-mode indented-text-mode folding marks.
-;; - Moved the version from branch to the root, because the extra
-;; overlay code added, seems to be behaving well and it didn't break
-;; the existing functionality.
-;;
-;; Feb 17 1997 19.28 [Jari 2.8.1.2]
-;; - Cleaned up Dan's changes. First: we must not replace the
-;; selective display code, but offer these two choices: Added
-;; folding-use-overlays-p function which looks variable
-;; folding-allow-overlays.
-;; - Dan uses function from another Emacs specific (19.34+?) package
-;; hs-discard-overlays. This is not available in 19.28. it should
-;; be replaced with some new function... I didn't do that yet.
-;; - The overlays don't exist in XEmacs. XE19.15 has promises: at least
-;; I have heard that they have overlay.el library to mimic Emacs
-;; functions.
-;; - Now the overlay support can be turned on by setting
-;; folding-allow-overlays to non-nil. The default is to use selective
-;; display. Overlay Code is not tested!
-;;
-;; Feb 17 1997 19.28 [Dan 2.8.1.1]
-;; - Dan Nicolaescu <done A T ece arizona edu> sent patch that replaced
-;; selective display code with overlays.
-;;
-;; Feb 10 1997 19.28 [jari 2.8]
-;; - Ricardo Marek <ricky A T ornet co il> Kindly sent patch that
-;; makes code XEmacs 20.0 compatible. Thank you.
-;;
-;; Nov 7 1996 19.28 [jari 2.7]
-;; - When I was on picture-mode and turned on folding, and started
-;; isearch (I don't remember how I got fold mode on exactly) it
-;; gave error that the fold marks were not defined and emacs
-;; locked up due to simultaneous isearch-loop
-;; - Added few fixes to the isearch handling function to avoid
-;; infinite error loops.
-;;
-;; Nov 6 1996 19.28 [jari 2.5 - 2.6]
-;; - Situation: have folded buffer, manually _narrow_ somewhere, C-x n n
-;; - Then try searching --> folding breaks. Now it checks if the
-;; region is true narrow and not folding-narrow before trying
-;; to go outside of region and open a fold
-;; - If it's true narrow, then we stay in that narrowed region.
-;;
-;; folding-isearch-general :+
-;; folding-region-has-folding-marks-p :+
-;;
-;; Oct 23 1996 19.28 [jari 2.4]
-;; folding-display-name :+ new user cmd "C-n"
-;; folding-find-folding-mark :+ new
-;; folding-pick-move :! rewritten, full of bugs
-;; folding-region-open-close :! rewritten, full of bugs
-;;
-;; Oct 22 1996 19.28 [jari 2.3]
-;; - folding-pick-move :! rewritten
-;; folding-region-open-close :+ new user cmd "#"
-;; folding-show-current-subtree :+ new user cmd "C-s", hides too
-;;
-;; Aug 01 1996 19.31 [andersl]
-;; - folding-subst-regions, variable `font-lock-mode' set to nil.
-;; Thanks to <stig A T hackvan com>
-;;
-;; Jun 19 1996 19.31 [andersl]
-;; - The code has proven itself stable through the beta testing phase
-;; which has lasted the past six months.
-;; - A lot of comments written.
-;; - The package `folding-isearch' integrated.
-;; - Some code cleanup:
-;; BOLP -> folding-BOL :! renamed
-;; folding-behave-table :! field `down' removed.
-;;
-;;
-;; Mar 14 1996 19.28 [jari 1.27]
-;; - No code changes. Only some textual corrections/additions.
-;; - Section "about keymaps" added.
-;;
-;; Mar 14 1996 19.28 [jackr 1.26]
-;; - spell-check run over code.
-;;
-;; Mar 14 1996 19.28 [davidm 1.25]
-;; - David Masterson <davidm A T prism kla com> This patch makes the menubar in
-;; XEmacs work better. After I made this patch, the Hyperbole menus
-;; starting working as expected again. I believe the use of
-;; set-buffer-menubar has a problem, so the recommendation in XEmacs
-;; 19.13 is to use set-menubar-dirty-flag.
-;;
-;; Mar 13 1996 19.28 [andersl 1.24]
-;; - Corrected one minor bug in folding-check-if-folding-allowed
-;;
-;; Mar 12 1996 19.28 [jari 1.23]
-;; - Renamed all -func variables to -function.
-;;
-;; mar 12 1996 19.28 [jari 1.22]
-;; - Added new example how to change the fold marks. The automatic folding
-;; was reported to cause unnecessary delays for big files (eg. when using
-;; ediff) Now there is new function variable which can totally disable
-;; automatic folding if the return value is nil.
-;;
-;; folding-check-allow-folding-function :+ new variable
-;; folding-check-if-folding-allowed :+ new func
-;; folding-mode-find-file :! modified
-;; folding-mode-write-file :! better docs
-;; folding-goto-line :! arg "n" --> "N" due to XEmacs 19.13
-;;
-;; Mar 11 1996 19.28 [jari 1.21]
-;; - Integrated changes made by Anders' to v1.19 [folding in beta dir]
-;;
-;; Jan 25 1996 19.28 [jari 1.20]
-;; - ** Mainly cosmetic changes **
-;; - Added some 'Section' codes that can be used with lisp-mnt.el
-;; - Deleted all code in 'special section' because it was never used.
-;; - Moved some old "-v-" named variables to better names.
-;; - Removed folding-mode-flag that was never used.
-;;
-;; Jan 25 1996 19.28 [jari 1.19]
-;; - Put Anders' latest version into RCS tree.
-;;
-;; Jan 03 1996 19.30 [andersl]
-;; - `folding-mouse-call-original' uses `call-interactively'.
-;; `folding-mouse-context-sensitive' doesn't do `save-excursion'.
-;; (More changes will come later.)
-;; `folding-mouse-yank-at-p' macro corrected (quote added).
-;; Error for `epoch::version' removed.
-;; `folding-mark-look-at' Regexp change .* -> [^\n\r]* to avoid error.
-;;
-;; Nov 24 1995 19.28 [andersl]
-;; - (sequencep ) added to the code which checks for the existence
-;; of a tools menu.
-;;
-;; Aug 27 1995 19.28 19.12 [andersl]
-;; - Keybindings restructured. They now conforms with the
-;; new 19.29 styleguide. Old keybindings are still available.
-;; - Menus new goes into the "Tools" menu, if present.
-;; - `folding-mouse-open-close' renamed to
-;; `folding-mouse-context-sensitive'.
-;; - New entry `other' in `folding-behave-table' which defaults to
-;; `folding-calling-original'.
-;; - `folding-calling-original' now gets the event from `last-input-event'
-;; if called without arguments (i.e. the way `folding-act' calls it.)
-;; - XEmacs mouse support added.
-;; - `folding-mouse-call-original' can call functions with or without
-;; the Event argument.
-;; - Byte compiler generates no errors neither for Emacs 19 and XEmacs.
-;;
-;; Aug 24 1995 19.28 [jari 1.17]
-;; - To prevent infinite back calling loop, Anders suggested smart way
-;; to detect that func call chain is started only once.
-;; folding-calling-original :+ v, call chain terminator
-;; "Internal" :! v, all private vars have this string
-;; folding-mouse-call-original :! v, stricter chain check.
-;; "copyright" :! t, newer notice
-;; "commentary" :! t, ripped non-supported emacsen
-;;
-;; Aug 24 1995 19.28 [jari 1.16]
-;; ** mouse interface rewritten
-;; - Anders gave many valuable comments about simplifying the mouse usage,
-;; he suggested that every mouse function should accept standard event,
-;; and it should be called directly.
-;; folding-global :- v, not needed
-;; folding-mode-off-hook :- v, not needed
-;; folding-mouse-action-table :- v, not needed any more
-;; folding-default-keys-function :+ v, key settings
-;; folding-default-mouse-keys-function:+ v, key settings
-;; folding-mouse :- f, unnecessary
-;; 'all mouse funcs' :! f, now accept "e" parameter
-;; folding-default-keys :+ f, defines keys
-;; folding-mouse-call-original :+ f, call orig mouse func
-;; "examples" :! t, radical rewrote, only one left
-;;
-;; Aug 24 1995 19.28 [jari 1.15]
-;; - some minor changes. If we're inside a fold, Mouse-3 will go one
-;; level up if it points END or BEG marker.
-;; folding-mouse-yank-at-point:! v, added 'up 'down
-;; folding-mark-look-at :! f, more return values: '11 and 'end-in
-;; folding-open-close :! f, bug, didn't exit if inside fold
-;; PMIN, PMAX, NEXTP, add-l :+ more macros fom tinylibm.el
-;;
-;; Aug 23 1995 19.28 [andersl 1.14]
-;; - Added `eval-when-compile' around 1.13 byte-compiler fix
-;; to avoid code to be executed when using a byte-compiled version
-;; of folding.el.
-;; - Binds mode keys via `minor-mode-map-alist'
-;; (i.e. `folding-merge-keymaps' is not used in modern Emacsen.)
-;; This means that the user can not bind `folding-mode-map' to a new
-;; keymap, \\(s\\|\\)he must modify the existing one.
-;; - `defvars' for global feature test variables `folding-*-p'.
-;; - `folding-mouse-open-close' now detects when the current fold was been
-;; pressed. (The "current" is the fold around which the buffer is
-;; narrowed.)
-;;
-;; Aug 23 1995 19.28 [jari 1.13]
-;; - 19.28 Byte compile doesn't handle fboundp, boundp well. That's a bug.
-;; Set some dummy functions to get cleaner output.
-;; - The folding-mode-off doesn't seem very useful, because it
-;; is never run when another major-mode is turned on ... maybe we should
-;; utilize kill-all-local-variables-hooks with defadvice around
-;; kill-all-local-variables ...
-;;
-;; folding-emacs-version :+ added. it was in the docs, but not defined
-;; kill-all-local-variables-hooks :! v, moved to variable section
-;; list-buffers-mode-alist :! v, --''--
-;; "compiler hacks" :+ section added
-;; "special" :+ section added
-;; "Compatibility" :! moved at the beginning
-;;
-;; Aug 22 1995 19.28 [jari 1.12]
-;; - Only minor changes
-;; BOLP, BOLPP, EOLP, EOLPP :+ f, macros added from tinylibm.el
-;; folding-mouse-pick-move :! f, when cursor at beolp, move always up
-;; "bindings" :+ added C-cv and C-cC-v
-;;
-;; Aug 22 1995 19.28 [jari 1.11]
-;; - Inspired by mouse so much, that this revision contain substantial
-;; changes and enhancements. Mouse is now powered!
-;; - Anders wanted mouse to operate according to 'mouse cursor', not
-;; current 'point'.
-;; folding-mouse-yank-at-point: controls it. Phwew, I like this
-;; one a lot.
-;;
-;; examples :! t, totally changed, now 2 choices
-;; folding-mode-off-hook :+ v, when folding ends
-;; folding-global :+ v, global store value
-;; folding-mouse-action-table :! v, changed
-;; folding-mouse :! f, stores event to global
-;; folding-mouse-open-close :! f, renamed, mouse activated open
-;; folding-mode :! f, added 'off' hook
-;; folding-event-posn :+ f, handles FSF mouse event
-;; folding-mouse-yank-at-p :+ f, check which mouse mode is on
-;; folding-mouse-point :+ f, return working point
-;; folding-mouse-move :+ f, mouse moving down , obsolete ??
-;; folding-mouse-pick-move :+ f, mouse move accord. fold mark
-;; folding-next-visible-heading :+ f, from tinyfold.el
-;; folding-previous-visible-heading :+ f, from tinyfold.el
-;; folding-pick-move :+ f, from tinyfold.el
-;;
-;;
-;; Aug 22 1995 19.28 [jari 1.10]
-;; - Minor typing errors corrected : fol-open-close 'hide --> 'close
-;; This caused error when trying to close open fold with mouse
-;; when cursor was sitting on fold marker.
-;;
-;; Aug 22 1995 19.28 [jari 1.9]
-;; - Having heard good suggestions from Anders...!
-;; "install" : add-hook for folding missed
-;; folding-open-close : generalized
-;; folding-behave-table : NEW, logical behavior control
-;; folding-:mouse-action-table : now folding-mouse-action-table
-;;
-;; - The mouse function seems to work with FSF emacs only, because
-;; XEmacs doesn't know about double or triple clicks. We're working
-;; on the problem...
-;;
-;; Aug 21 1995 19.28 [jari 1.8]
-;; - Rearranged the file structure so that all variables are at the
-;; beginning of file. With new functions, it easy to open-close
-;; fold. Added word "code:" or "setup:" to the front of code folds,
-;; so that the toplevel folds can be recognized more easily.
-;; - Added example hook to install section for easy mouse use.
-;; - Added new functions.
-;; folding-get-mode-marks : return folding marks
-;; folding-mark-look-at : status of current line, fold mark in it?
-;; folding-mark-mouse : execute action on fold mark
-;;
-;;
-;; Aug 17 1995 19.28/X19.12 [andersl 1.7]
-;; - Failed when loaded into XEmacs, when `folding-mode-map' was
-;; undefined. Folding marks for three new major modes added:
-;; rexx-mode, erlang-mode and xerl-mode.
-;;
-;; Aug 14 1995 19.28 [jari 1.6]
-;; - After I met Anders we exchanged some thoughts about usage philosophy
-;; of error and signal commands. I was annoyed by the fact that they
-;; couldn't be suppressed, when the error was "minor". Later Anders
-;; developed fdb.el, which will be integrated to FSF 19.30. It
-;; offers by-passing error/signal interference.
-;; --> I changed back all the error commands that were taken away.
-;;
-;; Jun 02 1995 19.28 [andersl]
-;; - "Narrow" not present in mode-line when in folding-mode.
-;;
-;; May 12 1995 19.28 [jari 1.5]
-;; - Installation text cleaned: reference to 'install-it' removed,
-;; because such function doesn't exist any more. The installation is
-;; now automatic: it's done when user calls folding mode first time.
-;; - Added 'private vars' section. made 'outside all folds' message
-;; informational, not an error.
-;;
-;; May 12 1995 19.28 [jackr x.x]
-;; - Corrected 'broken menu bar' problem.
-;; - Even though make-sparse-keymap claims its argument (a string to
-;; name the menu) is optional, it's not. Lucid has other
-;; arrangements for the same thing..
-;;
-;; May 10 1995 19.28 [jari 1.2]
-;; - Moved provide to the end of file.
-;; - Rearranged code so that the common functions are at the beginning.
-;; Reprogrammed the whole installation with hooks. Added Write file
-;; hook that makes sure you don't write in 'binary' while folding were
-;; accidentally off.
-;; - Added regexp text for certain files which are not allowed to
-;; 'auto fold' when loaded.
-;; - changed some 'error' commands to 'messages', this prevent screen
-;; mixup when debug-on-error is set to t
-;; + folding-list-delete , folding-msg , folding-mode-find-file ,
-;; folding-mode-write-file , folding-check-folded , folding-keep-hooked
-;;
-;; 1.7.4 May 04 1995 19.28 [jackr 1.11]
-;; - Some compatibility changes:
-;; v.18 doesn't allow an arg to make-sparse-keymap
-;; testing epoch::version is trickier than that
-;; free-variable reference cleanup
-;;
-;; 1.7.3 May 04 1995 19.28 [jari]
-;; - Corrected folding-mode-find-file-hook , so that it has more
-;; 'mode turn on' capabilities through user function
-;; + folding-mode-write-file-hook: Makes sure your file is saved
-;; properly, so that you don't end up saving in 'binary'.
-;; + folding-check-folded: func, default checker provided
-;; + folding-check-folded-file-function variable added, User can put his
-;; 'detect folding.el file' methods here.
-;; + folding-mode-install-it: func, Automatic installation with it
-;;
-;; 1.7.2 Apr 01 1995 19.28 [jackr] , Design support by [jari]
-;; - Added folding to FSF & XEmacs menus
-;;
-;; 1.7.1 Apr 28 1995 19.28 [jackr]
-;; - The folding editor's merge-keymap couldn't handle FSF menu-bar,
-;; so some minor changes were made, previous is '>' and enhancements
-;; are '>'
-;;
-;; < (buffer-disable-undo new-buffer)
-;; ---
-;; > (buffer-flush-undo new-buffer)
-;; 1510,1512c1510
-;; < key (if (symbolp keycode)
-;; < (vector keycode)
-;; < (char-to-string keycode))
-;; ---
-;; > key (char-to-string keycode)
-;; 1802,1808d1799
-;; < ;;{{{ Compatibility hacks for various Emacs versions
-;; <
-;; < (or (fboundp 'buffer-disable-undo)
-;; < (fset 'buffer-disable-undo (symbol-function 'buffer-flush-undo)))
-;; <
-;; < ;;}}}
-;;
-;;
-;; X.x Dec 1 1994 19.28 [jari]
-;; - Only minor change. Made the folding mode string user configurable.
-;; Added these variables:
-;; folding-mode-string, folding-inside-string,folding-inside-mode-name
-;; - Changed revision number from 1.6.2 to 1.7 , so that people know
-;; this package has changed.
-
-;;}}}
-
-;;; Code:
-
-;;{{{ setup: require packages
-
-;;; ......................................................... &require ...
-
-(eval-when-compile (require 'cl))
-(require 'easymenu)
-
-(defvar folding-package-url-location
- "Latest folding is available at http://cvs.xemacs.org/viewcvs.cgi/XEmacs/packages/xemacs-packages/text-modes/")
-
-;;}}}
-;;{{{ setup: byte compiler hacks
-
-;;; ............................................. &byte-compiler-hacks ...
-;;; - This really only should be evaluated in case we're about to byte
-;;; compile this file. Since `eval-when-compile' is evaluated when
-;;; the uncompiled version is used (great!) we test if the
-;;; byte-compiler is loaded.
-
-;; Make sure `advice' is loaded when compiling the code.
-
-(eval-and-compile
- (require 'advice)
- (defvar folding-xemacs-p (or (boundp 'xemacs-logo)
- (featurep 'xemacs))
- "Folding determines which emacs version it is running. t if Xemacs.")
- ;; loading overlay.el package removes some byte compiler whinings.
- ;; By default folding does not use overlay code.
- (if folding-xemacs-p
- (or (fboundp 'overlay-start) ;; Already loaded
- (load "overlay" 'noerr) ;; No? Try loading it.
- (message "\
-** folding.el: XEmacs 19.15+ has package overlay.el, try to get it.
- This is only warning. Folding does not use overlays by
- default. You can safely ignore possible overlay byte
- compilation error
- messages."))))
-
-(eval-when-compile
-
- (when nil ;; Disabled 2000-01-05
- ;; While byte compiling
- (if (string= (buffer-name) " *Compiler Input*")
- (progn
- (message "** folding.el:\
- Info, Ignore [X]Emacs's missing motion/event/posn functions calls"))))
-
- ;; ARGS: (symbol variable-p library)
- (defadvice find-function-search-for-symbol (around folding act)
- "Set folding flag for `find-file-noselect' to open all folds."
- (let ((file (ad-get-arg 2)))
- (when file
- (message "FILE %s" file)
- (put 'find-file-noselect 'folding file)))
- ad-do-it
- (put 'find-file-noselect 'folding nil))
-
- (defun folding-find-file-noselect ()
- (let* ((file (get 'find-file-noselect 'folding))
- (buffer (and file
- ;; It may be absolute path name, file.el,
- ;; or just "file".
- (or (find-buffer-visiting file)
- (get-buffer file)
- (get-buffer (concat file ".el"))))))
- (when buffer
- (with-current-buffer buffer
- (when (symbol-value 'folding-mode) ;; Byte compiler silencer
- (turn-off-folding-mode))))))
-
- ;; See find.func.el find-function-search-for-symbol
- ;; Make C-h f and mouse-click work to jump to a file. Folding mode
- ;; Must be turned off due to regexps in find.func.el that can't
- ;; search ^M lines.
-
- (defadvice find-file-noselect (after folding act)
- "When called by `find-function-search-for-symbol', turn folding off."
- (folding-find-file-noselect))
-
- (defadvice make-sparse-keymap
- (before
- make-sparse-keymap-with-optional-argument
- (&optional byte-compiler-happyfier)
- activate)
- "This advice does nothing except adding an optional argument
-to keep the byte compiler happy when compiling Emacs specific code
-with XEmacs.")
-
- ;; XEmacs and Emacs 19 differs when it comes to obsolete functions.
- ;; We're using the Emacs 19 versions, and this simply makes the
- ;; byte-compiler stop wining. (Why isn't there a warning flag which
- ;; could have turned off?)
-
- (and (boundp 'mode-line-format)
- (put 'mode-line-format 'byte-obsolete-variable nil))
-
- (and (fboundp 'byte-code-function-p)
- (put 'byte-code-function-p 'byte-compile nil))
-
- (and (fboundp 'eval-current-buffer)
- (put 'eval-current-buffer 'byte-compile nil)))
-
-(defsubst folding-preserve-active-region ()
- "In XEmacs keep the region alive. In Emacs do nothing."
- (if (boundp 'zmacs-region-stays) ;Keep regions alive
- (set 'zmacs-region-stays t))) ;use `set' to Quiet Emacs Byte Compiler
-
-;; Work around the NT Emacs Cut'n paste bug in selective-display which
-;; doesn't preserve C-m's. Only installed in problematic Emacs and
-;; in other cases these lines are no-op.
-
-(eval-and-compile
- (when (and (not folding-xemacs-p)
- (memq (symbol-value 'window-system) '(win32 w32)) ; NT Emacs
- (string< emacs-version "20.4")) ;at least in 19.34 .. 20.3.1
-
- (unless (fboundp 'char-equal)
- (defalias 'char-equal 'equal))
-
- (unless (fboundp 'subst-char)
- (defun subst-char (str char to-char)
- "Replace in STR every CHAR with TO-CHAR."
- (let ((len (length str))
- (ret (copy-sequence str))) ;because 'aset' is destructive
- (while (> len 0)
- (if (char-equal (aref str (1- len)) char)
- (aset ret (1- len) to-char))
- (decf len))
- ret)))
-
- (defadvice kill-new (around folding-win32-fix-selective-display act)
- "In selective display, convert each C-m to C-a. See `current-kill'."
- (let* ((string (ad-get-arg 0)))
- (when (and selective-display (string-match "\C-m" (or string "")))
- (setq string (subst-char string ?\C-m ?\C-a)))
- ad-do-it))
-
- (defadvice current-kill (around folding-win32-fix-selective-display act)
- "In selective display, convert each C-a back to C-m. See `kill-new'."
- ad-do-it
- (let* ((string ad-return-value))
- (when (and selective-display (string-match "\C-a" (or string "")))
- (setq string (subst-char string ?\C-a ?\C-m))
- (setq ad-return-value string))))))
-
-(defvar folding-mode) ;; Byte Compiler silencer
-
-(when (locate-library "mode-motion") ;; XEmacs
- (defun folding-mode-motion-highlight-fold (event)
- "Highlight line under mouse if it has a foldmark."
- (when folding-mode
- (funcall
- ;; Emacs Byte Compiler Shutup fix
- (symbol-function 'mode-motion-highlight-internal)
- event
- (function
- (lambda ()
- (beginning-of-line)
- (if (folding-mark-look-at)
- (search-forward-regexp "^[ \t]*"))))
- (function
- (lambda ()
- (if (folding-mark-look-at)
- (end-of-line)))))))
- (require 'mode-motion)
- (add-hook 'mode-motion-hook 'folding-mode-motion-highlight-fold 'at-end))
-
-;;}}}
-
-;;{{{ setup: some variable
-
-;;; .................................................. &some-variables ...
-
-;; This is a list of structures which keep track of folds being entered
-;; and exited. It is a list of (MARKER . MARKER) pairs, followed by the
-;; symbol `folded'. The first of these represents the fold containing
-;; the current one. If the view is currently outside all folds, this
-;; variable has value nil.
-
-(defvar folding-stack nil
- "Internal. A list of marker pairs representing folds entered so far.")
-
-(defvar folding-version (substring "$Revision: 3.42 $" 11 15)
- "Version number of folding.el.")
-
-;;}}}
-;;{{{ setup: bind
-
-;;; .......................................................... &v-bind ...
-
-(defgroup folding nil
- "Managing buffers with Folds."
- :group 'tools)
-
-(defcustom folding-mode-prefix-key "\C-c@"
- "*Prefix key to use for Folding commands in Folding mode."
- :type 'string
- :group 'folding)
-
-(defcustom folding-goto-key "\M-g"
- "*Key to be bound to `folding-goto-line' in folding mode.
-The default value is M - g, but you probably don't want folding to
-occupy it if you have used M - g got `goto-line'."
- :type 'string
- :group 'folding)
-
-(defcustom folding-font-lock-begin-mark 'font-lock-reference-face
- "Face to highlight beginning fold mark."
- :type 'face
- :group 'folding)
-
-(defcustom folding-font-lock-end-mark 'font-lock-reference-face
- "Face to highlight end fold mark."
- :type 'face
- :group 'folding)
-
-(defvar folding-mode-map nil
- "Keymap used in Folding mode (a minor mode).")
-
-(defvar folding-mode-prefix-map nil
- "Keymap used in Folding mode keys sans `folding-mode-prefix-key'.")
-
-;;;###autoload
-(defvar folding-mode nil
- "When Non nil, Folding mode is active in the current buffer.")
-
-(make-variable-buffer-local 'folding-mode)
-(set-default 'folding-mode nil)
-
-(defmacro folding-kbd (key function)
- "Folding: define KEY with FUNCTION to `folding-mode-prefix-map'.
-This is used when assigning keybindings to `folding-mode-map'.
-See also `folding-mode-prefix-key'."
- `(define-key
- folding-mode-prefix-map
- ,key ,function))
-
-(defun folding-bind-default-mouse ()
- "Bind default mouse keys used by Folding mode."
- (interactive)
- (cond
- (folding-xemacs-p
- (define-key folding-mode-map [(button3)]
- 'folding-mouse-context-sensitive)
- ;; (define-key folding-mode-map '(double button3) 'folding-hide-current-entry)
- (define-key folding-mode-map [(control shift button2)]
- 'folding-mouse-pick-move))
- (t
- (define-key folding-mode-map [mouse-3] 'folding-mouse-context-sensitive)
- (define-key folding-mode-map [C-S-mouse-2] 'folding-mouse-pick-move))))
-
-(defun folding-bind-terminal-keys ()
- "In non-window system, rebind C - f and C - b as folding-{forward,backward}-char."
- (unless (or (and (boundp 'window-system) ;; Emacs
- (symbol-value 'window-system)) ;; Byte compiler silencer
- (and (fboundp 'console-type) ;; XEmacs
- (let ((val (fboundp 'console-type)))
- (not (eq 'tty val)))))
- (define-key folding-mode-map "\C-f" 'folding-forward-char)
- (define-key folding-mode-map "\C-b" 'folding-backward-char)))
-
-(defun folding-bind-default-keys ()
- "Bind the default keys used the `folding-mode'.
-
-The variable `folding-mode-prefix-key' contains the prefix keys,
-the default is C - c @.
-
-For the good ol' key bindings, please use the function
-`folding-bind-backward-compatible-keys' instead."
- (interactive)
- (define-key folding-mode-map folding-goto-key 'folding-goto-line)
- (folding-bind-terminal-keys)
- (define-key folding-mode-map "\C-e" 'folding-end-of-line)
- (folding-kbd "\C-f" 'folding-fold-region)
- (folding-kbd ">" 'folding-shift-in)
- (folding-kbd "<" 'folding-shift-out)
- (folding-kbd "\C-t" 'folding-show-all)
- (folding-kbd "\C-s" 'folding-show-current-entry)
- (folding-kbd "\C-x" 'folding-hide-current-entry)
- (folding-kbd "\C-o" 'folding-open-buffer)
- (folding-kbd "\C-w" 'folding-whole-buffer)
- (folding-kbd "\C-r" 'folding-convert-buffer-for-printing)
- (folding-kbd "\C-k" 'folding-marks-kill)
- (folding-kbd "\C-v" 'folding-pick-move)
- (folding-kbd "v" 'folding-previous-visible-heading)
- (folding-kbd " " 'folding-next-visible-heading)
- (folding-kbd "." 'folding-context-next-action)
- ;; C-u: kinda "up" -- "down"
- (folding-kbd "\C-u" 'folding-toggle-enter-exit)
- (folding-kbd "\C-q" 'folding-toggle-show-hide)
- ;; Think "#" as a 'fence'
- (folding-kbd "#" 'folding-region-open-close)
- ;; Esc-; is the standard emacs commend add key.
- (folding-kbd ";" 'folding-comment-fold)
- (folding-kbd "%" 'folding-convert-to-major-folds)
- (folding-kbd "/" 'folding-all-comment-blocks-in-region)
- (folding-kbd "\C-y" 'folding-show-current-subtree)
- (folding-kbd "\C-z" 'folding-hide-current-subtree)
- (folding-kbd "\C-n" 'folding-display-name)
-
- (folding-kbd "I" 'folding-insert-advertise-folding-mode))
-
-(defun folding-bind-backward-compatible-keys ()
- "Bind keys traditionally used by Folding mode.
-For bindings which follow newer Emacs minor mode conventions, please
-use the function `folding-bind-default-keys'.
-
-This function sets `folding-mode-prefix-key' to `C-c'."
- (interactive)
- (setq folding-mode-prefix-key "\C-c")
- (folding-bind-default-keys))
-
-(defun folding-bind-outline-compatible-keys ()
- "Bind keys used by the minor mode `folding-mode'.
-The keys used are as much as possible compatible with
-bindings used by Outline mode.
-
-Currently, some outline mode functions doesn't have a corresponding
-folding function.
-
-The variable `folding-mode-prefix-key' contains the prefix keys,
-the default is C - c @.
-
-For the good ol' key bindings, please use the function
-`folding-bind-backward-compatible-keys' instead."
- (interactive)
- ;; Traditional keys:
- (folding-bind-terminal-keys)
- (define-key folding-mode-map "\C-e" 'folding-end-of-line)
- ;; Mimic Emacs 20.3 allout.el bindings
- (folding-kbd ">" 'folding-shift-in)
- (folding-kbd "<" 'folding-shift-out)
- (folding-kbd "\C-n" 'folding-next-visible-heading)
- (folding-kbd "\C-p" 'folding-previous-visible-heading)
- ;; ("\C-u" outline-up-current-level)
- ;; ("\C-f" outline-forward-current-level)
- ;; ("\C-b" outline-backward-current-level)
- ;; (folding-kbd "\C-i" 'folding-show-current-subtree)
- (folding-kbd "\C-s" 'folding-show-current-subtree)
- (folding-kbd "\C-h" 'folding-hide-current-subtree)
- (folding-kbd "\C-k" 'folding-marks-kill)
- (folding-kbd "!" 'folding-show-all)
- (folding-kbd "\C-d" 'folding-hide-current-entry)
- (folding-kbd "\C-o" 'folding-show-current-entry)
- ;; (" " outline-open-sibtopic)
- ;; ("." outline-open-subtopic)
- ;; ("," outline-open-supertopic)
- ;; Other bindings not in allout.el
- (folding-kbd "\C-a" 'folding-open-buffer)
- (folding-kbd "\C-q" 'folding-whole-buffer)
- (folding-kbd "\C-r" 'folding-convert-buffer-for-printing)
- (folding-kbd "\C-w" 'folding-fold-region)
- (folding-kbd "I" 'folding-insert-advertise-folding-mode))
-
-;;{{{ goto-line (advice)
-
-(defcustom folding-advice-instantiate t
- "*In non-nil install advice code. Eg for `goto-line'."
- :type 'boolean
- :group 'folding)
-
-(defcustom folding-shift-in-on-goto t
- "*Flag in folding adviced function `goto-line'.
-If non-nil, folds are entered when going to a given line.
-Otherwise the buffer is unfolded. Can also be set to 'show.
-This variable is used only if `folding-advice-instantiate' was
-non-nil when folding was loaded.
-
-See also `folding-goto-key'."
- :type 'boolean
- :group 'folding)
-
-(defvar folding-narrow-by-default t
- "If t (default) things like isearch will enter folds. If nil the
-folds will be opened, but not entered.")
-
-(when folding-advice-instantiate
- (eval-when-compile (require 'advice))
- ;; By Robert Marshall <rxmarsha A T bechtel com>
- (defadvice goto-line (around folding-goto-line first activate)
- "Go to line ARG, entering folds if `folding-shift-in-on-goto' is t.
-It attempts to keep the buffer in the same visibility state as before."
- (let () ;; (oldposn (point))
- ad-do-it
- (if (and folding-mode
- (or (folding-point-folded-p (point))
- (<= (point) (point-min-marker))
- (>= (point) (point-max-marker))))
- (let ((line (ad-get-arg 0)))
- (if folding-shift-in-on-goto
- (progn
- (folding-show-all)
- (goto-char 1)
- (and (< 1 line)
- (not (folding-use-overlays-p))
- (re-search-forward "[\n\C-m]" nil 0 (1- line)))
- (let ((goal (point)))
- (while (prog2 (beginning-of-line)
- (if (eq folding-shift-in-on-goto 'show)
- (progn
- (folding-show-current-entry t t)
- (folding-point-folded-p goal))
- (folding-shift-in t))
- (goto-char goal)))
- (folding-narrow-to-region
- (and folding-narrow-by-default (point-min))
- (point-max) t)))
- (if (or folding-stack (folding-point-folded-p (point)))
- (folding-open-buffer))))))))
-
-;;}}}
-
-(defun folding-bind-foldout-compatible-keys ()
- "Bind keys for `folding-mode' compatible with Foldout mode.
-
-The variable `folding-mode-prefix-key' contains the prefix keys,
-the default is C - c @."
- (interactive)
- (folding-kbd "\C-z" 'folding-shift-in)
- (folding-kbd "\C-x" 'folding-shift-out))
-
-;;; This function is here, just in case we ever would like to add
-;;; `hideif' support to folding mode. Currently, it is only used to
-;;; which keys shouldn't be used.
-
-;;(defun folding-bind-hideif-compatible-keys ()
-;; "Bind keys for `folding-mode' compatible with Hideif mode.
-;;
-;;The variable `folding-mode-prefix-key' contains the prefix keys,
-;;the default is C-c@."
-;; (interactive)
-;; ;; Keys defined by `hideif'
-;; ;; (folding-kbd "d" 'hide-ifdef-define)
-;; ;; (folding-kbd "u" 'hide-ifdef-undef)
-;; ;; (folding-kbd "D" 'hide-ifdef-set-define-alist)
-;; ;; (folding-kbd "U" 'hide-ifdef-use-define-alist)
-;;
-;; ;; (folding-kbd "h") 'hide-ifdefs)
-;; ;; (folding-kbd "s") 'show-ifdefs)
-;; ;; (folding-kbd "\C-d") 'hide-ifdef-block)
-;; ;; (folding-kbd "\C-s") 'show-ifdef-block)
-;;
-;; ;; (folding-kbd "\C-q" 'hide-ifdef-toggle-read-only)
-;; )
-
-;;; .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .
-
-;; Not used for modern Emacsen.
-(defvar folding-saved-local-keymap nil
- "Keymap used to save non-folding keymap.
-(so it can be restored when folding mode is turned off.)")
-
-;;;###autoload
-(defcustom folding-default-keys-function 'folding-bind-default-keys
- "*Function or list of functions used to define keys for Folding mode.
-Possible values are:
- folding-bind-default-key
- The standard keymap.
-
- `folding-bind-backward-compatible-keys'
- Keys used by older versions of Folding mode. This function
- does not conform to Emacs 19.29 style conversions concerning
- key bindings. The prefix key is C - c
-
- `folding-bind-outline-compatible-keys'
- Define keys compatible with Outline mode.
-
- `folding-bind-foldout-compatible-keys'
- Define some extra keys compatible with Foldout.
-
-All except `folding-bind-backward-compatible-keys' used the value of
-the variable `folding-mode-prefix-key' as prefix the key.
-The default is C - c @"
- :type 'function
- :group 'folding)
-
-;; Not yet implemented:
-;; folding-bind-hideif-compatible-keys
-;; Define some extra keys compatible with hideif.
-
-;;;###autoload
-(defcustom folding-default-mouse-keys-function 'folding-bind-default-mouse
- "*Function to bind default mouse keys to `folding-mode-map'."
- :type 'function
- :group 'folding)
-
-(defvar folding-mode-menu nil
- "Keymap containing the menu for Folding mode.")
-
-(defvar folding-mode-menu-name "Fld" ;; Short menu name
- "Name of pull down menu.")
-
-;;}}}
-;;{{{ setup: hooks
-
-;;; ......................................................... &v-hooks ...
-
-(defcustom folding-mode-hook nil
- "*Hook called when Folding mode is entered.
-
-A hook named `<major-mode>-folding-hook' is also called, if it
-exists. Eg., `c-mode-folding-hook' is called whenever Folding mode is
-started in C mode."
- :type 'hook
- :group 'folding)
-
-(defcustom folding-load-hook nil
- "*Hook run when file is loaded."
- :type 'hook
- :group 'folding)
-
-;;}}}
-;;{{{ setup: user config
-
-;;; ........................................................ &v-Config ...
-
-;; Q: should this inherit mouse-yank-at-point's value? maybe not.
-(defvar folding-mouse-yank-at-point t
- "If non-nil, mouse activities are done at point instead of 'mouse cursor'.
-Behaves like `mouse-yank-at-point'.")
-
-(defcustom folding-folding-on-startup t
- "*If non-nil, buffers are folded when starting Folding mode."
- :type 'boolean
- :group 'folding)
-
-(defcustom folding-internal-margins 1
- "*Number of blank lines left next to fold mark when tidying folds.
-
-This variable is local to each buffer. To set the default value for all
-buffers, use `set-default'.
-
-When exiting a fold, and at other times, `folding-tidy-inside' is invoked
-to ensure that the fold is in the correct form before leaving it. This
-variable specifies the number of blank lines to leave between the
-enclosing fold marks and the enclosed text.
-
-If this value is nil or negative, no blank lines are added or removed
-inside the fold marks. A value of 0 (zero) is valid, meaning leave no
-blank lines.
-
-See also `folding-tidy-inside'."
- :type 'boolean
- :group 'folding)
-
-(make-variable-buffer-local 'folding-internal-margins)
-
-(defvar folding-mode-string " Fld"
- "Buffer-local variable that hold the fold depth description.")
-
-(set-default 'folding-mode-string " Fld")
-
-;; Sets `folding-mode-string' appropriately. This allows the Folding mode
-;; description in the mode line to reflect the current fold depth.
-
-(defconst folding-inside-string " " ; was ' inside ',
- "Mode line addition to show 'inside' levels of fold.")
-
-;;;###autoload
-(defcustom folding-inside-mode-name "Fld"
- "*Mode line addition to show inside levels of 'fold' ."
- :type 'string
- :group 'folding)
-
-(defcustom folding-check-folded-file-function
- 'folding-check-folded
- "*Function that return t or nil after examining if the file is folded."
- :type 'function
- :group 'folding)
-
-(defcustom folding-check-allow-folding-function
- 'folding-check-if-folding-allowed
- "*Function that return t or nil after deciding if automatic folding."
- :type 'function
- :group 'folding)
-
-;;;###autoload
-(defcustom folding-mode-string "Fld"
- "*The minor mode string displayed when mode is on."
- :type 'string
- :group 'folding)
-
-;;;###autoload
-(defcustom folding-mode-hook-no-regexp "RMAIL"
- "*Regexp which disable automatic folding mode turn on for certain files."
- :type 'string
- :group 'folding)
-
-;;; ... ... ... ... ... ... ... ... ... ... ... ... ... .... &v-tables ...
-
-(defcustom folding-behave-table
- '((close folding-hide-current-entry)
- (open folding-show-current-entry) ; Could also be `folding-shift-in'.
- (up folding-shift-out)
- (other folding-mouse-call-original))
- "*Table of of logical commands and their associated functions.
-If you want fold to behave like `folding-shift-in', when it 'open'
-a fold, you just change the function entry in this table.
-
-Table form:
- '( (LOGICAL-ACTION CMD) (..) ..)"
- :type '(repeat
- (symbol :tag "logical action")
- (function :tag "callback"))
- :group 'folding)
-
-;;; ... ... ... ... ... ... ... ... ... ... ... ... ... ..... &v-marks ...
-
-;;;###autoload
-(defvar folding-mode-marks-alist nil
- "List of (major-mode . fold mark) default combinations to use.
-When Folding mode is started, the major mode is checked, and if there
-are fold marks for that major mode stored in `folding-mode-marks-alist',
-those marks are used by default. If none are found, the default values
-of \"{{{ \" and \"}}}\" are used.
-
-Use function `folding-add-to-marks-list' to add more fold marks. The function
-also explains the alist use in details.
-
-Use function `folding-set-local-variables' if you change the current mode's
-folding marks during the session.")
-
-;;}}}
-;;{{{ setup: private
-
-;;; ....................................................... &v-private ...
-
-(defvar folding-narrow-placeholder nil
- "Internal. Mark where \"%n\" used to be in `mode-line-format'.
-Must be nil.")
-
-(defvar folding-bottom-mark nil
- "Internal marker of the true bottom of a fold.")
-
-(defvar folding-bottom-regexp nil
- "Internal. Regexp marking the bottom of a fold.")
-
-(defvar folding-regexp nil
- "Internal. Regexp for hunting down the `folding-top-mark' even in comments.")
-
-(defvar folding-secondary-top-mark nil
- "Internal. Additional stuff that can be inserted as part of a top marker.")
-
-(defvar folding-top-mark nil
- "Internal. The actual string marking the top of a fold.")
-
-(defvar folding-top-regexp nil
- "Internal.
-Regexp describing the string beginning a fold, possible with
-leading comment thingies and like that.")
-
-(defvar folded-file nil
- "Enter folding mode when this file is loaded.
-(buffer local, use from a local variables list).")
-
-(defvar folding-calling-original nil
- "Internal. Non-nil when original mouse binding is executed.")
-
-(defvar folding-narrow-overlays nil
- "Internal. Keep the list of overlays.")
-(make-variable-buffer-local 'folding-narrow-overlays)
-
-(defcustom folding-allow-overlays nil
- "*If non-nil use overlay code. If nil, then selective display is used.
-Note, that this code is highly experimental and will not most likely do what
-you expect. using value t will not change folding to use overlays
-completely. This variable was introduced to experiment with the overlay
-interface, but the work never finished and it is unlikely that it
-will continued any later time. Folding at present state is designed
-too highly for selective display to make the change worthwhile."
- :type 'boolean
- :group 'folding)
-
-;;}}}
-;;{{{ Folding install
-
-(defun folding-easy-menu-define ()
- "Define folding easy menu."
- (interactive)
- (easy-menu-define
- folding-mode-menu
- (if folding-xemacs-p
- nil
- (list folding-mode-map))
- "Folding menu"
- (list
- folding-mode-menu-name
- ["Enter Fold" folding-shift-in t]
- ["Exit Fold" folding-shift-out t]
- ["Show Fold" folding-show-current-entry t]
- ["Hide Fold" folding-hide-current-entry t]
- "----"
- ["Show Whole Buffer" folding-open-buffer t]
- ["Fold Whole Buffer" folding-whole-buffer t]
- ["Show subtree" folding-show-current-subtree t]
- ["Hide subtree" folding-hide-current-subtree t]
- ["Display fold name" folding-display-name t]
- "----"
- ["Move previous" folding-previous-visible-heading t]
- ["Move next" folding-next-visible-heading t]
- ["Pick fold" folding-pick-move t]
- ["Next action (context)" folding-context-next-action t]
- "----"
- ["Foldify region" folding-fold-region t]
- ["Open or close folds in region" folding-region-open-close t]
- ["Open folds to top level" folding-show-all t]
- "----"
- ["Comment text in fold" folding-comment-fold t]
- ["Convert for printing(temp buffer)"
- folding-convert-buffer-for-printing t]
- ["Convert to major-mode folds" folding-convert-to-major-folds t]
- ["Move comments inside folds in region"
- folding-all-comment-blocks-in-region t]
- ["Delete fold marks in this fold" folding-marks-kill t]
- ["Insert folding URL reference"
- folding-insert-advertise-folding-mode t]
- "----"
- ["Toggle enter and exit mode" folding-toggle-enter-exit t]
- ["Toggle show and hide" folding-toggle-show-hide t]
- "----"
- ["Folding mode off" folding-mode t])))
-
-(defun folding-install-keymaps ()
- "Install keymaps."
- (unless folding-mode-map
- (setq folding-mode-map (make-sparse-keymap)))
- (unless folding-mode-prefix-map
- (setq folding-mode-prefix-map (make-sparse-keymap)))
- (if (listp folding-default-keys-function)
- (mapcar 'funcall folding-default-keys-function)
- (funcall folding-default-keys-function))
- (funcall folding-default-mouse-keys-function)
- (folding-easy-menu-define)
- (define-key folding-mode-map
- folding-mode-prefix-key folding-mode-prefix-map)
- ;; Install the keymap into `minor-mode-map-alist'. The keymap will
- ;; be activated as soon as the variable `folding-mode' is set to
- ;; non-nil.
- (let ((elt (assq 'folding-mode minor-mode-map-alist)))
- ;; Always remove old map before adding new definitions.
- (if elt
- (setq minor-mode-map-alist
- (delete elt minor-mode-map-alist)))
- (push (cons 'folding-mode folding-mode-map) minor-mode-map-alist))
- ;; Update minor-mode-alist
- (or (assq 'folding-mode minor-mode-alist)
- (push '(folding-mode folding-mode-string) minor-mode-alist))
- ;; Needed for XEmacs
- (or (fboundp 'buffer-disable-undo)
- (fset 'buffer-disable-undo (symbol-function 'buffer-flush-undo))))
-
-(defun folding-uninstall-keymaps ()
- "Uninstall keymaps."
- (let ((elt (assq 'folding-mode minor-mode-map-alist)))
- (if elt
- (setq minor-mode-map-alist
- (delete elt minor-mode-map-alist)))
- (if (setq elt (assq 'folding-mode minor-mode-alist))
- (setq minor-mode-alist
- (delete elt minor-mode-alist)))
- (folding-uninstall-hooks)))
-
-(defun folding-install (&optional uninstall)
- "Install or UNINSTALL folding."
- (interactive "P")
- (cond
- (uninstall
- (folding-uninstall-keymaps)
- (folding-uninstall-hooks))
- (t
- (folding-install-keymaps))))
-
-(defun folding-uninstall ()
- "Uninstall folding."
- (interactive)
- (folding-install 'uninstall)
- ;; Unwrap all buffers.
- (dolist (buffer (buffer-list))
- (with-current-buffer buffer
- (goto-char (point-min))
- (when (or folding-mode
- ;; To be sure, check this at the same time
- ;; Somebody may have just done
- ;; (setq folding-mode nil), which is bad thing.
- ;; Setting variable won't restore the buffer.
- (re-search-forward "{{{" nil t))
- (turn-off-folding-mode)))))
-
-;;}}}
-;;{{{ code: misc
-
-(defsubst folding-get-mode-marks (&optional mode)
- "Return fold markers for MODE. default is for current `major-mode'.
-
-Return:
- \(beg-marker end-marker\)"
- (interactive)
- (let* (elt)
- (unless (setq elt (assq (or mode major-mode)
- folding-mode-marks-alist))
- (error "Folding error: mode is not in `folding-mode-marks-alist'"))
- (list (nth 1 elt) (nth 2 elt) (nth 3 elt))))
-
-(defun folding-region-has-folding-marks-p (beg end)
- "Check is there is fold mark in region BEG END."
- (save-excursion
- (goto-char beg)
- (when (memq (folding-mark-look-at) '(1 11))
- (goto-char end)
- (memq (folding-mark-look-at) '(end end-in)))))
-
-;;; - Thumb rule: because "{{{" if more meaningful, all returns values
-;;; are of type integerp if it is found.
-;;;
-(defun folding-mark-look-at (&optional mode)
- "Check status of current line. Does it contain a fold mark?.
-
-MODE
-
- 'move move over fold mark
-
-Return:
-
- 0 1 numberp, line has fold begin mark
- 0 = closed, 1 = open,
- 11 = open, we're inside fold, and this is top marker
-
- 'end end mark
-
- 'end-in end mark, inside fold, floor marker
-
- nil no fold marks .."
- (let* (case-fold-search
- (marks (folding-get-mode-marks))
- (stack folding-stack)
- (bm (regexp-quote (nth 0 marks))) ;begin mark
- (em (concat "^[ \t\n]*" (regexp-quote (nth 1 marks))))
- (bm-re (concat
- (concat "^[ \t\n]*" bm)
- (if (and nil
- (string=
- " " (substring (nth 0 marks)
- (length (nth 1 marks)))))
- ;; Like "}}} *"
- "*"
- "")))
- ret
- point)
- (save-excursion
- (beginning-of-line)
- (cond
- ((looking-at bm-re)
- (setq point (point))
- (cond
- ((looking-at (concat "^[ \t\n]*" bm "[^\r\n]*\r")) ;; closed
- (setq ret 0))
- (t ;; open fold marker
- (goto-char (point-min))
- (cond
- ((and stack ;; we're inside fold
- ;; allow spaces
- (looking-at (concat "[ \t\n]*" bm)))
- (setq ret 11))
- (t
- (setq ret 1))))))
- ((looking-at em)
- (setq point (point))
- ;; - The stack is a list if we've entered inside fold. There
- ;; is no text after fold END mark
- ;; - At bol ".*\n[^\n]*" doesn't work but "\n[^\n]*" at eol does??
- (cond
- ((progn
- (end-of-line)
- (or (and stack (eobp)) ;normal ending
- (and stack ;empty newlines only, no text ?
- (not (looking-at "\n[^ \t\n]*")))))
- (setq ret 'end-in))
- (t ;all rest are newlines
- (setq ret 'end))))))
- (cond
- ((and mode point)
- (goto-char point)
- ;; This call breaks if there is no marks on the point,
- ;; because there is no parameter 'nil t' in call.
- ;; --> there is error in this function if that happens.
- (beginning-of-line)
- (re-search-forward (concat bm "\\|" em))
- (backward-char 1)))
- ret))
-
-(defsubst folding-mark-look-at-top-mark-p ()
- "Check if line contain folding top marker."
- (integerp (folding-mark-look-at)))
-
-(defsubst folding-mark-look-at-bottom-mark-p ()
- "Check if line contain folding bottom marker."
- (symbolp (folding-mark-look-at)))
-
-(defun folding-act (action &optional event)
- "Execute logical ACTION based on EVENT.
-
-References:
- `folding-behave-table'"
- (let* ((elt (assoc action folding-behave-table)))
- (if elt
- (funcall (nth 1 elt) event)
- (error "Folding mode (folding-act): Unknown action %s" action))))
-
-(defun folding-region-open-close (beg end &optional close)
- "Open all folds inside region BEG END. Close if optional CLOSE is non-nil."
- (interactive "r\nP")
- (let* ((func (if (null close)
- 'folding-show-current-entry
- 'folding-hide-current-entry))
- tmp)
- (save-excursion
- ;; make sure the beg is first.
- (if (> beg end) ;swap order
- (setq tmp beg beg end end tmp))
- (goto-char beg)
- (while (and
- ;; the folding-show-current-entry/hide will move point
- ;; to beg-of-line So we must move to the end of
- ;; line to continue search.
- (if (and close
- (eq 0 (folding-mark-look-at))) ;already closed ?
- t
- (funcall func)
- (end-of-line)
- t)
- (folding-next-visible-heading)
- (< (point) end))))))
-
-(defun fold-marks-kill ()
- "If over fold, open fold and kill beginning and end fold marker.
-Return t ot nil if marks were removed."
- (interactive)
- (if (not (folding-mark-look-at))
- (when (interactive-p)
- (message "Folding: Cursor not over fold. Can't remove fold marks.")
- nil)
- (destructuring-bind (beg end)
- (folding-show-current-entry)
- (let ((kill-whole-line t))
- ;; must be done in this order, because point moves after kill.
- (goto-char end)
- (beginning-of-line)
- (kill-line)
- (goto-char beg)
- (beginning-of-line)
- (kill-line)
- ;; Return status
- t))))
-
-(defun folding-hide-current-subtree ()
- "Call `folding-show-current-subtree' with argument 'hide."
- (interactive)
- (folding-show-current-subtree 'hide))
-
-(defun folding-show-current-subtree (&optional hide)
- "Show or HIDE all folds inside current fold.
-Point must be over beginning fold mark."
- (interactive "P")
- (let* ((stat (folding-mark-look-at 'move))
- (beg (point))
- end)
- (cond
- ((memq stat '(0 1 11)) ;It's BEG fold
- (when (eq 0 stat) ;it was closed
- (folding-show-current-entry)
- (goto-char beg)) ;folding-pick-move needs point at fold
- (save-excursion
- (if (folding-pick-move)
- (setq end (point))))
- (if (and beg end)
- (folding-region-open-close beg end hide)))
- (t
- (if (interactive-p)
- (message "point is not at fold beginning."))))))
-
-(defun folding-display-name ()
- "Show current active fold name."
- (interactive)
- (let* ((pos (folding-find-folding-mark))
- name)
- (when pos
- (save-excursion
- (goto-char pos)
- (if (looking-at ".*[{]+") ;Drop "{" mark away.
- (setq pos (match-end 0)))
- (setq name (buffer-substring
- pos
- (progn
- (end-of-line)
- (point))))))
- (if name
- (message (format "fold:%s" name)))))
-
-;;}}}
-;;{{{ code: events
-
-(defun folding-event-posn (act event)
- "According to ACT read mouse EVENT struct and return data from it.
-Event must be simple click, no dragging.
-
-ACT
- 'mouse-point return the 'mouse cursor' point
- 'window return window pointer
- 'col-row return list (col row)"
- (cond
- ((not folding-xemacs-p)
- ;; short Description of FSF mouse event
- ;;
- ;; EVENT : (mouse-3 (#<window 34 on *scratch*> 128 (20 . 104) -23723628))
- ;; event-start : (#<window 34 on *scratch*> 128 (20 . 104) -23723628))
- ;; ^^^MP
- ;; mp = mouse point
- (let* ((el (funcall (symbol-function 'event-start) event)))
- (cond
- ((eq act 'mouse-point)
- (nth 1 el)) ;is there macro for this ?
- ((eq act 'window)
- (funcall (symbol-function 'posn-window) el))
- ((eq act 'col-row)
- (funcall (symbol-function 'posn-col-row) el))
- (t
- (error "Unknown request" act)))))
-
- (folding-xemacs-p
- (cond
- ((eq act 'mouse-point)
- (funcall (symbol-function 'event-point) event))
- ((eq act 'window)
- (funcall (symbol-function 'event-window) event))
- ;; Must be tested! (However, it's not used...)
- ((eq act 'col-row)
- (list (funcall (symbol-function 'event-x) event)
- (funcall (symbol-function 'event-y) event)))
- (t
- (error "Unknown request" act))))
- (t
- (error "This version of Emacs can't handle events."))))
-
-(defmacro folding-interactive-spec-p ()
- "Preserve region during `interactive'.
-In XEmacs user could also set `zmacs-region-stays'."
- (if folding-xemacs-p
- ;; preserve selected region
- `'(interactive "_p")
- `'(interactive "p")))
-
-(defmacro folding-mouse-yank-at-p ()
- "Check if user use \"yank at mouse point\" feature.
-
-Please see the variable `folding-mouse-yank-at-point'."
- 'folding-mouse-yank-at-point)
-
-(defun folding-mouse-point (&optional event)
- "Return mouse's working point. Optional EVENT is mouse click.
-When used on XEmacs, return nil if no character was under the mouse."
- (if (or (folding-mouse-yank-at-p)
- (null event))
- (point)
- (folding-event-posn 'mouse-point event)))
-
-;;}}}
-
-;;{{{ code: hook
-
-(defun folding-is-hooked ()
- "Check if folding hooks are installed."
- (and (memq 'folding-mode-write-file write-file-hooks)
- (memq 'folding-mode-find-file find-file-hooks)))
-
-;;;###autoload
-(defun folding-uninstall-hooks ()
- "Remove hooks set by folding."
- (turn-off-folding-mode)
- (remove-hook 'finder-mode-hook 'folding-mode)
- (remove-hook 'write-file-hooks 'folding-mode-write-file)
- (remove-hook 'find-file-hooks 'folding-mode-find-file))
-
-;;;###autoload
-(defun folding-install-hooks ()
- "Install folding hooks."
- (folding-mode-add-find-file-hook)
- (add-hook 'finder-mode-hook 'folding-mode)
- (or (memq 'folding-mode-write-file write-file-hooks)
- (add-hook 'write-file-hooks 'folding-mode-write-file 'end)))
-
-;;;###autoload
-(defun folding-keep-hooked ()
- "Make sure hooks are in their places."
- (unless (folding-is-hooked)
- (folding-uninstall-hooks)
- (folding-install-hooks)))
-
-;;}}}
-;;{{{ code: Mouse handling
-
-(defun folding-mouse-call-original (&optional event)
- "Execute original mouse function using mouse EVENT.
-
-Do nothing if original function does not exist.
-
-Does nothing when called by a function which has earlier been called
-by us.
-
-Sets global:
- `folding-calling-original'"
- (interactive "@e") ;; Was "e"
- ;; Without the following test we could easily end up in a endless
- ;; loop in case we would call a function which would call us.
- ;;
- ;; (An easy constructed example is to bind the function
- ;; `folding-mouse-context-sensitive' to the same mouse button both in
- ;; `folding-mode-map' and in the global map.)
- (if folding-calling-original
- nil
- ;; `folding-calling-original' is global
- (setq folding-calling-original t)
- (unwind-protect
- (progn
- (or event
- (setq event last-input-event))
- (let (mouse-key)
- (cond
- ((not folding-xemacs-p)
- (setq mouse-key (make-vector 1 (car-safe event))))
- (folding-xemacs-p
- (setq mouse-key
- (vector
- (append
- (event-modifiers event)
- (list (intern
- (format "button%d"
- (funcall
- (symbol-function 'event-button)
- event))))))))
- (t
- (error "This version of Emacs can't handle events.")))
- ;; Test string: http://www.csd.uu.se/~andersl
- ;; andersl A T csd uu se
- ;; (I have `ark-goto-url' bound to the same key as
- ;; this function.)
- ;;
- ;; turn off folding, so that we can see the real
- ;; function behind it.
- ;;
- ;; We have to restore the current buffer, otherwise the
- ;; let* won't be able to restore the old value of
- ;; folding-mode. In my environment, I have bound a
- ;; function which starts mail when I click on an e-mail
- ;; address. When returning, the current buffer has
- ;; changed.
- (let* ((folding-mode nil)
- (orig-buf (current-buffer))
- (orig-func (key-binding mouse-key)))
- ;; call only if exist
- (when orig-func
- ;; Check if the original function has arguments. If
- ;; it does, call it with the event as argument.
- (unwind-protect
- (progn
- (setq this-command orig-func)
- (call-interactively orig-func))
-;;; #untested, but included here for further reference
-;;; (cond
-;;; ((not (string-match "mouse" (symbol-name orig-func)))
-;;; (call-interactively orig-func))
-;;; ((string-match "^mouse" (symbol-name orig-func))
-;;; (funcall orig-func event))
-;;; (t
-;;; ;; Some other package's mouse command,
-;;; ;; should we do something special here for
-;;; ;; somebody?
-;;; (funcall orig-func event)))
- (set-buffer orig-buf))))))
- ;; This is always executed, even if the above generates an error.
- (setq folding-calling-original nil))))
-
-(defun folding-mouse-context-sensitive (event)
- "Perform some operation depending on the context of the mouse pointer.
-EVENT is mouse event.
-
-The variable `folding-behave-table' contains a mapping between contexts and
-operations to perform.
-
-The following contexts can be handled (They are named after the
-natural operation to perform on them):
-
- open - A folded fold.
- close - An open fold, which isn't the one current topmost one.
- up - The topmost visible fold.
- other - Anything else.
-
-Note that the `pointer' can be either the buffer point, or the mouse
-pointer depending in the setting of the user option
-`folding-mouse-yank-at-point'."
- (interactive "e")
- (let* ( ;; - Get mouse cursor point, or point
- (point (folding-mouse-point event))
- state)
- (if (null point)
- ;; The user didn't click on any text.
- (folding-act 'other event)
- (save-excursion
- (goto-char point)
- (setq state (folding-mark-look-at)))
- (cond
- ((eq state 0)
- (folding-act 'open event))
- ((eq state 1)
- (folding-act 'close event))
- ((eq state 11)
- (folding-act 'up event))
- ((eq 'end state)
- (folding-act 'close))
- ((eq state 'end-in)
- (folding-act 'up event))
- (t
- (folding-act 'other event))))))
-
-;;; FIXME: #not used, the pick move handles this too
-(defun folding-mouse-move (event)
- "Move down if sitting on fold mark using mouse EVENT.
-
-Original function behind the mouse is called if no FOLD action wasn't
-taken."
- (interactive "e")
- (let* ( ;; - Get mouse cursor point, or point
- (point (folding-mouse-point event))
- state)
- (save-excursion
- (goto-char point)
- (beginning-of-line)
- (setq state (folding-mark-look-at)))
- (cond
- ((not (null state))
- (goto-char point)
- (folding-next-visible-heading) t)
- (t
- (folding-mouse-call-original event)))))
-
-(defun folding-mouse-pick-move (event)
- "Pick movement if sitting on beg/end fold mark using mouse EVENT.
-If mouse if at the `beginning-of-line' point, then always move up.
-
-Original function behind the mouse is called if no FOLD action wasn't
-taken."
- (interactive "e")
- (let* ( ;; - Get mouse cursor point, or point
- (point (folding-mouse-point event))
- state)
- (save-excursion
- (goto-char point)
- (setq state (folding-mark-look-at)))
- (cond
- ((not (null state))
- (goto-char point)
- (if (= point
- (save-excursion (beginning-of-line) (point)))
- (folding-previous-visible-heading)
- (folding-pick-move)))
- (t
- (folding-mouse-call-original event)))))
-
-;;}}}
-;;{{{ code: engine
-
-(defun folding-set-mode-line ()
- "Update modeline with fold level."
- (if (null folding-stack)
- (kill-local-variable 'folding-mode-string)
- (make-local-variable 'folding-mode-string)
- (setq folding-mode-string
- (if (eq 'folded (car folding-stack))
- (concat
- folding-inside-string "1" folding-inside-mode-name)
- (concat
- folding-inside-string
- (int-to-string (length folding-stack))
- folding-inside-mode-name)))))
-
-(defun folding-clear-stack ()
- "Clear the fold stack, and release all the markers it refers to."
- (let ((stack folding-stack))
- (setq folding-stack nil)
- (while (and stack (not (eq 'folded (car stack))))
- (set-marker (car (car stack)) nil)
- (set-marker (cdr (car stack)) nil)
- (setq stack (cdr stack)))))
-
-(defun folding-check-if-folding-allowed ()
- "Return non-nil when buffer allowed to be folded automatically.
-When buffer is loaded it may not be desirable to fold it immediately,
-because the file may be too large, or it may contain fold marks, that
-really are not _real_ folds. (Eg. RMAIL saved files may have the
-marks)
-
-This function returns t, if it's okay to proceed checking the fold status
-of file. Returning nil means that folding should not touch this file.
-
-The variable `folding-check-allow-folding-function' normally contains this
-function. Change the variable to use your own scheme."
-
- (or (let ((file (get 'find-file-noselect 'folding)))
- ;; When a file reference is "pushed" is a C-h v buffer that says:
- ;; test is a Lisp function in `~/foo/tmp/test.el' A flag gets set
- ;; (see adviced code) and we must not fold this buffer, because
- ;; it will be immediately searched.
- (and file
- (not (string-match (regexp-quote file)
- (or buffer-file-name "")))))
- ;; Do not fold these files
- (null (string-match folding-mode-hook-no-regexp (buffer-name)))))
-
-(defun folding-mode-find-file ()
- "One of the funcs called whenever a `find-file' is successful.
-It checks to see if `folded-file' has been set as a buffer-local
-variable, and automatically starts Folding mode if it has.
-
-This allows folded files to be automatically folded when opened.
-
-To make this hook effective, the symbol `folding-mode-find-file-hook'
-should be placed at the end of `find-file-hooks'. If you have
-some other hook in the list, for example a hook to automatically
-uncompress or decrypt a buffer, it should go earlier on in the list.
-
-See also `folding-mode-add-find-file-hook'."
- (let* ((check-fold folding-check-folded-file-function)
- (allow-fold folding-check-allow-folding-function))
- ;; Turn mode on only if it's allowed
- (if (funcall allow-fold)
- (or (and (and check-fold (funcall check-fold))
- (folding-mode 1))
- (and (assq 'folded-file (buffer-local-variables))
- folded-file
- (folding-mode 1)
- (kill-local-variable 'folded-file)))
- ;; In all other cases, unfold buffer.
- (if folding-mode
- (folding-mode -1)))))
-
-;;;###autoload
-(defun folding-mode-add-find-file-hook ()
- "Append `folding-mode-find-file-hook' to the list `find-file-hooks'.
-
-This has the effect that afterwards, when a folded file is visited, if
-appropriate Emacs local variable entries are recognized at the end of
-the file, Folding mode is started automatically.
-
-If `inhibit-local-variables' is non-nil, this will not happen regardless
-of the setting of `find-file-hooks'.
-
-To declare a file to be folded, put `folded-file: t' in the file's
-local variables. eg., at the end of a C source file, put:
-
-/*
-Local variables:
-folded-file: t
-*/
-
-The local variables can be inside a fold."
- (interactive)
- (or (memq 'folding-mode-find-file find-file-hooks)
- (add-hook 'find-file-hooks 'folding-mode-find-file 'end)))
-
-(defun folding-mode-write-file ()
- "Folded files must be controlled by folding before saving.
-This function turns on the folding mode if it is not activated.
-It prevents 'binary pollution' upon save."
- (let* ((check-func folding-check-folded-file-function)
- (no-re folding-mode-hook-no-regexp)
- (bn (or (buffer-name) "")))
- (if (and (not (string-match no-re bn))
- (boundp 'folding-mode)
- (null folding-mode)
- (and check-func (funcall check-func)))
- (progn
- ;; When folding mode is turned on it also 'folds' whole
- ;; buffer... can't avoid that, since it's more important
- ;; to save safely
- (folding-mode 1)))
- ;; hook returns nil, good habit
- nil))
-
-(defun folding-check-folded ()
- "Function to determine if this file is in folded form."
- (let* ( ;; Could use folding-top-regexp , folding-bottom-regexp ,
- ;; folding-regexp But they are not available at load time.
- (folding-re1 "^.?.?.?{{{")
- (folding-re2 "[\r\n].*}}}"))
- (save-excursion
- (goto-char (point-min))
- ;; If we found both, we assume file is folded
- (and (re-search-forward folding-re1 nil t)
- ;; if file is folded, there are \r's
- (search-forward "\r" nil t)
- (re-search-forward folding-re2 nil t)))))
-
-;;}}}
-
-;;{{{ code: Folding mode
-
-(defun folding-font-lock-keywords (&optional mode)
- "Return folding font-lock keywords for MODE."
- ;; Add support mode-by-mode basis. Check if mode is already
- ;; handled from the property list.
- (destructuring-bind (beg end ignore)
- (folding-get-mode-marks (or mode major-mode))
- (setq beg (concat "^[ \t]*" (regexp-quote beg) "[^\r\n]+"))
- (setq end (concat "^[ \t]*" (regexp-quote end)))
- (list
- ;; the `t' says to overwrite any previous highlight.
- ;; => Needed because folding marks are in comments.
- (list beg 0 folding-font-lock-begin-mark t)
- (list end 0 folding-font-lock-end-mark t))))
-
-(defun folding-font-lock-support-instantiate (&optional mode)
- "Add fold marks with `font-lock-add-keywords'."
- (or mode
- (setq mode major-mode))
- ;; Hide function from Byte Compiler.
- (let ((function 'font-lock-add-keywords))
- (when (fboundp function)
- (funcall function
- mode
- (folding-font-lock-keywords mode))
- ;; In order to see new keywords font lock must be restarted.
- (dolist (buffer (buffer-list))
- (with-current-buffer buffer
- (when (and (eq major-mode mode)
- (or font-lock-mode
- ;; Hide variable from byte compiler.
- (let ((sym 'global-font-lock-mode))
- (and (boundp sym)
- (symbol-value sym)))))
- ;; FIXME: should we use font-lock-fontify-buffer instead?
- (font-lock-mode -1)
- (font-lock-mode 1)))))))
-
-(defun folding-font-lock-support ()
- "Add font lock support."
- (let ((list (get 'folding-mode 'font-lock)))
- (unless (memq major-mode list)
- ;; Support added, update known list
- (push major-mode list)
- (put 'folding-mode 'font-lock list)
- (folding-font-lock-support-instantiate major-mode))))
-
-(defun folding-set-local-variables ()
- "Set local fold mark variables.
-If you're going to change the beginning and end mark in
-`folding-mode-marks-alist'; you must call this function."
- (set (make-local-variable 'folding-stack) nil)
- (make-local-variable 'folding-top-mark)
- (make-local-variable 'folding-secondary-top-mark)
- (make-local-variable 'folding-top-regexp)
- (make-local-variable 'folding-bottom-mark)
- (make-local-variable 'folding-bottom-regexp)
- (make-local-variable 'folding-regexp)
- (or (and (boundp 'folding-top-regexp)
- folding-top-regexp
- (boundp 'folding-bottom-regexp)
- folding-bottom-regexp)
- (let ((folding-marks (assq major-mode
- folding-mode-marks-alist)))
- (if folding-marks
- (setq folding-marks (cdr folding-marks))
- (setq folding-marks '("{{{" "}}}")))
- (apply 'folding-set-marks folding-marks))))
-
-;;;###autoload
-(defun turn-off-folding-mode ()
- "Turn off folding."
- (folding-mode -1))
-
-;;;###autoload
-(defun turn-on-folding-mode ()
- "Turn on folding."
- (folding-mode 1))
-
-;;;###autoload
-(defun folding-mode (&optional arg inter)
- "A folding-editor-like minor mode. ARG INTER.
-
-These are the basic commands that Folding mode provides:
-
-\\{folding-mode-map}
-
-Keys starting with `folding-mode-prefix-key'
-
-\\{folding-mode-prefix-map}
-
- folding-convert-buffer-for-printing:
- `\\[folding-convert-buffer-for-printing]'
- Makes a ready-to-print, formatted, unfolded copy in another buffer.
-
- Read the documentation for the above functions for more information.
-
-Overview
-
- Folds are a way of hierarchically organizing the text in a file, so
- that the text can be viewed and edited at different levels. It is
- similar to Outline mode in that parts of the text can be hidden from
- view. A fold is a region of text, surrounded by special \"fold marks\",
- which act like brackets, grouping the text. Fold mark pairs can be
- nested, and they can have titles. When a fold is folded, the text is
- hidden from view, except for the first line, which acts like a title
- for the fold.
-
- Folding mode is a minor mode, designed to cooperate with many other
- major modes, so that many types of text can be folded while they are
- being edited (eg., plain text, program source code, Texinfo, etc.).
-
-Folding-mode function
-
- If Folding mode is not called interactively (`(interactive-p)' is nil),
- and it is called with two or less arguments, all of which are nil, then
- the point will not be altered if `folding-folding-on-startup' is set
- and `folding-whole-buffer' is called. This is generally not a good
- thing, as it can leave the point inside a hidden region of a fold, but
- it is required if the local variables set \"mode: folding\" when the
- file is first read (see `hack-local-variables').
-
- Not that you should ever want to, but to call Folding mode from a
- program with the default behavior (toggling the mode), call it with
- something like `(folding-mode nil t)'.
-
-Fold marks
-
- For most types of folded file, lines representing folds have \"{{{\"
- near the beginning. To enter a fold, move the point to the folded line
- and type `\\[folding-shift-in]'. You should no longer be able to see
- the rest of the file, just the contents of the fold, which you couldn't
- see before. You can use `\\[folding-shift-out]' to leave a fold, and
- you can enter and exit folds to move around the structure of the file.
-
- All of the text is present in a folded file all of the time. It is just
- hidden. Folded text shows up as a line (the top fold mark) with \"...\"
- at the end. If you are in a fold, the mode line displays \"inside n
- folds Narrow\", and because the buffer is narrowed you can't see outside
- of the current fold's text.
-
- By arranging sections of a large file in folds, and maybe subsections
- in sub-folds, you can move around a file quickly and easily, and only
- have to scroll through a couple of pages at a time. If you pick the
- titles for the folds carefully, they can be a useful form of
- documentation, and make moving though the file a lot easier. In
- general, searching through a folded file for a particular item is much
- easier than without folds.
-
-Managing folds
-
- To make a new fold, set the mark at one end of the text you want in the
- new fold, and move the point to the other end. Then type
- `\\[folding-fold-region]'. The text you selected will be made into a
- fold, and the fold will be entered. If you just want a new, empty fold,
- set the mark where you want the fold, and then create a new fold there
- without moving the point. Don't worry if the point is in the middle of
- a line of text, `folding-fold-region' will not break text in the middle
- of a line. After making a fold, the fold is entered and the point is
- positioned ready to enter a title for the fold. Do not delete the fold
- marks, which are usually something like \"{{{\" and \"}}}\". There may
- also be a bit of fold mark which goes after the fold title.
-
- If the fold markers get messed up, or you just want to see the whole
- unfolded file, use `\\[folding-open-buffer]' to unfolded the whole
- file, so you can see all the text and all the marks. This is useful for
- checking/correcting unbalanced fold markers, and for searching for
- things. Use `\\[folding-whole-file]' to fold the buffer again.
-
- `folding-shift-out' will attempt to tidy the current fold just before
- exiting it. It will remove any extra blank lines at the top and bottom,
- \(outside the fold marks). It will then ensure that fold marks exists,
- and if they are not, will add them (after asking). Finally, the number
- of blank lines between the fold marks and the contents of the fold is
- set to 1 (by default).
-
-Folding package customizations
-
- If the fold marks are not set on entry to Folding mode, they are set to
- a default for current major mode, as defined by
- `folding-mode-marks-alist' or to \"{{{ \" and \"}}}\" if none are
- specified.
-
- To bind different commands to keys in Folding mode, set the bindings in
- the keymap `folding-mode-map'.
-
- The hooks `folding-mode-hook' and `<major-mode-name>-folding-hook' are
- called before folding the buffer and applying the key bindings in
- `folding-mode-map'. This is a good hook to set extra or different key
- bindings in `folding-mode-map'. Note that key bindings in
- `folding-mode-map' are only examined just after calling these hooks;
- new bindings in those maps only take effect when Folding mode is being
- started. The hook `folding-load-hook' is called when Folding mode is
- loaded into Emacs.
-
-Mouse behavior
-
- If you want folding to detect point of actual mouse click, please see
- variable `folding-mouse-yank-at-p'.
-
- To customise the mouse actions, look at `folding-behave-table'."
- (interactive)
-
- (let ((new-folding-mode
- (if (not arg)
- (not folding-mode)
- (> (prefix-numeric-value arg) 0))))
- (or (eq new-folding-mode
- folding-mode)
- (if folding-mode
- (progn
- ;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ progn ^^^
- ;; turn off folding
- (if (null (folding-use-overlays-p))
- (setq selective-display nil))
- (folding-clear-stack)
- (folding-narrow-to-region nil nil)
- (folding-subst-regions (list 1 (point-max)) ?\r ?\n)
-
- ;; Restore "%n" (Narrow) in the mode line
- (setq mode-line-format
- (mapcar
- (function
- (lambda (item)
- (if (equal item 'folding-narrow-placeholder)
- "%n" item)))
- mode-line-format)))
- ;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ else ^^^
- (cond
- ((folding-use-overlays-p)
- ;; This may be Emacs specific; how about XEmacs?
- ;;
- ;; make line-move-ignore-invisible buffer local, matches
- ;; outline.el, and the 21 pre-release gets upset if this is
- ;; defined globally in shell buffer...
- (make-local-variable 'line-move-ignore-invisible)
- (setq line-move-ignore-invisible t
- buffer-invisibility-spec '((t . t))))
- (t
- (setq selective-display t)
- (setq selective-display-ellipses t)))
- (unless (assq 'folding-mode minor-mode-alist)
- ;; User has not run folding-install or he did call
- ;; folding-uninstall which completely wiped package out.
- ;; => anyway now he calls us, so be there for him
- (folding-install))
- (folding-keep-hooked) ;set hooks if not there
- (widen)
- (setq folding-narrow-overlays nil)
- (folding-set-local-variables)
- (folding-font-lock-support)
- (unwind-protect
- (let ((hook-symbol (intern-soft
- (concat
- (symbol-name major-mode)
- "-folding-hook"))))
- (run-hooks 'folding-mode-hook)
- (and hook-symbol
- (run-hooks hook-symbol)))
- (folding-set-mode-line))
- (and folding-folding-on-startup
- (if (or (interactive-p)
- arg
- inter)
- (folding-whole-buffer)
- (save-excursion
- (folding-whole-buffer))))
- (folding-narrow-to-region nil nil t)
- ;; Remove "%n" (Narrow) from the mode line
- (setq mode-line-format
- (mapcar
- (function
- (lambda (item)
- (if (equal item "%n")
- 'folding-narrow-placeholder item)))
- mode-line-format))))
- (setq folding-mode new-folding-mode)
- (if folding-mode
- (easy-menu-add folding-mode-menu)
- (easy-menu-remove folding-mode-menu))))
-
-;;}}}
-;;{{{ code: setting fold marks
-
-;; You think those "\\(\\)" pairs are peculiar? Me too. Emacs regexp
-;; stuff has a bug; sometimes "\\(.*\\)" fails when ".*" succeeds, but
-;; only in a folded file! Strange bug! Must check it out sometime.
-
-(defun folding-set-marks (top bottom &optional secondary)
- "Set the folding top and bottom mark for the current buffer.
-
-Input:
-
- TOP The topmost fold mark. Comment start + fold begin string.
- BOTTOM The bottom fold mark Comment end + fold end string.
- SECONDARY Usually the comment end indicator for the mode. This
- is inserted by `folding-fold-region' after the fold top mark,
- and is presumed to be put after the title of the fold.
-
-Example:
-
- html-mode:
-
- top: \"<!-- [[[ \"
- bot: \"<!-- ]]] -->\"
- sec: \" -->\"
-
-Notice that the top marker needs to be closed with SECONDARY comment end string.
-
-Various regular expressions are set with this function, so don't set the
-mark variables directly."
- (set (make-local-variable 'folding-top-mark)
- top)
- (set (make-local-variable 'folding-bottom-mark)
- bottom)
- (set (make-local-variable 'folding-secondary-top-mark)
- secondary)
- (set (make-local-variable 'folding-top-regexp)
- (concat "\\(^\\|\r+\\)[ \t]*"
- (regexp-quote folding-top-mark)))
- (set (make-local-variable 'folding-bottom-regexp)
- (concat "\\(^\\|\r+\\)[ \t]*"
- (regexp-quote folding-bottom-mark)))
- (set (make-local-variable 'folding-regexp)
- (concat "\\(^\\|\r\\)\\([ \t]*\\)\\(\\("
- (regexp-quote folding-top-mark)
- "\\)\\|\\("
- (regexp-quote folding-bottom-mark)
- "[ \t]*\\(\\)\\($\\|\r\\)\\)\\)")))
-
-;;}}}
-;;{{{ code: movement
-
-(defun folding-next-visible-heading (&optional direction)
- "Move up/down fold headers.
-Backward if DIRECTION is non-nil returns nil if not moved = no next marker."
- (interactive)
- (let* ((begin-mark (nth 0 (folding-get-mode-marks)))
- case-fold-search)
- (if direction
- (re-search-backward (concat "^" (regexp-quote begin-mark)) nil t)
- (re-search-forward (concat "^" (regexp-quote begin-mark)) nil t))))
-
-(defun folding-previous-visible-heading ()
- "Move upward fold headers."
- (interactive)
- (beginning-of-line)
- (folding-next-visible-heading 'backward))
-
-(defun folding-find-folding-mark (&optional end-fold)
- "Search backward to find beginning fold. Skips subfolds.
-Optionally searches forward to find END-FOLD mark.
-
-Return:
-
- nil
- point position of fold mark"
- (let* (case-fold-search
- (elt (folding-get-mode-marks))
- (bm (regexp-quote (nth 0 elt))) ; markers defined for mode
- (em (regexp-quote (nth 1 elt))) ; markers defined for mode
- (re (concat "^" bm "\\|^" em))
- (count 0)
- stat
- moved)
- (save-excursion
- (cond
- (end-fold
- (folding-end-of-line)
- ;; We must skip over inner folds
- (while (and (null moved)
- (re-search-forward re nil t))
- (setq stat (folding-mark-look-at))
- (cond
- ((symbolp stat)
- (setq count (1- count))
- (if (< count 0) ;0 or less means no middle folds
- (setq moved t)))
- ((memq stat '(1 11)) ;BEG fold
- (setq count (1+ count))))) ;; end while
- (when moved
- (forward-char -3)
- (setq moved (point))))
- (t
- (while (and (null moved)
- (re-search-backward re nil t))
- (setq stat (folding-mark-look-at))
- (cond
- ((memq stat '(1 11))
- (setq count (1- count))
- (if (< count 0) ;0 or less means no middle folds
- (setq moved (point))))
- ((symbolp stat)
- (setq count (1+ count)))))
- (when moved ;What's the result
- (forward-char 3)
- (setq moved (point))))))
- moved))
-
-(defun folding-pick-move ()
- "Pick the logical movement on fold mark.
-If at the end of fold, then move to the beginning and vice versa.
-
-If placed over closed fold moves to the next fold. When no next
-folds are visible, stops moving.
-
-Return:
- t if moved"
- (interactive)
- (let* (case-fold-search
- (elt (folding-get-mode-marks))
- (bm (nth 0 elt)) ; markers defined for mode
- (stat (folding-mark-look-at))
- moved)
- (cond
- ((eq 0 stat) ;closed fold
- (when (re-search-forward (concat "^" (regexp-quote bm)) nil t)
- (setq moved t)
- (forward-char 3)))
- ((symbolp stat) ;End fold
- (setq moved (folding-find-folding-mark)))
- ((integerp stat) ;Beg fold
- (setq moved (folding-find-folding-mark 'end-fold))))
- (if (integerp moved)
- (goto-char moved))
- moved))
-
-;;; Idea by Scott Evans <gse A T antisleep com>
-(defun folding-context-next-action ()
- "Take next action according to point and context.
-If point is at:
-
- Begin Fold : toggle open - close
- End Fold : close
- inside : fold current level."
- (interactive)
- (let ((state (folding-mark-look-at)))
- (cond
- ((eq state 0)
- (folding-act 'open))
- ((eq state 1)
- (folding-act 'close))
- ((eq state 11)
- (folding-act 'up))
- ((eq 'end state)
- (folding-act 'close))
- ((eq state 'end-in)
- (folding-act 'up))
- (t
- (folding-act 'other)))))
-
-(defun folding-forward-char-1 (&optional arg)
- "See `folding-forward-char-1' for ARG."
- (if (eq arg 1)
- ;; Do it a faster way for arg = 1.
- (if (eq (following-char) ?\r)
- (let ((saved (point))
- (inhibit-quit t))
- (end-of-line)
- (if (not (eobp))
- (forward-char)
- (goto-char saved)
- (error "End of buffer")))
- ;; `forward-char' here will do its own error if (eobp).
- (forward-char))
- (if (> 0 (or arg (setq arg 1)))
- (folding-backward-char (- arg))
- (let (goal saved)
- (while (< 0 arg)
- (skip-chars-forward "^\r" (setq goal (+ (point) arg)))
- (if (eq goal (point))
- (setq arg 0)
- (if (eobp)
- (error "End of buffer")
- (setq arg (- goal 1 (point))
- saved (point))
- (let ((inhibit-quit t))
- (end-of-line)
- (if (not (eobp))
- (forward-char)
- (goto-char saved)
- (error "End of buffer"))))))))))
-
-(defmacro folding-forward-char-macro ()
- `(defun folding-forward-char (&optional arg)
- "Move point right ARG characters, skipping hidden folded regions.
-Moves left if ARG is negative. On reaching end of buffer, stop and
-signal error."
- ,(folding-interactive-spec-p)
- ;; (folding-preserve-active-region)
- (folding-forward-char-1 arg)))
-
-(folding-forward-char-macro)
-
-(defun folding-backward-char-1 (&optional arg)
- "See `folding-backward-char-1' for ARG."
- (if (eq arg 1)
- ;; Do it a faster way for arg = 1.
- ;; Catch the case where we are in a hidden region, and bump into a \r.
- (if (or (eq (preceding-char) ?\n)
- (eq (preceding-char) ?\r))
- (let ((pos (1- (point)))
- (inhibit-quit t))
- (forward-char -1)
- (beginning-of-line)
- (skip-chars-forward "^\r" pos))
- (forward-char -1))
- (if (> 0 (or arg (setq arg 1)))
- (folding-forward-char (- arg))
- (let (goal)
- (while (< 0 arg)
- (skip-chars-backward "^\r\n" (max (point-min)
- (setq goal (- (point) arg))))
- (if (eq goal (point))
- (setq arg 0)
- (if (bobp)
- (error "Beginning of buffer")
- (setq arg (- (point) 1 goal)
- goal (point))
- (let ((inhibit-quit t))
- (forward-char -1)
- (beginning-of-line)
- (skip-chars-forward "^\r" goal)))))))))
-
-(defmacro folding-backward-char-macro ()
- `(defun folding-backward-char (&optional arg)
- "Move point right ARG characters, skipping hidden folded regions.
-Moves left if ARG is negative. On reaching end of buffer, stop and
-signal error."
- ,(folding-interactive-spec-p)
- ;; (folding-preserve-active-region)
- (folding-backward-char-1 arg)))
-
-(folding-backward-char-macro)
-
-(defmacro folding-end-of-line-macro ()
- `(defun folding-end-of-line (&optional arg)
- "Move point to end of current line, but before hidden folded region.
-ARG is line count.
-
-Has the same behavior as `end-of-line', except that if the current line
-ends with some hidden folded text (represented by an ellipsis), the
-point is positioned just before it. This prevents the point from being
-placed inside the folded text, which is not normally useful."
- ,(folding-interactive-spec-p)
- ;;(interactive "p")
- ;; (folding-preserve-active-region)
- (if (or (eq arg 1)
- (not arg))
- (beginning-of-line)
- ;; `forward-line' also moves point to beginning of line.
- (forward-line (1- arg)))
- (skip-chars-forward "^\r\n")))
-
-(folding-end-of-line-macro)
-
-(defun folding-skip-ellipsis-backward ()
- "Move the point backwards out of folded text.
-
-If the point is inside a folded region, the cursor is displayed at the
-end of the ellipsis representing the folded part. This function checks
-to see if this is the case, and if so, moves the point backwards until
-it is just outside the hidden region, and just before the ellipsis.
-
-Returns t if the point was moved, nil otherwise."
- (interactive)
- (let ((pos (point))
- result)
- (save-excursion
- (beginning-of-line)
- (skip-chars-forward "^\r" pos)
- (or (eq pos (point))
- (setq pos (point)
- result t)))
- (goto-char pos)
- result))
-
-;;}}}
-
-;;{{{ code: Moving in and out of folds
-
-;;{{{ folding-shift-in
-
-(defun folding-shift-in (&optional noerror)
- "Open and enter the fold at or around the point.
-
-Enters the fold that the point is inside, wherever the point is inside
-the fold, provided it is a valid fold with balanced top and bottom
-marks. Returns nil if the fold entered contains no sub-folds, t
-otherwise. If an optional argument NOERROR is non-nil, returns nil if
-there are no folds to enter, instead of causing an error.
-
-If the point is inside a folded, hidden region (as represented by an
-ellipsis), the position of the point in the buffer is preserved, and as
-many folds as necessary are entered to make the surrounding text
-visible. This is useful after some commands eg., search commands."
- (interactive)
- (labels
- ((open-fold nil
- (let ((data (folding-show-current-entry noerror t)))
- (and data
- (progn
- (when folding-narrow-by-default
- (setq folding-stack
- (if folding-stack
- (cons (cons (point-min-marker)
- (point-max-marker))
- folding-stack)
- '(folded)))
- (folding-set-mode-line))
- (folding-narrow-to-region (car data) (nth 1 data)))))))
- (let ((goal (point)))
- (while (folding-skip-ellipsis-backward)
- (beginning-of-line)
- (open-fold)
- (goto-char goal))
- (when (not folding-narrow-by-default)
- (widen)))))
-
-;;}}}
-;;{{{ folding-shift-out
-
-(defun folding-shift-out (&optional event)
- "Exits the current fold with EVENT."
- (interactive)
- (if folding-stack
- (progn
- (folding-tidy-inside)
- (cond
- ((folding-use-overlays-p)
- (folding-subst-regions
- (list (overlay-end (car folding-narrow-overlays))
- (overlay-start (cdr folding-narrow-overlays))) ?\n ?\r)
- ;; So point is correct in other windows.
- (goto-char (overlay-end (car folding-narrow-overlays))))
- (t
- (folding-subst-regions (list (point-min) (point-max)) ?\n ?\r)
- ;; So point is correct in other window
- (goto-char (point-min))))
-
- (if (eq (car folding-stack) 'folded)
- (folding-narrow-to-region nil nil t)
- (folding-narrow-to-region
- (marker-position (car (car folding-stack)))
- (marker-position (cdr (car folding-stack))) t))
- (and (consp (car folding-stack))
- (set-marker (car (car folding-stack)) nil)
- (set-marker (cdr (car folding-stack)) nil))
- (setq folding-stack (cdr folding-stack)))
- (error "Outside all folds"))
- (folding-set-mode-line))
-
-;;}}}
-;;{{{ folding-show-current-entry
-
-(defun folding-show-current-entry (&optional event noerror noskip)
- "Opens the fold that the point is on, but does not enter it.
-EVENT and optional arg NOERROR means don't signal an error if there is
-no fold, just return nil. NOSKIP means don't jump out of a hidden
-region first.
-
-Returns ((START END SUBFOLDS-P). START and END indicate the extents of
-the fold that was shown. If SUBFOLDS-P is non-nil, the fold contains
-subfolds."
- (interactive)
- (or noskip
- (folding-skip-ellipsis-backward))
- (let ((point (point))
- backward
- forward
- start
- end
- subfolds-not-p)
- (unwind-protect
- (or (and (integerp
- (car-safe (setq backward (folding-skip-folds t))))
- (integerp
- (car-safe (setq forward (folding-skip-folds nil))))
- (progn
- (goto-char (car forward))
- (skip-chars-forward "^\r\n")
- (setq end (point))
- (skip-chars-forward "\r\n")
- (not (and folding-stack (eobp))))
- (progn
- (goto-char (car backward))
- (skip-chars-backward "^\r\n")
- (setq start (point))
- (skip-chars-backward "\r\n")
- (not (and folding-stack (bobp))))
- (progn
- (setq point start)
- ;; Avoid holding the list through a GC.
- (setq subfolds-not-p
- (not (or (cdr backward)
- (cdr forward))))
- (folding-subst-regions
- (append backward (nreverse forward))
- ?\r ?\n)
- ;; FIXME: this should be moved to font-lock:
- ;; - When fold is closed, the whole line (with code)
- ;; is treated as comment
- ;; - Fon-lock changes all fonts to `font-lock-comment-face'
- ;; - When you again open fold, all text is in color
- ;;
- ;; => Font lock should stop at \r, and not use ".*"
- ;; which includes \r character
- ;; This is a workaround, not an efficient one
- (if (or (and (boundp 'global-font-lock-mode)
- global-font-lock-mode)
- font-lock-mode)
- (font-lock-fontify-region start end))
- (list start end (not subfolds-not-p))))
- (if noerror
- nil
- (error "Not on a fold")))
- (goto-char point))))
-
-;;}}}
-;;{{{ folding-hide-current-entry
-
-(defun folding-toggle-enter-exit ()
- "Run `folding-shift-in' or `folding-shift-out'.
-This depends on current line's contents."
- (interactive)
- (beginning-of-line)
- (let ((current-line-mark (folding-mark-look-at)))
- (if (and (numberp current-line-mark)
- (= current-line-mark 0))
- (folding-shift-in)
- (folding-shift-out))))
-
-(defun folding-toggle-show-hide ()
- "Run folding-show-current-entry or folding-hide-current-entry depending on current line's contents."
- (interactive)
- (beginning-of-line)
- (let ((current-line-mark (folding-mark-look-at)))
- (if (and (numberp current-line-mark)
- (= current-line-mark 0))
- (folding-show-current-entry)
- (folding-hide-current-entry))))
-
-(defun folding-hide-current-entry (&optional event)
- "Close the fold around the point using EVENT.
-Undo effect of `folding-show-current-entry'."
- (interactive)
- (folding-skip-ellipsis-backward)
- (let (start end)
- (if (and (integerp (setq start (car-safe (folding-skip-folds t))))
- (integerp (setq end (car-safe (folding-skip-folds nil)))))
- (if (and folding-stack
- (or (eq start (point-min))
- (eq end (point-max))))
- ;;(error "Cannot hide current fold")
- (folding-shift-out)
- (goto-char start)
- (skip-chars-backward "^\r\n")
- (folding-subst-regions (list start end) ?\n ?\r))
- (error "Not on a fold"))))
-
-;;}}}
-;;{{{ folding-show-all
-
-(defun folding-show-all ()
- "Exits all folds, to the top level."
- (interactive)
- (while folding-stack
- (folding-shift-out)))
-
-;;}}}
-;;{{{ folding-goto-line
-
-(defun folding-goto-line (line)
- "Go to LINE, entering as many folds as possible."
- (interactive "NGoto line: ")
- (folding-show-all)
- (goto-char 1)
- (and (< 1 line)
- (re-search-forward "[\n\C-m]" nil 0 (1- line)))
- (let ((goal (point)))
- (while (prog2 (beginning-of-line)
- (folding-shift-in t)
- (goto-char goal))))
- (folding-narrow-to-region
- (and folding-narrow-by-default (point-min))
- (point-max) t))
-
-;;}}}
-
-;;}}}
-;;{{{ code: Searching for fold boundaries
-
-;;{{{ folding-skip-folds
-
-(defun folding-skip-folds (backward &optional outside)
- "Skips forward through the buffer (backward if BACKWARD is non-nil)
-until it finds a closing fold mark or the end of the buffer. The
-point is not moved. Jumps over balanced folding-mark pairs on the way.
-Returns t if the end of buffer was found in an unmatched folding-mark
-pair, otherwise a list.
-
-If the point is actually on an fold start mark, the mark is ignored;
-if it is on an end mark, the mark is noted. This decision is
-reversed if BACKWARD is non-nil. If optional OUTSIDE is non-nil and
-BACKWARD is nil, either mark is noted.
-
-The first element of the list is a position in the end of the closing
-fold mark if one was found, or nil. It is followed by (END START)
-pairs (flattened, not a list of pairs). The pairs indicating the
-positions of folds skipped over; they are positions in the fold
-marks, not necessarily at the ends of the fold marks. They are in
-the opposite order to that in which they were skipped. The point is
-left in a meaningless place. If going backwards, the pairs are
-\(START END) pairs, as the fold marks are scanned in the opposite
-order.
-
-Works by maintaining the position of the top and bottom marks found
-so far. They are found separately using a normal string search for
-the fixed part of a fold mark (because it is faster than a regexp
-search if the string does not occur often outside of fold marks),
-checking that it really is a proper fold mark, then considering the
-earliest one found. The position of the other (if found) is
-maintained to avoid an unnecessary search at the next iteration."
- (let ((first-mark (if backward folding-bottom-mark folding-top-mark))
- (last-mark (if backward folding-top-mark folding-bottom-mark))
- (top-re folding-top-regexp)
- (depth 0)
- pairs point
- temp
- start
- first
- last
- case-fold-search)
- ;; Ignore trailing space?
- (when nil
- (when (and (stringp first-mark)
- (string-match "^\\(.*[^ ]+\\) +$" first-mark))
- (setq first-mark (match-string 1 first-mark)))
- (when (and (stringp last-mark)
- (string-match "^\\(.*[^ ]+\\) +$" last-mark))
- (setq last-mark (match-string 1 last-mark)))
- (when (and (stringp top-re)
- (string-match "^\\(.*[^ ]+\\) +$" top-re))
- (setq top-re (match-string 1 top-re))))
- (save-excursion
- (skip-chars-backward "^\r\n")
- (unless outside
- (and (eq (preceding-char) ?\r)
- (forward-char -1))
- (if (looking-at top-re)
- (if backward
- (setq last (match-end 1))
- (skip-chars-forward "^\r\n"))))
- (while (progn
- ;; Find last first, prevents unnecessary searching
- ;; for first.
- (setq point (point))
- (or last
- (while (and (if backward
- (search-backward last-mark first t)
- (search-forward last-mark first t))
- (progn
- (setq temp (point))
- (goto-char (match-beginning 0))
- (skip-chars-backward " \t")
- (and (not
- (setq last
- (if (eq (preceding-char) ?\r)
- temp
- (and (bolp) temp))))
- (goto-char temp)))))
- (goto-char point))
- (or first
- (while (and (if backward
- (search-backward first-mark last t)
- (search-forward first-mark last t))
- (progn
- (setq temp (point))
- (goto-char (match-beginning 0))
- (skip-chars-backward " \t")
- (and (not
- (setq first
- (if (eq (preceding-char) ?\r)
- temp
- (and (bolp) temp))))
- (goto-char temp))))))
- ;; Return value of conditional says whether to
- ;; iterate again.
- (if (not last)
- ;; Return from this with the result.
- (not (setq pairs (if first t (cons nil pairs))))
- (if (and first
- (if backward
- (> first last)
- (< first last)))
- (progn
- (goto-char first)
- (if (eq 0 depth)
- (setq start first
- first nil
- depth 1) ;; non-nil value, loop again.
- (setq first nil
- ;; non-nil value => loop again
- depth (1+ depth))))
- (goto-char last)
- (if (eq 0 depth)
- (not (setq pairs (cons last pairs)))
- (or (< 0 (setq depth (1- depth)))
- (setq pairs (cons last (cons start pairs))))
- (setq last nil)
- t)))))
- pairs)))
-
-;;}}}
-
-;;}}}
-;;{{{ code: Functions that actually modify the buffer
-
-;;{{{ folding-fold-region
-
-(defun folding-fold-region (start end)
- "Places fold mark at the beginning and end of a specified region.
-The region is specified by two arguments START and END. The point is
-left at a suitable place ready to insert the title of the fold.
-
-The fold markers are intended according to mode."
- (interactive "r")
- (and (< end start)
- (setq start (prog1 end
- (setq end start))))
- (setq end (set-marker (make-marker) end))
- (goto-char start)
- (beginning-of-line)
- (setq start (point))
- (insert-before-markers folding-top-mark)
- ;; XEmacs latex-mode, after (tex-site), indents the whole
- ;; fold 50 characters right. Don't do that.
- (unless (string-match "latex" (symbol-name major-mode))
- (indent-according-to-mode))
- (let ((saved-point (point)))
- (and folding-secondary-top-mark
- (insert-before-markers folding-secondary-top-mark))
- (insert-before-markers ?\n)
- (goto-char (marker-position end))
- (set-marker end nil)
- (and (not (bolp))
- (eq 0 (forward-line))
- (eobp)
- (insert ?\n))
- (insert folding-bottom-mark)
- (unless (string-match "latex" (symbol-name major-mode))
- (indent-according-to-mode))
- (insert ?\n)
- (setq folding-stack (if folding-stack
- (cons (cons (point-min-marker)
- (point-max-marker))
- folding-stack)
- '(folded)))
- (folding-narrow-to-region start (1- (point)))
- (goto-char saved-point)
- (folding-set-mode-line))
- (save-excursion (folding-tidy-inside)))
-
-;;}}}
-;;{{{ folding-tidy-inside
-
-;; Note to self: The long looking code for checking and modifying those
-;; blank lines is to make sure the text isn't modified unnecessarily.
-;; Don't remove it again!
-
-(defun folding-tidy-inside ()
- "Add or remove blank lines at the top and bottom of the current fold.
-Also adds fold marks at the top and bottom (after asking), if they are not
-there already. The amount of space left depends on the variable
-`folding-internal-margins', which is one by default."
- (interactive)
- (if buffer-read-only nil
- (let ()
-;;; (top-re (if (string-match "^\\(.*\\) $" folding-top-mark)
-;;; (match-string 1 folding-top-mark)
-;;; folding-top-mark))
- (if (folding-use-overlays-p)
- (goto-char (- (overlay-end (car folding-narrow-overlays)) 1))
- (goto-char (point-min)))
- (and (eolp)
- (progn (skip-chars-forward "\n\t ")
- (delete-region (point-min) (point))))
- (and (if (let (case-fold-search) (folding-mark-look-at-top-mark-p))
- (progn (forward-line 1)
- (and (eobp) (insert ?\n))
- t)
- (and (y-or-n-p "Insert missing folding-top-mark? ")
- (progn (insert (concat folding-top-mark
- "<Replaced missing fold top mark>"
- (or folding-secondary-top-mark "")
- "\n"))
- t)))
- folding-internal-margins
- (<= 0 folding-internal-margins)
- (let* ((p1 (point))
- (p2 (progn (skip-chars-forward "\n") (point)))
- (p3 (progn (skip-chars-forward "\n\t ")
- (skip-chars-backward "\t " p2) (point))))
- (if (eq p2 p3)
- (or (eq p2 (setq p3 (+ p1 folding-internal-margins)))
- (if (< p2 p3)
- (newline (- p3 p2))
- (delete-region p3 p2)))
- (delete-region p1 p3)
- (or (eq 0 folding-internal-margins)
- (newline folding-internal-margins)))))
- (if (folding-use-overlays-p)
- (goto-char (overlay-start (cdr folding-narrow-overlays)))
- (goto-char (point-max)))
- (and (bolp)
- (progn (skip-chars-backward "\n")
- (delete-region (point) (point-max))))
- (beginning-of-line)
- (and (or (let (case-fold-search) (folding-mark-look-at-bottom-mark-p))
- (progn (goto-char (point-max)) nil)
- (and (y-or-n-p "Insert missing folding-bottom-mark? ")
- (progn
- (insert (concat "\n" folding-bottom-mark))
- (beginning-of-line)
- t)))
- folding-internal-margins
- (<= 0 folding-internal-margins)
- (let* ((p1 (point))
- (p2 (progn (skip-chars-backward "\n") (point)))
- (p3 (progn (skip-chars-backward "\n\t ")
- (skip-chars-forward "\t " p2) (point))))
- (if (eq p2 p3)
- (or (eq p2 (setq p3 (- p1 1 folding-internal-margins)))
- (if (> p2 p3)
- (newline (- p2 p3))
- (delete-region p2 p3)))
- (delete-region p3 p1)
- (newline (1+ folding-internal-margins))))))))
-
-;;}}}
-
-;;}}}
-;;{{{ code: Operations on the whole buffer
-
-;;{{{ folding-whole-buffer
-
-(defun folding-whole-buffer ()
- "Folds every fold in the current buffer.
-Fails if the fold markers are not balanced correctly.
-
-If the buffer is being viewed in a fold, folds are repeatedly exited to
-get to the top level first (this allows the folds to be tidied on the
-way out). The buffer modification flag is not affected, and this
-function will work on read-only buffers."
-
- (interactive)
- (message "Folding buffer...")
- (let ((narrow-min (point-min))
- (narrow-max (point-max))
- folding-list)
- (save-excursion
- (widen)
- (goto-char 1)
- (setq folding-list (folding-skip-folds nil t))
- (narrow-to-region narrow-min narrow-max)
- (and (eq t folding-list)
- (error
- "Cannot fold whole buffer -- unmatched begin-fold mark `%s' ´%s'"
- (current-buffer)
- folding-top-mark))
- (and (integerp (car folding-list))
- (error
- "Cannot fold whole buffer -- extraneous end-fold mark `%s' `%s'"
- (current-buffer)
- folding-bottom-mark))
- (folding-show-all)
- (widen)
- (goto-char 1)
- ;; Do the modifications forwards.
- (folding-subst-regions (nreverse (cdr folding-list)) ?\n ?\r))
- (beginning-of-line)
- (folding-narrow-to-region nil nil t)
- (message "Folding buffer... done")))
-
-;;}}}
-;;{{{ folding-open-buffer
-
-(defun folding-open-buffer ()
- "Unfolds the entire buffer, leaving the point where it is.
-Does not affect the buffer-modified flag, and can be used on read-only
-buffers."
- (interactive)
- (message "Unfolding buffer...")
- (folding-clear-stack)
- (folding-set-mode-line)
- (unwind-protect
- (progn
- (widen)
- (folding-subst-regions (list 1 (point-max)) ?\r ?\n))
- (folding-narrow-to-region nil nil t))
- (message "Unfolding buffer... done"))
-
-;;}}}
-;;{{{ folding-convert-buffer-for-printing
-
-(defun folding-convert-buffer-for-printing (&optional buffer pre-title post-title pad)
- "Remove folds from a buffer, for printing.
-
-It copies the contents of the (hopefully) folded buffer BUFFER into a
-buffer called `*Unfolded: <Original-name>*', removing all of the fold
-marks. It keeps the titles of the folds, however, and numbers them.
-Subfolds are numbered in the form 5.1, 5.2, 5.3 etc., and the titles are
-indented to eleven characters.
-
-It accepts four arguments. BUFFER is the name of the buffer to be
-operated on, or a buffer. nil means use the current buffer. PRE-TITLE
-is the text to go before the replacement fold titles, POST-TITLE is the
-text to go afterwards. Finally, if PAD is non-nil, the titles are all
-indented to the same column, which is eleven plus the length of
-PRE-TITLE. Otherwise just one space is placed between the number and
-the title."
- (interactive (list (read-buffer "Remove folds from buffer: "
- (buffer-name)
- t)
- (read-string "String to go before enumerated titles: ")
- (read-string "String to go after enumerated titles: ")
- (y-or-n-p "Pad section numbers with spaces? ")))
- (set-buffer (setq buffer (get-buffer buffer)))
- (setq pre-title (or pre-title "")
- post-title (or post-title ""))
- (or folding-mode
- (error "Must be in Folding mode before removing folds"))
- (let* ((new-buffer (get-buffer-create (concat "*Unfolded: "
- (buffer-name buffer)
- "*")))
- (section-list '(1))
- (section-prefix-list '(""))
-
- (secondary-mark-length (length folding-secondary-top-mark))
-
- (secondary-mark folding-secondary-top-mark)
- (mode major-mode)
-
- ;; [jari] Aug 14 1997
- ;; Regexp doesn't allow "footer text" like, so we add one more
- ;; regexp to loosen the end criteria
- ;;
- ;; {{{ Subsubsection 1
- ;; }}} Subsubsection 1
- ;;
- ;; was: (regexp folding-regexp)
- ;;
- (regexp
- (concat "\\(^\\|\r\\)\\([ \t]*\\)\\(\\("
- (regexp-quote folding-top-mark)
- "\\)\\|\\("
- (regexp-quote folding-bottom-mark)
- "[ \t]*.*\\(\\)\\($\\|\r\\)\\)\\)"))
- title
- prefix)
- ;; was obsolete function: (buffer-flush-undo new-buffer)
- (buffer-disable-undo new-buffer)
- (save-excursion
- (set-buffer new-buffer)
- (delete-region (point-min)
- (point-max)))
- (save-restriction
- (widen)
- (copy-to-buffer new-buffer (point-min) (point-max)))
- (display-buffer new-buffer t)
- (set-buffer new-buffer)
- (subst-char-in-region (point-min) (point-max) ?\r ?\n)
- (funcall mode)
- (while (re-search-forward regexp nil t)
- (if (match-beginning 4)
- (progn
- (goto-char (match-end 4))
-
- ;; - Move after start fold and read the title from there
- ;; - Then move back and kill the fold mark
- ;;
- (setq title
- (buffer-substring (point)
- (progn (end-of-line)
- (point))))
- (delete-region (save-excursion
- (goto-char (match-beginning 4))
- (skip-chars-backward "\n\r")
- (point))
- (progn
- (skip-chars-forward "\n\r")
- (point)))
- (and (<= secondary-mark-length
- (length title))
- (string-equal secondary-mark
- (substring title
- (- secondary-mark-length)))
- (setq title (substring title
- 0
- (- secondary-mark-length))))
- (setq section-prefix-list
- (cons (setq prefix (concat (car section-prefix-list)
- (int-to-string (car section-list))
- "."))
- section-prefix-list))
- (or (cdr section-list)
- (insert ?\n))
- (setq section-list (cons 1
- (cons (1+ (car section-list))
- (cdr section-list))))
- (setq title (concat prefix
- (if pad
- (make-string
- (max 2 (- 8 (length prefix))) ? )
- " ")
- title))
- (message "Reformatting: %s%s%s"
- pre-title
- title
- post-title)
- (insert "\n\n"
- pre-title
- title
- post-title
- "\n\n"))
- (goto-char (match-beginning 5))
- (or (setq section-list (cdr section-list))
- (error "Too many bottom-of-fold marks"))
-
- (setq section-prefix-list (cdr section-prefix-list))
- (delete-region (point)
- (progn
- (forward-line 1)
- (point)))))
- (and (cdr section-list)
- (error
- "Too many top-of-fold marks -- reached end of file prematurely"))
- (goto-char (point-min))
- (buffer-enable-undo)
- (set-buffer-modified-p nil)
- (message "All folds reformatted.")))
-
-;;}}}
-;;}}}
-
-;;{{{ code: Standard fold marks for various major modes
-
-;;{{{ A function to set default marks, `folding-add-to-marks-list'
-
-(defun folding-add-to-marks-list (mode top bottom
- &optional secondary noforce message)
- "Add/set fold mark list for a particular major mode.
-When called interactively, asks for a `major-mode' name, and for
-fold marks to be used in that mode. It adds the new set to
-`folding-mode-marks-alist', and if the mode name is the same as the current
-major mode for the current buffer, the marks in use are also changed.
-
-If called non-interactively, arguments are MODE, TOP, BOTTOM and
-SECONDARY. MODE is the symbol for the major mode for which marks are
-being set. TOP, BOTTOM and SECONDARY are strings, the three fold marks
-to be used. SECONDARY may be nil (as opposed to the empty string), but
-the other two must be non-empty strings, and is an optional argument.
-
-Two other optional arguments are NOFORCE, meaning do not change the
-marks if marks are already set for the specified mode if non-nil, and
-MESSAGE, which causes a message to be displayed if it is non-nil. This
-is also the message displayed if the function is called interactively.
-
-To set default fold marks for a particular mode, put something like the
-following in your .emacs:
-
-\(folding-add-to-marks-list 'major-mode \"(** {{{ \" \"(** }}} **)\" \" **)\")
-
-Look at the variable `folding-mode-marks-alist' to see what default settings
-already apply.
-
-`folding-set-marks' can be used to set the fold marks in use in the current
-buffer without affecting the default value for a particular mode."
- (interactive
- (let* ((mode (completing-read
- (concat "Add fold marks for major mode ("
- (symbol-name major-mode)
- "): ")
- obarray
- (function
- (lambda (arg)
- (and (commandp arg)
- (string-match "-mode\\'"
- (symbol-name arg)))))
- t))
- (mode (if (equal mode "")
- major-mode
- (intern mode)))
- (object (assq mode folding-mode-marks-alist))
- (old-top (and object
- (nth 1 object)))
- top
- (old-bottom (and object
- (nth 2 object)))
- bottom
- (secondary (and object
- (nth 3 object)))
- (prompt "Top fold marker: "))
- (and (equal secondary "")
- (setq secondary nil))
- (while (not top)
- (setq top (read-string prompt (or old-top "{{{ ")))
- (and (equal top "")
- (setq top nil)))
- (setq prompt (concat prompt
- top
- ", Bottom marker: "))
- (while (not bottom)
- (setq bottom (read-string prompt (or old-bottom "}}}")))
- (and (equal bottom "")
- (setq bottom nil)))
- (setq prompt (concat prompt
- bottom
- (if secondary
- ", Secondary marker: "
- ", Secondary marker (none): "))
- secondary (read-string prompt secondary))
- (and (equal secondary "")
- (setq secondary nil))
- (list mode top bottom secondary nil t)))
- (let ((object (assq mode folding-mode-marks-alist)))
- (if (and object
- noforce
- message)
- (message "Fold markers for `%s' are already set."
- (symbol-name mode))
- (if object
- (or noforce
- (setcdr object (if secondary
- (list top bottom secondary)
- (list top bottom))))
- (setq folding-mode-marks-alist
- (cons (if secondary
- (list mode top bottom secondary)
- (list mode top bottom))
- folding-mode-marks-alist)))
- (and message
- (message "Set fold marks for `%s' to \"%s\" and \"%s\"."
- (symbol-name mode)
- (if secondary
- (concat top "name" secondary)
- (concat top "name"))
- bottom)
- (and (eq major-mode mode)
- (folding-set-marks top bottom secondary))))))
-
-;;}}}
-;;{{{ Set some useful default fold marks
-
-(folding-add-to-marks-list 'ada-mode "-- {{{" "-- }}}" nil t)
-(folding-add-to-marks-list 'asm-mode "; {{{" "; }}}" nil t)
-(folding-add-to-marks-list 'awk-mode "# {{{" "# }}}" nil t)
-(folding-add-to-marks-list 'Bison-mode "/* {{{" "/* }}} */" " */" t)
-(folding-add-to-marks-list 'LaTeX-mode "%{{{" "%}}}" nil t)
-(folding-add-to-marks-list 'TeX-mode "%{{{" "%}}}" nil t)
-(folding-add-to-marks-list 'bibtex-mode "%{{{" "%}}} */" nil t)
-(folding-add-to-marks-list 'bison-mode "/* {{{" "/* }}} */" " */" t)
-(folding-add-to-marks-list 'c++-mode "// {{{" "// }}}" nil t)
-(folding-add-to-marks-list 'c-mode "/* {{{" "/* }}} */" " */" t)
-(folding-add-to-marks-list 'dcl-mode "! {{{" "! }}}" nil t)
-(folding-add-to-marks-list 'change-log-mode "{{{" "}}}" nil t)
-(folding-add-to-marks-list 'cperl-mode "# {{{" "# }}}" nil t)
-(folding-add-to-marks-list 'emacs-lisp-mode ";;{{{" ";;}}}" nil t)
-(folding-add-to-marks-list 'erlang-mode "%%{{{" "%%}}}" nil t)
-(folding-add-to-marks-list 'finder-mode "{{{" "}}}" nil t)
-(folding-add-to-marks-list 'fortran-mode "! {{{" "! }}}" nil t)
-(folding-add-to-marks-list 'f90-mode "! {{{" "! }}}" nil t)
-(folding-add-to-marks-list 'generic-mode ";# " ";\$" nil t)
-(folding-add-to-marks-list 'gofer-mode "-- {{{" "-- }}}" nil t)
-(folding-add-to-marks-list 'html-mode "<!-- {{{ " "<!-- }}} -->" " -->" t)
-(folding-add-to-marks-list 'icon-mode "# {{{" "# }}}" nil t)
-(folding-add-to-marks-list 'indented-text-mode "{{{" "}}}" nil t)
-(folding-add-to-marks-list 'java-mode "// {{{" "// }}}" nil t)
-(folding-add-to-marks-list 'javascript-mode "// {{{" "// }}}" nil t)
-(folding-add-to-marks-list 'jde-mode "// {{{" "// }}}" nil t)
-(folding-add-to-marks-list 'ksh-mode "# {{{" "# }}}" nil t)
-(folding-add-to-marks-list 'latex-mode "%{{{" "%}}}" nil t)
-(folding-add-to-marks-list 'lisp-interaction-mode ";;{{{" ";;}}}" nil t)
-(folding-add-to-marks-list 'lisp-mode ";;{{{" ";;}}}" nil t)
-(folding-add-to-marks-list 'm4-mode "# {{{" "# }}}" nil t)
-(folding-add-to-marks-list 'makefile-mode "# {{{" "# }}}" nil t)
-(folding-add-to-marks-list 'matlab-mode "%%%{{{" "%%%}}}" nil t)
-(folding-add-to-marks-list 'meta-mode "% {{{" "% }}}" nil t)
-(folding-add-to-marks-list 'ml-mode "(* {{{" "(* }}} *)" " *)" t)
-(folding-add-to-marks-list 'modula-2-mode "(* {{{" "(* }}} *)" " *)" t)
-(folding-add-to-marks-list 'nroff-mode "\\\\ {{{" "\\\\ }}}" nil t)
-(folding-add-to-marks-list 'occam-mode "-- {{{" "-- }}}" nil t)
-(folding-add-to-marks-list 'orwell-mode "{{{" "}}}" nil t)
-(folding-add-to-marks-list 'pascal-mode "{ ((( " "{ ))) }" " }" t)
-(folding-add-to-marks-list 'php-mode "// {{{" "// }}}" nil t)
-(folding-add-to-marks-list 'perl-mode "# {{{" "# }}}" nil t)
-(folding-add-to-marks-list 'plain-TeX-mode "%{{{" "%}}}" nil t)
-(folding-add-to-marks-list 'plain-tex-mode "%{{{" "%}}}" nil t)
-(folding-add-to-marks-list 'prolog-mode "% {{{" "% }}}" nil t)
-(folding-add-to-marks-list 'python-mode "# {{{" "# }}}" nil t)
-(folding-add-to-marks-list 'rexx-mode "/* {{{" "/* }}} */" " */" t)
-(folding-add-to-marks-list 'sh-mode "# {{{" "# }}}" nil t)
-(folding-add-to-marks-list 'sh-script-mode "# {{{" "# }}}" nil t)
-(folding-add-to-marks-list 'shellscript-mode "# {{{" "# }}}" nil t)
-(folding-add-to-marks-list 'sgml-mode "<!-- [[[ " "<!-- ]]] -->" " -->" t)
-(folding-add-to-marks-list 'simula-mode "! {{{" "! }}}" nil t)
-(folding-add-to-marks-list 'sml-mode "(* {{{" "(* }}} *)" " *)" t)
-(folding-add-to-marks-list 'sql-mode "-- {{{" "-- }}}" nil t)
-(folding-add-to-marks-list 'tcl-mode "#{{{" "#}}}" nil t)
-(folding-add-to-marks-list 'tex-mode "%{{{" "%}}}" nil t)
-(folding-add-to-marks-list 'texinfo-mode "@c {{{" "@c {{{endfold}}}" " }}}" t)
-(folding-add-to-marks-list 'text-mode "{{{" "}}}" nil t)
-(folding-add-to-marks-list 'vhdl-mode "# {{{" "# }}}" nil t)
-(folding-add-to-marks-list 'xerl-mode "%%{{{" "%%}}}" nil t)
-(folding-add-to-marks-list 'xrdb-mode "! {{{" "! }}}" nil t)
-
-;; heavy shell-perl-awk programmer in fundamental-mode need # prefix...
-
-(folding-add-to-marks-list 'fundamental-mode "# {{{" "# }}}" nil t)
-
-;;}}}
-
-;;}}}
-
-;;{{{ code: Gross, crufty hacks that seem necessary
-
-;; ----------------------------------------------------------------------
-;; The functions here have been tested with Emacs 18.55, Emacs 18.58,
-;; Epoch 4.0p2 (based on Emacs 18.58) and XEmacs 19.6.
-
-;; Note that XEmacs 19.6 can't do selective-display, and its
-;; "invisible extents" don't work either, so Folding mode just won't
-;; work with that version.
-
-;; They shouldn't do the wrong thing with later versions of Emacs, but
-;; they might not have the special effects either. They may appear to
-;; be excessive; that is not the case. All of the peculiar things these
-;; functions do is done to avoid some side-effect of Emacs' internal
-;; logic that I have met. Some of them work around bugs or unfortunate
-;; (lack of) features in Emacs. In most cases, it would be better to
-;; move this into the Emacs C code.
-
-;; Folding mode is designed to be simple to cooperate with as many
-;; things as possible. These functions go against that principle at the
-;; coding level, but make life for the user bearable.
-
-;;{{{ folding-subst-regions
-
-;; Substitute newlines for carriage returns or vice versa.
-;; Avoid excessive file locking.
-
-;; Substitutes characters in the buffer, even in a read-only buffer.
-;; Takes LIST, a list of regions specified as sequence in the form
-;; (START1 END1 START2 END2 ...). In every region specified by each
-;; pair, substitutes each occurence of character FIND by REPLACE.
-
-;; The buffer-modified flag is not affected, undo information is not
-;; kept for the change, and the function works on read-only files. This
-;; function is much more efficient called with a long sequence than
-;; called for each region in the sequence.
-
-;; If the buffer is not modified when the function is called, the
-;; modified-flag is set before performing all the substitutions, and
-;; locking is temporarily disabled. This prevents Emacs from trying to
-;; make then delete a lock file for *every* substitution, which slows
-;; folding considerably, especially on a slow networked filesystem.
-;; Without this, on my system, folding files on startup (and reading
-;; other peoples' folded files) takes about five times longer. Emacs
-;; still locks the file once for this call under those circumstances; I
-;; can't think of a way around that, but it isn't really a problem.
-
-;; I consider these problems to be a bug in `subst-char-in-region'.
-
-(defun folding-subst-regions (list find replace)
- "Substitute \\r and \\n using LIST FIND REPLACE."
- (let ((buffer-read-only buffer-read-only) ;; Protect read-only flag.
- (modified (buffer-modified-p))
- (font-lock-mode nil)
- (lazy-lock-mode nil)
- (overlay-p (folding-use-overlays-p))
- (ask1 (symbol-function 'ask-user-about-supersession-threat))
- (ask2 (symbol-function 'ask-user-about-lock)))
- (if lazy-lock-mode ;; no-op: Byte compiler silencer
- (setq lazy-lock-mode t))
- (unwind-protect
- (progn
- (setq buffer-read-only nil)
- (or modified
- (progn
- (fset 'ask-user-about-supersession-threat
- '(lambda (&rest x) nil))
- (fset 'ask-user-about-lock
- '(lambda (&rest x) nil))
- (set-buffer-modified-p t))) ; Prevent file locking in the loop
- (while list
- (if overlay-p
- (folding-flag-region (car list) (nth 1 list) (eq find ?\n))
- (subst-char-in-region (car list) (nth 1 list) find replace t))
- (setq list (cdr (cdr list)))))
- ;; buffer-read-only is restored by the let.
- ;; Don't want to change MODIFF time if it was modified before.
- (or modified
- (unwind-protect
- (set-buffer-modified-p nil)
- (fset 'ask-user-about-supersession-threat ask1)
- (fset 'ask-user-about-lock ask2))))))
-
-;;}}}
-;;{{{ folding-narrow-to-region
-
-;; Narrow to region, without surprising displays.
-
-;; Similar to `narrow-to-region', but also adjusts window-start to be
-;; the start of the narrowed region. If an optional argument CENTRE is
-;; non-nil, the window-start is positioned to leave the point at the
-;; centre of the window, like `recenter'. START may be nil, in which
-;; case the function acts more like `widen'.
-
-;; Actually, all the window-starts for every window displaying the
-;; buffer, as well as the last_window_start for the buffer are set. The
-;; points in every window are set to the point in the current buffer.
-;; All this logic is necessary to prevent the display getting really
-;; weird occasionally, even if there is only one window. Try making
-;; this function like normal `narrow-to-region' with a touch of
-;; `recenter', then moving around lots of folds in a buffer displayed in
-;; several windows. You'll see what I mean.
-
-;; last_window_start is set by making sure that the selected window is
-;; displaying the current buffer, then setting the window-start, then
-;; making the selected window display another buffer (which sets
-;; last_window_start), then setting the selected window to redisplay the
-;; buffer it displayed originally.
-
-;; Note that whenever window-start is set, the point cannot be moved
-;; outside the displayed area until after a proper redisplay. If this
-;; is possible, centre the display on the point.
-
-;; In Emacs 19; Epoch or XEmacs, searches all screens for all
-;; windows. In Emacs 19, they are called "frames".
-
-(defun folding-narrow-to-region (&optional start end centre)
- "Narrow to region START END, possibly CENTRE."
- (let* ((the-window (selected-window))
- (selected-buffer (window-buffer the-window))
- (window-ring the-window)
- (window the-window)
- (point (point))
- (buffer (current-buffer))
- temp)
- (unwind-protect
- (progn
- (unwind-protect
- (progn
- (if (folding-use-overlays-p)
- (if start
- (folding-narrow-aux start end t)
- (folding-narrow-aux nil nil nil))
- (if start
- (narrow-to-region start end)
- (widen)))
-
- (setq point (point))
- (set-window-buffer window buffer)
-
- (while (progn
- (and (eq buffer (window-buffer window))
- (if centre
- (progn
- (select-window window)
- (goto-char point)
- (vertical-motion
- (- (lsh (window-height window) -1)))
- (set-window-start window (point))
- (set-window-point window point))
- (set-window-start window (or start 1))
- (set-window-point window point)))
-
- (not (eq (setq window (next-window window nil t))
- window-ring)))))
- nil ;; epoch screen
- (select-window the-window)) ;; unwind-protect INNER
- ;; Set last_window_start.
- (unwind-protect
- (if (not (eq buffer selected-buffer))
- (set-window-buffer the-window selected-buffer)
- (if (get-buffer "*scratch*")
- (set-window-buffer the-window (get-buffer "*scratch*"))
- (set-window-buffer
- the-window (setq temp (generate-new-buffer " *temp*"))))
- (set-window-buffer the-window buffer))
- (and temp
- (kill-buffer temp))))
- ;; Undo this side-effect of set-window-buffer.
- (set-buffer buffer)
- (goto-char (point)))))
-
-;;}}}
-
-;;}}}
-
-;;{{{ code: folding-end-mode-quickly
-
-(defun folding-end-mode-quickly ()
- "Replace all ^M's with linefeeds and widen a folded buffer.
-Only has any effect if Folding mode is active.
-
-This should not in general be used for anything. It is used when changing
-major modes, by being placed in kill-mode-tidy-alist, to tidy the buffer
-slightly. It is similar to `(folding-mode 0)', except that it does not
-restore saved keymaps etc. Repeat: Do not use this function. Its
-behaviour is liable to change."
- (and (boundp 'folding-mode)
- (assq 'folding-mode
- (buffer-local-variables))
- folding-mode
- (progn
- (if (folding-use-overlays-p)
- (folding-narrow-to-region nil nil)
- (widen))
- (folding-clear-stack)
- (folding-subst-regions (list 1 (point-max)) ?\r ?\n))))
-
-;;{{{ folding-eval-current-buffer-open-folds
-
-(defun folding-eval-current-buffer-open-folds (&optional printflag)
- "Evaluate all of a folded buffer as Lisp code.
-Unlike `eval-current-buffer', this function will evaluate all of a
-buffer, even if it is folded. It will also work correctly on non-folded
-buffers, so is a good candidate for being bound to a key if you program
-in Emacs-Lisp.
-
-It works by making a copy of the current buffer in another buffer,
-unfolding it and evaluating it. It then deletes the copy.
-
-Programs can pass argument PRINTFLAG which controls printing of output:
-nil means discard it; anything else is stream for print."
- (interactive)
- (if (or (and (boundp 'folding-mode)
- folding-mode))
- (let ((temp-buffer
- (generate-new-buffer (buffer-name))))
- (message "Evaluating unfolded buffer...")
- (save-restriction
- (widen)
- (copy-to-buffer temp-buffer 1 (point-max)))
- (set-buffer temp-buffer)
- (subst-char-in-region 1 (point-max) ?\r ?\n)
- (let ((real-message-def (symbol-function 'message))
- (suppress-eval-message))
- (fset 'message
- (function
- (lambda (&rest args)
- (setq suppress-eval-message t)
- (fset 'message real-message-def)
- (apply 'message args))))
- (unwind-protect
- (eval-current-buffer printflag)
- (fset 'message real-message-def)
- (kill-buffer temp-buffer))
- (or suppress-eval-message
- (message "Evaluating unfolded buffer... Done"))))
- (eval-current-buffer printflag)))
-
-;;}}}
-
-;;}}}
-
-;;{{{ code: ISearch support, walks in and out of folds
-
-;; This used to be a package of it's own.
-;; Requires Emacs 19 or XEmacs. Does not work under Emacs 18.
-
-;;{{{ Variables
-
-(defcustom folding-isearch-install t
- "*When non-nil, the isearch commands will handle folds."
- :type 'boolean
- :group 'folding)
-
-(defvar folding-isearch-stack nil
- "Temporary storage for `folding-stack' during isearch.")
-
-;; Lists of isearch commands to replace
-
-;; These do normal searching.
-
-(defvar folding-isearch-normal-cmds
- '(isearch-repeat-forward
- isearch-repeat-backward
- isearch-toggle-regexp
- isearch-toggle-case-fold
- isearch-delete-char
- isearch-abort
- isearch-quote-char
- isearch-other-control-char
- isearch-other-meta-char
- isearch-return-char
- isearch-exit
- isearch-printing-char
- isearch-whitespace-chars
- isearch-yank-word
- isearch-yank-line
- isearch-yank-kill
- isearch-*-char
- isearch-\|-char
- isearch-mode-help
- isearch-yank-x-selection
- isearch-yank-x-clipboard)
- "List if isearch commands doing normal search.")
-
-;; Enables the user to edit the search string
-
-;; Missing, present in XEmacs isearch-mode.el. Not necessary?
-;; isearch-ring-advance-edit, isearch-ring-retreat-edit, isearch-complete-edit
-;; isearch-nonincremental-exit-minibuffer, isearch-yank-x-selection,
-;; isearch-yank-x-clipboard
-
-(defvar folding-isearch-edit-enter-cmds
- '(isearch-edit-string
- isearch-ring-advance
- isearch-ring-retreat
- isearch-complete) ; (Could also stay in search mode!)
- "List of isearch commands which enters search string edit.")
-
-;; Continues searching after editing.
-
-(defvar folding-isearch-edit-exit-cmds
- '(isearch-forward-exit-minibuffer ; Exits edit
- isearch-reverse-exit-minibuffer
- isearch-nonincremental-exit-minibuffer)
- "List of isearch commands which exits search string edit.")
-
-;;}}}
-;;{{{ Keymaps (an Isearch hook)
-
-(defvar folding-isearch-mode-map nil
- "Modified copy of the isearch keymap.")
-
-;; Create local copies of the keymaps. The `isearch-mode-map' is
-;; copied to `folding-isearch-mode-map' while `minibuffer-local-isearch-map'
-;; is made local. (Its name is used explicitly.)
-;;
-;; Note: This is called every time the search is started.
-
-(defun folding-isearch-hook-function ()
- "Update the isearch keymaps for usage with folding mode."
- (if (and (boundp 'folding-mode) folding-mode)
- (let ((cmds (append folding-isearch-normal-cmds
- folding-isearch-edit-enter-cmds
- folding-isearch-edit-exit-cmds)))
- (setq folding-isearch-mode-map (copy-keymap isearch-mode-map))
- (make-local-variable 'minibuffer-local-isearch-map)
- ;; Make sure the destructive operations below doesn't alter
- ;; the global instance of the map.
- (setq minibuffer-local-isearch-map
- (copy-keymap minibuffer-local-isearch-map))
- (setq folding-isearch-stack folding-stack)
- (while cmds
- (substitute-key-definition
- (car cmds)
- (intern (concat "folding-" (symbol-name (car cmds))))
- folding-isearch-mode-map)
- (substitute-key-definition
- (car cmds)
- (intern (concat "folding-" (symbol-name (car cmds))))
- minibuffer-local-isearch-map)
- (setq cmds (cdr cmds)))
- ;; Install our keymap
- (cond
- (folding-xemacs-p
- (let ((f 'set-keymap-name))
- (funcall f folding-isearch-mode-map 'folding-isearch-mode-map))
- ;; Later version of XEmacs (21.2+) use overriding-local-map
- ;; for isearch keymap rather than fiddling with
- ;; minor-mode-map-alist. This is so isearch keymaps take
- ;; precedence over extent-local keymaps. We will support
- ;; both ways here. Keymaps will be restored as side-effect
- ;; of isearch-abort and isearch-quit
- (cond
- ;; if overriding-local-map is in use
- ((and (boundp 'overriding-local-map) overriding-local-map)
- (set-keymap-parent folding-isearch-mode-map overriding-local-map)
- (setq overriding-local-map folding-isearch-mode-map))
- ;; otherwise fiddle with minor-mode-map-alist
- (t
- (setq minor-mode-map-alist
- (cons (cons 'isearch-mode folding-isearch-mode-map)
- (delq (assoc 'isearch-mode minor-mode-map-alist)
- minor-mode-map-alist))))))
- ((boundp 'overriding-terminal-local-map)
- (funcall (symbol-function 'set)
- 'overriding-terminal-local-map folding-isearch-mode-map))
- ((boundp 'overriding-local-map)
- (setq overriding-local-map folding-isearch-mode-map))))))
-
-;; Undoes the `folding-isearch-hook-function' function.
-
-(defun folding-isearch-end-hook-function ()
- "Actions to perform at the end of isearch in folding mode."
- (when (and (boundp 'folding-mode) folding-mode)
- (kill-local-variable 'minibuffer-local-isearch-map)
- (setq folding-stack folding-isearch-stack)))
-
-(when folding-isearch-install
- (add-hook 'isearch-mode-hook 'folding-isearch-hook-function)
- (add-hook 'isearch-mode-end-hook 'folding-isearch-end-hook-function))
-
-;;}}}
-;;{{{ Normal search routines
-
-;; Generate the replacement functions of the form:
-;; (defun folding-isearch-repeat-forward ()
-;; (interactive)
-;; (folding-isearch-general 'isearch-repeat-forward))
-
-(let ((cmds folding-isearch-normal-cmds))
- (while cmds
- (eval
- `(defun ,(intern (concat "folding-" (symbol-name (car cmds))))
- nil
- "Automatically generated"
- (interactive)
- (folding-isearch-general (quote ,(car cmds)))))
- (setq cmds (cdr cmds))))
-
-;; The HEART! Executes command and updates the foldings.
-;; This is capable of detecting a `quit'.
-
-(defun folding-isearch-general (function)
- "Execute isearch command FUNCTION and adjusts the folding."
- (let* ((quit-isearch nil)
- (area-beg (point-min))
- (area-end (point-max))
- pos)
- (cond
- (t
- (save-restriction
- (widen)
- (condition-case nil
- (funcall function)
- (quit (setq quit-isearch t)))
- (setq pos (point)))
- ;; Situation
- ;; o user has folded buffer
- ;; o He manually narrows, say to function !
- ;; --> there is no fold marks at the beg/end --> this is not a fold
- (condition-case nil
- ;; "current mode has no fold marks..."
- (folding-region-has-folding-marks-p area-beg area-end)
- (error (setq quit-isearch t)))
- (folding-goto-char pos)))
- (if quit-isearch
- (signal 'quit '(isearch)))))
-
-;;}}}
-;;{{{ Edit search string support
-
-(defvar folding-isearch-current-buffer nil
- "The buffer we are editing, so we can widen it when in minibuffer.")
-
-;; Functions which enters edit mode.
-
-(defun folding-isearch-edit-string ()
- "Replace `isearch-edit-string' when in `folding-mode'."
- (interactive)
- (folding-isearch-start-edit 'isearch-edit-string))
-
-(defun folding-isearch-ring-advance ()
- "Replace `isearch-ring-advance' when in `folding-mode'."
- (interactive)
- (folding-isearch-start-edit 'isearch-ring-advance))
-
-(defun folding-isearch-ring-retreat ()
- "Replace `isearch-ring-retreat' when in `folding-mode'."
- (interactive)
- (folding-isearch-start-edit 'isearch-ring-retreat))
-
-(defun folding-isearch-complete ()
- "Replace `isearch-complete' when in `folding-mode'."
- (interactive)
- (folding-isearch-start-edit 'isearch-complete))
-
-;; Start and wait for editing. When (funcall fnk) returns
-;; we are back in interactive search mode.
-;;
-;; Store match data!
-
-(defun folding-isearch-start-edit (function)
- "Edit with function FUNCTION."
- (let (pos)
- (setq folding-isearch-current-buffer (current-buffer))
- (save-restriction
- (funcall function)
- ;; Here, we are widened, by folding-isearch-*-exit-minibuffer.
- (setq pos (point)))
- (folding-goto-char pos)))
-
-;; Functions which exits edit mode.
-
-;; The `widen' below will be caught by the `save-restriction' above, thus
-;; this will not cripple `folding-stack'.
-
-(defun folding-isearch-forward-exit-minibuffer ()
- "Replace `isearch-forward-exit-minibuffer' when in `folding-mode'."
- (interactive)
- ;; Make sure we can continue searching outside narrowing.
- (save-excursion
- (set-buffer folding-isearch-current-buffer)
- (widen))
- (isearch-forward-exit-minibuffer))
-
-(defun folding-isearch-reverse-exit-minibuffer ()
- "Replace `isearch-reverse-exit-minibuffer' when in `folding-mode'."
- (interactive)
- ;; Make sure we can continue searching outside narrowing.
- (save-excursion
- (set-buffer folding-isearch-current-buffer)
- (widen))
- (isearch-reverse-exit-minibuffer))
-
-(defun folding-isearch-nonincremental-exit-minibuffer ()
- "Replace `isearch-reverse-exit-minibuffer' when in `folding-mode'."
- (interactive)
- ;; Make sure we can continue searching outside narrowing.
- (save-excursion
- (set-buffer folding-isearch-current-buffer)
- (widen))
- (isearch-nonincremental-exit-minibuffer))
-
-;;}}}
-;;{{{ Special XEmacs support
-
-;; In XEmacs, all isearch commands must have the property `isearch-command'.
-
-(if folding-xemacs-p
- (let ((cmds (append folding-isearch-normal-cmds
- folding-isearch-edit-enter-cmds
- folding-isearch-edit-exit-cmds)))
- (while cmds
- (put (intern (concat "folding-" (symbol-name (car cmds))))
- 'isearch-command t)
- (setq cmds (cdr cmds)))))
-
-;;}}}
-;;{{{ General purpose function.
-
-(defun folding-goto-char (pos)
- "Goto character POS, changing fold if necessary."
- ;; Make sure POS is inside the visible area of the buffer.
- (goto-char pos)
- (if (eq pos (point)) ; Point inside narrowed area?
- nil
- (folding-show-all) ; Fold everything and goto top.
- (goto-char pos))
- ;; Enter if point is folded.
- (if (folding-point-folded-p pos)
- (progn
- (folding-shift-in) ; folding-shift-in can change the pos.
- (setq folding-isearch-stack folding-stack)
- (setq folding-stack '(folded))
- (goto-char pos))))
-
-(defun folding-point-folded-p (pos)
- "Non-nil when POS is not visible."
- (if (folding-use-overlays-p)
- (let ((overlays (overlays-at (point)))
- (found nil))
- (while (and (not found) (overlayp (car overlays)))
- (setq found (overlay-get (car overlays) 'fold)
- overlays (cdr overlays)))
- found)
- (save-excursion
- (goto-char pos)
- (beginning-of-line)
- (skip-chars-forward "^\r" pos)
- (not (eq pos (point))))))
-
-;;}}}
-
-;;}}}
-;;{{{ code: Additional functions
-
-(defvar folding-comment-folding-table
- '((c-mode
- folding-comment-c-mode
- folding-uncomment-c-mode))
- "Table of functions to comment and uncomment folds.
-Function is called with two arguments:
-
- number start of fold mark
- marker end of fold mark
-
-Function must return:
-
- (beg . end) start of fold, end of fold
-
-Table Format:
- '((MAJOR-MODE COMMENT-FUNCTION UNCOMMENT-FUNCTION) ..)")
-
-(defun folding-insert-advertise-folding-mode ()
- "Insert Small text describing where to the get the folding at point.
-This may be useful 'banner' to inform other people why your code
-is formatted like it is and how to view it correctly."
- (interactive)
- (let* ((prefix "")
- (re (or comment-start-skip
- (and comment-start
- (concat "^[ \t]*" comment-start "+[ \t]*")))))
-
- (when re
- (save-excursion
- (beginning-of-line)
- (when (or (re-search-forward re nil t)
- (progn
- (goto-char (point-min))
- (re-search-forward re nil t)))
- (setq prefix (match-string 0)))))
-
- (beginning-of-line)
- (dolist (line
- (list
- "File layout controlled by Emacs folding.el available at: "
- folding-package-url-location))
- (insert "\n" prefix line))))
-
-(defun folding-uncomment-mode-generic (beg end tag)
- "In region (BEG . END) remove two TAG lines."
- (re-search-forward tag (marker-position end))
- (beginning-of-line)
- (kill-line 1)
- (re-search-forward tag (marker-position end))
- (beginning-of-line)
- (kill-line 1)
- (cons beg end))
-
-(defun folding-comment-mode-generic (beg end tag1 &optional tag2)
- "Return (BEG . END) and Add two TAG1 and TAG2 lines."
- (insert tag1)
- (goto-char (marker-position end))
- (insert (or tag2 tag1))
- (cons beg end))
-
-(defun folding-uncomment-c-mode (beg end)
- "Uncomment region BEG END."
- (folding-uncomment-mode-generic
- beg end (regexp-quote " comment /* FOLDING -COM- */")))
-
-(defun folding-comment-c-mode (beg end)
- "Comment region BEG END."
- (let* ((tag " /* FOLDING -COM- */"))
- (folding-comment-mode-generic
- beg end
- (concat "#if comment" tag "\n")
- (concat "#endif comment" tag "\n"))))
-
-(defun folding-comment-fold (&optional uncomment)
- "Comment or UNCOMMENT all text inside single fold.
-If there are subfolds this function won't work as expected.
-User must know that there are no subfolds.
-
-The heading has -COM- at the end when the fold is commented.
-Point must be over fold heading {{{ when function is called.
-
-Note:
-
- You can use this function only in modes that do _not_ have
- `comment-end'. Ie. don't use this function in modes like C (/* */), because
- nested comments are not allowed. See this:
-
- /* {{{ fold */
- code /* comment of the code */
- /* }}} */
-
- Fold can't know how to comment the `code' inside fold, because comments
- do not nest.
-
-Implementation detail:
-
- {{{ FoldHeader-COM-
-
- If the fold header has -COM- at the end, then the fold is supposed to
- be commented. And if there is no -COM- then fold will be considered
- as normal fold. Do not loose or add the -COM- yourself or it will
- confuse the state of the fold.
-
-References:
-
- `folding-comment-folding-table'"
- (interactive "P")
- (let* ((state (folding-mark-look-at 'move))
- (closed (eq 0 state))
- (id "-COM-")
- (opoint (point))
- (mode-elt (assq major-mode folding-comment-folding-table))
- comment
- ret
- beg
- end)
- (unless mode-elt
- (if (stringp (nth 2 (folding-get-mode-marks major-mode)))
- (error "\
-Folding: function usage error, mode with `comment-end' is not supported.")))
- (when (or (null comment-start)
- (not (string-match "[^ \t\n]" comment-start)))
- (error "Empty comment-start."))
- (unless (memq state '( 0 1 11))
- (error "Incorrect fold state. Point must be over {{{."))
- ;; There is nothing to do if this fold heading does not have
- ;; the ID when uncommenting the fold.
- (setq state (looking-at (concat ".*" id)))
- (when (or (and uncomment state)
- (and (null uncomment) (null state)))
- (when closed (save-excursion (folding-show-current-entry)))
- (folding-pick-move) ;Go to end
- (beginning-of-line)
- (setq end (point-marker))
- (goto-char opoint) ;And off the fold heading
- (forward-line 1)
- (setq beg (point))
- (setq comment (concat comment-start id))
- (cond
- (mode-elt
- (setq ret
- (if uncomment
- (funcall (nth 2 mode-elt) (point) end)
- (funcall (nth 1 mode-elt) (point) end)))
- (goto-char (cdr ret)))
- (uncomment
- (while (< (point) (marker-position end))
- (if (looking-at comment)
- (delete-region (point) (match-end 0)))
- (forward-line 1)))
- (t
- (while (< (point) (marker-position end))
- (if (not (looking-at comment))
- (insert comment))
- (forward-line 1))))
- (setq end nil) ;kill marker
- ;; Remove the possible tag from the fold name line
- (goto-char opoint)
- (setq id (concat (or comment-start "") id (or comment-end "")))
- (if (re-search-forward (regexp-quote id) beg t)
- (delete-region (match-beginning 0) (match-end 0)))
- (when (null uncomment)
- (end-of-line)
- (insert id))
- (if closed
- (folding-hide-current-entry))
- (goto-char opoint))))
-
-(defun folding-convert-to-major-folds ()
- "Convert fold mark items according to `major-mode'.
-This function replaces all fold markings }}} and {{{
-with major mode's fold marks.
-
-As a side effect also corrects all foldings to standard notation.
-Eg. following, where correct folding-beg should be \"#{{{ \"
-Note that /// marks foldings.
-
- /// ;wrong fold
- # /// ;too many spaces, fold format error
- # ///title ;ok, but title too close
-
- produces
-
- #///
- #///
- #/// title
-
-You must 'unfold' whole buffer before using this function."
- (interactive)
- (let (case-fold-search
- (bm "{{{") ; begin match mark
- (em "}}}") ;
- el ; element
- b ; begin
- e ; end
- e2 ; end2
- pp)
- (catch 'out ; is folding active/loaded ??
- (unless (setq el (folding-get-mode-marks major-mode))
- (throw 'out t)) ; ** no mode found
- ;; ok , we're in business. Search whole buffer and replace.
- (setq b (elt el 0)
- e (elt el 1)
- e2 (or (elt el 2) ""))
- (save-excursion
- (goto-char (point-min)) ; start from the beginning of buffer
- (while (re-search-forward (regexp-quote bm) nil t)
- ;; set the end position for fold marker
- (setq pp (point))
- (beginning-of-line)
- (if (looking-at (regexp-quote b)) ; should be mode-marked; ok, ignore
- (goto-char pp) ; note that beg-of-l cmd, move rexp
- (delete-region (point) pp)
- (insert b)
- (when (not (string= "" e2))
- (unless (looking-at (concat ".*" (regexp-quote e2)))
- ;; replace with right fold mark
- (end-of-line)
- (insert e2)))))
- ;; handle end marks , identical func compared to prev.
- (goto-char (point-min))
- (while (re-search-forward (regexp-quote em)nil t)
- (setq pp (point))
- (beginning-of-line)
- (if (looking-at (regexp-quote e))
- (goto-char pp)
- (delete-region (point) (progn (end-of-line) (point)))
- (insert e)))))))
-
-(defun folding-all-comment-blocks-in-region (beg end)
- "Put all comments in folds inside BEG END.
-Notice: Make sure there is no interfering folds inside the area,
-because the results may and up corrupted.
-
-This only works for modes that DO NOT have `comment-end'.
-The `comment-start' must be left flushed in order to counted in.
-
-After this
-
- ;; comment
- ;; comment
-
- code
-
- ;; comment
- ;; comment
-
- code
-
-The result will be:
-
- ;; {{{ 1
-
- ;; comment
- ;; comment
-
- ;; }}}
-
- code
-
- ;; {{{ 2
-
- ;; comment
- ;; comment
-
- ;; }}}
-
- code"
- (interactive "*r")
-
- (unless comment-start
- (error "Folding: Mode does not define `comment-start'"))
-
- (when (and (stringp comment-end)
- (string-match "[^ \t]" comment-end))
- (error "Folding: Mode defines non-empty `comment-end'."))
- (let* ((count 0)
- (comment-regexp (concat "^" comment-start))
- (marker (point-marker))
- done)
- (destructuring-bind (left right ignore)
- (folding-get-mode-marks)
- ;; Bytecomp silencer: variable ignore bound but not referenced
- (if ignore (setq ignore ignore))
- ;; %%%{{{ --> "%%%"
- (string-match (concat (regexp-quote comment-start) "+") left)
- (save-excursion
- (goto-char beg)
- (beginning-of-line)
- (while (re-search-forward comment-regexp nil t)
- (move-marker marker (point))
- (setq done nil)
- (beginning-of-line)
- (forward-line -1)
- ;; 2 previous lines Must not contain FOLD beginning already
- (unless (looking-at (regexp-quote left))
- (forward-line -1)
- (unless (looking-at (regexp-quote left))
- (goto-char (marker-position marker))
- (beginning-of-line)
- (insert left " " (int-to-string count) "\n\n")
- (incf count)
- (setq done t)))
- (goto-char (marker-position marker))
- (when done
- ;; Try finding pat of the comment block
- (if (not (re-search-forward "^[ \t]*$" nil t))
- (goto-char end))
- (open-line 1)
- (forward-line 1)
- (insert right "\n")))))))
-
-;;}}}
-;;{{{ code: Overlay support
-
-(defun folding-use-overlays-p ()
- "Should folding use overlays?."
- (if folding-allow-overlays
- (if folding-xemacs-p
- ;; See if we can load overlay.el library that comes in 19.15
- ;; This call returns t or nil if load was successful
- ;; Note: is there provide statement? Load is so radical
- ;;
- (load "overlay" 'noerr)
- t)))
-
-(defun folding-flag-region (from to flag)
- "Hide or show lines from FROM to TO, according to FLAG.
-If FLAG is nil then text is shown, while if FLAG is t the text is hidden."
- (let ((inhibit-read-only t)
- overlay)
- (save-excursion
- (goto-char from)
- (end-of-line)
- (cond
- (flag
- (setq overlay (make-overlay (point) to))
- (folding-make-overlay-hidden overlay))
- (t
- (if (fboundp 'hs-discard-overlays)
- (funcall (symbol-function 'hs-discard-overlays)
- (point) to 'invisible t)))))))
-
-(defun folding-make-overlay-hidden (overlay)
- "Make OVERLAY hidden."
- (overlay-put overlay 'fold t)
- ;; (overlay-put overlay 'intangible t)
- (overlay-put overlay 'invisible t)
- (overlay-put overlay 'owner 'folding))
-
-(defun folding-narrow-aux (start end arg)
- "Narrow. Make overlay from `point-min' to START.
-And from END t `point-min'. If ARG is nil, delete overlays."
- (if (null arg)
- (cond
- (folding-narrow-overlays
- (delete-overlay (car folding-narrow-overlays))
- (delete-overlay (cdr folding-narrow-overlays))
- (setq folding-narrow-overlays nil)))
- (let ((overlay-beg (make-overlay (point-min) start))
- (overlay-end (make-overlay end (point-max))))
- (overlay-put overlay-beg 'folding-narrow t)
- (overlay-put overlay-beg 'invisible t)
- (overlay-put overlay-beg 'owner 'folding)
- (overlay-put overlay-end 'folding-narrow t)
- (overlay-put overlay-end 'invisible t)
- (overlay-put overlay-end 'owner 'folding)
- (setq folding-narrow-overlays (cons overlay-beg overlay-end)))))
-
-;;}}}
-;;{{{ code: end of file tag, provide
-
-(folding-install)
-
-(provide 'folding)
-(provide 'folding-isearch) ;; This used to be a separate package.
-
-(run-hooks 'folding-load-hook)
-
-;;}}}
-
-;;; folding.el ends here
diff --git a/.emacs.d/identica-mode-1.1.tar.gz b/.emacs.d/identica-mode-1.1.tar.gz
deleted file mode 100644
index 31d4190..0000000
--- a/.emacs.d/identica-mode-1.1.tar.gz
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/identica-mode-1.1/.gitignore b/.emacs.d/identica-mode-1.1/.gitignore
deleted file mode 100644
index 26db85e..0000000
--- a/.emacs.d/identica-mode-1.1/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-TAGS \ No newline at end of file
diff --git a/.emacs.d/identica-mode-1.1/COPYING b/.emacs.d/identica-mode-1.1/COPYING
deleted file mode 100755
index d511905..0000000
--- a/.emacs.d/identica-mode-1.1/COPYING
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/.emacs.d/identica-mode-1.1/doc/fdl.texi b/.emacs.d/identica-mode-1.1/doc/fdl.texi
deleted file mode 100644
index 96ce74e..0000000
--- a/.emacs.d/identica-mode-1.1/doc/fdl.texi
+++ /dev/null
@@ -1,451 +0,0 @@
-@c The GNU Free Documentation License.
-@center Version 1.2, November 2002
-
-@c This file is intended to be included within another document,
-@c hence no sectioning command or @node.
-
-@display
-Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
-51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
-
-Everyone is permitted to copy and distribute verbatim copies
-of this license document, but changing it is not allowed.
-@end display
-
-@enumerate 0
-@item
-PREAMBLE
-
-The purpose of this License is to make a manual, textbook, or other
-functional and useful document @dfn{free} in the sense of freedom: to
-assure everyone the effective freedom to copy and redistribute it,
-with or without modifying it, either commercially or noncommercially.
-Secondarily, this License preserves for the author and publisher a way
-to get credit for their work, while not being considered responsible
-for modifications made by others.
-
-This License is a kind of ``copyleft'', which means that derivative
-works of the document must themselves be free in the same sense. It
-complements the GNU General Public License, which is a copyleft
-license designed for free software.
-
-We have designed this License in order to use it for manuals for free
-software, because free software needs free documentation: a free
-program should come with manuals providing the same freedoms that the
-software does. But this License is not limited to software manuals;
-it can be used for any textual work, regardless of subject matter or
-whether it is published as a printed book. We recommend this License
-principally for works whose purpose is instruction or reference.
-
-@item
-APPLICABILITY AND DEFINITIONS
-
-This License applies to any manual or other work, in any medium, that
-contains a notice placed by the copyright holder saying it can be
-distributed under the terms of this License. Such a notice grants a
-world-wide, royalty-free license, unlimited in duration, to use that
-work under the conditions stated herein. The ``Document'', below,
-refers to any such manual or work. Any member of the public is a
-licensee, and is addressed as ``you''. You accept the license if you
-copy, modify or distribute the work in a way requiring permission
-under copyright law.
-
-A ``Modified Version'' of the Document means any work containing the
-Document or a portion of it, either copied verbatim, or with
-modifications and/or translated into another language.
-
-A ``Secondary Section'' is a named appendix or a front-matter section
-of the Document that deals exclusively with the relationship of the
-publishers or authors of the Document to the Document's overall
-subject (or to related matters) and contains nothing that could fall
-directly within that overall subject. (Thus, if the Document is in
-part a textbook of mathematics, a Secondary Section may not explain
-any mathematics.) The relationship could be a matter of historical
-connection with the subject or with related matters, or of legal,
-commercial, philosophical, ethical or political position regarding
-them.
-
-The ``Invariant Sections'' are certain Secondary Sections whose titles
-are designated, as being those of Invariant Sections, in the notice
-that says that the Document is released under this License. If a
-section does not fit the above definition of Secondary then it is not
-allowed to be designated as Invariant. The Document may contain zero
-Invariant Sections. If the Document does not identify any Invariant
-Sections then there are none.
-
-The ``Cover Texts'' are certain short passages of text that are listed,
-as Front-Cover Texts or Back-Cover Texts, in the notice that says that
-the Document is released under this License. A Front-Cover Text may
-be at most 5 words, and a Back-Cover Text may be at most 25 words.
-
-A ``Transparent'' copy of the Document means a machine-readable copy,
-represented in a format whose specification is available to the
-general public, that is suitable for revising the document
-straightforwardly with generic text editors or (for images composed of
-pixels) generic paint programs or (for drawings) some widely available
-drawing editor, and that is suitable for input to text formatters or
-for automatic translation to a variety of formats suitable for input
-to text formatters. A copy made in an otherwise Transparent file
-format whose markup, or absence of markup, has been arranged to thwart
-or discourage subsequent modification by readers is not Transparent.
-An image format is not Transparent if used for any substantial amount
-of text. A copy that is not ``Transparent'' is called ``Opaque''.
-
-Examples of suitable formats for Transparent copies include plain
-@sc{ascii} without markup, Texinfo input format, La@TeX{} input
-format, @acronym{SGML} or @acronym{XML} using a publicly available
-@acronym{DTD}, and standard-conforming simple @acronym{HTML},
-PostScript or @acronym{PDF} designed for human modification. Examples
-of transparent image formats include @acronym{PNG}, @acronym{XCF} and
-@acronym{JPG}. Opaque formats include proprietary formats that can be
-read and edited only by proprietary word processors, @acronym{SGML} or
-@acronym{XML} for which the @acronym{DTD} and/or processing tools are
-not generally available, and the machine-generated @acronym{HTML},
-PostScript or @acronym{PDF} produced by some word processors for
-output purposes only.
-
-The ``Title Page'' means, for a printed book, the title page itself,
-plus such following pages as are needed to hold, legibly, the material
-this License requires to appear in the title page. For works in
-formats which do not have any title page as such, ``Title Page'' means
-the text near the most prominent appearance of the work's title,
-preceding the beginning of the body of the text.
-
-A section ``Entitled XYZ'' means a named subunit of the Document whose
-title either is precisely XYZ or contains XYZ in parentheses following
-text that translates XYZ in another language. (Here XYZ stands for a
-specific section name mentioned below, such as ``Acknowledgements'',
-``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
-of such a section when you modify the Document means that it remains a
-section ``Entitled XYZ'' according to this definition.
-
-The Document may include Warranty Disclaimers next to the notice which
-states that this License applies to the Document. These Warranty
-Disclaimers are considered to be included by reference in this
-License, but only as regards disclaiming warranties: any other
-implication that these Warranty Disclaimers may have is void and has
-no effect on the meaning of this License.
-
-@item
-VERBATIM COPYING
-
-You may copy and distribute the Document in any medium, either
-commercially or noncommercially, provided that this License, the
-copyright notices, and the license notice saying this License applies
-to the Document are reproduced in all copies, and that you add no other
-conditions whatsoever to those of this License. You may not use
-technical measures to obstruct or control the reading or further
-copying of the copies you make or distribute. However, you may accept
-compensation in exchange for copies. If you distribute a large enough
-number of copies you must also follow the conditions in section 3.
-
-You may also lend copies, under the same conditions stated above, and
-you may publicly display copies.
-
-@item
-COPYING IN QUANTITY
-
-If you publish printed copies (or copies in media that commonly have
-printed covers) of the Document, numbering more than 100, and the
-Document's license notice requires Cover Texts, you must enclose the
-copies in covers that carry, clearly and legibly, all these Cover
-Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
-the back cover. Both covers must also clearly and legibly identify
-you as the publisher of these copies. The front cover must present
-the full title with all words of the title equally prominent and
-visible. You may add other material on the covers in addition.
-Copying with changes limited to the covers, as long as they preserve
-the title of the Document and satisfy these conditions, can be treated
-as verbatim copying in other respects.
-
-If the required texts for either cover are too voluminous to fit
-legibly, you should put the first ones listed (as many as fit
-reasonably) on the actual cover, and continue the rest onto adjacent
-pages.
-
-If you publish or distribute Opaque copies of the Document numbering
-more than 100, you must either include a machine-readable Transparent
-copy along with each Opaque copy, or state in or with each Opaque copy
-a computer-network location from which the general network-using
-public has access to download using public-standard network protocols
-a complete Transparent copy of the Document, free of added material.
-If you use the latter option, you must take reasonably prudent steps,
-when you begin distribution of Opaque copies in quantity, to ensure
-that this Transparent copy will remain thus accessible at the stated
-location until at least one year after the last time you distribute an
-Opaque copy (directly or through your agents or retailers) of that
-edition to the public.
-
-It is requested, but not required, that you contact the authors of the
-Document well before redistributing any large number of copies, to give
-them a chance to provide you with an updated version of the Document.
-
-@item
-MODIFICATIONS
-
-You may copy and distribute a Modified Version of the Document under
-the conditions of sections 2 and 3 above, provided that you release
-the Modified Version under precisely this License, with the Modified
-Version filling the role of the Document, thus licensing distribution
-and modification of the Modified Version to whoever possesses a copy
-of it. In addition, you must do these things in the Modified Version:
-
-@enumerate A
-@item
-Use in the Title Page (and on the covers, if any) a title distinct
-from that of the Document, and from those of previous versions
-(which should, if there were any, be listed in the History section
-of the Document). You may use the same title as a previous version
-if the original publisher of that version gives permission.
-
-@item
-List on the Title Page, as authors, one or more persons or entities
-responsible for authorship of the modifications in the Modified
-Version, together with at least five of the principal authors of the
-Document (all of its principal authors, if it has fewer than five),
-unless they release you from this requirement.
-
-@item
-State on the Title page the name of the publisher of the
-Modified Version, as the publisher.
-
-@item
-Preserve all the copyright notices of the Document.
-
-@item
-Add an appropriate copyright notice for your modifications
-adjacent to the other copyright notices.
-
-@item
-Include, immediately after the copyright notices, a license notice
-giving the public permission to use the Modified Version under the
-terms of this License, in the form shown in the Addendum below.
-
-@item
-Preserve in that license notice the full lists of Invariant Sections
-and required Cover Texts given in the Document's license notice.
-
-@item
-Include an unaltered copy of this License.
-
-@item
-Preserve the section Entitled ``History'', Preserve its Title, and add
-to it an item stating at least the title, year, new authors, and
-publisher of the Modified Version as given on the Title Page. If
-there is no section Entitled ``History'' in the Document, create one
-stating the title, year, authors, and publisher of the Document as
-given on its Title Page, then add an item describing the Modified
-Version as stated in the previous sentence.
-
-@item
-Preserve the network location, if any, given in the Document for
-public access to a Transparent copy of the Document, and likewise
-the network locations given in the Document for previous versions
-it was based on. These may be placed in the ``History'' section.
-You may omit a network location for a work that was published at
-least four years before the Document itself, or if the original
-publisher of the version it refers to gives permission.
-
-@item
-For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
-the Title of the section, and preserve in the section all the
-substance and tone of each of the contributor acknowledgements and/or
-dedications given therein.
-
-@item
-Preserve all the Invariant Sections of the Document,
-unaltered in their text and in their titles. Section numbers
-or the equivalent are not considered part of the section titles.
-
-@item
-Delete any section Entitled ``Endorsements''. Such a section
-may not be included in the Modified Version.
-
-@item
-Do not retitle any existing section to be Entitled ``Endorsements'' or
-to conflict in title with any Invariant Section.
-
-@item
-Preserve any Warranty Disclaimers.
-@end enumerate
-
-If the Modified Version includes new front-matter sections or
-appendices that qualify as Secondary Sections and contain no material
-copied from the Document, you may at your option designate some or all
-of these sections as invariant. To do this, add their titles to the
-list of Invariant Sections in the Modified Version's license notice.
-These titles must be distinct from any other section titles.
-
-You may add a section Entitled ``Endorsements'', provided it contains
-nothing but endorsements of your Modified Version by various
-parties---for example, statements of peer review or that the text has
-been approved by an organization as the authoritative definition of a
-standard.
-
-You may add a passage of up to five words as a Front-Cover Text, and a
-passage of up to 25 words as a Back-Cover Text, to the end of the list
-of Cover Texts in the Modified Version. Only one passage of
-Front-Cover Text and one of Back-Cover Text may be added by (or
-through arrangements made by) any one entity. If the Document already
-includes a cover text for the same cover, previously added by you or
-by arrangement made by the same entity you are acting on behalf of,
-you may not add another; but you may replace the old one, on explicit
-permission from the previous publisher that added the old one.
-
-The author(s) and publisher(s) of the Document do not by this License
-give permission to use their names for publicity for or to assert or
-imply endorsement of any Modified Version.
-
-@item
-COMBINING DOCUMENTS
-
-You may combine the Document with other documents released under this
-License, under the terms defined in section 4 above for modified
-versions, provided that you include in the combination all of the
-Invariant Sections of all of the original documents, unmodified, and
-list them all as Invariant Sections of your combined work in its
-license notice, and that you preserve all their Warranty Disclaimers.
-
-The combined work need only contain one copy of this License, and
-multiple identical Invariant Sections may be replaced with a single
-copy. If there are multiple Invariant Sections with the same name but
-different contents, make the title of each such section unique by
-adding at the end of it, in parentheses, the name of the original
-author or publisher of that section if known, or else a unique number.
-Make the same adjustment to the section titles in the list of
-Invariant Sections in the license notice of the combined work.
-
-In the combination, you must combine any sections Entitled ``History''
-in the various original documents, forming one section Entitled
-``History''; likewise combine any sections Entitled ``Acknowledgements'',
-and any sections Entitled ``Dedications''. You must delete all
-sections Entitled ``Endorsements.''
-
-@item
-COLLECTIONS OF DOCUMENTS
-
-You may make a collection consisting of the Document and other documents
-released under this License, and replace the individual copies of this
-License in the various documents with a single copy that is included in
-the collection, provided that you follow the rules of this License for
-verbatim copying of each of the documents in all other respects.
-
-You may extract a single document from such a collection, and distribute
-it individually under this License, provided you insert a copy of this
-License into the extracted document, and follow this License in all
-other respects regarding verbatim copying of that document.
-
-@item
-AGGREGATION WITH INDEPENDENT WORKS
-
-A compilation of the Document or its derivatives with other separate
-and independent documents or works, in or on a volume of a storage or
-distribution medium, is called an ``aggregate'' if the copyright
-resulting from the compilation is not used to limit the legal rights
-of the compilation's users beyond what the individual works permit.
-When the Document is included in an aggregate, this License does not
-apply to the other works in the aggregate which are not themselves
-derivative works of the Document.
-
-If the Cover Text requirement of section 3 is applicable to these
-copies of the Document, then if the Document is less than one half of
-the entire aggregate, the Document's Cover Texts may be placed on
-covers that bracket the Document within the aggregate, or the
-electronic equivalent of covers if the Document is in electronic form.
-Otherwise they must appear on printed covers that bracket the whole
-aggregate.
-
-@item
-TRANSLATION
-
-Translation is considered a kind of modification, so you may
-distribute translations of the Document under the terms of section 4.
-Replacing Invariant Sections with translations requires special
-permission from their copyright holders, but you may include
-translations of some or all Invariant Sections in addition to the
-original versions of these Invariant Sections. You may include a
-translation of this License, and all the license notices in the
-Document, and any Warranty Disclaimers, provided that you also include
-the original English version of this License and the original versions
-of those notices and disclaimers. In case of a disagreement between
-the translation and the original version of this License or a notice
-or disclaimer, the original version will prevail.
-
-If a section in the Document is Entitled ``Acknowledgements'',
-``Dedications'', or ``History'', the requirement (section 4) to Preserve
-its Title (section 1) will typically require changing the actual
-title.
-
-@item
-TERMINATION
-
-You may not copy, modify, sublicense, or distribute the Document except
-as expressly provided for under this License. Any other attempt to
-copy, modify, sublicense or distribute the Document is void, and will
-automatically terminate your rights under this License. However,
-parties who have received copies, or rights, from you under this
-License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-@item
-FUTURE REVISIONS OF THIS LICENSE
-
-The Free Software Foundation may publish new, revised versions
-of the GNU Free Documentation License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns. See
-@uref{http://www.gnu.org/copyleft/}.
-
-Each version of the License is given a distinguishing version number.
-If the Document specifies that a particular numbered version of this
-License ``or any later version'' applies to it, you have the option of
-following the terms and conditions either of that specified version or
-of any later version that has been published (not as a draft) by the
-Free Software Foundation. If the Document does not specify a version
-number of this License, you may choose any version ever published (not
-as a draft) by the Free Software Foundation.
-@end enumerate
-
-@page
-@heading ADDENDUM: How to use this License for your documents
-
-To use this License in a document you have written, include a copy of
-the License in the document and put the following copyright and
-license notices just after the title page:
-
-@smallexample
-@group
- Copyright (C) @var{year} @var{your name}.
- Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.2
- or any later version published by the Free Software Foundation;
- with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
- Texts. A copy of the license is included in the section entitled ``GNU
- Free Documentation License''.
-@end group
-@end smallexample
-
-If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
-replace the ``with@dots{}Texts.'' line with this:
-
-@smallexample
-@group
- with the Invariant Sections being @var{list their titles}, with
- the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
- being @var{list}.
-@end group
-@end smallexample
-
-If you have Invariant Sections without Cover Texts, or some other
-combination of the three, merge those two alternatives to suit the
-situation.
-
-If your document contains nontrivial examples of program code, we
-recommend releasing these examples in parallel under your choice of
-free software license, such as the GNU General Public License,
-to permit their use in free software.
-
-@c Local Variables:
-@c ispell-local-pdict: "ispell-dict"
-@c End:
-
diff --git a/.emacs.d/identica-mode-1.1/doc/identica-mode.texi b/.emacs.d/identica-mode-1.1/doc/identica-mode.texi
deleted file mode 100644
index a620dd5..0000000
--- a/.emacs.d/identica-mode-1.1/doc/identica-mode.texi
+++ /dev/null
@@ -1,345 +0,0 @@
-\input texinfo @c -*-texinfo-*-
-
-@c %**start of header
-@setfilename identica-mode.info
-@settitle Identica mode manual
-@c %**end of header
-
-@copying
- Copyright @copyright{} 2009 Chris Bryant (@email{chrisbryant@@ucla.edu}).
- Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.2
- or any later version published by the Free Software Foundation;
- with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
- Texts. A copy of the license is included in the section entitled "GNU
- Free Documentation License".
-@end copying
-
-@dircategory Emacs
-@direntry
-* Identica mode: (identica-mode). Emacs mode for microblogging services.
-@end direntry
-
-@titlepage
- @title Identica mode manual
- @subtitle v0.3 for identica-mode.el v0.9
- @author Chris Bryant (@email{chrisbryant@@ucla.edu})
- @page
- @vskip 0pt plus 1filll
- @insertcopying
-@end titlepage
-
-@contents
-
-@node Top, About Identica mode and obtaining it, (dir), (dir)
-@ifnottex
-@top identica-mode
-This manual is for identica-mode.el, version 0.9.
-@end ifnottex
-
-@menu
-* About Identica mode and obtaining it::
-* Installation and configuration::
-* Using identica-mode.el::
-* Credits and contributing::
-* GNU Free Documentation License::
-@end menu
-
-@node About Identica mode and obtaining it, Installation and configuration, Top, Top
-@chapter About Identica mode and obtaining it
-
-@menu
-* About identica-mode.el and this manual::
-* Getting a copy::
-@end menu
-
-@node About identica-mode.el and this manual, Getting a copy, About Identica mode and obtaining it, About Identica mode and obtaining it
-@section About identica-mode.el and this manual
-
-@firstparagraphindent none
-This manual instructs in the use of identica-mode.el, a major mode for GNU Emacs used to perform useful actions with @uref{http://status.net, StatusNet} microblogging services, like @uref{http://identi.ca, identi.ca}.
-
-@paragraphindent 3
-identica-mode.el was developed by @uref{mailto:gsaldana@@gmail.com, Gabriel Saldana} and other contributors (@ref{Credits}). It is originally based on Twittering mode version 0.6 by Y. Hayamizu and Tsuyoshi CHO.
-
-@node Getting a copy, , About identica-mode.el and this manual, About Identica mode and obtaining it
-@section Getting a copy
-
-@firstparagraphindent none
-Identica mode can be obtained from the @uref{https://savannah.gnu.org, Savannah} software forge. The URLs for the Identica mode project are:
-
-@itemize @bullet
-@item @uref{http://www.nongnu.org/identica-mode/, http://www.nongnu.org/identica-mode} - Main website
-@item @uref{https://savannah.nongnu.org/projects/identica-mode/, https://savannah.nongnu.org/projects/identica-mode} - Software forge
-@end itemize
-
-@paragraphindent 3
-You can obtain identica-mode.el directly from the git repository at Savannah by executing a git clone command:
-@*
-@example
-git clone git://git.savannah.nongnu.org/identica-mode.git
-@end example
-@*
-@paragraphindent 3
-This action will fetch the latest identica-mode.el file as well as the latest manual, located under the @code{doc/} directory.
-
-@node Installation and configuration, Using identica-mode.el, About Identica mode and obtaining it, Top
-@chapter Installation and configuration
-
-@menu
-* Installing identica-mode.el::
-* Configuring GNU Emacs::
-@end menu
-
-@node Installing identica-mode.el, Configuring GNU Emacs, Installation and configuration, Installation and configuration
-@section Installing identica-mode.el
-
-@firstparagraphindent none
-Installation of indentica-mode.el is fairly straightforward. Like most GNU Emacs customizations, it is recommended you place your identica-mode.el file under your @code{emacs.d} directory. The location of this directory will vary between OSs, but it is generally under @code{~/.emacs.d/} for UNIX style systems. Consult your @uref{http://www.gnu.org/software/emacs/, GNU Emacs} documentation.
-
-@paragraphindent 3
-Alternatively, you can create your own directory for this GNU Emacs mode file, and others, if you choose. Read on for information on how to configure your @code{.emacs} file to find indentica-mode.el.
-
-@node Configuring GNU Emacs, , Installing identica-mode.el, Installation and configuration
-@section Configuring GNU Emacs
-
-@menu
-* identica-mode requirements::
-* Configuring .emacs::
-@end menu
-
-@node identica-mode requirements, Configuring .emacs, Configuring GNU Emacs, Configuring GNU Emacs
-@subsection identica-mode requirements
-
-@firstparagraphindent none
-The following GNU Emacs libraries are required by identica-mode.el. A standard GNU Emacs installation should provide these, but if yours does not, fetch a copy of the @uref{http://www.gnu.org/software/emacs/, GNU Emacs} source. The libraries are generally found under the @code{emacs-<version>/lisp/} directory.
-
-@itemize @bullet
-@item cl
-@item xml
-@item parse-time
-@item longlines
-@end itemize
-
-
-@paragraphindent 3
-In addition to the library requirements, the following software is currently required:
-
-@itemize @bullet
-@item GNU Emacs 22 or later
-@item Curl
-@item Wget
-@item UNIX-like OS (GNU/Linux, BSD, etcetera)
-@end itemize
-
-@node Configuring .emacs, , identica-mode requirements, Configuring GNU Emacs
-@subsection Configuring .emacs
-
-@firstparagraphindent none
-Some or all or the following settings can be configured from within GNU Emacs or written to your @code{.emacs} file. To configure within GNU Emacs, execute @command{M-x} and type @command{customize-group}. When prompted for the group to customize, enter @command{identica-mode}. The settings are:
-
-@itemize @bullet
-@item Identica Idle Time
-@item Identica Timer Interval
-@item Identica Username
-@item Identica Password
-@item Laconica Server
-@item Identica Default Timeline
-@item Identica Display Success Messages
-@item Identica Update Status Edit Confirm Cancellation
-@item Identica Update Status Method
-@item Identica Http Get Timeout
-@item Identica Status Format
-@end itemize
-
-@paragraphindent 3
-For general usage, the defaults for each of these settings (excluding Username and Password) should be fine to get started for use with identi.ca. If you wish to customize these settings, please see the @uref{http://status.net/wiki/, StatusNet wiki} for documentation of usage. Management of the customizations can also be performed from within your @code{.emacs} file. Below is a sample, explicitly calling the identica-mode.el file and with an added global keybinding to allow posting from the minibuffer without having the identica buffer active:
-@*
-@example
-;; Identica Mode
-(load "/home/identicauser/.emacs.d/identica-mode.el")
-(require 'identica-mode)
-(setq identica-username "identicauser")
-(setq identica-password "password")
-(global-set-key "\C-cip" 'identica-update-status-interactive)
-@end example
-@*
-@node Using identica-mode.el, Credits and contributing, Installation and configuration, Top
-@chapter Using identica-mode.el
-
-@menu
-* Basic usage::
-* Tips and tricks::
-@end menu
-
-@node Basic usage, Tips and tricks, Using identica-mode.el, Using identica-mode.el
-@section Basic usage
-
-@menu
-* Introduction::
-* Startup::
-* Icons::
-* Replies timeline::
-* Public timeline::
-* Personal timeline::
-* Update status::
-* Send notice::
-* Shorten url::
-@end menu
-
-@node Introduction, Startup, Basic usage, Basic usage
-@subsection Introduction
-
-@firstparagraphindent none
-Identica mode currently works under GNU Emacs in both terminal and graphical mode. Where there are special considerations for one or the other mode, they will be clearly highlighted. The purpose of Identica mode is to provide an easy method to send and view updates while working within a GNU Emacs environment. Thus, the command set detailed below is simple. If you are interested in more complex functionality, feel free to send suggestions through the Savannah project website. Additionally, keep up-to-date with the latest releases. Also, see @ref{Extending identica-mode} for tips on writing your own functions.
-
-@node Startup, Icons, Introduction, Basic usage
-@subsection Startup
-
-@firstparagraphindent none
-To get started using Identica mode, execute @code{M-x} and type @command{identica-mode}. This will initiate the identica-mode buffer, *identica*, and display the default timeline. At any time you wish to refresh the timeline, press the @command{G} key.
-
-@node Icons, Replies timeline, Startup, Basic usage
-@subsection Icons
-
-@firstparagraphindent none
-If you are using GNU Emacs with a graphical interface, you can toggle the view of user icons by pressing the @command{I} key.
-
-@node Replies timeline, Public timeline, Icons, Basic usage
-@subsection Replies timeline
-
-@firstparagraphindent none
-To view your Replies timeline execute:
-@*
-@example
-C-c C-r
-@end example
-
-@node Public timeline, Personal timeline, Replies timeline, Basic usage
-@subsection Public timeline
-
-@firstparagraphindent none
-To view the Public timeline execute:
-@*
-@example
-C-c C-g
-@end example
-
-@node Personal timeline, Update status, Public timeline, Basic usage
-@subsection Personal timeline
-
-@firstparagraphindent none
-To view your Personal timeline execute:
-@*
-@example
-C-c C-f
-@end example
-
-@node Update status, Send notice, Personal timeline, Basic usage
-@subsection Update status
-
-@firstparagraphindent none
-To update your Identica status execute:
-@*
-@example
-C-c C-s
-@end example
-
-@paragraphindent 3
-At the @code{Status:} prompt, type the content of your status, up to 140 characters. When done, hit the @command{Enter} key. The message @code{Success: Post} will apper in the minibuffer.
-
-@node Send notice, Shorten url, Update status, Basic usage
-@subsection Send notice
-
-@firstparagraphindent none
-To send a notice directly to a user execute:
-@*
-@example
-C-c C-d
-@end example
-
-@paragraphindent 3
-At the @code{To user:} prompt type the exact user name and press the @command{Enter} key. At the @code{Direct message:} prompt, type your message and press the @command{Enter} key.
-
-@node Shorten url, , Send notice, Basic usage
-@subsection Shorten url
-
-@firstparagraphindent none
-You can shorten a url while typing your update notice on the
-minibuffer by pressing the @command{<F4>} key while the cursor is in
-between or at the end of the long url you just typed.
-
-@node Tips and tricks, , Basic usage, Using identica-mode.el
-@section Tips and tricks
-
-@menu
-* Run commands after recieving notices::
-* Extending identica-mode::
-@end menu
-
-@node Run commands after recieving notices, , Tips and tricks, Tips and tricks
-@subsection Run commands after recieving notices
-
-@firstparagraphindent none
-You can now create ``hooks'' that will run after recieving new
-notices. Just add a hook function to @code{identica-new-dents-hook}.
-
-@firstparagraphindent none
-To display a notification message on KDE 4 you can add the following
-code on your .emacs file:
-@*
-@example
-;; KDE 4 Notification of new dents with kdialog
-(add-hook 'identica-new-dents-hook (lambda ()
- (let ((n identica-new-dents-count))
- (start-process "identica-notify" nil "kdialog"
- "--title"
- "Emacs Identica-mode New dents"
- "--passivepopup"
- (format "You have %d new dent%s"
- n (if (> n 1) "s" ""))
- "3"
-))))
-@end example
-
-@node Extending identica-mode, , Tips and tricks, Tips and tricks
-@subsection Extending identica-mode
-
-@firstparagraphindent none
-Because identica-mode.el is written in Emacs Lisp, there are many options to extend the mode to your liking. As this is the first release of the Identica mode manual, this section will serve to simply encourage you to experiment with the code, and to see @ref{Contributing} for ways to let us know how you've extended identica-mode.el - maybe we'll add your extensions to the code, and this section, in further releases!
-
-@node Credits and contributing, GNU Free Documentation License, Using identica-mode.el, Top
-@chapter Credits and contributing
-
-@menu
-* Credits::
-* Contributing::
-@end menu
-
-@node Credits, Contributing, Credits and contributing, Credits and contributing
-@section Credits
-
-@firstparagraphindent none
-The following individuals have contributed to the Identica mode project. See the identica-mode.el file for more information.
-
-@itemize @bullet
-@item Christian Cheng
-@item Alberto Garcia
-@item Bradley M. Kuhn
-@item Jason McBrayer
-@item Carlos A. Perilla
-@item Alex Schröder
-@item Shyam Karanatt
-@end itemize
-
-@node Contributing, , Credits, Credits and contributing
-@section Contributing
-
-@firstparagraphindent none
-If you have any ideas for features, patches or bug fixes, please add them to the identica-mode @uref{https://savannah.nongnu.org/bugs/?group=identica-mode, bug tracking list}. If you are submitting something specifically for @ref{Extending identica-mode}, be sure to note this in your ticket.
-
-@node GNU Free Documentation License, , Credits and contributing, Top
-@unnumbered GNU Free Documentation License
-@include fdl.texi
-
-@bye
diff --git a/.emacs.d/identica-mode-1.1/identica-mode.el b/.emacs.d/identica-mode-1.1/identica-mode.el
deleted file mode 100644
index 86ff386..0000000
--- a/.emacs.d/identica-mode-1.1/identica-mode.el
+++ /dev/null
@@ -1,1853 +0,0 @@
-;;; identica-mode.el --- Major mode for Identica
-
-;; Copyright (C) 2008, 2009, 2010 Gabriel Saldana
-;; Copyright (C) 2009 Bradley M. Kuhn
-
-;; Author: Gabriel Saldana <gsaldana@gmail.com>
-;; Last update: 2010-11-26
-;; Version: 1.1
-;; Keywords: identica web
-;; URL: http://blog.nethazard.net/identica-mode-for-emacs/
-;; Contributors:
-;; Jason McBrayer <jmcbray@carcosa.net> (minor updates for working under Emacs 23)
-;; Alex Schröder <kensanata@gmail.com> (mode map patches)
-;; Christian Cheng (fixed long standing xml parsing bug)
-;; Carlos A. Perilla from denting-mode
-;; Alberto Garcia <agarcia@igalia.com> (integrated patch from twittering-mode for retrieving multiplemethods)
-;; Bradley M. Kuhn <bkuhn@ebb.org> (editing status from edit-buffer rather than minibuffer)
-;; Jason McBrayer <jmcbray@carcosa.net> (replace group tags with hashtags on redents, longlines use)
-;; Sean Neakums (patches of bugs flagged by byte-compiler)
-;; Shyam Karanatt <shyam@swathanthran.in> (several patches and code cleanup, new http backend based on url.el)
-;; Tezcatl Franco <tzk@riseup.net> (ur1.ca support)
-;; Anthony Garcia <lagg@lavabit.com> (fix for icon-mode)
-
-;; Identica Mode is a major mode to check friends timeline, and update your
-;; status on Emacs.
-
-;; identica-mode.el is a major mode for Identica. Based on the twittering mode
-;; version 0.6 by Y. Hayamizu and Tsuyoshi CHO found at
-;; <http://hayamin.com/wiliki.cgi?twittering-mode-en&l=en>
-
-;; This file is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
-
-;; This file is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to
-;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth floor,
-;; Boston, MA 02110-1301, USA.
-
-;; Requirements
-;; if using Emacs22 or previous, you'll need json.el
-;; get it from http://edward.oconnor.cx/2006/03/json.el
-;; json.el is part of Emacs23
-
-;; Installation
-
-;; You can use M-x customize-group identica-mode to setup all settings or simply
-;; add the following to your .emacs or your prefered customizations file
-
-;; (require 'identica-mode)
-;; (setq identica-username "yourusername")
-;; (setq identica-password "yourpassword")
-
-;; If you want to post from the minibufer without having identica buffer active, add the following global keybinding.
-;; Add this to send status updates
-;; (global-set-key "\C-cip" 'identica-update-status-interactive)
-;; Add this to send direct messages
-;; (global-set-key "\C-cid" 'identica-direct-message-interactive)
-
-;; If you want to connect to a custom statusnet server add this and change
-;; identi.ca with your server's doman name.
-
-;; (setq statusnet-server "identi.ca")
-
-;; Start using with M-x identica
-
-;; Follow me on identica: http://identi.ca/gabrielsaldana
-
-(require 'cl)
-(require 'xml)
-(require 'parse-time)
-(require 'longlines)
-(require 'url)
-(require 'url-http)
-(require 'json)
-
-(defconst identica-mode-version "1.1")
-
-;;url-basepath fix for emacs22
-(unless (fboundp 'url-basepath)
- (defalias 'url-basepath 'url-file-directory))
-
-(defgroup identica-mode nil
- "Identica Mode for microblogging"
- :tag "Microblogging"
- :link '(url-link http://blog.nethazard.net/identica-mode-for-emacs/)
- :group 'applications )
-
-(defun identica-mode-version ()
- "Display a message for identica-mode version."
- (interactive)
- (let ((version-string
- (format "identica-mode-v%s" identica-mode-version)))
- (if (interactive-p)
- (message "%s" version-string)
- version-string)))
-
-(defvar identica-mode-map (make-sparse-keymap "Identi.ca"))
-(defvar menu-bar-identica-mode-menu nil)
-(defvar identica-timer nil "Timer object for timeline refreshing will be stored here. DO NOT SET VALUE MANUALLY.")
-(defvar identica-last-timeline-retrieved nil)
-
-(defvar identica-urlshortening-services-map
- '((tinyurl . "http://tinyurl.com/api-create.php?url=")
- (toly . "http://to.ly/api.php?longurl=")
- (google . "http://ggl-shortener.appspot.com/?url=")
- (ur1ca . "http://ur1.ca")
- (tighturl . "http://2tu.us"))
- "Alist of tinyfy services")
-
-(defvar identica-new-dents-count 0
- "Number of new tweets when `identica-new-dents-hook' is run")
-
-(defvar identica-new-dents-hook nil
- "Hook run when new twits are received.
-
-You can read `identica-new-dents-count' to get the number of new
-tweets received when this hook is run.")
-
-(defvar identica-display-max-dents nil
- "How many dents to keep on the displayed timeline.
-
-If non-nil, dents over this amount will bre removed.")
-
-;; Menu
-(unless menu-bar-identica-mode-menu
- (easy-menu-define
- menu-bar-identica-mode-menu identica-mode-map ""
- '("Identi.ca"
- ["Send an update" identica-update-status-interactive t]
- ["Send a direct message" identica-direct-message-interactive t]
- ["Re-dent someone's update" identica-redent t]
- ["Repeat someone's update" identica-repeat t]
- ["Add as favorite" identica-favorite t]
- ["Follow user" identica-follow]
- ["Unfollow user" identica-unfollow]
- ["--" nil nil]
- ["Friends timeline" identica-friends-timeline t]
- ["Public timeline" identica-public-timeline t]
- ["Replies timeline" identica-replies-timeline t]
- ["User timeline" identica-user-timeline t]
- ["Group timeline" identica-group-timeline t]
- ["Tag timeline" identica-tag-timeline t]
-)))
-
-(defcustom identica-idle-time 20
- "Idle time"
- :type 'integer
- :group 'identica-mode)
-
-(defcustom identica-timer-interval 90
- "Timer interval to refresh the timeline"
- :type 'integer
- :group 'identica-mode)
-
-(defcustom identica-username nil
- "Your identi.ca username. If nil, you will be prompted"
- :type '(choice (const :tag "Ask" nil) (string))
- :group 'identica-mode)
-
-(defcustom identica-password nil
- "Your identi.ca password. If nil, you will be prompted"
- :type '(choice (const :tag "Ask" nil) (string))
- :group 'identica-mode)
-
-(defcustom statusnet-server "identi.ca"
- "Statusnet instance url"
- :type 'string
- :group 'identica-mode)
-
-(defcustom statusnet-port 80
- "Port on which StatusNet instance listens"
- :type 'integer
- :group 'identica-mode)
-
-(defcustom identica-default-timeline "friends_timeline"
- "Default timeline to retrieve"
- :type 'string
- :options '("friends_timeline" "public_timeline" "replies")
- :group 'identica-mode)
-
-(defcustom identica-display-success-messages nil
- "Display messages when the timeline is successfully retrieved"
- :type 'boolean
- :group 'identica-mode)
-
-(defcustom identica-oldest-first nil
- "If t, display older messages before newer ones"
- :type 'boolean
- :group 'identica-mode)
-
-(defcustom identica-update-status-edit-confirm-cancellation nil
- "If t, ask user if they are sure when aborting editing of an
- identica status update when using an edit-buffer"
- :type 'boolean
- :group 'identica-mode)
-
-(defcustom identica-soft-wrap-status nil
- "If non-nil, don't fill status messages in the timeline as
- paragraphs. Instead, use visual-line-mode or longlines-mode if
- available to wrap messages. This may work better for narrow
- timeline windows."
- :type 'boolean
- :group 'identica-mode)
-
-(defcustom identica-update-status-method 'minibuffer
- "Method for performaing status updates.
-
-The available choices are:
-
- 'minibuffer - edit the status update in the minibuffer.
- 'edit-buffer - edit the status update in an independent buffer."
- :type '(choice (const :tag "Edit status in minibuffer" minibuffer)
- (const :tag "Edit status in independent buffer" edit-buffer))
- :group 'identica-mode)
-
-(defcustom identica-http-get-timeout 10
- "Controls how long to wait for a response from the server."
- :type 'integer
- :group 'identica-mode)
-
-;; Initialize with default timeline
-(defvar identica-method identica-default-timeline)
-(defvar identica-method-class "statuses")
-
-(defvar identica-scroll-mode nil)
-(make-variable-buffer-local 'identica-scroll-mode)
-
-(defvar identica-source "identica-mode")
-
-(defcustom identica-redent-format "â™»"
- "The format/symbol to represent redents"
- :type 'string
- :group 'identica-mode)
-
-(defcustom identica-status-format "%i %s, %@:\n %t // from %f%L%r"
- "The format used to display the status updates"
- :type 'string
- :group 'identica-mode)
-;; %s - screen_name
-;; %S - name
-;; %i - profile_image
-;; %d - description
-;; %l - location
-;; %L - " [location]"
-;; %r - in reply to status
-;; %u - url
-;; %j - user.id
-;; %p - protected?
-;; %c - created_at (raw UTC string)
-;; %C{time-format-str} - created_at (formatted with time-format-str)
-;; %@ - X seconds ago
-;; %t - text
-;; %' - truncated
-;; %f - source
-;; %# - id
-
-(defcustom identica-urlshortening-service 'ur1ca
- "The service to use for URL shortening. Values understood are
-ur1ca, tighturl, tinyurl, toly, and google"
- :type 'symbol
- :group 'identica-mode)
-
-(defvar identica-buffer "*identica*")
-(defun identica-buffer (&optional method)
- (unless method
- (setq method "friends_timeline"))
- (identica-get-or-generate-buffer identica-buffer))
-
-(defvar identica-http-buffer nil
- "Pointer to the current http response buffer.")
-
-(defvar identica-timeline-data nil)
-(defvar identica-timeline-last-update nil)
-
-(defvar identica-username-face 'identica-username-face)
-(defvar identica-uri-face 'identica-uri-face)
-(defvar identica-reply-face 'identica-reply-face)
-
-(defun identica-get-or-generate-buffer (buffer)
- (if (bufferp buffer)
- (if (buffer-live-p buffer)
- buffer
- (generate-new-buffer (buffer-name buffer)))
- (if (stringp buffer)
- (or (get-buffer buffer)
- (generate-new-buffer buffer)))))
-
-(defun assocref (item alist)
- (cdr (assoc item alist)))
-(defmacro list-push (value listvar)
- `(setq ,listvar (cons ,value ,listvar)))
-
-;;; Proxy
-(defvar identica-proxy-use nil)
-(defvar identica-proxy-server nil)
-(defvar identica-proxy-port 8080)
-(defvar identica-proxy-user nil)
-(defvar identica-proxy-password nil)
-
-(defun identica-toggle-proxy () ""
- (interactive)
- (setq identica-proxy-use
- (not identica-proxy-use))
- (message "%s %s"
- "Use Proxy:"
- (if identica-proxy-use
- "on" "off")))
-
-(defun identica-user-agent-default-function ()
- "Identica mode default User-Agent function."
- (concat "Emacs/"
- (int-to-string emacs-major-version) "." (int-to-string
- emacs-minor-version)
- " "
- "Identica-mode/"
- identica-mode-version))
-
-(defvar identica-user-agent-function 'identica-user-agent-default-function)
-
-(defun identica-user-agent ()
- "Return User-Agent header string."
- (funcall identica-user-agent-function))
-
-;;; to show image files
-
-(defvar identica-tmp-dir
- (expand-file-name (concat "identicamode-images-" (user-login-name))
- temporary-file-directory))
-
-(defvar identica-icon-mode nil "You MUST NOT CHANGE this variable directory. You should change through function'identica-icon-mode'")
-(make-variable-buffer-local 'identica-icon-mode)
-(defun identica-icon-mode (&optional arg)
- (interactive)
- (setq identica-icon-mode
- (if identica-icon-mode
- (if (null arg)
- nil
- (> (prefix-numeric-value arg) 0))
- (when (or (null arg)
- (and arg (> (prefix-numeric-value arg) 0)))
- (when (file-writable-p identica-tmp-dir)
- (progn
- (if (not (file-directory-p identica-tmp-dir))
- (make-directory identica-tmp-dir))
- t)))))
- (identica-get-timeline))
-
-(defun identica-scroll-mode (&optional arg)
- (interactive)
- (setq identica-scroll-mode
- (if (null arg)
- (not identica-scroll-mode)
- (> (prefix-numeric-value arg) 0))))
-
-(defvar identica-image-stack nil)
-
-(defun identica-image-type (file-name)
- (cond
- ((string-match "\\.jpe?g" file-name) 'jpeg)
- ((string-match "\\.png" file-name) 'png)
- ((string-match "\\.gif" file-name) 'gif)
- (t nil)))
-
-(defun identica-setftime (fmt string uni)
- (format-time-string fmt ; like "%Y-%m-%d %H:%M:%S"
- (apply 'encode-time (parse-time-string string))
- uni))
-(defun identica-local-strftime (fmt string)
- (identica-setftime fmt string nil))
-(defun identica-global-strftime (fmt string)
- (identica-setftime fmt string t))
-
-(defvar identica-debug-mode nil)
-(defvar identica-debug-buffer "*identica-debug*")
-(defun identica-debug-buffer ()
- (identica-get-or-generate-buffer identica-debug-buffer))
-(defmacro debug-print (obj)
- (let ((obsym (gensym)))
- `(let ((,obsym ,obj))
- (if identica-debug-mode
- (with-current-buffer (identica-debug-buffer)
- (insert (prin1-to-string ,obsym))
- (newline)
- ,obsym)
- ,obsym))))
-
-(defun identica-debug-mode ()
- (interactive)
- (setq identica-debug-mode
- (not identica-debug-mode))
- (message (if identica-debug-mode "debug mode:on" "debug mode:off")))
-
-(defun identica-delete-notice ()
- (interactive)
- (let ((id (get-text-property (point) 'id))
- (usern (get-text-property (point) 'username)))
- (if (string= usern identica-username)
- (when (y-or-n-p "Delete this notice? ")
- (identica-http-post "statuses/destroy" (number-to-string id))
- (identica-get-timeline))
- (message "Can't delete a notice that isn't yours"))))
-
-(if identica-mode-map
- (let ((km identica-mode-map))
- (define-key km "\C-c\C-f" 'identica-friends-timeline)
-;; (define-key km "\C-c\C-i" 'identica-direct-messages-timeline)
- (define-key km "\C-c\C-r" 'identica-replies-timeline)
- (define-key km "\C-c\C-a" 'identica-public-timeline)
- (define-key km "\C-c\C-g" 'identica-group-timeline)
- (define-key km "\C-c\C-t" 'identica-tag-timeline)
- (define-key km "\C-c\C-k" 'identica-stop)
- (define-key km "\C-c\C-u" 'identica-user-timeline)
- (define-key km "\C-c\C-s" 'identica-update-status-interactive)
- (define-key km "\C-c\C-d" 'identica-direct-message-interactive)
- (define-key km "\C-c\C-m" 'identica-redent)
- (define-key km "r" 'identica-repeat)
- (define-key km "F" 'identica-favorite)
- (define-key km "\C-c\C-e" 'identica-erase-old-statuses)
- (define-key km "\C-m" 'identica-enter)
- (define-key km "R" 'identica-reply-to-user)
- (define-key km "\t" 'identica-next-link)
- (define-key km [backtab] 'identica-prev-link)
- (define-key km [mouse-1] 'identica-click)
- (define-key km "\C-c\C-v" 'identica-view-user-page)
- (define-key km "q" 'bury-buffer)
- (define-key km "j" 'identica-goto-next-status)
- (define-key km "k" 'identica-goto-previous-status)
- (define-key km "l" 'forward-char)
- (define-key km "h" 'backward-char)
- (define-key km "0" 'beginning-of-line)
- (define-key km "^" 'beginning-of-line-text)
- (define-key km "$" 'end-of-line)
- (define-key km "n" 'identica-goto-next-status-of-user)
- (define-key km "p" 'identica-goto-previous-status-of-user)
- (define-key km [backspace] 'scroll-down)
- (define-key km " " 'scroll-up)
- (define-key km "G" 'end-of-buffer)
- (define-key km "g" 'identica-current-timeline)
- (define-key km "H" 'beginning-of-buffer)
- (define-key km "i" 'identica-icon-mode)
- (define-key km "s" 'identica-scroll-mode)
- (define-key km "t" 'identica-toggle-proxy)
- (define-key km "\C-k" 'identica-delete-notice)
- (define-key km "\C-c\C-p" 'identica-toggle-proxy)
- nil))
-
-(defvar identica-mode-syntax-table nil "")
-
-(if identica-mode-syntax-table
- ()
- (setq identica-mode-syntax-table (make-syntax-table))
- ;; (modify-syntax-entry ? "" identica-mode-syntax-table)
- (modify-syntax-entry ?\" "w" identica-mode-syntax-table))
-
-(defun identica-mode-init-variables ()
- ;; (make-variable-buffer-local 'variable)
- ;; (setq variable nil)
- (font-lock-mode -1)
- (defface identica-username-face
- `((t nil)) "" :group 'faces)
- (copy-face 'font-lock-string-face 'identica-username-face)
- (set-face-attribute 'identica-username-face nil :underline t)
- (defface identica-reply-face
- `((t nil)) "" :group 'faces)
- (copy-face 'font-lock-string-face 'identica-reply-face)
- (set-face-attribute 'identica-reply-face nil :foreground "white")
- (set-face-attribute 'identica-reply-face nil :background "DarkSlateGray")
- (defface identica-uri-face
- `((t nil)) "" :group 'faces)
-
- (set-face-attribute 'identica-uri-face nil :underline t)
- (add-to-list 'minor-mode-alist '(identica-icon-mode " id-icon"))
- (add-to-list 'minor-mode-alist '(identica-scroll-mode " id-scroll")))
-
-(defmacro case-string (str &rest clauses)
- `(cond
- ,@(mapcar
- (lambda (clause)
- (let ((keylist (car clause))
- (body (cdr clause)))
- `(,(if (listp keylist)
- `(or ,@(mapcar (lambda (key) `(string-equal ,str ,key)) keylist))
- 't)
- ,@body)))
- clauses)))
-
-;; If you use Emacs21, decode-char 'ucs will fail unless Mule-UCS is loaded.
-;; TODO: Show error messages if Emacs 21 without Mule-UCS
-(defmacro identica-ucs-to-char (num)
- (if (functionp 'ucs-to-char)
- `(ucs-to-char ,num)
- `(decode-char 'ucs ,num)))
-
-(defvar identica-mode-string identica-method)
-
-(defun identica-set-mode-string (loading)
- (setq mode-name
- (if loading (concat "loading " identica-method "...") identica-method)))
-
-(defvar identica-mode-hook nil
- "Identica-mode hook.")
-
-(defun identica-kill-buffer-function ()
- (when (eq major-mode 'identica-mode)
- (identica-stop)))
-
-(defun identica-mode ()
- "Major mode for Identica
-\\{identica-mode-map}"
- (interactive)
- (switch-to-buffer (identica-buffer))
- (buffer-disable-undo (identica-buffer))
- (kill-all-local-variables)
- (identica-mode-init-variables)
- (use-local-map identica-mode-map)
- (setq major-mode 'identica-mode)
- (setq mode-name identica-mode-string)
- (setq mode-line-buffer-identification
- `(,(default-value 'mode-line-buffer-identification)
- (:eval (identica-mode-line-buffer-identification))))
- (identica-update-mode-line)
- (set-syntax-table identica-mode-syntax-table)
- (font-lock-mode -1)
- (if identica-soft-wrap-status
- (if (fboundp 'visual-line-mode)
- (visual-line-mode t)
- (if (fboundp 'longlines-mode)
- (longlines-mode t))))
- (identica-start)
- (add-hook 'kill-buffer-hook 'identica-kill-buffer-function)
- (run-mode-hooks 'identica-mode-hook))
-
-;;;
-;;; Basic HTTP functions
-;;;
-
-(defun identica-set-proxy (&optional url username passwd server port)
- "Sets the proxy authentication variables as required by url
-library.When called with no arguments, it reads `identica-mode' proxy
-variables to get the authentication parameters.URL is either a string
-or parsed URL. If URL is non-nil and valid, proxy authentication
-values are read from it.the rest of the arguments can be used to
-directly set proxy authentication.This function essentially adds
-authentication parameters from one of the above methods to the double
-alist `url-http-proxy-basic-auth-storage' and sets `url-using-proxy'."
- (let* ((href (if (stringp url)
- (url-generic-parse-url url)
- url))
- (port (or (and href (url-port href))
- port identica-proxy-port))
- (port (if (integerp port) (int-to-string port) port))
- (server (or (and href (url-host href))
- server identica-proxy-server))
- (server (and server
- (concat server (when port (concat ":" port)))))
- (file (if href (let ((file-url (url-filename href)))
- (cond
- ((string= "" file-url) "/")
- ((string-match "/$" file-url) file-url)
- (t (url-basepath file-url))))
- "Proxy"))
- (password (or (and href (url-password href))
- passwd identica-proxy-password))
- (auth (concat (or (and href (url-user href))
- username identica-proxy-user)
- (and password (concat ":" password)))))
- (when (and identica-proxy-use
- (not (string= "" server))
- (not (string= "" auth)))
- (setq url-using-proxy server)
- (let* ((proxy-double-alist
- (or (assoc server
- url-http-proxy-basic-auth-storage)
- (car (push (cons server nil)
- url-http-proxy-basic-auth-storage))))
- (proxy-auth-alist (assoc file proxy-double-alist)))
- (if proxy-auth-alist
- (setcdr proxy-auth-alist (base64-encode-string auth))
- (setcdr proxy-double-alist
- (cons (cons file
- (base64-encode-string auth))
- (cdr-safe proxy-double-alist))))))))
-
-(defun identica-change-user ()
- (interactive)
- "Interactive function to instantly change user authentication by
-directly reading parameters from user. This function only sets the
-identica-mode variables `identica-username' and
-`identica-password'.
-It is the `identica-set-auth' function that eventually sets the
-url library variables according to the above variables which does the
-authentication. This will be done automatically in normal use cases
-enabling dynamic change of user authentication."
- (setq identica-username
- (read-string (concat "Username [for " statusnet-server
- ":" (int-to-string statusnet-port) "]: ")
- nil nil identica-username)
- identica-password
- (read-passwd "Password: " nil identica-password))
- (identica-get-timeline))
-
-(defun identica-set-auth (&optional url username passwd server port)
- "Sets the authentication parameters as required by url library.
-If URL is non-nil and valid, it reads user authentication
-parameters from url.
-If URL is nil, Rest of the arguments can be used to directly set user
-authentication.
-When called with no arguments, user authentication parameters are
-read from identica-mode variables `identica-username'
-`identica-password' `statusnet-server' `statusnet-port'."
- (let* ((href (if (stringp url)
- (url-generic-parse-url url)
- url))
- (port (or (and href (url-port href))
- port statusnet-port))
- (port (if (integerp port) (int-to-string port) port))
- (server (or (and href (url-host href))
- server statusnet-server))
- (server (and server
- (concat server (when port (concat ":" port)))))
- (file (if href (let ((file-url (url-filename href)))
- (cond
- ((string= "" file-url) "/")
- ((string-match "/$" file-url) file-url)
- (t (url-basepath file-url))))
- "Identi.ca API"))
- (password (or (and href (url-password href))
- passwd identica-password))
- (auth (concat (or (and href (url-user href))
- username identica-username)
- (and password (concat ":" password)))))
- (when (and (not (string= "" server))
- (not (string= "" auth)))
- (let* ((server-double-alist
- (or (assoc server
- url-http-real-basic-auth-storage)
- (car (push (cons server nil)
- url-http-real-basic-auth-storage))))
- (api-auth-alist (assoc file server-double-alist)))
- (if api-auth-alist
- (setcdr api-auth-alist (base64-encode-string auth))
- (setcdr server-double-alist
- (cons (cons file
- (base64-encode-string auth))
- (cdr-safe server-double-alist))))))))
-
-(defun identica-http-get (method-class method &optional parameters
- sentinel sentinel-arguments)
- "Basic function which communicates with server.
-METHOD-CLASS and METHOD are parameters for getting dents messages and
-other information from server as specified in api documentation.
-Third optional arguments specify the additional parameters required by
-the above METHOD. It is specified as an alist with parameter name and
-its corresponding value
-SENTINEL represents the callback function to be called after the http
-response is completely retrieved. SENTINEL-ARGUMENTS is the list of
-arguments (if any) of the SENTINEL procedure."
- (or sentinel (setq sentinel 'identica-http-get-default-sentinel))
- (let ((url (concat "http://" statusnet-server "/api/"
- (when (not (string-equal method-class "none"))
- (concat method-class "/" ))
- method ".xml"
- (when parameters
- (concat "?"
- (mapconcat
- (lambda (param-pair)
- (format "%s=%s"
- (identica-percent-encode (car param-pair))
- (identica-percent-encode (cdr param-pair))))
- parameters
- "&")))))
- (url-package-name "emacs-identica-mode")
- (url-package-version identica-mode-version)
- (url-show-status nil))
- (identica-set-proxy)
- (identica-set-auth url)
- (when (get-buffer-process identica-http-buffer)
- (delete-process identica-http-buffer)
- (kill-buffer identica-http-buffer))
- (setq identica-http-buffer
- (url-retrieve url sentinel
- (append (list method-class method parameters)
- sentinel-arguments)))
- (save-excursion
- (set-buffer identica-buffer)
- (identica-set-mode-string t))))
-
-(defun identica-http-get-default-sentinel
- (&optional status method-class method parameters success-message)
- (cond ((setq error-object
- (or (assoc :error status)
- (and (equal :error (car status))
- (cadr status))))
- (let ((error-data (format "%s" (caddr error-object))))
- (when (cond
- ((string= error-data "deleted\n") t)
- ((and (string= error-data "404") method
- (= 13 (string-match "/" method)))
- (message "No Such User: %s" (substring method 14))
- t)
- ((y-or-n-p
- (format "Identica-Mode: Network error:%s Retry? "
- status))
- (identica-http-get method-class method parameters)
- nil))
- ;; when the network process is deleted by another query
- ;; or the user queried is not found , query is _finished_
- ;; unsuccessful and we want to restore identica-method
- ;; to loose track of this unsuccessful attempt
- (setq identica-method identica-last-timeline-retrieved))))
- ((< (- (point-max) (or (re-search-forward ">\r?\n\r*$" nil t) 0)) 2)
- ;;Checking the whether the message is complete by
- ;;searching for > that closes the last tag, followed by
- ;;CRLF at (point-max)
- (when (setq body (identica-get-response-body))
- (setq identica-new-dents-count
- (count t (mapcar
- #'identica-cache-status-datum
- (reverse (identica-xmltree-to-status
- body)))))
- ; Shorten the timeline if necessary
- (if (and identica-display-max-dents
- (> (safe-length identica-timeline-data)
- identica-display-max-dents))
- (cl-set-nthcdr identica-display-max-dents
- identica-timeline-data nil))
- (identica-render-timeline)
- (if (> identica-new-dents-count 0)
- (run-hooks 'identica-new-dents-hook))
- (when identica-display-success-messages
- (message (or success-message "Success: Get"))))))
- (unless (get-buffer-process (current-buffer))
- (kill-buffer (current-buffer))))
-
-(defun identica-render-timeline ()
- (with-current-buffer (identica-buffer)
- (let ((point (point))
- (end (point-max))
- (wrapped (cond (longlines-mode 'longlines-mode)
- (visual-line-mode 'visual-line-mode)
- (t nil))))
-
- (setq buffer-read-only nil)
- (erase-buffer)
- (when wrapped (funcall wrapped -1))
- (mapc (lambda (status)
- (insert (identica-format-status
- status identica-status-format))
- (if (not wrapped)
- (progn
- (fill-region-as-paragraph
- (save-excursion (beginning-of-line) (point)) (point))))
- (insert "\n")
- (if identica-oldest-first
- (goto-char (point-min))))
- identica-timeline-data)
- (if (and identica-image-stack window-system)
- (clear-image-cache))
- (when wrapped (funcall wrapped 1))
- (setq buffer-read-only t)
- (debug-print (current-buffer))
- (goto-char (+ point (if identica-scroll-mode (- (point-max) end) 0)))
- (identica-set-mode-string nil)
- (setq identica-last-timeline-retrieved identica-method)
- (if transient-mark-mode (deactivate-mark)))))
-
-(defun identica-format-status (status format-str)
- (flet ((attr (key)
- (assocref key status))
- (profile-image
- ()
- (let ((profile-image-url (attr 'user-profile-image-url))
- (icon-string "\n "))
- (if (string-match "/\\([^/?]+\\)\\(?:\\?\\|$\\)" profile-image-url)
- (let ((filename (match-string-no-properties 1 profile-image-url)))
- ;; download icons if does not exist
- (if (file-exists-p (concat identica-tmp-dir
- "/" filename))
- t
- (add-to-list 'identica-image-stack profile-image-url))
-
- (when (and icon-string identica-icon-mode)
- (set-text-properties
- 1 2 `(display ,(create-image (concat identica-tmp-dir "/" filename)))
- icon-string)
- icon-string))))))
- (let ((cursor 0)
- (result ())
- c
- found-at)
- (setq cursor 0)
- (setq result '())
- (while (setq found-at (string-match "%\\(C{\\([^}]+\\)}\\|[A-Za-z#@']\\)" format-str cursor))
- (setq c (string-to-char (match-string-no-properties 1 format-str)))
- (if (> found-at cursor)
- (list-push (substring format-str cursor found-at) result)
- "|")
- (setq cursor (match-end 1))
-
- (case c
- ((?s) ; %s - screen_name
- (list-push (attr 'user-screen-name) result))
- ((?S) ; %S - name
- (list-push (attr 'user-name) result))
- ((?i) ; %i - profile_image
- (list-push (profile-image) result))
- ((?d) ; %d - description
- (list-push (attr 'user-description) result))
- ((?l) ; %l - location
- (list-push (attr 'user-location) result))
- ((?L) ; %L - " [location]"
- (let ((location (attr 'user-location)))
- (unless (or (null location) (string= "" location))
- (list-push (concat " [" location "]") result)) ))
- ((?u) ; %u - url
- (list-push (attr 'user-url) result))
- ((?j) ; %j - user.id
- (list-push (format "%d" (attr 'user-id)) result))
- ((?r) ; %r - in_reply_to_status_id
- (let ((reply-id (attr 'in-reply-to-status-id))
- (reply-name (attr 'in-reply-to-screen-name)))
- (unless (or (null reply-id) (string= "" reply-id)
- (null reply-name) (string= "" reply-name))
- (let ((in-reply-to-string (format "in reply to %s" reply-name))
- (url (identica-get-status-url reply-id)))
- (add-text-properties
- 0 (length in-reply-to-string)
- `(mouse-face highlight
- face identica-uri-face
- uri ,url)
- in-reply-to-string)
- (list-push (concat " " in-reply-to-string) result)))))
- ((?p) ; %p - protected?
- (let ((protected (attr 'user-protected)))
- (when (string= "true" protected)
- (list-push "[x]" result))))
- ((?c) ; %c - created_at (raw UTC string)
- (list-push (attr 'created-at) result))
- ((?C) ; %C{time-format-str} - created_at (formatted with time-format-str)
- (list-push (identica-local-strftime
- (or (match-string-no-properties 2 format-str) "%H:%M:%S")
- (attr 'created-at))
- result))
- ((?@) ; %@ - X seconds ago
- (let ((created-at
- (apply
- 'encode-time
- (parse-time-string (attr 'created-at))))
- (now (current-time)))
- (let ((secs (+ (* (- (car now) (car created-at)) 65536)
- (- (cadr now) (cadr created-at))))
- time-string url)
- (setq time-string
- (cond ((< secs 5) "less than 5 seconds ago")
- ((< secs 10) "less than 10 seconds ago")
- ((< secs 20) "less than 20 seconds ago")
- ((< secs 30) "half a minute ago")
- ((< secs 60) "less than a minute ago")
- ((< secs 150) "1 minute ago")
- ((< secs 2400) (format "%d minutes ago"
- (/ (+ secs 30) 60)))
- ((< secs 5400) "about 1 hour ago")
- ((< secs 84600) (format "about %d hours ago"
- (/ (+ secs 1800) 3600)))
- (t (format-time-string "%I:%M %p %B %d, %Y" created-at))))
- (setq url (identica-get-status-url (attr 'id)))
- ;; make status url clickable
- (add-text-properties
- 0 (length time-string)
- `(mouse-face highlight
- face identica-uri-face
- uri ,url)
- time-string)
- (list-push time-string result))))
- ((?t) ; %t - text
- (list-push ;(clickable-text)
- (attr 'text)
- result))
- ((?') ; %' - truncated
- (let ((truncated (attr 'truncated)))
- (when (string= "true" truncated)
- (list-push "..." result))))
- ((?f) ; %f - source
- (list-push (attr 'source) result))
- ((?#) ; %# - id
- (list-push (format "%d" (attr 'id)) result))
- (t
- (list-push (char-to-string c) result))))
- (list-push (substring format-str cursor) result)
- (let ((formatted-status (apply 'concat (nreverse result))))
- (add-text-properties 0 (length formatted-status)
- `(username ,(attr 'user-screen-name)
- id, (attr 'id)
- text ,(attr 'text))
- formatted-status)
- formatted-status))))
-
-(defun identica-http-post
- (method-class method &optional parameters sentinel sentinel-arguments)
- "Send HTTP POST request to statusnet server
-METHOD-CLASS must be one of Identica API method classes(statuses, users or direct_messages).
-METHOD must be one of Identica API method which belongs to METHOD-CLASS.
-PARAMETERS is alist of URI parameters. ex) ((\"mode\" . \"view\") (\"page\" . \"6\")) => <URI>?mode=view&page=6"
- (or sentinel (setq sentinel 'identica-http-post-default-sentinel))
- (let ((url-request-method "POST")
- (url (concat "http://"statusnet-server "/api/" method-class "/" method ".xml"
- (when parameters
- (concat "?"
- (mapconcat
- (lambda (param-pair)
- (format "%s=%s"
- (identica-percent-encode (car param-pair))
- (identica-percent-encode (cdr param-pair))))
- parameters
- "&")))))
- (url-package-name "emacs-identicamode")
- (url-package-version identica-mode-version)
- (url-request-extra-headers '(("Content-Length" . "0")))
- (url-show-status nil))
- (identica-set-proxy)
- (identica-set-auth url)
- (when (get-buffer-process identica-http-buffer)
- (delete-process identica-http-buffer)
- (kill-buffer identica-http-buffer))
- (url-retrieve url sentinel
- (append (list method-class method parameters)
- sentinel-arguments))))
-
-(defun identica-http-post-default-sentinel
- (&optional status method-class method parameters success-message)
- (cond ((and
- (setq error-object (or (assoc :error status)
- (and (equal :error (car status))
- (cadr status))))
- (y-or-n-p (format "Network error:%s %s Retry?"
- (cadr error-object)
- (caddr error-object))))
- (identica-http-post method-class method parameters nil success-message))
- (identica-display-success-messages
- (message (or success-message "Success: Post"))))
- (unless (get-buffer-process (current-buffer))
- (kill-buffer (current-buffer))))
-
-(defun identica-get-response-header (&optional buffer)
- "Exract HTTP response header from HTTP response.
-`buffer' may be a buffer or the name of an existing buffer.
- If `buffer' is omitted, current-buffer is parsed."
- (or buffer
- (setq buffer (current-buffer)))
- (save-excursion
- (set-buffer buffer)
- (let ((end (or (and (search-forward-regexp "\r?\n\r?\n" (point-max) t)
- (match-beginning 0))
- 0)))
- (and (> end 1)
- (buffer-substring (point-min) end)))))
-
-(defun identica-get-response-body (&optional buffer)
- "Exract HTTP response body from HTTP response, parse it as XML, and return a XML tree as list.
-`buffer' may be a buffer or the name of an existing buffer.
- If `buffer' is omitted, current-buffer is parsed."
- (or buffer
- (setq buffer (current-buffer)))
- (save-excursion
- (set-buffer buffer)
- (set-buffer-multibyte t)
- (let ((start (save-excursion
- (goto-char (point-min))
- (and (re-search-forward "<\?xml" (point-max) t)
- (match-beginning 0)))))
- (identica-clean-response-body)
- (and start
- (xml-parse-region start (point-max))))))
-
-(defun identica-clean-weird-chars (&optional buffer)
-;;(if (null buffer) (setq buffer (identica-http-buffer)))
-(with-current-buffer (identica-http-buffer)
- (goto-char (point-min))
- (while (re-search-forward "\
-
-?
-[0-9a-z]*\
-
-?
-?" nil t)
-(replace-match ""))
-(buffer-string)))
-
-(defun identica-clean-response-body ()
- "Removes weird strings (e.g., 1afc, a or 0) from within the
-response body. Known Statusnet issue. Mostly harmless except if
-in tags."
- (goto-char (point-min))
- (while (re-search-forward "\r?\n[0-9a-z]+\r?\n" nil t)
- (replace-match "")))
-
-(defun identica-cache-status-datum (status-datum &optional data-var)
- "Cache status datum into data-var(default identica-timeline-data)
-If STATUS-DATUM is already in DATA-VAR, return nil. If not, return t."
- (if (null data-var)
- (setf data-var 'identica-timeline-data))
- (let ((id (cdr (assq 'id status-datum))))
- (if (or (null (symbol-value data-var))
- (not (find-if
- (lambda (item)
- (eql id (cdr (assq 'id item))))
- (symbol-value data-var))))
- (progn
- (set data-var (cons status-datum (symbol-value data-var)))
- t)
- nil)))
-
-(defun identica-status-to-status-datum (status)
- (flet ((assq-get (item seq)
- (car (cddr (assq item seq)))))
- (let* ((status-data (cddr status))
- id text source created-at truncated
- in-reply-to-status-id
- in-reply-to-screen-name
- (user-data (cddr (assq 'user status-data)))
- user-id user-name
- user-screen-name
- user-location
- user-description
- user-profile-image-url
- user-url
- user-protected
- regex-index)
-
- (setq id (string-to-number (assq-get 'id status-data)))
- (setq text (identica-decode-html-entities
- (assq-get 'text status-data)))
- (setq source (identica-decode-html-entities
- (assq-get 'source status-data)))
- (setq created-at (assq-get 'created_at status-data))
- (setq truncated (assq-get 'truncated status-data))
- (setq in-reply-to-status-id
- (identica-decode-html-entities
- (assq-get 'in_reply_to_status_id status-data)))
- (setq in-reply-to-screen-name
- (identica-decode-html-entities
- (assq-get 'in_reply_to_screen_name status-data)))
- (setq user-id (string-to-number (assq-get 'id user-data)))
- (setq user-name (identica-decode-html-entities
- (assq-get 'name user-data)))
- (setq user-screen-name (identica-decode-html-entities
- (assq-get 'screen_name user-data)))
- (setq user-location (identica-decode-html-entities
- (assq-get 'location user-data)))
- (setq user-description (identica-decode-html-entities
- (assq-get 'description user-data)))
- (setq user-profile-image-url (assq-get 'profile_image_url user-data))
- (setq user-url (assq-get 'url user-data))
- (setq user-protected (assq-get 'protected user-data))
-
- ;; make username clickable
- (add-text-properties
- 0 (length user-name)
- `(mouse-face highlight
- uri ,(concat "https://" statusnet-server "/" user-screen-name)
- face identica-username-face)
- user-name)
-
- ;; make screen-name clickable
- (add-text-properties
- 0 (length user-screen-name)
- `(mouse-face highlight
- face identica-username-face
- uri ,(concat "https://" statusnet-server "/" user-screen-name)
- face identica-username-face)
- user-screen-name)
-
- ;; make URI clickable
- (setq regex-index 0)
- (while regex-index
- (setq regex-index
- (string-match "@\\([_[:word:]0-9]+\\)\\|!\\([_[:word:]0-9\-]+\\)\\|#\\([_[:word:]0-9\-]+\\)\\|\\(ur1\.ca/[a-z0-9]+/?\\|https?://[-_.!~*'()[:word:]0-9\;/?:@&=+$,%#]+\\)"
- text
- regex-index))
- (when regex-index
- (let* ((matched-string (match-string-no-properties 0 text))
- (screen-name (match-string-no-properties 1 text))
- (group-name (match-string-no-properties 2 text))
- (tag-name (match-string-no-properties 3 text))
- (uri (match-string-no-properties 4 text)))
- (add-text-properties
- (if (or screen-name group-name tag-name)
- (+ 1 (match-beginning 0))
- (match-beginning 0))
- (match-end 0)
- (if (or screen-name group-name tag-name)
- `(mouse-face
- highlight
- face identica-uri-face
- uri ,(if screen-name
- (concat "https://" statusnet-server "/" screen-name)
- (if group-name
- (concat "https://" statusnet-server "/group/" group-name)
- (concat "https://" statusnet-server "/tag/" tag-name)))
- uri-in-text ,(if screen-name
- (concat "https://" statusnet-server "/" screen-name)
- (if group-name
- (concat "https://" statusnet-server "/group/" group-name)
- (concat "https://" statusnet-server "/tag/" tag-name)))
- tag ,tag-name
- group ,group-name)
- `(mouse-face highlight
- face identica-uri-face
- uri ,uri
- uri-in-text ,uri))
- text))
- (setq regex-index (match-end 0)) ))
-
-
- ;; make source pretty and clickable
- (if (string-match "<a href=\"\\(.*\\)\">\\(.*\\)</a>" source)
- (let ((uri (match-string-no-properties 1 source))
- (caption (match-string-no-properties 2 source)))
- (setq source caption)
- (add-text-properties
- 0 (length source)
- `(mouse-face highlight
- face identica-uri-face
- source ,source)
- source)))
-
- ;; save last update time
- (setq identica-timeline-last-update created-at)
-
- ;; highlight replies
- (if (string-match (concat "@" identica-username) text)
- (add-text-properties 0 (length text)
- `(face identica-reply-face) text))
- (mapcar
- (lambda (sym)
- `(,sym . ,(symbol-value sym)))
- '(id text source created-at truncated
- in-reply-to-status-id
- in-reply-to-screen-name
- user-id user-name user-screen-name user-location
- user-description
- user-profile-image-url
- user-url
- user-protected)))))
-
-(defun identica-xmltree-to-status (xmltree)
- (mapcar #'identica-status-to-status-datum
- ;; quirk to treat difference between xml.el in Emacs21 and Emacs22
- ;; On Emacs22, there may be blank strings
- (let ((ret nil) (statuses (reverse (cddr (car xmltree)))))
- (while statuses
- (if (consp (car statuses))
- (setq ret (cons (car statuses) ret)))
- (setq statuses (cdr statuses)))
- ret)))
-
-(defun identica-percent-encode (str &optional coding-system)
- (if (or (null coding-system)
- (not (coding-system-p coding-system)))
- (setq coding-system 'utf-8))
- (mapconcat
- (lambda (c)
- (cond
- ((identica-url-reserved-p c)
- (char-to-string c))
- ((eq c ? ) "+")
- (t (format "%%%x" c))))
- (encode-coding-string str coding-system)
- ""))
-
-(defun identica-url-reserved-p (ch)
- (or (and (<= ?A ch) (<= ch ?z))
- (and (<= ?0 ch) (<= ch ?9))
- (eq ?. ch)
- (eq ?- ch)
- (eq ?_ ch)
- (eq ?~ ch)))
-
-(defun identica-decode-html-entities (encoded-str)
- (if encoded-str
- (let ((cursor 0)
- (found-at nil)
- (result '()))
- (while (setq found-at
- (string-match "&\\(#\\([0-9]+\\)\\|\\([A-Za-z]+\\)\\);"
- encoded-str cursor))
- (when (> found-at cursor)
- (list-push (substring encoded-str cursor found-at) result))
- (let ((number-entity (match-string-no-properties 2 encoded-str))
- (letter-entity (match-string-no-properties 3 encoded-str)))
- (cond (number-entity
- (list-push
- (char-to-string
- (identica-ucs-to-char
- (string-to-number number-entity))) result))
- (letter-entity
- (cond ((string= "gt" letter-entity) (list-push ">" result))
- ((string= "lt" letter-entity) (list-push "<" result))
- (t (list-push "?" result))))
- (t (list-push "?" result)))
- (setq cursor (match-end 0))))
- (list-push (substring encoded-str cursor) result)
- (apply 'concat (nreverse result)))
- ""))
-
-(defun identica-timer-action (func)
- (let ((buf (get-buffer identica-buffer)))
- (if (null buf)
- (identica-stop)
- (funcall func))))
-
-(defun identica-update-status-if-not-blank (method-class method status &optional parameters reply-to-id)
- (if (string-match "^\\s-*\\(?:@[-_a-z0-9]+\\)?\\s-*$" status)
- nil
- (if (equal method-class "statuses")
- (identica-http-post method-class method
- `(("status" . ,status)
- ("source" . ,identica-source)
- ,@(if reply-to-id
- `(("in_reply_to_status_id"
- . ,(number-to-string reply-to-id))))))
- (identica-http-post method-class method
- `(("text" . ,status)
- ("user" . ,parameters) ;must change this to parse parameters as list
- ("source" . ,identica-source))))
-
- t))
-
-(defvar identica-update-status-edit-map
- (let ((map (make-sparse-keymap)))
- (define-key map (kbd "C-c C-c") 'identica-update-status-from-edit-buffer-send)
- (define-key map (kbd "C-c C-k") 'identica-update-status-from-edit-buffer-cancel)
- map))
-
-(define-derived-mode identica-update-status-edit-mode text-mode "Identica Status Edit"
- (use-local-map identica-update-status-edit-map))
-
-(defvar identica-update-status-edit-method-class)
-(defvar identica-update-status-edit-method)
-(defvar identica-update-status-edit-parameters)
-(defvar identica-update-status-edit-reply-to-id)
-
-(defun identica-update-status-edit-in-edit-buffer (init-str msgtype method-class method parameters &optional reply-to-id)
- (let ((buf (get-buffer-create "*identica-status-update-edit*")))
- (pop-to-buffer buf)
- (with-current-buffer buf
- (if (not (equal major-mode 'identica-update-status-edit-mode))
- (progn
- (identica-update-status-edit-mode)
- (longlines-mode)
- (make-local-variable 'identica-update-status-edit-method-class)
- (make-local-variable 'identica-update-status-edit-method)
- (make-local-variable 'identica-update-status-edit-parameters)
- (make-local-variable 'identica-update-status-edit-reply-to-id)
- (if (> (length parameters) 0)
- (setq mode-line-format
- (cons (format "%s(%s) (%%i/140) " msgtype parameters)
- mode-line-format))
- t (setq mode-line-format
- (cons (format "%s (%%i/140) " msgtype) mode-line-format)))))
- (setq identica-update-status-edit-method-class method-class)
- (setq identica-update-status-edit-method method)
- (setq identica-update-status-edit-parameters parameters)
- (setq identica-update-status-edit-reply-to-id reply-to-id)
- (message identica-update-status-edit-method-class)
- (insert init-str)
- (message "Type C-c C-c to post status update (C-c C-k to cancel)."))))
-
-(defun identica-show-minibuffer-length (&optional beg end len)
- "Show the number of characters in minibuffer."
- (when (minibuffer-window-active-p (selected-window))
- (let* ((status-len (- (buffer-size) (minibuffer-prompt-width)))
- (mes (format "%d" status-len)))
- (if (<= 23 emacs-major-version)
- (minibuffer-message mes) ; Emacs23 or later
- (minibuffer-message (concat " (" mes ")")))
- )))
-
-(defun identica-setup-minibuffer ()
- (identica-show-minibuffer-length)
- (add-hook 'post-command-hook 'identica-show-minibuffer-length t t))
-
-(defun identica-finish-minibuffer ()
- (remove-hook 'post-command-hook 'identica-show-minibuffer-length t))
-
-(defun identica-update-status (update-input-method &optional init-str reply-to-id method-class method parameters)
- (if (null init-str) (setq init-str ""))
- (let ((msgtype "")
- (status init-str)
- (not-posted-p t)
- (user nil)
- (map minibuffer-local-map)
- (minibuffer-message-timeout nil))
- (define-key map (kbd "<f4>") 'identica-shortenurl-replace-at-point)
- (if (null method-class)
- (progn (setq msgtype "Status")
- (setq method-class "statuses")
- (setq method "update"))
- (progn (setq msgtype "Direct message")
- (setq method-class "direct_messages")
- (setq parameters (read-from-minibuffer "To user: " user nil nil nil nil t))
- (setq method "new")))
- (cond ((eq update-input-method 'minibuffer)
- (add-hook 'minibuffer-setup-hook 'identica-setup-minibuffer t)
- (add-hook 'minibuffer-exit-hook 'identica-finish-minibuffer t)
- (unwind-protect
- (while not-posted-p
- (setq status (read-from-minibuffer (concat msgtype ": ") status nil nil nil nil t))
- (while (< 141 (length status))
- (setq status (read-from-minibuffer (format (concat msgtype "(%d): ")
- (- 140 (length status)))
- status nil nil nil nil t)))
- (setq not-posted-p
- (not (identica-update-status-if-not-blank method-class method status parameters reply-to-id))))
- (remove-hook 'minibuffer-setup-hook 'identica-setup-minibuffer)
- (remove-hook 'minibuffer-exit-hook 'identica-finish-minibuffer)))
- ((eq update-input-method 'edit-buffer)
- (identica-update-status-edit-in-edit-buffer init-str msgtype method-class method parameters reply-to-id))
- (t (error "Unknown update-input-method in identica-update-status: %S" update-input-method)))))
-
-(defun identica-update-status-from-edit-buffer-send ()
- (interactive)
- (with-current-buffer "*identica-status-update-edit*"
- (longlines-encode-region (point-min) (point-max))
- (let* ((status (buffer-substring-no-properties (point-min) (point-max)))
- (status-len (length status)))
- (if (< 140 status-len)
- (message (format "Beyond 140 chars. Remove %d chars." (- status-len 140)))
- (if (identica-update-status-if-not-blank identica-update-status-edit-method-class
- identica-update-status-edit-method status identica-update-status-edit-parameters identica-update-status-edit-reply-to-id)
- (progn
- (erase-buffer)
- (bury-buffer))
- (message "Update failed!"))))))
-
-(defun identica-update-status-from-minibuffer (&optional init-str method-class method parameters reply-to-id)
- (interactive)
- (identica-update-status 'minibuffer init-str method-class method parameters reply-to-id))
-
-(defun identica-update-status-from-edit-buffer (&optional init-str method-class method parameters)
- (interactive)
- (identica-update-status 'edit-buffer init-str method-class method parameters))
-
-(defun identica-update-status-from-edit-buffer-cancel ()
- (interactive)
- (when (or (not identica-update-status-edit-confirm-cancellation)
- (yes-or-no-p
- "Really cancel editing this status message (any changes will be lost)?"))
- (erase-buffer)
- (bury-buffer)))
-
-(defun identica-update-status-from-region (beg end)
- (interactive "r")
- (if (> (- end beg) 140) (setq end (+ beg 140)))
- (if (< (- end beg) -140) (setq beg (+ end 140)))
- (identica-update-status-if-not-blank "statuses" "update" (buffer-substring beg end)))
-
-(defun identica-tinyurl-unjson-google (result)
- "Gets only the URL from JSON URL tinyfying service results.
-
-Google's shortening service, goo.gl, returns shortened URLs as a
-JSON dictionary. This function retrieves only the URL value from
-this dictionary, only if identica-urlshortening-service is 'google.
-"
- (if (eq identica-urlshortening-service 'google)
- (cdr (assoc 'short_url (json-read-from-string result)))
- result))
-
-(defun identica-ur1ca-get (api longurl)
- "Shortens url through ur1.ca free service 'as in freedom'"
- (let* ((url-request-method "POST")
- (url-request-extra-headers
- '(("Content-Type" . "application/x-www-form-urlencoded")))
- (url-request-data (concat "longurl=" (url-hexify-string longurl)))
- (buffer (url-retrieve-synchronously api)))
- (with-current-buffer buffer
- (goto-char (point-min))
- (prog1
- (setq ur1short
- (if (search-forward-regexp "Your .* is: .*>\\(http://ur1.ca/[0-9A-Za-z].*\\)</a>" nil t)
- (match-string-no-properties 1)
- (error "URL shortening service failed: %s" longurl)))
- (kill-buffer buffer)))))
-
-(defun identica-shortenurl-get (longurl)
- "Shortens url through a url shortening service"
- (let ((api (cdr (assoc identica-urlshortening-service
- identica-urlshortening-services-map))))
- (unless api
- (error "`identica-urlshortening-service' was invalid. try one of %s"
- (mapconcat (lambda (x)
- (symbol-name (car x)))
- identica-urlshortening-services-map ", ")
- "."))
- (if longurl
- (if (or (eq identica-urlshortening-service 'ur1ca) (eq identica-urlshortening-service 'tighturl))
- (identica-ur1ca-get api longurl)
- (let ((buffer (url-retrieve-synchronously (concat api longurl))))
- (with-current-buffer buffer
- (goto-char (point-min))
- (prog1
- (identica-tinyurl-unjson-google
- (if (search-forward-regexp "\n\r?\n\\([^\n\r]*\\)" nil t)
- (match-string-no-properties 1)
- (error "URL shortening service failed: %s" longurl)))
- (kill-buffer buffer))))
- nil))))
-
-(defun identica-shortenurl-replace-at-point ()
- "Replace the url at point with a tiny version."
- (interactive)
- (let ((url-bounds (bounds-of-thing-at-point 'url)))
- (when url-bounds
- (let ((url (identica-shortenurl-get (thing-at-point 'url))))
- (when url
- (save-restriction
- (narrow-to-region (car url-bounds) (cdr url-bounds))
- (delete-region (point-min) (point-max))
- (insert url)))))))
-;;;
-;;; Commands
-;;;
-
-(defun identica-start (&optional action)
- (interactive)
- (if (null action)
- (setq action #'identica-current-timeline))
- (if identica-timer
- nil
- (setq identica-timer
- (run-at-time "0 sec"
- identica-timer-interval
- #'identica-timer-action action)))
- (setq identica-active-mode t)
- (identica-update-mode-line))
-
-(defun identica-stop ()
-"Stop Current network activitiy (if any) and the reload-timer."
- (interactive)
- (when (get-buffer-process identica-http-buffer)
- (delete-process identica-http-buffer)
- (kill-buffer identica-http-buffer))
- (setq identica-method identica-last-timeline-retrieved)
- (identica-set-mode-string nil)
- (and identica-timer
- (cancel-timer identica-timer))
- (setq identica-timer nil)
- (setq identica-active-mode nil)
- (identica-update-mode-line))
-
-(defun identica-get-timeline ()
- (if (not (eq identica-last-timeline-retrieved identica-method))
- (setq identica-timeline-last-update nil
- identica-timeline-data nil))
- (let ((buf (get-buffer identica-buffer)))
- (if (not buf)
- (identica-stop)
- (identica-http-get identica-method-class identica-method)))
- (if identica-icon-mode
- (if (and identica-image-stack window-system)
- (let ((proc
- (apply
- #'start-process
- "wget-images"
- nil
- "wget"
- (format "--directory-prefix=%s" identica-tmp-dir)
- "--no-clobber"
- "--quiet"
- identica-image-stack)))
- (set-process-sentinel
- proc
- (lambda (proc stat)
- (clear-image-cache)
- ))))))
-
-(defun identica-friends-timeline ()
- (interactive)
- (setq identica-method "friends_timeline")
- (setq identica-method-class "statuses")
- (identica-get-timeline))
-
-(defun identica-replies-timeline ()
- (interactive)
- (setq identica-method "replies")
- (setq identica-method-class "statuses")
- (identica-get-timeline))
-
-;; (defun identica-direct-messages-timeline ()
-;; (interactive)
-;; (setq identica-method "direct_messages")
-;; (setq identica-method-class "none")
-;; (identica-get-timeline))
-
-(defun identica-public-timeline ()
- (interactive)
- (setq identica-method "public_timeline")
- (setq identica-method-class "statuses")
- (identica-get-timeline))
-
-(defun identica-group-timeline (&optional group)
- (interactive)
- (unless group
- (setq group (read-from-minibuffer "Group: " nil nil nil nil nil t)))
- (setq identica-method-class "statusnet/groups")
- (if (string-equal group "")
- (setq identica-method "timeline")
- (setq identica-method (concat "timeline/" group)))
- (identica-get-timeline))
-
-(defun identica-tag-timeline (&optional tag)
- (interactive)
- (unless tag
- (setq tag (read-from-minibuffer "Tag: " nil nil nil nil nil t)))
- (setq identica-method-class "statusnet/tags")
- (if (string-equal tag "")
- (setq identica-method "timeline")
- (setq identica-method (concat "timeline/" tag)))
- (identica-get-timeline))
-
-(defun identica-user-timeline ()
- (interactive)
- (let ((from-user (read-from-minibuffer "User [Empty for mine]: "
- nil nil nil nil nil t)))
- (if (string-equal from-user "")
- (setq identica-method "user_timeline")
- (setq identica-method (concat "user_timeline/" from-user))))
- (identica-get-timeline))
-
-(defun identica-current-timeline ()
- (interactive)
- (identica-get-timeline))
-
-(defun identica-update-status-interactive ()
- (interactive)
- (identica-update-status identica-update-status-method))
-
-(defun identica-direct-message-interactive ()
- (interactive)
- (identica-update-status identica-update-status-method nil nil "direct_messages" "new"))
-
-(defun identica-erase-old-statuses ()
- (interactive)
- (setq identica-timeline-data nil)
- (if (not identica-last-timeline-retrieved)
- (setq identica-last-timeline-retrieved identica-method))
- (identica-http-get "statuses" identica-last-timeline-retrieved)
- )
-
-(defun identica-click ()
- (interactive)
- (let ((uri (get-text-property (point) 'uri)))
- (if uri
- (browse-url uri))))
-
-(defun identica-enter ()
- (interactive)
- (let ((username (get-text-property (point) 'username))
- (id (get-text-property (point) 'id))
- (uri (get-text-property (point) 'uri))
- (group (get-text-property (point) 'group))
- (tag (get-text-property (point) 'tag)))
- (if group (identica-group-timeline group)
- (if tag (identica-tag-timeline tag)
- (if uri (browse-url uri)
- (if username
- (identica-update-status identica-update-status-method
- (concat "@" username " ") id)))))))
-
-(defun identica-next-link nil
- (interactive)
- (goto-char (next-single-property-change (point) 'uri))
- (if (not (get-text-property (point) 'uri))
- (goto-char (next-single-property-change (point) 'uri))))
-
-(defun identica-prev-link nil
- (interactive)
- (goto-char (previous-single-property-change (point) 'uri))
- (if (not (get-text-property (point) 'uri))
- (goto-char (previous-single-property-change (point) 'uri))))
-
-(defun identica-follow (&optional remove)
- (interactive)
- (let ((username (get-text-property (point) 'username))
- (method (if remove "destroy" "create"))
- (message (if remove "unfollowing" "following")))
- (unless username
- (setq username (read-from-minibuffer "user: ")))
- (if (> (length username) 0)
- (when (y-or-n-p (format "%s %s? " message username))
- (identica-http-post (format "friendships/%s" method) username)
- (message (format "Now %s %s" message username)))
- (message "No user selected"))))
-
-(defun identica-unfollow ()
- (interactive)
- (identica-follow t))
-
-(defun identica-favorite ()
- (interactive)
- (if (y-or-n-p "Do you want to favor this notice? ")
- (let ((id (get-text-property (point) 'id)))
- (identica-http-post "favorites/create" (number-to-string id))
- (message "Notice saved as favorite"))))
-
-(defun identica-repeat ()
- (interactive)
- (if (y-or-n-p "Do you want to repeat this notice? ")
- (let ((id (get-text-property (point) 'id)))
- (identica-http-post "statuses/retweet" (number-to-string id))
- (message "Notice repeated"))))
-
-(defun identica-view-user-page ()
- (interactive)
- (let ((uri (get-text-property (point) 'uri)))
- (if uri
- (browse-url uri))))
-
-(defun identica-redent ()
- (interactive)
- (let ((username (get-text-property (point) 'username))
- (id (get-text-property (point) 'id))
- (text (replace-regexp-in-string "!\\(.\\)" "#\\1" (get-text-property (point) 'text))))
- (when username
- (identica-update-status identica-update-status-method
- (concat identica-redent-format " @" username ": " text) id))))
-
-(defun identica-reply-to-user ()
- (interactive)
- (let ((username (get-text-property (point) 'username))
- (id (get-text-property (point) 'id)))
- (if username
- (identica-update-status identica-update-status-method (concat "@" username " ") id))))
-
-(defun identica-get-password ()
- (or identica-password
- (setq identica-password (read-passwd "password: "))))
-
-(defun identica-goto-next-status ()
- "Go to next status."
- (interactive)
- (let ((pos))
- (setq pos (identica-get-next-username-face-pos (point)))
- (if pos
- (goto-char pos)
- (message "End of status."))))
-
-(defun identica-get-next-username-face-pos (pos)
- (interactive)
- (let ((prop))
- (catch 'not-found
- (while (and pos (not (eq prop identica-username-face)))
- (setq pos (next-single-property-change pos 'face))
- (when (eq pos nil) (throw 'not-found nil))
- (setq prop (get-text-property pos 'face)))
- pos)))
-
-(defun identica-goto-previous-status ()
- "Go to previous status."
- (interactive)
- (let ((pos))
- (setq pos (identica-get-previous-username-face-pos (point)))
- (if pos
- (goto-char pos)
- (message "Start of status."))))
-
-(defun identica-get-previous-username-face-pos (pos)
- (interactive)
- (let ((prop))
- (catch 'not-found
- (while (and pos (not (eq prop identica-username-face)))
- (setq pos (previous-single-property-change pos 'face))
- (when (eq pos nil) (throw 'not-found nil))
- (setq prop (get-text-property pos 'face)))
- pos)))
-
-(defun identica-goto-next-status-of-user ()
- "Go to next status of user."
- (interactive)
- (let ((user-name (identica-get-username-at-pos (point)))
- (pos (identica-get-next-username-face-pos (point))))
- (while (and (not (eq pos nil))
- (not (equal (identica-get-username-at-pos pos) user-name)))
- (setq pos (identica-get-next-username-face-pos pos)))
- (if pos
- (goto-char pos)
- (if user-name
- (message "End of %s's status." user-name)
- (message "Invalid user-name.")))))
-
-(defun identica-goto-previous-status-of-user ()
- "Go to previous status of user."
- (interactive)
- (let ((user-name (identica-get-username-at-pos (point)))
- (pos (identica-get-previous-username-face-pos (point))))
- (while (and (not (eq pos nil))
- (not (equal (identica-get-username-at-pos pos) user-name)))
- (setq pos (identica-get-previous-username-face-pos pos)))
- (if pos
- (goto-char pos)
- (if user-name
- (message "Start of %s's status." user-name)
- (message "Invalid user-name.")))))
-
-(defun identica-get-username-at-pos (pos)
- (let ((start-pos pos)
- (end-pos))
- (catch 'not-found
- (while (eq (get-text-property start-pos 'face) identica-username-face)
- (setq start-pos (1- start-pos))
- (when (or (eq start-pos nil) (eq start-pos 0)) (throw 'not-found nil)))
- (setq start-pos (1+ start-pos))
- (setq end-pos (next-single-property-change pos 'face))
- (buffer-substring start-pos end-pos))))
-
-(defun identica-get-status-url (id)
- "Generate status URL."
- (format "https://%s/notice/%s" statusnet-server id))
-
-(defun identica-get-context-url (id)
- "Generate status URL."
- (format "https://%s/conversation/%s" statusnet-server id))
-
-;; Icons
-;;; ACTIVE/INACTIVE
-(defconst identica-active-indicator-image
- (when (image-type-available-p 'xpm)
- '(image :type xpm
- :ascent center
- :data
- "/* XPM */
-static char * statusnet_xpm[] = {
-\"16 16 14 1\",
-\" c None\",
-\". c #8F0000\",
-\"+ c #AB4040\",
-\"@ c #D59F9F\",
-\"# c #E3BFBF\",
-\"$ c #CE8F8F\",
-\"% c #C78080\",
-\"& c #FFFFFF\",
-\"* c #B96060\",
-\"= c #DCAFAF\",
-\"- c #C07070\",
-\"; c #F1DFDF\",
-\"> c #961010\",
-\", c #9D2020\",
-\" ....... \",
-\" ......... \",
-\" ........... \",
-\" ....+@#$+.... \",
-\"....%&&&&&*.... \",
-\"...+&&&&&&&+... \",
-\"...=&&&&&&&$... \",
-\"...#&&&&&&&#... \",
-\"...=&&&&&&&@... \",
-\"...*&&&&&&&-... \",
-\"....@&&&&&&=... \",
-\" ....-#&#$;&>.. \",
-\" ..........,>.. \",
-\" ............. \",
-\" ............\",
-\" . ..\"};")))
-
-(defconst identica-inactive-indicator-image
- (when (image-type-available-p 'xpm)
- '(image :type xpm
- :ascent center
- :data
- "/* XPM */
-static char * statusnet_off_xpm[] = {
-\"16 16 13 1\",
-\" g None\",
-\". g #5B5B5B\",
-\"+ g #8D8D8D\",
-\"@ g #D6D6D6\",
-\"# g #EFEFEF\",
-\"$ g #C9C9C9\",
-\"% g #BEBEBE\",
-\"& g #FFFFFF\",
-\"* g #A5A5A5\",
-\"= g #E3E3E3\",
-\"- g #B2B2B2\",
-\"; g #676767\",
-\"> g #747474\",
-\" ....... \",
-\" ......... \",
-\" ........... \",
-\" ....+@#$+.... \",
-\"....%&&&&&*.... \",
-\"...+&&&&&&&+... \",
-\"...=&&&&&&&$... \",
-\"...#&&&&&&&#... \",
-\"...=&&&&&&&@... \",
-\"...*&&&&&&&-... \",
-\"....@&&&&&&=... \",
-\" ....-#&#$&&;.. \",
-\" ..........>;.. \",
-\" ............. \",
-\" ............\",
-\" . ..\"};")))
-
-(let ((props
- (when (display-mouse-p)
- `(local-map
- ,(purecopy (make-mode-line-mouse-map
- 'mouse-2 #'identica-toggle-activate-buffer))
- help-echo "mouse-2 toggles automatic updates"))))
- (defconst identica-modeline-active
- (if identica-active-indicator-image
- (apply 'propertize " "
- `(display ,identica-active-indicator-image ,@props))
- " "))
- (defconst identica-modeline-inactive
- (if identica-inactive-indicator-image
- (apply 'propertize "INACTIVE"
- `(display ,identica-inactive-indicator-image ,@props))
- "INACTIVE")))
-
- (make-local-variable 'identica-active-mode)
- (setq identica-active-mode t)
-
-(defun identica-toggle-activate-buffer ()
- (interactive)
- (setq identica-active-mode (not identica-active-mode))
- (if (not identica-active-mode)
- (identica-stop)
- (identica-start)))
-
-(defun identica-mode-line-buffer-identification ()
- (if identica-active-mode
- identica-modeline-active
- identica-modeline-inactive))
-
-(defun identica-update-mode-line ()
- "Update mode line."
- (force-mode-line-update))
-
-;;;###autoload
-(defun identica ()
- "Start identica-mode."
- (interactive)
- (identica-mode))
-
-(provide 'identica-mode)
-;;; identica.el ends here
diff --git a/.emacs.d/identica-mode.el b/.emacs.d/identica-mode.el
deleted file mode 120000
index 3104c70..0000000
--- a/.emacs.d/identica-mode.el
+++ /dev/null
@@ -1 +0,0 @@
-identica-mode-1.1/identica-mode.el \ No newline at end of file
diff --git a/.emacs.d/org-7.4.tar.gz b/.emacs.d/org-7.4.tar.gz
deleted file mode 100644
index e6d69b2..0000000
--- a/.emacs.d/org-7.4.tar.gz
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/Changes.org b/.emacs.d/org-7.4/Changes.org
deleted file mode 100644
index c88d879..0000000
--- a/.emacs.d/org-7.4/Changes.org
+++ /dev/null
@@ -1,2522 +0,0 @@
-# -*- mode: org; fill-column: 65 -*-
-
-#+begin_html
-<a href="/"><img src="http://orgmode.org/img/org-mode-unicorn.png" class="logo-link" /></a>
-#+end_html
-
-#+STARTUP: indent hidestars
-
-* Version 7.4
-:PROPERTIES:
-:VISIBILITY: content
-:CUSTOM_ID: v7.4
-:END:
-
-
-** Incompatible changes
-
-*** Agenda: rework ndays and span handling
-
-The variable =org-agenda-ndays= is obsolete - please use
-=org-agenda-span= instead.
-
-Thanks to Julien Danjou for this.
-
-** Details
-
-*** Improvements with inline tasks and indentation
-
-There is now a configurable way on how to export inline tasks. See
-the new variable =org-inlinetask-export-templates=.
-
-Thanks to Nicolas Goaziou for coding these changes.
-
-*** Agenda: Added a bulk "scattering" command
-
-=B S= in the agenda buffer will cause tasks to be rescheduled a random
-number of days into the future, with 7 as the default. This is useful
-if you've got a ton of tasks scheduled for today, you realize you'll
-never deal with them all, and you just want them to be distributed
-across the next N days. When called with a prefix arg, rescheduling
-will avoid weekend days.
-
-Thanks to John Wiegley for this.
-
-*** In-buffer completion is now done using John Wiegleys pcomplete.el
-
-Thanks to John Wiegley for much of this code.
-
-*** Sending radio tables from org buffers is now allowed
-
-Org radio tables can no also be sent inside Org buffers. Also,
-there is a new hook which get called after a table has been sent.
-
-Thanks to Seweryn Kokot.
-
-*** Command names shown in manual
-
-The reference manual now lists command names for most commands.
-Thanks to Andreas Röhler who started this project.
-
-*** Allow ap/pm times in agenda time grid
-
-Times in the agenda can now be displayed in am/pm format. See the new
-variable =org-agenda-timegrid-use-ampm=. Thanks to C. A. Webber for
-a patch to this effect.
-
-*** Rewriten clock table code
-
-The entire clocktable code has been rewritten to add more options and
-to make hacking time reports easier.
-
-Thanks to Erwin Vrolijk for a patch introducing clock tables for
-quarters.
-
-*** Babel
-**** Add =msosql= engine to sql code blocks
-SQL code blocks can now be executed using the =myosql= engine on
-Windows systems.
-
-Thanks to Sébastien Vauban for this contribution.
-
-**** Python code blocks now accept a =preamble= header argument
-This allows specification of coding declarations and library imports
-which must take place in the beginning of a file of executed python
-code (note this header argument is used during code block evaluation
-unlike the =shebang= header argument which is used during tangling).
-For example
-
-#+begin_src org
- ,#+begin_src python :preamble # -*- coding: utf-8 -*- :return s
- ,s = "é"
- ,#+end_src
-#+end_src
-
-Thanks to Vincent Beffara for this idea.
-
-**** Code block name is shown during evaluation query
-When the user is queried about the evaluation of a named code block
-the name of the code block is now displayed.
-
-Thanks to Tom Dye for this suggestion.
-
-**** Clojure code blocks results insertion
-The results of Clojure code blocks have been improved in two ways.
-1. lazy sequences are now expanded for insertion into the Org-mode
- buffer
-2. pretty printing of results is now possible with both "code" and
- "data" pretty print formats
-
-Thanks to Rick Moynihan for suggesting these changes.
-
-**** Python code blocks now accept a =:return= header argument
-This alleviates the need to explicitly insert return statements into
-the bode of Python code blocks. This change both
-- allows the same python code blocks to be run both in sessions and
- externally
-- removes the floating =return= statements which violated python
- syntax
-
-Thanks to Darlan Cavalcante for proposing this feature.
-
-**** =:results wrap= header argument wraps code block results
-The new =:results wrap= wraps code blocks results in a custom
-environment making it possible to offset their contents during
-export. For example
-
-#+begin_src org
- ,#+begin_src emacs-lisp :results wrap
- , "code block results"
- ,#+end_src
-
- ,#+results:
- ,#+BEGIN_RESULT
- ,: code block results
- ,#+END_RESULT
-#+end_src
-
-Thanks to Sébastien Vauban for persistently suggesting this enhancement.
-
-**** Code block error buffer wiped clean between executions
-Previously the code block error buffer accumulated errors making it
-difficult to distinguish between previous and current errors. This
-buffer is now cleaned before every interactive code block evaluation.
-
-**** Lists now recognized by code blocks
-It is now possible for code blocks to both read and write list
-contents from and to Org-mode buffers. For example
-
-#+begin_src org
- ,#+results: a-list
- ,- babel
- ,- and
- ,- org-mode
-
- ,#+source: a-list
- ,#+begin_src emacs-lisp :var lst=a-list :results list
- , (reverse lst)
- ,#+end_src
-#+end_src
-
-**** Calc added as a supported code block language
-The Emacs Calc package can be used through =calc= code blocks allowing
-both regular arithmetic operations as well as stack based
-calculation. For example
-
-#+begin_src org
- ,#+source: calc-stack
- ,#+begin_src calc
- , 8
- , 1
- , '+
- , 9
- , '*
- ,#+end_src
-
- ,#+results: calc-stack
- ,: 81
-
- ,#+source: calc-arithmetic
- ,#+begin_src calc :var in=calc-stack
- , in / 9
- ,#+end_src
-
- ,#+results: calc-arithmetic
- ,: 9
-#+end_src
-
-**** "org-babel-detangle" propagates change to source code files into code blocks
-`org-babel-detangle' can be used to propagate changes to pure source
-code files tangled from embedded code blocks in Org-mode files back to
-the original code blocks in the Org-mode file. This can be used on
-collaborative projects to keep embedded code blocks up to date with
-edits made in pure source code files.
-
-
-
-
-
-
-
-
-* Version 7.02
-
-:PROPERTIES:
-:CUSTOM_ID: v7.02
-:END:
-
-** Incompatible Changes
-*** Code block hashes
-Due to changes in the code resolving code block header arguments
-hashing of code block results should now re-run a code block when
-an argument to the code block has changed. As a result of this
-change *all* code blocks with cached results will be re-run after
-upgrading to the latest version.
-
-*** Testing update
-Anyone using the org-mode test suite will need to update the jump
-repository for test navigation by executing the following from
-the root of the org-mode repository.
-: git submodule update
-Failure to update this repository will cause loading of
-org-test.el to throw errors.
-** Details
-*** Org-babel speed commands
-All Org-babel commands (behind the C-c C-v key prefix) are now
-available as speed commands when the point is on the first line of a
-code block. This uses the existing Org-mode speed key mechanisms.
-
-Thanks to Jambunathan K for implementation this new feature.
-
-*** Fontify code in code blocks.
-
-Source code in code blocks can now be fontified. Please customize the
-varable =org-src-fontify-natively=. For very large blocks (several
-hundreds of lines) there can be delays in editing such fontified
-blocks, in which case C-c ' should be used to bring up a dedicated
-edit buffer.
-
-Thanks to Dan Davison for this.
-
-*** Language-mode commands are available in the Org-buffer
- The most general machinery for doing this is the macro
- `org-babel-do-in-edit-buffer'. There is also the convenience
- function `org-babel-do-key-sequence-in-edit-buffer' which makes
- use of this macro, and is bound to C-c C-v C-x and C-c C-v x. If
- there is an active region contained within the code block, then
- this is inherited by the edit buffer. Some examples of the sorts
- of usage this permits are
-
-C-c C-v C-x M-; comment region according to language
-C-c C-v C-x C-M-\ indent region according to language
-
-Users can make these more convenient, e.g.
-
-(defun my/org-comment-dwim (&optional arg)
- (interactive "P")
- (or (org-babel-do-key-sequence-in-edit-buffer "\M-;")
- (comment-dwim arg)))
-
-(define-key org-mode-map "\M-;" 'my/org-comment-dwim)
-
-A common instance of this general pattern is built in to Org-mode,
-controlled by the variable `org-src-tab-acts-natively': if this
-variable is set, then TAB in a code block has the effect that it would
-have in the language major mode buffer.
-
-*** Org-babel commands are available in language-mode edit buffer
- Mirroring the language-native commands in Org buffers above, a new
- macro `org-src-do-at-code-block' and convenience function
- `org-src-do-key-sequence-at-code-block' provide the converse. When
- used in a language major-mode edit buffer (i.e. a buffer generated
- by C-c '), `org-src-do-key-sequence-at-code-block' executes a key
- sequence at the code block in the source Org buffer. The command
- bound to the key sequence in the Org-babel key map is executed
- remotely with point temporarily at the start of the code block in
- the Org buffer.
-
- The command is not bound to a key by default, to avoid conflicts
- with language major mode bindings. To bind it to C-c @ in all
- language major modes, you could use
-
- (add-hook 'org-src-mode-hook
- (lambda () (define-key org-src-mode-map "\C-c@"
- 'org-src-do-key-sequence-at-code-block)))
-
- In that case, for example, C-c @ t issued in code edit buffers
- would tangle the current Org code block, C-c @ e would execute
- the block and C-c @ h would display the other available
- Org-babel commands.
-
-*** Multi-line header arguments to code blocks
-Code block header arguments can now span multiple lines using the
-new =#+header:= or =#+headers:= lines preceding a code block or
-nested in between the name and body of a named code block.
-Examples are given below.
-
-- multi-line header arguments on an un-named code block
- : #+headers: :var data1=1
- : #+begin_src emacs-lisp :var data2=2
- : (message "data1:%S, data2:%S" data1 data2)
- : #+end_src
- :
- : #+results:
- : : data1:1, data2:2
-
-- multi-line header arguments on a named code block
- : #+source: named-block
- : #+header: :var data=2
- : #+begin_src emacs-lisp
- : (message "data:%S" data)
- : #+end_src
- :
- : #+results: named-block
- : : data:2
-
-*** Unified handling of variable expansion for code blocks
-The code used to resolve variable references in code block header
-arguments has now been consolidated. This both simplifies the
-code base (especially the language-specific files), and ensures
-that the arguments to a code block will not be evaluated multiple
-times. This change should not be externally visible to the
-Org-mode user.
-*** Improved Caching
-Code block caches now notice if the value of a variable argument
-to the code block has changed, if this is the case the cache is
-invalidated and the code block is re-run. The following example
-can provide intuition for the new behavior.
-#+begin_src org :exports code
- ,#+srcname: random
- ,#+begin_src R :cache yes
- ,runif(1)
- ,#+end_src
-
- ,#+results[a2a72cd647ad44515fab62e144796432793d68e1]: random
- ,: 0.4659510825295
-
- ,#+srcname: caller
- ,#+begin_src emacs-lisp :var x=random :cache yes
- ,x
- ,#+end_src
-
- ,#+results[bec9c8724e397d5df3b696502df3ed7892fc4f5f]: caller
- ,: 0.254227238707244
-#+end_src
-
-*** Added :headers header argument for LaTeX code blocks
-This makes it possible to set LaTeX options which must take place in
-the document pre-amble for LaTeX code blocks. This header argument
-accepts either a single string or a list, e.g.
-
-#+begin_src org
- ,#+begin_src latex :headers \usepackage{lmodern} :file name1.pdf
- , latex body
- ,#+end_src
-
- ,#+begin_src latex :headers '("\\usepackage{mathpazo}" "\\usepackage{fullpage}") :file name2.pdf
- , latex body
- ,#+end_src
-#+end_src
-
-*** New function `org-export-string'
-Allows exporting directly from a string to the specified export format.
-*** Code block header argument ":noweb tangle"
-Only expands <<noweb>> syntax references when tangling, not during
-export (weaving).
-*** New function `org-babel-switch-to-session-with-code'
-C-c C-v z (`org-babel-switch-to-session-with-code') is a variant of
-C-c C-v C-z (`org-babel-switch-to-session'): instead of switching to
-the session buffer, it splits the window between (a) the session
-buffer and (b) a language major-mode edit buffer for the code block in
-question. This can be convenient for using language major mode for
-interacting with the session buffer.
-
-*** Improvements to R sessions
- R now uses standard ESS code evaluation machinery in the :results
- value case, which avoids unnecessary output to the comint
- buffer. In addition, the R command responsible for writing the
- result to file is hidden from the user. Finally, the R code edit
- buffer generated by C-c ' is automatically linked to the ESS
- session if the current code block is using :session.
-
-*** Temporary file directory
-All babel temporary files are now kept in a single sub-directory in
-the /tmp directory and are cleaned up when Emacs exits.
-
-*** Function for demarcating blocks `org-babel-demarcate-block'
-Can be called to wrap the region in a block, or to split the block
-around point, bound to (C-c C-v d).
-
-*** Function for marking code block contents `org-babel-mark-block'
- Bound to C-M-h in the babel key map (i.e. C-c C-v C-M-h by
- default). This can be useful in conjunction with
- `org-babel-do-in-edit-buffer', for example for language-native
- commenting or indenting of the whole block.
-*** Lists of anniversaries are now handeled better
-
-When several anniversaries are defined in the bbdb anniversaries
-field (separated by semicolon), this is now handled nicely by the
-agenda.
-
-Thanks to Åukasz Stelmach for a patch to this effect.
-
-*** Table fields are now aligned better, new <c> cookie.
-
-In HTML export, table fields are now properly aligned in accord
-with automatic alignment in org, or as set by the =<r>=, =<l>=, and
-=<c>= cookies. The =<c>= cookie is new and has no effect in
-Org, but it does do the right thing in HTML export. A LaTeX export
-implementation will follow, but is currently still missing.
-
-*** Update freemind converter to include body text
-
-The freemind exporter now incorporates body text into the mind
-map.
-
-Thanks to Lennard Borgman for this patch.
-
-*** Make footnotes work correctly in message-mode
-The footnotes code now searches for =message-signature-separator=
-(which is "-- " by default) in order to place footnotes before the
-signature. Thanks to Tassilo Horn for this patch.
-
-*** Improve XEmacs compatibility
-
-Org-mode 7.02 now runs again in 21.4.22 if the new XEmacs base
-package is installed.
-
-Thanks to Uwe Bauer, Volker Ziegler, Michael Sperber and others
-for a discussion that lead to this nice result.
-
-*** Make it configurable wether agenda jumping prefers the future
-
-When jumping to a date from the agenda using the =j= key, you may
-or may not like the property of Org's date reader to prefer the
-future when you enter incomplete dates. This can now be
-configured using the variable =org-agenda-jump-prefer-future'.
-
-*** Add publishing functions for ASCII, Latin-1 and UTF-8
-
-There are now publishing functions =org-publish-org-to-ascii=,
-=org-publish-org-to-latin1=, and =org-publish-org-to-utf8=.
-
-Thanks to Matthias Danzl for showing how to do this.
-
-*** Indentation and headline insertion after inline tasks
-
-Indentation in inline tasks, and headline insertion after inline
-tasks now behave as expected.
-
-*** Encryption in MobileOrg finally works
-
-As soon as MobilOrg 1.5 hits the Apple's AppStore, you can
-encrypt your org files on public servers. Please see the
-documentation of MobileOrg and Appendix B of the manual for more
-details.
-
-*** MobileOrg: Do not force to insert IDs
-
-If you dislike the property of MobileOrg to insert ID properties
-for in all entries being part of an agenda view, you can now turn
-this off using the variable
-=org-mobile-force-id-on-agenda-items=. When this variable is set
-to =nil=, MobileOrg will use outline paths to identify entries.
-Note that this may fail if several entries have identical outline
-paths.
-
-*** LaTeX minted package for fontified source code export
-Patch by Dan Davison.
-
-A non-nil value of `org-export-latex-minted' means to export source
-code using the minted package, which will fontify source code
-with color. If you want to use this, you need to make LaTeX use the
-minted package. Add minted to `org-export-latex-packages-alist', for
-example using customize, or with something like
-
- (require 'org-latex)
- (add-to-list 'org-export-latex-packages-alist '("" "minted"))
-
-In addition, it is neccessary to install
-pygments (http://pygments.org), and to configure
-`org-latex-to-pdf-process' so that the -shell-escape option is
-passed to pdflatex.
-
-*** Allow to use texi2dvi or rubber for processing LaTeX to pdf
-
-Please see the variable =org-export-latex-to-pdf-process= for
-more information.
-
-Thanks to Olivier Schwander for the rubber part.
-
-*** New STARTUP keywords to turn on inline images
-
-If you want to inline images whenever you visit an Org file, use
-
-: #+STARTUP: inlineimages
-
-*** Support for user-extensible speed commands.
-
-There is a new hook =org-speed-command-hook=. Thanks to
-Jambunathan for a patch to this effect.
-
-*** Add macro to insert property values into exported text
-
-you can use {{{property{NAME}}}} to insert the value of a
-property upon export.
-
-Thanks to David Maus for a patch to this effect.
-
-*** LaTeX package fixes
-
-We updated the list of default packages loaded by LaTeX exported
-files.
-
-*** Allow "#" and "%" in tags
-
-Tags can now also contain the characters =#= and =%=, in addition
-to =@= and letters.
-
-*** Show command names in manual
-
-Andreas Röhler is adding command names to keys in the manual.
-This will take a while to complete, but a start has been made.
-
-*** Make backslash escape "-" in property matches
-
-When entering a tags/property query, "-" is a logical operator.
-However, "-" is also allowed in property names. So you can now
-write "SOME\-NAME" to work around this issue.
-
-This was a request by Ilya Shlyakhter.
-
-*** Document quick insertion of empty structural elements
-
-Org-mode has a built-in template mechanism for inserting block
-templates. This was undocumented until now.
-
-Thanks to Jambunathan K for the patch.
-
-*** Implement MathJax support
-
-Org-mode now uses MathJax to display math on web pages. We serve
-MathJax from the orgmode.org server, at least for the time being
-(thanks Bastien!). If you are going to use this for pages which
-are viewed often, please install MathJax on your own webserver.
-
-To return to the old way of creating images and inserting them
-into web pages, you would have to set
-
-: (setq org-export-with-LaTeX-fragments 'dvipng)
-
-or on a per-file basis
-
-: #+OPTIONS: LaTeX:dvipng
-
-*** Agenda: Allow compact two-column display in agenda dispatcher
-
-If you have many custom agenda commands, you can have the display
-in the dispatcher use two columns with the following settings
-
-: (setq org-agenda-menu-show-match nil
-: org-agenda-menu-two-column t)
-
-This was a request by John Wiegley.
-
-*** Add org-wikinodes.el as a contributed package
-
-One frequent request has been to be able to use CamelCase words
-for automatic cross links in a Wiki created by Org. THis is now
-possible with org-wikinodes.el, which is available in the contrib
-directory. We also have some [[http://orgmode.org/worg/org-contrib/org-wikinodes.php][documentation]] for this feature up
-on Worg.
-
-*** Timer/clock enhancements
-
-=org-timer-set-timer= displays a countdown timer in the modeline.
-From the agenda, `J' invokes =org-agenda-clock-goto=.
-
-* Version 7.01
-:PROPERTIES:
-:CUSTOM_ID: v7.01
-:END:
-
-** Incompatible Changes
-
-*** Emacs 21 support has been dropped
-
-Do not use Org mode 7.xx with Emacs 21, use [[http://orgmode.org/org-6.36c.zip][version 6.36c]] instead.
-
-*** XEmacs support requires the XEmacs development version
-
-To use Org mode 7.xx with XEmacs, you need to run the developer
-version of XEmacs. I was about to drop XEmacs support entirely,
-but Michael Sperber stepped in and made changes to XEmacs that
-made it easier to keep the support. Thanks to Michael for this
-last-minute save. I had hoped to be able to remove
-xemacs/noutline.el from release 7 by moving it into XEmacs, but
-this is not yet done.
-
-*** Org-babel configuration changes
-:PROPERTIES:
-:CUSTOM_ID: ob-configuration-changes
-:END:
-
-Babel took the integration into Org-mode as an opportunity to do
-some much needed house cleaning. Most importantly we have
-simplified the enabling of language support, and cleared out
-unnecessary configuration variables -- which is great unless you
-already have a working configuration under the old model.
-
-The most important changes regard the /location/ and /enabling/
-of Babel (both core functionality and language specific support).
-
-- Babel :: Babel is now part of the core of Org-mode, so it is
- now loaded along with the rest of Org-mode. That means that
- there is /no configuration/ required to enable the main
- Babel functionality. For current users, this means that
- statements like
- #+begin_src emacs-lisp
- (require 'org-babel)
- #+end_src
- or
- #+begin_src emacs-lisp
- (require 'org-babel-init)
- #+end_src
- that may by lying around in your configuration must now be
- removed.
-- load path :: Babel (including all language specific files --
- aside from those which are located in the =contrib/=
- directory for reasons of licencing) now lives in the base of
- the Org-mode lisp directory, so /no additional directories/
- need to be added to your load path to use babel. For Babel
- users this means that statements adding babel-specific
- directories to your load-path should now be removed from
- your config.
-- language support :: It is no longer necessary to require
- language specific support on a language-by-language basis.
- Specific language support should now be managed through the
- `org-babel-load-languages' variable. This variable can be
- customized using the Emacs customization interface, or
- through the addition of something like the following to your
- configuration (note: any language not mentioned will /not/
- be enabled, aside from =emacs-lisp= which is enabled by
- default)
- #+begin_src emacs-lisp
- (org-babel-do-load-languages
- 'org-babel-load-languages
- '((R . t)
- (ditaa . t)
- (dot . t)
- (emacs-lisp . t)
- (gnuplot . t)
- (haskell . nil)
- (ocaml . nil)
- (python . t)
- (ruby . t)
- (screen . nil)
- (sh . t)
- (sql . nil)
- (sqlite . t)))
- #+end_src
-
- Despite this change it is still possible to add
- language support through the use of =require=
- statements, however to conform to Emacs file-name
- regulations all Babel language files have changed
- prefix from =org-babel-*= to =ob-*=, so the require
- lines must also change e.g.
- #+begin_src emacs-lisp
- (require 'org-babel-R)
- #+end_src
- should be changed to
- #+begin_src emacs-lisp
- (require 'ob-R)
- #+end_src
-
-We have eliminated the =org-babel-tangle-w-comments= variable as
-well as the two main internal lists of languages, namely
-- =org-babel-interpreters= and
-- =org-babel-tangle-langs=
-
-so any config lines which mention those variables, can/should be
-stripped out in their entirety. This includes any calls to the
-=org-babel-add-interpreter= function, whose sole purpose was to
-add languages to the =org-babel-interpreters= variable.
-
-With those calls stripped out, we may still in some cases want to
-associate a file name extension with certain languages, for
-example we want all of our emacs-lisp files to end in a =.el=, we
-can do this will the =org-babel-tangle-lang-exts= variable. In
-general you shouldn't need to touch this as it already has
-defaults for most common languages, and if a language is not
-present in org-babel-tangle-langs, then babel will just use the
-language name, so for example a file of =c= code will have a =.c=
-extension by default, shell-scripts (identified with =sh=) will
-have a =.sh= extension etc...
-
-The configuration of /shebang/ lines now lives in header
-arguments. So the shebang for a single file can be set at the
-code block level, e.g.
-
-#+begin_src org
- ,#+begin_src clojure :shebang #!/usr/bin/env clj
- , (println "with a shebang line, I can be run as a script!")
- ,#+end_src
-#+end_src
-
-Note that whenever a file is tangled which includes a /shebang/
-line, Babel will make the file executable, so there is good
-reason to only add /shebangs/ at the source-code block level.
-However if you're sure that you want all of your code in some
-language (say shell scripts) to tangle out with shebang lines,
-then you can customize the default header arguments for that
-language, e.g.
-
-#+begin_src emacs-lisp
- ;; ensure this variable is defined defined
- (unless (boundp 'org-babel-default-header-args:sh)
- (setq org-babel-default-header-args:sh '()))
-
- ;; add a default shebang header argument
- (add-to-list 'org-babel-default-header-args:sh
- '(:shebang . "#!/bin/bash"))
-#+end_src
-
-The final important change included in this release is the
-addition of new security measures into Babel. These measures are
-in place to protect users from the accidental or uninformed
-execution of code. Along these lines /every/ execution of a code
-block will now require an explicit confirmation from the user.
-These confirmations can be stifled through customization of the
-`org-confirm-babel-evaluate' variable, e.g.
-#+begin_src emacs-lisp
- ;; I don't want to be prompted on every code block evaluation
- (setq org-confirm-babel-evaluate nil)
-#+end_src
-
-In addition, it is now possible to remove code block evaluation
-form the =C-c C-c= keybinding. This can be done by setting the
-=org-babel-no-eval-on-ctrl-c-ctrl-c= variable to a non-nil value,
-e.g.
-#+begin_src emacs-lisp
- ;; I don't want to execute code blocks with C-c C-c
- (setq org-babel-no-eval-on-ctrl-c-ctrl-c t)
-#+end_src
-
-An additional keybinding has been added for code block
-evaluation, namely =C-c C-v e=.
-
-Whew! that seems like a lot of effort for a /simplification/ of
-configuration.
-
-*** New keys for TODO sparse trees
-
-The key =C-c C-v= is now reserved for Org Babel action. TODO
-sparse trees can still be made with =C-c / t= (all not-done
-states) and =C-c / T= (specific states).
-
-*** Customizable variable changes for DocBook exporter
-
-To make it more flexible for users to provide DocBook exporter
-related commands, we start to use format-spec to format the
-commands in this release. If you use DocBook exporter and use it
-to export Org files to PDF and/or FO format, the settings of the
-following two customizable variables need to be changed:
-
-- =org-export-docbook-xslt-proc-command=
-- =org-export-docbook-xsl-fo-proc-command=
-
-Instead of using =%s= in the format control string for all
-arguments, now we use /three/ different format spec characters:
-
-- =%i=: input file argument
-- =%o=: output file argument
-- =%s=: XSLT stylesheet argument
-
-For example, if you set =org-export-docbook-xslt-proc-command= to
-
-: java com.icl.saxon.StyleSheet -o %s %s /path/to/docbook.xsl
-
-in the past, now you need to change it to
-
-: java com.icl.saxon.StyleSheet -o %o %i %s
-
-and set a new customizable variable called
-=org-export-docbook-xslt-stylesheet= to =/path/to/docbook.xsl=.
-
-Please check the documentation of these two variables for more
-details and other examples.
-
-Along with the introduction of variable
-=org-export-docbook-xslt-stylesheet=, we also added a new
-in-buffer setting called =#+XSLT:=. You can use this setting to
-specify the XSLT stylesheet that you want to use on a per-file
-basis. This setting overrides
-=org-export-docbook-xslt-stylesheet=.
-
-** Details
-
-*** Org Babel is now part of the Org core
-See [[#ob-configuration-changes][Org-babel configuration changes]] for instructions on how to
-update your babel configuration.
-
-The most significant result of this change is that Babel now has
-documentation! It is part of Org-mode's documentation, see
-Chapter 14 [[http://orgmode.org/manual/Working-with-source-code.html#Working-with-source-code][Working With Source Code]]. The Babel keybindings
-are now listed in the refcard, and can be viewed from any
-Org-mode buffer by pressing =C-c C-v h=. In addition this
-integration has included a number of bug fixes, and a significant
-amount of internal code cleanup.
-
-*** The default capture system for Org mode is now called org-capture
-
-This replaces the earlier system org-remember. The manual only
-describes org-capture, but for people who prefer to continue to
-use org-remember, we keep a static copy of the former manual
-section [[http://orgmode.org/org-remember.pdf][chapter about remember]].
-
-The new system has a technically cleaner implementation and more
-possibilities for capturing different types of data. See
-[[http://thread.gmane.org/gmane.emacs.orgmode/26441/focus%3D26441][Carsten's announcement]] for more details.
-
-To switch over to the new system:
-
-1. Run
-
- : M-x org-capture-import-remember-templates RET
-
- to get a translated version of your remember templates into the
- new variable =org-capture-templates=. This will "mostly" work,
- but maybe not for all cases. At least it will give you a good
- place to modify your templates. After running this command,
- enter the customize buffer for this variable with
-
- : M-x customize-variable RET org-capture-templates RET
-
- and convince yourself that everything is OK. Then save the
- customization.
-
-2. Bind the command =org-capture= to a key, similar to what you did
- with org-remember:
-
- : (define-key global-map "\C-cc" 'org-capture)
-
- If your fingers prefer =C-c r=, you can also use this key once
- you have decided to move over completely to the new
- implementation. During a test time, there is nothing wrong
- with using both system in parallel.
-
-*** Implement pretty display of entities, sub-, and superscripts.
-
-The command =C-c C-x \= toggles the display of Org's special
-entities like =\alpha= as pretty unicode characters. Also, sub
-and superscripts are displayed in a pretty way (raised/lower
-display, in a smaller font). If you want to exclude sub- and
-superscripts, see the variable
-=org-pretty-entities-include-sub-superscripts=.
-
-Thanks to Eric Schulte and Ulf Stegeman for making this possible.
-
-*** Help system for finding entities
-
-The new command =M-x org-entities-help= creates a structured
-buffer that lists all entities available in Org. Thanks to Ulf
-Stegeman for adding the necessary structure to the internal
-entity list.
-
-*** New module to create Gantt charts
-
-Christian Egli's /org-taskjuggler.el/ module is now part of Org.
-He also wrote a [[http://orgmode.org/worg/org-tutorials/org-taskjuggler.php][tutorial]] for it.
-
-*** Refile targets can now be cached
-
-You can turn on caching of refile targets by setting the variable
-=org-refile-use-cache=. This should speed up refiling if you
-have many eligible targets in many files. If you need to update
-the cache because Org misses a newly created entry or still
-offers a deleted one, press =C-0 C-c C-w=.
-
-*** Enhanced functionality of the clock resolver
-
-Here are the new options for the clock resolver:
-
-: i/q/C-g Ignore this question; the same as keeping all the idle time.
-:
-: k/K Keep X minutes of the idle time (default is all). If this
-: amount is less than the default, you will be clocked out
-: that many minutes after the time that idling began, and then
-: clocked back in at the present time.
-: g/G Indicate that you \"got back\" X minutes ago. This is quite
-: different from 'k': it clocks you out from the beginning of
-: the idle period and clock you back in X minutes ago.
-: s/S Subtract the idle time from the current clock. This is the
-: same as keeping 0 minutes.
-: C Cancel the open timer altogether. It will be as though you
-: never clocked in.
-: j/J Jump to the current clock, to make manual adjustments.
-
-For all these options, using uppercase makes your final state
-to be CLOCKED OUT. Thanks to John Wiegley for making these
-changes.
-
-*** A property value of "nil" now means to unset a property
-
-This can be useful in particular with property inheritance, if
-some upper level has the property, and some grandchild of it
-would like to have the default settings (i.e. not overruled by a
-property) back.
-
-Thanks to Robert Goldman and Bernt Hansen for suggesting this
-change.
-
-*** The problem with comment syntax has finally been fixed
-
-Thanks to Leo who has been on a year-long quest to get this fixed
-and finally found the right way to do it.
-
-*** Make it possible to protect hidden subtrees from being killed by =C-k=
-
-This was a request by Scott Otterson.
-See the new variable =org-ctrl-k-protect-subtree=.
-
-*** New module org-mac-link-grabber.el
-
-This module allows to grab links to all kinds of applications on
-a mac. It is available in the contrib directory.
-
-Thanks to Anthony Lander for this contribution.
-
-*** LaTeX export: Implement table* environment for wide tables
-
-Thanks to Chris Gray for a patch to this effect.
-
-*** When cloning entries, remove or renew ID property
-
-Thanks to David Maus for this change.
-
-* Version 6.36
-
- :PROPERTIES:
- :CUSTOM_ID: v6.36
- :END:
-
-** Details
-*** Inline display of linked images
-
-Images can now be displayed inline. The key C-c C-x C-v does
-toggle the display of such images. Note that only image links
-that have no description part will be inlined.
-
-*** Implement offsets for ordered lists
-
-If you want to start an ordered plain list with a number
-different from 1, you can now do it like this:
-
-: 1. [@start:12] will star a lit a number 12
-
-*** Extensions to storing and opening links to Wanderlust messages
-
-- Remove filter conditions for messages in a filter folder
-
- If customization variable `org-wl-link-remove-filter' is non-nil,
- filter conditions are stripped of the folder name.
-
-- Create web links for messages in a Shimbun folder
-
- If customization variable `org-wl-shimbun-prefer-web-links' is
- non-nil, calling `org-store-link' on a Shimbun message creates a
- web link to the messages source, indicated in the Xref: header
- field.
-
-- Create web links for messages in a nntp folder
-
- If customization variable `org-wl-nntp-prefer-web-links' is
- non-nil, calling `org-store-link' on a nntp message creates a web
- link either to gmane.org if the group can be read trough gmane or
- to googlegroups otherwise. In both cases the message-id is used as
- reference.
-
-- Open links in namazu search folder
-
- If `org-wl-open' is called with one prefix, WL opens a namazu
- search folder for message's message-id using
- `org-wl-namazu-default-index' as search index. If this variable is
- nil or `org-wl-open' is called with two prefixes Org asks for the
- search index to use.
-
-Thanks to David Maus for these changes.
-
-*** Org-babel: code block body expansion for table and preview
-
-In org-babel, code is "expanded" prior to evaluation. I.e. the
-code that is actually evaluated comprises the code block
-contents, augmented with the extra code which assigns the
-referenced data to variables. It is now possible to preview
-expanded contents, and also to expand code during during
-tangling. This expansion takes into account all header arguments,
-and variables.
-
-A new key-binding C-c M-b p bound to
-`org-babel-expand-src-block' can be used from inside of a
-source code block to preview its expanded contents (which can
-be very useful for debugging). tangling
-
-The expanded body can now be tangled, this includes variable
-values which may be the results of other source-code blocks, or
-stored in headline properties or tables. One possible use for
-this is to allow those using org-babel for their emacs
-initialization to store values (e.g. usernames, passwords,
-etc…) in headline properties or in tables.
-
-Org-babel now supports three new header arguments, and new
-default behavior for handling horizontal lines in tables
-(hlines), column names, and rownames across all languages.
-
-* Version 6.35
- :PROPERTIES:
- :CUSTOM_ID: v6.35
- :END:
-
-** Incompatible Changes
-
-*** Changes to the intended use of =org-export-latex-classes=
-
-So far this variable has been used to specify the complete header
-of the LaTeX document, including all the =\usepackage= calls
-necessary for the document. This setup makes it difficult to
-maintain the list of packages that Org itself would like to call,
-for example for the special symbol support it needs. Each time I
-have to add a package, I have to ask people to revise the
-configuration of this variable. In this release, I have tried to
-fix this.
-
-First of all, you can *opt out of this change* in the following
-way: You can say: /I want to have full control over headers, and
-I will take responsibility to include the packages Org needs/.
-If that is what you want, add this to your configuration and skip
-the rest of this section (except maybe for the description of the
-=[EXTRA]= place holder):
-
-#+begin_src emacs-lisp
- (setq org-export-latex-default-packages-alist nil
- org-export-latex-packages-alist nil)
-#+end_src
-
-/Continue to read here if you want to go along with the modified
-setup./
-
-There are now two variables that should be used to list the LaTeX
-packages that need to be included in all classes. The header
-definition in =org-export-latex-classes= should then not contain
-the corresponding =\usepackage= calls (see below).
-
-The two new variables are:
-
-1. =org-export-latex-default-packages-alist= :: This is the
- variable where Org-mode itself puts the packages it needs.
- Normally you should not change this variable. The only
- reason to change it anyway is when one of these packages
- causes a conflict with another package you want to use.
- Then you can remove that packages and hope that you are not
- using Org-mode functionality that needs it.
-
-2. =org-export-latex-packages-alist= :: This is the variable
- where you can put the packages that you'd like to use across
- all classes. For example, I am putting =amsmath= and =tikz=
- here, because I always want to have them.
-
-The sequence how these customizations will show up in the LaTeX
-document are:
-1. Header from =org-export-latex-classes=
-2. =org-export-latex-default-packages-alist=
-3. =org-export-latex-packages-alist=
-4. Buffer-specific things set with =#+LaTeX_HEADER:=
-
-If you want more control about which segment is placed where, or
-if you want, for a specific class, have full control over the
-header and exclude some of the automatic building blocks, you can
-put the following macro-like place holders into the header:
-
-#+begin_example
-[DEFAULT-PACKAGES] \usepackage statements for default packages
-[NO-DEFAULT-PACKAGES] do not include any of the default packages
-[PACKAGES] \usepackage statements for packages
-[NO-PACKAGES] do not include the packages
-[EXTRA] the stuff from #+LaTeX_HEADER
-[NO-EXTRA] do not include #+LaTeX_HEADER stuff
-#+end_example
-
-If you have currently customized =org-export-latex-classes=, you
-should revise that customization and remove any package calls that
-are covered by =org-export-latex-default-packages-alist=. This
-applies to the following packages:
-
-- inputenc
-- fontenc
-- fixltx2e
-- graphicx
-- longtable
-- float
-- wrapfig
-- soul
-- t1enc
-- textcomp
-- marvosym
-- wasysym
-- latexsym
-- amssymb
-- hyperref
-
-If one of these packages creates a conflict with another package
-you are using, you can remove it from
-=org-export-latex-default-packages-alist=. But then you risk
-that some of the advertised export features of Org will not work
-properly.
-
-You can also consider moving packages that you use in all classes
-to =org-export-latex-packages-alist=. If necessary, put the
-place holders so that the packages get loaded in the right
-sequence. As said above, for backward compatibility, if you omit
-the place holders, all the variables will dump their content at
-the end of the header.
-
-Damn, this has become more complex than I wanted it to be. I
-hope that in practice, this will not be complicated at all.
-
-*** The constant =org-html-entities= is obsolete
-
-Its content is now part of the new constant =org-entities=, which
-is defined in the file org-entities.el. =org-html-entities= was
-an internal variable, but it is possible that some users did
-write code using it - this is why I am mentioning it here.
-
-** Editing Convenience and Appearance
-
-*** New faces for title, date, author and email address lines.
-
-The keywords in these lines are now dimmed out, and the title is
-displayed in a larger font, and a special font is also used for
-author, date, and email information. This is implemented by the
-following new faces:
-
-org-document-title
-org-document-info
-org-document-info-keyword
-
-In addition, the variable =org-hidden-keywords= can be used to
-make the corresponding keywords disappear.
-
-Thanks to Dan Davison for this feature.
-
-*** Simpler way to specify faces for tags and todo keywords
-
-The variables =org-todo-keyword-faces=, =org-tag-faces=, and
-=org-priority-faces= now accept simple color names as
-specifications. The colors will be used as either foreground or
-background color for the corresponding keyword. See also the
-variable =org-faces-easy-properties=, which governs which face
-property is affected by this setting.
-
-This is really a great simplification for setting keyword faces.
-The change is based on an idea and patch by Ryan Thompson.
-
-*** <N> in tables now means fixed width, not maximum width
-
-Requested by Michael Brand.
-
-*** Better level cycling function
-
-=TAB= in an empty headline cycles the level of that headline
-through likely states. Ryan Thompson implemented an improved
-version of this function, which does not depend upon when exactly
-this command is used. Thanks to Ryan for this improvement.
-
-*** Adaptive filling
-
-For paragraph text, =org-adaptive-fill-function= did not handle the
-base case of regular text which needed to be filled. This is now
-fixed. Among other things, it allows email-style ">" comments
-to be filled correctly.
-
-Thanks to Dan Hackney for this patch.
-
-*** `org-reveal' (=C-c C-r=) also decrypts encrypted entries (org-crypt.el)
-
-Thanks to Richard Riley for triggering this change.
-
-*** Better automatic letter selection for TODO keywords
-
-When all first letters of keywords have been used, Org now assigns
-more meaningful characters based on the keywords.
-
-Thanks to Mikael Fornius for this patch.
-
-** Export
-
-*** Much better handling of entities for LaTeX export
-
-Special entities like =\therefore= and =\alpha= now know if
-they need to be in LaTeX math mode and are formatted accordingly.
-
-Thanks to Ulf Stegemann for the tedious work to make this
-possible.
-
-*** LaTeX export: Set coding system automatically
-
-The coding system of the LaTeX class will now be set to the value
-corresponding to the buffer's file coding system. This happens
-if your setup sets up the file to have a line
-=\usepackage[AUTO]{inputenc}= (the default setup does this).
-
-*** New exporters to Latin-1 and UTF-8
-
-While Ulf Stegemann was going through the entities list to
-improve the LaTeX export, he had the great idea to provide
-representations for many of the entities in Latin-1, and for all
-of them in UTF-8. This means that we can now export files rich
-in special symbols to Latin-1 and to UTF-8 files. These new
-exporters can be reached with the commands =C-c C-e n= and =C-c
-C-e u=, respectively.
-
-When there is no representation for a given symbol in the
-targeted coding system, you can choose to keep the TeX-macro-like
-representation, or to get an "explanatory" representation. For
-example, =\simeq= could be represented as "[approx. equal to]".
-Please use the variable =org-entities-ascii-explanatory= to state
-your preference.
-
-*** Full label/reference support in HTML, Docbook, and LaTeX backends
-
-=#+LABEL= definitions for tables and figures are now fully
-implemented in the LaTeX, Docbook, and HTML interfaces.
-=\ref{xxx}= is expanded to a valid link in all backends.
-
-*** BEAMER export: Title of the outline frame is now customizable
-
-The new option =org-outline-frame-title= allows to set the
-title for outline frames in Beamer presentations.
-
-Patch by Åukasz Stelmach.
-
-*** BEAMER export: fragile frames are better recognized
-
-A =lstlisting= environment now also triggers the fragile option in
-a beamer frame, just like =verbatim= environments do.
-
-Thanks to Eric Schulte for this patch.
-
-*** BEAMER export: Protect <...> macro arguments
-
-Macros for the BEAMER package can have arguments in angular
-brackets. These are now protected just like normal arguments.
-
-Requested by Bill Jackson.
-
-*** HTML export: Add class to outline containers using property
-
-The =HTML_CONTAINER_CLASS= property can now be used to add a
-class name to the outline container of a node in HTML export.
-
-*** New option =org-export-email-info= to turn off export of the email address
-
-Default is actually off now.
-
-*** Throw an error when creating an image from a LaTeX snippet fails
-
-This behavior can be configured with the new option variable
-=org-format-latex-signal-error=.
-
-** Index generation
-
-Org-mode can now produce a 2-level subject index spanning an
-entire publishing project. Write index entries in your files as
-
-#+begin_src org
-,* What is org-mode?
-#+index: Org-mode
-#+index: Definitions!Org-mode
-#+end_src
-
-where the first line will produce an index entry /Org-mode/,
-while the second line will create /Definitions/ with a sub-item
-/Org-mode/. Three-level entries are not supported.
-
-To produce the index, set
-
-#+begin_src emacs-lisp
-:makeindex t
-#+end_src
-
-in the project definition in =org-publish-project-alist=. You
-may have to force re-export of all files to get the index by
-using a =C-u= prefix to the publishing command:
-
-#+begin_example
-C-u M-x org-publish-all
-#+end_example
-
-Whenever an Org file is published in this project, a new file
-with the extension "orgx" will be written. It contains the index
-entries and corresponding jump target names. When all project
-files are published, Org will produce a new file "theindex.inc"
-containing the index as a to-level tree. This file can be
-included into any project file using
-
-#+begin_src org
- ,#+include: "theindex.inc"
-#+end_src
-
-Org-mode will also create a file "theindex.org" with this include
-statement, and you can build a more complex structure (for
-example style definitions, top and home links, etc) around this
-statement. When this file already exists, it will not be
-overwritten by Org.
-
-Thanks to Stefan Vollmar for initiating and driving this feature.
-
-*** TODO Still need to do the LaTeX portion
-
-** MobileOrg
-
-*** Encrypting stage files for MobileOrg
-
-Since the use of (often pubic) servers is needed for MobileOrg,
-it is now possible to encrypt the files to be staged for
-MobileOrg. Version 1.2 of MobileOrg will be needed for this
-feature, and Richard Moreland will show instructions on his
-website once that is available. Basically, on the Org-side this
-will require the following settings:
-
-#+begin_src emacs-lisp
- (setq org-mobile-use-encryption t
- org-mobile-encryption-password "My_MobileOrg_Password")
-#+end_src
-
-So the password will be visible in your local setup, but since
-the encryption is only for the public server, this seems
-acceptable.
-
-** Agenda
-
-*** Specify entry types as an option
-
-Custom Agenda commands can now limit the sets of entry types
-considered for this command by binding =org-agenda-entry-types=
-temporarily in the options section of the command. This can lead
-to significant speedups, because instead of laboriously finding
-entries and then rejecting them, a whole search cycle is skipped.
-For more information see the new section in
-[[http://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.php#sec-5][Matt Lundin's agenda custom command tutorial]].
-
-Thanks to Matt Lundin for this feature.
-
-*** Speed up multiple calls to org-diary by only doing buffer prep once
-
-Also a patch by Matt Lundin.
-
-*** Show and hide deadlines in the agenda
-
-You can now hide all deadline entries in the agenda by pressing
-=!=.
-
-Thanks to John Wiegley for this feature.
-
-*** Agenda: Allow to suppress deadline warnings for entries also scheduled
-
-The the docstring of the variable
-=org-agenda-skip-deadline-prewarning-if-scheduled=.
-
-*** Expand file names in org-agenda-files (external file case)
-
-If you are using a file to manage the list of agenda files, the
-names in this file can now contain environment variables and "~"
-to write them more compactly and portable.
-
-Thanks to Mikael Fornius for a patch to this effect.
-
-*** Agenda: Allow TODO conditions in the skip functions
-
-The agenda skip function has now special support for skipping
-based on the TODO state. Here are just two examples, see the
-manual for more information.
-
-#+begin_src emacs-lisp
-(org-agenda-skip-entry-if 'todo '(\"TODO\" \"WAITING\"))
-(org-agenda-skip-entry-if 'nottodo 'done)
-#+end_src
-
-Thanks to Åukasz Stelmach for this patch.
-
-*** Extracting the time-of-day when adding diary entries
-
-The time of day can now be extracted from new diary entries made
-from the agenda with (for example) =i d=. When
-=org-agenda-insert-diary-extract-time= is set, this is done, and
-the time is moved into the time stamp.
-
-Thanks to Stephen Eglen for this feature.
-
-*** The customization group org-font-lock has been renamed
-
-The new name is `org-appearance'.
-
-Thanks to Dan Davison for a patch to this effect.
-
-*** The TODO list: Allow skipping scheduled or deadlined entries
-
-Skipping TODO entries in the global TODO list based on whether
-they are scheduled or have a deadline can now be controlled in
-more detail. Please see the docstrings of
-=org-agenda-todo-ignore-scheduled= and
-=org-agenda-todo-ignore-deadline=.
-
-Thanks to Åukasz Stelmach for patches to this effect.
-
-** Hyperlinks
-
-*** Make =org-store-link= point to directory in a dired buffer
-
-When, in a dired buffer, the cursor is not in a line listing a
-file, `org-store-link' will store a link to the directory.
-
-Patch by Stephen Eglen.
-
-*** Allow regexps in =org-file-apps= to capture link parameters
-
-The way extension regexps in =org-file-apps= are handled has
-changed. Instead of matching against the file name, the regexps
-are now matched against the whole link, and you can use grouping
-to extract link parameters which you can then use in a command
-string to be executed.
-
-For example, to allow linking to PDF files using the syntax
-=file:/doc.pdf::<page number>=, you can add the following entry to
-org-file-apps:
-
-#+begin_example
-Extension: \.pdf::\([0-9]+\)\'
-Command: evince "%s" -p %1
-#+end_example
-
-Thanks to Jan Böcker for a patch to this effect.
-
-** Clocking
-
-*** Show clock overruns in mode line
-
-When clocking an item with a planned effort, overrunning the
-planned time is now made visible in the mode line, for example
-using the new face =org-mode-line-clock-overrun=, or by adding an
-extra string given by =org-task-overrun-text=.
-
-Thanks to Richard Riley for a patch to this effect.
-
-** Tables
-
-*** Repair the broken support for table.el tables again.
-
-Tables created with the table.el package now finally work again
-in Org-mode. While you cannot edit the table directly in the
-buffer, you can use =C-c '= to edit it nicely in a temporary
-buffer.
-
-Export of these tables to HTML seem to work without problems.
-Export to LaTeX is imperfect. If fails if the table contains
-special characters that will be replaced by the exporter before
-formatting the table. The replacement operation changes the
-length of some lines, breaking the alignment of the table fields.
-Unfortunately this is not easy to fix. It is also not an option
-to not do these replacements. The table.el LaTeX exporter will
-for example not escape "&" in table fields, causing the exported
-tables to be broken.
-
-** Misc
-
-*** New logging support for refiling
-
-Whenever you refile an item, a time stamp and even a note can be
-added to this entry. For details, see the new option
-=org-log-refile=.
-
-Thanks to Charles Cave for this idea.
-
-*** New helper functions in org-table.el
-
-There are new functions to access and write to a specific table
-field. This is for hackers, and maybe for the org-babel people.
-
-#+begin_example
-org-table-get
-org-table-put
-org-table-current-line
-org-table-goto-line
-#+end_example
-
-*** Tables: Field coordinates for formulas, and improved docs
-
-Calc and Emacs-Lisp formulas for tables can access the current
-field coordinates with =@#= and =$#= for row and column,
-respectively. These can be useful in some formulas. For
-example, to sequentially number the fields in a column, use
-~=@#~ as column equation.
-
-One application is to copy a column from a different table. See
-the manual for details.
-
-Thanks to Michael Brand for this feature.
-
-*** Archiving: Allow to reverse order in target node
-
-The new option =org-archive-reversed-order= allows to have
-archived entries inserted in a last-on-top fashion in the target
-node.
-
-Requested by Tom.
-
-*** Better documentation on calc accuracy in tables
-
-Thanks to Michael Brand for this fix.
-
-*** Clock reports can now include the running, incomplete clock
-
-If you have a clock running, and the entry being clocked falls
-into the scope when creating a clock table, the time so far spent
-can be added to the total. This behavior depends on the setting
-of =org-clock-report-include-clocking-task=. The default is
-=nil=.
-
-Thanks to Bernt Hansen for this useful addition.
-
-*** American-style dates are now understood by =org-read-date=
-
-So when you are prompted for a date, you can now answer like this
-
-#+begin_example
-2/5/3 --> 2003-02-05
-2/5 --> <CURRENT-YEAR>-02-05
-#+end_example
-
-*** org-timer.el now allows just one timer
-
-There is now only a single free timer supported by org-timer.el.
-Thanks to Bastien for cleaning this up, after a bug report in
-this area by Frédéric Couchet.
-
-*** Remember: Allow to file as sibling of current clock
-
-=C-3 C-c C-c= will file the remember entry as a sibling of the
-last filed entry.
-
-Patch by Åukasz Stelmach.
-
-*** Org-reveal: Double prefix arg shows the entire subtree of the parent
-
-This can help to get out of an inconsistent state produced for
-example by viewing from the agenda.
-
-This was a request by Matt Lundin.
-
-*** Add org-secretary.el by Juan Reyero to the contrib directory
-
-org-secretary.el is a possible setup for group work using
-Org-mode.
-
-Thanks to Juan Reyero for this contribution.
-
-** Babel
-
-Eric and Dan have compiled the following list of changes in and
-around org-babel.
-
-- Added support for Matlab and Octave.
-- Added support for C and C++ code blocks.
-- Added support for the Oz programming language.
- Thanks to Torsten Anders for this contribution
-- Can now force literal interpretation of table cell contents
- with extra "$" in table formula.
- Thanks to Maurizio Vitale for this suggestion.
-- Variable references which look like lisp forms are now
- evaluated.
-- No longer adding extension during tangling when filename is
- provided.
- Thanks to Martin G. Skjæveland and Nicolas Girard for prompting this.
-- Added `org-babel-execute-hook' which runs after code block
- execution.
-- Working directories and remote execution
-
- This introduces a new header argument :dir. For the duration of
- source block execution, default-directory is set to the value
- of this header argument. Consequences include:
-
- - external interpreter processes run in that directory
- - new session processes run in that directory (but existing
- ones are unaffected)
- - relative paths for file output are relative to that directory
-
- The name of a directory on a remote machine may be specified
- with tramp syntax (/user@host:path), in which case the
- interpreter executable will be sought in tramp-remote-path, and
- if found will execute on the remote machine in the specified
- remote directory.
-- Tramp syntax can be used to tangle to remote files.
- Thanks to Maurizio Vitale and Rémi Vanicat.
-- org-R removed from contrib.
-- gnuplot can now return it's string output -- when session is
- set to "none".
-- Now including source code block arguments w/source name on
- export.
-- Now able to reference file links as results.
-- Allow pdf/png generation directly from latex source blocks
- with :file header argument.
-
-* Version 6.34
- :PROPERTIES:
- :CUSTOM_ID: v6.34
- :END:
-
-** Incompatible changes
-
-*** Tags in org-agenda-auto-exclude-function must be lower case.
-
-When defining an =org-agenda-auto-exclude-function=, you need to
-be aware that tag that is being passed into the function is
-always lower case - even if it was defined in upper case
-originally.
-
-** Details
-
-*** Support for creating BEAMER presentations from Org-mode documents
-
-Org-mode documents or subtrees can now be converted directly in
-to BEAMER presentation. Turning a tree into a simple
-presentations is straight forward, and there is also quite some
-support to make richer presentations as well. See the [[http://orgmode.org/manual/Beamer-class-export.html#Beamer-class-export][BEAMER
-section]] in the manual for more details.
-
-Thanks to everyone who has contributed to the discussion about
-BEAMER support and how it should work. This was a great example
-for how this community can achieve a much better result than any
-individual could.
-
-*** Hyperlinks
-
-**** Add Paul Sexton's org-ctags.el
-
-Targets like =<<my target>>= can now be found by Emacs' etag
-functionality, and Org-mode links can be used to to link to
-etags, also in non-Org-mode files. For details, see the file
-/org-ctags.el/.
-
-This feature uses a new hook =org-open-link-functions= which will
-call function to do something special with text links.
-
-Thanks to Paul Sexton for this contribution.
-
-**** Add Jan Böcker's org-docview.el
-
-This new module allows links to various file types using docview,
-where Emacs displays images of document pages. Docview link
-types can point to a specific page in a document, for example to
-page 131 of the Org-mode manual:
-
-: [[docview:~/.elisp/org/doc/org.pdf::131][Org-Mode Manual]]
-
-Thanks to Jan Böcker for this contribution.
-
-**** New link types that force special ways of opening the file
-
-- =file+sys:/path/to/file= will use the system to open the file,
- like double-clicking would.
-- file+emacs:/path/to/file will force opening the linked file
- with Emacs.
-
-This was a request by John Wiegley.
-
-**** Open all links in a node
-
-When using =C-c C-o= on a headline to get a list of links in the
-entry, pressing =RET= will open *all* links. This allows
-something like projects to be defined, with a number of files
-that have to be opened by different applications.
-
-This was a request by John Wiegley.
-
-*** Agenda Views
-
-**** Improve the logic of the search view.
-
-The logic of search views is changed a bit. See the docstring of
-the function =or-search-view=.
-
-These changes resulted from a discussion with Matt Lundin.
-
-**** New face for entries from the Emacs diary
-
-Entries that enter the Agenda through the Emacs diary now get the
-face =org-agenda-diary=.
-
-This was a request by Thierry Volpiatto.
-
-**** New function `org-diary-class' to schedule classes with skipped weeks.
-
-This was a request by Daniel Martins.
-
-**** Empty matcher means prompt in agenda custom commands
-
-When an agenda custom command has an empty string as MATCH
-element, so far this would lead to a meaningless search using an
-empty matcher. Now an empty (or white) string will be
-interpreted just like a nil matcher, i.e. the user will be
-prompted for the match.
-
-**** Agenda: Selectively remove some tags from agenda display
-
-If you use tags very extensively, you might want to exclude some
-from being displayed in the agenda, in order to keep the display
-compact. See the new option =org-agenda-hide-tags-regexp= for
-details.
-
-This was largely a patch by Martin Pohlack.
-
-*** Export
-
-**** Direct export of only the current subtree
-
-Pressing =1= after =C-c C-e= and before the key that selects the
-export backend, only the current subtree will be exported,
-exactly as it you had selected it first with =C-c @=. So for
-example, =C-c C-e 1 b= will export the current subtree to HTML
-and open the result in the browser.
-
-**** Direct export of enclosing node
-
-Pressing =SPC= after =C-c C-e= and before the key that selects
-the export backend, the enclosing subree that is set up for
-subtree export will be exported, exactly as it you had selected
-it first with =C-c @=. So for example, =C-c C-e SPC d= will find
-the enclosing node with a LaTeX_CLASS property or an
-EXPORT_FILE_NAME property and export that.
-
-**** Caching export images
-
-Images that are created for example using LaTeX or ditaa for
-inclusion into exported files are now cached. This works by
-adding a hash to the image name, that reflects the source code
-and all relevant settings. So as long as the hash does not
-change, the image does not have to be made again. His can lead
-to a substantial reduction in export/publishing times.
-
-Thanks to Eric Schulte for a patch to this effect.
-
-**** Preserving line breaks for export no longer works
-
-ASCII export always preserves them - no other export format
-does. We had attempted to use =\obeylines= for this in LaTeX,
-but that does create too many problems.
-
-**** New symbols =\EUR= and =\checkmark=
-
-=\EUR= symbols from Marvosym package, and =\checkmark= are now
-supported symbols in Org-mode, i.e. they will be exported
-properly to the various backends.
-
-**** Allow LaTeX_CLASS_OPTIONS to set options, also from a property
-
-You can set the options to the =\documentclass= command on a
-per-file basis, using
-
-: #+LaTeX_CLASS_OPTIONS: [11pt]
-
-or on a per-tree basis using the corresponding property. The
-defined string will replace the default options entirely.
-
-**** The encoding of LaTeX files is now handled property
-
-Org now makes sure that the encoding used by the file created
-through the export mechanism is reflected correctly in the
-
-: \usepackage[CODINGSYSTEM]{inputenc}
-
-command. So as long as the =org-export-latex-classes= definition
-contains an =\usepackage[utf8]{inputenc}= statement, that
-statement will be modified so that the correct option is used.
-
-If you wan to use special encodings, for example =utf8x= instead
-of =utf8=, see the variable =org-export-latex-inputenc-alist=.
-
-This was a request by Francesco Pizzolante.
-
-*** Property API enhancements
-
-**** Make a new special property BLOCKED, indicating if entry is blocked
-
-A new special property BLOCKED returns "t" when the entry is
-blocked from switching the TODO state to a DONE state.
-
-This was a request by John Wiegley.
-
-**** New hooks for external support for allowed property values
-
-It is now possible to hook into Org in order to provide the
-allowed values for any property with a lisp function. See the
-docstring of the variable =org-property-allowed-value-functions=
-
-**** Allow unrestricted completion on properties
-
-When listing the allowed values for a property, for example with
-a =:name_ALL:= property, completion on these values enforces that
-one of the values will be chosen. Now, if you add ":ETC" to the
-list of allowed values, it will be interpreted as a switch, and
-the completion will be non-restrictive, so you can also choose to
-type a new value.
-
-*** Changes to Org-babel
-
-- The documentation for Org-babel has been drastically improved
- and is available on Worg at
- http://orgmode.org/worg/org-contrib/babel/
-- Source-code block names are now exported to HTML and LaTeX
-- Org-babel functions are now bound to keys behind a common key
- prefix (see
- http://orgmode.org/worg/org-contrib/babel/reference.php#sec-5)
-- Results are now foldable with TAB
-- Header argument values can now be lisp forms
-- Readable aliases for #+srcname: and #+resname:
-- Sha1 hash based caching of results in buffer
-- Can now index into variable values
-- org-babel-clojure now supports multiple named sessions
-
-*** Miscellaneous changes
-
-**** Make =C-c r C= customize remember templates
-
-=C-c r C= is now a shortcut for
-
-: M-x customize-variable RET org-remember-templates RET
-
-This was a proposal by Adam Spiers.
-
-**** Use John Gruber's regular expression for URL's
-
-We now use a better regexp to spot plain links in text. This
-regexp is adopted from [[http://daringfireball.net/2009/11/liberal_regex_for_matching_urls][John Gruber's blogpost]].
-
-Thanks to William Henney for the pointer.
-
-**** Implement tag completion of all tags in all agenda files
-
-The new option =org-complete-tags-always-offer-all-agenda-tags=
-makes Org complete all tags from all agenda files if non-nil.
-Usually, setting it locally to t in org-remember buffers is the
-most useful application of this new feature.
-
-Thanks to Tassilo Horn for a patch to this effect.
-
-* Version 6.33
- :PROPERTIES:
- :CUSTOM_ID: v6.33
- :END:
-
-** Incompatible changes
-
-*** Reorganize key bindings for archiving
-
-The following keys now do archiving
-
-- C-c C-x C-a :: archive using the command specified in
- =org-archive-default-command=. This variable is by default
- set to =org-archive-subtree=, which means arching to the
- archive file.
-
-The three specific archiving commands are available through
-
-- C-c C-x C-s :: archive to archive file
-- C-c C-x a :: toggle the archive tag
-- C-c C-x A :: move to archive sibling
-
-These bindings work the same in an Org file, and in the agenda.
-
-In addition:
-
-- In the agenda you can also use =a= to call the default archiving
- command, but you need to confirm the command with =y= so that this
- cannot easily happen by accident.
-
-- For backward compatibility, =C-c $= in an org-mode file, and
- =$= in the agenda buffer continue to archive to archive file.
-
-
-** Details
-
-*** Level indentation cycling new empty entries and plain list items
-:PROPERTIES:
-:ID: 1CBF16C9-031C-4A03-A5EE-09B6AAB6209C
-:END:
-
-To speed up data entry, TAB now behaves special in an empty
-headline, i.e. if the current line only contains the headline
-starter stars, maybe a TOD keyword, but no further content. This
-is usually the situation just after creating a new headline with
-=M-RET= or =M-S-RET=.
-
-Then, TAB will first make the current entry a child of the
-entry above, then a parent, then a grand parent etc until it
-reaches top level. Yet another TAB and you will be back at the
-initial level at which the headline was created.
-
-New plain list items behave in just the same way.
-
-Sounds strange? Try it, it is insanely fast when entering data.
-If you still don't like it, turn it off by customizing
-=org-cycle-level-after-item/entry-creation=.
-
-Thanks to [[http://thread.gmane.org/gmane.emacs.orgmode/18236][Samuel Wales]] and [[http://thread.gmane.org/gmane.emacs.orgmode/18447/focus%3D19015][John Wiegley]] for ideas that
-contributed to this new feature.
-
-*** Speed commands at the start of a headline
-
-If you set the variable =org-use-speed-commands=, the cursor
-position at the beginning of a headline (i.e. before the first
-star) becomes special. Single keys execute special commands in
-this place, for example outline navigation with =f=, =b=, =n=,
-and =p=, equivalent to the corresponding =C-c C-f=, =C-c C-b=,
-=C-c C-n=, and =C-c C-f= commands. The full list of commands can
-be seen by pressing =?= at the special location. More commands
-can be added and existing ones modified by configuring the
-variable =org-speed-commands-user=.
-
-This was a request by John Wiegley, based on similar speed
-navigation in /allout.el/.
-
-*** Logging changes in scheduling and deadline time stamps
-
-Setting the variables =org-log-reschedule= and
-=org-log-redeadline= to either =time= or =note= will arrange for
-recording a logbook entry whenever a scheduling date or deadline
-is changed.
-
-This was a request by Rick Moynihan.
-
-*** File remember notes into a date tree
-
-Remember notes can now be filed to a location in a date tree. A
-date tree is an outline tree with years as top levels, months as
-level 2 headings, and days as level three headings. These are
-great for journals and for recording appointments and other loose
-dates because it will be easy to find all entries referencing a
-particular date, and it will be easy to archive all such entry
-from last year, for example.
-
-To select date tree filing, set the HEADLINE part of the remember
-template to the symbol =date-tree=. The date tree will be build
-in the file on top level. However, if the file contains an entry
-with a non-nil =DATE_TREE= property, then the tree will be build
-under that headline.
-
-*** New commands to create entries from agenda and calendar
-
-If you make the variable =org-agenda-diary-file= point to an
-org-mode file, the =i= key in both the agenda buffer and in the
-Emacs calendar will be made to insert entries into that Org file.
-The dates at the cursor and the mark are being used when making
-entries for specific dates or blocks. In the new file,
-anniversaries will be collected under a special headline, and
-day/block entries will be filed into a date tree (see previous
-section).
-
-This was a request by Stephen Eglen.
-
-*** A new freemind exporter has been integrated with Org-mode
-
-org-freemind.el has a number of entry points (for details, see
-the source code), but you can also use Org's =C-c C-e m= to
-export a file or a selected subtree.
-
-Thanks to Lennart Borgman for this contribution. An earlier
-version of this file was part of the nxhtml package, under the
-name /freemind.el/.
-
-*** Drawers are now exported properly
-
-Drawers are now exported when the configuration requires it,
-i.e. if the variable `org-export-with-drawers' is t or a list
-containing the drawers to export.
-
-*** Min/Max/Mean age operators in Column View.
-
-This lets you see how much time has passed since the specified
-timestamp property each entry. The three operators (=@min=,
-=@max=, =@mean=) show either the age of the youngest or oldest
-entry or the average age of the children.
-
-Thanks to James TD Smith for a patch to this effect.
-
-*** Allow source code block indentation to be preserved
-
-If =org-src-preserve-indentation= is non-nil, or if a block has a
-=-i= switch, then the behavior of org-exp-blocks is altered as
-follows:
-
-1. Indentation is not removed before passing the block contents
- to the block-transforming plugin.
-
-2. The result returned by the plugin is not re-indented.
-
-3. Editing the source code block with =C-c '= preserves it's
- indentation.
-
-Thanks to Dan Davison for this feature.
-
-*** Frame/window control when switching to source code edit buffer.
-
-When switching to a source code editing buffer with =C-c '=, you
-can now control the frame / window setup using the new variable
-=org-src-window-setup=.
-
-Thanks to Dan Davison for this feature.
-
-*** Refile an entry to the current clock
-
-You can now quickly refile an entry to become a child of the
-entry currently being clocked. The keys for doing this are
-=C-2 C-c C-w=.
-
-This was a request by Bernt Hansen.
-
-*** Make =C-c C-o= open the attachment directory is there are no links
-
-If there is no link in an entry, =C-c C-o= will now open the
-attachment directory instead.
-
-This was a request/patch by John Wiegley.
-
-*** org-mac-iCal.el: work with calendar "groups"
-
-Some calendar systems (Google, Zimbra) handle subscriptions to
-multiple calendars (or to an account) by grouping them under a
-single caldav directory in the calendar tree. org-mac-iCal used
-to assumes there is only one ics file created per caldav
-directory, so while it *creates* all of the needed merged ics
-files, it only copies one of them to ~/Library/Calendar before
-importing the contents into the diary.
-
-Thanks to Doug Hellmann for a patch to fix this.
-
-*** New module /org-learn.el/ in the contrib directory
-
-The file implements the learning algorithm described at
-http://supermemo.com/english/ol/sm5.htm, which is a system for reading
-material according to "spaced repetition". See
-http://en.wikipedia.org/wiki/Spaced_repetition for more details.
-
-Thanks to John Wiegley for this contribution.
-
-*** New contributed package /org-git-link.el/
-
-/org-git-link.el/ defines two new link types. The =git= link type
-is meant to be used in the typical scenario and mimics the =file=
-link syntax as closely as possible. The =gitbare= link type
-exists mostly for debugging reasons, but also allows e.g.
-linking to files in a bare git repository for the experts.
-
-Thanks to Raimar Finken for this contribution.
-
-*** /org-annotation-helper.el/ and /org-browser-url.e./ have been removed
-Please switch to /org-protocol.el/, into which contains the same
-functionality in a more general framework.
-*** The contributed /org-export-freemind/ package has been removed.
-Org now contains a new freemind exporter, /org-freemind.el/.
-
-** Org-babel Changes
-- Clojure is supported [Thanks to Joel Boehland]
-- Perl is supported
-- Ruby and Python now respond to the :file header argument
-- Added :results_switches header argument for passing switches
- through to raw src blocks
-- Preserve indentation in source blocks on export and tangle
-- Possible to evaluate noweb reference on tangling or code block
- evaluation
-- Allowing multiple noweb references on a single line
-- Cleaned up the passing of parameter values from Org-babel to
- language specific functions
-
-* Version 6.32
- :PROPERTIES:
- :CUSTOM_ID: v6.32
- :END:
-
-** Rewrite of org-mobile.org, for MobileOrg 1.0 (build 20)
-
-MobileOrg is currently under review at the iPhone App Store. You
-will need Org-mode version 6.32 to interact with it.
-
-** Added support for habit consistency tracking
-
-/org-habit.el/ contains new code to track habits. Please
-configure the variable org-modules to activate it. When active,
-habits (a special TODO entry) will be displayed in the agenda
-together with a "consistency graph". Habit tracking is described
-in a new [[http://orgmode.org/manual/Tracking-your-habits.html][manual section]].
-
-Thanks to John Wiegley for this contribution.
-
-** New context-aware tag auto-exclusion
-
-After writing a function relating to location and context
-information, you will be able to press =/ RET= in the agenda to
-exclude tasks that cannot be done in the current context.
-For details, see the information about filtering in the manual.
-
-Thanks to John Wiegley for a patch to this effect.
-
-** New clock resolving tools
-
-When clocking into a new task while no clock is running, Org now
-checks for orphaned CLOCK lines and offers to repair these before
-starting the clock. You can also configure this feature to check
-for idle time and prompt you to subtract that time from the
-running timer.
-
-See the new [[http://orgmode.org/manual/Resolving-idle-time.html][manual section]] for more details.
-
-Thanks to John Wiegley for a patch to this effect.
-
-** Mutually exclusive tag groups can now have a name in the tags interface
-
-The customize interface allows to optionally add a string to the
-beginning or end of such a group.
-
-Thanks to James TD Smith for a patch to this effect.
-
-** Agenda Search view: Search for substrings
-
-The default in search view (/C-c a s/)is now that the search
-expression is searched for as a /substring/, i.e. the different
-words must occur in direct sequence, and it may be only part of
-a word. If you want to look for a number of separate keywords
-with Boolean logic, all words must be preceded by =+= or =-=.
-
-This was, more-or-less, requested by John Wiegley.
-
-** Make space and backspace scroll the show window in the agenda
-
-Pressing SPC again after using it to show an agenda item in
-another window will make the entire subtree visible, and show
-scroll it. Backspace and DEL will scroll back.
-
-This was a request by Eric Fraga.
-
-** File tags are now offered for completion during a tag prompts
-
-Requested by Matt Lundin.
-
-** Make `- SPC' an agenda filter that selects entries without any tags
-
-Request by John Wiegley.
-
-** Better way to edit multi-line macro definitions
-
-The editing tool key =C-c '= now also edits =#+MACRO=
-definitions, including multiline macros.
-
-** Restructured Manual
-
-The manual has been slightly reorganized. The archiving stuff,
-which was - somewhat obscurely - hidden in the /Document
-Structure/ chapter, has been moved into the new chapter
-/Capture-Refile-Archive/. Also, there is a new chapter /Markup/
-which contains both the markup rules (moved there from the Export
-chapter) and the documentation for embedded LaTeX.
-
-** Improved figure placement in LaTeX and HTML export
-
-Text can now be wrapped around figures. See the manual for
-details.
-
-** Allow date to be shifted into the future if time given is earlier than now
-
-By setting
-
-: (setq org-read-date-prefer-future 'time)
-
-you indicate to Org that, if you only give a time at the
-date/time prompt, and if this time is earlier then the current
-time, then the date of tomorrow will be assumed to be valid for
-this event. A similar mechanism was already in place for dates,
-but now you can make it work for times as well.
-
-** Collected changes in org-babel
-- Source blocks can now reference source-blocks in other files
- using =filepath:srcname= syntax.
-- Inline code blocks like =src_python{2+2}= are now exported
-- Remote source block calls using the =#+lob: srcname(arg=val)=
- syntax can now be exported.
-- When =:file= is supplied with an =R= block, graphics are
- automatically sent to file and linked from the org buffer, thus
- appearing on export. The image format is obtained from the
- filename extension. Possible values are =.png, .jpg, .jpeg,
- .tiff, .bmp, .pdf, .ps, .postscript=, defaulting to =png=.
-- Results can be returned as parseable code using =:results code=,
- and as pretty-printed code using =:results pp= (emacs-lisp,
- python, ruby). Thanks to Benny Andresen for the idea and patch
- for emacs-lisp.
-- When =:file filename= is supplied, =:exports file= is unnecessary
-- Header args are taken from org-file-properties in addition to
- properties active in the subtree.
-- =:noweb= header argument now expands noweb references before
- source-block evaluation.
-- Tangling honours the new org variable
- org-src-preserve-indentation, so that correct code is output for
- a language like python that depends on indentation.
-
-** Changes in org-exp-blocks.el
-- Interblocks export has been simplified.
-- Support for R code (=begin_R= blocks and inline =\R{}=) has been
- removed. Please use org-babel instead.
-
-* Version 6.31
- :PROPERTIES:
- :CUSTOM_ID: v6.31
- :END:
-
-** Org-babel is now part of the Org distribution
-
-Org-babel provides the ability to execute source code in many
-different languages within org-mode documents. The results of
-code execution -- text, tables and graphics -- can be integrated
-into Org-mode documents and can be automatically updated during
-publishing. Since Org-babel allows execution of arbitrary code,
-the range of tasks that can be addressed from within an Org mode
-file becomes very large. Examples of ways in which Org-babel
-might be used include
-
-- Documenting a task that involves some programming so that it is
- automatically repeatable
-- Creating dynamic (executable) reports that respond to changes
- in the underlying data (Reproducible Research)
-- Exportation of code contained in an Org-mode document into
- regular source code files (Literate Programming)
-
-Additionally, Org-babel provides a programming environment within
-Org files, in which data can be transmitted between parameterised
-source code blocks in different languages, as well as between
-source code blocks and Org-mode tables.
-
-A simple API is defined so that users can add support for new
-"languages" (broadly construed). Languages currently supported
-are:
-
-- asymptote
-- css
-- ditaa
-- dot
-- emacs-lisp
-- gnuplot
-- haskell
-- ocaml
-- python
-- R
-- ruby
-- sass
-- sh
-- sql
-
-Org-babel was designed and implemented Eric Schulte with continued
-significant help on both accounts from Dan Davison.
-
-** MobileOrg support
-
-Richard Morelands iPhone/iPod Touch program [[http://mobileorg.ncogni.to/][MobileOrg]] can view
-Org files, mark entries as DONE, flag entries for later
-attention, and capture new entries on the road. Org-mode has now
-support to produce a staging area where MobileOrg can download
-its files, and to integrate changes done on the phone in a half
-automatic, half interactive way. See the new appendix B in the
-manual for more information.
-
-
-** Indented lines starting with "#+ " are treated as comments
-
-To allow comments in plain lists without breaking the list
-structure, you can now have indented comment lines that start
-with "#+ ".
-
-** New STARTUP keyword `showeverything'
-
-This will make even drawer contents visible upon startup.
-Requested by Jeff Kowalczyk.
-
-** New contributed package org-invoice.el
-
-This package collects clocking information for billing
-customers.
-
-Thanks to Peter Jones for this contribution.
-
-** Encrypting subtrees
-
-/org-crypt.el/ by John Wiegley and Peter Jones allows encryption
-of individual subtrees in Org-mode outlines. Thanks to John and
-Peter for this contribution.
-
-** Agenda: Support for including a link in the category string
-
-The category (as specified by an #+CATEGORY line or CATEGORY
-property can contain a bracket link. While this sort-of worked
-in the past, it now is officially supported and should cause no
-problems in agenda display or update. The link can be followed
-by clicking on it, or with =C-c C-o 0=.
-
-This was a request by Peter Westlake.
-
-* Version 6.30
- :PROPERTIES:
- :CUSTOM_ID: v6.30
- :END:
-
-** Inconsistent changes
-
-*** Agenda now uses =f= and =b= to move through time
-
-Up to now, the Org-mode agenda used the cursor keys =left= and
-=right= to switch the agenda view forward an backward through
-time. However, many people found this confusing, and others
-wanted to be able to do cursor motion in the agenda, for example
-to select text. Therefore, after an extensive discussion on
-=emacs-orgmode@gnu.org=, it was decided to use the =b= and
-=f= keys instead, and to let the cursor keys do cursor motion
-again.
-
-*** Agenda follow mode is now on the =F= key
-
-This was necessary to free up the =f= key, see above.
-
-** Details
-
-*** Maintenance
-
-**** New command to submit a bug report
-
-There is now a special command =M-x org-submit-bug-report=. This
-command will create a mail buffer with lots of useful details.
-In particular, it contains complete version information for Emacs
-and Org-mode. It will also (if you agree to it) contain all
-non-standard settings of org-mode and outline-mode related
-variables. Even if you do not sent your emails from within
-Emacs, please still use this command to generate the information
-and then copy it into your mail program.
-
-The command will not generate and include a =*Backtrace*= buffer,
-please do this yourself if you have hit an error. For more
-information, see the [[http://orgmode.org/manual/Feedback.html#Feedback][feedback section]] of the manual.
-
-**** New contributed package org-track.el
-
-This package allows to keep up-to-date with current Org
-development, using only Emacs on-board means. So if you don't
-want or cannot use =git=, but still want to run the latest and
-hottest Org-mode, this is for you.
-
-Thanks to Sebastian Rose for this contribution.
-
-*** Agenda
-
-**** Agenda now uses =f= and =b= to move through time
-
-Up to now, the Org-mode agenda used the cursor keys =left= and
-=right= to switch the agenda view forward an backward through
-time. However, many people found this confusing, and others
-wanted to be able to do cursor motion in the agenda, for example
-to select text. Therefore, after an extensive discussion on
-=emacs-orgmode@gnu.org=, it was decided to use the =b= and
-=f= keys instead, and to let the cursor keys do cursor motion
-again.
-
-**** Agenda follow mode is now on the =F= key
-
-This was necessary to free up the =f= key, see above.
-
-**** The agenda can be put into a dedicated frame
-
-When the variable =org-agenda-window-setup= has the value
-=other-frame=, then the new frame created to show the agenda
-will now have the window marked as /dedicated/. As a
-consequence, exiting the agenda while the agenda is the only
-window on the frame will kill that frame.
-
-This was a request by Henry Atting.
-
-**** New mode to show some entry body text in the agenda
-
-There is now a new agenda sub-mode called
-=org-agenda-entry-text-mode=. It is toggled with the =E= key.
-When active, all entries in the agenda will be accompanied by a
-few lines from the outline entry. The amount of text can be
-customized with the variable =org-agenda-entry-text-maxlines=.
-
-This was a request by Anthony Fairchild, Manish, and others.
-
-**** Improve following links from the agenda
-
-=C-c C-o= in the agenda will now offer all links in the headline
-and text of an entry. If there is only a single link, it will be
-followed immediately.
-
-**** Avoid some duplicate entries
-
-There is a new variable that can be used to avoid some duplicate
-agenda entries: =org-agenda-skip-scheduled-if-deadline-is-shown=
-If that is set, it avoids that an entry shows up in the agenda for
-today for both a scheduling and a deadline entry. See the
-docstring of the variables for more details.
-
-This partially addresses a request by Samuel Wales.
-
-**** Mark the running clock in the agenda.
-
-If the entry currently being clocked is present in the agenda, it
-will be highlighted with the face =org-agenda-clocking=.
-
-This was a request by Rainer Stengele.
-
-
-*** Export
-
-**** Allow LaTeX export to use the listings package
-
-The LaTeX =listings= package can now be used for formatting
-fontified source code in many programming languages. For more
-information, see
-http://thread.gmane.org/gmane.emacs.orgmode/16269 and
-http://orgmode.org/worg/org-faq.php#fontified_source_code_w_latex
-
-Thanks to Eric Schulte for this patch.
-
-**** Remove table rows that only contain width and alignment markers
-
-The width and alignment in table columns can be set with a cookie
-like "<10>" or "<r>" or "<r10>". In order to keep Org from
-exporting such lines, the first column of a line should contain
-only "/". However, for convenience, there is now a special case:
-If the entire row contains only such markers, the line will
-automatically be discarded during export, even is the first
-column is not "/".
-
-**** Allow Macro calls to span several lines.
-
-Macro calls may now span several lines, to write several
-arguments in a cleaner way. The result of a macro call can also
-span several lines, by inserting the string "\n" (backslash
-followed by n) into the value in the macro definition.
-
-These were requests by Stefan Vollmar.
-
-*** Misc
-
-**** Quick access to all links in an entry
-
-If =C-c C-o= is called while the cursor is in a headline, but not
-directly on a link, then all links in the entry will be offered
-in a small menu. If there is only a single link, it will be
-followed without a prompt.
-
-**** Visibility Cycling: Allow to show all empty lines after a headline
-
-=org-cycle-separator-lines= can now be set to a negative value,
-to indicate that, if the number of empty lines before a visible
-entry is greater than the specified number, then *all* empty
-lines should be shown.
-
-This was a request by "PT" whatever this means.
-
-**** Allow language names to replace some strange major mode names
-
-Sometimes a language uses a major mode which can't be guessed
-from it's name. There is now a new variable =org-src-lang-modes=
-which can be used to map language names to major modes when this
-is the case. This is used when editing a source-code
-block, or when exporting fontified source-code with htmlize.
-
-Thanks to Eric Schulte for a patch to this effect.
-
-**** iswitchb support for many completion prompts
-
-This is enabled using =org-completion-use-iswitchb=, and follows
-the same model of usage as for ido users.
-
-Thanks to John Wiegley for a patch to this effect.
-
-**** New commands to set the effort property of an entry
-
-There is now a special command, =C-c C-x e= to set the =Effort=
-property of an entry. From the agenda you can even use =e=.
-If you have set up allowed values for the =Effort= property, then
-using a prefix argument will directly select the nth allowed
-value. For example, in the agenda, =5 e= will select the 5th
-allowed value.
-
-This was a request by Michael Gilbert
-
-**** Edit src works now better with killing buffer
-
-Thanks to Dan Davison for a patch to this effect
-
-
-* Older changes
-
- For older Changes, see [[file:Changes_old.org]]
-
-
-
-* COMMENT Setup
-
-#+STARTUP: showstars
-
-#+TITLE: Org-mode list of user-visible changes
-#+AUTHOR: Carsten Dominik
-#+EMAIL: carsten at orgmode dot org
-#+OPTIONS: H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:{} *:t TeX:t LaTeX:nil f:nil
-#+INFOJS_OPT: view:info toc:1 path:org-info.js tdepth:2 ftoc:t
-#+LINK_UP: index.html
-#+LINK_HOME: http://orgmode.org
diff --git a/.emacs.d/org-7.4/Makefile b/.emacs.d/org-7.4/Makefile
deleted file mode 100644
index d473904..0000000
--- a/.emacs.d/org-7.4/Makefile
+++ /dev/null
@@ -1,511 +0,0 @@
-# Makefile - for the org-mode distribution
-#
-# Maintainer: Carsten Dominik <dominik@science.uva.nl>
-# Version: VERSIONTAG
-#
-# To install org-mode, edit the Makefile, type `make', then `make install'.
-# To create the PDF and HTML documentation files, type `make doc'.
-
-##----------------------------------------------------------------------
-## YOU MUST EDIT THE FOLLOWING LINES
-##----------------------------------------------------------------------
-
-# Name of your emacs binary
-EMACS=emacs
-
-# Where local software is found
-prefix=/usr/local
-
-# Where local lisp files go.
-lispdir = $(prefix)/share/emacs/site-lisp
-
-# Where info files go.
-infodir = $(prefix)/share/info
-
-##----------------------------------------------------------------------
-## YOU MAY NEED TO EDIT THESE
-##----------------------------------------------------------------------
-
-# Using emacs in batch mode.
-
-BATCH=$(EMACS) -batch -q -no-site-file -eval \
- "(setq load-path (cons (expand-file-name \"./lisp/\") (cons \"$(lispdir)\" load-path)))"
-
-# Specify the byte-compiler for compiling org-mode files
-ELC= $(BATCH) -f batch-byte-compile
-
-# How to make a pdf file from a texinfo file
-TEXI2PDF = texi2pdf
-
-# How to create directories
-MKDIR = mkdir -p
-
-# How to create the info files from the texinfo file
-MAKEINFO = makeinfo
-
-# How to create the HTML file
-TEXI2HTML = makeinfo --html --number-sections
-TEXI2HTMLNOPSLIT = makeinfo --html --no-split --number-sections
-
-# How to copy the lisp files and elc files to their distination.
-CP = cp -p
-
-# Name of the program to install info files
-INSTALL_INFO=install-info
-
-##----------------------------------------------------------------------
-## BELOW THIS LINE ON YOUR OWN RISK!
-##----------------------------------------------------------------------
-
-# The following variables need to be defined by the maintainer
-LISPF = org.el \
- org-agenda.el \
- org-ascii.el \
- org-attach.el \
- org-archive.el \
- org-bbdb.el \
- org-beamer.el \
- org-bibtex.el \
- org-capture.el \
- org-clock.el \
- org-colview.el \
- org-colview-xemacs.el \
- org-compat.el \
- org-complete.el \
- org-crypt.el \
- org-ctags.el \
- org-datetree.el \
- org-docview.el \
- org-entities.el \
- org-exp.el \
- org-exp-blocks.el \
- org-docbook.el \
- org-faces.el \
- org-feed.el \
- org-footnote.el \
- org-freemind.el \
- org-gnus.el \
- org-habit.el \
- org-html.el \
- org-icalendar.el \
- org-id.el \
- org-indent.el \
- org-info.el \
- org-inlinetask.el \
- org-jsinfo.el \
- org-irc.el \
- org-latex.el \
- org-list.el \
- org-mac-message.el \
- org-macs.el \
- org-mew.el \
- org-mhe.el \
- org-mks.el \
- org-mobile.el \
- org-mouse.el \
- org-publish.el \
- org-plot.el \
- org-protocol.el \
- org-remember.el \
- org-rmail.el \
- org-src.el \
- org-table.el \
- org-taskjuggler.el \
- org-timer.el \
- org-vm.el \
- org-w3m.el \
- org-wl.el \
- org-xoxo.el \
- ob.el \
- ob-table.el \
- ob-lob.el \
- ob-ref.el \
- ob-exp.el \
- ob-tangle.el \
- ob-comint.el \
- ob-eval.el \
- ob-keys.el \
- ob-C.el \
- ob-calc.el \
- ob-ditaa.el \
- ob-haskell.el \
- ob-perl.el \
- ob-sh.el \
- ob-R.el \
- ob-dot.el \
- ob-mscgen.el \
- ob-latex.el \
- ob-ledger.el \
- ob-python.el \
- ob-sql.el \
- ob-asymptote.el \
- ob-emacs-lisp.el \
- ob-matlab.el \
- ob-ruby.el \
- ob-sqlite.el \
- ob-clojure.el \
- ob-ocaml.el \
- ob-sass.el \
- ob-css.el \
- ob-gnuplot.el \
- ob-octave.el \
- ob-screen.el \
- ob-plantuml.el \
- ob-org.el \
- ob-js.el \
- ob-scheme.el
-
-LISPFILES0 = $(LISPF:%=lisp/%)
-LISPFILES = $(LISPFILES0) lisp/org-install.el
-ELCFILES0 = $(LISPFILES0:.el=.elc)
-ELCFILES = $(LISPFILES:.el=.elc)
-DOCFILES = doc/org.texi doc/org.pdf doc/org doc/dir \
- doc/pdflayout.sty doc/.nosearch \
- doc/orgguide.texi doc/orgguide.pdf
-CARDFILES = doc/orgcard.tex doc/orgcard.pdf doc/orgcard_letter.pdf
-TEXIFILES = doc/org.texi
-INFOFILES = doc/org
-
-# Package Manager (ELPA)
-PKG_TAG = $(shell date +%Y%m%d)
-PKG_DOC = "Outline-based notes management and organizer"
-PKG_REQ = "nil"
-
-PKG_FILES = $(LISPFILES0) \
- doc/dir doc/org \
- doc/pdflayout.sty \
- doc/org.pdf \
- doc/orgguide.pdf \
- doc/orgcard.tex \
- doc/orgcard.pdf \
- doc/orgcard_letter.pdf
-
-.SUFFIXES: .el .elc .texi
-SHELL = /bin/sh
-
-# Additional distribution files
-DISTFILES_extra= Makefile request-assign-future.txt contrib
-
-default: $(ELCFILES) $(ELCBFILES)
-
-all: $(ELCFILES) $(ELCBFILES) $(INFOFILES)
-
-up2: update
- sudo ${MAKE} install
-
-update:
- git pull
- ${MAKE} clean
- ${MAKE} all
-
-compile: $(ELCFILES0) $(ELCBFILES)
-
-install: install-lisp
-
-doc: doc/org.html doc/org.pdf doc/orgcard.pdf doc/orgcard_letter.pdf doc/orgguide.pdf doc/orgcard.txt
-
-p:
- ${MAKE} pdf && open doc/org.pdf
-
-g:
- ${MAKE} pdf && open doc/orgguide.pdf
-
-install-lisp: $(LISPFILES) $(ELCFILES)
- if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ;
- $(CP) $(LISPFILES) $(lispdir)
- $(CP) $(ELCFILES) $(lispdir)
-
-install-info: $(INFOFILES)
- if [ ! -d $(infodir) ]; then $(MKDIR) $(infodir); else true; fi ;
- $(CP) $(INFOFILES) $(infodir)
- $(INSTALL_INFO) --info-file=$(INFOFILES) --info-dir=$(infodir)
-
-install-info-debian: $(INFOFILES)
- $(INSTALL_INFO) --infodir=$(infodir) $(INFOFILES)
-
-autoloads: lisp/org-install.el
-
-lisp/org-install.el: $(LISPFILES0) Makefile
- $(BATCH) --eval "(require 'autoload)" \
- --eval '(find-file "org-install.el")' \
- --eval '(erase-buffer)' \
- --eval '(mapc (lambda (x) (generate-file-autoloads (symbol-name x))) (quote ($(LISPFILES0))))' \
- --eval '(insert "\n(provide (quote org-install))\n")' \
- --eval '(save-buffer)'
- mv org-install.el lisp
-
-doc/org: doc/org.texi
- (cd doc; $(MAKEINFO) --no-split org.texi -o org)
-
-doc/org.pdf: doc/org.texi
- (cd doc; $(TEXI2PDF) org.texi)
-
-doc/orgguide.pdf: doc/orgguide.texi
- (cd doc; $(TEXI2PDF) orgguide.texi)
-
-doc/org.html: doc/org.texi
- (cd doc; $(TEXI2HTML) --no-split -o org.html org.texi)
- UTILITIES/manfull.pl doc/org.html
-
-doc/orgcard.pdf: doc/orgcard.tex
- (cd doc; pdftex orgcard.tex)
-
-doc/orgcard.txt: doc/orgcard.tex
- (cd doc; perl ../UTILITIES/orgcard2txt.pl orgcard.tex > orgcard.txt)
-
-doc/orgcard_letter.tex: doc/orgcard.tex
- perl -pe 's/\\pdflayout=\(0l\)/\\pdflayout=(1l)/' \
- doc/orgcard.tex > doc/orgcard_letter.tex
-
-doc/orgcard_letter.pdf: doc/orgcard_letter.tex
- (cd doc; pdftex orgcard_letter.tex)
-
-# Below here are special targets for maintenance only
-
-updateweb:
- ssh cdominik@orgmode.org 'pull-worg-orgweb.sh && publish-worg-orgweb.sh'
-
-html: doc/org.html
-
-html_manual: doc/org.texi
- rm -rf doc/manual
- mkdir doc/manual
- $(TEXI2HTML) -o doc/manual doc/org.texi
- UTILITIES/mansplit.pl doc/manual/*.html
-
-html_guide: doc/orgguide.texi
- rm -rf doc/guide
- mkdir doc/guide
- $(TEXI2HTML) -o doc/guide doc/orgguide.texi
- UTILITIES/guidesplit.pl doc/guide/*.html
-
-info: doc/org
-
-pdf: doc/org.pdf doc/orgguide.pdf
-
-card: doc/orgcard.pdf doc/orgcard_letter.pdf doc/orgcard.txt
-
-testrelease:
- git checkout -b testrelease maint
- git merge -s recursive -X theirs master
- UTILITIES/set-version.pl testing
- git commit -a -m "Release testing"
- make distfile TAG=testversion
- make cleanrel
- rm -rf org-testversion*
- git reset --hard
- git checkout master
- git branch -D testrelease
-
-# The following target makes a full release fro the stuff that is
-# currently on master. Do it like this:
-#
-# make release TAG=7.01
-
-release:
- git checkout maint
- git merge -s recursive -X theirs master
- UTILITIES/set-version.pl $(TAG)
- git commit -a -m "Release $(TAG)"
- make relup TAG=$(TAG)
- make cleanrel
- rm -rf org-$(TAG)
- rm -f org-$(TAG)*.zip
- rm -f org-$(TAG)*.tar.gz
- make pushreleasetag TAG=$(TAG)
- git push -f origin maint
- git checkout master
- git merge -s ours maint
- UTILITIES/set-version.pl -o $(TAG)
- git commit -a -m "Update website to show $(TAG) as current release"
- git push
- make updateweb
-
-# The following target makes a release, but from the studd that is on
-# maint, not from the stuff that is on master. The idea is that it pushes
-# out a minor fix into a minor update, while development on master
-# already went full steam ahead. To make a micro-relesse, cherry-pick
-# the necessary changes into maint, then run (with proper version number)
-# This is just like release, but we skip the step which merges master
-# into maint.
-#
-# make fixrelease TAG=7.01.02
-
-fixrelease:
- git checkout maint
- git merge -s recursive -X theirs master
- UTILITIES/set-version.pl $(TAG)
- git commit -a -m "Release $(TAG)"
- make relup TAG=$(TAG)
- make cleanrel
- rm -rf org-$(TAG)
- rm org-$(TAG)*.zip
- rm org-$(TAG)*.tar.gz
- make pushreleasetag TAG=$(TAG)
- git push -f origin maint
- git checkout master
- git merge -s ours maint
- UTILITIES/set-version.pl -o $(TAG)
- git commit -a -m "Update website to show $(TAG) as current release"
- git push
- make updateweb
-
-relup:
- ${MAKE} makerelease
- ${MAKE} upload_release
- ${MAKE} upload_manual
-
-distfile:
- @if [ "X$(TAG)" = "X" ]; then echo "*** No tag ***"; exit 1; fi
- touch doc/org.texi doc/orgcard.tex # force update
- ${MAKE} cleancontrib
- ${MAKE} info
- ${MAKE} doc
- ${MAKE} lisp/org-install.el
- rm -rf org-$(TAG) org-$(TAG).zip
- $(MKDIR) org-$(TAG)
- $(MKDIR) org-$(TAG)/doc
- $(MKDIR) org-$(TAG)/lisp
- cp -r $(LISPFILES) org-$(TAG)/lisp
- cp -r $(DOCFILES) $(CARDFILES) org-$(TAG)/doc
- cp -r $(DISTFILES_extra) org-$(TAG)/
- cp -r README_DIST org-$(TAG)/README
- cp -r ORGWEBPAGE/Changes.org org-$(TAG)/
- zip -r org-$(TAG).zip org-$(TAG)
- gtar zcvf org-$(TAG).tar.gz org-$(TAG)
-
-pkg:
- @if [ "X$(PKG_TAG)" = "X" ]; then echo "*** No tag ***"; exit 1; fi
- touch doc/org.texi doc/orgcard.tex # force update
- ${MAKE} info
- ${MAKE} doc
- rm -rf org-$(PKG_TAG) org-$(PKG_TAG).tar
- $(MKDIR) org-$(PKG_TAG)
- cp -r $(PKG_FILES) org-$(PKG_TAG)
- echo "(define-package \"org\" \"$(PKG_TAG)\" \"$(PKG_DOC)\" $(PKG_REQ))" > org-$(PKG_TAG)/org-pkg.el
- tar cf org-$(PKG_TAG).tar org-$(PKG_TAG) --remove-files
-
-makerelease:
- @if [ "X$(TAG)" = "X" ]; then echo "*** No tag ***"; exit 1; fi
- ${MAKE} distfile
- ${MAKE} doc
- UTILITIES/gplmanual.pl
- ${MAKE} html_manual
- ${MAKE} html_guide
- rm -rf RELEASEDIR
- $(MKDIR) RELEASEDIR
- cp org-$(TAG).zip org-$(TAG).tar.gz RELEASEDIR
- cp doc/org.pdf doc/orgcard.pdf doc/org.texi doc/org.html RELEASEDIR
- cp doc/org_dual_license.texi RELEASEDIR
- cp doc/orgguide.pdf doc/orgcard.txt RELEASEDIR
- cp RELEASEDIR/org-$(TAG).zip RELEASEDIR/org.zip
- cp RELEASEDIR/org-$(TAG).tar.gz RELEASEDIR/org.tar.gz
-
-upload_release:
- rsync -avuz RELEASEDIR/ cdominik@orgmode.org:orgmode.org/
-
-upload_manual:
- rsync -avuz --delete doc/manual/ cdominik@orgmode.org:orgmode.org/manual/
- rsync -avuz --delete doc/guide/ cdominik@orgmode.org:orgmode.org/guide/
-
-cleanall:
- ${MAKE} clean
- rm -f lisp/org-install.el
-
-clean:
- ${MAKE} cleanelc
- ${MAKE} cleandoc
- ${MAKE} cleanrel
- rm -f *~ */*~ */*/*~
-
-cleancontrib:
- find contrib -name \*~ -exec rm {} \;
-
-cleanelc:
- rm -f $(ELCFILES)
-cleandoc:
- (cd doc; rm -f org.pdf org org.html orgcard.pdf)
- (cd doc; rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs)
- (cd doc; rm -f *.toc *.tp *.tps *.vr *.vrs *.log *.html *.ps)
- (cd doc; rm -f orgcard_letter.tex orgcard_letter.pdf)
- (cd doc; rm -rf manual)
-
-cleanrel:
- rm -rf RELEASEDIR
- rm -rf org-7.*
- rm -rf org-7*zip org-7*tar.gz
-
-.el.elc:
- $(ELC) $<
-
-
-push:
- git-push git+ssh://repo.or.cz/srv/git/org-mode.git master
-
-pushtag:
- git-tag -m "Adding tag" -a $(TAG)
- git-push git+ssh://repo.or.cz/srv/git/org-mode.git $(TAG)
-
-pushreleasetag:
- git-tag -m "Adding release tag" -a release_$(TAG)
- git-push git+ssh://repo.or.cz/srv/git/org-mode.git release_$(TAG)
-
-# Dependencies
-
-lisp/org.elc: lisp/org-macs.el lisp/org-compat.el lisp/org-faces.el
-lisp/org-agenda.elc: lisp/org.el
-lisp/org-ascii.elc: lisp/org-exp.el
-lisp/org-attach.elc: lisp/org.el lisp/org-id.el
-lisp/org-archive.elc: lisp/org.el
-lisp/org-bbdb.elc: lisp/org.el
-lisp/org-beamer.elc: lisp/org.el
-lisp/org-bibtex.elc: lisp/org.el
-lisp/org-capture.elc: lisp/org.el lisp/org-mks.el
-lisp/org-clock.elc: lisp/org.el
-lisp/org-colview.elc: lisp/org.el
-lisp/org-colview-xemacs.elc: lisp/org.el
-lisp/org-compat.elc: lisp/org-macs.el
-lisp/org-crypt.elc: lisp/org-crypt.el lisp/org.el
-lisp/org-ctags.elc: lisp/org.el
-lisp/org-datetree.elc: lisp/org.el
-lisp/org-docview.elc: lisp/org.el
-lisp/org-entities.elc:
-lisp/org-exp.elc: lisp/org.el lisp/org-agenda.el
-lisp/org-exp-blocks.elc: lisp/org.el
-lisp/org-latex.elc: lisp/org.el lisp/org-exp.el lisp/org-beamer.el
-lisp/org-docbook.elc: lisp/org.el lisp/org-exp.el
-lisp/org-faces.elc: lisp/org-macs.el lisp/org-compat.el
-lisp/org-feed.elc: lisp/org.el
-lisp/org-footnotes.elc: lisp/org-macs.el lisp/org-compat.el
-lisp/org-freemind.elc: lisp/org.el
-lisp/org-gnus.elc: lisp/org.el
-lisp/org-html.elc: lisp/org-exp.el
-lisp/org-habit.elc: lisp/org.el lisp/org-agenda.el
-lisp/org-icalendar.elc: lisp/org-exp.el
-lisp/org-id.elc: lisp/org.el
-lisp/org-indent.elc: lisp/org.el lisp/org-macs.el lisp/org-compat.el
-lisp/org-info.elc: lisp/org.el
-lisp/org-inlinetask.elc:
-lisp/org-irc.elc: lisp/org.el
-lisp/org-jsinfo.elc: lisp/org.el lisp/org-exp.el
-lisp/org-list.elc: lisp/org-macs.el lisp/org-compat.el
-lisp/org-mac-message.elc: lisp/org.el
-lisp/org-macs.elc:
-lisp/org-mew.elc: lisp/org.el
-lisp/org-mhe.elc: lisp/org.el
-lisp/org-mks.elc:
-lisp/org-mobile.elc: lisp/org.el
-lisp/org-mouse.elc: lisp/org.el
-lisp/org-plot.elc: lisp/org.el lisp/org-exp.el lisp/org-table.el
-lisp/org-publish.elc:
-lisp/org-protocol.elc: lisp/org.el
-lisp/org-remember.elc: lisp/org.el
-lisp/org-rmail.elc: lisp/org.el
-lisp/org-src.elc: lisp/org-macs.el lisp/org-compat.el
-lisp/org-table.elc: lisp/org.el
-lisp/org-taskjuggler.elc: lisp/org.el lisp/org-exp.el
-lisp/org-timer.elc: lisp/org.el
-lisp/org-vm.elc: lisp/org.el
-lisp/org-w3m.elc: lisp/org.el
-lisp/org-wl.elc: lisp/org.el
-lisp/org-xoxo.elc: lisp/org-exp.el
diff --git a/.emacs.d/org-7.4/README b/.emacs.d/org-7.4/README
deleted file mode 100644
index ac4082c..0000000
--- a/.emacs.d/org-7.4/README
+++ /dev/null
@@ -1,39 +0,0 @@
-The is a distribution of Org, a plain text notes and project planning
-tool for Emacs.
-
-The version of this release is: 7.4
-
-The homepage of Org is at http://orgmode.org
-
-This distribution contains:
-
-README
- This file.
-
-lisp/
- Directory with all the Emacs Lisp files that make up Org.
-
-doc/
- The documentation files. org.texi is the source of the
- documentation, org.html and org.pdf are formatted versions of it.
-
-contrib/
- A directory with third-party additions for Org. Some really cool
- stuff is in there.
-
-ChangeLog
- The standard ChangeLog file, for geeks.
-
-Changes.org
- An Org-mode file listing the user visible changes in each release.
-
-Makefile
- The makefile to compile and install Org. For installation
- instructions, see the manual.
-
-request-assign-future.txt
- The form that contributors have to sign and get processed with the
- FSF before contributed changes can be integrated into the Org
- core. All files in this distribution except the CONTRIB directory
- have copyright assigned to the FSF.
-
diff --git a/.emacs.d/org-7.4/contrib/.DS_Store b/.emacs.d/org-7.4/contrib/.DS_Store
deleted file mode 100644
index dc5f85a..0000000
--- a/.emacs.d/org-7.4/contrib/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/contrib/README b/.emacs.d/org-7.4/contrib/README
deleted file mode 100644
index 6a15821..0000000
--- a/.emacs.d/org-7.4/contrib/README
+++ /dev/null
@@ -1,60 +0,0 @@
-This directory contains add-ons to Org-mode.
-
-These contributions are not part of GNU Emacs or of the official Org-mode
-package. But the git repository for Org-mode is glad to provide useful way
-to distribute and develop them as long as they are distributed under a free
-software license.
-
-Please put your contribution in one of these three directories:
-
-LISP (emacs-lisp code)
-======================
-htmlize.el --- Convert buffer text and decorations to HTML
-org2rem.el --- Convert org appointments into reminders
-org-annotate-file.el --- Annotate a file with org syntax
-org-bookmark.el --- Links to bookmarks
-org-checklist.el --- org functions for checklist handling
-org-choose.el --- Use TODO keywords to mark decision states
-org-collector.el --- Collect properties into tables
-org-contribdir.el --- Dummy file to mark the org contrib Lisp directory
-org-depend.el --- TODO dependencies for Org-mode
-org-drill.el --- Self-testing with org-learn
-org-depend.el --- TODO dependencies for Org-mode
-org-elisp-symbol.el --- Org links to emacs-lisp symbols
-org-eval.el --- The <lisp> tag, adapted from Muse
-org-eval-light.el --- Evaluate in-buffer code on demand
-org-exp-bibtex.el --- Export citations to LaTeX and HTML
-org-expiry.el --- Expiry mechanism for Org entries
-org-export-generic.el --- Export framework for configurable backends
-org-git-link.el --- Provide org links to specific file version
-org-interactive-query.el --- Interactive modification of tags query
-org-invoice.el --- Help manage client invoices in OrgMode
-org-jira.el --- Add a jira:ticket protocol to Org
-org-learn.el --- SuperMemo's incremental learning algorithm
-org-mac-iCal.el --- Imports events from iCal.app to the Emacs diary
-org-mac-link-grabber.el --- Grab links and URLs from various Mac applications
-org-mairix.el --- Hook mairix search into Org for different MUAs
-org-man.el --- Support for links to manpages in Org-mode
-org-mime.el --- org html export for text/html MIME emails
-org-mtags.el --- Support for some Muse-like tags in Org-mode
-org-panel.el --- Simple routines for us with bad memory
-org-registry.el --- A registry for Org links
-org-screen.el --- Visit screen sessions through Org-mode links
-org-secretary.el --- Team management with org-mode
-org-special-blocks.el --- Turn blocks into LaTeX envs and HTML divs
-orgtbl-sqlinsert.el --- Convert Org-mode tables to SQL insertions
-org-toc.el --- Table of contents for Org-mode buffer
-org-track.el --- Keep up with Org development
-org-velocity.el --- something like Notational Velocity for Org
-org-wikinodes --- CamelCase wiki-like links for Org
-
-
-PACKAGES
-========
-
-SCRIPTS (shell, bash, etc.)
-===========================
-
-dir2org.zsh --- Org compatible fs structure output
-org2hpda --- Generate hipster pda style printouts from Org-mode
-ditaa.jar --- ASCII to PNG converter by Stathis Sideris, GPL
diff --git a/.emacs.d/org-7.4/contrib/babel/langs/ob-oz.el b/.emacs.d/org-7.4/contrib/babel/langs/ob-oz.el
deleted file mode 100644
index e1e6e35..0000000
--- a/.emacs.d/org-7.4/contrib/babel/langs/ob-oz.el
+++ /dev/null
@@ -1,306 +0,0 @@
-;;; ob-oz.el --- org-babel functions for Oz evaluation
-
-;; Copyright (C) 2009 Torsten Anders and Eric Schulte
-
-;; Author: Torsten Anders and Eric Schulte
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 0.01
-
-;;; License:
-
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; Org-Babel support for evaluating Oz source code.
-;;
-;; Oz code is always send to the Oz Programming Environment (OPI), the
-;; Emacs mode and compiler interface for Oz programs. Therefore, only
-;; session mode is supported. In practice, non-session code blocks are
-;; handled equally well by the session mode. However, only a single
-;; session is supported. Consequently, the :session header argument is
-;; ignored.
-;;
-;; The Org-babel header argument :results is interpreted as
-;; follows. :results output requires the respective code block to be
-;; an Oz statement and :results value requires an Oz
-;; expression. Currently, results are only supported for expressions
-;; (i.e. the result of :results output is always nil).
-;;
-;; Expression evaluation happens synchronously. Therefore there is an
-;; additional header argument :wait-time <number>, which specifies the
-;; maximum time to wait for the result of a given expression. nil
-;; means to wait as long as it takes to get a result (potentially wait
-;; forever).
-;;
-;; NOTE: Currently the copyright of this file may not be in a state to
-;; permit inclusion as core software into Emacs or Org-mode.
-
-;;; Requirements:
-
-;; - Mozart Programming System, the implementation of the Oz
-;; programming language (http://www.mozart-oz.org/), which includes
-;; the major mode mozart for editing Oz programs.
-;;
-;; - StartOzServer.oz which is located in the contrib/scripts
-;; directory of the Org-mode repository
-
-;;; TODO:
-
-;; - Decide: set communication to \\switch -threadedqueries?
-;;
-;; - Only start Oz compiler when required, e.g., load Org-babel only when needed?
-;;
-;; - Avoid synchronous evaluation to avoid blocking Emacs (complex
-;; Strasheela programs can take long to find a result..). In order
-;; to cleanly map code blocks to their associated results (which can
-;; arrive then in any order) I could use IDs
-;; (e.g. integers). However, how do I do concurrency in Emacs Lisp,
-;; and how can I define org-babel-execute:oz concurrently.
-;;
-;; - Expressions are rarely used in Oz at the top-level, and using
-;; them in documentation and Literate Programs will cause
-;; confusion. Idea: hide expression from reader and instead show
-;; them statement (e.g., MIDI output statement) and then include
-;; result in Org file. Implementation: for expressions (:results
-;; value) support an additional header argument that takes arbitrary
-;; Oz code. This code is not seen by the reader, but will be used
-;; for the actual expression at the end. Alternative: feed all
-;; relevant code as statement (:results output), then add expression
-;; as extra code block which outputs, e.g., file name (so the file
-;; name must be accessible by global var), but the code of this
-;; extra codeblock is not seen. Hm, in that case it might be even
-;; more easy to manually add this link to the Org file.
-;;
-
-
-(require 'ob)
-;;; major mode for editing Oz programs
-(require 'mozart)
-
-;;
-;; Interface to communicate with Oz.
-;; (1) For statements without any results: oz-send-string
-;; (2) For expressions with a single result: oz-send-string-expression
-;; (defined in org-babel-oz-ResultsValue.el)
-;;
-
-;; oz-send-string-expression implements an additional very direct
-;; communication between Org-babel and the Oz compiler. Communication
-;; with the Oz server works already without this code via the function
-;; oz-send-string from mozart.el.in, but this function does not get
-;; back any results from Oz to Emacs. The following code creates a
-;; socket for sending code to the OPI compiler and results are
-;; returned by the same socket. On the Oz side, a socket is opened and
-;; conected to the compiler of the OPI (via oz-send-string). On the
-;; Emacs side, a connection to this socket is created for feeding code
-;; and receiving results. This additional communication channel to the
-;; OPI compiler ensures that results are returned cleanly (e.g., only
-;; the result of the sent code is returned, no parsing or any
-;; processing of *Oz Emulator* is required).
-;;
-;; There is no buffer, nor sentinel involved. Oz code is send
-;; directly, and results from Oz are send back, but Emacs Lisp
-;; requires a filter function for processing results.
-
-(defvar org-babel-oz-server-dir
- (file-name-as-directory
- (expand-file-name
- "scripts"
- (file-name-as-directory
- (expand-file-name
- "../../.."
- (file-name-directory (or load-file-name buffer-file-name))))))
- "Path to the contrib/scripts directory in which
-StartOzServer.oz is located.")
-
-(defvar org-babel-oz-port 6001
- "Port for communicating with Oz compiler.")
-(defvar org-babel-oz-OPI-socket nil
- "Socket for communicating with OPI.")
-
-(defvar org-babel-oz-collected-result nil
- "Aux var to hand result from org-babel-oz-filter to oz-send-string-expression.")
-(defun org-babel-oz-filter (proc string)
- "Processes output from socket org-babel-oz-OPI-socket."
-;; (setq org-babel-oz-collected-results (cons string org-babel-oz-collected-results))
- (setq org-babel-oz-collected-result string)
- )
-
-
-(defun org-babel-oz-create-socket ()
- (message "Create OPI socket for evaluating expressions")
- ;; Start Oz directly
- (run-oz)
- ;; Create socket on Oz side (after Oz was started).
- (oz-send-string (concat "\\insert '" org-babel-oz-server-dir "StartOzServer.oz'"))
- ;; Wait until socket is created before connecting to it.
- ;; Quick hack: wait 3 sec
- ;;
- ;; extending time to 30 secs does not help when starting Emacs for
- ;; the first time (and computer does nothing else)
- (sit-for 3)
- ;; connect to OPI socket
- (setq org-babel-oz-OPI-socket
- ;; Creates a socket. I/O interface of Emacs sockets as for processes.
- (open-network-stream "*Org-babel-OPI-socket*" nil "localhost" org-babel-oz-port))
- ;; install filter
- (set-process-filter org-babel-oz-OPI-socket #'org-babel-oz-filter)
-)
-
-;; communication with org-babel-oz-OPI-socket is asynchronous, but
-;; oz-send-string-expression turns is into synchronous...
-(defun oz-send-string-expression (string &optional wait-time)
- "Similar to oz-send-string, oz-send-string-expression sends a string to the OPI compiler. However, string must be expression and this function returns the result of the expression (as string). oz-send-string-expression is synchronous, wait-time allows to specify a maximum wait time. After wait-time is over with no result, the function returns nil."
- (if (not org-babel-oz-OPI-socket)
- (org-babel-oz-create-socket))
- (let ((polling-delay 0.1)
- result)
- (process-send-string org-babel-oz-OPI-socket string)
- ;; wait for result
- (if wait-time
- (let ((waited 0))
- (unwind-protect
- (progn
- (while
- ;; stop loop if org-babel-oz-collected-result \= nil or waiting time is over
- (not (or (not (equal org-babel-oz-collected-result nil))
- (> waited wait-time)))
- (progn
- (sit-for polling-delay)
-;; (message "org-babel-oz: next polling iteration")
- (setq waited (+ waited polling-delay))))
-;; (message "org-babel-oz: waiting over, got result or waiting timed out")
-;; (message (format "wait-time: %s, waited: %s" wait-time waited))
- (setq result org-babel-oz-collected-result)
- (setq org-babel-oz-collected-result nil))))
- (unwind-protect
- (progn
- (while (equal org-babel-oz-collected-result nil)
- (sit-for polling-delay))
- (setq result org-babel-oz-collected-result)
- (setq org-babel-oz-collected-result nil))))
- result))
-
-(defun org-babel-expand-body:oz (body params &optional processed-params)
- (let ((vars (second (or processed-params (org-babel-process-params params))))))
- (if vars
- ;; only add var declarations if any variables are there
- (concat
- ;; prepend code to define all arguments passed to the code block
- "local\n"
- (mapconcat
- (lambda (pair)
- (format "%s=%s"
- (car pair)
- (org-babel-oz-var-to-oz (cdr pair))))
- vars "\n") "\n"
- "in\n"
- body
- "end\n")
- body))
-
-(defun org-babel-execute:oz (body params)
- "Execute a block of Oz code with org-babel. This function is
-called by `org-babel-execute-src-block' via multiple-value-bind."
- (let* ((processed-params (org-babel-process-params params))
-;; (session (org-babel-ruby-initiate-session (first processed-params)))
- (vars (second processed-params))
-;; (result-params (third processed-params))
- (result-type (fourth processed-params))
- (full-body (org-babel-expand-body:oz body params processed-params))
- (wait-time (plist-get params :wait-time))
- ;; set the session if the session variable is non-nil
-;; (session-buffer (org-babel-oz-initiate-session session))
-;; (session (org-babel-prep-session:oz session params))
- )
- ;; actually execute the source-code block
- (org-babel-reassemble-table
- (case result-type
- (output
- (progn
- (message "Org-babel: executing Oz statement")
- (oz-send-string full-body)))
- (value
- (progn
- (message "Org-babel: executing Oz expression")
- (oz-send-string-expression full-body (if wait-time
- wait-time
- 1)))))
- (org-babel-pick-name (nth 4 processed-params) (cdr (assoc :colnames params)))
- (org-babel-pick-name (nth 5 processed-params) (cdr (assoc :rownames params))))))
-
-;; This function should be used to assign any variables in params in
-;; the context of the session environment.
-(defun org-babel-prep-session:oz (session params)
- "Prepare SESSION according to the header arguments specified in PARAMS."
- (error "org-babel-prep-session:oz unimplemented"))
-;; TODO: testing... (copied from org-babel-haskell.el)
-;; (defun org-babel-prep-session:oz (session params)
-;; "Prepare SESSION according to the header arguments specified in PARAMS."
-;; (save-window-excursion
-;; (org-babel-oz-initiate-session session)
-;; (let* ((vars (org-babel-ref-variables params))
-;; (var-lines (mapconcat ;; define any variables
-;; (lambda (pair)
-;; (format "%s=%s"
-;; (car pair)
-;; (org-babel-ruby-var-to-ruby (cdr pair))))
-;; vars "\n"))
-;; (vars-file (concat (make-temp-file "org-babel-oz-vars") ".oz")))
-;; (when vars
-;; (with-temp-buffer
-;; (insert var-lines) (write-file vars-file)
-;; (oz-mode)
-;; ;; (inferior-oz-load-file) ; ??
-;; ))
-;; (current-buffer))))
-;;
-
-
-;; TODO: testing... (simplified version of def in org-babel-prep-session:ocaml)
-;;
-;; BUG: does not work yet. Error: ad-Orig-error: buffer none doesn't exist or has no process
-;; UNUSED DEF
-(defun org-babel-oz-initiate-session (&optional session params)
- "If there is not a current inferior-process-buffer in SESSION
-then create. Return the initialized session."
- (unless (string= session "none")
- ;; TODO: make it possible to have multiple sessions
- (save-window-excursion
- ;; (run-oz)
- (get-buffer oz-compiler-buffer))))
-
-(defun org-babel-oz-var-to-oz (var)
- "Convert an elisp var into a string of Oz source code
-specifying a var of the same value."
- (if (listp var)
-;; (concat "[" (mapconcat #'org-babel-oz-var-to-oz var ", ") "]")
- (eval var)
- (format "%s" var) ; don't preserve string quotes.
-;; (format "%s" var)
- ))
-
-;; TODO:
-(defun org-babel-oz-table-or-string (results)
- "If the results look like a table, then convert them into an
-Emacs-lisp table, otherwise return the results as a string."
- (error "org-babel-oz-table-or-string unimplemented"))
-
-
-(provide 'ob-oz)
-;;; org-babel-oz.el ends here
diff --git a/.emacs.d/org-7.4/contrib/babel/library-of-babel.org b/.emacs.d/org-7.4/contrib/babel/library-of-babel.org
deleted file mode 100644
index abc15a9..0000000
--- a/.emacs.d/org-7.4/contrib/babel/library-of-babel.org
+++ /dev/null
@@ -1,370 +0,0 @@
-#+title: The Library of Babel
-#+author: Org-mode People
-#+STARTUP: odd hideblocks
-
-* Introduction
- The Library of Babel is an extensible collection of ready-made and
- easily-shortcut-callable source-code blocks for handling common
- tasks. Org-babel comes pre-populated with the source-code blocks
- located in this file. It is possible to add source-code blocks from
- any org-mode file to the library by calling =(org-babel-lob-ingest
- "path/to/file.org")=.
-
- This file is included in worg mainly less for viewing through the
- web interface, and more for contribution through the worg git
- repository. If you have code snippets that you think others may
- find useful please add them to this file and [[file:~/src/worg/worg-git.org::contribute-to-worg][contribute them]] to
- worg.
-
- The raw Org-mode text of this file can be downloaded at
- [[repofile:contrib/babel/library-of-babel.org][library-of-babel.org]]
-
-* Simple
-A collection of simple utility functions
-
-#+srcname: echo
-#+begin_src emacs-lisp :var input="echo'd"
- input
-#+end_src
-
-* File I/O
-** reading and writing files
-Read the contents of the file at =file=. The =:results vector= and
-=:results scalar= header arguments can be used to read the contents of
-file as either a table or a string.
-#+srcname: read
-#+begin_src emacs-lisp :var file="" :var format=""
- (if (string= format "csv")
- (with-temp-buffer
- (org-table-import (expand-file-name file) nil)
- (org-table-to-lisp))
- (with-temp-buffer
- (insert-file-contents (expand-file-name file))
- (buffer-string)))
-#+end_src
-
-Write =data= to a file at =file=. If =data= is a list, then write it
-as a table in traditional Org-mode table syntax.
-#+srcname: write
-#+begin_src emacs-lisp :var data="" :var file="" :var ext='()
- (flet ((echo (r) (if (stringp r) r (format "%S" r))))
- (with-temp-file file
- (case (and (listp data)
- (or ext (intern (file-name-extension file))))
- ('tsv (insert (orgtbl-to-tsv data '(:fmt echo))))
- ('csv (insert (orgtbl-to-csv data '(:fmt echo))))
- (t (org-babel-insert-result data)))))
- nil
-#+end_src
-
-** remote files
-**** json
-Read local or remote file in [[http://www.json.org/][json]] format into emacs-lisp objects.
-#+srcname: json
-#+begin_src emacs-lisp :var file='() :var url='()
- (require 'json)
- (cond
- (file
- (with-temp-filebuffer file
- (goto-char (point-min))
- (json-read)))
- (url
- (require 'w3m)
- (with-temp-buffer
- (w3m-retrieve url)
- (goto-char (point-min))
- (json-read))))
-#+end_src
-
-**** Google docs
-The following code blocks make use of the [[http://code.google.com/p/googlecl/][googlecl]] Google command line
-tool. This tool provides functionality for accessing Google services
-from the command line, and the following code blocks use /googlecl/
-for reading from and writing to Google docs with Org-mode code blocks.
-
-****** read a document from Google docs
-The =google= command seems to be throwing "Moved Temporarily" errors
-when trying to download textual documents, but this is working fine
-for spreadsheets.
-#+source: gdoc-read
-#+begin_src emacs-lisp :var title="example" :var format="csv"
- (let* ((file (concat title "." format))
- (cmd (format "google docs get --format %S --title %S" format title)))
- (message cmd) (message (shell-command-to-string cmd))
- (prog1 (if (string= format "csv")
- (with-temp-buffer
- (org-table-import (shell-quote-argument file) '(4))
- (org-table-to-lisp))
- (with-temp-buffer
- (insert-file-contents (shell-quote-argument file))
- (buffer-string)))
- (delete-file file)))
-#+end_src
-
-For example, a line like the following can be used to read the
-contents of a spreadsheet named =num-cells= into a table.
-: #+call: gdoc-read(title="num-cells"")
-
-A line like the following can be used to read the contents of a
-document as a string.
-: #+call: gdoc-read(title="loremi", :format "txt")
-
-****** write a document to a Google docs
-Write =data= to a google document named =title=. If =data= is tabular
-it will be saved to a spreadsheet, otherwise it will be saved as a
-normal document.
-#+source: gdoc-write
-#+begin_src emacs-lisp :var title="babel-upload" :var data=fibs(n=10) :results silent
- (let* ((format (if (listp data) "csv" "txt"))
- (tmp-file (make-temp-file "org-babel-google-doc" nil (concat "." format)))
- (cmd (format "google docs upload --title %S %S" title tmp-file)))
- (with-temp-file tmp-file
- (insert
- (if (listp data)
- (orgtbl-to-csv
- data '(:fmt (lambda (el) (if (stringp el) el (format "%S" el)))))
- (if (stringp data) data (format "%S" data)))))
- (message cmd)
- (prog1 (shell-command-to-string cmd) (delete-file tmp-file)))
-#+end_src
-
-example usage
-: #+source: fibs
-: #+begin_src emacs-lisp :var n=8
-: (flet ((fib (m) (if (< m 2) 1 (+ (fib (- m 1)) (fib (- m 2))))))
-: (mapcar (lambda (el) (list el (fib el))) (number-sequence 0 (- n 1))))
-: #+end_src
-:
-: #+call: gdoc-write(title="fibs", data=fibs(n=10))
-
-* Plotting code
-
-** R
- Plot column 2 (y axis) against column 1 (x axis). Columns 3 and beyond, if present, are ignored.
-
-#+srcname: R-plot(data=R-plot-example-data)
-#+begin_src R
-plot(data)
-#+end_src
-
-#+tblname: R-plot-example-data
-| 1 | 2 |
-| 2 | 4 |
-| 3 | 9 |
-| 4 | 16 |
-| 5 | 25 |
-
-#+lob: R-plot(data=R-plot-example-data)
-
-#+resname: R-plot(data=R-plot-example-data)
-: nil
-
-** Gnuplot
-
-* Org reference
-** headline references
-#+source: headline
-#+begin_src emacs-lisp :var headline=top :var file='()
- (save-excursion
- (when file (get-file-buffer file))
- (org-open-link-from-string (org-make-link-string headline))
- (save-restriction
- (org-narrow-to-subtree)
- (buffer-string)))
-#+end_src
-
-#+call: headline(headline="headline references")
-
-* Tables
-** LaTeX Table export
-*** booktabs
-This block can be used to wrap a table in the latex =booktabs=
-environment, it takes the following arguments -- all but the first two
-are optional.
-| arg | description |
-|-------+--------------------------------------------|
-| table | a reference to the table |
-| align | optional alignment string |
-| env | optional environment, default to "tabular" |
-| width | optional width specification string |
-
-#+srcname: booktabs
-#+begin_src emacs-lisp :var table='((:head) hline (:body)) :var align='() :var env="tabular" :var width='() :noweb yes :results latex
- (flet ((to-tab (tab)
- (orgtbl-to-generic
- (mapcar (lambda (lis)
- (if (listp lis)
- (mapcar (lambda (el)
- (if (stringp el)
- el
- (format "%S" el))) lis)
- lis)) tab)
- (list :lend " \\\\" :sep " & " :hline "\\hline"))))
- (org-fill-template
- "
- \\begin{%env}%width%align
- \\toprule
- %table
- \\bottomrule
- \\end{%env}\n"
- (list
- (cons "env" (or env "table"))
- (cons "width" (if width (format "{%s}" width) ""))
- (cons "align" (if align (format "{%s}" align) ""))
- (cons "table"
- ;; only use \midrule if it looks like there are column headers
- (if (equal 'hline (second table))
- (concat (to-tab (list (first table)))
- "\n\\midrule\n"
- (to-tab (cddr table)))
- (to-tab table))))))
-#+end_src
-
-*** longtable
-This block can be used to wrap a table in the latex =longtable=
-environment, it takes the following arguments -- all but the first two
-are optional.
-| arg | description |
-|-----------+-------------------------------------------------------------|
-| table | a reference to the table |
-| align | optional alignment string |
-| width | optional width specification string |
-| hline | the string to use as hline separator, defaults to "\\hline" |
-| head | optional "head" string |
-| firsthead | optional "firsthead" string |
-| foot | optional "foot" string |
-| lastfoot | optional "lastfoot" string |
-
-#+srcname: longtable
-#+begin_src emacs-lisp :var table='((:table)) :var align='() :var width='() :var hline="\\hline" :var firsthead='() :var head='() :var foot='() :var lastfoot='() :noweb yes :results latex
- (org-fill-template
- "
- \\begin{longtable}%width%align
- %firsthead
- %head
- %foot
- %lastfoot
-
- %table
- \\end{longtable}\n"
- (list
- (cons "width" (if width (format "{%s}" width) ""))
- (cons "align" (if align (format "{%s}" align) ""))
- (cons "firsthead" (if firsthead (concat firsthead "\n\\endfirsthead\n") ""))
- (cons "head" (if head (concat head "\n\\endhead\n") ""))
- (cons "foot" (if foot (concat foot "\n\\endfoot\n") ""))
- (cons "lastfoot" (if lastfoot (concat lastfoot "\n\\endlastfoot\n") ""))
- (cons "table" (orgtbl-to-generic
- (mapcar (lambda (lis)
- (if (listp lis)
- (mapcar (lambda (el)
- (if (stringp el)
- el
- (format "%S" el))) lis)
- lis)) table)
- (list :lend " \\\\" :sep " & " :hline hline)))))
-#+end_src
-
-** Elegant lisp for transposing a matrix.
-
-#+tblname: transpose-example
-| 1 | 2 | 3 |
-| 4 | 5 | 6 |
-
-#+srcname: transpose
-#+begin_src emacs-lisp :var table=transpose-example
- (apply #'mapcar* #'list table)
-#+end_src
-
-#+resname:
-| 1 | 4 |
-| 2 | 5 |
-| 3 | 6 |
-
-* Misc
-#+srcname: python-identity(a=1)
-#+begin_src python
-a
-#+end_src
-#+srcname: python-add(a=1, b=2)
-#+begin_src python
-a + b
-#+end_src
-* GANTT Charts
-
-The =elispgantt= source block was sent to the mailing list by Eric
-Fraga. It was modified slightly by Tom Dye.
-
-#+source: elispgantt
-#+begin_src emacs-lisp :var table=gantttest
- (let ((dates "")
- (entries (nthcdr 2 table))
- (milestones "")
- (nmilestones 0)
- (ntasks 0)
- (projecttime 0)
- (tasks "")
- (xlength 1))
- (message "Initial: %s\n" table)
- (message "Entries: %s\n" entries)
- (while entries
- (let ((entry (first entries)))
- (if (listp entry)
- (let ((id (first entry))
- (type (nth 1 entry))
- (label (nth 2 entry))
- (task (nth 3 entry))
- (dependencies (nth 4 entry))
- (start (nth 5 entry))
- (duration (nth 6 entry))
- (end (nth 7 entry))
- (alignment (nth 8 entry)))
- (if (> start projecttime) (setq projecttime start))
- (if (string= type "task")
- (let ((end (+ start duration))
- (textposition (+ start (/ duration 2)))
- (flush ""))
- (if (string= alignment "left")
- (progn
- (setq textposition start)
- (setq flush "[left]"))
- (if (string= alignment "right")
- (progn
- (setq textposition end)
- (setq flush "[right]"))))
- (setq tasks
- (format "%s \\gantttask{%s}{%s}{%d}{%d}{%d}{%s}\n"
- tasks label task start end textposition flush))
- (setq ntasks (+ 1 ntasks))
- (if (> end projecttime)
- (setq projecttime end)))
- (if (string= type "milestone")
- (progn
- (setq milestones
- (format
- "%s \\ganttmilestone{$\\begin{array}{c}\\mbox{%s}\\\\ \\mbox{%s}\\end{array}$}{%d}\n"
- milestones label task start))
- (setq nmilestones (+ 1 nmilestones)))
- (if (string= type "date")
- (setq dates (format "%s \\ganttdateline{%s}{%d}\n"
- dates label start))
- (message "Ignoring entry with type %s\n" type)))))
- (message "Ignoring non-list entry %s\n" entry)) ; end if list entry
- (setq entries (cdr entries)))) ; end while entries left
- (format "\\pgfdeclarelayer{background}
- \\pgfdeclarelayer{foreground}
- \\pgfsetlayers{background,foreground}
- \\renewcommand{\\ganttprojecttime}{%d}
- \\renewcommand{\\ganttntasks}{%d}
- \\noindent
- \\begin{tikzpicture}[y=-0.75cm,x=0.75\\textwidth]
- \\begin{pgfonlayer}{background}
- \\draw[very thin, red!10!white] (0,1+\\ganttntasks) grid [ystep=0.75cm,xstep=1/\\ganttprojecttime] (1,0);
- \\draw[\\ganttdatelinecolour] (0,0) -- (1,0);
- \\draw[\\ganttdatelinecolour] (0,1+\\ganttntasks) -- (1,1+\\ganttntasks);
- \\end{pgfonlayer}
- %s
- %s
- %s
- \\end{tikzpicture}" projecttime ntasks tasks milestones dates))
-#+end_src
diff --git a/.emacs.d/org-7.4/contrib/lisp/.DS_Store b/.emacs.d/org-7.4/contrib/lisp/.DS_Store
deleted file mode 100644
index 5008ddf..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/contrib/lisp/htmlize.el b/.emacs.d/org-7.4/contrib/lisp/htmlize.el
deleted file mode 100644
index 5f4cb5b..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/htmlize.el
+++ /dev/null
@@ -1,1769 +0,0 @@
-;; htmlize.el -- Convert buffer text and decorations to HTML.
-
-;; Copyright (C) 1997,1998,1999,2000,2001,2002,2003,2005,2006,2009 Hrvoje Niksic
-
-;; Author: Hrvoje Niksic <hniksic@xemacs.org>
-;; Keywords: hypermedia, extensions
-
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with this program; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
-
-;;; Commentary:
-
-;; This package converts the buffer text and the associated
-;; decorations to HTML. Mail to <hniksic@xemacs.org> to discuss
-;; features and additions. All suggestions are more than welcome.
-
-;; To use this, just switch to the buffer you want HTML-ized and type
-;; `M-x htmlize-buffer'. You will be switched to a new buffer that
-;; contains the resulting HTML code. You can edit and inspect this
-;; buffer, or you can just save it with C-x C-w. `M-x htmlize-file'
-;; will find a file, fontify it, and save the HTML version in
-;; FILE.html, without any additional intervention. `M-x
-;; htmlize-many-files' allows you to htmlize any number of files in
-;; the same manner. `M-x htmlize-many-files-dired' does the same for
-;; files marked in a dired buffer.
-
-;; htmlize supports three types of HTML output, selected by setting
-;; `htmlize-output-type': `css', `inline-css', and `font'. In `css'
-;; mode, htmlize uses cascading style sheets to specify colors; it
-;; generates classes that correspond to Emacs faces and uses <span
-;; class=FACE>...</span> to color parts of text. In this mode, the
-;; produced HTML is valid under the 4.01 strict DTD, as confirmed by
-;; the W3C validator. `inline-css' is like `css', except the CSS is
-;; put directly in the STYLE attribute of the SPAN element, making it
-;; possible to paste the generated HTML to other documents. In `font'
-;; mode, htmlize uses <font color="...">...</font> to colorize HTML,
-;; which is not standard-compliant, but works better in older
-;; browsers. `css' mode is the default.
-
-;; You can also use htmlize from your Emacs Lisp code. When called
-;; non-interactively, `htmlize-buffer' and `htmlize-region' will
-;; return the resulting HTML buffer, but will not change current
-;; buffer or move the point.
-
-;; I tried to make the package elisp-compatible with multiple Emacsen,
-;; specifically aiming for XEmacs 19.14+ and GNU Emacs 19.34+. Please
-;; let me know if it doesn't work on some of those, and I'll try to
-;; fix it. I relied heavily on the presence of CL extensions,
-;; especially for cross-emacs compatibility; please don't try to
-;; remove that particular dependency. When byte-compiling under GNU
-;; Emacs, you're likely to get some warnings; just ignore them.
-
-;; The latest version should be available at:
-;;
-;; <http://fly.srk.fer.hr/~hniksic/emacs/htmlize.el>
-;;
-;; You can find a sample of htmlize's output (possibly generated with
-;; an older version) at:
-;;
-;; <http://fly.srk.fer.hr/~hniksic/emacs/htmlize.el.html>
-
-;; Thanks go to the multitudes of people who have sent reports and
-;; contributed comments, suggestions, and fixes. They include Ron
-;; Gut, Bob Weiner, Toni Drabik, Peter Breton, Thomas Vogels, Juri
-;; Linkov, Maciek Pasternacki, and many others.
-
-;; User quotes: "You sir, are a sick, sick, _sick_ person. :)"
-;; -- Bill Perry, author of Emacs/W3
-
-
-;;; Code:
-
-(require 'cl)
-(eval-when-compile
- (if (string-match "XEmacs" emacs-version)
- (byte-compiler-options
- (warnings (- unresolved))))
- (defvar font-lock-auto-fontify)
- (defvar font-lock-support-mode)
- (defvar global-font-lock-mode)
- (when (and (eq emacs-major-version 19)
- (not (string-match "XEmacs" emacs-version)))
- ;; Older versions of GNU Emacs fail to autoload cl-extra even when
- ;; `cl' is loaded.
- (load "cl-extra")))
-
-(defconst htmlize-version "1.36")
-
-;; Incantations to make custom stuff work without customize, e.g. on
-;; XEmacs 19.14 or GNU Emacs 19.34.
-(eval-and-compile
- (condition-case ()
- (require 'custom)
- (error nil))
- (if (and (featurep 'custom) (fboundp 'custom-declare-variable))
- nil ; we've got what we needed
- ;; No custom or obsolete custom, define surrogates. Define all
- ;; three macros, so we don't hose another library that expects
- ;; e.g. `defface' to work after (fboundp 'defcustom) succeeds.
- (defmacro defgroup (&rest ignored) nil)
- (defmacro defcustom (var value doc &rest ignored)
- `(defvar ,var ,value ,doc))
- (defmacro defface (face value doc &rest stuff)
- `(make-face ,face))))
-
-(defgroup htmlize nil
- "Convert buffer text and faces to HTML."
- :group 'hypermedia)
-
-(defcustom htmlize-head-tags ""
- "*Additional tags to insert within HEAD of the generated document."
- :type 'string
- :group 'htmlize)
-
-(defcustom htmlize-output-type 'css
- "*Output type of generated HTML, one of `css', `inline-css', or `font'.
-When set to `css' (the default), htmlize will generate a style sheet
-with description of faces, and use it in the HTML document, specifying
-the faces in the actual text with <span class=\"FACE\">.
-
-When set to `inline-css', the style will be generated as above, but
-placed directly in the STYLE attribute of the span ELEMENT: <span
-style=\"STYLE\">. This makes it easier to paste the resulting HTML to
-other documents.
-
-When set to `font', the properties will be set using layout tags
-<font>, <b>, <i>, <u>, and <strike>.
-
-`css' output is normally preferred, but `font' is still useful for
-supporting old, pre-CSS browsers, and both `inline-css' and `font' for
-easier embedding of colorized text in foreign HTML documents (no style
-sheet to carry around)."
- :type '(choice (const css) (const inline-css) (const font))
- :group 'htmlize)
-
-(defcustom htmlize-generate-hyperlinks t
- "*Non-nil means generate the hyperlinks for URLs and mail addresses.
-This is on by default; set it to nil if you don't want htmlize to
-insert hyperlinks in the resulting HTML. (In which case you can still
-do your own hyperlinkification from htmlize-after-hook.)"
- :type 'boolean
- :group 'htmlize)
-
-(defcustom htmlize-hyperlink-style "
- a {
- color: inherit;
- background-color: inherit;
- font: inherit;
- text-decoration: inherit;
- }
- a:hover {
- text-decoration: underline;
- }
-"
- "*The CSS style used for hyperlinks when in CSS mode."
- :type 'string
- :group 'htmlize)
-
-(defcustom htmlize-replace-form-feeds t
- "*Non-nil means replace form feeds in source code with HTML separators.
-Form feeds are the ^L characters at line beginnings that are sometimes
-used to separate sections of source code. If this variable is set to
-`t', form feed characters are replaced with the <hr> separator. If this
-is a string, it specifies the replacement to use. Note that <pre> is
-temporarily closed before the separator is inserted, so the default
-replacement is effectively \"</pre><hr /><pre>\". If you specify
-another replacement, don't forget to close and reopen the <pre> if you
-want the output to remain valid HTML.
-
-If you need more elaborate processing, set this to nil and use
-htmlize-after-hook."
- :type 'boolean
- :group 'htmlize)
-
-(defcustom htmlize-html-charset nil
- "*The charset declared by the resulting HTML documents.
-When non-nil, causes htmlize to insert the following in the HEAD section
-of the generated HTML:
-
- <meta http-equiv=\"Content-Type\" content=\"text/html; charset=CHARSET\">
-
-where CHARSET is the value you've set for htmlize-html-charset. Valid
-charsets are defined by MIME and include strings like \"iso-8859-1\",
-\"iso-8859-15\", \"utf-8\", etc.
-
-If you are using non-Latin-1 charsets, you might need to set this for
-your documents to render correctly. Also, the W3C validator requires
-submitted HTML documents to declare a charset. So if you care about
-validation, you can use this to prevent the validator from bitching.
-
-Needless to say, if you set this, you should actually make sure that
-the buffer is in the encoding you're claiming it is in. (Under Mule
-that is done by ensuring the correct \"file coding system\" for the
-buffer.) If you don't understand what that means, this option is
-probably not for you."
- :type '(choice (const :tag "Unset" nil)
- string)
- :group 'htmlize)
-
-(defcustom htmlize-convert-nonascii-to-entities (featurep 'mule)
- "*Whether non-ASCII characters should be converted to HTML entities.
-
-When this is non-nil, characters with codes in the 128-255 range will be
-considered Latin 1 and rewritten as \"&#CODE;\". Characters with codes
-above 255 will be converted to \"&#UCS;\", where UCS denotes the Unicode
-code point of the character. If the code point cannot be determined,
-the character will be copied unchanged, as would be the case if the
-option were nil.
-
-When the option is nil, the non-ASCII characters are copied to HTML
-without modification. In that case, the web server and/or the browser
-must be set to understand the encoding that was used when saving the
-buffer. (You might also want to specify it by setting
-`htmlize-html-charset'.)
-
-Note that in an HTML entity \"&#CODE;\", CODE is always a UCS code point,
-which has nothing to do with the charset the page is in. For example,
-\"&#169;\" *always* refers to the copyright symbol, regardless of charset
-specified by the META tag or the charset sent by the HTTP server. In
-other words, \"&#169;\" is exactly equivalent to \"&copy;\".
-
-By default, entity conversion is turned on for Mule-enabled Emacsen and
-turned off otherwise. This is because Mule knows the charset of
-non-ASCII characters in the buffer. A non-Mule Emacs cannot tell
-whether a character with code 0xA9 represents Latin 1 copyright symbol,
-Latin 2 \"S with caron\", or something else altogether. Setting this to
-t without Mule means asserting that 128-255 characters always mean Latin
-1.
-
-For most people htmlize will work fine with this option left at the
-default setting; don't change it unless you know what you're doing."
- :type 'sexp
- :group 'htmlize)
-
-(defcustom htmlize-ignore-face-size 'absolute
- "*Whether face size should be ignored when generating HTML.
-If this is nil, face sizes are used. If set to t, sizes are ignored
-If set to `absolute', only absolute size specifications are ignored.
-Please note that font sizes only work with CSS-based output types."
- :type '(choice (const :tag "Don't ignore" nil)
- (const :tag "Ignore all" t)
- (const :tag "Ignore absolute" absolute))
- :group 'htmlize)
-
-(defcustom htmlize-css-name-prefix ""
- "*The prefix used for CSS names.
-The CSS names that htmlize generates from face names are often too
-generic for CSS files; for example, `font-lock-type-face' is transformed
-to `type'. Use this variable to add a prefix to the generated names.
-The string \"htmlize-\" is an example of a reasonable prefix."
- :type 'string
- :group 'htmlize)
-
-(defcustom htmlize-use-rgb-txt t
- "*Whether `rgb.txt' should be used to convert color names to RGB.
-
-This conversion means determining, for instance, that the color
-\"IndianRed\" corresponds to the (205, 92, 92) RGB triple. `rgb.txt'
-is the X color database that maps hundreds of color names to such RGB
-triples. When this variable is non-nil, `htmlize' uses `rgb.txt' to
-look up color names.
-
-If this variable is nil, htmlize queries Emacs for RGB components of
-colors using `color-instance-rgb-components' and `x-color-values'.
-This can yield incorrect results on non-true-color displays.
-
-If the `rgb.txt' file is not found (which will be the case if you're
-running Emacs on non-X11 systems), this option is ignored."
- :type 'boolean
- :group 'htmlize)
-
-(defcustom htmlize-html-major-mode nil
- "The mode the newly created HTML buffer will be put in.
-Set this to nil if you prefer the default (fundamental) mode."
- :type '(radio (const :tag "No mode (fundamental)" nil)
- (function-item html-mode)
- (function :tag "User-defined major mode"))
- :group 'htmlize)
-
-(defvar htmlize-before-hook nil
- "Hook run before htmlizing a buffer.
-The hook functions are run in the source buffer (not the resulting HTML
-buffer).")
-
-(defvar htmlize-after-hook nil
- "Hook run after htmlizing a buffer.
-Unlike `htmlize-before-hook', these functions are run in the generated
-HTML buffer. You may use them to modify the outlook of the final HTML
-output.")
-
-(defvar htmlize-file-hook nil
- "Hook run by `htmlize-file' after htmlizing a file, but before saving it.")
-
-(defvar htmlize-buffer-places)
-
-;;; Some cross-Emacs compatibility.
-
-;; I try to conditionalize on features rather than Emacs version, but
-;; in some cases checking against the version *is* necessary.
-(defconst htmlize-running-xemacs (string-match "XEmacs" emacs-version))
-
-(eval-and-compile
- ;; save-current-buffer, with-current-buffer, and with-temp-buffer
- ;; are not available in 19.34 and in older XEmacsen. Strictly
- ;; speaking, we should stick to our own namespace and define and use
- ;; htmlize-save-current-buffer, etc. But non-standard special forms
- ;; are a pain because they're not properly fontified or indented and
- ;; because they look weird and ugly. So I'll just go ahead and
- ;; define the real ones if they're not available. If someone
- ;; convinces me that this breaks something, I'll switch to the
- ;; "htmlize-" namespace.
- (unless (fboundp 'save-current-buffer)
- (defmacro save-current-buffer (&rest forms)
- `(let ((__scb_current (current-buffer)))
- (unwind-protect
- (progn ,@forms)
- (set-buffer __scb_current)))))
- (unless (fboundp 'with-current-buffer)
- (defmacro with-current-buffer (buffer &rest forms)
- `(save-current-buffer (set-buffer ,buffer) ,@forms)))
- (unless (fboundp 'with-temp-buffer)
- (defmacro with-temp-buffer (&rest forms)
- (let ((temp-buffer (gensym "tb-")))
- `(let ((,temp-buffer
- (get-buffer-create (generate-new-buffer-name " *temp*"))))
- (unwind-protect
- (with-current-buffer ,temp-buffer
- ,@forms)
- (and (buffer-live-p ,temp-buffer)
- (kill-buffer ,temp-buffer))))))))
-
-;; We need a function that efficiently finds the next change of a
-;; property (usually `face'), preferably regardless of whether the
-;; change occurred because of a text property or an extent/overlay.
-;; As it turns out, it is not easy to do that compatibly.
-;;
-;; Under XEmacs, `next-single-property-change' does that. Under GNU
-;; Emacs beginning with version 21, `next-single-char-property-change'
-;; is available and does the same. GNU Emacs 20 had
-;; `next-char-property-change', which we can use. GNU Emacs 19 didn't
-;; provide any means for simultaneously examining overlays and text
-;; properties, so when using Emacs 19.34, we punt and fall back to
-;; `next-single-property-change', thus ignoring overlays altogether.
-
-(cond
- (htmlize-running-xemacs
- ;; XEmacs: good.
- (defun htmlize-next-change (pos prop &optional limit)
- (next-single-property-change pos prop nil (or limit (point-max)))))
- ((fboundp 'next-single-char-property-change)
- ;; GNU Emacs 21: good.
- (defun htmlize-next-change (pos prop &optional limit)
- (next-single-char-property-change pos prop nil limit)))
- ((fboundp 'next-char-property-change)
- ;; GNU Emacs 20: bad, but fixable.
- (defun htmlize-next-change (pos prop &optional limit)
- (let ((done nil)
- (current-value (get-char-property pos prop))
- newpos next-value)
- ;; Loop over positions returned by next-char-property-change
- ;; until the value of PROP changes or we've hit EOB.
- (while (not done)
- (setq newpos (next-char-property-change pos limit)
- next-value (get-char-property newpos prop))
- (cond ((eq newpos pos)
- ;; Possibly at EOB? Whatever, just don't infloop.
- (setq done t))
- ((eq next-value current-value)
- ;; PROP hasn't changed -- keep looping.
- )
- (t
- (setq done t)))
- (setq pos newpos))
- pos)))
- (t
- ;; GNU Emacs 19.34: hopeless, cannot properly support overlays.
- (defun htmlize-next-change (pos prop &optional limit)
- (unless limit
- (setq limit (point-max)))
- (let ((res (next-single-property-change pos prop)))
- (if (or (null res)
- (> res limit))
- limit
- res)))))
-
-;;; Transformation of buffer text: HTML escapes, untabification, etc.
-
-(defvar htmlize-basic-character-table
- ;; Map characters in the 0-127 range to either one-character strings
- ;; or to numeric entities.
- (let ((table (make-vector 128 ?\0)))
- ;; Map characters in the 32-126 range to themselves, others to
- ;; &#CODE entities;
- (dotimes (i 128)
- (setf (aref table i) (if (and (>= i 32) (<= i 126))
- (char-to-string i)
- (format "&#%d;" i))))
- ;; Set exceptions manually.
- (setf
- ;; Don't escape newline, carriage return, and TAB.
- (aref table ?\n) "\n"
- (aref table ?\r) "\r"
- (aref table ?\t) "\t"
- ;; Escape &, <, and >.
- (aref table ?&) "&amp;"
- (aref table ?<) "&lt;"
- (aref table ?>) "&gt;"
- ;; Not escaping '"' buys us a measurable speedup. It's only
- ;; necessary to quote it for strings used in attribute values,
- ;; which htmlize doesn't do.
- ;(aref table ?\") "&quot;"
- )
- table))
-
-;; A cache of HTML representation of non-ASCII characters. Depending
-;; on availability of `encode-char' and the setting of
-;; `htmlize-convert-nonascii-to-entities', this maps non-ASCII
-;; characters to either "&#<code>;" or "<char>" (mapconcat's mapper
-;; must always return strings). It's only filled as characters are
-;; encountered, so that in a buffer with e.g. French text, it will
-;; only ever contain French accented characters as keys. It's cleared
-;; on each entry to htmlize-buffer-1 to allow modifications of
-;; `htmlize-convert-nonascii-to-entities' to take effect.
-(defvar htmlize-extended-character-cache (make-hash-table :test 'eq))
-
-(defun htmlize-protect-string (string)
- "HTML-protect string, escaping HTML metacharacters and I18N chars."
- ;; Only protecting strings that actually contain unsafe or non-ASCII
- ;; chars removes a lot of unnecessary funcalls and consing.
- (if (not (string-match "[^\r\n\t -%'-;=?-~]" string))
- string
- (mapconcat (lambda (char)
- (cond
- ((< char 128)
- ;; ASCII: use htmlize-basic-character-table.
- (aref htmlize-basic-character-table char))
- ((gethash char htmlize-extended-character-cache)
- ;; We've already seen this char; return the cached
- ;; string.
- )
- ((not htmlize-convert-nonascii-to-entities)
- ;; If conversion to entities is not desired, always
- ;; copy the char literally.
- (setf (gethash char htmlize-extended-character-cache)
- (char-to-string char)))
- ((< char 256)
- ;; Latin 1: no need to call encode-char.
- (setf (gethash char htmlize-extended-character-cache)
- (format "&#%d;" char)))
- ((and (fboundp 'encode-char)
- ;; Must check if encode-char works for CHAR;
- ;; it fails for Arabic and possibly elsewhere.
- (encode-char char 'ucs))
- (setf (gethash char htmlize-extended-character-cache)
- (format "&#%d;" (encode-char char 'ucs))))
- (t
- ;; encode-char doesn't work for this char. Copy it
- ;; unchanged and hope for the best.
- (setf (gethash char htmlize-extended-character-cache)
- (char-to-string char)))))
- string "")))
-
-(defconst htmlize-ellipsis "...")
-(put-text-property 0 (length htmlize-ellipsis) 'htmlize-ellipsis t htmlize-ellipsis)
-
-(defun htmlize-buffer-substring-no-invisible (beg end)
- ;; Like buffer-substring-no-properties, but don't copy invisible
- ;; parts of the region. Where buffer-substring-no-properties
- ;; mandates an ellipsis to be shown, htmlize-ellipsis is inserted.
- (let ((pos beg)
- visible-list invisible show next-change)
- ;; Iterate over the changes in the `invisible' property and filter
- ;; out the portions where it's non-nil, i.e. where the text is
- ;; invisible.
- (while (< pos end)
- (setq invisible (get-char-property pos 'invisible)
- next-change (htmlize-next-change pos 'invisible end))
- (if (not (listp buffer-invisibility-spec))
- ;; If buffer-invisibility-spec is not a list, then all
- ;; characters with non-nil `invisible' property are visible.
- (setq show (not invisible))
- ;; Otherwise, the value of a non-nil `invisible' property can be:
- ;; 1. a symbol -- make the text invisible if it matches
- ;; buffer-invisibility-spec.
- ;; 2. a list of symbols -- make the text invisible if
- ;; any symbol in the list matches
- ;; buffer-invisibility-spec.
- ;; If the match of buffer-invisibility-spec has a non-nil
- ;; CDR, replace the invisible text with an ellipsis.
- (let (match)
- (if (symbolp invisible)
- (setq match (member* invisible buffer-invisibility-spec
- :key (lambda (i)
- (if (symbolp i) i (car i)))))
- (setq match (block nil
- (dolist (elem invisible)
- (let ((m (member*
- elem buffer-invisibility-spec
- :key (lambda (i)
- (if (symbolp i) i (car i))))))
- (when m (return m))))
- nil)))
- (setq show (cond ((null match) t)
- ((and (cdr-safe (car match))
- ;; Conflate successive ellipses.
- (not (eq show htmlize-ellipsis)))
- htmlize-ellipsis)
- (t nil)))))
- (cond ((eq show t)
- (push (buffer-substring-no-properties pos next-change) visible-list))
- ((stringp show)
- (push show visible-list)))
- (setq pos next-change))
- (if (= (length visible-list) 1)
- ;; If VISIBLE-LIST consists of only one element, return it
- ;; without concatenation. This avoids additional consing in
- ;; regions without any invisible text.
- (car visible-list)
- (apply #'concat (nreverse visible-list)))))
-
-(defun htmlize-trim-ellipsis (text)
- ;; Remove htmlize-ellipses ("...") from the beginning of TEXT if it
- ;; starts with it. It checks for the special property of the
- ;; ellipsis so it doesn't work on ordinary text that begins with
- ;; "...".
- (if (get-text-property 0 'htmlize-ellipsis text)
- (substring text (length htmlize-ellipsis))
- text))
-
-(defconst htmlize-tab-spaces
- ;; A table of strings with spaces. (aref htmlize-tab-spaces 5) is
- ;; like (make-string 5 ?\ ), except it doesn't cons.
- (let ((v (make-vector 32 nil)))
- (dotimes (i (length v))
- (setf (aref v i) (make-string i ?\ )))
- v))
-
-(defun htmlize-untabify (text start-column)
- "Untabify TEXT, assuming it starts at START-COLUMN."
- (let ((column start-column)
- (last-match 0)
- (chunk-start 0)
- chunks match-pos tab-size)
- (while (string-match "[\t\n]" text last-match)
- (setq match-pos (match-beginning 0))
- (cond ((eq (aref text match-pos) ?\t)
- ;; Encountered a tab: create a chunk of text followed by
- ;; the expanded tab.
- (push (substring text chunk-start match-pos) chunks)
- ;; Increase COLUMN by the length of the text we've
- ;; skipped since last tab or newline. (Encountering
- ;; newline resets it.)
- (incf column (- match-pos last-match))
- ;; Calculate tab size based on tab-width and COLUMN.
- (setq tab-size (- tab-width (% column tab-width)))
- ;; Expand the tab.
- (push (aref htmlize-tab-spaces tab-size) chunks)
- (incf column tab-size)
- (setq chunk-start (1+ match-pos)))
- (t
- ;; Reset COLUMN at beginning of line.
- (setq column 0)))
- (setq last-match (1+ match-pos)))
- ;; If no chunks have been allocated, it means there have been no
- ;; tabs to expand. Return TEXT unmodified.
- (if (null chunks)
- text
- (when (< chunk-start (length text))
- ;; Push the remaining chunk.
- (push (substring text chunk-start) chunks))
- ;; Generate the output from the available chunks.
- (apply #'concat (nreverse chunks)))))
-
-(defun htmlize-despam-address (string)
- "Replace every occurrence of '@' in STRING with &#64;.
-`htmlize-make-hyperlinks' uses this to spam-protect mailto links
-without modifying their meaning."
- ;; Suggested by Ville Skytta.
- (while (string-match "@" string)
- (setq string (replace-match "&#64;" nil t string)))
- string)
-
-(defun htmlize-make-hyperlinks ()
- "Make hyperlinks in HTML."
- ;; Function originally submitted by Ville Skytta. Rewritten by
- ;; Hrvoje Niksic, then modified by Ville Skytta and Hrvoje Niksic.
- (goto-char (point-min))
- (while (re-search-forward
- "&lt;\\(\\(mailto:\\)?\\([-=+_.a-zA-Z0-9]+@[-_.a-zA-Z0-9]+\\)\\)&gt;"
- nil t)
- (let ((address (match-string 3))
- (link-text (match-string 1)))
- (delete-region (match-beginning 0) (match-end 0))
- (insert "&lt;<a href=\"mailto:"
- (htmlize-despam-address address)
- "\">"
- (htmlize-despam-address link-text)
- "</a>&gt;")))
- (goto-char (point-min))
- (while (re-search-forward "&lt;\\(\\(URL:\\)?\\([a-zA-Z]+://[^;]+\\)\\)&gt;"
- nil t)
- (let ((url (match-string 3))
- (link-text (match-string 1)))
- (delete-region (match-beginning 0) (match-end 0))
- (insert "&lt;<a href=\"" url "\">" link-text "</a>&gt;"))))
-
-;; Tests for htmlize-make-hyperlinks:
-
-;; <mailto:hniksic@xemacs.org>
-;; <http://fly.srk.fer.hr>
-;; <URL:http://www.xemacs.org>
-;; <http://www.mail-archive.com/bbdb-info@xemacs.org/>
-;; <hniksic@xemacs.org>
-;; <xalan-dev-sc.10148567319.hacuhiucknfgmpfnjcpg-john=doe.com@xml.apache.org>
-
-(defun htmlize-defang-local-variables ()
- ;; Juri Linkov reports that an HTML-ized "Local variables" can lead
- ;; visiting the HTML to fail with "Local variables list is not
- ;; properly terminated". He suggested changing the phrase to
- ;; syntactically equivalent HTML that Emacs doesn't recognize.
- (goto-char (point-min))
- (while (search-forward "Local Variables:" nil t)
- (replace-match "Local Variables&#58;" nil t)))
-
-
-;;; Color handling.
-
-(if (fboundp 'locate-file)
- (defalias 'htmlize-locate-file 'locate-file)
- (defun htmlize-locate-file (file path)
- (dolist (dir path nil)
- (when (file-exists-p (expand-file-name file dir))
- (return (expand-file-name file dir))))))
-
-(defvar htmlize-x-library-search-path
- '("/usr/X11R6/lib/X11/"
- "/usr/X11R5/lib/X11/"
- "/usr/lib/X11R6/X11/"
- "/usr/lib/X11R5/X11/"
- "/usr/local/X11R6/lib/X11/"
- "/usr/local/X11R5/lib/X11/"
- "/usr/local/lib/X11R6/X11/"
- "/usr/local/lib/X11R5/X11/"
- "/usr/X11/lib/X11/"
- "/usr/lib/X11/"
- "/usr/local/lib/X11/"
- "/usr/X386/lib/X11/"
- "/usr/x386/lib/X11/"
- "/usr/XFree86/lib/X11/"
- "/usr/unsupported/lib/X11/"
- "/usr/athena/lib/X11/"
- "/usr/local/x11r5/lib/X11/"
- "/usr/lpp/Xamples/lib/X11/"
- "/usr/openwin/lib/X11/"
- "/usr/openwin/share/lib/X11/"))
-
-(defun htmlize-get-color-rgb-hash (&optional rgb-file)
- "Return a hash table mapping X color names to RGB values.
-The keys in the hash table are X11 color names, and the values are the
-#rrggbb RGB specifications, extracted from `rgb.txt'.
-
-If RGB-FILE is nil, the function will try hard to find a suitable file
-in the system directories.
-
-If no rgb.txt file is found, return nil."
- (let ((rgb-file (or rgb-file (htmlize-locate-file
- "rgb.txt"
- htmlize-x-library-search-path)))
- (hash nil))
- (when rgb-file
- (with-temp-buffer
- (insert-file-contents rgb-file)
- (setq hash (make-hash-table :test 'equal))
- (while (not (eobp))
- (cond ((looking-at "^\\s-*\\([!#]\\|$\\)")
- ;; Skip comments and empty lines.
- )
- ((looking-at
- "[ \t]*\\([0-9]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\(.*\\)")
- (setf (gethash (downcase (match-string 4)) hash)
- (format "#%02x%02x%02x"
- (string-to-number (match-string 1))
- (string-to-number (match-string 2))
- (string-to-number (match-string 3)))))
- (t
- (error
- "Unrecognized line in %s: %s"
- rgb-file
- (buffer-substring (point) (progn (end-of-line) (point))))))
- (forward-line 1))))
- hash))
-
-;; Compile the RGB map when loaded. On systems where rgb.txt is
-;; missing, the value of the variable will be nil, and rgb.txt will
-;; not be used.
-(defvar htmlize-color-rgb-hash (htmlize-get-color-rgb-hash))
-
-;;; Face handling.
-
-(defun htmlize-face-specifies-property (face prop)
- ;; Return t if face specifies PROP, as opposed to it being inherited
- ;; from the default face. The problem with e.g.
- ;; `face-foreground-instance' is that it returns an instance for
- ;; EVERY face because every face inherits from the default face.
- ;; However, we'd like htmlize-face-{fore,back}ground to return nil
- ;; when called with a face that doesn't specify its own foreground
- ;; or background.
- (or (eq face 'default)
- (assq 'global (specifier-spec-list (face-property face prop)))))
-
-(defun htmlize-face-color-internal (face fg)
- ;; Used only under GNU Emacs. Return the color of FACE, but don't
- ;; return "unspecified-fg" or "unspecified-bg". If the face is
- ;; `default' and the color is unspecified, look up the color in
- ;; frame parameters.
- (let* ((function (if fg #'face-foreground #'face-background))
- color)
- (if (>= emacs-major-version 22)
- ;; For GNU Emacs 22+ set INHERIT to get the inherited values.
- (setq color (funcall function face nil t))
- (setq color (funcall function face))
- ;; For GNU Emacs 21 (which has `face-attribute'): if the color
- ;; is nil, recursively check for the face's parent.
- (when (and (null color)
- (fboundp 'face-attribute)
- (face-attribute face :inherit)
- (not (eq (face-attribute face :inherit) 'unspecified)))
- (setq color (htmlize-face-color-internal
- (face-attribute face :inherit) fg))))
- (when (and (eq face 'default) (null color))
- (setq color (cdr (assq (if fg 'foreground-color 'background-color)
- (frame-parameters)))))
- (when (or (eq color 'unspecified)
- (equal color "unspecified-fg")
- (equal color "unspecified-bg"))
- (setq color nil))
- (when (and (eq face 'default)
- (null color))
- ;; Assuming black on white doesn't seem right, but I can't think
- ;; of anything better to do.
- (setq color (if fg "black" "white")))
- color))
-
-(defun htmlize-face-foreground (face)
- ;; Return the name of the foreground color of FACE. If FACE does
- ;; not specify a foreground color, return nil.
- (cond (htmlize-running-xemacs
- ;; XEmacs.
- (and (htmlize-face-specifies-property face 'foreground)
- (color-instance-name (face-foreground-instance face))))
- (t
- ;; GNU Emacs.
- (htmlize-face-color-internal face t))))
-
-(defun htmlize-face-background (face)
- ;; Return the name of the background color of FACE. If FACE does
- ;; not specify a background color, return nil.
- (cond (htmlize-running-xemacs
- ;; XEmacs.
- (and (htmlize-face-specifies-property face 'background)
- (color-instance-name (face-background-instance face))))
- (t
- ;; GNU Emacs.
- (htmlize-face-color-internal face nil))))
-
-;; Convert COLOR to the #RRGGBB string. If COLOR is already in that
-;; format, it's left unchanged.
-
-(defun htmlize-color-to-rgb (color)
- (let ((rgb-string nil))
- (cond ((null color)
- ;; Ignore nil COLOR because it means that the face is not
- ;; specifying any color. Hence (htmlize-color-to-rgb nil)
- ;; returns nil.
- )
- ((string-match "\\`#" color)
- ;; The color is already in #rrggbb format.
- (setq rgb-string color))
- ((and htmlize-use-rgb-txt
- htmlize-color-rgb-hash)
- ;; Use of rgb.txt is requested, and it's available on the
- ;; system. Use it.
- (setq rgb-string (gethash (downcase color) htmlize-color-rgb-hash)))
- (t
- ;; We're getting the RGB components from Emacs.
- (let ((rgb
- ;; Here I cannot conditionalize on (fboundp ...)
- ;; because ps-print under some versions of GNU Emacs
- ;; defines its own dummy version of
- ;; `color-instance-rgb-components'.
- (if htmlize-running-xemacs
- (mapcar (lambda (arg)
- (/ arg 256))
- (color-instance-rgb-components
- (make-color-instance color)))
- (mapcar (lambda (arg)
- (/ arg 256))
- (x-color-values color)))))
- (when rgb
- (setq rgb-string (apply #'format "#%02x%02x%02x" rgb))))))
- ;; If RGB-STRING is still nil, it means the color cannot be found,
- ;; for whatever reason. In that case just punt and return COLOR.
- ;; Most browsers support a decent set of color names anyway.
- (or rgb-string color)))
-
-;; We store the face properties we care about into an
-;; `htmlize-fstruct' type. That way we only have to analyze face
-;; properties, which can be time consuming, once per each face. The
-;; mapping between Emacs faces and htmlize-fstructs is established by
-;; htmlize-make-face-map. The name "fstruct" refers to variables of
-;; type `htmlize-fstruct', while the term "face" is reserved for Emacs
-;; faces.
-
-(defstruct htmlize-fstruct
- foreground ; foreground color, #rrggbb
- background ; background color, #rrggbb
- size ; size
- boldp ; whether face is bold
- italicp ; whether face is italic
- underlinep ; whether face is underlined
- overlinep ; whether face is overlined
- strikep ; whether face is struck through
- css-name ; CSS name of face
- )
-
-(defun htmlize-face-emacs21-attr (fstruct attr value)
- ;; For ATTR and VALUE, set the equivalent value in FSTRUCT.
- (case attr
- (:foreground
- (setf (htmlize-fstruct-foreground fstruct) (htmlize-color-to-rgb value)))
- (:background
- (setf (htmlize-fstruct-background fstruct) (htmlize-color-to-rgb value)))
- (:height
- (setf (htmlize-fstruct-size fstruct) value))
- (:weight
- (when (string-match (symbol-name value) "bold")
- (setf (htmlize-fstruct-boldp fstruct) t)))
- (:slant
- (setf (htmlize-fstruct-italicp fstruct) (or (eq value 'italic)
- (eq value 'oblique))))
- (:bold
- (setf (htmlize-fstruct-boldp fstruct) value))
- (:italic
- (setf (htmlize-fstruct-italicp fstruct) value))
- (:underline
- (setf (htmlize-fstruct-underlinep fstruct) value))
- (:overline
- (setf (htmlize-fstruct-overlinep fstruct) value))
- (:strike-through
- (setf (htmlize-fstruct-strikep fstruct) value))))
-
-(defun htmlize-face-size (face)
- ;; The size (height) of FACE, taking inheritance into account.
- ;; Only works in Emacs 21 and later.
- (let ((size-list
- (loop
- for f = face then (ignore-errors (face-attribute f :inherit)) ;?????
- until (or (not f) (eq f 'unspecified))
- for h = (ignore-errors (face-attribute f :height)) ;???????
- collect (if (eq h 'unspecified) nil h))))
- (reduce 'htmlize-merge-size (cons nil size-list))))
-
-(defun htmlize-face-to-fstruct (face)
- "Convert Emacs face FACE to fstruct."
- (let ((fstruct (make-htmlize-fstruct
- :foreground (htmlize-color-to-rgb
- (htmlize-face-foreground face))
- :background (htmlize-color-to-rgb
- (htmlize-face-background face)))))
- (cond (htmlize-running-xemacs
- ;; XEmacs doesn't provide a way to detect whether a face is
- ;; bold or italic, so we need to examine the font instance.
- ;; #### This probably doesn't work under MS Windows and/or
- ;; GTK devices. I'll need help with those.
- (let* ((font-instance (face-font-instance face))
- (props (font-instance-properties font-instance)))
- (when (equalp (cdr (assq 'WEIGHT_NAME props)) "bold")
- (setf (htmlize-fstruct-boldp fstruct) t))
- (when (or (equalp (cdr (assq 'SLANT props)) "i")
- (equalp (cdr (assq 'SLANT props)) "o"))
- (setf (htmlize-fstruct-italicp fstruct) t))
- (setf (htmlize-fstruct-strikep fstruct)
- (face-strikethru-p face))
- (setf (htmlize-fstruct-underlinep fstruct)
- (face-underline-p face))))
- ((fboundp 'face-attribute)
- ;; GNU Emacs 21 and further.
- (dolist (attr '(:weight :slant :underline :overline :strike-through))
- (let ((value (if (>= emacs-major-version 22)
- ;; Use the INHERIT arg in GNU Emacs 22.
- (face-attribute face attr nil t)
- ;; Otherwise, fake it.
- (let ((face face))
- (while (and (eq (face-attribute face attr)
- 'unspecified)
- (not (eq (face-attribute face :inherit)
- 'unspecified)))
- (setq face (face-attribute face :inherit)))
- (face-attribute face attr)))))
- (when (and value (not (eq value 'unspecified)))
- (htmlize-face-emacs21-attr fstruct attr value))))
- (let ((size (htmlize-face-size face)))
- (unless (eql size 1.0) ; ignore non-spec
- (setf (htmlize-fstruct-size fstruct) size))))
- (t
- ;; Older GNU Emacs. Some of these functions are only
- ;; available under Emacs 20+, hence the guards.
- (when (fboundp 'face-bold-p)
- (setf (htmlize-fstruct-boldp fstruct) (face-bold-p face)))
- (when (fboundp 'face-italic-p)
- (setf (htmlize-fstruct-italicp fstruct) (face-italic-p face)))
- (setf (htmlize-fstruct-underlinep fstruct)
- (face-underline-p face))))
- ;; Generate the css-name property. Emacs places no restrictions
- ;; on the names of symbols that represent faces -- any characters
- ;; may be in the name, even ^@. We try hard to beat the face name
- ;; into shape, both esthetically and according to CSS1 specs.
- (setf (htmlize-fstruct-css-name fstruct)
- (let ((name (downcase (symbol-name face))))
- (when (string-match "\\`font-lock-" name)
- ;; Change font-lock-FOO-face to FOO.
- (setq name (replace-match "" t t name)))
- (when (string-match "-face\\'" name)
- ;; Drop the redundant "-face" suffix.
- (setq name (replace-match "" t t name)))
- (while (string-match "[^-a-zA-Z0-9]" name)
- ;; Drop the non-alphanumerics.
- (setq name (replace-match "X" t t name)))
- (when (string-match "\\`[-0-9]" name)
- ;; CSS identifiers may not start with a digit.
- (setq name (concat "X" name)))
- ;; After these transformations, the face could come
- ;; out empty.
- (when (equal name "")
- (setq name "face"))
- ;; Apply the prefix.
- (setq name (concat htmlize-css-name-prefix name))
- name))
- fstruct))
-
-(defmacro htmlize-copy-attr-if-set (attr-list dest source)
- ;; Expand the code of the type
- ;; (and (htmlize-fstruct-ATTR source)
- ;; (setf (htmlize-fstruct-ATTR dest) (htmlize-fstruct-ATTR source)))
- ;; for the given list of boolean attributes.
- (cons 'progn
- (loop for attr in attr-list
- for attr-sym = (intern (format "htmlize-fstruct-%s" attr))
- collect `(and (,attr-sym ,source)
- (setf (,attr-sym ,dest) (,attr-sym ,source))))))
-
-(defun htmlize-merge-size (merged next)
- ;; Calculate the size of the merge of MERGED and NEXT.
- (cond ((null merged) next)
- ((integerp next) next)
- ((null next) merged)
- ((floatp merged) (* merged next))
- ((integerp merged) (round (* merged next)))))
-
-(defun htmlize-merge-two-faces (merged next)
- (htmlize-copy-attr-if-set
- (foreground background boldp italicp underlinep overlinep strikep)
- merged next)
- (setf (htmlize-fstruct-size merged)
- (htmlize-merge-size (htmlize-fstruct-size merged)
- (htmlize-fstruct-size next)))
- merged)
-
-(defun htmlize-merge-faces (fstruct-list)
- (cond ((null fstruct-list)
- ;; Nothing to do, return a dummy face.
- (make-htmlize-fstruct))
- ((null (cdr fstruct-list))
- ;; Optimize for the common case of a single face, simply
- ;; return it.
- (car fstruct-list))
- (t
- (reduce #'htmlize-merge-two-faces
- (cons (make-htmlize-fstruct) fstruct-list)))))
-
-;; GNU Emacs 20+ supports attribute lists in `face' properties. For
-;; example, you can use `(:foreground "red" :weight bold)' as an
-;; overlay's "face", or you can even use a list of such lists, etc.
-;; We call those "attrlists".
-;;
-;; htmlize supports attrlist by converting them to fstructs, the same
-;; as with regular faces.
-
-(defun htmlize-attrlist-to-fstruct (attrlist)
- ;; Like htmlize-face-to-fstruct, but accepts an ATTRLIST as input.
- (let ((fstruct (make-htmlize-fstruct)))
- (cond ((eq (car attrlist) 'foreground-color)
- ;; ATTRLIST is (foreground-color . COLOR)
- (setf (htmlize-fstruct-foreground fstruct)
- (htmlize-color-to-rgb (cdr attrlist))))
- ((eq (car attrlist) 'background-color)
- ;; ATTRLIST is (background-color . COLOR)
- (setf (htmlize-fstruct-background fstruct)
- (htmlize-color-to-rgb (cdr attrlist))))
- (t
- ;; ATTRLIST is a plist.
- (while attrlist
- (let ((attr (pop attrlist))
- (value (pop attrlist)))
- (when (and value (not (eq value 'unspecified)))
- (htmlize-face-emacs21-attr fstruct attr value))))))
- (setf (htmlize-fstruct-css-name fstruct) "ATTRLIST")
- fstruct))
-
-(defun htmlize-face-list-p (face-prop)
- "Return non-nil if FACE-PROP is a list of faces, nil otherwise."
- ;; If not for attrlists, this would return (listp face-prop). This
- ;; way we have to be more careful because attrlist is also a list!
- (cond
- ((eq face-prop nil)
- ;; FACE-PROP being nil means empty list (no face), so return t.
- t)
- ((symbolp face-prop)
- ;; A symbol other than nil means that it's only one face, so return
- ;; nil.
- nil)
- ((not (consp face-prop))
- ;; Huh? Not a symbol or cons -- treat it as a single element.
- nil)
- (t
- ;; We know that FACE-PROP is a cons: check whether it looks like an
- ;; ATTRLIST.
- (let* ((car (car face-prop))
- (attrlist-p (and (symbolp car)
- (or (eq car 'foreground-color)
- (eq car 'background-color)
- (eq (aref (symbol-name car) 0) ?:)))))
- ;; If FACE-PROP is not an ATTRLIST, it means it's a list of
- ;; faces.
- (not attrlist-p)))))
-
-(defun htmlize-make-face-map (faces)
- ;; Return a hash table mapping Emacs faces to htmlize's fstructs.
- ;; The keys are either face symbols or attrlists, so the test
- ;; function must be `equal'.
- (let ((face-map (make-hash-table :test 'equal))
- css-names)
- (dolist (face faces)
- (unless (gethash face face-map)
- ;; Haven't seen FACE yet; convert it to an fstruct and cache
- ;; it.
- (let ((fstruct (if (symbolp face)
- (htmlize-face-to-fstruct face)
- (htmlize-attrlist-to-fstruct face))))
- (setf (gethash face face-map) fstruct)
- (let* ((css-name (htmlize-fstruct-css-name fstruct))
- (new-name css-name)
- (i 0))
- ;; Uniquify the face's css-name by using NAME-1, NAME-2,
- ;; etc.
- (while (member new-name css-names)
- (setq new-name (format "%s-%s" css-name (incf i))))
- (unless (equal new-name css-name)
- (setf (htmlize-fstruct-css-name fstruct) new-name))
- (push new-name css-names)))))
- face-map))
-
-(defun htmlize-unstringify-face (face)
- "If FACE is a string, return it interned, otherwise return it unchanged."
- (if (stringp face)
- (intern face)
- face))
-
-(defun htmlize-faces-in-buffer ()
- "Return a list of faces used in the current buffer.
-Under XEmacs, this returns the set of faces specified by the extents
-with the `face' property. (This covers text properties as well.) Under
-GNU Emacs, it returns the set of faces specified by the `face' text
-property and by buffer overlays that specify `face'."
- (let (faces)
- ;; Testing for (fboundp 'map-extents) doesn't work because W3
- ;; defines `map-extents' under FSF.
- (if htmlize-running-xemacs
- (let (face-prop)
- (map-extents (lambda (extent ignored)
- (setq face-prop (extent-face extent)
- ;; FACE-PROP can be a face or a list of
- ;; faces.
- faces (if (listp face-prop)
- (union face-prop faces)
- (adjoin face-prop faces)))
- nil)
- nil
- ;; Specify endpoints explicitly to respect
- ;; narrowing.
- (point-min) (point-max) nil nil 'face))
- ;; FSF Emacs code.
- ;; Faces used by text properties.
- (let ((pos (point-min)) face-prop next)
- (while (< pos (point-max))
- (setq face-prop (get-text-property pos 'face)
- next (or (next-single-property-change pos 'face) (point-max)))
- ;; FACE-PROP can be a face/attrlist or a list thereof.
- (setq faces (if (htmlize-face-list-p face-prop)
- (nunion (mapcar #'htmlize-unstringify-face face-prop)
- faces :test 'equal)
- (adjoin (htmlize-unstringify-face face-prop)
- faces :test 'equal)))
- (setq pos next)))
- ;; Faces used by overlays.
- (dolist (overlay (overlays-in (point-min) (point-max)))
- (let ((face-prop (overlay-get overlay 'face)))
- ;; FACE-PROP can be a face/attrlist or a list thereof.
- (setq faces (if (htmlize-face-list-p face-prop)
- (nunion (mapcar #'htmlize-unstringify-face face-prop)
- faces :test 'equal)
- (adjoin (htmlize-unstringify-face face-prop)
- faces :test 'equal))))))
- faces))
-
-;; htmlize-faces-at-point returns the faces in use at point. The
-;; faces are sorted by increasing priority, i.e. the last face takes
-;; precedence.
-;;
-;; Under XEmacs, this returns all the faces in all the extents at
-;; point. Under GNU Emacs, this returns all the faces in the `face'
-;; property and all the faces in the overlays at point.
-
-(cond (htmlize-running-xemacs
- (defun htmlize-faces-at-point ()
- (let (extent extent-list face-list face-prop)
- (while (setq extent (extent-at (point) nil 'face extent))
- (push extent extent-list))
- ;; extent-list is in reverse display order, meaning that
- ;; smallest ones come last. That is the order we want,
- ;; except it can be overridden by the `priority' property.
- (setq extent-list (stable-sort extent-list #'<
- :key #'extent-priority))
- (dolist (extent extent-list)
- (setq face-prop (extent-face extent))
- ;; extent's face-list is in reverse order from what we
- ;; want, but the `nreverse' below will take care of it.
- (setq face-list (if (listp face-prop)
- (append face-prop face-list)
- (cons face-prop face-list))))
- (nreverse face-list))))
- (t
- (defun htmlize-faces-at-point ()
- (let (all-faces)
- ;; Faces from text properties.
- (let ((face-prop (get-text-property (point) 'face)))
- (setq all-faces (if (htmlize-face-list-p face-prop)
- (nreverse (mapcar #'htmlize-unstringify-face
- face-prop))
- (list (htmlize-unstringify-face face-prop)))))
- ;; Faces from overlays.
- (let ((overlays
- ;; Collect overlays at point that specify `face'.
- (delete-if-not (lambda (o)
- (overlay-get o 'face))
- (overlays-at (point))))
- list face-prop)
- ;; Sort the overlays so the smaller (more specific) ones
- ;; come later. The number of overlays at each one
- ;; position should be very small, so the sort shouldn't
- ;; slow things down.
- (setq overlays (sort* overlays
- ;; Sort by ascending...
- #'<
- ;; ...overlay size.
- :key (lambda (o)
- (- (overlay-end o)
- (overlay-start o)))))
- ;; Overlay priorities, if present, override the above
- ;; established order. Larger overlay priority takes
- ;; precedence and therefore comes later in the list.
- (setq overlays (stable-sort
- overlays
- ;; Reorder (stably) by acending...
- #'<
- ;; ...overlay priority.
- :key (lambda (o)
- (or (overlay-get o 'priority) 0))))
- (dolist (overlay overlays)
- (setq face-prop (overlay-get overlay 'face))
- (setq list (if (htmlize-face-list-p face-prop)
- (nconc (nreverse (mapcar
- #'htmlize-unstringify-face
- face-prop))
- list)
- (cons (htmlize-unstringify-face face-prop) list))))
- ;; Under "Merging Faces" the manual explicitly states
- ;; that faces specified by overlays take precedence over
- ;; faces specified by text properties.
- (setq all-faces (nconc all-faces list)))
- all-faces))))
-
-;; htmlize supports generating HTML in two several fundamentally
-;; different ways, one with the use of CSS and nested <span> tags, and
-;; the other with the use of the old <font> tags. Rather than adding
-;; a bunch of ifs to many places, we take a semi-OO approach.
-;; `htmlize-buffer-1' calls a number of "methods", which indirect to
-;; the functions that depend on `htmlize-output-type'. The currently
-;; used methods are `doctype', `insert-head', `body-tag', and
-;; `insert-text'. Not all output types define all methods.
-;;
-;; Methods are called either with (htmlize-method METHOD ARGS...)
-;; special form, or by accessing the function with
-;; (htmlize-method-function 'METHOD) and calling (funcall FUNCTION).
-;; The latter form is useful in tight loops because `htmlize-method'
-;; conses.
-;;
-;; Currently defined output types are `css' and `font'.
-
-(defmacro htmlize-method (method &rest args)
- ;; Expand to (htmlize-TYPE-METHOD ...ARGS...). TYPE is the value of
- ;; `htmlize-output-type' at run time.
- `(funcall (htmlize-method-function ',method) ,@args))
-
-(defun htmlize-method-function (method)
- ;; Return METHOD's function definition for the current output type.
- ;; The returned object can be safely funcalled.
- (let ((sym (intern (format "htmlize-%s-%s" htmlize-output-type method))))
- (indirect-function (if (fboundp sym)
- sym
- (let ((default (intern (concat "htmlize-default-"
- (symbol-name method)))))
- (if (fboundp default)
- default
- 'ignore))))))
-
-(defvar htmlize-memoization-table (make-hash-table :test 'equal))
-
-(defmacro htmlize-memoize (key generator)
- "Return the value of GENERATOR, memoized as KEY.
-That means that GENERATOR will be evaluated and returned the first time
-it's called with the same value of KEY. All other times, the cached
-\(memoized) value will be returned."
- (let ((value (gensym)))
- `(let ((,value (gethash ,key htmlize-memoization-table)))
- (unless ,value
- (setq ,value ,generator)
- (setf (gethash ,key htmlize-memoization-table) ,value))
- ,value)))
-
-;;; Default methods.
-
-(defun htmlize-default-doctype ()
- nil ; no doc-string
- ;; According to DTDs published by the W3C, it is illegal to embed
- ;; <font> in <pre>. This makes sense in general, but is bad for
- ;; htmlize's intended usage of <font> to specify the document color.
-
- ;; To make generated HTML legal, htmlize's `font' mode used to
- ;; specify the SGML declaration of "HTML Pro" DTD here. HTML Pro
- ;; aka Silmaril DTD was a project whose goal was to produce a GPL'ed
- ;; DTD that would encompass all the incompatible HTML extensions
- ;; procured by Netscape, MSIE, and other players in the field.
- ;; Apparently the project got abandoned, the last available version
- ;; being "Draft 0 Revision 11" from January 1997, as documented at
- ;; <http://imbolc.ucc.ie/~pflynn/articles/htmlpro.html>.
-
- ;; Since by now HTML Pro is remembered by none but the most die-hard
- ;; early-web-days nostalgics and used by not even them, there is no
- ;; use in specifying it. So we return the standard HTML 4.0
- ;; declaration, which makes generated HTML technically illegal. If
- ;; you have a problem with that, use the `css' engine designed to
- ;; create fully conforming HTML.
-
- "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\">"
-
- ;; Now-abandoned HTML Pro declaration.
- ;"<!DOCTYPE HTML PUBLIC \"+//Silmaril//DTD HTML Pro v0r11 19970101//EN\">"
- )
-
-(defun htmlize-default-body-tag (face-map)
- nil ; no doc-string
- "<body>")
-
-;;; CSS based output support.
-
-;; Internal function; not a method.
-(defun htmlize-css-specs (fstruct)
- (let (result)
- (when (htmlize-fstruct-foreground fstruct)
- (push (format "color: %s;" (htmlize-fstruct-foreground fstruct))
- result))
- (when (htmlize-fstruct-background fstruct)
- (push (format "background-color: %s;"
- (htmlize-fstruct-background fstruct))
- result))
- (let ((size (htmlize-fstruct-size fstruct)))
- (when (and size (not (eq htmlize-ignore-face-size t)))
- (cond ((floatp size)
- (push (format "font-size: %d%%;" (* 100 size)) result))
- ((not (eq htmlize-ignore-face-size 'absolute))
- (push (format "font-size: %spt;" (/ size 10.0)) result)))))
- (when (htmlize-fstruct-boldp fstruct)
- (push "font-weight: bold;" result))
- (when (htmlize-fstruct-italicp fstruct)
- (push "font-style: italic;" result))
- (when (htmlize-fstruct-underlinep fstruct)
- (push "text-decoration: underline;" result))
- (when (htmlize-fstruct-overlinep fstruct)
- (push "text-decoration: overline;" result))
- (when (htmlize-fstruct-strikep fstruct)
- (push "text-decoration: line-through;" result))
- (nreverse result)))
-
-(defun htmlize-css-insert-head (buffer-faces face-map)
- (insert " <style type=\"text/css\">\n <!--\n")
- (insert " body {\n "
- (mapconcat #'identity
- (htmlize-css-specs (gethash 'default face-map))
- "\n ")
- "\n }\n")
- (dolist (face (sort* (copy-list buffer-faces) #'string-lessp
- :key (lambda (f)
- (htmlize-fstruct-css-name (gethash f face-map)))))
- (let* ((fstruct (gethash face face-map))
- (cleaned-up-face-name
- (let ((s
- ;; Use `prin1-to-string' rather than `symbol-name'
- ;; to get the face name because the "face" can also
- ;; be an attrlist, which is not a symbol.
- (prin1-to-string face)))
- ;; If the name contains `--' or `*/', remove them.
- (while (string-match "--" s)
- (setq s (replace-match "-" t t s)))
- (while (string-match "\\*/" s)
- (setq s (replace-match "XX" t t s)))
- s))
- (specs (htmlize-css-specs fstruct)))
- (insert " ." (htmlize-fstruct-css-name fstruct))
- (if (null specs)
- (insert " {")
- (insert " {\n /* " cleaned-up-face-name " */\n "
- (mapconcat #'identity specs "\n ")))
- (insert "\n }\n")))
- (insert htmlize-hyperlink-style
- " -->\n </style>\n"))
-
-(defun htmlize-css-insert-text (text fstruct-list buffer)
- ;; Insert TEXT colored with FACES into BUFFER. In CSS mode, this is
- ;; easy: just nest the text in one <span class=...> tag for each
- ;; face in FSTRUCT-LIST.
- (dolist (fstruct fstruct-list)
- (princ "<span class=\"" buffer)
- (princ (htmlize-fstruct-css-name fstruct) buffer)
- (princ "\">" buffer))
- (princ text buffer)
- (dolist (fstruct fstruct-list)
- (ignore fstruct) ; shut up the byte-compiler
- (princ "</span>" buffer)))
-
-;; `inline-css' output support.
-
-(defun htmlize-inline-css-body-tag (face-map)
- (format "<body style=\"%s\">"
- (mapconcat #'identity (htmlize-css-specs (gethash 'default face-map))
- " ")))
-
-(defun htmlize-inline-css-insert-text (text fstruct-list buffer)
- (let* ((merged (htmlize-merge-faces fstruct-list))
- (style (htmlize-memoize
- merged
- (let ((specs (htmlize-css-specs merged)))
- (and specs
- (mapconcat #'identity (htmlize-css-specs merged) " "))))))
- (when style
- (princ "<span style=\"" buffer)
- (princ style buffer)
- (princ "\">" buffer))
- (princ text buffer)
- (when style
- (princ "</span>" buffer))))
-
-;;; `font' tag based output support.
-
-(defun htmlize-font-body-tag (face-map)
- (let ((fstruct (gethash 'default face-map)))
- (format "<body text=\"%s\" bgcolor=\"%s\">"
- (htmlize-fstruct-foreground fstruct)
- (htmlize-fstruct-background fstruct))))
-
-(defun htmlize-font-insert-text (text fstruct-list buffer)
- ;; In `font' mode, we use the traditional HTML means of altering
- ;; presentation: <font> tag for colors, <b> for bold, <u> for
- ;; underline, and <strike> for strike-through.
- (let* ((merged (htmlize-merge-faces fstruct-list))
- (markup (htmlize-memoize
- merged
- (cons (concat
- (and (htmlize-fstruct-foreground merged)
- (format "<font color=\"%s\">" (htmlize-fstruct-foreground merged)))
- (and (htmlize-fstruct-boldp merged) "<b>")
- (and (htmlize-fstruct-italicp merged) "<i>")
- (and (htmlize-fstruct-underlinep merged) "<u>")
- (and (htmlize-fstruct-strikep merged) "<strike>"))
- (concat
- (and (htmlize-fstruct-strikep merged) "</strike>")
- (and (htmlize-fstruct-underlinep merged) "</u>")
- (and (htmlize-fstruct-italicp merged) "</i>")
- (and (htmlize-fstruct-boldp merged) "</b>")
- (and (htmlize-fstruct-foreground merged) "</font>"))))))
- (princ (car markup) buffer)
- (princ text buffer)
- (princ (cdr markup) buffer)))
-
-(defun htmlize-buffer-1 ()
- ;; Internal function; don't call it from outside this file. Htmlize
- ;; current buffer, writing the resulting HTML to a new buffer, and
- ;; return it. Unlike htmlize-buffer, this doesn't change current
- ;; buffer or use switch-to-buffer.
- (save-excursion
- ;; Protect against the hook changing the current buffer.
- (save-excursion
- (run-hooks 'htmlize-before-hook))
- ;; Convince font-lock support modes to fontify the entire buffer
- ;; in advance.
- (htmlize-ensure-fontified)
- (clrhash htmlize-extended-character-cache)
- (clrhash htmlize-memoization-table)
- (let* ((buffer-faces (htmlize-faces-in-buffer))
- (face-map (htmlize-make-face-map (adjoin 'default buffer-faces)))
- ;; Generate the new buffer. It's important that it inherits
- ;; default-directory from the current buffer.
- (htmlbuf (generate-new-buffer (if (buffer-file-name)
- (htmlize-make-file-name
- (file-name-nondirectory
- (buffer-file-name)))
- "*html*")))
- ;; Having a dummy value in the plist allows writing simply
- ;; (plist-put places foo bar).
- (places '(nil nil))
- (title (if (buffer-file-name)
- (file-name-nondirectory (buffer-file-name))
- (buffer-name))))
- ;; Initialize HTMLBUF and insert the HTML prolog.
- (with-current-buffer htmlbuf
- (buffer-disable-undo)
- (insert (htmlize-method doctype) ?\n
- (format "<!-- Created by htmlize-%s in %s mode. -->\n"
- htmlize-version htmlize-output-type)
- "<html>\n ")
- (plist-put places 'head-start (point-marker))
- (insert "<head>\n"
- " <title>" (htmlize-protect-string title) "</title>\n"
- (if htmlize-html-charset
- (format (concat " <meta http-equiv=\"Content-Type\" "
- "content=\"text/html; charset=%s\">\n")
- htmlize-html-charset)
- "")
- htmlize-head-tags)
- (htmlize-method insert-head buffer-faces face-map)
- (insert " </head>")
- (plist-put places 'head-end (point-marker))
- (insert "\n ")
- (plist-put places 'body-start (point-marker))
- (insert (htmlize-method body-tag face-map)
- "\n ")
- (plist-put places 'content-start (point-marker))
- (insert "<pre>\n"))
- (let ((insert-text-method
- ;; Get the inserter method, so we can funcall it inside
- ;; the loop. Not calling `htmlize-method' in the loop
- ;; body yields a measurable speed increase.
- (htmlize-method-function 'insert-text))
- ;; Declare variables used in loop body outside the loop
- ;; because it's faster to establish `let' bindings only
- ;; once.
- next-change text face-list fstruct-list trailing-ellipsis)
- ;; This loop traverses and reads the source buffer, appending
- ;; the resulting HTML to HTMLBUF with `princ'. This method is
- ;; fast because: 1) it doesn't require examining the text
- ;; properties char by char (htmlize-next-change is used to
- ;; move between runs with the same face), and 2) it doesn't
- ;; require buffer switches, which are slow in Emacs.
- (goto-char (point-min))
- (while (not (eobp))
- (setq next-change (htmlize-next-change (point) 'face))
- ;; Get faces in use between (point) and NEXT-CHANGE, and
- ;; convert them to fstructs.
- (setq face-list (htmlize-faces-at-point)
- fstruct-list (delq nil (mapcar (lambda (f)
- (gethash f face-map))
- face-list)))
- ;; Extract buffer text, sans the invisible parts. Then
- ;; untabify it and escape the HTML metacharacters.
- (setq text (htmlize-buffer-substring-no-invisible
- (point) next-change))
- (when trailing-ellipsis
- (setq text (htmlize-trim-ellipsis text)))
- ;; If TEXT ends up empty, don't change trailing-ellipsis.
- (when (> (length text) 0)
- (setq trailing-ellipsis
- (get-text-property (1- (length text))
- 'htmlize-ellipsis text)))
- (setq text (htmlize-untabify text (current-column)))
- (setq text (htmlize-protect-string text))
- ;; Don't bother writing anything if there's no text (this
- ;; happens in invisible regions).
- (when (> (length text) 0)
- ;; Insert the text, along with the necessary markup to
- ;; represent faces in FSTRUCT-LIST.
- (funcall insert-text-method text fstruct-list htmlbuf))
- (goto-char next-change)))
-
- ;; Insert the epilog and post-process the buffer.
- (with-current-buffer htmlbuf
- (insert "</pre>")
- (plist-put places 'content-end (point-marker))
- (insert "\n </body>")
- (plist-put places 'body-end (point-marker))
- (insert "\n</html>\n")
- (when htmlize-generate-hyperlinks
- (htmlize-make-hyperlinks))
- (htmlize-defang-local-variables)
- (when htmlize-replace-form-feeds
- ;; Change each "\n^L" to "<hr />".
- (goto-char (point-min))
- (let ((source
- ;; ^L has already been escaped, so search for that.
- (htmlize-protect-string "\n\^L"))
- (replacement
- (if (stringp htmlize-replace-form-feeds)
- htmlize-replace-form-feeds
- "</pre><hr /><pre>")))
- (while (search-forward source nil t)
- (replace-match replacement t t))))
- (goto-char (point-min))
- (when htmlize-html-major-mode
- ;; What sucks about this is that the minor modes, most notably
- ;; font-lock-mode, won't be initialized. Oh well.
- (funcall htmlize-html-major-mode))
- (set (make-local-variable 'htmlize-buffer-places) places)
- (run-hooks 'htmlize-after-hook)
- (buffer-enable-undo))
- htmlbuf)))
-
-;; Utility functions.
-
-(defmacro htmlize-with-fontify-message (&rest body)
- ;; When forcing fontification of large buffers in
- ;; htmlize-ensure-fontified, inform the user that he is waiting for
- ;; font-lock, not for htmlize to finish.
- `(progn
- (if (> (buffer-size) 65536)
- (message "Forcing fontification of %s..."
- (buffer-name (current-buffer))))
- ,@body
- (if (> (buffer-size) 65536)
- (message "Forcing fontification of %s...done"
- (buffer-name (current-buffer))))))
-
-(defun htmlize-ensure-fontified ()
- ;; If font-lock is being used, ensure that the "support" modes
- ;; actually fontify the buffer. If font-lock is not in use, we
- ;; don't care because, except in htmlize-file, we don't force
- ;; font-lock on the user.
- (when (and (boundp 'font-lock-mode)
- font-lock-mode)
- ;; In part taken from ps-print-ensure-fontified in GNU Emacs 21.
- (cond
- ((and (boundp 'jit-lock-mode)
- (symbol-value 'jit-lock-mode))
- (htmlize-with-fontify-message
- (jit-lock-fontify-now (point-min) (point-max))))
- ((and (boundp 'lazy-lock-mode)
- (symbol-value 'lazy-lock-mode))
- (htmlize-with-fontify-message
- (lazy-lock-fontify-region (point-min) (point-max))))
- ((and (boundp 'lazy-shot-mode)
- (symbol-value 'lazy-shot-mode))
- (htmlize-with-fontify-message
- ;; lazy-shot is amazing in that it must *refontify* the region,
- ;; even if the whole buffer has already been fontified. <sigh>
- (lazy-shot-fontify-region (point-min) (point-max))))
- ;; There's also fast-lock, but we don't need to handle specially,
- ;; I think. fast-lock doesn't really defer fontification, it
- ;; just saves it to an external cache so it's not done twice.
- )))
-
-
-;;;###autoload
-(defun htmlize-buffer (&optional buffer)
- "Convert BUFFER to HTML, preserving colors and decorations.
-
-The generated HTML is available in a new buffer, which is returned.
-When invoked interactively, the new buffer is selected in the current
-window. The title of the generated document will be set to the buffer's
-file name or, if that's not available, to the buffer's name.
-
-Note that htmlize doesn't fontify your buffers, it only uses the
-decorations that are already present. If you don't set up font-lock or
-something else to fontify your buffers, the resulting HTML will be
-plain. Likewise, if you don't like the choice of colors, fix the mode
-that created them, or simply alter the faces it uses."
- (interactive)
- (let ((htmlbuf (with-current-buffer (or buffer (current-buffer))
- (htmlize-buffer-1))))
- (when (interactive-p)
- (switch-to-buffer htmlbuf))
- htmlbuf))
-
-;;;###autoload
-(defun htmlize-region (beg end)
- "Convert the region to HTML, preserving colors and decorations.
-See `htmlize-buffer' for details."
- (interactive "r")
- ;; Don't let zmacs region highlighting end up in HTML.
- (when (fboundp 'zmacs-deactivate-region)
- (zmacs-deactivate-region))
- (let ((htmlbuf (save-restriction
- (narrow-to-region beg end)
- (htmlize-buffer-1))))
- (when (interactive-p)
- (switch-to-buffer htmlbuf))
- htmlbuf))
-
-(defun htmlize-region-for-paste (beg end)
- "Htmlize the region and return just the HTML as a string.
-This forces the `inline-css' style and only returns the HTML body,
-but without the BODY tag. This should make it useful for inserting
-the text to another HTML buffer."
- (let* ((htmlize-output-type 'inline-css)
- (htmlbuf (htmlize-region beg end)))
- (unwind-protect
- (with-current-buffer htmlbuf
- (buffer-substring (plist-get htmlize-buffer-places 'content-start)
- (plist-get htmlize-buffer-places 'content-end)))
- (kill-buffer htmlbuf))))
-
-(defun htmlize-make-file-name (file)
- "Make an HTML file name from FILE.
-
-In its default implementation, this simply appends `.html' to FILE.
-This function is called by htmlize to create the buffer file name, and
-by `htmlize-file' to create the target file name.
-
-More elaborate transformations are conceivable, such as changing FILE's
-extension to `.html' (\"file.c\" -> \"file.html\"). If you want them,
-overload this function to do it and htmlize will comply."
- (concat file ".html"))
-
-;; Older implementation of htmlize-make-file-name that changes FILE's
-;; extension to ".html".
-;(defun htmlize-make-file-name (file)
-; (let ((extension (file-name-extension file))
-; (sans-extension (file-name-sans-extension file)))
-; (if (or (equal extension "html")
-; (equal extension "htm")
-; (equal sans-extension ""))
-; (concat file ".html")
-; (concat sans-extension ".html"))))
-
-;;;###autoload
-(defun htmlize-file (file &optional target)
- "Load FILE, fontify it, convert it to HTML, and save the result.
-
-Contents of FILE are inserted into a temporary buffer, whose major mode
-is set with `normal-mode' as appropriate for the file type. The buffer
-is subsequently fontified with `font-lock' and converted to HTML. Note
-that, unlike `htmlize-buffer', this function explicitly turns on
-font-lock. If a form of highlighting other than font-lock is desired,
-please use `htmlize-buffer' directly on buffers so highlighted.
-
-Buffers currently visiting FILE are unaffected by this function. The
-function does not change current buffer or move the point.
-
-If TARGET is specified and names a directory, the resulting file will be
-saved there instead of to FILE's directory. If TARGET is specified and
-does not name a directory, it will be used as output file name."
- (interactive (list (read-file-name
- "HTML-ize file: "
- nil nil nil (and (buffer-file-name)
- (file-name-nondirectory
- (buffer-file-name))))))
- (let ((output-file (if (and target (not (file-directory-p target)))
- target
- (expand-file-name
- (htmlize-make-file-name (file-name-nondirectory file))
- (or target (file-name-directory file)))))
- ;; Try to prevent `find-file-noselect' from triggering
- ;; font-lock because we'll fontify explicitly below.
- (font-lock-mode nil)
- (font-lock-auto-fontify nil)
- (global-font-lock-mode nil)
- ;; Ignore the size limit for the purposes of htmlization.
- (font-lock-maximum-size nil)
- ;; Disable font-lock support modes. This will only work in
- ;; more recent Emacs versions, so htmlize-buffer-1 still needs
- ;; to call htmlize-ensure-fontified.
- (font-lock-support-mode nil))
- (with-temp-buffer
- ;; Insert FILE into the temporary buffer.
- (insert-file-contents file)
- ;; Set the file name so normal-mode and htmlize-buffer-1 pick it
- ;; up. Restore it afterwards so with-temp-buffer's kill-buffer
- ;; doesn't complain about killing a modified buffer.
- (let ((buffer-file-name file))
- ;; Set the major mode for the sake of font-lock.
- (normal-mode)
- (font-lock-mode 1)
- (unless font-lock-mode
- ;; In GNU Emacs (font-lock-mode 1) doesn't force font-lock,
- ;; contrary to the documentation. This seems to work.
- (font-lock-fontify-buffer))
- ;; htmlize the buffer and save the HTML.
- (with-current-buffer (htmlize-buffer-1)
- (unwind-protect
- (progn
- (run-hooks 'htmlize-file-hook)
- (write-region (point-min) (point-max) output-file))
- (kill-buffer (current-buffer)))))))
- ;; I haven't decided on a useful return value yet, so just return
- ;; nil.
- nil)
-
-;;;###autoload
-(defun htmlize-many-files (files &optional target-directory)
- "Convert FILES to HTML and save the corresponding HTML versions.
-
-FILES should be a list of file names to convert. This function calls
-`htmlize-file' on each file; see that function for details. When
-invoked interactively, you are prompted for a list of files to convert,
-terminated with RET.
-
-If TARGET-DIRECTORY is specified, the HTML files will be saved to that
-directory. Normally, each HTML file is saved to the directory of the
-corresponding source file."
- (interactive
- (list
- (let (list file)
- ;; Use empty string as DEFAULT because setting DEFAULT to nil
- ;; defaults to the directory name, which is not what we want.
- (while (not (equal (setq file (read-file-name
- "HTML-ize file (RET to finish): "
- (and list (file-name-directory
- (car list)))
- "" t))
- ""))
- (push file list))
- (nreverse list))))
- ;; Verify that TARGET-DIRECTORY is indeed a directory. If it's a
- ;; file, htmlize-file will use it as target, and that doesn't make
- ;; sense.
- (and target-directory
- (not (file-directory-p target-directory))
- (error "target-directory must name a directory: %s" target-directory))
- (dolist (file files)
- (htmlize-file file target-directory)))
-
-;;;###autoload
-(defun htmlize-many-files-dired (arg &optional target-directory)
- "HTMLize dired-marked files."
- (interactive "P")
- (htmlize-many-files (dired-get-marked-files nil arg) target-directory))
-
-(provide 'htmlize)
-
-;;; htmlize.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-annotate-file.el b/.emacs.d/org-7.4/contrib/lisp/org-annotate-file.el
deleted file mode 100644
index 9ea9015..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-annotate-file.el
+++ /dev/null
@@ -1,130 +0,0 @@
-;;; org-annotate-file.el --- Annotate a file with org syntax
-
-;; Copyright (C) 2008 Philip Jackson
-
-;; Author: Philip Jackson <phil@shellarchive.co.uk>
-;; Version: 0.2
-
-;; This file is not currently part of GNU Emacs.
-
-;; This program is free software; you can redistribute it and/or
-;; modify it under the terms of the GNU General Public License as
-;; published by the Free Software Foundation; either version 2, or (at
-;; your option) any later version.
-
-;; This program is distributed in the hope that it will be useful, but
-;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-;; General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with this program ; see the file COPYING. If not, write to
-;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
-
-;;; Commentary:
-
-;; This is yet another implementation to allow the annotation of a
-;; file without modification of the file itself. The annotation is in
-;; org syntax so you can use all of the org features you are used to.
-
-;; To use you might put the following in your .emacs:
-;;
-;; (require 'org-annotate-file)
-;; (global-set-key (kbd "C-c C-l") 'org-annotate-file) ; for example
-;;
-;; To change the location of the annotation file:
-;;
-;; (setq org-annotate-file-storage-file "~/annotated.org")
-;;
-;; Then when you visit any file and hit C-c C-l you will find yourself
-;; in an org buffer on a headline which links to the file you were
-;; visiting, e.g:
-
-;; * ~/org-annotate-file.el
-
-;; Under here you can put anything you like, save the file
-;; and next time you hit C-c C-l you will hit those notes again.
-;;
-;; To put a subheading with a text search for the current line set
-;; `org-annotate-file-add-search` to non-nil value. Then when you hit
-;; C-c C-l (on the above line for example) you will get:
-
-;; * ~/org-annotate-file.el
-;; ** `org-annotate-file-add-search` to non-nil value. Then whe...
-
-;; Note that both of the above will be links.
-
-(require 'org)
-
-(defvar org-annotate-file-storage-file "~/.org-annotate-file.org"
- "File in which to keep annotations.")
-
-(defvar org-annotate-file-add-search nil
- "If non-nil then add a link as a second level to the actual
-location in the file")
-
-(defvar org-annotate-file-always-open t
- "non-nil means always expand the full tree when you visit
-`org-annotate-file-storage-file'.")
-
-(defun org-annotate-file-elipsify-desc (string &optional after)
- "Strip starting and ending whitespace and replace any chars
-that appear after the value in `after' with '...'"
- (let* ((after (number-to-string (or after 30)))
- (replace-map (list (cons "^[ \t]*" "")
- (cons "[ \t]*$" "")
- (cons (concat "^\\(.\\{" after
- "\\}\\).*") "\\1..."))))
- (mapc (lambda (x)
- (when (string-match (car x) string)
- (setq string (replace-match (cdr x) nil nil string))))
- replace-map)
- string))
-
-(defun org-annotate-file ()
- "Put a section for the current file into your annotation file"
- (interactive)
- (unless (buffer-file-name)
- (error "This buffer has no associated file."))
- (org-annotate-file-show-section))
-
-(defun org-annotate-file-show-section (&optional buffer)
- "Visit the buffer named `org-annotate-file-storage-file' and
-show the relevant section"
- (let* ((filename (abbreviate-file-name (or buffer (buffer-file-name))))
- (line (buffer-substring-no-properties (point-at-bol) (point-at-eol)))
- (link (org-make-link-string (concat "file:" filename) filename))
- (search-link (org-make-link-string
- (concat "file:" filename "::" line)
- (org-annotate-file-elipsify-desc line))))
- (with-current-buffer (find-file org-annotate-file-storage-file)
- (unless (org-mode-p)
- (org-mode))
- (goto-char (point-min))
- (widen)
- (when org-annotate-file-always-open
- (show-all))
- (unless (search-forward-regexp
- (concat "^* " (regexp-quote link)) nil t)
- (org-annotate-file-add-upper-level link))
- (beginning-of-line)
- (org-narrow-to-subtree)
- ;; deal with a '::' search if need be
- (when org-annotate-file-add-search
- (unless (search-forward-regexp
- (concat "^** " (regexp-quote search-link)) nil t)
- (org-annotate-file-add-second-level search-link))))))
-
-(defun org-annotate-file-add-upper-level (link)
- (goto-char (point-min))
- (call-interactively 'org-insert-heading)
- (insert link))
-
-(defun org-annotate-file-add-second-level (link)
- (goto-char (point-at-eol))
- (call-interactively 'org-insert-subheading)
- (insert link))
-
-(provide 'org-annotate-file)
-;;; org-annotate-file.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-bookmark.el b/.emacs.d/org-7.4/contrib/lisp/org-bookmark.el
deleted file mode 100644
index 06d2c60..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-bookmark.el
+++ /dev/null
@@ -1,88 +0,0 @@
-;;; org-bookmark.el - Support for links to bookmark
-;; Copyright (C) 2008 Free Software Foundation, Inc.
-;;
-;; Author: Tokuya Kameshima <kames AT fa2.so-net.ne.jp>
-;; Version: 1.0
-;; Keywords: outlines, hypermedia, calendar, wp
-;;
-;; This file is not part of GNU Emacs.
-;;
-;; Emacs is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(require 'org)
-(require 'bookmark)
-
-(defgroup org-bookmark nil
- "Options concerning the bookmark link."
- :tag "Org Startup"
- :group 'org-link)
-
-(defcustom org-bookmark-in-dired nil
- "Use org-bookmark in dired."
- :group 'org-bookmark
- :type 'boolean)
-
-(defcustom org-bookmark-when-visiting-a-file nil
- "Use org-bookmark in any buffer visiting a file."
- :group 'org-bookmark
- :type 'boolean)
-
-(defcustom org-bookmark-use-first-bookmark nil
- "If several bookmarks links to the buffer, take the first one.
-Otherwise prompt the user for the right bookmark to use."
- :group 'org-bookmark
- :type 'boolean)
-
-(org-add-link-type "bookmark" 'org-bookmark-open)
-(add-hook 'org-store-link-functions 'org-bookmark-store-link)
-
-(defun org-bookmark-open (bookmark)
- "Visit the bookmark BOOKMARK."
- (bookmark-jump bookmark))
-
-(defun org-bookmark-store-link ()
- "Store a link to the current line's bookmark in bookmark list."
- (let (file bookmark bmks)
- (cond ((and org-bookmark-in-dired
- (eq major-mode 'dired-mode))
- (setq file (abbreviate-file-name (dired-get-filename))))
- ((and org-bookmark-when-visiting-a-file
- (buffer-file-name (buffer-base-buffer)))
- (setq file (abbreviate-file-name
- (buffer-file-name (buffer-base-buffer))))))
- (if (not file)
- (when (eq major-mode 'bookmark-bmenu-mode)
- (setq bookmark (bookmark-bmenu-bookmark)))
- (when (and (setq bmks
- (mapcar (lambda (name)
- (if (equal file
- (abbreviate-file-name
- (bookmark-location name)))
- name))
- (bookmark-all-names)))
- (setq bmks (delete nil bmks)))
- (setq bookmark
- (if (or (eq 1 (length bmks)) org-bookmark-use-first-bookmark)
- (car bmks)
- (completing-read "Bookmark: " bmks nil t nil nil (car bmks))))))
- (if bookmark
- (org-store-link-props :link (org-make-link "bookmark:" bookmark)
- :description bookmark))))
-
-(provide 'org-bookmark)
-
-;;; org-bookmark.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-checklist.el b/.emacs.d/org-7.4/contrib/lisp/org-checklist.el
deleted file mode 100644
index 50df757..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-checklist.el
+++ /dev/null
@@ -1,143 +0,0 @@
-;;; org-checklist.el --- org functions for checklist handling
-
-;; Copyright (C) 2008 James TD Smith
-
-;; Author: James TD Smith (@ ahktenzero (. mohorovi cc))
-;; Version: 1.0
-;; Keywords: org, checklists
-;;
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with this program; if not, write to the Free Software
-;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-;;; Commentary:
-
-;; This file provides some functions for handing repeated tasks which involve
-;; checking off a list of items. By setting the RESET_CHECK_BOXES property in an
-;; item, when the TODO state is set to done all checkboxes under that item are
-;; cleared. If the LIST_EXPORT_BASENAME property is set, a file will be created
-;; using the value of that property plus a timestamp, containing all the items
-;; in the list which are not checked. Additionally the user will be prompted to
-;; print the list.
-;;
-;; I use this for to keep track of stores of various things (food stores,
-;; components etc) which I check periodically and use the exported list of items
-;; which are not present as a shopping list.
-;;
-;;; Usage:
-;; (require 'org-checklist)
-;;
-;; Set the RESET_CHECK_BOXES and LIST_EXPORT_BASENAME properties in items as
-;; needed.
-;;
-;;; Code:
-(require 'org)
-(load "a2ps-print" 'no-error)
-
-(setq org-default-properties (cons "RESET_CHECK_BOXES" (cons "LIST_EXPORT_BASENAME" org-default-properties)))
-
-(defgroup org-checklist nil
- "Extended checklist handling for org"
- :tag "Org-checklist"
- :group 'org)
-
-(defcustom org-checklist-export-time-format "%Y%m%d%H%M"
- "The format of timestamp appended to LIST_EXPORT_BASENAME to
- make the name of the export file."
- :link '(function-link format-time-string)
- :group 'org-checklist
- :type 'string)
-
-(defcustom org-checklist-export-function 'org-export-as-ascii
- "function used to prepare the export file for printing"
- :group 'org-checklist
- :type '(radio (function-item :tag "ascii text" org-export-as-ascii)
- (function-item :tag "HTML" org-export-as-html)
- (function-item :tag "LaTeX" :value org-export-as-latex)
- (function-item :tag "XOXO" :value org-export-as-xoxo)))
-
-(defcustom org-checklist-export-params nil
- "options for the export function file for printing"
- :group 'org-checklist
- :type '(repeat string))
-
-(defcustom org-checklist-a2ps-params nil
- "options for a2ps for printing"
- :group 'org-checklist
- :type '(repeat string))
-
-(defun org-reset-checkbox-state-maybe ()
- "Reset all checkboxes in an entry if the `RESET_CHECK_BOXES' property is set"
- (interactive "*")
- (if (org-entry-get (point) "RESET_CHECK_BOXES")
- (org-reset-checkbox-state-subtree)))
-
-
-(defun org-make-checklist-export ()
- "Produce a checklist containing all unchecked items from a list
-of checkbox items"
- (interactive "*")
- (if (org-entry-get (point) "LIST_EXPORT_BASENAME")
- (let* ((export-file (concat (org-entry-get (point) "LIST_EXPORT_BASENAME" nil)
- "-" (format-time-string
- org-checklist-export-time-format)
- ".org"))
- (print (case (org-entry-get (point) "PRINT_EXPORT" nil)
- (("" "nil" nil) nil)
- (t t)
- (nil (y-or-n-p "Print list? "))))
- exported-lines
- (title "Checklist export"))
- (save-restriction
- (save-excursion
- (org-narrow-to-subtree)
- (org-update-checkbox-count-maybe)
- (org-show-subtree)
- (goto-char (point-min))
- (when (looking-at org-complex-heading-regexp)
- (setq title (match-string 4)))
- (goto-char (point-min))
- (let ((end (point-max)))
- (while (< (point) end)
- (when (and (org-at-item-checkbox-p)
- (or (string= (match-string 0) "[ ]")
- (string= (match-string 0) "[-]")))
- (add-to-list 'exported-lines (thing-at-point 'line) t))
- (beginning-of-line 2)))
- (set-buffer (get-buffer-create export-file))
- (org-insert-heading)
- (insert (or title export-file) "\n")
- (dolist (entry exported-lines) (insert entry))
- (org-update-checkbox-count-maybe)
- (write-file export-file)
- (if (print)
- (progn (funcall org-checklist-export-function
- org-checklist-export-params)
- (let* ((current-a2ps-switches a2ps-switches)
- (a2ps-switches (append current-a2ps-switches
- org-checklist-a2ps-params)))
- (a2ps-buffer)))))))))
-
-(defun org-checklist ()
- (when (member state org-done-keywords)
- (org-make-checklist-export)
- (org-reset-checkbox-state-maybe)))
-
-(add-hook 'org-after-todo-state-change-hook 'org-checklist)
-
-(provide 'org-checklist)
-
-;;; org-checklist.el ends here
-
-
-
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-choose.el b/.emacs.d/org-7.4/contrib/lisp/org-choose.el
deleted file mode 100644
index 6f7f120..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-choose.el
+++ /dev/null
@@ -1,539 +0,0 @@
-;;;_ org-choose.el --- decision management for org-mode
-
-;;;_. Headers
-;;;_ , License
-;; Copyright (C) 2009 Tom Breton (Tehom)
-
-;; Author: Tom Breton (Tehom)
-;; Keywords: outlines, convenience
-
-;; This file is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
-
-;; This file is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to
-;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
-
-;;;_ , Commentary:
-
-; This is code to support decision management. It lets you treat a
-; group of sibling items in org-mode as alternatives in a decision.
-
-; There are no user commands in this file. You use it by:
-; * Loading it (manually or by M-x customize-apropos org-modules)
-
-;; * Setting up at least one set of TODO keywords with the
-;; interpretation "choose" by either:
-
-;; * Using the file directive #+CHOOSE_TODO:
-
-;; * For instance, "#+CHOOSE_TODO: NO(,-) MAYBE(,0) YES"
-
-;; * Or by M-x customize-apropos org-todo-keywords
-
-;; * Operating on single items with the TODO commands.
-
-;; * Use C-S-right to change the keyword set. Use this to change to
-;; the "choose" keyword set that you just defined.
-
-;; * Use S-right to advance the TODO mark to the next setting.
-
-;; For "choose", that means you like this alternative more than
-;; before. Other alternatives will be automatically demoted to
-;; keep your settings consistent.
-
-;; * Use S-left to demote TODO to the previous setting.
-
-;; For "choose", that means you don't like this alternative as much
-;; as before. Other alternatives will be automatically promoted,
-;; if this item was all that was keeping them down.
-
-;; * All the other TODO commands are available and behave essentially
-;; the normal way.
-
-
-;;;_ , Requires
-
-(require 'org)
-;(eval-when-compile
-; (require 'cl))
-(require 'cl)
-
-;;;_. Body
-;;;_ , The variables
-
-(defstruct (org-choose-mark-data. (:type list))
- "The format of an entry in org-choose-mark-data.
-Indexes are 0-based or `nil'.
-"
- keyword
- bot-lower-range
- top-upper-range
- range-length
- static-default
- all-keywords)
-
-(defvar org-choose-mark-data
- ()
- "Alist of information for choose marks.
-
-Each entry is an `org-choose-mark-data.'" )
-(make-variable-buffer-local 'org-choose-mark-data)
-;;;_ , For setup
-;;;_ . org-choose-filter-one
-
-(defun org-choose-filter-one (i)
- "Return a list of
- * a canonized version of the string
- * optionally one symbol"
-
- (if
- (not
- (string-match "(.*)" i))
- (list i i)
- (let*
- (
- (end-text (match-beginning 0))
- (vanilla-text (substring i 0 end-text))
- ;;Get the parenthesized part.
- (match (match-string 0 i))
- ;;Remove the parentheses.
- (args (substring match 1 -1))
- ;;Split it
- (arglist
- (let
- ((arglist-x (org-split-string args ",")))
- ;;When string starts with "," `split-string' doesn't
- ;;make a first arg, so in that case make one
- ;;manually.
- (if
- (string-match "^," args)
- (cons nil arglist-x)
- arglist-x)))
- (decision-arg (second arglist))
- (type
- (cond
- ((string= decision-arg "0")
- 'default-mark)
- ((string= decision-arg "+")
- 'top-upper-range)
- ((string= decision-arg "-")
- 'bot-lower-range)
- (t nil)))
- (vanilla-arg (first arglist))
- (vanilla-mark
- (if vanilla-arg
- (concat vanilla-text "("vanilla-arg")")
- vanilla-text)))
- (if type
- (list vanilla-text vanilla-mark type)
- (list vanilla-text vanilla-mark)))))
-
-;;;_ . org-choose-setup-vars
-(defun org-choose-setup-vars (bot-lower-range top-upper-range
- static-default num-items all-mark-texts)
- "Add to org-choose-mark-data according to arguments"
-
- (let*
- (
- (tail
- ;;If there's no bot-lower-range or no default, we don't
- ;;have ranges.
- (cdr
- (if (and static-default bot-lower-range)
- (let*
- (
- ;;If there's no top-upper-range, use the last
- ;;item.
- (top-upper-range
- (or top-upper-range (1- num-items)))
- (lower-range-length
- (1+ (- static-default bot-lower-range)))
- (upper-range-length
- (- top-upper-range static-default))
- (range-length
- (min upper-range-length lower-range-length)))
-
-
- (make-org-choose-mark-data.
- :keyword nil
- :bot-lower-range bot-lower-range
- :top-upper-range top-upper-range
- :range-length range-length
- :static-default static-default
- :all-keywords all-mark-texts))
-
- (make-org-choose-mark-data.
- :keyword nil
- :bot-lower-range nil
- :top-upper-range nil
- :range-length nil
- :static-default (or static-default 0)
- :all-keywords all-mark-texts)))))
-
- (dolist (text all-mark-texts)
- (pushnew (cons text tail)
- org-choose-mark-data
- :test
- #'(lambda (a b)
- (equal (car a) (car b)))))))
-
-
-
-
-;;;_ . org-choose-filter-tail
-(defun org-choose-filter-tail (raw)
- "Return a translation of RAW to vanilla and set appropriate
-buffer-local variables.
-
-RAW is a list of strings representing the input text of a choose
-interpretation."
- (let
- ((vanilla-list nil)
- (all-mark-texts nil)
- (index 0)
- bot-lower-range top-upper-range range-length static-default)
- (dolist (i raw)
- (destructuring-bind
- (vanilla-text vanilla-mark &optional type)
- (org-choose-filter-one i)
- (cond
- ((eq type 'bot-lower-range)
- (setq bot-lower-range index))
- ((eq type 'top-upper-range)
- (setq top-upper-range index))
- ((eq type 'default-mark)
- (setq static-default index)))
- (incf index)
- (push vanilla-text all-mark-texts)
- (push vanilla-mark vanilla-list)))
-
- (org-choose-setup-vars bot-lower-range top-upper-range
- static-default index (reverse all-mark-texts))
- (nreverse vanilla-list)))
-
-;;;_ . org-choose-setup-filter
-
-(defun org-choose-setup-filter (raw)
- "A setup filter for choose interpretations."
- (when (eq (car raw) 'choose)
- (cons
- 'choose
- (org-choose-filter-tail (cdr raw)))))
-
-;;;_ . org-choose-conform-after-promotion
-(defun org-choose-conform-after-promotion (entry-pos keywords highest-ok-ix)
- "Conform the current item after another item was promoted"
-
- (unless
- ;;Skip the entry that triggered this by skipping any entry with
- ;;the same starting position. plist uses the start of the
- ;;header line as the position, but map no longer does, so we
- ;;have to go back to the heading.
- (=
- (save-excursion
- (org-back-to-heading)
- (point))
- entry-pos)
- (let
- ((ix
- (org-choose-get-entry-index keywords)))
- ;;If the index of the entry exceeds the highest allowable
- ;;index, change it to that.
- (when (and ix
- (> ix highest-ok-ix))
- (org-todo
- (nth highest-ok-ix keywords))))))
-;;;_ . org-choose-conform-after-demotion
-(defun org-choose-conform-after-demotion (entry-pos keywords
- raise-to-ix
- old-highest-ok-ix)
- "Conform the current item after another item was demoted."
-
- (unless
- ;;Skip the entry that triggered this.
- (=
- (save-excursion
- (org-back-to-heading)
- (point))
- entry-pos)
- (let
- ((ix
- (org-choose-get-entry-index keywords)))
- ;;If the index of the entry was at or above the old allowable
- ;;position, change it to the new mirror position if there is
- ;;one.
- (when (and
- ix
- raise-to-ix
- (>= ix old-highest-ok-ix))
- (org-todo
- (nth raise-to-ix keywords))))))
-
-;;;_ , org-choose-keep-sensible (the org-trigger-hook function)
-(defun org-choose-keep-sensible (change-plist)
- "Bring the other items back into a sensible state after an item's
-setting was changed."
- (let*
- ( (from (plist-get change-plist :from))
- (to (plist-get change-plist :to))
- (entry-pos
- (set-marker
- (make-marker)
- (plist-get change-plist :position)))
- (kwd-data
- (assoc to org-todo-kwd-alist)))
- (when
- (eq (nth 1 kwd-data) 'choose)
- (let*
- (
- (data
- (assoc to org-choose-mark-data))
- (keywords
- (org-choose-mark-data.-all-keywords data))
- (old-index
- (org-choose-get-index-in-keywords
- from
- keywords))
- (new-index
- (org-choose-get-index-in-keywords
- to
- keywords))
- (highest-ok-ix
- (org-choose-highest-other-ok
- new-index
- data))
- (funcdata
- (cond
- ;;The entry doesn't participate in conformance,
- ;;so give `nil' which does nothing.
- ((not highest-ok-ix) nil)
- ;;The entry was created or promoted
- ((or
- (not old-index)
- (> new-index old-index))
- (list
- #'org-choose-conform-after-promotion
- entry-pos keywords
- highest-ok-ix))
- (t ;;Otherwise the entry was demoted.
- (let
- (
- (raise-to-ix
- (min
- highest-ok-ix
- (org-choose-mark-data.-static-default
- data)))
- (old-highest-ok-ix
- (org-choose-highest-other-ok
- old-index
- data)))
-
- (list
- #'org-choose-conform-after-demotion
- entry-pos
- keywords
- raise-to-ix
- old-highest-ok-ix))))))
-
- (if funcdata
- ;;The funny-looking names are to make variable capture
- ;;unlikely. (Poor-man's lexical bindings).
- (destructuring-bind (func-d473 . args-46k) funcdata
- (let
- ((map-over-entries
- (org-choose-get-fn-map-group))
- ;;We may call `org-todo', so let various hooks
- ;;`nil' so we don't cause loops.
- org-after-todo-state-change-hook
- org-trigger-hook
- org-blocker-hook
- org-todo-get-default-hook
- ;;Also let this alist `nil' so we don't log
- ;;secondary transitions.
- org-todo-log-states)
- ;;Map over group
- (funcall map-over-entries
- #'(lambda ()
- (apply func-d473 args-46k))))))))
-
- ;;Remove the marker
- (set-marker entry-pos nil)))
-
-
-
-;;;_ , Getting the default mark
-;;;_ . org-choose-get-index-in-keywords
-(defun org-choose-get-index-in-keywords (ix all-keywords)
- "Return the index of the current entry."
-
- (if ix
- (position ix all-keywords
- :test #'equal)))
-
-;;;_ . org-choose-get-entry-index
-(defun org-choose-get-entry-index (all-keywords)
- "Return index of current entry."
-
- (let*
- ((state (org-entry-get (point) "TODO")))
- (org-choose-get-index-in-keywords state all-keywords)))
-
-;;;_ . org-choose-get-fn-map-group
-
-(defun org-choose-get-fn-map-group ()
- "Return a function to map over the group"
-
- #'(lambda (fn)
- (require 'org-agenda) ;; `org-map-entries' seems to need it.
- (save-excursion
- (unless (org-up-heading-safe)
- (error "Choosing is only supported between siblings in a tree, not on top level"))
- (let
- ((level (org-reduced-level (org-outline-level))))
- (save-restriction
- (org-map-entries
- fn
- (format "LEVEL=%d" level)
- 'tree))))))
-
-;;;_ . org-choose-get-highest-mark-index
-
-(defun org-choose-get-highest-mark-index (keywords)
- "Get the index of the highest current mark in the group.
-If there is none, return 0"
-
- (let*
- (
- ;;Func maps over applicable entries.
- (map-over-entries
- (org-choose-get-fn-map-group))
-
- (indexes-list
- (remove nil
- (funcall map-over-entries
- #'(lambda ()
- (org-choose-get-entry-index keywords))))))
- (if
- indexes-list
- (apply #'max indexes-list)
- 0)))
-
-
-;;;_ . org-choose-highest-ok
-
-(defun org-choose-highest-other-ok (ix data)
- "Return the highest index that any choose mark can sensibly have,
-given that another mark has index IX.
-DATA must be a `org-choose-mark-data.'."
-
- (let
- (
- (bot-lower-range
- (org-choose-mark-data.-bot-lower-range data))
- (top-upper-range
- (org-choose-mark-data.-top-upper-range data))
- (range-length
- (org-choose-mark-data.-range-length data)))
- (when (and ix bot-lower-range)
- (let*
- ((delta
- (- top-upper-range ix)))
- (unless
- (< range-length delta)
- (+ bot-lower-range delta))))))
-
-;;;_ . org-choose-get-default-mark-index
-
-(defun org-choose-get-default-mark-index (data)
- "Return the index of the default mark in a choose interpretation.
-
-DATA must be a `org-choose-mark-data.'."
-
-
- (or
- (let
- ((highest-mark-index
- (org-choose-get-highest-mark-index
- (org-choose-mark-data.-all-keywords data))))
- (org-choose-highest-other-ok
- highest-mark-index data))
- (org-choose-mark-data.-static-default data)))
-
-
-
-;;;_ . org-choose-get-mark-N
-(defun org-choose-get-mark-N (n data)
- "Get the text of the nth mark in a choose interpretation."
-
- (let*
- ((l (org-choose-mark-data.-all-keywords data)))
- (nth n l)))
-
-;;;_ . org-choose-get-default-mark
-
-(defun org-choose-get-default-mark (new-mark old-mark)
- "Get the default mark IFF in a choose interpretation.
-NEW-MARK and OLD-MARK are the text of the new and old marks."
-
- (let*
- (
- (old-kwd-data
- (assoc old-mark org-todo-kwd-alist))
- (new-kwd-data
- (assoc new-mark org-todo-kwd-alist))
- (becomes-choose
- (and
- (or
- (not old-kwd-data)
- (not
- (eq (nth 1 old-kwd-data) 'choose)))
- (eq (nth 1 new-kwd-data) 'choose))))
- (when
- becomes-choose
- (let
- ((new-mark-data
- (assoc new-mark org-choose-mark-data)))
- (if
- new-mark
- (org-choose-get-mark-N
- (org-choose-get-default-mark-index
- new-mark-data)
- new-mark-data)
- (error "Somehow got an unrecognizable mark"))))))
-
-;;;_ , Setting it all up
-
-(eval-after-load "org"
- '(progn
- (add-to-list 'org-todo-setup-filter-hook
- #'org-choose-setup-filter)
- (add-to-list 'org-todo-get-default-hook
- #'org-choose-get-default-mark)
- (add-to-list 'org-trigger-hook
- #'org-choose-keep-sensible)
- (add-to-list 'org-todo-interpretation-widgets
- '(:tag "Choose (to record decisions)" choose)
- 'append)
- ))
-
-
-;;;_. Footers
-;;;_ , Provides
-
-(provide 'org-choose)
-
-;;;_ * Local emacs vars.
-;;;_ + Local variables:
-;;;_ + End:
-
-;;;_ , End
-;;; org-choose.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-collector.el b/.emacs.d/org-7.4/contrib/lisp/org-collector.el
deleted file mode 100644
index 1d4f042..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-collector.el
+++ /dev/null
@@ -1,235 +0,0 @@
-;;; org-collector --- collect properties into tables
-
-;; Copyright (C) 2008 Free Software Foundation, Inc.
-
-;; Author: Eric Schulte <schulte dot eric at gmail dot com>
-;; Keywords: outlines, hypermedia, calendar, wp, experimentation,
-;; organization, properties
-;; Homepage: http://orgmode.org
-;; Version: 0.01
-
-;; This file is not yet part of GNU Emacs.
-
-;; GNU Emacs is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Pass in an alist of columns, each column can be either a single
-;; property or a function which takes column names as arguments.
-;;
-;; For example the following propview block would collect the value of
-;; the 'amount' property from each header in the current buffer
-;;
-;; #+BEGIN: propview :cols (ITEM amount)
-;; | "ITEM" | "amount" |
-;; |---------------------+----------|
-;; | "December Spending" | 0 |
-;; | "Grocery Store" | 56.77 |
-;; | "Athletic club" | 75.0 |
-;; | "Restaurant" | 30.67 |
-;; | "January Spending" | 0 |
-;; | "Athletic club" | 75.0 |
-;; | "Restaurant" | 50.00 |
-;; |---------------------+----------|
-;; | | |
-;; #+END:
-;;
-;; This slightly more selective propview block will limit those
-;; headers included to those in the subtree with the id 'december'
-;; in which the spendtype property is equal to "food"
-;;
-;; #+BEGIN: propview :id "december" :conds ((string= spendtype "food")) :cols (ITEM amount)
-;; | "ITEM" | "amount" |
-;; |-----------------+----------|
-;; | "Grocery Store" | 56.77 |
-;; | "Restaurant" | 30.67 |
-;; |-----------------+----------|
-;; | | |
-;; #+END:
-;;
-;; Org Collector allows arbitrary processing of the property values
-;; through elisp in the cols: property. This allows for both simple
-;; computations as in the following example
-;;
-;; #+BEGIN: propview :id "results" :cols (ITEM f d list (apply '+ list) (+ f d))
-;; | "ITEM" | "f" | "d" | "list" | "(apply (quote +) list)" | "(+ f d)" |
-;; |--------+-----+-----+-------------------------+--------------------------+-----------|
-;; | "run1" | 2 | 33 | (quote (9 2 3 4 5 6 7)) | 36 | 35 |
-;; | "run2" | 2 | 34 | :na | :na | 36 |
-;; | "run3" | 2 | 35 | :na | :na | 37 |
-;; | "run4" | 2 | 36 | :na | :na | 38 |
-;; | | | | | | |
-;; #+END:
-;;
-;; or more complex computations as in the following example taken from
-;; an org file where each header in "results" subtree contained a
-;; property "sorted_hits" which was passed through the
-;; "average-precision" elisp function
-;;
-;; #+BEGIN: propview :id "results" :cols (ITEM (average-precision sorted_hits))
-;; | "ITEM" | "(average-precision sorted_hits)" |
-;; |-----------+-----------------------------------|
-;; | run (80) | 0.105092 |
-;; | run (70) | 0.108142 |
-;; | run (10) | 0.111348 |
-;; | run (60) | 0.113593 |
-;; | run (50) | 0.116446 |
-;; | run (100) | 0.118863 |
-;; #+END:
-;;
-
-;;; Code:
-(require 'org)
-(require 'org-table)
-
-(defvar org-propview-default-value 0
- "Default value to insert into the propview table when the no
-value is calculated either through lack of required variables for
-a column, or through the generation of an error.")
-
-(defun and-rest (list)
- (if (listp list)
- (if (> (length list) 1)
- (and (car list) (and-rest (cdr list)))
- (car list))
- list))
-
-(put 'org-collector-error
- 'error-conditions
- '(error column-prop-error org-collector-error))
-
-(defun org-read-prop (prop)
- "Convert the string property PROP to a number if appropriate.
-If prop looks like a list (meaning it starts with a '(') then
-read it as lisp expression, otherwise return it unmodified as a
-string.
-
-Results of calling:
-\(org-read-prop \"12\") -> 12
-\(org-read-prop \"(1 2 3)\") -> (1 2 3)
-\(org-read-prop \"+0\") -> 0
-\(org-read-prop \"aaa\") -> \"aaa\""
- (if (and (stringp prop) (not (equal prop "")))
- (let ((out (string-to-number prop)))
- (if (equal out 0)
- (cond
- ((or
- (equal "(" (substring prop 0 1))
- (equal "'" (substring prop 0 1)))
-
- (condition-case nil
- (read prop)
- (error prop)))
- ((string-match "^\\(+0\\|-0\\|0\\)$" prop)
- 0)
- (t
- (set-text-properties 0 (length prop) nil prop)
- prop))
- out))
- prop))
-
-(defun org-dblock-write:propview (params)
- "collect the column specification from the #+cols line
-preceeding the dblock, then update the contents of the dblock."
- (interactive)
- (condition-case er
- (let ((cols (plist-get params :cols))
- (conds (plist-get params :conds))
- (match (plist-get params :match))
- (scope (plist-get params :scope))
- (content-lines (org-split-string (plist-get params :content) "\n"))
- id table line pos)
- (save-excursion
- (when (setq id (plist-get params :id))
- (cond ((not id) nil)
- ((eq id 'global) (goto-char (point-min)))
- ((eq id 'local) nil)
- ((setq idpos (org-find-entry-with-id id))
- (goto-char idpos))
- (t (error "Cannot find entry with :ID: %s" id))))
- (org-narrow-to-subtree)
- (setq table (org-propview-to-table (org-propview-collect cols conds match scope)))
- (widen))
- (setq pos (point))
- (when content-lines
- (while (string-match "^#" (car content-lines))
- (insert (pop content-lines) "\n")))
- (insert table) (insert "\n|--") (org-cycle) (move-end-of-line 1)
- (message (format "point-%d" pos))
- (while (setq line (pop content-lines))
- (when (string-match "^#" line)
- (insert "\n" line)))
- (goto-char pos)
- (org-table-recalculate 'all))
- (org-collector-error (widen) (error "%s" er))
- (error (widen) (error "%s" er))))
-
-(defun org-propview-eval-w-props (props body)
- "evaluate the BODY-FORMS binding the variables using the
-variables and values specified in props"
- (condition-case nil ;; catch any errors
- (eval `(let ,(mapcar
- (lambda (pair) (list (intern (car pair)) (cdr pair)))
- props)
- ,body))
- (error nil)))
-
-(defun org-propview-collect (cols &optional conds match scope)
- (interactive)
- ;; collect the properties from every header
- (let* ((header-props
- (let ((org-trust-scanner-tags t))
- (org-map-entries (quote (cons (cons "ITEM" (org-get-heading t))
- (org-entry-properties)))
- match scope)))
- ;; read property values
- (header-props (mapcar (lambda (props)
- (mapcar (lambda (pair) (cons (car pair) (org-read-prop (cdr pair))))
- props))
- header-props))
- ;; collect all property names
- (prop-names (mapcar 'intern (delete-dups
- (apply 'append (mapcar (lambda (header)
- (mapcar 'car header))
- header-props))))))
- (append
- (list
- (mapcar (lambda (el) (format "%S" el)) cols) ;; output headers
- 'hline) ;; ------------------------------------------------
- (mapcar ;; calculate the value of the column for each header
- (lambda (props) (mapcar (lambda (col) (let ((result (org-propview-eval-w-props props col)))
- (if result result org-propview-default-value)))
- cols))
- (if conds
- ;; eliminate the headers which don't satisfy the property
- (delq nil
- (mapcar
- (lambda (props)
- (if (and-rest (mapcar (lambda (col) (org-propview-eval-w-props props col)) conds))
- props))
- header-props))
- header-props)))))
-
-(defun org-propview-to-table (results)
- ;; (message (format "cols:%S" cols))
- (orgtbl-to-orgtbl
- (mapcar
- (lambda (row)
- (if (equal row 'hline)
- 'hline
- (mapcar (lambda (el) (format "%S" el)) row)))
- (delq nil results)) '()))
-
-(provide 'org-collector)
-;;; org-collector ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-contribdir.el b/.emacs.d/org-7.4/contrib/lisp/org-contribdir.el
deleted file mode 100644
index 92c50a0..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-contribdir.el
+++ /dev/null
@@ -1,38 +0,0 @@
-;;; org-contribdir.el --- Mark the location of the contrib directory
-;; Copyright (C) 2009 Free Software Foundation, Inc.
-;;
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 0.01
-;;
-;; This file is not yet part of GNU Emacs.
-;;
-;; GNU Emacs is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-;;
-
-;; The sole purpose of this file is to be located in the same place
-;; as where the contributed Org files are located, typically in the
-;; contrib/lisp directory of the Org-mode distribution. This is to
-;; make sure that the command `org-reload' can reliably locate
-;; contributed org files.
-
-(provide 'org-contribdir)
-
-;;; org-contribdir.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-depend.el b/.emacs.d/org-7.4/contrib/lisp/org-depend.el
deleted file mode 100644
index 089a6a0..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-depend.el
+++ /dev/null
@@ -1,279 +0,0 @@
-;;; org-depend.el --- TODO dependencies for Org-mode
-;; Copyright (C) 2008 Free Software Foundation, Inc.
-;;
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 0.08
-;;
-;; This file is not part of GNU Emacs.
-;;
-;; This file is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-;;
-;; WARNING: This file is just a PROOF OF CONCEPT, not a supported part
-;; of Org-mode.
-;;
-;; This is an example implementation of TODO dependencies in Org-mode.
-;; It uses the new hooks in version 5.13 of Org-mode,
-;; `org-trigger-hook' and `org-blocker-hook'.
-;;
-;; It implements the following:
-;;
-;; Triggering
-;; ----------
-;;
-;; 1) If an entry contains a TRIGGER property that contains the string
-;; "chain-siblings(KEYWORD)", then switching that entry to DONE does
-;; do the following:
-;; - The sibling following this entry switched to todo-state KEYWORD.
-;; - The sibling also gets a TRIGGER property "chain-sibling(KEYWORD)",
-;; property, to make sure that, when *it* is DONE, the chain will
-;; continue.
-;;
-;; 2) If an entry contains a TRIGGER property that contains the string
-;; "chain-siblings-scheduled", then switching that entry to DONE does
-;; the following actions, similarly to "chain-siblings(KEYWORD)":
-;; - The sibling receives the same scheduled time as the entry
-;; marked as DONE (or, in the case, in which there is no scheduled
-;; time, the sibling does not get any either).
-;; - The sibling also gets the same TRIGGER property
-;; "chain-siblings-scheduled", so the chain can continue.
-;;
-;; 3) If the TRIGGER property contains any other words like
-;; XYZ(KEYWORD), these are treated as entry id's with keywords. That
-;; means Org-mode will search for an entry with the ID property XYZ
-;; and switch that entry to KEYWORD as well.
-;;
-;; Blocking
-;; --------
-;;
-;; 1) If an entry contains a BLOCKER property that contains the word
-;; "previous-sibling", the sibling above the current entry is
-;; checked when you try to mark it DONE. If it is still in a TODO
-;; state, the current state change is blocked.
-;;
-;; 2) If the BLOCKER property contains any other words, these are
-;; treated as entry id's. That means Org-mode will search for an
-;; entry with the ID property exactly equal to this word. If any
-;; of these entries is not yet marked DONE, the current state change
-;; will be blocked.
-;;
-;; 3) Whenever a state change is blocked, an org-mark is pushed, so that
-;; you can find the offending entry with `C-c &'.
-;;
-;;; Example:
-;;
-;; When trying this example, make sure that the settings for TODO keywords
-;; have been activated, i.e. include the following line and press C-c C-c
-;; on the line before working with the example:
-;;
-;; #+TYP_TODO: TODO NEXT | DONE
-;;
-;; * TODO Win a million in Las Vegas
-;; The "third" TODO (see above) cannot become a TODO without this money.
-;;
-;; :PROPERTIES:
-;; :ID: I-cannot-do-it-without-money
-;; :END:
-;;
-;; * Do this by doing a chain of TODO's
-;; ** NEXT This is the first in this chain
-;; :PROPERTIES:
-;; :TRIGGER: chain-siblings(NEXT)
-;; :END:
-;;
-;; ** This is the second in this chain
-;;
-;; ** This is the third in this chain
-;; :PROPERTIES:
-;; :BLOCKER: I-cannot-do-it-without-money
-;; :END:
-;;
-;; ** This is the forth in this chain
-;; When this is DONE, we will also trigger entry XYZ-is-my-id
-;; :PROPERTIES:
-;; :TRIGGER: XYZ-is-my-id(TODO)
-;; :END:
-;;
-;; ** This is the fifth in this chain
-;;
-;; * Start writing report
-;; :PROPERTIES:
-;; :ID: XYZ-is-my-id
-;; :END:
-;;
-;;
-
-(require 'org)
-
-(defcustom org-depend-tag-blocked t
- "Whether to indicate blocked TODO items by a special tag."
- :group 'org
- :type 'boolean)
-
-(defmacro org-depend-act-on-sibling (trigger-val &rest rest)
- "Perform a set of actions on the next sibling, if it exists,
-copying the sibling spec TRIGGER-VAL to the next sibling."
- `(catch 'exit
- (save-excursion
- (goto-char pos)
- ;; find the sibling, exit if no more siblings
- (condition-case nil
- (outline-forward-same-level 1)
- (error (throw 'exit t)))
- ;; mark the sibling TODO
- ,@rest
- ;; make sure the sibling will continue the chain
- (org-entry-add-to-multivalued-property
- nil "TRIGGER" ,trigger-val))))
-
-(defun org-depend-trigger-todo (change-plist)
- "Trigger new TODO entries after the current is switched to DONE.
-This does two different kinds of triggers:
-
-- If the current entry contains a TRIGGER property that contains
- \"chain-siblings(KEYWORD)\", it goes to the next sibling, marks it
- KEYWORD and also installs the \"chain-sibling\" trigger to continue
- the chain.
-- If the current entry contains a TRIGGER property that contains
- \"chain-siblings-scheduled\", we go to the next sibling and copy
- the scheduled time from the current task, also installing the property
- in the sibling.
-- Any other word (space-separated) like XYZ(KEYWORD) in the TRIGGER
- property is seen as an entry id. Org-mode finds the entry with the
- corresponding ID property and switches it to the state TODO as well."
-
- ;; Get information from the plist
- (let* ((type (plist-get change-plist :type))
- (pos (plist-get change-plist :position))
- (from (plist-get change-plist :from))
- (to (plist-get change-plist :to))
- (org-log-done nil) ; IMPROTANT!: no logging during automatic trigger!
- trigger triggers tr p1 kwd)
- (catch 'return
- (unless (eq type 'todo-state-change)
- ;; We are only handling todo-state-change....
- (throw 'return t))
- (unless (and (member from org-not-done-keywords)
- (member to org-done-keywords))
- ;; This is not a change from TODO to DONE, ignore it
- (throw 'return t))
-
- ;; OK, we just switched from a TODO state to a DONE state
- ;; Lets see if this entry has a TRIGGER property.
- ;; If yes, split it up on whitespace.
- (setq trigger (org-entry-get pos "TRIGGER")
- triggers (and trigger (org-split-string trigger "[ \t]+")))
-
- ;; Go through all the triggers
- (while (setq tr (pop triggers))
- (cond
- ((string-match "\\`chain-siblings(\\(.*?\\))\\'" tr)
- ;; This is a TODO chain of siblings
- (setq kwd (match-string 1 tr))
- (org-depend-act-on-sibling (format "chain-siblings(%s)" kwd)
- (org-todo kwd)))
-
- ((string-match "\\`\\(\\S-+\\)(\\(.*?\\))\\'" tr)
- ;; This seems to be ENTRY_ID(KEYWORD)
- (setq id (match-string 1 tr)
- kwd (match-string 2 tr)
- p1 (org-find-entry-with-id id))
- (when p1
- ;; there is an entry with this ID, mark it TODO
- (save-excursion
- (goto-char p1)
- (org-todo kwd))))
- ((string-match "\\`chain-siblings-scheduled\\'" tr)
- (let ((time (org-get-scheduled-time pos)))
- (when time
- (org-depend-act-on-sibling
- "chain-siblings-scheduled"
- (org-schedule nil time))))))))))
-
-(defun org-depend-block-todo (change-plist)
- "Block turning an entry into a TODO.
-This checks for a BLOCKER property in an entry and checks
-all the entries listed there. If any of them is not done,
-block changing the current entry into a TODO entry. If the property contains
-the word \"previous-sibling\", the sibling above the current entry is checked.
-Any other words are treated as entry id's. If an entry exists with the
-this ID property, that entry is also checked."
- ;; Get information from the plist
- (let* ((type (plist-get change-plist :type))
- (pos (plist-get change-plist :position))
- (from (plist-get change-plist :from))
- (to (plist-get change-plist :to))
- (org-log-done nil) ; IMPROTANT!: no logging during automatic trigger
- blocker blockers bl p1
- (proceed-p
- (catch 'return
- ;; If this is not a todo state change, or if this entry is
- ;; DONE, do not block
- (when (or (not (eq type 'todo-state-change))
- (member from (cons 'done org-done-keywords))
- (member to (cons 'todo org-not-done-keywords))
- (not to))
- (throw 'return t))
-
- ;; OK, the plan is to switch from nothing to TODO
- ;; Lets see if we will allow it. Find the BLOCKER property
- ;; and split it on whitespace.
- (setq blocker (org-entry-get pos "BLOCKER")
- blockers (and blocker (org-split-string blocker "[ \t]+")))
-
- ;; go through all the blockers
- (while (setq bl (pop blockers))
- (cond
- ((equal bl "previous-sibling")
- ;; the sibling is required to be DONE.
- (catch 'ignore
- (save-excursion
- (goto-char pos)
- ;; find the older sibling, exit if no more siblings
- (condition-case nil
- (outline-backward-same-level 1)
- (error (throw 'ignore t)))
- ;; Check if this entry is not yet done and block
- (unless (org-entry-is-done-p)
- ;; return nil, to indicate that we block the change!
- (org-mark-ring-push)
- (throw 'return nil)))))
-
- ((setq p1 (org-find-entry-with-id bl))
- ;; there is an entry with this ID, check it out
- (save-excursion
- (goto-char p1)
- (unless (org-entry-is-done-p)
- ;; return nil, to indicate that we block the change!
- (org-mark-ring-push)
- (throw 'return nil))))))
- t ; return t to indicate that we are not blocking
- )))
- (when org-depend-tag-blocked
- (org-toggle-tag "blocked" (if proceed-p 'off 'on)))
-
- proceed-p))
-
-(add-hook 'org-trigger-hook 'org-depend-trigger-todo)
-(add-hook 'org-blocker-hook 'org-depend-block-todo)
-
-(provide 'org-depend)
-
-;;; org-depend.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-drill.el b/.emacs.d/org-7.4/contrib/lisp/org-drill.el
deleted file mode 100644
index 6b5ff06..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-drill.el
+++ /dev/null
@@ -1,1144 +0,0 @@
-;;; org-drill.el - Self-testing with org-learn
-;;;
-;;; Author: Paul Sexton <eeeickythump@gmail.com>
-;;; Version: 1.4
-;;; Repository at http://bitbucket.org/eeeickythump/org-drill/
-;;;
-;;;
-;;; Synopsis
-;;; ========
-;;;
-;;; Uses the spaced repetition algorithm in `org-learn' to conduct interactive
-;;; "drill sessions", where the material to be remembered is presented to the
-;;; student in random order. The student rates his or her recall of each item,
-;;; and this information is fed back to `org-learn' to schedule the item for
-;;; later revision.
-;;;
-;;; Each drill session can be restricted to topics in the current buffer
-;;; (default), one or several files, all agenda files, or a subtree. A single
-;;; topic can also be drilled.
-;;;
-;;; Different "card types" can be defined, which present their information to
-;;; the student in different ways.
-;;;
-;;; See the file README.org for more detailed documentation.
-
-
-(eval-when-compile (require 'cl))
-(eval-when-compile (require 'hi-lock))
-(require 'org)
-(require 'org-learn)
-
-
-(defgroup org-drill nil
- "Options concerning interactive drill sessions in Org mode (org-drill)."
- :tag "Org-Drill"
- :group 'org-link)
-
-
-
-(defcustom org-drill-question-tag
- "drill"
- "Tag which topics must possess in order to be identified as review topics
-by `org-drill'."
- :group 'org-drill
- :type 'string)
-
-
-
-(defcustom org-drill-maximum-items-per-session
- 30
- "Each drill session will present at most this many topics for review.
-Nil means unlimited."
- :group 'org-drill
- :type '(choice integer (const nil)))
-
-
-
-(defcustom org-drill-maximum-duration
- 20
- "Maximum duration of a drill session, in minutes.
-Nil means unlimited."
- :group 'org-drill
- :type '(choice integer (const nil)))
-
-
-(defcustom org-drill-failure-quality
- 2
- "If the quality of recall for an item is this number or lower,
-it is regarded as an unambiguous failure, and the repetition
-interval for the card is reset to 0 days. By default this is
-2. For Mnemosyne-like behaviour, set it to 1. Other values are
-not really sensible."
- :group 'org-drill
- :type '(choice (const 2) (const 1)))
-
-
-(defcustom org-drill-leech-failure-threshold
- 15
- "If an item is forgotten more than this many times, it is tagged
-as a 'leech' item."
- :group 'org-drill
- :type '(choice integer (const nil)))
-
-
-(defcustom org-drill-leech-method
- 'skip
- "How should 'leech items' be handled during drill sessions?
-Possible values:
-- nil :: Leech items are treated the same as normal items.
-- skip :: Leech items are not included in drill sessions.
-- warn :: Leech items are still included in drill sessions,
- but a warning message is printed when each leech item is
- presented."
- :group 'org-drill
- :type '(choice (const 'warn) (const 'skip) (const nil)))
-
-
-(defface org-drill-visible-cloze-face
- '((t (:foreground "darkseagreen")))
- "The face used to hide the contents of cloze phrases."
- :group 'org-drill)
-
-
-(defface org-drill-visible-cloze-hint-face
- '((t (:foreground "dark slate blue")))
- "The face used to hide the contents of cloze phrases."
- :group 'org-drill)
-
-
-(defcustom org-drill-use-visible-cloze-face-p
- nil
- "Use a special face to highlight cloze-deleted text in org mode
-buffers?"
- :group 'org-drill
- :type 'boolean)
-
-
-(defface org-drill-hidden-cloze-face
- '((t (:foreground "deep sky blue" :background "blue")))
- "The face used to hide the contents of cloze phrases."
- :group 'org-drill)
-
-
-(defcustom org-drill-new-count-color
- "royal blue"
- "Foreground colour used to display the count of remaining new items
-during a drill session."
- :group 'org-drill
- :type 'color)
-
-(defcustom org-drill-mature-count-color
- "green"
- "Foreground colour used to display the count of remaining mature items
-during a drill session. Mature items are due for review, but are not new."
- :group 'org-drill
- :type 'color)
-
-(defcustom org-drill-failed-count-color
- "red"
- "Foreground colour used to display the count of remaining failed items
-during a drill session."
- :group 'org-drill
- :type 'color)
-
-(defcustom org-drill-done-count-color
- "sienna"
- "Foreground colour used to display the count of reviewed items
-during a drill session."
- :group 'org-drill
- :type 'color)
-
-
-(setplist 'org-drill-cloze-overlay-defaults
- '(display "[...]"
- face org-drill-hidden-cloze-face
- window t))
-
-
-(defvar org-drill-cloze-regexp
- ;; ver 1 "[^][]\\(\\[[^][][^]]*\\]\\)"
- ;; ver 2 "\\(\\[.*?\\]\\|^[^[[:cntrl:]]*?\\]\\|\\[.*?$\\)"
- ;; ver 3! "\\(\\[.*?\\]\\|\\[.*?[[:cntrl:]]+.*?\\]\\)"
- "\\(\\[[[:cntrl:][:graph:][:space:]]*?\\)\\(\\||.+?\\)\\(\\]\\)")
-
-(defvar org-drill-cloze-keywords
- `((,org-drill-cloze-regexp
- (1 'org-drill-visible-cloze-face nil)
- (2 'org-drill-visible-cloze-hint-face t)
- (3 'org-drill-visible-cloze-face nil)
- )))
-
-
-(defcustom org-drill-card-type-alist
- '((nil . org-drill-present-simple-card)
- ("simple" . org-drill-present-simple-card)
- ("twosided" . org-drill-present-two-sided-card)
- ("multisided" . org-drill-present-multi-sided-card)
- ("multicloze" . org-drill-present-multicloze)
- ("spanish_verb" . org-drill-present-spanish-verb))
- "Alist associating card types with presentation functions. Each entry in the
-alist takes the form (CARDTYPE . FUNCTION), where CARDTYPE is a string
-or nil, and FUNCTION is a function which takes no arguments and returns a
-boolean value."
- :group 'org-drill
- :type '(alist :key-type (choice string (const nil)) :value-type function))
-
-
-(defcustom org-drill-spaced-repetition-algorithm
- 'sm5
- "Which SuperMemo spaced repetition algorithm to use for scheduling items.
-Available choices are SM2 and SM5."
- :group 'org-drill
- :type '(choice (const 'sm2) (const 'sm5)))
-
-(defcustom org-drill-add-random-noise-to-intervals-p
- nil
- "If true, the number of days until an item's next repetition
-will vary slightly from the interval calculated by the SM2
-algorithm. The variation is very small when the interval is
-small, and scales up with the interval. The code for calculating
-random noise is adapted from Mnemosyne."
- :group 'org-drill
- :type 'boolean)
-
-(defcustom org-drill-cram-hours
- 12
- "When in cram mode, items are considered due for review if
-they were reviewed at least this many hours ago."
- :group 'org-drill
- :type 'integer)
-
-
-(defvar *org-drill-session-qualities* nil)
-(defvar *org-drill-start-time* 0)
-(defvar *org-drill-new-entries* nil)
-(defvar *org-drill-mature-entries* nil)
-(defvar *org-drill-failed-entries* nil)
-(defvar *org-drill-again-entries* nil)
-(defvar *org-drill-done-entries* nil)
-(defvar *org-drill-cram-mode* nil
- "Are we in 'cram mode', where all items are considered due
-for review unless they were already reviewed in the recent past?")
-
-
-
-;;;; Utilities ================================================================
-
-
-(defun free-marker (m)
- (set-marker m nil))
-
-
-(defmacro pop-random (place)
- (let ((elt (gensym)))
- `(if (null ,place)
- nil
- (let ((,elt (nth (random (length ,place)) ,place)))
- (setq ,place (remove ,elt ,place))
- ,elt))))
-
-
-(defun shuffle-list (list)
- "Randomly permute the elements of LIST (all permutations equally likely)."
- ;; Adapted from 'shuffle-vector' in cookie1.el
- (let ((i 0)
- j
- temp
- (len (length list)))
- (while (< i len)
- (setq j (+ i (random (- len i))))
- (setq temp (nth i list))
- (setf (nth i list) (nth j list))
- (setf (nth j list) temp)
- (setq i (1+ i))))
- list)
-
-
-(defun time-to-inactive-org-timestamp (time)
- (format-time-string
- (concat "[" (substring (cdr org-time-stamp-formats) 1 -1) "]")
- time))
-
-
-
-(defmacro with-hidden-cloze-text (&rest body)
- `(progn
- (org-drill-hide-clozed-text)
- (unwind-protect
- (progn
- ,@body)
- (org-drill-unhide-clozed-text))))
-
-
-(defun org-drill-days-since-last-review ()
- "Nil means a last review date has not yet been stored for
-the item.
-Zero means it was reviewed today.
-A positive number means it was reviewed that many days ago.
-A negative number means the date of last review is in the future --
-this should never happen."
- (let ((datestr (org-entry-get (point) "DRILL_LAST_REVIEWED")))
- (when datestr
- (- (time-to-days (current-time))
- (time-to-days (apply 'encode-time
- (org-parse-time-string datestr)))))))
-
-
-(defun org-drill-hours-since-last-review ()
- "Like `org-drill-days-since-last-review', but return value is
-in hours rather than days."
- (let ((datestr (org-entry-get (point) "DRILL_LAST_REVIEWED")))
- (when datestr
- (floor
- (/ (- (time-to-seconds (current-time))
- (time-to-seconds (apply 'encode-time
- (org-parse-time-string datestr))))
- (* 60 60))))))
-
-
-(defun org-drill-entry-p ()
- "Is the current entry a 'drill item'?"
- (or (org-entry-get (point) "LEARN_DATA")
- ;;(assoc "LEARN_DATA" (org-entry-properties nil))
- (member org-drill-question-tag (org-get-local-tags))))
-
-
-(defun org-part-of-drill-entry-p ()
- "Is the current entry either the main heading of a 'drill item',
-or a subheading within a drill item?"
- (or (org-drill-entry-p)
- ;; Does this heading INHERIT the drill tag
- (member org-drill-question-tag (org-get-tags-at))))
-
-
-(defun org-drill-goto-drill-entry-heading ()
- "Move the point to the heading which hold the :drill: tag for this
-drill entry."
- (unless (org-at-heading-p)
- (org-back-to-heading))
- (unless (org-part-of-drill-entry-p)
- (error "Point is not inside a drill entry"))
- (while (not (org-drill-entry-p))
- (unless (org-up-heading-safe)
- (error "Cannot find a parent heading that is marked as a drill entry"))))
-
-
-
-(defun org-drill-entry-leech-p ()
- "Is the current entry a 'leech item'?"
- (and (org-drill-entry-p)
- (member "leech" (org-get-local-tags))))
-
-
-(defun org-drill-entry-due-p ()
- (cond
- (*org-drill-cram-mode*
- (let ((hours (org-drill-hours-since-last-review)))
- (and (org-drill-entry-p)
- (or (null hours)
- (>= hours org-drill-cram-hours)))))
- (t
- (let ((item-time (org-get-scheduled-time (point))))
- (and (org-drill-entry-p)
- (or (not (eql 'skip org-drill-leech-method))
- (not (org-drill-entry-leech-p)))
- (or (null item-time)
- (not (minusp ; scheduled for today/in future
- (- (time-to-days (current-time))
- (time-to-days item-time))))))))))
-
-
-(defun org-drill-entry-new-p ()
- (and (org-drill-entry-p)
- (let ((item-time (org-get-scheduled-time (point))))
- (null item-time))))
-
-
-
-(defun org-drill-entry-last-quality ()
- (let ((quality (org-entry-get (point) "DRILL_LAST_QUALITY")))
- (if quality
- (string-to-number quality)
- nil)))
-
-
-;;; SM2 Algorithm =============================================================
-
-
-(defun determine-next-interval-sm2 (last-interval n ef quality of-matrix)
- "Arguments:
-- LAST-INTERVAL -- the number of days since the item was last reviewed.
-- N -- the number of times the item has been successfully reviewed
-- EF -- the 'easiness factor'
-- QUALITY -- 0 to 5
-- OF-MATRIX -- a matrix of values, used by SM5 but not by SM2.
-
-Returns a list: (INTERVAL N EF OFMATRIX), where:
-- INTERVAL is the number of days until the item should next be reviewed
-- N is incremented by 1.
-- EF is modified based on the recall quality for the item.
-- OF-MATRIX is not modified."
- (assert (> n 0))
- (assert (and (>= quality 0) (<= quality 5)))
- (if (<= quality org-drill-failure-quality)
- ;; When an item is failed, its interval is reset to 0,
- ;; but its EF is unchanged
- (list -1 1 ef of-matrix)
- ;; else:
- (let* ((next-ef (modify-e-factor ef quality))
- (interval
- (cond
- ((<= n 1) 1)
- ((= n 2)
- (cond
- (org-drill-add-random-noise-to-intervals-p
- (case quality
- (5 6)
- (4 4)
- (3 3)
- (2 1)
- (t -1)))
- (t 6)))
- (t (ceiling (* last-interval next-ef))))))
- (list (round
- (if org-drill-add-random-noise-to-intervals-p
- (+ last-interval (* (- interval last-interval)
- (org-drill-random-dispersal-factor)))
- interval))
- (1+ n) next-ef of-matrix))))
-
-
-;;; SM5 Algorithm =============================================================
-
-;;; From http://www.supermemo.com/english/ol/sm5.htm
-(defun org-drill-random-dispersal-factor ()
- (let ((a 0.047)
- (b 0.092)
- (p (- (random* 1.0) 0.5)))
- (flet ((sign (n)
- (cond ((zerop n) 0)
- ((plusp n) 1)
- (t -1))))
- (/ (+ 100 (* (* (/ -1 b) (log (- 1 (* (/ b a ) (abs p)))))
- (sign p)))
- 100))))
-
-
-(defun inter-repetition-interval-sm5 (last-interval n ef &optional of-matrix)
- (let ((of (get-optimal-factor n ef of-matrix)))
- (if (= 1 n)
- of
- (* of last-interval))))
-
-
-(defun determine-next-interval-sm5 (last-interval n ef quality of-matrix)
- (assert (> n 0))
- (assert (and (>= quality 0) (<= quality 5)))
- (let ((next-ef (modify-e-factor ef quality))
- (interval nil))
- (setq of-matrix
- (set-optimal-factor n next-ef of-matrix
- (modify-of (get-optimal-factor n ef of-matrix)
- quality org-learn-fraction))
- ef next-ef)
-
- (cond
- ;; "Failed" -- reset repetitions to 0,
- ((<= quality org-drill-failure-quality)
- (list -1 1 ef of-matrix)) ; Not clear if OF matrix is supposed to be
- ; preserved
- ;; For a zero-based quality of 4 or 5, don't repeat
- ((and (>= quality 4)
- (not org-learn-always-reschedule))
- (list 0 (1+ n) ef of-matrix)) ; 0 interval = unschedule
- (t
- (setq interval (inter-repetition-interval-sm5
- last-interval n ef of-matrix))
- (if org-drill-add-random-noise-to-intervals-p
- (setq interval (+ last-interval
- (* (- interval last-interval)
- (org-drill-random-dispersal-factor)))))
- (list (round interval) (1+ n) ef of-matrix)))))
-
-
-;;; Essentially copied from `org-learn.el', but modified to
-;;; optionally call the SM2 function above.
-(defun org-drill-smart-reschedule (quality)
- (interactive "nHow well did you remember the information (on a scale of 0-5)? ")
- (let* ((learn-str (org-entry-get (point) "LEARN_DATA"))
- (learn-data (or (and learn-str
- (read learn-str))
- (copy-list initial-repetition-state)))
- closed-dates)
- (setq learn-data
- (case org-drill-spaced-repetition-algorithm
- (sm5 (determine-next-interval-sm5 (nth 0 learn-data)
- (nth 1 learn-data)
- (nth 2 learn-data)
- quality
- (nth 3 learn-data)))
- (sm2 (determine-next-interval-sm2 (nth 0 learn-data)
- (nth 1 learn-data)
- (nth 2 learn-data)
- quality
- (nth 3 learn-data)))))
- (org-entry-put (point) "LEARN_DATA" (prin1-to-string learn-data))
- (cond
- ((= 0 (nth 0 learn-data))
- (org-schedule t))
- ((minusp (first learn-data))
- (org-schedule nil (current-time)))
- (t
- (org-schedule nil (time-add (current-time)
- (days-to-time (nth 0 learn-data))))))))
-
-
-(defun org-drill-reschedule ()
- "Returns quality rating (0-5), or nil if the user quit."
- (let ((ch nil))
- (while (not (memq ch '(?q ?e ?0 ?1 ?2 ?3 ?4 ?5)))
- (setq ch (read-char-exclusive
- (if (eq ch ??)
- "0-2 Means you have forgotten the item.
-3-5 Means you have remembered the item.
-
-0 - Completely forgot.
-1 - Even after seeing the answer, it still took a bit to sink in.
-2 - After seeing the answer, you remembered it.
-3 - It took you awhile, but you finally remembered.
-4 - After a little bit of thought you remembered.
-5 - You remembered the item really easily.
-
-How well did you do? (0-5, ?=help, e=edit, t=tags, q=quit)"
- "How well did you do? (0-5, ?=help, e=edit, q=quit)")))
- (if (eql ch ?t)
- (org-set-tags-command)))
- (cond
- ((and (>= ch ?0) (<= ch ?5))
- (let ((quality (- ch ?0))
- (failures (org-entry-get (point) "DRILL_FAILURE_COUNT")))
- (save-excursion
- (org-drill-smart-reschedule quality))
- (push quality *org-drill-session-qualities*)
- (cond
- ((<= quality org-drill-failure-quality)
- (when org-drill-leech-failure-threshold
- (setq failures (if failures (string-to-number failures) 0))
- (org-set-property "DRILL_FAILURE_COUNT"
- (format "%d" (1+ failures)))
- (if (> (1+ failures) org-drill-leech-failure-threshold)
- (org-toggle-tag "leech" 'on))))
- (t
- (let ((scheduled-time (org-get-scheduled-time (point))))
- (when scheduled-time
- (message "Next review in %d days"
- (- (time-to-days scheduled-time)
- (time-to-days (current-time))))
- (sit-for 0.5)))))
- (org-set-property "DRILL_LAST_QUALITY" (format "%d" quality))
- (org-set-property "DRILL_LAST_REVIEWED"
- (time-to-inactive-org-timestamp (current-time)))
- quality))
- ((= ch ?e)
- 'edit)
- (t
- nil))))
-
-
-(defun org-drill-hide-all-subheadings-except (heading-list)
- "Returns a list containing the position of each immediate subheading of
-the current topic."
- (let ((drill-entry-level (org-current-level))
- (drill-sections nil)
- (drill-heading nil))
- (org-show-subtree)
- (save-excursion
- (org-map-entries
- (lambda ()
- (when (= (org-current-level) (1+ drill-entry-level))
- (setq drill-heading (org-get-heading t))
- (unless (member drill-heading heading-list)
- (hide-subtree))
- (push (point) drill-sections)))
- "" 'tree))
- (reverse drill-sections)))
-
-
-
-(defun org-drill-presentation-prompt (&rest fmt-and-args)
- (let* ((item-start-time (current-time))
- (ch nil)
- (last-second 0)
- (prompt
- (if fmt-and-args
- (apply 'format
- (first fmt-and-args)
- (rest fmt-and-args))
- (concat "Press key for answer, "
- "e=edit, t=tags, s=skip, q=quit."))))
- (setq prompt
- (format "%s %s %s %s %s"
- (propertize
- (number-to-string (length *org-drill-done-entries*))
- 'face `(:foreground ,org-drill-done-count-color)
- 'help-echo "The number of items you have reviewed this session.")
- (propertize
- (number-to-string (+ (length *org-drill-again-entries*)
- (length *org-drill-failed-entries*)))
- 'face `(:foreground ,org-drill-failed-count-color)
- 'help-echo (concat "The number of items that you failed, "
- "and need to review again."))
- (propertize
- (number-to-string (length *org-drill-mature-entries*))
- 'face `(:foreground ,org-drill-mature-count-color)
- 'help-echo "The number of old items due for review.")
- (propertize
- (number-to-string (length *org-drill-new-entries*))
- 'face `(:foreground ,org-drill-new-count-color)
- 'help-echo (concat "The number of new items that you "
- "have never reviewed."))
- prompt))
- (if (and (eql 'warn org-drill-leech-method)
- (org-drill-entry-leech-p))
- (setq prompt (concat
- (propertize "!!! LEECH ITEM !!!
-You seem to be having a lot of trouble memorising this item.
-Consider reformulating the item to make it easier to remember.\n"
- 'face '(:foreground "red"))
- prompt)))
- (while (memq ch '(nil ?t))
- (while (not (input-pending-p))
- (message (concat (format-time-string
- "%M:%S " (time-subtract
- (current-time) item-start-time))
- prompt))
- (sit-for 1))
- (setq ch (read-char-exclusive))
- (if (eql ch ?t)
- (org-set-tags-command)))
- (case ch
- (?q nil)
- (?e 'edit)
- (?s 'skip)
- (otherwise t))))
-
-
-(defun org-pos-in-regexp (pos regexp &optional nlines)
- (save-excursion
- (goto-char pos)
- (org-in-regexp regexp nlines)))
-
-
-(defun org-drill-hide-clozed-text ()
- (save-excursion
- (while (re-search-forward org-drill-cloze-regexp nil t)
- ;; Don't hide org links, partly because they might contain inline
- ;; images which we want to keep visible
- (unless (org-pos-in-regexp (match-beginning 0)
- org-bracket-link-regexp 1)
- (org-drill-hide-matched-cloze-text)))))
-
-
-(defun org-drill-hide-matched-cloze-text ()
- "Hide the current match with a 'cloze' visual overlay."
- (let ((ovl (make-overlay (match-beginning 0) (match-end 0))))
- (overlay-put ovl 'category
- 'org-drill-cloze-overlay-defaults)
- (when (find ?| (match-string 0))
- (overlay-put ovl
- 'display
- (format "[...%s]"
- (substring-no-properties
- (match-string 0)
- (1+ (position ?| (match-string 0)))
- (1- (length (match-string 0)))))))))
-
-
-(defun org-drill-unhide-clozed-text ()
- (save-excursion
- (dolist (ovl (overlays-in (point-min) (point-max)))
- (when (eql 'org-drill-cloze-overlay-defaults (overlay-get ovl 'category))
- (delete-overlay ovl)))))
-
-
-
-;;; Presentation functions ====================================================
-
-;; Each of these is called with point on topic heading. Each needs to show the
-;; topic in the form of a 'question' or with some information 'hidden', as
-;; appropriate for the card type. The user should then be prompted to press a
-;; key. The function should then reveal either the 'answer' or the entire
-;; topic, and should return t if the user chose to see the answer and rate their
-;; recall, nil if they chose to quit.
-
-(defun org-drill-present-simple-card ()
- (with-hidden-cloze-text
- (org-drill-hide-all-subheadings-except nil)
- (org-display-inline-images t)
- (org-cycle-hide-drawers 'all)
- (prog1 (org-drill-presentation-prompt)
- (org-show-subtree))))
-
-
-(defun org-drill-present-two-sided-card ()
- (with-hidden-cloze-text
- (let ((drill-sections (org-drill-hide-all-subheadings-except nil)))
- (when drill-sections
- (save-excursion
- (goto-char (nth (random (min 2 (length drill-sections)))
- drill-sections))
- (org-show-subtree)))
- (org-display-inline-images t)
- (org-cycle-hide-drawers 'all)
- (prog1
- (org-drill-presentation-prompt)
- (org-show-subtree)))))
-
-
-
-(defun org-drill-present-multi-sided-card ()
- (with-hidden-cloze-text
- (let ((drill-sections (org-drill-hide-all-subheadings-except nil)))
- (when drill-sections
- (save-excursion
- (goto-char (nth (random (length drill-sections)) drill-sections))
- (org-show-subtree)))
- (org-display-inline-images t)
- (org-cycle-hide-drawers 'all)
- (prog1
- (org-drill-presentation-prompt)
- (org-show-subtree)))))
-
-
-(defun org-drill-present-multicloze ()
- (let ((item-end nil)
- (match-count 0)
- (body-start (or (cdr (org-get-property-block))
- (point))))
- (org-drill-hide-all-subheadings-except nil)
- (save-excursion
- (outline-next-heading)
- (setq item-end (point)))
- (save-excursion
- (goto-char body-start)
- (while (re-search-forward org-drill-cloze-regexp item-end t)
- (incf match-count)))
- (when (plusp match-count)
- (save-excursion
- (goto-char body-start)
- (re-search-forward org-drill-cloze-regexp
- item-end t (1+ (random match-count)))
- (org-drill-hide-matched-cloze-text)))
- (org-display-inline-images t)
- (org-cycle-hide-drawers 'all)
- (prog1 (org-drill-presentation-prompt)
- (org-show-subtree)
- (org-drill-unhide-clozed-text))))
-
-
-(defun org-drill-present-spanish-verb ()
- (let ((prompt nil)
- (reveal-headings nil))
- (with-hidden-cloze-text
- (case (random 6)
- (0
- (org-drill-hide-all-subheadings-except '("Infinitive"))
- (setq prompt
- (concat "Translate this Spanish verb, and conjugate it "
- "for the *present* tense.")
- reveal-headings '("English" "Present Tense" "Notes")))
- (1
- (org-drill-hide-all-subheadings-except '("English"))
- (setq prompt (concat "For the *present* tense, conjugate the "
- "Spanish translation of this English verb.")
- reveal-headings '("Infinitive" "Present Tense" "Notes")))
- (2
- (org-drill-hide-all-subheadings-except '("Infinitive"))
- (setq prompt (concat "Translate this Spanish verb, and "
- "conjugate it for the *past* tense.")
- reveal-headings '("English" "Past Tense" "Notes")))
- (3
- (org-drill-hide-all-subheadings-except '("English"))
- (setq prompt (concat "For the *past* tense, conjugate the "
- "Spanish translation of this English verb.")
- reveal-headings '("Infinitive" "Past Tense" "Notes")))
- (4
- (org-drill-hide-all-subheadings-except '("Infinitive"))
- (setq prompt (concat "Translate this Spanish verb, and "
- "conjugate it for the *future perfect* tense.")
- reveal-headings '("English" "Future Perfect Tense" "Notes")))
- (5
- (org-drill-hide-all-subheadings-except '("English"))
- (setq prompt (concat "For the *future perfect* tense, conjugate the "
- "Spanish translation of this English verb.")
- reveal-headings '("Infinitive" "Future Perfect Tense" "Notes"))))
- (org-cycle-hide-drawers 'all)
- (prog1
- (org-drill-presentation-prompt prompt)
- (org-drill-hide-all-subheadings-except reveal-headings)))))
-
-
-
-(defun org-drill-entry ()
- "Present the current topic for interactive review, as in `org-drill'.
-Review will occur regardless of whether the topic is due for review or whether
-it meets the definition of a 'review topic' used by `org-drill'.
-
-Returns a quality rating from 0 to 5, or nil if the user quit, or the symbol
-EDIT if the user chose to exit the drill and edit the current item.
-
-See `org-drill' for more details."
- (interactive)
- (org-drill-goto-drill-entry-heading)
- ;;(unless (org-part-of-drill-entry-p)
- ;; (error "Point is not inside a drill entry"))
- ;;(unless (org-at-heading-p)
- ;; (org-back-to-heading))
- (let ((card-type (org-entry-get (point) "DRILL_CARD_TYPE"))
- (cont nil))
- (save-restriction
- (org-narrow-to-subtree)
- (org-show-subtree)
- (org-cycle-hide-drawers 'all)
-
- (let ((presentation-fn (cdr (assoc card-type org-drill-card-type-alist))))
- (cond
- (presentation-fn
- (setq cont (funcall presentation-fn)))
- (t
- (error "Unknown card type: '%s'" card-type))))
-
- (cond
- ((not cont)
- (message "Quit")
- nil)
- ((eql cont 'edit)
- 'edit)
- ((eql cont 'skip)
- 'skip)
- (t
- (save-excursion
- (org-drill-reschedule)))))))
-
-
-;; (defun org-drill-entries (entries)
-;; "Returns nil, t, or a list of markers representing entries that were
-;; 'failed' and need to be presented again before the session ends."
-;; (let ((again-entries nil))
-;; (setq *org-drill-done-entry-count* 0
-;; *org-drill-pending-entry-count* (length entries))
-;; (if (and org-drill-maximum-items-per-session
-;; (> (length entries)
-;; org-drill-maximum-items-per-session))
-;; (setq entries (subseq entries 0
-;; org-drill-maximum-items-per-session)))
-;; (block org-drill-entries
-;; (dolist (m entries)
-;; (save-restriction
-;; (switch-to-buffer (marker-buffer m))
-;; (goto-char (marker-position m))
-;; (setq result (org-drill-entry))
-;; (cond
-;; ((null result)
-;; (message "Quit")
-;; (return-from org-drill-entries nil))
-;; ((eql result 'edit)
-;; (setq end-pos (point-marker))
-;; (return-from org-drill-entries nil))
-;; (t
-;; (cond
-;; ((< result 3)
-;; (push m again-entries))
-;; (t
-;; (decf *org-drill-pending-entry-count*)
-;; (incf *org-drill-done-entry-count*)))
-;; (when (and org-drill-maximum-duration
-;; (> (- (float-time (current-time)) *org-drill-start-time*)
-;; (* org-drill-maximum-duration 60)))
-;; (message "This drill session has reached its maximum duration.")
-;; (return-from org-drill-entries nil))))))
-;; (or again-entries
-;; t))))
-
-
-(defun org-drill-entries-pending-p ()
- (or *org-drill-again-entries*
- (and (not (org-drill-maximum-item-count-reached-p))
- (not (org-drill-maximum-duration-reached-p))
- (or *org-drill-new-entries*
- *org-drill-failed-entries*
- *org-drill-mature-entries*
- *org-drill-again-entries*))))
-
-
-(defun org-drill-pending-entry-count ()
- (+ (length *org-drill-new-entries*)
- (length *org-drill-failed-entries*)
- (length *org-drill-mature-entries*)
- (length *org-drill-again-entries*)))
-
-
-(defun org-drill-maximum-duration-reached-p ()
- "Returns true if the current drill session has continued past its
-maximum duration."
- (and org-drill-maximum-duration
- *org-drill-start-time*
- (> (- (float-time (current-time)) *org-drill-start-time*)
- (* org-drill-maximum-duration 60))))
-
-
-(defun org-drill-maximum-item-count-reached-p ()
- "Returns true if the current drill session has reached the
-maximum number of items."
- (and org-drill-maximum-items-per-session
- (>= (length *org-drill-done-entries*)
- org-drill-maximum-items-per-session)))
-
-
-(defun org-drill-pop-next-pending-entry ()
- (cond
- ;; First priority is items we failed in a prior session.
- ((and *org-drill-failed-entries*
- (not (org-drill-maximum-item-count-reached-p))
- (not (org-drill-maximum-duration-reached-p)))
- (pop-random *org-drill-failed-entries*))
- ;; Next priority is newly added items, and items which
- ;; are not new and were not failed when they were last
- ;; reviewed.
- ((and (or *org-drill-new-entries*
- *org-drill-mature-entries*)
- (not (org-drill-maximum-item-count-reached-p))
- (not (org-drill-maximum-duration-reached-p)))
- (if (< (random (+ (length *org-drill-new-entries*)
- (length *org-drill-mature-entries*)))
- (length *org-drill-new-entries*))
- (pop-random *org-drill-new-entries*)
- ;; else
- (pop-random *org-drill-mature-entries*)))
- ;; After all the above are done, last priority is items
- ;; that were failed earlier THIS SESSION.
- (*org-drill-again-entries*
- (pop-random *org-drill-again-entries*))
- (t
- nil)))
-
-
-(defun org-drill-entries ()
- "Returns nil, t, or a list of markers representing entries that were
-'failed' and need to be presented again before the session ends."
- (block org-drill-entries
- (while (org-drill-entries-pending-p)
- (setq m (org-drill-pop-next-pending-entry))
- (unless m
- (error "Unexpectedly ran out of pending drill items"))
- (save-excursion
- (set-buffer (marker-buffer m))
- (goto-char m)
- (setq result (org-drill-entry))
- (cond
- ((null result)
- (message "Quit")
- (return-from org-drill-entries nil))
- ((eql result 'edit)
- (setq end-pos (point-marker))
- (return-from org-drill-entries nil))
- ((eql result 'skip)
- nil) ; skip this item
- (t
- (cond
- ((<= result org-drill-failure-quality)
- (push m *org-drill-again-entries*))
- (t
- (push m *org-drill-done-entries*)))))))))
-
-
-
-(defun org-drill-final-report ()
- (read-char-exclusive
- (format
- "%d items reviewed
-%d items awaiting review (%s, %s, %s)
-Session duration %s
-
-Recall of reviewed items:
- Excellent (5): %3d%% | Near miss (2): %3d%%
- Good (4): %3d%% | Failure (1): %3d%%
- Hard (3): %3d%% | Total failure (0): %3d%%
-
-Session finished. Press a key to continue..."
- (length *org-drill-done-entries*)
- (org-drill-pending-entry-count)
- (propertize
- (format "%d failed"
- (+ (length *org-drill-failed-entries*)
- (length *org-drill-again-entries*)))
- 'face `(:foreground ,org-drill-failed-count-color))
- (propertize
- (format "%d old"
- (length *org-drill-mature-entries*))
- 'face `(:foreground ,org-drill-mature-count-color))
- (propertize
- (format "%d new"
- (length *org-drill-new-entries*))
- 'face `(:foreground ,org-drill-new-count-color))
- (format-seconds "%h:%.2m:%.2s"
- (- (float-time (current-time)) *org-drill-start-time*))
- (round (* 100 (count 5 *org-drill-session-qualities*))
- (max 1 (length *org-drill-session-qualities*)))
- (round (* 100 (count 2 *org-drill-session-qualities*))
- (max 1 (length *org-drill-session-qualities*)))
- (round (* 100 (count 4 *org-drill-session-qualities*))
- (max 1 (length *org-drill-session-qualities*)))
- (round (* 100 (count 1 *org-drill-session-qualities*))
- (max 1 (length *org-drill-session-qualities*)))
- (round (* 100 (count 3 *org-drill-session-qualities*))
- (max 1 (length *org-drill-session-qualities*)))
- (round (* 100 (count 0 *org-drill-session-qualities*))
- (max 1 (length *org-drill-session-qualities*)))
- )))
-
-
-
-(defun org-drill (&optional scope)
- "Begin an interactive 'drill session'. The user is asked to
-review a series of topics (headers). Each topic is initially
-presented as a 'question', often with part of the topic content
-hidden. The user attempts to recall the hidden information or
-answer the question, then presses a key to reveal the answer. The
-user then rates his or her recall or performance on that
-topic. This rating information is used to reschedule the topic
-for future review using the `org-learn' library.
-
-Org-drill proceeds by:
-
-- Finding all topics (headings) in SCOPE which have either been
- used and rescheduled by org-learn before (i.e. the LEARN_DATA
- property is set), or which have a tag that matches
- `org-drill-question-tag'.
-
-- All matching topics which are either unscheduled, or are
- scheduled for the current date or a date in the past, are
- considered to be candidates for the drill session.
-
-- If `org-drill-maximum-items-per-session' is set, a random
- subset of these topics is presented. Otherwise, all of the
- eligible topics will be presented.
-
-SCOPE determines the scope in which to search for
-questions. It is passed to `org-map-entries', and can be any of:
-
-nil The current buffer, respecting the restriction if any.
- This is the default.
-tree The subtree started with the entry at point
-file The current buffer, without restriction
-file-with-archives
- The current buffer, and any archives associated with it
-agenda All agenda files
-agenda-with-archives
- All agenda files with any archive files associated with them
- (file1 file2 ...)
- If this is a list, all files in the list will be scanned."
-
- (interactive)
- (let ((entries nil)
- (failed-entries nil)
- (result nil)
- (results nil)
- (end-pos nil)
- (cnt 0))
- (block org-drill
- (setq *org-drill-done-entries* nil
- *org-drill-new-entries* nil
- *org-drill-mature-entries* nil
- *org-drill-failed-entries* nil
- *org-drill-again-entries* nil)
- (setq *org-drill-session-qualities* nil)
- (setq *org-drill-start-time* (float-time (current-time)))
- (unwind-protect
- (save-excursion
- (let ((org-trust-scanner-tags t))
- (org-map-entries
- (lambda ()
- (when (zerop (% (incf cnt) 50))
- (message "Processing drill items: %4d%s"
- (+ (length *org-drill-new-entries*)
- (length *org-drill-mature-entries*)
- (length *org-drill-failed-entries*))
- (make-string (ceiling cnt 50) ?.)))
- (when (org-drill-entry-due-p)
- (cond
- ((org-drill-entry-new-p)
- (push (point-marker) *org-drill-new-entries*))
- ((and (org-drill-entry-last-quality)
- (<= (org-drill-entry-last-quality)
- org-drill-failure-quality))
- (push (point-marker) *org-drill-failed-entries*))
- (t
- (push (point-marker) *org-drill-mature-entries*)))))
- (concat "+" org-drill-question-tag) scope))
- ;; Failed first, then random mix of old + new
- (setq entries (append (shuffle-list *org-drill-failed-entries*)
- (shuffle-list (append *org-drill-mature-entries*
- *org-drill-new-entries*))))
- (cond
- ((and (null *org-drill-new-entries*)
- (null *org-drill-failed-entries*)
- (null *org-drill-mature-entries*))
- (message "I did not find any pending drill items."))
- (t
- (org-drill-entries)
- (message "Drill session finished!"))))
- ;; (cond
- ;; ((null entries)
- ;; (message "I did not find any pending drill items."))
- ;; (t
- ;; (let ((again t))
- ;; (while again
- ;; (when (listp again)
- ;; (setq entries (shuffle-list again)))
- ;; (setq again (org-drill-entries entries))
- ;; (cond
- ;; ((null again)
- ;; (return-from org-drill nil))
- ;; ((eql t again)
- ;; (setq again nil))))
- ;; (message "Drill session finished!")
- ;; ))))
- (progn
- (dolist (m (append *org-drill-new-entries*
- *org-drill-failed-entries*
- *org-drill-again-entries*
- *org-drill-mature-entries*))
- (free-marker m)))))
- (cond
- (end-pos
- (switch-to-buffer (marker-buffer end-pos))
- (goto-char (marker-position end-pos))
- (message "Edit topic."))
- (t
- (org-drill-final-report)))))
-
-
-(defun org-drill-cram (&optional scope)
- "Run an interactive drill session in 'cram mode'. In cram mode,
-all drill items are considered to be due for review, unless they
-have been reviewed within the last `org-drill-cram-hours'
-hours."
- (interactive)
- (let ((*org-drill-cram-mode* t))
- (org-drill scope)))
-
-
-
-(add-hook 'org-mode-hook
- (lambda ()
- (if org-drill-use-visible-cloze-face-p
- (font-lock-add-keywords
- 'org-mode
- org-drill-cloze-keywords
- t))))
-
-
-
-(provide 'org-drill)
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-elisp-symbol.el b/.emacs.d/org-7.4/contrib/lisp/org-elisp-symbol.el
deleted file mode 100644
index b826467..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-elisp-symbol.el
+++ /dev/null
@@ -1,159 +0,0 @@
-;;; org-elisp-symbol.el --- Org links to emacs-lisp symbols
-;;
-;; Copyright 2007, 2008, 2009 Bastien Guerry
-;;
-;; Author: bzg AT altern DOT org
-;; Version: 0.2
-;; Keywords: org, remember, lisp
-;; URL: http://www.cognition.ens.fr/~guerry/u/org-elisp-symbol.el
-;;
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with this program; if not, write to the Free Software
-;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-;;
-;;; Commentary:
-;;
-;; Org-mode already lets you store/insert links to emacs-lisp files,
-;; just like any other file. This package lets you precisely link to
-;; any emacs-lisp symbol and access useful information about the symbol.
-;;
-;; Here is the list of available properties when linking from a elisp-symbol:
-;;
-;; :name The symbol's name.
-;; :stype The symbol's type (commandp, function, etc.)
-;; :def The function used to set the symbol's value (defun, etc.)
-;; :keys The keys associated with the command.
-;; :args The arguments of the function.
-;; :docstring The docstring of the symbol.
-;; :doc The first line of the dostring.
-;; :comment A comment line just above the sexp, if any.
-;; :fixme A FIXME comment line just above the sexp, if any.
-;;
-;; Let's say we have a defun like this one:
-;;
-;; ;; FIXME update docstring
-;; (defun org-export-latex-lists ()
-;; "Convert lists to LaTeX."
-;; (goto-char (point-min))
-;; (while (re-search-forward org-export-latex-list-beginning-re nil t)
-;; (beginning-of-line)
-;; (insert (org-list-to-latex (org-list-parse-list t)) "\n")))
-;;
-;; And a remember template like:
-;;
-;; (setq org-remember-templates
-;; '((?s "* DEBUG `%:name' (%:args)\n\n%?\n\nFixme: %:fixme\n \
-;; Doc: \"%:doc\"\n\n%a")))
-;;
-;; Then M-x `org-remember' on this sexp will produce this buffer:
-;;
-;; =====================================================================
-;; * DEBUG `org-export-latex-lists' ()
-;;
-;; <== point
-;;
-;; Fixme: update the docstring
-;; Doc: "Convert lists to LaTeX."
-;;
-;; [[file:~/path/file.el::defun%20my-func][Function: my-func]]
-;; =====================================================================
-;;
-;; Put this file into your load-path and the following into your ~/.emacs:
-;; (require 'org-elisp-symbol)
-
-;;; Code:
-
-(provide 'org-elisp-symbol)
-
-(require 'org)
-
-(org-add-link-type "elisp-symbol" 'org-elisp-symbol-open)
-(add-hook 'org-store-link-functions 'org-elisp-symbol-store-link)
-
-(defun org-elisp-symbol-open (path)
- "Visit the emacs-lisp elisp-symbol at PATH."
- (let* ((search (when (string-match "::\\(.+\\)\\'" path)
- (match-string 1 path)))
- (path (substring path 0 (match-beginning 0))))
- (org-open-file path t nil search)))
-
-(defun org-elisp-symbol-store-link ()
- "Store a link to an emacs-lisp elisp-symbol."
- (when (eq major-mode 'emacs-lisp-mode)
- (save-excursion
- (or (looking-at "^(") (beginning-of-defun))
- (looking-at "^(\\([a-z]+\\) \\([^)\n ]+\\) ?\n?[ \t]*\\(?:(\\(.*\\))\\)?")
- (let* ((end (save-excursion
- (save-match-data
- (end-of-defun) (point))))
- (def (match-string 1))
- (name (match-string 2))
- (sym-name (intern-soft name))
- (stype (cond ((commandp sym-name) "Command")
- ((functionp sym-name) "Function")
- ((user-variable-p sym-name) "User variable")
- ((eq def "defvar") "Variable")
- ((eq def "defmacro") "Macro")
- (t "Symbol")))
- (args (if (match-string 3)
- (mapconcat (lambda (a) (unless (string-match "^&" a) a))
- (split-string (match-string 3)) " ")
- "no arg"))
- (docstring (cond ((functionp sym-name)
- (or (documentation sym-name)
- "[no documentation]"))
- ((string-match "[Vv]ariable" stype)
- (documentation-property sym-name
- 'variable-documentation))
- (t "no documentation")))
- (doc (and (string-match "^\\([^\n]+\\)$" docstring)
- (match-string 1 docstring)))
- (fixme (save-excursion
- (beginning-of-defun) (end-of-defun)
- (if (re-search-forward "^;+ ?FIXME[ :]*\\(.*\\)$" end t)
- (match-string 1) "nothing to fix")))
- (comment (save-excursion
- (beginning-of-defun) (end-of-defun)
- (if (re-search-forward "^;;+ ?\\(.*\\)$" end t)
- (match-string 1) "no comment")))
- keys keys-desc link description)
- (if (equal stype "Command")
- (setq keys (where-is-internal sym-name)
- keys-desc
- (if keys (mapconcat 'key-description keys " ") "none")))
- (setq link (concat "file:" (abbreviate-file-name buffer-file-name)
- "::" def " " name))
- (setq description (concat stype ": " name))
- (org-store-link-props
- :type "elisp-symbol"
- :link link
- :description description
- :def def
- :name name
- :stype stype
- :args args
- :keys keys-desc
- :docstring docstring
- :doc doc
- :fixme fixme
- :comment comment)))))
-
-(provide 'org-elisp-symbol)
-
-
-;;;;##########################################################################
-;;;; User Options, Variables
-;;;;##########################################################################
-
-
-;;; org-elisp-symbol.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-eval-light.el b/.emacs.d/org-7.4/contrib/lisp/org-eval-light.el
deleted file mode 100644
index c571ea0..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-eval-light.el
+++ /dev/null
@@ -1,200 +0,0 @@
-;;; org-eval-light.el --- Display result of evaluating code in various languages (light)
-
-;; Copyright (C) 2008 Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>,
-;; Eric Schulte <schulte dot eric at gmail dot com>
-;; Keywords: outlines, hypermedia, calendar, wp, literate programming,
-;; reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 0.04
-
-;; This file is not yet part of GNU Emacs.
-
-;; GNU Emacs is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; This file is based off of org-eval, with the following changes.
-;;
-;; 1) forms are only executed manually, (allowing for the execution of
-;; an entire subtree of forms)
-;; 2) use the org-mode style src blocks, rather than the muse style
-;; <code></code> blocks
-;; 3) forms are not replaced by their outputs, but rather the output
-;; is placed in the buffer immediately following the src block
-;; commented by `org-eval-light-make-region-example' (when
-;; evaluated with a prefix argument no output is placed in the
-;; buffer)
-;; 4) add defadvice to org-ctrl-c-ctrl-c so that when called inside of
-;; a source block it will call `org-eval-light-current-snippet'
-
-;;; Code:
-(require 'org)
-
-(defgroup org-eval-light nil
- "Options concerning including output from commands into the Org-mode buffer."
- :tag "Org Eval"
- :group 'org)
-
-(defvar org-eval-light-example-size-cutoff 10
- "The number of lines under which an example is considered
-'small', and is exported with the '^:' syntax instead of in a
-large example block")
-
-(defvar org-eval-light-regexp nil)
-
-(defun org-eval-light-set-interpreters (var value)
- (set-default var value)
- (setq org-eval-light-regexp
- (concat "#\\+begin_src \\("
- (mapconcat 'regexp-quote value "\\|")
- "\\)\\([^\000]+?\\)#\\+end_src")))
-
-(defcustom org-eval-light-interpreters '("lisp" "emacs-lisp" "ruby" "shell")
- "Interpreters allows for evaluation tags.
-This is a list of program names (as strings) that can evaluate code and
-insert the output into an Org-mode buffer. Valid choices are
-
-lisp Interpret Emacs Lisp code and display the result
-shell Pass command to the shell and display the result
-perl The perl interpreter
-python Thy python interpreter
-ruby The ruby interpreter"
- :group 'org-eval-light
- :set 'org-eval-light-set-interpreters
- :type '(set :greedy t
- (const "lisp")
- (const "emacs-lisp")
- (const "perl")
- (const "python")
- (const "ruby")
- (const "shell")))
-
-;;; functions
-(defun org-eval-light-inside-snippet ()
- (interactive)
- (save-excursion
- (let ((case-fold-search t)
- (start-re "^#\\+begin_src\\( \\([^ \t\n]+\\)\\)?.*\n")
- (end-re "\n#\\+end_src")
- (pos (point))
- beg end)
- (if (and (setq beg (re-search-backward start-re nil t))
- (setq end (re-search-forward end-re nil t))
- (<= beg pos) (>= end pos))
- t))))
-
-(defun org-eval-light-make-region-example (beg end)
- "Comment out region using either the '^:' or the BEGIN_EXAMPLE
-syntax based on the size of the region as compared to
-`org-eval-light-example-size-cutoff'."
- (interactive "*r")
- (let ((size (abs (- (line-number-at-pos end)
- (line-number-at-pos beg)))))
- (if (= size 0)
- (let ((result (buffer-substring beg end)))
- (delete-region beg end)
- (insert (concat ": " result)))
- (if (<= size org-eval-light-example-size-cutoff)
- (save-excursion
- (goto-char beg)
- (dotimes (n size)
- (move-beginning-of-line 1) (insert ": ") (forward-line 1)))
- (let ((result (buffer-substring beg end)))
- (delete-region beg end)
- (insert (concat "#+BEGIN_EXAMPLE\n" result "#+END_EXAMPLE\n")))))))
-
-(defun org-eval-light-current-snippet (&optional arg)
- "Execute the current #+begin_src #+end_src block, and dump the
-results into the buffer immediately following the src block,
-commented by `org-eval-light-make-region-example'."
- (interactive "P")
- (let ((line (org-current-line))
- (case-fold-search t)
- (info (org-edit-src-find-region-and-lang))
- beg end lang result)
- (setq beg (nth 0 info)
- end (nth 1 info)
- lang (nth 2 info))
- (unless (member lang org-eval-light-interpreters)
- (error "Language is not in `org-eval-light-interpreters': %s" lang))
- (goto-line line)
- (setq result (org-eval-light-code lang (buffer-substring beg end)))
- (unless arg
- (save-excursion
- (re-search-forward "^#\\+end_src" nil t) (open-line 1) (forward-char 2)
- (let ((beg (point))
- (end (progn (insert result)
- (point))))
- (message (format "from %S %S" beg end))
- (org-eval-light-make-region-example beg end))))))
-
-(defun org-eval-light-eval-subtree (&optional arg)
- "Replace EVAL snippets in the entire subtree."
- (interactive "P")
- (save-excursion
- (org-narrow-to-subtree)
- (goto-char (point-min))
- (while (re-search-forward org-eval-light-regexp nil t)
- (org-eval-light-current-snippet arg))
- (widen)))
-
-(defun org-eval-light-code (interpreter code)
- (cond
- ((member interpreter '("lisp" "emacs-lisp"))
- (org-eval-light-lisp (concat "(progn\n" code "\n)")))
- ((equal interpreter "shell")
- (shell-command-to-string code))
- ((member interpreter '("perl" "python" "ruby"))
- (org-eval-light-run (executable-find interpreter) code))
- (t (error "Cannot evaluate code type %s" interpreter))))
-
-(defun org-eval-light-lisp (form)
- "Evaluate the given form and return the result as a string."
- (require 'pp)
- (save-match-data
- (condition-case err
- (let ((object (eval (read form))))
- (cond
- ((stringp object) object)
- ((and (listp object)
- (not (eq object nil)))
- (let ((string (pp-to-string object)))
- (substring string 0 (1- (length string)))))
- ((numberp object)
- (number-to-string object))
- ((eq object nil) "")
- (t
- (pp-to-string object))))
- (error
- (org-display-warning (format "%s: Error evaluating %s: %s"
- "???" form err))
- "; INVALID LISP CODE"))))
-
-(defun org-eval-light-run (cmd code)
- (with-temp-buffer
- (insert code)
- (shell-command-on-region (point-min) (point-max) cmd nil 'replace)
- (buffer-string)))
-
-(defadvice org-ctrl-c-ctrl-c (around org-cc-eval-source activate)
- (if (org-eval-light-inside-snippet)
- (call-interactively 'org-eval-light-current-snippet)
- ad-do-it))
-
-(provide 'org-eval-light)
-;;; org-eval-light.el ends here \ No newline at end of file
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-eval.el b/.emacs.d/org-7.4/contrib/lisp/org-eval.el
deleted file mode 100644
index 0dd3ade..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-eval.el
+++ /dev/null
@@ -1,220 +0,0 @@
-;;; org-eval.el --- Display result of evaluating code in various languages
-;; Copyright (C) 2008 Free Software Foundation, Inc.
-;;
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 0.04
-;;
-;; This file is not yet part of GNU Emacs.
-;;
-;; GNU Emacs is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-;;
-;; This modules allows to include output from various commands into an
-;; Org-mode buffer, both for live display, and for export.
-;; This technique has been copied from emacs-wiki and Emacs Muse, and
-;; we try to make it work here in a way as similar as possible to
-;; Muse, so that people who move between both worlds don't need to learn
-;; new syntax.
-;;
-;; Basically it works like this:
-;;
-;; <lisp>(concat "aaa" "bbb")</lisp>
-;;
-;; will display "aaabbb" in the buffer and export like that as well.
-;; The leading lisp tag will also accept the attributes "markup" and
-;; "lang", to specify how the text should be formatted during export.
-;; For example,
-;;
-;; <lisp markup="src" lang="emacs-lisp"> .... </lisp>
-;;
-;; will format the result of the lisp form as if it was lisp source
-;; code. Internally, it will wrap the text into a
-;;
-;; #+begin_src emacs-lisp
-;; #+end_src
-;;
-;; structure so that the right things happen when the exporter is running.
-;;
-;; By default, only the <lisp> tag is turned on, but you can configure
-;; the variable `org-eval-interpreters' to add more interpreters like
-;; `perl', `python', or the `shell'.
-;;
-;; You can edit the code snippets with "C-c '" (org-edit-src-code).
-;;
-;; Please note that this mechanism is potentially dangerous, because it
-;; executes code that you don't even see. This gives you great power,
-;; but also enough rope to hang yourself. And, it gives your friends
-;; who send you Org files plenty of opportunity for good and bad jokes.
-;; This is also why this module is not turned on by default, but only
-;; available as a contributed package.
-;;
-;;
-;;
-(require 'org)
-
-;;; Customization
-
-(defgroup org-eval nil
- "Options concerning including output from commands into the Org-mode buffer."
- :tag "Org Eval"
- :group 'org)
-
-(defface org-eval
- (org-compatible-face nil
- '((((class color grayscale) (min-colors 88) (background light))
- (:foreground "grey40"))
- (((class color grayscale) (min-colors 88) (background dark))
- (:foreground "grey60"))
- (((class color) (min-colors 8) (background light))
- (:foreground "green"))
- (((class color) (min-colors 8) (background dark))
- (:foreground "yellow"))))
- "Face for command output that is included into an Org-mode buffer."
- :group 'org-eval
- :group 'org-faces
- :version "22.1")
-
-(defvar org-eval-regexp nil)
-
-(defun org-eval-set-interpreters (var value)
- (set-default var value)
- (setq org-eval-regexp
- (concat "<\\("
- (mapconcat 'regexp-quote value "\\|")
- "\\)"
- "\\([^>]\\{0,50\\}?\\)>"
- "\\([^\000]+?\\)</\\1>")))
-
-(defcustom org-eval-interpreters '("lisp")
- "Interpreters allows for evaluation tags.
-This is a list of program names (as strings) that can evaluate code and
-insert the output into an Org-mode buffer. Valid choices are
-
-lisp Interpret Emacs Lisp code and display the result
-shell Pass command to the shell and display the result
-perl The perl interpreter
-python Thy python interpreter
-ruby The ruby interpreter"
- :group 'org-eval
- :set 'org-eval-set-interpreters
- :type '(set :greedy t
- (const "lisp")
- (const "perl")
- (const "python")
- (const "ruby")
- (const "shell")))
-
-(defun org-eval-handle-snippets (limit &optional replace)
- "Evaluate code snippets and display the results as display property.
-When REPLACE is non-nil, replace the code region with the result (used
-for export)."
- (let (a)
- (while (setq a (text-property-any (point) (or limit (point-max))
- 'org-eval t))
- (remove-text-properties
- a (next-single-property-change a 'org-eval nil limit)
- '(display t intangible t org-eval t))))
- (while (re-search-forward org-eval-regexp limit t)
- (let* ((beg (match-beginning 0))
- (end (match-end 0))
- (kind (match-string 1))
- (attr (match-string 2))
- (code (match-string 3))
- (value (org-eval-code kind code))
- markup lang)
- (if replace
- (progn
- (setq attr (save-match-data (org-eval-get-attributes attr))
- markup (cdr (assoc "markup" attr))
- lang (cdr (assoc "lang" attr)))
- (replace-match
- (concat (if markup (format "#+BEGIN_%s" (upcase markup)))
- (if (and markup (equal (downcase markup) "src"))
- (concat " " (or lang "fundamental")))
- "\n"
- value
- (if markup (format "\n#+END_%s\n" (upcase markup))))
- t t))
- (add-text-properties
- beg end
- (list 'display value 'intangible t 'font-lock-multiline t
- 'face 'org-eval
- 'org-eval t))))))
-
-(defun org-eval-replace-snippts ()
- "Replace EVAL snippets in the entire buffer.
-This should go into the `org-export-preprocess-hook'."
- (goto-char (point-min))
- (org-eval-handle-snippets nil 'replace))
-
-(add-hook 'org-export-preprocess-hook 'org-eval-replace-snippts)
-(add-hook 'org-font-lock-hook 'org-eval-handle-snippets)
-
-(defun org-eval-get-attributes (str)
- (let ((start 0) key value rtn)
- (while (string-match "\\<\\([a-zA-Z]+\\)\\>=\"\\([^\"]+\\)\"" str start)
- (setq key (match-string 1 str)
- value (match-string 2 str)
- start (match-end 0))
- (push (cons key value) rtn))
- rtn))
-
-(defun org-eval-code (interpreter code)
- (cond
- ((equal interpreter "lisp")
- (org-eval-lisp (concat "(progn\n" code "\n)")))
- ((equal interpreter "shell")
- (shell-command-to-string code))
- ((member interpreter '("perl" "python" "ruby"))
- (org-eval-run (executable-find interpreter) code))
- (t (error "Cannot evaluate code type %s" interpreter))))
-
-(defun org-eval-lisp (form)
- "Evaluate the given form and return the result as a string."
- (require 'pp)
- (save-match-data
- (condition-case err
- (let ((object (eval (read form))))
- (cond
- ((stringp object) object)
- ((and (listp object)
- (not (eq object nil)))
- (let ((string (pp-to-string object)))
- (substring string 0 (1- (length string)))))
- ((numberp object)
- (number-to-string object))
- ((eq object nil) "")
- (t
- (pp-to-string object))))
- (error
- (org-display-warning (format "%s: Error evaluating %s: %s"
- "???" form err))
- "; INVALID LISP CODE"))))
-
-(defun org-eval-run (cmd code)
- (with-temp-buffer
- (insert code)
- (shell-command-on-region (point-min) (point-max) cmd nil 'replace)
- (buffer-string)))
-
-(provide 'org-eval)
-
-;;; org-eval.el ends here
-
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-exp-bibtex.el b/.emacs.d/org-7.4/contrib/lisp/org-exp-bibtex.el
deleted file mode 100644
index ab6a6b0..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-exp-bibtex.el
+++ /dev/null
@@ -1,155 +0,0 @@
-;;; org-exp-bibtex.el --- Export bibtex fragments
-
-;; Copyright (C) 2009 Taru Karttunen
-
-;; Author: Taru Karttunen <taruti@taruti.net >
-
-;; This file is not currently part of GNU Emacs.
-
-;; This program is free software; you can redistribute it and/or
-;; modify it under the terms of the GNU General Public License as
-;; published by the Free Software Foundation; either version 2, or (at
-;; your option) any later version.
-
-;; This program is distributed in the hope that it will be useful, but
-;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-;; General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with this program ; see the file COPYING. If not, write to
-;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
-
-;;; Commentary:
-;;
-;; This is an utility to handle BibTeX export to both LaTeX and html
-;; exports. It uses the bibtex2html software from
-;; http://www.lri.fr/~filliatr/bibtex2html/
-;;
-;; The usage is as follows:
-;; #+BIBLIOGRAPHY: bibfilebasename stylename optional-options
-;; e.g. given foo.bib and using style plain:
-;; #+BIBLIOGRAPHY: foo plain option:-d
-;;
-;; Optional options are of the form:
-;;
-;; option:-foobar pass '-foobar' to bibtex2html
-;; e.g.
-;; option:-d sort by date.
-;; option:-a sort as BibTeX (usually by author) *default*
-;; option:-u unsorted i.e. same order as in .bib file
-;; option:-r reverse the sort.
-;; see the bibtex2html man page for more. Multiple options can be combined like:
-;; option:-d option:-r
-;;
-;; Limiting to only the entries cited in the document:
-;; limit:t
-
-;; For LaTeX export this simply inserts the lines
-;; \bibliographystyle{plain}
-;; \bibliography{foo}
-;; into the tex-file when exporting.
-
-;; For Html export it:
-;; 1) converts all \cite{foo} to links to the bibliography
-;; 2) creates a foo.html and foo_bib.html
-;; 3) includes the contents of foo.html in the exported html file
-
-(require 'org)
-(require 'org-exp)
-(defun org-export-bibtex-preprocess ()
- "Export all BibTeX."
- (interactive)
- (save-window-excursion
- (setq oebp-cite-plist '())
-
- ;; Convert #+BIBLIOGRAPHY: name style
- (goto-char (point-min))
- (while (re-search-forward "^#\\+BIBLIOGRAPHY:[ \t]+\\(\\S-+\\)[ \t]+\\(\\S-+\\)\\([^\r\n]*\\)" nil t)
- (let ((file (match-string 1))
- (style (match-string 2))
- (opt (org-exp-bibtex-options-to-plist (match-string 3))))
- (replace-match
- (cond
- (htmlp ;; We are exporting to HTML
- (let (extra-args cite-list end-hook tmp-files)
- (dolist (elt opt)
- (when (equal "option" (car elt))
- (setq extra-args (cons (cdr elt) extra-args))))
-
-
- (when (assoc "limit" opt) ;; Limit is true - collect references
- (org-exp-bibtex-docites (lambda ()
- (dolist (c (org-split-string (match-string 1) ","))
- (add-to-list 'cite-list c))))
-;; (message "cites: %s" cite-list)
- (let ((tmp (make-temp-file "org-exp-bibtex")))
- (with-temp-file tmp (dolist (i cite-list) (insert (concat i "\n"))))
- (setq tmp-files (cons tmp tmp-files))
- (setq extra-args (append extra-args `("-citefile" ,tmp)))))
-
- (when (not (eq 0 (apply 'call-process (append '("bibtex2html" nil nil nil)
- `("-a" "--nodoc" "--style" ,style "--no-header")
- extra-args
- (list (concat file ".bib"))))))
- (error "Executing bibtex2html failed"))
-
- (dolist (f tmp-files) (delete-file f)))
-
- (with-temp-buffer
- (save-match-data
- (insert-file-contents (concat file ".html"))
- (goto-char (point-min))
- (while (re-search-forward "a name=\"\\(\\w+\\)\">\\(\\w+\\)" nil t)
- (setq oebp-cite-plist (cons (cons (match-string 1) (match-string 2)) oebp-cite-plist)))
- (goto-char (point-min))
- (while (re-search-forward "<hr>" nil t)
- (replace-match "<hr/>" t t))
- (concat "\n#+BEGIN_HTML\n<div id=\"bibliography\">\n" (buffer-string) "\n</div>\n#+END_HTML\n"))))
- (latexp ;; Latex export
- (concat "\n#+LATEX: \\bibliographystyle{" style "}"
- "\n#+LATEX: \\bibliography{" file "}\n"))) t t)))
-
-
- ;; Convert cites to links in html
- (when htmlp
- ;; Split citation commands with multiple keys
- (org-exp-bibtex-docites
- (lambda ()
- (let ((keys (save-match-data (org-split-string (match-string 1) ","))))
- (when (> (length keys) 1)
- (replace-match (mapconcat (lambda (k) (format "\\cite{%s}" k)) keys "")
- t t)))))
- ;; Replace the citation commands with links
- (org-exp-bibtex-docites
- (lambda () (let* ((cn (match-string 1))
- (cv (assoc cn oebp-cite-plist)))
-;; (message "L: %s" (concat "\[_{}[[" cn "][" (if cv (cdr cv) cn) "]]\]"))
- (replace-match (concat "\[_{}[[#" cn "][" (if cv (cdr cv) cn) "]]\]")) t t))))
-
-
-))
-
-(defun org-exp-bibtex-docites (fun)
- (save-excursion
- (save-match-data
- (goto-char (point-min))
- (when htmlp
- (while (re-search-forward "\\\\cite{\\([^}\n]+\\)}" nil t)
- (apply fun nil))))))
-
-
-(defun org-exp-bibtex-options-to-plist (options)
- (save-match-data
- (flet ((f (o) (let ((s (split-string o ":"))) (cons (nth 0 s) (nth 1 s)))))
- (mapcar 'f (split-string options nil t)))))
-
-
-
-
-(add-hook 'org-export-preprocess-hook 'org-export-bibtex-preprocess)
-
-(provide 'org-exp-bibtex)
-
-;;; org-exp-bibtex.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-expiry.el b/.emacs.d/org-7.4/contrib/lisp/org-expiry.el
deleted file mode 100644
index 4a49399..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-expiry.el
+++ /dev/null
@@ -1,346 +0,0 @@
-;;; org-expiry.el --- expiry mechanism for Org entries
-;;
-;; Copyright 2007 2008 Bastien Guerry
-;;
-;; Author: bzg AT altern DOT org
-;; Version: 0.2
-;; Keywords: org expiry
-;; URL: http://www.cognition.ens.fr/~guerry/u/org-expiry.el
-;;
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with this program; if not, write to the Free Software
-;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-;;
-;;; Commentary:
-;;
-;; This gives you a chance to get rid of old entries in your Org files
-;; by expiring them.
-;;
-;; By default, entries that have no EXPIRY property are considered to be
-;; new (i.e. 0 day old) and only entries older than one year go to the
-;; expiry process, which consist in adding the ARCHIVE tag. None of
-;; your tasks will be deleted with the default settings.
-;;
-;; When does an entry expires?
-;;
-;; Consider this entry:
-;;
-;; * Stop watching TV
-;; :PROPERTIES:
-;; :CREATED: <2008-01-07 lun 08:01>
-;; :EXPIRY: <2008-01-09 08:01>
-;; :END:
-;;
-;; This entry will expire on the 9th, january 2008.
-
-;; * Stop watching TV
-;; :PROPERTIES:
-;; :CREATED: <2008-01-07 lun 08:01>
-;; :EXPIRY: +1w
-;; :END:
-;;
-;; This entry will expire on the 14th, january 2008, one week after its
-;; creation date.
-;;
-;; What happen when an entry is expired? Nothing until you explicitely
-;; M-x org-expiry-process-entries When doing this, org-expiry will check
-;; for expired entries and request permission to process them.
-;;
-;; Processing an expired entries means calling the function associated
-;; with `org-expiry-handler-function'; the default is to add the tag
-;; :ARCHIVE:, but you can also add a EXPIRED keyword or even archive
-;; the subtree.
-;;
-;; Is this useful? Well, when you're in a brainstorming session, it
-;; might be useful to know about the creation date of an entry, and be
-;; able to archive those entries that are more than xxx days/weeks old.
-;;
-;; When you're in such a session, you can insinuate org-expiry like
-;; this: M-x org-expiry-insinuate
-;;
-;; Then, each time you're pressing M-RET to insert an item, the CREATION
-;; property will be automatically added. Same when you're scheduling or
-;; deadlining items. You can deinsinuate: M-x org-expiry-deinsinuate
-
-;;; Code:
-
-;;; User variables:
-
-(defgroup org-expiry nil
- "Org expiry process."
- :tag "Org Expiry"
- :group 'org)
-
-(defcustom org-expiry-created-property-name "CREATED"
- "The name of the property for setting the creation date."
- :type 'string
- :group 'org-expiry)
-
-(defcustom org-expiry-expiry-property-name "EXPIRY"
- "The name of the property for setting the expiry date/delay."
- :type 'string
- :group 'org-expiry)
-
-(defcustom org-expiry-keyword "EXPIRED"
- "The default keyword for `org-expiry-add-keyword'."
- :type 'string
- :group 'org-expiry)
-
-(defcustom org-expiry-wait "+1y"
- "Time span between the creation date and the expiry.
-The default value for this variable (\"+1y\") means that entries
-will expire if there are at least one year old.
-
-If the expiry delay cannot be retrieved from the entry or the
-subtree above, the expiry process compares the expiry delay with
-`org-expiry-wait'. This can be either an ISO date or a relative
-time specification. See `org-read-date' for details."
- :type 'string
- :group 'org-expiry)
-
-(defcustom org-expiry-created-date "+0d"
- "The default creation date.
-The default value of this variable (\"+0d\") means that entries
-without a creation date will be handled as if they were created
-today.
-
-If the creation date cannot be retrieved from the entry or the
-subtree above, the expiry process will compare the expiry delay
-with this date. This can be either an ISO date or a relative
-time specification. See `org-read-date' for details on relative
-time specifications."
- :type 'string
- :group 'org-expiry)
-
-(defcustom org-expiry-handler-function 'org-toggle-archive-tag
- "Function to process expired entries.
-Possible candidates for this function are:
-
-`org-toggle-archive-tag'
-`org-expiry-add-keyword'
-`org-expiry-archive-subtree'"
- :type 'function
- :group 'org-expiry)
-
-(defcustom org-expiry-confirm-flag t
- "Non-nil means confirm expiration process."
- :type '(choice
- (const :tag "Always require confirmation" t)
- (const :tag "Do not require confirmation" nil)
- (const :tag "Require confirmation in interactive expiry process"
- interactive))
- :group 'org-expiry)
-
-(defcustom org-expiry-advised-functions
- '(org-scheduled org-deadline org-time-stamp)
- "A list of advised functions.
-`org-expiry-insinuate' will activate the expiry advice for these
-functions. `org-expiry-deinsinuate' will deactivate them."
- :type 'boolean
- :group 'list)
-
-;;; Advices and insinuation:
-
-(defadvice org-schedule (after org-schedule-update-created)
- "Update the creation-date property when calling `org-schedule'."
- (org-expiry-insert-created))
-
-(defadvice org-deadline (after org-deadline-update-created)
- "Update the creation-date property when calling `org-deadline'."
- (org-expiry-insert-created))
-
-(defadvice org-time-stamp (after org-time-stamp-update-created)
- "Update the creation-date property when calling `org-time-stamp'."
- (org-expiry-insert-created))
-
-(defun org-expiry-insinuate (&optional arg)
- "Add hooks and activate advices for org-expiry.
-If ARG, also add a hook to `before-save-hook' in `org-mode' and
-restart `org-mode' if necessary."
- (interactive "P")
- (ad-activate 'org-schedule)
- (ad-activate 'org-time-stamp)
- (ad-activate 'org-deadline)
- (add-hook 'org-insert-heading-hook 'org-expiry-insert-created)
- (add-hook 'org-after-todo-state-change-hook 'org-expiry-insert-created)
- (add-hook 'org-after-tags-change-hook 'org-expiry-insert-created)
- (when arg
- (add-hook 'org-mode-hook
- (lambda() (add-hook 'before-save-hook
- 'org-expiry-process-entries t t)))
- ;; need this to refresh org-mode hooks
- (when (org-mode-p)
- (org-mode)
- (if (interactive-p)
- (message "Org-expiry insinuated, `org-mode' restarted.")))))
-
-(defun org-expiry-deinsinuate (&optional arg)
- "Remove hooks and deactivate advices for org-expiry.
-If ARG, also remove org-expiry hook in Org's `before-save-hook'
-and restart `org-mode' if necessary."
- (interactive "P")
- (ad-deactivate 'org-schedule)
- (ad-deactivate 'org-time-stamp)
- (ad-deactivate 'org-deadline)
- (remove-hook 'org-insert-heading-hook 'org-expiry-insert-created)
- (remove-hook 'org-after-todo-state-change-hook 'org-expiry-insert-created)
- (remove-hook 'org-after-tags-change-hook 'org-expiry-insert-created)
- (remove-hook 'org-mode-hook
- (lambda() (add-hook 'before-save-hook
- 'org-expiry-process-entries t t)))
- (when arg
- ;; need this to refresh org-mode hooks
- (when (org-mode-p)
- (org-mode)
- (if (interactive-p)
- (message "Org-expiry de-insinuated, `org-mode' restarted.")))))
-
-;;; org-expiry-expired-p:
-
-(defun org-expiry-expired-p ()
- "Check if the entry at point is expired.
-Return nil if the entry is not expired. Otherwise return the
-amount of time between today and the expiry date.
-
-If there is no creation date, use `org-expiry-created-date'.
-If there is no expiry date, use `org-expiry-expiry-date'."
- (let* ((ex-prop org-expiry-expiry-property-name)
- (cr-prop org-expiry-created-property-name)
- (ct (current-time))
- (cr (org-read-date nil t (or (org-entry-get (point) cr-prop t) "+0d")))
- (ex-field (or (org-entry-get (point) ex-prop t) org-expiry-wait))
- (ex (if (string-match "^[ \t]?[+-]" ex-field)
- (time-add cr (time-subtract (org-read-date nil t ex-field) ct))
- (org-read-date nil t ex-field))))
- (if (time-less-p ex ct)
- (time-subtract ct ex))))
-
-;;; Expire an entry or a region/buffer:
-
-(defun org-expiry-process-entry (&optional force)
- "Call `org-expiry-handler-function' on entry.
-If FORCE is non-nil, don't require confirmation from the user.
-Otherwise rely on `org-expiry-confirm-flag' to decide."
- (interactive "P")
- (save-excursion
- (when (interactive-p) (org-reveal))
- (when (org-expiry-expired-p)
- (org-back-to-heading)
- (looking-at org-complex-heading-regexp)
- (let* ((ov (make-overlay (point) (match-end 0)))
- (e (org-expiry-expired-p))
- (d (time-to-number-of-days e)))
- (overlay-put ov 'face 'secondary-selection)
- (if (or force
- (null org-expiry-confirm-flag)
- (and (eq org-expiry-confirm-flag 'interactive)
- (not (interactive)))
- (and org-expiry-confirm-flag
- (y-or-n-p (format "Entry expired by %d days. Process? " d))))
- (funcall 'org-expiry-handler-function))
- (delete-overlay ov)))))
-
-(defun org-expiry-process-entries (beg end)
- "Process all expired entries between BEG and END.
-The expiry process will run the function defined by
-`org-expiry-handler-functions'."
- (interactive "r")
- (save-excursion
- (let ((beg (if (org-region-active-p)
- (region-beginning) (point-min)))
- (end (if (org-region-active-p)
- (region-end) (point-max))))
- (goto-char beg)
- (let ((expired 0) (processed 0))
- (while (and (outline-next-heading) (< (point) end))
- (when (org-expiry-expired-p)
- (setq expired (1+ expired))
- (if (if (interactive-p)
- (call-interactively 'org-expiry-process-entry)
- (org-expiry-process-entry))
- (setq processed (1+ processed)))))
- (if (equal expired 0)
- (message "No expired entry")
- (message "Processed %d on %d expired entries"
- processed expired))))))
-
-;;; Insert created/expiry property:
-
-(defun org-expiry-insert-created (&optional arg)
- "Insert or update a property with the creation date.
-If ARG, always update it. With one `C-u' prefix, silently update
-to today's date. With two `C-u' prefixes, prompt the user for to
-update the date."
- (interactive "P")
- (let* ((d (org-entry-get (point) org-expiry-created-property-name))
- d-time d-hour)
- (when (or (null d) arg)
- ;; update if no date or non-nil prefix argument
- ;; FIXME Use `org-time-string-to-time'
- (setq d-time (if d (apply 'encode-time (org-parse-time-string d))
- (current-time)))
- (setq d-hour (format-time-string "%H:%M" d-time))
- (save-excursion
- (org-entry-put
- (point) org-expiry-created-property-name
- ;; two C-u prefixes will call org-read-date
- (if (equal arg '(16))
- (concat "<" (org-read-date
- nil nil nil nil d-time d-hour) ">")
- (format-time-string (cdr org-time-stamp-formats))))))))
-
-(defun org-expiry-insert-expiry (&optional today)
- "Insert a property with the expiry date.
-With one `C-u' prefix, don't prompt interactively for the date
-and insert today's date."
- (interactive "P")
- (let* ((d (org-entry-get (point) org-expiry-expiry-property-name))
- d-time d-hour)
- (setq d-time (if d (apply 'encode-time (org-parse-time-string d))
- (current-time)))
- (setq d-hour (format-time-string "%H:%M" d-time))
- (save-excursion
- (org-entry-put
- (point) org-expiry-expiry-property-name
- (if today (format-time-string (cdr org-time-stamp-formats))
- (concat "<" (org-read-date
- nil nil nil nil d-time d-hour) ">"))))))
-
-;;; Functions to process expired entries:
-
-(defun org-expiry-archive-subtree ()
- "Archive the entry at point if it is expired."
- (interactive)
- (save-excursion
- (if (org-expiry-expired-p)
- (org-archive-subtree)
- (if (interactive-p)
- (message "Entry at point is not expired.")))))
-
-(defun org-expiry-add-keyword (&optional keyword)
- "Add KEYWORD to the entry at point if it is expired."
- (interactive "sKeyword: ")
- (if (or (member keyword org-todo-keywords-1)
- (setq keyword org-expiry-keyword))
- (save-excursion
- (if (org-expiry-expired-p)
- (org-todo keyword)
- (if (interactive-p)
- (message "Entry at point is not expired."))))
- (error "\"%s\" is not a to-do keyword in this buffer" keyword)))
-
-;; FIXME what about using org-refile ?
-
-(provide 'org-expiry)
-
-;;; org-expiry.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-export-generic.el b/.emacs.d/org-7.4/contrib/lisp/org-export-generic.el
deleted file mode 100644
index f8e8c4a..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-export-generic.el
+++ /dev/null
@@ -1,1385 +0,0 @@
-;; org-export-generic.el --- Export frameworg with custom backends
-
-;; Copyright (C) 2009 Free Software Foundation, Inc.
-
-;; Author: Wes Hardaker <hardaker at users dot sourceforge dot net>
-;; Keywords: outlines, hypermedia, calendar, wp, export
-;; Homepage: http://orgmode.org
-;; Version: 6.25trans
-;; Acks: Much of this code was stolen form the ascii export from Carsten
-;;
-;; This file is not yet part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;
-;; ----------------------------------------------------------------------
-;;
-;; OVERVIEW
-;;
-;; org-export-generic is basically a simple translation system that
-;; knows how to parse at least most of a .org buffer and then add
-;; various formatting prefixes before and after each section type. It
-;; does this by examining a property list stored in org-generic-alist.
-;; You can dynamically add propety lists of your own using the
-;; org-set-generic-type function:
-;;
-;; (org-set-generic-type
-;; "really-basic-text"
-;; '(:file-suffix ".txt"
-;; :key-binding ?R
-;;
-;; :title-format "=== %s ===\n"
-;; :body-header-section-numbers t
-;; :body-header-section-number-format "%s) "
-;; :body-section-header-prefix "\n"
-;; :body-section-header-suffix "\n"
-;; :body-line-format " %s\n"
-;; :body-line-wrap 75
-;; ))
-;;
-;; Note: Upper case key-bindings are reserved for your use. Lower
-;; case key bindings may conflict with future export-generic
-;; publications.
-;;
-;; Then run org-export (ctrl-c ctrl-e) and select generic or run
-;; org-export-generic. You'll then be prompted with a list of export
-;; types to choose from which will include your new type assigned to
-;; the key "r".
-;;
-;; ----------------------------------------------------------------------
-;;
-;; TODO (non-ordered)
-;; * handle function references
-;; * handle other types of multi-complex-listy-things to do
-;; ideas: (t ?- "%s" ?-)
-;; * handle indent specifiers better
-;; ideas: (4 ?\ "%s")
-;; * need flag to remove indents from body text
-;; * handle links
-;; * handle internationalization strings better
-;; * date/author/etc needs improvment (internationalization too)
-;; * allow specifying of section ordering
-;; ideas: :ordering ("header" "toc" "body" "footer")
-;; ^ matches current hard coded ordering
-;; * err, actually *do* a footer
-;; * deal with usage of org globals
-;; *** should we even consider them, or let the per-section specifiers do it
-;; *** answer: remove; mostly removed now
-;; * deal with interactive support for picking a export specifier label
-;; * char specifiers that need extra length because of formatting
-;; idea: (?- 4) for 4-longer
-;; * centering specifier
-;; idea: ('center " -- %s -- ")
-;; * remove more of the unneeded export-to-ascii copy code
-;; * tags
-;; *** supported now, but need separate format per tag
-;; *** allow different open/closing prefixes
-;; * properties
-;; * drawers
-;; * oh my
-;; * optmization (many plist extracts should be in let vars)
-;; * define defcustom spec for the specifier list
-;; * fonts: at least monospace is not handled at all here.
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-(require 'org-exp)
-(require 'assoc)
-
-(defgroup org-export-generic nil
- "Options specific for ASCII export of Org-mode files."
- :tag "Org Export ASCII"
- :group 'org-export)
-
-(defcustom org-export-generic-links-to-notes t
- "Non-nil means convert links to notes before the next headline.
-When nil, the link will be exported in place. If the line becomes long
-in this way, it will be wrapped."
- :group 'org-export-generic
- :type 'boolean)
-
-
-(defvar org-generic-current-indentation nil) ; For communication
-
-(defvar org-generic-alist
- '(
- ;;
- ;; generic DEMO exporter
- ;;
- ;; (this tries to use every specifier for demo purposes)
- ;;
- ("demo"
- :file-suffix ".txt"
- :key-binding ?d
-
- :header-prefix "<header>\n"
- :header-suffix "</header>\n"
-
- :author-export t
- :tags-export t
-
- :drawers-export t
-
-
- :title-prefix ?=
- :title-format "<h1>%s</h1>\n"
- :title-suffix ?=
-
- :date-export t
- :date-prefix "<date>"
- :date-format "<br /><b>Date:</b> <i>%s</i><br />"
- :date-suffix "</date>\n\n"
-
- :toc-export t
- :toc-header-prefix "<tocname>\n"
- :toc-header-format "__%s__\n"
- :toc-header-suffix "</tocname>\n"
-
- :toc-prefix "<toc>\n"
- :toc-suffix "</toc>\n"
-
- :toc-section-numbers t
- :toc-section-number-format "\#(%s) "
- :toc-format "--%s--"
- :toc-format-with-todo "!!%s!!\n"
- :toc-indent-char ?\
- :toc-indent-depth 4
-
- :toc-tags-export t
- :toc-tags-prefix " <tags>"
- :toc-tags-format "*%s*"
- :toc-tags-suffix "</tags>\n"
- :toc-tags-none-string "\n"
-
- :body-header-section-numbers 3 ; t = all, nil = none
-
- ; lists indicate different things per level
- ; list contents or straight value can either be a
- ; ?x char reference for printing strings that match the header len
- ; "" string to print directly
- :body-section-header-prefix ("<h1>" "<h2>" "<h3>"
- "<h4>" "<h5>" "<h6>")
- :body-section-header-format "%s"
- :body-section-header-suffix ("</h1>\n" "</h2>\n" "</h3>\n"
- "</h4>\n" "</h5>\n" "</h6>\n")
-
- :timestamps-export t
- :priorities-export t
- :todo-keywords-export t
-
- :body-tags-export t
- :body-tags-prefix " <tags>"
- :body-tags-suffix "</tags>\n"
-
- ; section prefixes/suffixes can be direct strings or lists as well
- :body-section-prefix "<secprefix>\n"
- :body-section-suffix "</secsuffix>\n"
-; :body-section-prefix ("<sec1>\n" "<sec2>\n" "<sec3>\n")
-; :body-section-suffix ("</sec1>\n" "</sec2>\n" "</sec3>\n")
-
-
- ; if preformated text should be included (eg, : prefixed)
- :body-line-export-preformated t
- :body-line-fixed-prefix "<pre>\n"
- :body-line-fixed-suffix "\n</pre>\n"
- :body-line-fixed-format "%s\n"
-
-
- :body-list-prefix "<list>\n"
- :body-list-suffix "</list>\n"
- :body-list-format "<li>%s</li>\n"
-
- :body-number-list-prefix "<ol>\n"
- :body-number-list-suffix "</ol>\n"
- :body-number-list-format "<li>%s</li>\n"
- :body-number-list-leave-number t
-
- :body-list-checkbox-todo "<checkbox type=\"todo\">"
- :body-list-checkbox-todo-end "</checkbox (todo)>"
- :body-list-checkbox-done "<checkbox type=\"done\">"
- :body-list-checkbox-done-end "</checkbox (done)>"
- :body-list-checkbox-half "<checkbox type=\"half\">"
- :body-list-checkbox-half-end "</checkbox (half)>"
-
-
-
-
- ; other body lines
- :body-line-format "%s"
- :body-line-wrap 60 ; wrap at 60 chars
-
- ; print above and below all body parts
- :body-text-prefix "<p>\n"
- :body-text-suffix "</p>\n"
-
- )
-
- ;;
- ;; ascii exporter
- ;;
- ;; (close to the original ascii specifier)
- ;;
- ("ascii"
- :file-suffix ".txt"
- :key-binding ?a
-
- :header-prefix ""
- :header-suffix ""
-
- :title-prefix ?=
- :title-format "%s\n"
- :title-suffix ?=
-
- :date-export t
- :date-prefix ""
- :date-format "Date: %s\n"
- :date-suffix ""
-
- :toc-header-prefix ""
- :toc-header-format "%s\n"
- :toc-header-suffix ?=
-
- :toc-export t
- :toc-section-numbers t
- :toc-section-number-format "%s "
- :toc-format "%s\n"
- :toc-format-with-todo "%s (*)\n"
- :toc-indent-char ?\
- :toc-indent-depth 4
-
- :body-header-section-numbers 3
- :body-section-prefix "\n"
-
-; :body-section-header-prefix "\n"
-; :body-section-header-format "%s\n"
-; :body-section-header-suffix (?\$ ?\# ?^ ?\~ ?\= ?\-)
-
- :body-section-header-prefix ("" "" "" "* " " + " " - ")
- :body-section-header-format "%s\n"
- :body-section-header-suffix (?~ ?= ?- "\n" "\n" "\n")
-
-; :body-section-marker-prefix ""
-; :body-section-marker-chars (?\$ ?\# ?^ ?\~ ?\= ?\-)
-; :body-section-marker-suffix "\n"
-
- :body-line-export-preformated t
- :body-line-format "%s\n"
- :body-line-wrap 75
-
-; :body-text-prefix "<t>\n"
-; :body-text-suffix "</t>\n"
-
-
- :body-bullet-list-prefix (?* ?+ ?-)
-; :body-bullet-list-suffix (?* ?+ ?-)
- )
-
- ;;
- ;; wikipedia
- ;;
- ("wikipedia"
- :file-suffix ".txt"
- :key-binding ?w
-
- :header-prefix ""
- :header-suffix ""
-
- :title-format "= %s =\n"
-
- :date-export nil
-
- :toc-export nil
-
- :body-header-section-numbers nil
- :body-section-prefix "\n"
-
- :body-section-header-prefix ("= " "== " "=== "
- "==== " "===== " "====== ")
- :body-section-header-suffix (" =\n\n" " ==\n\n" " ===\n\n"
- " ====\n\n" " =====\n\n" " ======\n\n")
-
- :body-line-export-preformated t ;; yes/no/maybe???
- :body-line-format "%s\n"
- :body-line-wrap 75
-
- :body-line-fixed-format " %s\n"
-
- :body-list-format "* %s\n"
- :body-number-list-format "# %s\n"
-
- :body-bullet-list-prefix ("* " "** " "*** " "**** " "***** ")
- )
-
- ;;
- ;; minimal html exporter
- ;;
- ("html"
- ;; simple html output
- :file-suffix ".html"
- :key-binding ?h
-
- :header-prefix "<body>"
-
- :title-format "<h1>%s</h1>\n\n"
-
- :date-export t
- :date-format "<br /><b>Date:</b> <i>%s</i><br />\n\n"
-
- :toc-export nil
-
- :body-header-section-numbers 3
-
- :body-section-header-prefix ("<h1>" "<h2>" "<h3>"
- "<h4>" "<h5>" "<h6>")
- :body-section-header-format "%s"
- :body-section-header-suffix ("</h1>\n" "</h2>\n" "</h3>\n"
- "</h4>\n" "</h5>\n" "</h6>\n")
-
- :body-section-prefix "<secprefix>\n"
- :body-section-suffix "</secsuffix>\n"
-; :body-section-prefix ("<sec1>\n" "<sec2>\n" "<sec3>\n")
-; :body-section-suffix ("</sec1>\n" "</sec2>\n" "</sec3>\n")
-
- :body-line-export-preformated t
- :body-line-format "%s\n"
-
- :body-text-prefix "<p>\n"
- :body-text-suffix "</p>\n"
-
- :body-bullet-list-prefix (?* ?+ ?-)
-; :body-bullet-list-suffix (?* ?+ ?-)
- )
-
- ;;
- ;; internet-draft .xml for xml2rfc exporter
- ;;
- ("ietfid"
- ;; this tries to use every specifier for demo purposes
- :file-suffix ".xml"
- :key-binding ?i
-
- :title-prefix "<?xml version=\"1.0\"\?>
-<!DOCTYPE rfc SYSTEM \"rfc2629.dtd\" [
-<!ENTITY rfcs PUBLIC '' 'blah'>
-<?rfc strict=\"yes\" ?>
-<?rfc toc=\"yes\" ?>
-<?rfc tocdepth=\"4\" ?>
-<?rfc symrefs=\"yes\" ?>
-<?rfc compact=\"yes\" ?>
-<?rfc subcompact=\"no\" ?>
-<rfc category=\"std\" ipr=\"pre5378Trust200902\" docName=\"FILLME.txt\">
- <front>
-"
- :title-format "<title abbrev=\"ABBREV HERE\">\n%s\n</title>\n"
- :title-suffix "<author initials=\"A.A\" surname=\"LASTNAME\" fullname=\"FULL NAME\">
- <organization>Comany, Inc..</organization>
- <address>
- <postal>
- <street></street>
- <city></city>
- <region></region>
- <code></code>
- <country></country>
- </postal>
- <phone></phone>
- <email></email>
- </address>
- </author>
- <date month=\"FILLMONTH\" year=\"FILLYEAR\"/>
- <area>Operations and Management</area>
- <workgroup>FIXME</workgroup>
-<abstract>\n"
- :date-export nil
-
- :toc-export nil
-
- :body-header-section-numbers nil
-
- :body-section-header-format "<section title=\"%s\">\n"
- :body-section-suffix "</section>\n"
-
- ; if preformated text should be included (eg, : prefixed)
- :body-line-export-preformated t
- :body-line-fixed-prefix "<figure>\n<artwork>\n"
- :body-line-fixed-suffix "\n</artwork>\n</figure>\n"
-
- ; other body lines
- :body-line-format "%s"
- :body-line-wrap 75
-
- ; print above and below all body parts
- :body-text-prefix "<t>\n"
- :body-text-suffix "</t>\n"
-
- :body-list-prefix "<list style=\"symbols\">\n"
- :body-list-suffix "</list>\n"
- :body-list-format "<t>%s</t>\n"
-
- )
- )
- "A assoc list of property lists to specify export definitions"
-)
-
-(setq org-generic-export-type "demo")
-
-(defvar org-export-generic-section-type "")
-(defvar org-export-generic-section-suffix "")
-
-;;;###autoload
-(defun org-set-generic-type (type definition)
- "Adds a TYPE and DEFINITION to the existing list of defined generic
-export definitions."
- (aput 'org-generic-alist type definition))
-
-;;; helper functions for org-set-generic-type
-(defvar org-export-generic-keywords nil)
-(defmacro* def-org-export-generic-keyword (keyword
- &key documentation
- type)
- "Define KEYWORD as a legitimate element for inclusion in
-the body of an org-set-generic-type definition."
- `(progn
- (pushnew ,keyword org-export-generic-keywords)
- ;; TODO: push the documentation and type information
- ;; somewhere where it will do us some good.
- ))
-
-(def-org-export-generic-keyword :body-newline-paragraph
- :documentation "Bound either to NIL or to a pattern to be
-inserted in the output for every blank line in the input.
- The intention is to handle formats where text is flowed, and
-newlines are interpreted as significant \(e.g., as indicating
-preformatted text\). A common non-nil value for this keyword
-is \"\\n\". Should typically be combined with a value for
-:body-line-format that does NOT end with a newline."
- :type string)
-
-;;; fontification keywords
-(def-org-export-generic-keyword :bold-format)
-(def-org-export-generic-keyword :italic-format)
-(def-org-export-generic-keyword :underline-format)
-(def-org-export-generic-keyword :strikethrough-format)
-(def-org-export-generic-keyword :code-format)
-(def-org-export-generic-keyword :verbatim-format)
-
-
-
-
-(defun org-export-generic-remember-section (type suffix &optional prefix)
- (setq org-export-generic-section-type type)
- (setq org-export-generic-section-suffix suffix)
- (if prefix
- (insert prefix))
-)
-
-(defun org-export-generic-check-section (type &optional prefix suffix)
- "checks to see if type is already in use, or we're switching parts
-If we're switching, then insert a potentially previously remembered
-suffix, and insert the current prefix immediately and then save the
-suffix a later change time."
-
- (when (not (equal type org-export-generic-section-type))
- (if org-export-generic-section-suffix
- (insert org-export-generic-section-suffix))
- (setq org-export-generic-section-type type)
- (setq org-export-generic-section-suffix suffix)
- (if prefix
- (insert prefix))))
-
-;;;###autoload
-(defun org-export-generic (arg)
- "Export the outline as generic output.
-If there is an active region, export only the region.
-The prefix ARG specifies how many levels of the outline should become
-underlined headlines. The default is 3."
- (interactive "P")
- (setq-default org-todo-line-regexp org-todo-line-regexp)
- (let* ((opt-plist (org-combine-plists (org-default-export-plist)
- (org-infile-export-plist)))
- (region-p (org-region-active-p))
- (rbeg (and region-p (region-beginning)))
- (rend (and region-p (region-end)))
- (subtree-p
- (when region-p
- (save-excursion
- (goto-char rbeg)
- (and (org-at-heading-p)
- (>= (org-end-of-subtree t t) rend)))))
- (level-offset (if subtree-p
- (save-excursion
- (goto-char rbeg)
- (+ (funcall outline-level)
- (if org-odd-levels-only 1 0)))
- 0))
- (opt-plist (setq org-export-opt-plist
- (if subtree-p
- (org-export-add-subtree-options opt-plist rbeg)
- opt-plist)))
-
- helpstart
- (bogus (mapc (lambda (x)
- (setq helpstart
- (concat helpstart "\["
- (char-to-string
- (plist-get (cdr x) :key-binding))
- "] " (car x) "\n")))
- org-generic-alist))
-
- (help (concat helpstart "
-
-\[ ] the current setting of the org-generic-export-type variable
-"))
-
- (cmds
-
- (append
- (mapcar (lambda (x)
- (list
- (plist-get (cdr x) :key-binding)
- (car x)))
- org-generic-alist)
- (list (list ? "default"))))
-
- r1 r2 ass
-
- ;; read in the type to use
- (export-plist
- (progn
- (save-excursion
- (save-window-excursion
- (delete-other-windows)
- (with-output-to-temp-buffer "*Org Export/Generic Styles Help*"
- (princ help))
- (org-fit-window-to-buffer (get-buffer-window
- "*Org Export/Generic Styles Help*"))
- (message "Select command: ")
- (setq r1 (read-char-exclusive))))
- (setq r2 (if (< r1 27) (+ r1 96) r1))
- (unless (setq ass (cadr (assq r2 cmds)))
- (error "No command associated with key %c" r1))
-
- (cdr (assoc
- (if (equal ass "default") org-generic-export-type ass)
- org-generic-alist))))
-
- (custom-times org-display-custom-times)
- (org-generic-current-indentation '(0 . 0))
- (level 0) (old-level 0) line txt lastwastext
- (umax nil)
- (umax-toc nil)
- (case-fold-search nil)
- (bfname (buffer-file-name (or (buffer-base-buffer) (current-buffer))))
- (filesuffix (or (plist-get export-plist :file-suffix) ".foo"))
- (filename (concat (file-name-as-directory
- (org-export-directory :ascii opt-plist))
- (file-name-sans-extension
- (or (and subtree-p
- (org-entry-get (region-beginning)
- "EXPORT_FILE_NAME" t))
- (file-name-nondirectory bfname)))
- filesuffix))
- (filename (if (equal (file-truename filename)
- (file-truename bfname))
- (concat filename filesuffix)
- filename))
- (buffer (find-file-noselect filename))
- (org-levels-open (make-vector org-level-max nil))
- (odd org-odd-levels-only)
- (date (plist-get opt-plist :date))
- (author (plist-get opt-plist :author))
- (title (or (and subtree-p (org-export-get-title-from-subtree))
- (plist-get opt-plist :title)
- (and (not
- (plist-get opt-plist :skip-before-1st-heading))
- (org-export-grab-title-from-buffer))
- (file-name-sans-extension
- (file-name-nondirectory bfname))))
- (email (plist-get opt-plist :email))
- (language (plist-get opt-plist :language))
- (quote-re0 (concat "^[ \t]*" org-quote-string "\\>"))
-; (quote-re (concat "^\\(\\*+\\)\\([ \t]*" org-quote-string "\\>\\)"))
- (todo nil)
- (lang-words nil)
- (region
- (buffer-substring
- (if (org-region-active-p) (region-beginning) (point-min))
- (if (org-region-active-p) (region-end) (point-max))))
- (lines (org-split-string
- (org-export-preprocess-string
- region
- :for-ascii t
- :skip-before-1st-heading
- (plist-get opt-plist :skip-before-1st-heading)
- :drawers (plist-get export-plist :drawers-export)
- :tags (plist-get export-plist :tags-export)
- :priority (plist-get export-plist :priority-export)
- :footnotes (plist-get export-plist :footnotes-export)
- :timestamps (plist-get export-plist :timestamps-export)
- :todo-keywords (plist-get export-plist :todo-keywords-export)
- :verbatim-multiline t
- :select-tags (plist-get export-plist :select-tags-export)
- :exclude-tags (plist-get export-plist :exclude-tags-export)
- :emph-multiline t
- :archived-trees
- (plist-get export-plist :archived-trees-export)
- :add-text (plist-get opt-plist :text))
- "\n"))
- ;; export-generic plist variables
- (withtags (plist-get export-plist :tags-export))
- (tagsintoc (plist-get export-plist :toc-tags-export))
- (tocnotagsstr (or (plist-get export-plist :toc-tags-none-string) ""))
- (tocdepth (plist-get export-plist :toc-indent-depth))
- (tocindentchar (plist-get export-plist :toc-indent-char))
- (tocsecnums (plist-get export-plist :toc-section-numbers))
- (tocsecnumform (plist-get export-plist :toc-section-number-format))
- (tocformat (plist-get export-plist :toc-format))
- (tocformtodo (plist-get export-plist :toc-format-with-todo))
- (tocprefix (plist-get export-plist :toc-prefix))
- (tocsuffix (plist-get export-plist :toc-suffix))
- (bodyfixedpre (plist-get export-plist :body-line-fixed-prefix))
- (bodyfixedsuf (plist-get export-plist :body-line-fixed-suffix))
- (bodyfixedform (or (plist-get export-plist :body-line-fixed-format)
- "%s"))
- (listprefix (plist-get export-plist :body-list-prefix))
- (listsuffix (plist-get export-plist :body-list-suffix))
- (listformat (or (plist-get export-plist :body-list-format) "%s\n"))
- (numlistleavenum
- (plist-get export-plist :body-number-list-leave-number))
- (numlistprefix (plist-get export-plist :body-number-list-prefix))
- (numlistsuffix (plist-get export-plist :body-number-list-suffix))
- (numlistformat
- (or (plist-get export-plist :body-number-list-format) "%s\n"))
- (listchecktodo
- (or (plist-get export-plist :body-list-checkbox-todo) "\\1"))
- (listcheckdone
- (or (plist-get export-plist :body-list-checkbox-done) "\\1"))
- (listcheckhalf
- (or (plist-get export-plist :body-list-checkbox-half) "\\1"))
- (listchecktodoend
- (or (plist-get export-plist :body-list-checkbox-todo-end) ""))
- (listcheckdoneend
- (or (plist-get export-plist :body-list-checkbox-done-end) ""))
- (listcheckhalfend
- (or (plist-get export-plist :body-list-checkbox-half-end) ""))
- (bodynewline-paragraph (plist-get export-plist :body-newline-paragraph))
- (bodytextpre (plist-get export-plist :body-text-prefix))
- (bodytextsuf (plist-get export-plist :body-text-suffix))
- (bodylinewrap (plist-get export-plist :body-line-wrap))
- (bodylineform (or (plist-get export-plist :body-line-format) "%s"))
- (blockquotestart (or (plist-get export-plist :blockquote-start) "\n\n\t"))
- (blockquoteend (or (plist-get export-plist :blockquote-end) "\n\n"))
-
- ;; dynamic variables used heinously in fontification
- ;; not referenced locally...
- (format-boldify (plist-get export-plist :bold-format))
- (format-italicize (plist-get export-plist :italic-format))
- (format-underline (plist-get export-plist :underline-format))
- (format-strikethrough (plist-get export-plist :strikethrough-format))
- (format-code (plist-get export-plist :code-format))
- (format-verbatim (plist-get export-plist :verbatim-format))
-
-
-
- thetoc toctags have-headings first-heading-pos
- table-open table-buffer link-buffer link desc desc0 rpl wrap)
-
- (let ((inhibit-read-only t))
- (org-unmodified
- (remove-text-properties (point-min) (point-max)
- '(:org-license-to-kill t))))
-
- (setq org-min-level (org-get-min-level lines level-offset))
- (setq org-last-level org-min-level)
- (org-init-section-numbers)
-
- (find-file-noselect filename)
-
- (setq lang-words (or (assoc language org-export-language-setup)
- (assoc "en" org-export-language-setup)))
- (switch-to-buffer-other-window buffer)
- (erase-buffer)
- (fundamental-mode)
- ;; create local variables for all options, to make sure all called
- ;; functions get the correct information
- (mapc (lambda (x)
- (set (make-local-variable (nth 2 x))
- (plist-get opt-plist (car x))))
- org-export-plist-vars)
- (org-set-local 'org-odd-levels-only odd)
- (setq umax (if arg (prefix-numeric-value arg)
- org-export-headline-levels))
- (setq umax-toc umax)
-
- ;; File header
- (if title
- (insert
- (org-export-generic-header title export-plist
- :title-prefix
- :title-format
- :title-suffix)))
-
- (if (and (or author email)
- (plist-get export-plist :author-export))
- (insert (concat (nth 1 lang-words) ": " (or author "")
- (if email (concat " <" email ">") "")
- "\n")))
-
- (cond
- ((and date (string-match "%" date))
- (setq date (format-time-string date)))
- (date)
- (t (setq date (format-time-string "%Y-%m-%d %T %Z"))))
-
- (if (and date (plist-get export-plist :date-export))
- (insert
- (org-export-generic-header date export-plist
- :date-prefix
- :date-format
- :date-suffix)))
-
- ;; export the table of contents first
- (if (plist-get export-plist :toc-export)
- (progn
- (push
- (org-export-generic-header (nth 3 lang-words) export-plist
- :toc-header-prefix
- :toc-header-format
- :toc-header-suffix)
- thetoc)
-
- (if tocprefix
- (push tocprefix thetoc))
-
- (mapc '(lambda (line)
- (if (string-match org-todo-line-regexp line)
- ;; This is a headline
- (progn
- (setq have-headings t)
- (setq level (- (match-end 1) (match-beginning 1)
- level-offset)
- level (org-tr-level level)
- txt (match-string 3 line)
- todo
- (or (and org-export-mark-todo-in-toc
- (match-beginning 2)
- (not (member (match-string 2 line)
- org-done-keywords)))
- ; TODO, not DONE
- (and org-export-mark-todo-in-toc
- (= level umax-toc)
- (org-search-todo-below
- line lines level))))
- (setq txt (org-html-expand-for-generic txt))
-
- (while (string-match org-bracket-link-regexp txt)
- (setq txt
- (replace-match
- (match-string (if (match-end 2) 3 1) txt)
- t t txt)))
-
- (if (and (not tagsintoc)
- (string-match
- (org-re "[ \t]+:[[:alnum:]_@:]+:[ \t]*$")
- txt))
- (setq txt (replace-match "" t t txt))
- ; include tags but formated
- (if (string-match
- (org-re "[ \t]+:\\([[:alnum:]_@:]+\\):[ \t]*$")
- txt)
- (progn
- (setq
- toctags
- (org-export-generic-header
- (match-string 1 txt)
- export-plist :toc-tags-prefix
- :toc-tags-format :toc-tags-suffix))
- (string-match
- (org-re "[ \t]+:[[:alnum:]_@:]+:[ \t]*$")
- txt)
- (setq txt (replace-match "" t t txt)))
- (setq toctags tocnotagsstr)))
-
- (if (string-match quote-re0 txt)
- (setq txt (replace-match "" t t txt)))
-
- (if (<= level umax-toc)
- (progn
- (push
- (concat
-
- (make-string
- (* (max 0 (- level org-min-level)) tocdepth)
- tocindentchar)
-
- (if tocsecnums
- (format tocsecnumform
- (org-section-number level))
- "")
-
- (format
- (if todo tocformtodo tocformat)
- txt)
-
- toctags)
-
- thetoc)
- (setq org-last-level level))
- ))))
- lines)
- (if tocsuffix
- (push tocsuffix thetoc))
- (setq thetoc (if have-headings (nreverse thetoc) nil))))
-
- (org-init-section-numbers)
- (org-export-generic-check-section "top")
- (while (setq line (pop lines))
- (when (and link-buffer (string-match "^\\*+ " line))
- (org-export-generic-push-links (nreverse link-buffer))
- (setq link-buffer nil))
- (setq wrap nil)
- ;; Remove the quoted HTML tags.
- ;; XXX
- (setq line (org-html-expand-for-generic line))
- ;; Replace links with the description when possible
- ;; XXX
- (while (string-match org-bracket-link-regexp line)
- (setq link (match-string 1 line)
- desc0 (match-string 3 line)
- desc (or desc0 (match-string 1 line)))
- (if (and (> (length link) 8)
- (equal (substring link 0 8) "coderef:"))
- (setq line (replace-match
- (format (org-export-get-coderef-format (substring link 8) desc)
- (cdr (assoc
- (substring link 8)
- org-export-code-refs)))
- t t line))
- (setq rpl (concat "["
- (or (match-string 3 line) (match-string 1 line))
- "]"))
- (when (and desc0 (not (equal desc0 link)))
- (if org-export-generic-links-to-notes
- (push (cons desc0 link) link-buffer)
- (setq rpl (concat rpl " (" link ")")
- wrap (+ (length line) (- (length (match-string 0 line)))
- (length desc)))))
- (setq line (replace-match rpl t t line))))
- (when custom-times
- (setq line (org-translate-time line)))
- (cond
- ((string-match "^\\(\\*+\\)[ \t]+\\(.*\\)" line)
- ;;
- ;; a Headline
- ;;
- (org-export-generic-check-section "headline")
-
- (setq first-heading-pos (or first-heading-pos (point)))
- (setq level (org-tr-level (- (match-end 1) (match-beginning 1)
- level-offset))
- txt (match-string 2 line))
- (org-generic-level-start level old-level txt umax export-plist lines)
- (setq old-level level))
-
- ((and org-export-with-tables
- (string-match "^\\([ \t]*\\)\\(|\\|\\+-+\\+\\)" line))
- ;;
- ;; a Table
- ;;
- (org-export-generic-check-section "table")
-
- (if (not table-open)
- ;; New table starts
- (setq table-open t table-buffer nil))
- ;; Accumulate table lines
- (setq table-buffer (cons line table-buffer))
- (when (or (not lines)
- (not (string-match "^\\([ \t]*\\)\\(|\\|\\+-+\\+\\)"
- (car lines))))
- (setq table-open nil
- table-buffer (nreverse table-buffer))
- (insert (mapconcat
- (lambda (x)
- (org-fix-indentation x org-generic-current-indentation))
- (org-format-table-generic table-buffer)
- "\n") "\n")))
-
- ((string-match "^\\([ \t]*\\)\\(:\\( \\|$\\)\\)" line)
- ;;
- ;; pre-formatted text
- ;;
- (setq line (replace-match "\\1" nil nil line))
-
- (org-export-generic-check-section "preformat" bodyfixedpre bodyfixedsuf)
-
- (insert (format bodyfixedform line)))
-
- ((or (string-match "^\\([ \t]*\\)\\([\-\+][ \t]*\\)" line)
- ;; if the bullet list item is an asterisk, the leading space is /mandatory/
- ;; [2010/02/02:rpg]
- (string-match "^\\([ \t]+\\)\\(\\*[ \t]*\\)" line))
- ;;
- ;; plain list item
- ;; TODO: nested lists
- ;;
- ;; first add a line break between any previous paragraph or line item and this
- ;; one
- (when bodynewline-paragraph
- (insert bodynewline-paragraph))
-
- ;; I believe this gets rid of leading whitespace.
- (setq line (replace-match "" nil nil line))
-
- ;; won't this insert the suffix /before/ the last line of the list?
- ;; also isn't it spoofed by bulleted lists that have a line skip between the list items
- ;; unless 'org-empty-line-terminates-plain-lists' is true?
- (org-export-generic-check-section "liststart" listprefix listsuffix)
-
- ;; deal with checkboxes
- (cond
- ((string-match "^\\(\\[ \\]\\)[ \t]*" line)
- (setq line (concat (replace-match listchecktodo nil nil line)
- listchecktodoend)))
- ((string-match "^\\(\\[X\\]\\)[ \t]*" line)
- (setq line (concat (replace-match listcheckdone nil nil line)
- listcheckdoneend)))
- ((string-match "^\\(\\[/\\]\\)[ \t]*" line)
- (setq line (concat (replace-match listcheckhalf nil nil line)
- listcheckhalfend)))
- )
-
- (insert (format listformat (org-export-generic-fontify line))))
- ((string-match "^\\([ \t]+\\)\\([0-9]+\\.[ \t]*\\)" line)
- ;;
- ;; numbered list item
- ;;
- ;; TODO: nested lists
- ;;
- (setq line (replace-match (if numlistleavenum "\\2" "") nil nil line))
-
- (org-export-generic-check-section "numliststart"
- numlistprefix numlistsuffix)
-
- ;; deal with checkboxes
- ;; TODO: whoops; leaving the numbers is a problem for ^ matching
- (cond
- ((string-match "\\(\\[ \\]\\)[ \t]*" line)
- (setq line (concat (replace-match listchecktodo nil nil line)
- listchecktodoend)))
- ((string-match "\\(\\[X\\]\\)[ \t]*" line)
- (setq line (concat (replace-match listcheckdone nil nil line)
- listcheckdoneend)))
- ((string-match "\\(\\[/\\]\\)[ \t]*" line)
- (setq line (concat (replace-match listcheckhalf nil nil line)
- listcheckhalfend)))
- )
-
- (insert (format numlistformat (org-export-generic-fontify line))))
-
- ((equal line "ORG-BLOCKQUOTE-START")
- (setq line blockquotestart))
- ((equal line "ORG-BLOCKQUOTE-END")
- (setq line blockquoteend))
- ((string-match "^\\s-*$" line)
- ;; blank line
- (if bodynewline-paragraph
- (insert bodynewline-paragraph)))
- (t
- ;;
- ;; body
- ;;
- (org-export-generic-check-section "body" bodytextpre bodytextsuf)
-
- (setq line
- (org-export-generic-fontify line))
-
- ;; XXX: properties? list?
- (if (string-match "^\\([ \t]*\\)\\([-+*][ \t]+\\)\\(.*?\\)\\( ::\\)" line)
- (setq line (replace-match "\\1\\3:" t nil line)))
-
- (setq line (org-fix-indentation line org-generic-current-indentation))
-
- ;; Remove forced line breaks
- (if (string-match "\\\\\\\\[ \t]*$" line)
- (setq line (replace-match "" t t line)))
-
- (if bodylinewrap
- ;; XXX: was dependent on wrap var which was calculated by???
- (if (> (length line) bodylinewrap)
- (setq line
- (org-export-generic-wrap line bodylinewrap))
- (setq line line)))
- (insert (format bodylineform line)))))
-
- ;; if we're at a level > 0; insert the closing body level stuff
- (let ((counter 0))
- (while (> (- level counter) 0)
- (insert
- (org-export-generic-format export-plist :body-section-suffix 0
- (- level counter)))
- (setq counter (1+ counter))))
-
- (org-export-generic-check-section "bottom")
-
- (org-export-generic-push-links (nreverse link-buffer))
-
- (normal-mode)
-
- ;; insert the table of contents
- (when thetoc
- (goto-char (point-min))
- (if (re-search-forward "^[ \t]*\\[TABLE-OF-CONTENTS\\][ \t]*$" nil t)
- (progn
- (goto-char (match-beginning 0))
- (replace-match ""))
- (goto-char first-heading-pos))
- (mapc 'insert thetoc)
- (or (looking-at "[ \t]*\n[ \t]*\n")
- (insert "\n\n")))
-
- ;; Convert whitespace place holders
- (goto-char (point-min))
- (let (beg end)
- (while (setq beg (next-single-property-change (point) 'org-whitespace))
- (setq end (next-single-property-change beg 'org-whitespace))
- (goto-char beg)
- (delete-region beg end)
- (insert (make-string (- end beg) ?\ ))))
-
- (save-buffer)
-
- ;; remove display and invisible chars
- (let (beg end)
- (goto-char (point-min))
- (while (setq beg (next-single-property-change (point) 'display))
- (setq end (next-single-property-change beg 'display))
- (delete-region beg end)
- (goto-char beg)
- (insert "=>"))
- (goto-char (point-min))
- (while (setq beg (next-single-property-change (point) 'org-cwidth))
- (setq end (next-single-property-change beg 'org-cwidth))
- (delete-region beg end)
- (goto-char beg)))
- (goto-char (point-min))))
-
-
-(defun org-export-generic-format (export-plist prop &optional len n reverse)
- "converts a property specification to a string given types of properties
-
-The EXPORT-PLIST should be defined as the lookup plist.
-The PROP should be the property name to search for in it.
-LEN is set to the length of multi-characters strings to generate (or 0)
-N is the tree depth
-REVERSE means to reverse the list if the plist match is a list
- "
- (let* ((prefixtype (plist-get export-plist prop))
- subtype)
- (cond
- ((null prefixtype) "")
- ((and len (char-or-string-p prefixtype) (not (stringp prefixtype)))
- ;; sequence of chars
- (concat (make-string len prefixtype) "\n"))
- ((stringp prefixtype)
- prefixtype)
- ((and n (listp prefixtype))
- (if reverse
- (setq prefixtype (reverse prefixtype)))
- (setq subtype (if (> n (length prefixtype))
- (car (last prefixtype))
- (nth (1- n) prefixtype)))
- (if (stringp subtype)
- subtype
- (concat (make-string len subtype) "\n")))
- (t ""))
- ))
-
-(defun org-export-generic-header (header export-plist
- prefixprop formatprop postfixprop
- &optional n reverse)
- "convert a header to an output string given formatting property names"
- (let* ((formatspec (plist-get export-plist formatprop))
- (len (length header)))
- (concat
- (org-export-generic-format export-plist prefixprop len n reverse)
- (format (or formatspec "%s") header)
- (org-export-generic-format export-plist postfixprop len n reverse))
- ))
-
-(defun org-export-generic-preprocess (parameters)
- "Do extra work for ASCII export"
- ;; Put quotes around verbatim text
- (goto-char (point-min))
- (while (re-search-forward org-verbatim-re nil t)
- (goto-char (match-end 2))
- (backward-delete-char 1) (insert "'")
- (goto-char (match-beginning 2))
- (delete-char 1) (insert "`")
- (goto-char (match-end 2)))
- ;; Remove target markers
- (goto-char (point-min))
- (while (re-search-forward "<<<?\\([^<>]*\\)>>>?\\([ \t]*\\)" nil t)
- (replace-match "\\1\\2")))
-
-(defun org-html-expand-for-generic (line)
- "Handle quoted HTML for ASCII export."
- (if org-export-html-expand
- (while (string-match "@<[^<>\n]*>" line)
- ;; We just remove the tags for now.
- (setq line (replace-match "" nil nil line))))
- line)
-
-(defun org-export-generic-wrap (line where)
- "Wrap LINE at or before WHERE."
- (let* ((ind (org-get-indentation line))
- (indstr (make-string ind ?\ ))
- (len (length line))
- (result "")
- pos didfirst)
- (while (> len where)
- (catch 'found
- (loop for i from where downto (/ where 2) do
- (and (equal (aref line i) ?\ )
- (setq pos i)
- (throw 'found t))))
- (if pos
- (progn
- (setq result
- (concat result
- (if didfirst indstr "")
- (substring line 0 pos)
- "\n"))
- (setq didfirst t)
- (setq line (substring line (1+ pos)))
- (setq len (length line)))
- (setq result (concat result line))
- (setq len 0)))
- (concat result indstr line)))
-
-(defun org-export-generic-push-links (link-buffer)
- "Push out links in the buffer."
- (when link-buffer
- ;; We still have links to push out.
- (insert "\n")
- (let ((ind ""))
- (save-match-data
- (if (save-excursion
- (re-search-backward
- "^\\(\\([ \t]*\\)\\|\\(\\*+ \\)\\)[^ \t\n]" nil t))
- (setq ind (or (match-string 2)
- (make-string (length (match-string 3)) ?\ )))))
- (mapc (lambda (x) (insert ind "[" (car x) "]: " (cdr x) "\n"))
- link-buffer))
- (insert "\n")))
-
-(defun org-generic-level-start (level old-level title umax export-plist
- &optional lines)
- "Insert a new level in a generic export."
- (let ((n (- level umax 1))
- (ind 0)
- (diff (- level old-level)) (counter 0)
- (secnums (plist-get export-plist :body-header-section-numbers))
- (secnumformat
- (plist-get export-plist :body-header-section-number-format))
- char tagstring)
- (unless org-export-with-tags
- (if (string-match (org-re "[ \t]+\\(:[[:alnum:]_@:]+:\\)[ \t]*$") title)
- (setq title (replace-match "" t t title))))
-
- (cond
- ;; going deeper
- ((> level old-level)
- (while (< (+ old-level counter) (1- level))
- (insert
- (org-export-generic-format export-plist :body-section-prefix 0
- (+ old-level counter)))
- (setq counter (1+ counter))
- ))
- ;; going up
- ((< level old-level)
- (while (> (- old-level counter) (1- level))
- (insert
- (org-export-generic-format export-plist :body-section-suffix 0
- (- old-level counter)))
- (setq counter (1+ counter))
- ))
- ;; same level
- ((= level old-level)
- (insert
- (org-export-generic-format export-plist :body-section-suffix 0 level))
- )
- )
- (insert
- (org-export-generic-format export-plist :body-section-prefix 0 level))
-
- (if (and org-export-with-section-numbers
- secnums
- (or (not (numberp secnums))
- (< level secnums)))
- (setq title
- (concat (format (or secnumformat "%s ")
- (org-section-number level)) title)))
-
- ;; handle tags and formatting
- (if (string-match
- (org-re "[ \t]+:\\([[:alnum:]_@:]+\\):[ \t]*$") title)
- (progn
- (if (plist-get export-plist :body-tags-export)
- (setq tagstring (org-export-generic-header (match-string 1 title)
- export-plist
- :body-tags-prefix
- :body-tags-format
- :body-tags-suffix)))
- (string-match (org-re "[ \t]+:[[:alnum:]_@:]+:[ \t]*$") title)
- (setq title (replace-match "" t t title)))
- (setq tagstring (plist-get export-plist :body-tags-none-string)))
-
- (insert
- (org-export-generic-header title export-plist
- :body-section-header-prefix
- :body-section-header-format
- :body-section-header-suffix
- level))
- (if tagstring
- (insert tagstring))
-
- (setq org-generic-current-indentation '(0 . 0))))
-
-(defun org-insert-centered (s &optional underline)
- "Insert the string S centered and underline it with character UNDERLINE."
- (let ((ind (max (/ (- fill-column (string-width s)) 2) 0)))
- (insert (make-string ind ?\ ) s "\n")
- (if underline
- (insert (make-string ind ?\ )
- (make-string (string-width s) underline)
- "\n"))))
-
-(defvar org-table-colgroup-info nil)
-(defun org-format-table-generic (lines)
- "Format a table for ascii export."
- (if (stringp lines)
- (setq lines (org-split-string lines "\n")))
- (if (not (string-match "^[ \t]*|" (car lines)))
- ;; Table made by table.el - test for spanning
- lines
-
- ;; A normal org table
- ;; Get rid of hlines at beginning and end
- (if (string-match "^[ \t]*|-" (car lines)) (setq lines (cdr lines)))
- (setq lines (nreverse lines))
- (if (string-match "^[ \t]*|-" (car lines)) (setq lines (cdr lines)))
- (setq lines (nreverse lines))
- (when org-export-table-remove-special-lines
- ;; Check if the table has a marking column. If yes remove the
- ;; column and the special lines
- (setq lines (org-table-clean-before-export lines)))
- ;; Get rid of the vertical lines except for grouping
- (let ((vl (org-colgroup-info-to-vline-list org-table-colgroup-info))
- rtn line vl1 start)
- (while (setq line (pop lines))
- (if (string-match org-table-hline-regexp line)
- (and (string-match "|\\(.*\\)|" line)
- (setq line (replace-match " \\1" t nil line)))
- (setq start 0 vl1 vl)
- (while (string-match "|" line start)
- (setq start (match-end 0))
- (or (pop vl1) (setq line (replace-match " " t t line)))))
- (push line rtn))
- (nreverse rtn))))
-
-(defun org-colgroup-info-to-vline-list (info)
- (let (vl new last)
- (while info
- (setq last new new (pop info))
- (if (or (memq last '(:end :startend))
- (memq new '(:start :startend)))
- (push t vl)
- (push nil vl)))
- (setq vl (nreverse vl))
- (and vl (setcar vl nil))
- vl))
-
-
-;;; FIXME: this should probably turn into a defconstant later [2010/05/20:rpg]
-(defvar org-export-generic-emphasis-alist
- '(("*" format-boldify nil)
- ("/" format-italicize nil)
- ("_" format-underline nil)
- ("+" format-strikethrough nil)
- ("=" format-code t)
- ("~" format-verbatim t))
- "Alist of org format -> formatting variables for fontification.
-Each element of the list is a list of three elements.
-The first element is the character used as a marker for fontification.
-The second element is a variable name, set in org-export-generic. That
-variable will be dereferenced to obtain a formatting string to wrap
-fontified text with.
-The third element decides whether to protect converted text from other
-conversions.")
-
-;;; Cargo-culted from the latex translation. I couldn't figure out how
-;;; to keep the structure since the generic export operates on lines, rather
-;;; than on a buffer as in the latex export, meaning that none of the
-;;; search forward code could be kept. This led me to rewrite the
-;;; whole thing recursively. A huge lose for efficiency (potentially),
-;;; but I couldn't figure out how to make the looping work.
-;;; Worse, it's /doubly/ recursive, because this function calls
-;;; org-export-generic-emph-format, which can call it recursively...
-;;; [2010/05/20:rpg]
-(defun org-export-generic-fontify (string)
- "Convert fontification according to generic rules."
- (if (string-match org-emph-re string)
- ;; The match goes one char after the *string*, except at the end of a line
- (let ((emph (assoc (match-string 3 string)
- org-export-generic-emphasis-alist))
- (beg (match-beginning 0))
- (end (match-end 0)))
- (unless emph
- (message "`org-export-generic-emphasis-alist' has no entry for formatting triggered by \"%s\""
- (match-string 3 string)))
- ;; now we need to determine whether we have strikethrough or
- ;; a list, which is a bit nasty
- (if (and (equal (match-string 3 string) "+")
- (save-match-data
- (string-match "\\`-+\\'" (match-string 4 string))))
- ;; a list --- skip this match and recurse on the point after the
- ;; first emph char...
- (concat (substring string 0 (1+ (match-beginning 3)))
- (org-export-generic-fontify (substring string (match-beginning 3))))
- (concat (substring string 0 beg) ;; part before the match
- (match-string 1 string)
- (org-export-generic-emph-format (second emph)
- (match-string 4 string)
- (third emph))
- (or (match-string 5 string) "")
- (org-export-generic-fontify (substring string end)))))
- string))
-
-(defun org-export-generic-emph-format (format-varname string protect)
- "Return a string that results from applying the markup indicated by
-FORMAT-VARNAME to STRING."
- (let ((format (symbol-value format-varname)))
- (let ((string-to-emphasize
- (if protect
- string
- (org-export-generic-fontify string))))
- (if format
- (format format string-to-emphasize)
- string-to-emphasize))))
-
-(provide 'org-generic)
-(provide 'org-export-generic)
-
-;;; org-export-generic.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-git-link.el b/.emacs.d/org-7.4/contrib/lisp/org-git-link.el
deleted file mode 100644
index 195bf9b..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-git-link.el
+++ /dev/null
@@ -1,219 +0,0 @@
-;;; org-git-link.el --- Provide org links to specific file version
-
-;; Copyright (C) 2009 Reimar Finken
-
-;; Author: Reimar Finken <reimar.finken@gmx.de>
-;; Keywords: files, calendar, hypermedia
-
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; This program is distaributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; `org-git-link.el' defines two new link types. The `git' link
-;; type is meant to be used in the typical scenario and mimics the
-;; `file' link syntax as closely as possible. The `gitbare' link
-;; type exists mostly for debugging reasons, but also allows e.g.
-;; linking to files in a bare git repository for the experts.
-
-;; * User friendy form
-;; [[git:/path/to/file::searchstring]]
-
-;; This form is the familiar from normal org file links
-;; including search options. However, its use is
-;; restricted to files in a working directory and does not
-;; handle bare repositories on purpose (see the bare form for
-;; that).
-
-;; The search string references a commit (a tree-ish in Git
-;; terminology). The two most useful types of search strings are
-
-;; - A symbolic ref name, usually a branch or tag name (e.g.
-;; master or nobelprize).
-;; - A ref followed by the suffix @ with a date specification
-;; enclosed in a brace pair (e.g. {yesterday}, {1 month 2
-;; weeks 3 days 1 hour 1 second ago} or {1979-02-26 18:30:00})
-;; to specify the value of the ref at a prior point in time
-;;
-;; * Bare git form
-;; [[gitbare:$GIT_DIR::$OBJECT]]
-;;
-;; This is the more bare metal version, which gives the user most
-;; control. It directly translates to the git command
-;; git --no-pager --git-dir=$GIT_DIR show $OBJECT
-;; Using this version one can also view files from a bare git
-;; repository. For detailed information on how to specify an
-;; object, see the man page of `git-rev-parse' (section
-;; SPECIFYING REVISIONS). A specific blob (file) can be
-;; specified by a suffix clolon (:) followed by a path.
-
-;;; Code:
-
-(require 'org)
-(defcustom org-git-program "git"
- "Name of the git executable used to follow git links."
- :type '(string)
- :group 'org)
-
-;; org link functions
-;; bare git link
-(org-add-link-type "gitbare" 'org-gitbare-open)
-
-(defun org-gitbare-open (str)
- (let* ((strlist (org-git-split-string str))
- (gitdir (first strlist))
- (object (second strlist)))
- (org-git-open-file-internal gitdir object)))
-
-
-(defun org-git-open-file-internal (gitdir object)
- (let* ((sha (org-git-blob-sha gitdir object))
- (tmpdir (concat temporary-file-directory "org-git-" sha))
- (filename (org-git-link-filename object))
- (tmpfile (expand-file-name filename tmpdir)))
- (unless (file-readable-p tmpfile)
- (make-directory tmpdir)
- (with-temp-file tmpfile
- (org-git-show gitdir object (current-buffer))))
- (org-open-file tmpfile)
- (set-buffer (get-file-buffer tmpfile))
- (setq buffer-read-only t)))
-
-;; user friendly link
-(org-add-link-type "git" 'org-git-open)
-
-(defun org-git-open (str)
- (let* ((strlist (org-git-split-string str))
- (filepath (first strlist))
- (commit (second strlist))
- (dirlist (org-git-find-gitdir (file-truename filepath)))
- (gitdir (first dirlist))
- (relpath (second dirlist)))
- (org-git-open-file-internal gitdir (concat commit ":" relpath))))
-
-
-;; Utility functions (file names etc)
-
-(defun org-git-split-dirpath (dirpath)
- "Given a directory name, return '(dirname basname)"
- (let ((dirname (file-name-directory (directory-file-name dirpath)))
- (basename (file-name-nondirectory (directory-file-name dirpath))))
- (list dirname basename)))
-
-;; finding the git directory
-(defun org-git-find-gitdir (path)
- "Given a file (not necessarily existing) file path, return the
- a pair (gitdir relpath), where gitdir is the path to the first
- .git subdirectory found updstream and relpath is the rest of
- the path. Example: (org-git-find-gitdir
- \"~/gitrepos/foo/bar.txt\") returns
- '(\"/home/user/gitrepos/.git\" \"foo/bar.txt\"). When not in a git repository, return nil."
- (let ((dir (file-name-directory path))
- (relpath (file-name-nondirectory path)))
- (catch 'toplevel
- (while (not (file-exists-p (expand-file-name ".git" dir)))
- (let ((dirlist (org-git-split-dirpath dir)))
- (when (string= (second dirlist) "") ; at top level
- (throw 'toplevel nil))
- (setq dir (first dirlist)
- relpath (concat (file-name-as-directory (second dirlist)) relpath))))
- (list (expand-file-name ".git" dir) relpath))))
-
-
-(if (featurep 'xemacs)
- (defalias 'org-git-gitrepos-p 'org-git-find-gitdir)
- (defalias 'org-git-gitrepos-p 'org-git-find-gitdir
- "Return non-nil if path is in git repository"))
-
-;; splitting the link string
-
-;; Both link open functions are called with a string of
-;; consisting of two parts separated by a double colon (::).
-(defun org-git-split-string (str)
- "Given a string of the form \"str1::str2\", return a list of
- two substrings \'(\"str1\" \"str2\"). If the double colon is mising, take str2 to be the empty string."
- (let ((strlist (split-string str "::")))
- (cond ((= 1 (length strlist))
- (list (car strlist) ""))
- ((= 2 (length strlist))
- strlist)
- (t (error "org-git-split-string: only one :: allowed: %s" str)))))
-
-;; finding the file name part of a commit
-(defun org-git-link-filename (str)
- "Given an object description (see the man page of
- git-rev-parse), return the nondirectory part of the referenced
- filename, if it can be extracted. Otherwise, return a valid
- filename."
- (let* ((match (and (string-match "[^:]+$" str)
- (match-string 0 str)))
- (filename (and match (file-name-nondirectory match)))) ;extract the final part without slash
- filename))
-
-;; creating a link
-(defun org-git-create-searchstring (branch timestring)
- (concat branch "@{" timestring "}"))
-
-
-(defun org-git-create-git-link (file)
- "Create git link part to file at specific time"
- (interactive "FFile: ")
- (let* ((gitdir (first (org-git-find-gitdir (file-truename file))))
- (branchname (org-git-get-current-branch gitdir))
- (timestring (format-time-string "%Y-%m-%d" (current-time))))
- (org-make-link "git:" file "::" (org-git-create-searchstring branchname timestring))))
-
-(defun org-git-store-link ()
- "Store git link to current file."
- (when (buffer-file-name)
- (let ((file (abbreviate-file-name (buffer-file-name))))
- (when (org-git-gitrepos-p file)
- (org-store-link-props
- :type "git"
- :link (org-git-create-git-link file))))))
-
-(add-hook 'org-store-link-functions 'org-git-store-link)
-
-(defun org-git-insert-link-interactively (file searchstring &optional description)
- (interactive "FFile: \nsSearch string: \nsDescription: ")
- (insert (org-make-link-string (org-make-link "git:" file "::" searchstring) description)))
-
-;; Calling git
-(defun org-git-show (gitdir object buffer)
- "Show the output of git --git-dir=gitdir show object in buffer."
- (unless
- (zerop (call-process org-git-program nil buffer nil
- "--no-pager" (concat "--git-dir=" gitdir) "show" object))
- (error "git error: %s " (save-excursion (set-buffer buffer)
- (buffer-string)))))
-
-(defun org-git-blob-sha (gitdir object)
- "Return sha of the referenced object"
- (with-temp-buffer
- (if (zerop (call-process org-git-program nil t nil
- "--no-pager" (concat "--git-dir=" gitdir) "rev-parse" object))
- (buffer-substring (point-min) (1- (point-max))) ; to strip off final newline
- (error "git error: %s " (buffer-string)))))
-
-(defun org-git-get-current-branch (gitdir)
- "Return the name of the current branch."
- (with-temp-buffer
- (if (not (zerop (call-process org-git-program nil t nil
- "--no-pager" (concat "--git-dir=" gitdir) "symbolic-ref" "-q" "HEAD")))
- (error "git error: %s " (buffer-string))
- (goto-char (point-min))
- (if (looking-at "^refs/heads/") ; 11 characters
- (buffer-substring 12 (1- (point-max))))))) ; to strip off final newline
-
-(provide 'org-git-link)
-;;; org-git-link.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-interactive-query.el b/.emacs.d/org-7.4/contrib/lisp/org-interactive-query.el
deleted file mode 100644
index 1051e7c..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-interactive-query.el
+++ /dev/null
@@ -1,310 +0,0 @@
-;;; org-interactive-query.el --- Interactive modification of agenda query
-;;
-;; Copyright 2007 Free Software Foundation, Inc.
-;;
-;; Author: Christopher League <league at contrapunctus dot net>
-;; Version: 1.0
-;; Keywords: org, wp
-;;
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with this program; if not, write to the Free Software
-;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-;;
-;;; Commentary:
-;;
-
-;; This library implements interactive modification of a tags/todo query
-;; in the org-agenda. It adds 4 keys to the agenda
-;;
-;; / add a keyword as a positive selection criterion
-;; \ add a keyword as a newgative selection criterion
-;; = clear a keyword from the selection string
-;; ;
-
-(require 'org)
-
-(org-defkey org-agenda-mode-map "=" 'org-agenda-query-clear-cmd)
-(org-defkey org-agenda-mode-map "/" 'org-agenda-query-and-cmd)
-(org-defkey org-agenda-mode-map ";" 'org-agenda-query-or-cmd)
-(org-defkey org-agenda-mode-map "\\" 'org-agenda-query-not-cmd)
-
-;;; Agenda interactive query manipulation
-
-(defcustom org-agenda-query-selection-single-key t
- "Non-nil means query manipulation exits after first change.
-When nil, you have to press RET to exit it.
-During query selection, you can toggle this flag with `C-c'.
-This variable can also have the value `expert'. In this case, the window
-displaying the tags menu is not even shown, until you press C-c again."
- :group 'org-agenda
- :type '(choice
- (const :tag "No" nil)
- (const :tag "Yes" t)
- (const :tag "Expert" expert)))
-
-(defun org-agenda-query-selection (current op table &optional todo-table)
- "Fast query manipulation with single keys.
-CURRENT is the current query string, OP is the initial
-operator (one of \"+|-=\"), TABLE is an alist of tags and
-corresponding keys, possibly with grouping information.
-TODO-TABLE is a similar table with TODO keywords, should these
-have keys assigned to them. If the keys are nil, a-z are
-automatically assigned. Returns the new query string, or nil to
-not change the current one."
- (let* ((fulltable (append table todo-table))
- (maxlen (apply 'max (mapcar
- (lambda (x)
- (if (stringp (car x)) (string-width (car x)) 0))
- fulltable)))
- (fwidth (+ maxlen 3 1 3))
- (ncol (/ (- (window-width) 4) fwidth))
- (expert (eq org-agenda-query-selection-single-key 'expert))
- (exit-after-next org-agenda-query-selection-single-key)
- (done-keywords org-done-keywords)
- tbl char cnt e groups ingroup
- tg c2 c c1 ntable rtn)
- (save-window-excursion
- (if expert
- (set-buffer (get-buffer-create " *Org tags*"))
- (delete-other-windows)
- (split-window-vertically)
- (org-switch-to-buffer-other-window (get-buffer-create " *Org tags*")))
- (erase-buffer)
- (org-set-local 'org-done-keywords done-keywords)
- (insert "Query: " current "\n")
- (org-agenda-query-op-line op)
- (insert "\n\n")
- (org-fast-tag-show-exit exit-after-next)
- (setq tbl fulltable char ?a cnt 0)
- (while (setq e (pop tbl))
- (cond
- ((equal e '(:startgroup))
- (push '() groups) (setq ingroup t)
- (when (not (= cnt 0))
- (setq cnt 0)
- (insert "\n"))
- (insert "{ "))
- ((equal e '(:endgroup))
- (setq ingroup nil cnt 0)
- (insert "}\n"))
- (t
- (setq tg (car e) c2 nil)
- (if (cdr e)
- (setq c (cdr e))
- ;; automatically assign a character.
- (setq c1 (string-to-char
- (downcase (substring
- tg (if (= (string-to-char tg) ?@) 1 0)))))
- (if (or (rassoc c1 ntable) (rassoc c1 table))
- (while (or (rassoc char ntable) (rassoc char table))
- (setq char (1+ char)))
- (setq c2 c1))
- (setq c (or c2 char)))
- (if ingroup (push tg (car groups)))
- (setq tg (org-add-props tg nil 'face
- (cond
- ((not (assoc tg table))
- (org-get-todo-face tg))
- (t nil))))
- (if (and (= cnt 0) (not ingroup)) (insert " "))
- (insert "[" c "] " tg (make-string
- (- fwidth 4 (length tg)) ?\ ))
- (push (cons tg c) ntable)
- (when (= (setq cnt (1+ cnt)) ncol)
- (insert "\n")
- (if ingroup (insert " "))
- (setq cnt 0)))))
- (setq ntable (nreverse ntable))
- (insert "\n")
- (goto-char (point-min))
- (if (and (not expert) (fboundp 'fit-window-to-buffer))
- (fit-window-to-buffer))
- (setq rtn
- (catch 'exit
- (while t
- (message "[a-z..]:Toggle [SPC]:clear [RET]:accept [TAB]:free%s%s"
- (if groups " [!] no groups" " [!]groups")
- (if expert " [C-c]:window" (if exit-after-next " [C-c]:single" " [C-c]:multi")))
- (setq c (let ((inhibit-quit t)) (read-char-exclusive)))
- (cond
- ((= c ?\r) (throw 'exit t))
- ((= c ?!)
- (setq groups (not groups))
- (goto-char (point-min))
- (while (re-search-forward "[{}]" nil t) (replace-match " ")))
- ((= c ?\C-c)
- (if (not expert)
- (org-fast-tag-show-exit
- (setq exit-after-next (not exit-after-next)))
- (setq expert nil)
- (delete-other-windows)
- (split-window-vertically)
- (org-switch-to-buffer-other-window " *Org tags*")
- (and (fboundp 'fit-window-to-buffer)
- (fit-window-to-buffer))))
- ((or (= c ?\C-g)
- (and (= c ?q) (not (rassoc c ntable))))
- (setq quit-flag t))
- ((= c ?\ )
- (setq current "")
- (if exit-after-next (setq exit-after-next 'now)))
- ((= c ?\[) ; clear left
- (org-agenda-query-decompose current)
- (setq current (concat "/" (match-string 2 current)))
- (if exit-after-next (setq exit-after-next 'now)))
- ((= c ?\]) ; clear right
- (org-agenda-query-decompose current)
- (setq current (match-string 1 current))
- (if exit-after-next (setq exit-after-next 'now)))
- ((= c ?\t)
- (condition-case nil
- (setq current (read-string "Query: " current))
- (quit))
- (if exit-after-next (setq exit-after-next 'now)))
- ;; operators
- ((or (= c ?/) (= c ?+)) (setq op "+"))
- ((or (= c ?\;) (= c ?|)) (setq op "|"))
- ((or (= c ?\\) (= c ?-)) (setq op "-"))
- ((= c ?=) (setq op "="))
- ;; todos
- ((setq e (rassoc c todo-table) tg (car e))
- (setq current (org-agenda-query-manip
- current op groups 'todo tg))
- (if exit-after-next (setq exit-after-next 'now)))
- ;; tags
- ((setq e (rassoc c ntable) tg (car e))
- (setq current (org-agenda-query-manip
- current op groups 'tag tg))
- (if exit-after-next (setq exit-after-next 'now))))
- (if (eq exit-after-next 'now) (throw 'exit t))
- (goto-char (point-min))
- (beginning-of-line 1)
- (delete-region (point) (point-at-eol))
- (insert "Query: " current)
- (beginning-of-line 2)
- (delete-region (point) (point-at-eol))
- (org-agenda-query-op-line op)
- (goto-char (point-min)))))
- (if rtn current nil))))
-
-(defun org-agenda-query-op-line (op)
- (insert "Operator: "
- (org-agenda-query-op-entry (equal op "+") "/+" "and")
- (org-agenda-query-op-entry (equal op "|") ";|" "or")
- (org-agenda-query-op-entry (equal op "-") "\\-" "not")
- (org-agenda-query-op-entry (equal op "=") "=" "clear")))
-
-(defun org-agenda-query-op-entry (matchp chars str)
- (if matchp
- (org-add-props (format "[%s %s] " chars (upcase str))
- nil 'face 'org-todo)
- (format "[%s]%s " chars str)))
-
-(defun org-agenda-query-decompose (current)
- (string-match "\\([^/]*\\)/?\\(.*\\)" current))
-
-(defun org-agenda-query-clear (current prefix tag)
- (if (string-match (concat prefix "\\b" (regexp-quote tag) "\\b") current)
- (replace-match "" t t current)
- current))
-
-(defun org-agenda-query-manip (current op groups kind tag)
- "Apply an operator to a query string and a tag.
-CURRENT is the current query string, OP is the operator, GROUPS is a
-list of lists of tags that are mutually exclusive. KIND is 'tag for a
-regular tag, or 'todo for a TODO keyword, and TAG is the tag or
-keyword string."
- ;; If this tag is already in query string, remove it.
- (setq current (org-agenda-query-clear current "[-\\+&|]?" tag))
- (if (equal op "=") current
- ;; When using AND, also remove mutually exclusive tags.
- (if (equal op "+")
- (loop for g in groups do
- (if (member tag g)
- (mapc (lambda (x)
- (setq current
- (org-agenda-query-clear current "\\+" x)))
- g))))
- ;; Decompose current query into q1 (tags) and q2 (TODOs).
- (org-agenda-query-decompose current)
- (let* ((q1 (match-string 1 current))
- (q2 (match-string 2 current)))
- (cond
- ((eq kind 'tag)
- (concat q1 op tag "/" q2))
- ;; It's a TODO; when using AND, drop all other TODOs.
- ((equal op "+")
- (concat q1 "/+" tag))
- (t
- (concat q1 "/" q2 op tag))))))
-
-(defun org-agenda-query-global-todo-keys (&optional files)
- "Return alist of all TODO keywords and their fast keys, in all FILES."
- (let (alist)
- (unless (and files (car files))
- (setq files (org-agenda-files)))
- (save-excursion
- (loop for f in files do
- (set-buffer (find-file-noselect f))
- (loop for k in org-todo-key-alist do
- (setq alist (org-agenda-query-merge-todo-key
- alist k)))))
- alist))
-
-(defun org-agenda-query-merge-todo-key (alist entry)
- (let (e)
- (cond
- ;; if this is not a keyword (:startgroup, etc), ignore it
- ((not (stringp (car entry))))
- ;; if keyword already exists, replace char if it's null
- ((setq e (assoc (car entry) alist))
- (when (null (cdr e)) (setcdr e (cdr entry))))
- ;; if char already exists, prepend keyword but drop char
- ((rassoc (cdr entry) alist)
- (message "TRACE POSITION 2")
- (setq alist (cons (cons (car entry) nil) alist)))
- ;; else, prepend COPY of entry
- (t
- (setq alist (cons (cons (car entry) (cdr entry)) alist)))))
- alist)
-
-(defun org-agenda-query-generic-cmd (op)
- "Activate query manipulation with OP as initial operator."
- (let ((q (org-agenda-query-selection org-agenda-query-string op
- org-tag-alist
- (org-agenda-query-global-todo-keys))))
- (when q
- (setq org-agenda-query-string q)
- (org-agenda-redo))))
-
-(defun org-agenda-query-clear-cmd ()
- "Activate query manipulation, to clear a tag from the string."
- (interactive)
- (org-agenda-query-generic-cmd "="))
-
-(defun org-agenda-query-and-cmd ()
- "Activate query manipulation, initially using the AND (+) operator."
- (interactive)
- (org-agenda-query-generic-cmd "+"))
-
-(defun org-agenda-query-or-cmd ()
- "Activate query manipulation, initially using the OR (|) operator."
- (interactive)
- (org-agenda-query-generic-cmd "|"))
-
-(defun org-agenda-query-not-cmd ()
- "Activate query manipulation, initially using the NOT (-) operator."
- (interactive)
- (org-agenda-query-generic-cmd "-"))
-
-(provide 'org-interactive-query) \ No newline at end of file
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-invoice.el b/.emacs.d/org-7.4/contrib/lisp/org-invoice.el
deleted file mode 100644
index 7e2dad2..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-invoice.el
+++ /dev/null
@@ -1,399 +0,0 @@
-;;; org-invoice.el --- Help manage client invoices in OrgMode
-;;
-;; Copyright (C) 2008 pmade inc. (Peter Jones pjones@pmade.com)
-;;
-;; Permission is hereby granted, free of charge, to any person obtaining
-;; a copy of this software and associated documentation files (the
-;; "Software"), to deal in the Software without restriction, including
-;; without limitation the rights to use, copy, modify, merge, publish,
-;; distribute, sublicense, and/or sell copies of the Software, and to
-;; permit persons to whom the Software is furnished to do so, subject to
-;; the following conditions:
-;;
-;; The above copyright notice and this permission notice shall be
-;; included in all copies or substantial portions of the Software.
-;;
-;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-;; LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-;; OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-;; WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-;;
-;; Commentary:
-;;
-;; Building on top of the terrific OrgMode, org-invoice tries to
-;; provide functionality for managing invoices. Currently, it does
-;; this by implementing an OrgMode dynamic block where invoice
-;; information is aggregated so that it can be exported.
-;;
-;; It also provides a library of functions that can be used to collect
-;; this invoice information and use it in other ways, such as
-;; submitting it to on-line invoicing tools.
-;;
-;; I'm already working on an elisp package to submit this invoice data
-;; to the FreshBooks on-line accounting tool.
-;;
-;; Usage:
-;;
-;; In your ~/.emacs:
-;; (autoload 'org-invoice-report "org-invoice")
-;; (autoload 'org-dblock-write:invoice "org-invoice")
-;;
-;; See the documentation in the following functions:
-;;
-;; `org-invoice-report'
-;; `org-dblock-write:invoice'
-;;
-;; Latest version:
-;;
-;; git clone git://pmade.com/elisp
-(eval-when-compile
- (require 'cl)
- (require 'org))
-
-(defgroup org-invoice nil
- "OrgMode Invoice Helper"
- :tag "Org-Invoice" :group 'org)
-
-(defcustom org-invoice-long-date-format "%A, %B %d, %Y"
- "The format string for long dates."
- :type 'string :group 'org-invoice)
-
-(defcustom org-invoice-strip-ts t
- "Remove org timestamps that appear in headings."
- :type 'boolean :group 'org-invoice)
-
-(defcustom org-invoice-default-level 2
- "The heading level at which a new invoice starts. This value
-is used if you don't specify a scope option to the invoice block,
-and when other invoice helpers are trying to find the heading
-that starts an invoice.
-
-The default is 2, assuming that you structure your invoices so
-that they fall under a single heading like below:
-
-* Invoices
-** This is invoice number 1...
-** This is invoice number 2...
-
-If you don't structure your invoices using those conventions,
-change this setting to the number that corresponds to the heading
-at which an invoice begins."
- :type 'integer :group 'org-invoice)
-
-(defcustom org-invoice-start-hook nil
- "Hook called when org-invoice is about to collect data from an
-invoice heading. When this hook is called, point will be on the
-heading where the invoice begins.
-
-When called, `org-invoice-current-invoice' will be set to the
-alist that represents the info for this invoice."
- :type 'hook :group 'org-invoice)
-
- (defcustom org-invoice-heading-hook nil
- "Hook called when org-invoice is collecting data from a
-heading. You can use this hook to add additional information to
-the alist that represents the heading.
-
-When this hook is called, point will be on the current heading
-being processed, and `org-invoice-current-item' will contain the
-alist for the current heading.
-
-This hook is called repeatedly for each invoice item processed."
- :type 'hook :group 'org-invoice)
-
-(defvar org-invoice-current-invoice nil
- "Information about the current invoice.")
-
-(defvar org-invoice-current-item nil
- "Information about the current invoice item.")
-
-(defvar org-invoice-table-params nil
- "The table parameters currently being used.")
-
-(defvar org-invoice-total-time nil
- "The total invoice time for the summary line.")
-
-(defvar org-invoice-total-price nil
- "The total invoice price for the summary line.")
-
-(defconst org-invoice-version "1.0.0"
- "The org-invoice version number.")
-
-(defun org-invoice-goto-tree (&optional tree)
- "Move point to the heading that represents the head of the
-current invoice. The heading level will be taken from
-`org-invoice-default-level' unless tree is set to a string that
-looks like tree2, where the level is 2."
- (let ((level org-invoice-default-level))
- (save-match-data
- (when (and tree (string-match "^tree\\([0-9]+\\)$" tree))
- (setq level (string-to-number (match-string 1 tree)))))
- (org-back-to-heading)
- (while (and (> (org-reduced-level (org-outline-level)) level)
- (org-up-heading-safe)))))
-
-(defun org-invoice-heading-info ()
- "Return invoice information from the current heading."
- (let ((title (org-no-properties (org-get-heading t)))
- (date (org-entry-get nil "TIMESTAMP" 'selective))
- (work (org-entry-get nil "WORK" nil))
- (rate (or (org-entry-get nil "RATE" t) "0"))
- (level (org-outline-level))
- raw-date long-date)
- (unless date (setq date (org-entry-get nil "TIMESTAMP_IA" 'selective)))
- (unless date (setq date (org-entry-get nil "TIMESTAMP" t)))
- (unless date (setq date (org-entry-get nil "TIMESTAMP_IA" t)))
- (unless work (setq work (org-entry-get nil "CLOCKSUM" nil)))
- (unless work (setq work "00:00"))
- (when date
- (setq raw-date (apply 'encode-time (org-parse-time-string date)))
- (setq long-date (format-time-string org-invoice-long-date-format raw-date)))
- (when (and org-invoice-strip-ts (string-match org-ts-regexp-both title))
- (setq title (replace-match "" nil nil title)))
- (when (string-match "^[ \t]+" title)
- (setq title (replace-match "" nil nil title)))
- (when (string-match "[ \t]+$" title)
- (setq title (replace-match "" nil nil title)))
- (setq work (org-hh:mm-string-to-minutes work))
- (setq rate (string-to-number rate))
- (setq org-invoice-current-item (list (cons 'title title)
- (cons 'date date)
- (cons 'raw-date raw-date)
- (cons 'long-date long-date)
- (cons 'work work)
- (cons 'rate rate)
- (cons 'level level)
- (cons 'price (* rate (/ work 60.0)))))
- (run-hook-with-args 'org-invoice-heading-hook)
- org-invoice-current-item))
-
-(defun org-invoice-level-min-max (ls)
- "Return a list where the car is the min level, and the cdr the max."
- (let ((max 0) min level)
- (dolist (info ls)
- (when (cdr (assoc 'date info))
- (setq level (cdr (assoc 'level info)))
- (when (or (not min) (< level min)) (setq min level))
- (when (> level max) (setq max level))))
- (cons (or min 0) max)))
-
-(defun org-invoice-collapse-list (ls)
- "Reorganize the given list by dates."
- (let ((min-max (org-invoice-level-min-max ls)) new)
- (dolist (info ls)
- (let* ((date (cdr (assoc 'date info)))
- (work (cdr (assoc 'work info)))
- (price (cdr (assoc 'price info)))
- (long-date (cdr (assoc 'long-date info)))
- (level (cdr (assoc 'level info)))
- (bucket (cdr (assoc date new))))
- (if (and (/= (car min-max) (cdr min-max))
- (= (car min-max) level)
- (= work 0) (not bucket) date)
- (progn
- (setq info (assq-delete-all 'work info))
- (push (cons 'total-work 0) info)
- (push (cons date (list info)) new)
- (setq bucket (cdr (assoc date new))))
- (when (and date (not bucket))
- (setq bucket (list (list (cons 'date date)
- (cons 'title long-date)
- (cons 'total-work 0)
- (cons 'price 0))))
- (push (cons date bucket) new)
- (setq bucket (cdr (assoc date new))))
- (when (and date bucket)
- (setcdr (assoc 'total-work (car bucket))
- (+ work (cdr (assoc 'total-work (car bucket)))))
- (setcdr (assoc 'price (car bucket))
- (+ price (cdr (assoc 'price (car bucket)))))
- (nconc bucket (list info))))))
- (nreverse new)))
-
-(defun org-invoice-info-to-table (info)
- "Create a single org table row from the given info alist."
- (let ((title (cdr (assoc 'title info)))
- (total (cdr (assoc 'total-work info)))
- (work (cdr (assoc 'work info)))
- (price (cdr (assoc 'price info)))
- (with-price (plist-get org-invoice-table-params :price)))
- (unless total
- (setq
- org-invoice-total-time (+ org-invoice-total-time work)
- org-invoice-total-price (+ org-invoice-total-price price)))
- (setq total (and total (org-minutes-to-hh:mm-string total)))
- (setq work (and work (org-minutes-to-hh:mm-string work)))
- (insert-before-markers
- (concat "|" title
- (cond
- (total (concat "|" total))
- (work (concat "|" work)))
- (and with-price price (concat "|" (format "%.2f" price)))
- "|" "\n"))))
-
-(defun org-invoice-list-to-table (ls)
- "Convert a list of heading info to an org table"
- (let ((with-price (plist-get org-invoice-table-params :price))
- (with-summary (plist-get org-invoice-table-params :summary))
- (with-header (plist-get org-invoice-table-params :headers))
- (org-invoice-total-time 0)
- (org-invoice-total-price 0))
- (insert-before-markers
- (concat "| Task / Date | Time" (and with-price "| Price") "|\n"))
- (dolist (info ls)
- (insert-before-markers "|-\n")
- (mapc 'org-invoice-info-to-table (if with-header (cdr info) (cdr (cdr info)))))
- (when with-summary
- (insert-before-markers
- (concat "|-\n|Total:|"
- (org-minutes-to-hh:mm-string org-invoice-total-time)
- (and with-price (concat "|" (format "%.2f" org-invoice-total-price)))
- "|\n")))))
-
-(defun org-invoice-collect-invoice-data ()
- "Collect all the invoice data from the current OrgMode tree and
-return it. Before you call this function, move point to the
-heading that begins the invoice data, usually using the
-`org-invoice-goto-tree' function."
- (let ((org-invoice-current-invoice
- (list (cons 'point (point)) (cons 'buffer (current-buffer))))
- (org-invoice-current-item nil))
- (save-restriction
- (org-narrow-to-subtree)
- (org-clock-sum)
- (run-hook-with-args 'org-invoice-start-hook)
- (cons org-invoice-current-invoice
- (org-invoice-collapse-list
- (org-map-entries 'org-invoice-heading-info t 'tree 'archive))))))
-
-(defun org-dblock-write:invoice (params)
- "Function called by OrgMode to write the invoice dblock. To
-create an invoice dblock you can use the `org-invoice-report'
-function.
-
-The following parameters can be given to the invoice block (for
-information about dblock parameters, please see the Org manual):
-
-:scope Allows you to override the `org-invoice-default-level'
- variable. The only supported values right now are ones
- that look like :tree1, :tree2, etc.
-
-:prices Set to nil to turn off the price column.
-
-:headers Set to nil to turn off the group headers.
-
-:summary Set to nil to turn off the final summary line."
- (let ((scope (plist-get params :scope))
- (org-invoice-table-params params)
- (zone (move-marker (make-marker) (point)))
- table)
- (unless scope (setq scope 'default))
- (unless (plist-member params :price) (plist-put params :price t))
- (unless (plist-member params :summary) (plist-put params :summary t))
- (unless (plist-member params :headers) (plist-put params :headers t))
- (save-excursion
- (cond
- ((eq scope 'tree) (org-invoice-goto-tree "tree1"))
- ((eq scope 'default) (org-invoice-goto-tree))
- ((symbolp scope) (org-invoice-goto-tree (symbol-name scope))))
- (setq table (org-invoice-collect-invoice-data))
- (goto-char zone)
- (org-invoice-list-to-table (cdr table))
- (goto-char zone)
- (org-table-align)
- (move-marker zone nil))))
-
-(defun org-invoice-in-report-p ()
- "Check to see if point is inside an invoice report."
- (let ((pos (point)) start)
- (save-excursion
- (end-of-line 1)
- (and (re-search-backward "^#\\+BEGIN:[ \t]+invoice" nil t)
- (setq start (match-beginning 0))
- (re-search-forward "^#\\+END:.*" nil t)
- (>= (match-end 0) pos)
- start))))
-
-(defun org-invoice-report (&optional jump)
- "Create or update an invoice dblock report. If point is inside
-an existing invoice report, the report is updated. If point
-isn't inside an invoice report, a new report is created.
-
-When called with a prefix argument, move to the first invoice
-report after point and update it.
-
-For information about various settings for the invoice report,
-see the `org-dblock-write:invoice' function documentation.
-
-An invoice report is created by reading a heading tree and
-collecting information from various properties. It is assumed
-that all invoices start at a second level heading, but this can
-be configured using the `org-invoice-default-level' variable.
-
-Here is an example, where all invoices fall under the first-level
-heading Invoices:
-
-* Invoices
-** Client Foo (Jan 01 - Jan 15)
-*** [2008-01-01 Tue] Built New Server for Production
-*** [2008-01-02 Wed] Meeting with Team to Design New System
-** Client Bar (Jan 01 - Jan 15)
-*** [2008-01-01 Tue] Searched for Widgets on Google
-*** [2008-01-02 Wed] Billed You for Taking a Nap
-
-In this layout, invoices begin at level two, and invoice
-items (tasks) are at level three. You'll notice that each level
-three heading starts with an inactive timestamp. The timestamp
-can actually go anywhere you want, either in the heading, or in
-the text under the heading. But you must have a timestamp
-somewhere so that the invoice report can group your items by
-date.
-
-Properties are used to collect various bits of information for
-the invoice. All properties can be set on the invoice item
-headings, or anywhere in the tree. The invoice report will scan
-up the tree looking for each of the properties.
-
-Properties used:
-
-CLOCKSUM: You can use the Org clock-in and clock-out commands to
- create a CLOCKSUM property. Also see WORK.
-
-WORK: An alternative to the CLOCKSUM property. This property
- should contain the amount of work that went into this
- invoice item formatted as HH:MM (e.g. 01:30).
-
-RATE: Used to calculate the total price for an invoice item.
- Should be the price per hour that you charge (e.g. 45.00).
- It might make more sense to place this property higher in
- the hierarchy than on the invoice item headings.
-
-Using this information, a report is generated that details the
-items grouped by days. For each day you will be able to see the
-total number of hours worked, the total price, and the items
-worked on.
-
-You can place the invoice report anywhere in the tree you want.
-I place mine under a third-level heading like so:
-
-* Invoices
-** An Invoice Header
-*** [2008-11-25 Tue] An Invoice Item
-*** Invoice Report
-#+BEGIN: invoice
-#+END:"
- (interactive "P")
- (let ((report (org-invoice-in-report-p)))
- (when (and (not report) jump)
- (when (re-search-forward "^#\\+BEGIN:[ \t]+invoice" nil t)
- (org-show-entry)
- (beginning-of-line)
- (setq report (point))))
- (if report (goto-char report)
- (org-create-dblock (list :name "invoice")))
- (org-update-dblock)))
-
-(provide 'org-invoice)
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-jira.el b/.emacs.d/org-7.4/contrib/lisp/org-jira.el
deleted file mode 100644
index d224c8f..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-jira.el
+++ /dev/null
@@ -1,65 +0,0 @@
-;;; org-jira.el --- add a jira:ticket protocol to Org
-(defconst org-jira-version "0.1")
-;; Copyright (c)2008 Jonathan Arkell. (by)(nc)(sa) Some rights reserved.
-;; Author: Jonathan Arkell <jonnay@jonnay.net>
-
-;; This file is not part of GNU Emacs.
-
-;; This program is free software; you can redistribute it and/or
-;; modify it under the terms of the GNU General Public License as
-;; published by the Free Software Foundation version 2.
-
-;; This program is distributed in the hope that it will be useful, but
-;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-;; General Public License for more details.
-
-;; For a copy of the GNU General Public License, search the Internet,
-;; or write to the Free Software Foundation, Inc., 59 Temple Place,
-;; Suite 330, Boston, MA 02111-1307 USA
-
-;;; Commentary:
-;; This adds a jira protocol to org mode.
-
-;;; Commands:
-;;
-;; Below are complete command list:
-;;
-;;
-;;; Customizable Options:
-;;
-;; Below are customizable option list:
-;;
-
-;; I had initially planned on adding bi-directional linking, so you
-;; could store links from a jira ticket. I also wanted to import
-;; tickets assigned to you as a task. However, I am no longer working
-;; with JIRA, so this is now abandonware.
-
-;;; Installation:
-;; Put org-jira.el somewhere in your load-path.
-;; (Use M-x show-variable RET load-path to see what your load path is.)
-;; Add this to your emacs init file, preferably after you load org mode.
-;(require 'org-jira)
-
-;;; TODO:
-;; - bi-directional links
-;; - deeper importing, like tasks...?
-
-;;; CHANGELOG:
-;; v 0.2 - ran through checkdoc
-;; - Abandoned.
-;; v 0.1 - Initial release
-
-(require 'jira)
-
-(org-add-link-type "jira" 'org-jira-open)
-
-(defun org-jira-open (path)
- "Open a Jira Link from PATH."
- (jira-show-issue path))
-
-
-(provide 'org-jira)
-
-;;; org-jira.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-learn.el b/.emacs.d/org-7.4/contrib/lisp/org-learn.el
deleted file mode 100644
index 1078001..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-learn.el
+++ /dev/null
@@ -1,180 +0,0 @@
-;;; org-learn.el --- Implements SuperMemo's incremental learning algorithm
-
-;; Copyright (C) 2009
-;; Free Software Foundation, Inc.
-
-;; Author: John Wiegley <johnw at gnu dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 6.32trans
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; The file implements the learning algorithm described at
-;; http://supermemo.com/english/ol/sm5.htm, which is a system for reading
-;; material according to "spaced repetition". See
-;; http://en.wikipedia.org/wiki/Spaced_repetition for more details.
-;;
-;; To use, turn on state logging and schedule some piece of information you
-;; want to read. Then in the agenda buffer type
-
-(require 'org)
-(eval-when-compile
- (require 'cl))
-
-(defgroup org-learn nil
- "Options concerning the learning code in Org-mode."
- :tag "Org Learn"
- :group 'org-progress)
-
-(defcustom org-learn-always-reschedule nil
- "If non-nil, always reschedule items, even if retention was \"perfect\"."
- :type 'boolean
- :group 'org-learn)
-
-(defcustom org-learn-fraction 0.5
- "Controls the rate at which EF is increased or decreased.
-Must be a number between 0 and 1 (the greater it is the faster
-the changes of the OF matrix)."
- :type 'float
- :group 'org-learn)
-
-(defun initial-optimal-factor (n ef)
- (if (= 1 n)
- 4
- ef))
-
-(defun get-optimal-factor (n ef of-matrix)
- (let ((factors (assoc n of-matrix)))
- (or (and factors
- (let ((ef-of (assoc ef (cdr factors))))
- (and ef-of (cdr ef-of))))
- (initial-optimal-factor n ef))))
-
-(defun set-optimal-factor (n ef of-matrix of)
- (let ((factors (assoc n of-matrix)))
- (if factors
- (let ((ef-of (assoc ef (cdr factors))))
- (if ef-of
- (setcdr ef-of of)
- (push (cons ef of) (cdr factors))))
- (push (cons n (list (cons ef of))) of-matrix)))
- of-matrix)
-
-(defun inter-repetition-interval (n ef &optional of-matrix)
- (let ((of (get-optimal-factor n ef of-matrix)))
- (if (= 1 n)
- of
- (* of (inter-repetition-interval (1- n) ef of-matrix)))))
-
-(defun modify-e-factor (ef quality)
- (if (< ef 1.3)
- 1.3
- (+ ef (- 0.1 (* (- 5 quality) (+ 0.08 (* (- 5 quality) 0.02)))))))
-
-(defun modify-of (of q fraction)
- (let ((temp (* of (+ 0.72 (* q 0.07)))))
- (+ (* (- 1 fraction) of) (* fraction temp))))
-
-(defun calculate-new-optimal-factor (interval-used quality used-of
- old-of fraction)
- "This implements the SM-5 learning algorithm in Lisp.
-INTERVAL-USED is the last interval used for the item in question.
-QUALITY is the quality of the repetition response.
-USED-OF is the optimal factor used in calculation of the last
-interval used for the item in question.
-OLD-OF is the previous value of the OF entry corresponding to the
-relevant repetition number and the E-Factor of the item.
-FRACTION is a number belonging to the range (0,1) determining the
-rate of modifications (the greater it is the faster the changes
-of the OF matrix).
-
-Returns the newly calculated value of the considered entry of the
-OF matrix."
- (let (;; the value proposed for the modifier in case of q=5
- (mod5 (/ (1+ interval-used) interval-used))
- ;; the value proposed for the modifier in case of q=2
- (mod2 (/ (1- interval-used) interval-used))
- ;; the number determining how many times the OF value will
- ;; increase or decrease
- modifier)
- (if (< mod5 1.05)
- (setq mod5 1.05))
- (if (< mod2 0.75)
- (setq mod5 0.75))
- (if (> quality 4)
- (setq modifier (1+ (* (- mod5 1) (- quality 4))))
- (setq modifier (- 1 (* (/ (- 1 mod2) 2) (- 4 quality)))))
- (if (< modifier 0.05)
- (setq modifier 0.05))
- (setq new-of (* used-of modifier))
- (if (> quality 4)
- (if (< new-of old-of)
- (setq new-of old-of)))
- (if (< quality 4)
- (if (> new-of old-of)
- (setq new-of old-of)))
- (setq new-of (+ (* new-of fraction) (* old-of (- 1 fraction))))
- (if (< new-of 1.2)
- (setq new-of 1.2)
- new-of)))
-
-(defvar initial-repetition-state '(-1 1 2.5 nil))
-
-(defun determine-next-interval (n ef quality of-matrix)
- (assert (> n 0))
- (assert (and (>= quality 0) (<= quality 5)))
- (if (< quality 3)
- (list (inter-repetition-interval n ef) (1+ n) ef nil)
- (let ((next-ef (modify-e-factor ef quality)))
- (setq of-matrix
- (set-optimal-factor n next-ef of-matrix
- (modify-of (get-optimal-factor n ef of-matrix)
- quality org-learn-fraction))
- ef next-ef)
- ;; For a zero-based quality of 4 or 5, don't repeat
- (if (and (>= quality 4)
- (not org-learn-always-reschedule))
- (list 0 (1+ n) ef of-matrix)
- (list (inter-repetition-interval n ef of-matrix) (1+ n)
- ef of-matrix)))))
-
-(defun org-smart-reschedule (quality)
- (interactive "nHow well did you remember the information (on a scale of 0-5)? ")
- (let* ((learn-str (org-entry-get (point) "LEARN_DATA"))
- (learn-data (or (and learn-str
- (read learn-str))
- (copy-list initial-repetition-state)))
- closed-dates)
- (setq learn-data
- (determine-next-interval (nth 1 learn-data)
- (nth 2 learn-data)
- quality
- (nth 3 learn-data)))
- (org-entry-put (point) "LEARN_DATA" (prin1-to-string learn-data))
- (if (= 0 (nth 0 learn-data))
- (org-schedule t)
- (org-schedule nil (time-add (current-time)
- (days-to-time (nth 0 learn-data)))))))
-
-(provide 'org-learn)
-
-;; arch-tag: a46bb0e5-e4fb-4004-a9b8-63933c55af33
-
-;;; org-learn.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-mac-iCal.el b/.emacs.d/org-7.4/contrib/lisp/org-mac-iCal.el
deleted file mode 100644
index 2510aa7..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-mac-iCal.el
+++ /dev/null
@@ -1,249 +0,0 @@
-;;; org-mac-iCal.el --- Imports events from iCal.app to the Emacs diary
-
-;; Copyright (C) 2009 Christopher Suckling
-
-;; Author: Christopher Suckling <suckling at gmail dot com>
-
-;; This file is Free Software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; It is distributed in the hope that it will be useful, but WITHOUT
-;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
-;; License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;; Version: 0.1057.104
-;; Keywords: outlines, calendar
-
-;;; Commentary:
-;;
-;; This file provides the import of events from Mac OS X 10.5 iCal.app
-;; into the Emacs diary (it is not compatible with OS X < 10.5). The
-;; function org-mac-iCal will import events in all checked iCal.app
-;; calendars for the date range org-mac-iCal-range months, centered
-;; around the current date.
-;;
-;; CAVEAT: This function is destructive; it will overwrite the current
-;; contents of the Emacs diary.
-;;
-;; Installation: add (require 'org-mac-iCal) to your .emacs.
-;;
-;; If you view Emacs diary entries in org-agenda, the following hook
-;; will ensure that all-day events are not orphaned below TODO items
-;; and that any supplementary fields to events (e.g. Location) are
-;; grouped with their parent event
-;;
-;; (add-hook 'org-agenda-cleanup-fancy-diary-hook
-;; (lambda ()
-;; (goto-char (point-min))
-;; (save-excursion
-;; (while (re-search-forward "^[a-z]" nil t)
-;; (goto-char (match-beginning 0))
-;; (insert "0:00-24:00 ")))
-;; (while (re-search-forward "^ [a-z]" nil t)
-;; (goto-char (match-beginning 0))
-;; (save-excursion
-;; (re-search-backward "^[0-9]+:[0-9]+-[0-9]+:[0-9]+ " nil t))
-;; (insert (match-string 0)))))
-
-;;; Code:
-
-(defcustom org-mac-iCal-range 2
- "The range in months to import iCal.app entries into the Emacs
-diary. The import is centered around today's date; thus a value
-of 2 imports entries for one month before and one month after
-today's date"
- :group 'org-time
- :type 'integer)
-
-(defun org-mac-iCal ()
- "Selects checked calendars in iCal.app and imports them into
-the the Emacs diary"
- (interactive)
-
- ;; kill diary buffers then empty diary files to avoid duplicates
- (setq currentBuffer (buffer-name))
- (setq openBuffers (mapcar (function buffer-name) (buffer-list)))
- (omi-kill-diary-buffer openBuffers)
- (with-temp-buffer
- (insert-file-contents diary-file)
- (delete-region (point-min) (point-max))
- (write-region (point-min) (point-max) diary-file))
-
- ;; determine available calendars
- (setq caldav-folders (directory-files "~/Library/Calendars" 1 ".*caldav$"))
- (setq caldav-calendars nil)
- (mapc
- (lambda (x)
- (setq caldav-calendars (nconc caldav-calendars (directory-files x 1 ".*calendar$"))))
- caldav-folders)
-
- (setq local-calendars nil)
- (setq local-calendars (directory-files "~/Library/Calendars" 1 ".*calendar$"))
-
- (setq all-calendars (append caldav-calendars local-calendars))
-
- ;; parse each calendar's Info.plist to see if calendar is checked in iCal
- (setq all-calendars (delq 'nil (mapcar
- (lambda (x)
- (omi-checked x))
- all-calendars)))
-
- ;; for each calendar, concatenate individual events into a single ics file
- (with-temp-buffer
- (shell-command "sw_vers" (current-buffer))
- (when (re-search-backward "10\\.[56]" nil t)
- (omi-concat-leopard-ics all-calendars)))
-
- ;; move all caldav ics files to the same place as local ics files
- (mapc
- (lambda (x)
- (mapc
- (lambda (y)
- (rename-file (concat x "/" y);
- (concat "~/Library/Calendars/" y)))
- (directory-files x nil ".*ics$")))
- caldav-folders)
-
- ;; check calendar has contents and import
- (setq import-calendars (directory-files "~/Library/Calendars" 1 ".*ics$"))
- (mapc
- (lambda (x)
- (when (/= (nth 7 (file-attributes x 'string)) 0)
- (omi-import-ics x)))
- import-calendars)
-
- ;; tidy up intermediate files and buffers
- (setq usedCalendarsBuffers (mapcar (function buffer-name) (buffer-list)))
- (omi-kill-ics-buffer usedCalendarsBuffers)
- (setq usedCalendarsFiles (directory-files "~/Library/Calendars" 1 ".*ics$"))
- (omi-delete-ics-file usedCalendarsFiles)
-
- (switch-to-buffer currentBuffer))
-
-(defun omi-concat-leopard-ics (list)
- "Leopard stores each iCal.app event in a separate ics file.
-Whilst useful for Spotlight indexing, this is less helpful for
-icalendar-import-file. omi-concat-leopard-ics concatenates these
-individual event files into a single ics file"
- (mapc
- (lambda (x)
- (setq omi-leopard-events (directory-files (concat x "/Events") 1 ".*ics$"))
- (with-temp-buffer
- (mapc
- (lambda (y)
- (insert-file-contents (expand-file-name y)))
- omi-leopard-events)
- (write-region (point-min) (point-max) (concat (expand-file-name x) ".ics"))))
- list))
-
-(defun omi-import-ics (string)
- "Imports an ics file into the Emacs diary. First tidies up the
-ics file so that it is suitable for import and selects a sensible
-date range so that Emacs calendar view doesn't grind to a halt"
- (with-temp-buffer
- (insert-file-contents string)
- (goto-char (point-min))
- (while
- (re-search-forward "^BEGIN:VCALENDAR$" nil t)
- (setq startEntry (match-beginning 0))
- (re-search-forward "^END:VCALENDAR$" nil t)
- (setq endEntry (match-end 0))
- (save-restriction
- (narrow-to-region startEntry endEntry)
- (goto-char (point-min))
- (re-search-forward "\\(^DTSTART;.*:\\)\\([0-9][0-9][0-9][0-9]\\)\\([0-9][0-9]\\)" nil t)
- (if (or (eq (match-string 2) nil) (eq (match-string 3) nil))
- (progn
- (setq yearEntry 0)
- (setq monthEntry 0))
- (setq yearEntry (string-to-number (match-string 2)))
- (setq monthEntry (string-to-number (match-string 3))))
- (setq year (string-to-number (format-time-string "%Y")))
- (setq month (string-to-number (format-time-string "%m")))
- (when (or
- (and
- (= yearEntry year)
- (or (< monthEntry (- month (/ org-mac-iCal-range 2))) (> monthEntry (+ month (/ org-mac-iCal-range 2)))))
- (< yearEntry (- year 1))
- (> yearEntry (+ year 1))
- (and
- (= yearEntry (- year 1)) (/= monthEntry 12))
- (and
- (= yearEntry (+ year 1)) (/= monthEntry 1)))
- (delete-region startEntry endEntry))))
- (while
- (re-search-forward "^END:VEVENT$" nil t)
- (delete-blank-lines))
- (goto-line 1)
- (insert "BEGIN:VCALENDAR\n\n")
- (goto-line 2)
- (while
- (re-search-forward "^BEGIN:VCALENDAR$" nil t)
- (replace-match "\n"))
- (goto-line 2)
- (while
- (re-search-forward "^END:VCALENDAR$" nil t)
- (replace-match "\n"))
- (insert "END:VCALENDAR")
- (goto-line 1)
- (delete-blank-lines)
- (while
- (re-search-forward "^END:VEVENT$" nil t)
- (delete-blank-lines))
- (goto-line 1)
- (while
- (re-search-forward "^ORG.*" nil t)
- (replace-match "\n"))
- (goto-line 1)
- (write-region (point-min) (point-max) string))
-
- (icalendar-import-file string diary-file))
-
-(defun omi-kill-diary-buffer (list)
- (mapc
- (lambda (x)
- (if (string-match "^diary" x)
- (kill-buffer x)))
- list))
-
-(defun omi-kill-ics-buffer (list)
- (mapc
- (lambda (x)
- (if (string-match "ics$" x)
- (kill-buffer x)))
- list))
-
-(defun omi-delete-ics-file (list)
- (mapc
- (lambda (x)
- (delete-file x))
- list))
-
-(defun omi-checked (directory)
- "Parse Info.plist in iCal.app calendar folder and determine
-whether Checked key is 1. If Checked key is not 1, remove
-calendar from list of calendars for import"
- (let* ((root (xml-parse-file (car (directory-files directory 1 "Info.plist"))))
- (plist (car root))
- (dict (car (xml-get-children plist 'dict)))
- (keys (cdr (xml-node-children dict)))
- (keys (mapcar
- (lambda (x)
- (cond ((listp x)
- x)))
- keys))
- (keys (delq 'nil keys)))
- (when (equal "1" (car (cddr (lax-plist-get keys '(key nil "Checked")))))
- directory)))
-
-(provide 'org-mac-iCal)
-
-;;; org-mac-iCal.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-mac-link-grabber.el b/.emacs.d/org-7.4/contrib/lisp/org-mac-link-grabber.el
deleted file mode 100644
index 8ec428b..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-mac-link-grabber.el
+++ /dev/null
@@ -1,465 +0,0 @@
-;;; org-mac-link-grabber.el --- Grab links and url from various mac
-;;; application and insert them as links into org-mode documents
-;;
-;; Copyright (c) 2010 Free Software Foundation, Inc.
-;;
-;; Author: Anthony Lander <anthony.lander@gmail.com>
-;; Version: 1.0.1
-;; Keywords: org, mac, hyperlink
-;;
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with this program; if not, write to the Free Software
-;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-;;
-;;; Commentary:
-;;
-;; This code allows you to grab either the current selected items, or
-;; the frontmost url in various mac appliations, and insert them as
-;; hyperlinks into the current org-mode document at point.
-;;
-;; This code is heavily based on, and indeed requires,
-;; org-mac-message.el written by John Weigley and Christopher
-;; Suckling.
-;;
-;; Detailed comments for each application interface are inlined with
-;; the code. Here is a brief overview of how the code interacts with
-;; each application:
-;;
-;; Finder.app - grab links to the selected files in the frontmost window
-;; Mail.app - grab links to the selected messages in the message list
-;; AddressBook.app - Grab links to the selected addressbook Cards
-;; Firefox.app - Grab the url of the frontmost tab in the frontmost window
-;; Vimperator/Firefox.app - Grab the url of the frontmost tab in the frontmost window
-;; Safari.app - Grab the url of the frontmost tab in the frontmost window
-;; Google Chrome.app - Grab the url of the frontmost tab in the frontmost window
-;; Together.app - Grab links to the selected items in the library list
-;;
-;;
-;; Installation:
-;;
-;; add (require 'org-mac-link-grabber) to your .emacs, and optionally
-;; bind a key to activate the link grabber menu, like this:
-;;
-;; (add-hook 'org-mode-hook (lambda ()
-;; (define-key org-mode-map (kbd "C-c g") 'omlg-grab-link)))
-;;
-;;
-;; Usage:
-;;
-;; Type C-c g (or whatever key you defined, as above), or type M-x
-;; omlg-grab-link RET to activate the link grabber. This will present
-;; you with a menu to choose an application from which to grab a link
-;; to insert at point. You may also type C-g to abort.
-;;
-;; Customizing:
-;;
-;; You may customize which applications appear in the grab menu by
-;; customizing the group org-mac-link-grabber. Changes take effect
-;; immediately.
-;;
-;;
-;;; Code:
-
-(require 'org)
-(require 'org-mac-message)
-
-(defgroup org-mac-link-grabber nil
- "Options concerning grabbing links from external Mac
-applications and inserting them in org documents"
- :tag "Org Mac link grabber"
- :group 'org-link)
-
-(defcustom org-mac-grab-Finder-app-p t
- "Enable menu option [F]inder to grab links from the Finder"
- :tag "Grab Finder.app links"
- :group 'org-mac-link-grabber
- :type 'boolean)
-
-(defcustom org-mac-grab-Mail-app-p t
- "Enable menu option [m]ail to grab links from Mail.app"
- :tag "Grab Mail.app links"
- :group 'org-mac-link-grabber
- :type 'boolean)
-
-(defcustom org-mac-grab-Addressbook-app-p t
- "Enable menu option [a]ddressbook to grab links from AddressBook.app"
- :tag "Grab AddressBook.app links"
- :group 'org-mac-link-grabber
- :type 'boolean)
-
-(defcustom org-mac-grab-Safari-app-p t
- "Enable menu option [s]afari to grab links from Safari.app"
- :tag "Grab Safari.app links"
- :group 'org-mac-link-grabber
- :type 'boolean)
-
-(defcustom org-mac-grab-Firefox-app-p t
- "Enable menu option [f]irefox to grab links from Firefox.app"
- :tag "Grab Firefox.app links"
- :group 'org-mac-link-grabber
- :type 'boolean)
-
-(defcustom org-mac-grab-Firefox+Vimperator-p nil
- "Enable menu option [v]imperator to grab links from Firefox.app running the Vimperator plugin"
- :tag "Grab Vimperator/Firefox.app links"
- :group 'org-mac-link-grabber
- :type 'boolean)
-
-(defcustom org-mac-grab-Chrome-app-p t
- "Enable menu option [f]irefox to grab links from Google Chrome.app"
- :tag "Grab Google Chrome.app links"
- :group 'org-mac-link-grabber
- :type 'boolean)
-
-(defcustom org-mac-grab-Together-app-p nil
- "Enable menu option [t]ogether to grab links from Together.app"
- :tag "Grab Together.app links"
- :group 'org-mac-link-grabber
- :type 'boolean)
-
-
-(defun omlg-grab-link ()
- "Prompt the user for an application to grab a link from, then go grab the link, and insert it at point"
- (interactive)
- (let* ((descriptors `(("F" "inder" org-mac-finder-insert-selected ,org-mac-grab-Finder-app-p)
- ("m" "ail" org-mac-message-insert-selected ,org-mac-grab-Mail-app-p)
- ("a" "ddressbook" org-mac-addressbook-insert-selected ,org-mac-grab-Addressbook-app-p)
- ("s" "afari" org-mac-safari-insert-frontmost-url ,org-mac-grab-Safari-app-p)
- ("f" "irefox" org-mac-firefox-insert-frontmost-url ,org-mac-grab-Firefox-app-p)
- ("v" "imperator" org-mac-vimperator-insert-frontmost-url ,org-mac-grab-Firefox+Vimperator-p)
- ("c" "hrome" org-mac-chrome-insert-frontmost-url ,org-mac-grab-Chrome-app-p)
- ("t" "ogether" org-mac-together-insert-selected ,org-mac-grab-Together-app-p)))
- (menu-string (make-string 0 ?x))
- input)
-
- ;; Create the menu string for the keymap
- (mapc '(lambda (descriptor)
- (when (elt descriptor 3)
- (setf menu-string (concat menu-string "[" (elt descriptor 0) "]" (elt descriptor 1) " "))))
- descriptors)
- (setf (elt menu-string (- (length menu-string) 1)) ?:)
-
- ;; Prompt the user, and grab the link
- (message menu-string)
- (setq input (read-char-exclusive))
- (mapc '(lambda (descriptor)
- (let ((key (elt (elt descriptor 0) 0))
- (active (elt descriptor 3))
- (grab-function (elt descriptor 2)))
- (when (and active (eq input key))
- (call-interactively grab-function))))
- descriptors)))
-
-(defalias 'omgl-grab-link 'omlg-grab-link
- "Renamed, and this alias will be obsolete next revision.")
-
-(defun org-mac-paste-applescript-links (as-link-list)
- "Paste in a list of links from an applescript handler. The
- links are of the form <link>::split::<name>"
- (let* ((link-list
- (mapcar
- (lambda (x) (if (string-match "\\`\"\\(.*\\)\"\\'" x) (setq x (match-string 1 x))) x)
- (split-string as-link-list "[\r\n]+")))
- split-link URL description orglink orglink-insert rtn orglink-list)
- (while link-list
- (setq split-link (split-string (pop link-list) "::split::"))
- (setq URL (car split-link))
- (setq description (cadr split-link))
- (when (not (string= URL ""))
- (setq orglink (org-make-link-string URL description))
- (push orglink orglink-list)))
- (setq rtn (mapconcat 'identity orglink-list "\n"))
- (kill-new rtn)
- rtn))
-
-
-
-;; Handle links from Firefox.app
-;;
-;; This code allows you to grab the current active url from the main
-;; Firefox.app window, and insert it as a link into an org-mode
-;; document. Unfortunately, firefox does not expose an applescript
-;; dictionary, so this is necessarily introduces some limitations.
-;;
-;; The applescript to grab the url from Firefox.app uses the System
-;; Events application to give focus to the firefox application, select
-;; the contents of the url bar, and copy it. It then uses the title of
-;; the window as the text of the link. There is no way to grab links
-;; from other open tabs, and further, if there is more than one window
-;; open, it is not clear which one will be used (though emperically it
-;; seems that it is always the last active window).
-
-(defun as-mac-firefox-get-frontmost-url ()
- (let ((result (do-applescript
- (concat
- "set oldClipboard to the clipboard\n"
- "set frontmostApplication to path to frontmost application\n"
- "tell application \"Firefox\"\n"
- " activate\n"
- " delay 0.15\n"
- " tell application \"System Events\"\n"
- " keystroke \"l\" using command down\n"
- " keystroke \"c\" using command down\n"
- " end tell\n"
- " delay 0.15\n"
- " set theUrl to the clipboard\n"
- " set the clipboard to oldClipboard\n"
- " set theResult to (get theUrl) & \"::split::\" & (get name of window 1)\n"
- "end tell\n"
- "activate application (frontmostApplication as text)\n"
- "set links to {}\n"
- "copy theResult to the end of links\n"
- "return links as string\n"))))
- (car (split-string result "[\r\n]+" t))))
-
-(defun org-mac-firefox-get-frontmost-url ()
- (interactive)
- (message "Applescript: Getting Firefox url...")
- (let* ((url-and-title (as-mac-firefox-get-frontmost-url))
- (split-link (split-string url-and-title "::split::"))
- (URL (car split-link))
- (description (cadr split-link))
- (org-link))
- (when (not (string= URL ""))
- (setq org-link (org-make-link-string URL description)))
- (kill-new org-link)
- org-link))
-
-(defun org-mac-firefox-insert-frontmost-url ()
- (interactive)
- (insert (org-mac-firefox-get-frontmost-url)))
-
-
-;; Handle links from Google Firefox.app running the Vimperator extension
-;; Grab the frontmost url from Firefox+Vimperator. Same limitations are
-;; Firefox
-
-(defun as-mac-vimperator-get-frontmost-url ()
- (let ((result (do-applescript
- (concat
- "set oldClipboard to the clipboard\n"
- "set frontmostApplication to path to frontmost application\n"
- "tell application \"Firefox\"\n"
- " activate\n"
- " delay 0.15\n"
- " tell application \"System Events\"\n"
- " keystroke \"y\"\n"
- " end tell\n"
- " delay 0.15\n"
- " set theUrl to the clipboard\n"
- " set the clipboard to oldClipboard\n"
- " set theResult to (get theUrl) & \"::split::\" & (get name of window 1)\n"
- "end tell\n"
- "activate application (frontmostApplication as text)\n"
- "set links to {}\n"
- "copy theResult to the end of links\n"
- "return links as string\n"))))
- (replace-regexp-in-string "\s+-\s+Vimperator" "" (car (split-string result "[\r\n]+" t)))))
-
-
-(defun org-mac-vimperator-get-frontmost-url ()
- (interactive)
- (message "Applescript: Getting Vimperator url...")
- (let* ((url-and-title (as-mac-vimperator-get-frontmost-url))
- (split-link (split-string url-and-title "::split::"))
- (URL (car split-link))
- (description (cadr split-link))
- (org-link))
- (when (not (string= URL ""))
- (setq org-link (org-make-link-string URL description)))
- (kill-new org-link)
- org-link))
-
-(defun org-mac-vimperator-insert-frontmost-url ()
- (interactive)
- (insert (org-mac-vimperator-get-frontmost-url)))
-
-
-;; Handle links from Google Chrome.app
-;; Grab the frontmost url from Google Chrome. Same limitations are
-;; Firefox because Chrome doesn't publish an Applescript dictionary
-
-(defun as-mac-chrome-get-frontmost-url ()
- (let ((result (do-applescript
- (concat
- "set oldClipboard to the clipboard\n"
- "set frontmostApplication to path to frontmost application\n"
- "tell application \"Google Chrome\"\n"
- " activate\n"
- " delay 0.15\n"
- " tell application \"System Events\"\n"
- " keystroke \"l\" using command down\n"
- " keystroke \"c\" using command down\n"
- " end tell\n"
- " delay 0.15\n"
- " set theUrl to the clipboard\n"
- " set the clipboard to oldClipboard\n"
- " set theResult to (get theUrl) & \"::split::\" & (get name of window 1)\n"
- "end tell\n"
- "activate application (frontmostApplication as text)\n"
- "set links to {}\n"
- "copy theResult to the end of links\n"
- "return links as string\n"))))
- (car (split-string result "[\r\n]+" t))))
-
-(defun org-mac-chrome-get-frontmost-url ()
- (interactive)
- (message "Applescript: Getting Chrome url...")
- (let* ((url-and-title (as-mac-chrome-get-frontmost-url))
- (split-link (split-string url-and-title "::split::"))
- (URL (car split-link))
- (description (cadr split-link))
- (org-link))
- (when (not (string= URL ""))
- (setq org-link (org-make-link-string URL description)))
- (kill-new org-link)
- org-link))
-
-(defun org-mac-chrome-insert-frontmost-url ()
- (interactive)
- (insert (org-mac-chrome-get-frontmost-url)))
-
-
-;; Handle links from Safari.app
-;; Grab the frontmost url from Safari.
-
-(defun as-mac-safari-get-frontmost-url ()
- (let ((result (do-applescript
- (concat
- "tell application \"Safari\"\n"
- " set theUrl to URL of document 1\n"
- " set theName to the name of the document 1\n"
- " return theUrl & \"::split::\" & theName & \"\n\"\n"
- "end tell\n"))))
- (car (split-string result "[\r\n]+" t))))
-
-(defun org-mac-safari-get-frontmost-url ()
- (interactive)
- (message "Applescript: Getting Safari url...")
- (let* ((url-and-title (as-mac-safari-get-frontmost-url))
- (split-link (split-string url-and-title "::split::"))
- (URL (car split-link))
- (description (cadr split-link))
- (org-link))
- (when (not (string= URL ""))
- (setq org-link (org-make-link-string URL description)))
- (kill-new org-link)
- org-link))
-
-(defun org-mac-safari-insert-frontmost-url ()
- (interactive)
- (insert (org-mac-safari-get-frontmost-url)))
-
-
-;;
-;;
-;; Handle links from together.app
-;;
-;;
-
-(org-add-link-type "x-together-item" 'org-mac-together-item-open)
-
-(defun org-mac-together-item-open (uid)
- "Open the given uid, which is a reference to an item in Together"
- (shell-command (concat "open -a Together \"x-together-item:" uid "\"")))
-
-(defun as-get-selected-together-items ()
- (do-applescript
- (concat
- "tell application \"Together\"\n"
- " set theLinkList to {}\n"
- " set theSelection to selected items\n"
- " repeat with theItem in theSelection\n"
- " set theLink to (get item link of theItem) & \"::split::\" & (get name of theItem) & \"\n\"\n"
- " copy theLink to end of theLinkList\n"
- " end repeat\n"
- " return theLinkList as string\n"
- "end tell")))
-
-(defun org-mac-together-get-selected ()
- (interactive)
- (message "Applescript: Getting Togther items...")
- (org-mac-paste-applescript-links (as-get-selected-together-items)))
-
-(defun org-mac-together-insert-selected ()
- (interactive)
- (insert (org-mac-together-get-selected)))
-
-
-;;
-;;
-;; Handle links from Finder.app
-;;
-;;
-
-(defun as-get-selected-finder-items ()
- (do-applescript
-(concat
-"tell application \"Finder\"\n"
-" set theSelection to the selection\n"
-" set links to {}\n"
-" repeat with theItem in theSelection\n"
-" set theLink to \"file://\" & (POSIX path of (theItem as string)) & \"::split::\" & (get the name of theItem) & \"\n\"\n"
-" copy theLink to the end of links\n"
-" end repeat\n"
-" return links as string\n"
-"end tell\n")))
-
-(defun org-mac-finder-item-get-selected ()
- (interactive)
- (message "Applescript: Getting Finder items...")
- (org-mac-paste-applescript-links (as-get-selected-finder-items)))
-
-(defun org-mac-finder-insert-selected ()
- (interactive)
- (insert (org-mac-finder-item-get-selected)))
-
-
-;;
-;;
-;; Handle links from AddressBook.app
-;;
-;;
-
-(org-add-link-type "addressbook" 'org-mac-addressbook-item-open)
-
-(defun org-mac-addressbook-item-open (uid)
- "Open the given uid, which is a reference to an item in Together"
- (shell-command (concat "open \"addressbook:" uid "\"")))
-
-(defun as-get-selected-addressbook-items ()
- (do-applescript
- (concat
- "tell application \"Address Book\"\n"
- " set theSelection to the selection\n"
- " set links to {}\n"
- " repeat with theItem in theSelection\n"
- " set theLink to \"addressbook://\" & (the id of theItem) & \"::split::\" & (the name of theItem) & \"\n\"\n"
- " copy theLink to the end of links\n"
- " end repeat\n"
- " return links as string\n"
- "end tell\n")))
-
-(defun org-mac-addressbook-item-get-selected ()
- (interactive)
- (message "Applescript: Getting Address Book items...")
- (org-mac-paste-applescript-links (as-get-selected-addressbook-items)))
-
-(defun org-mac-addressbook-insert-selected ()
- (interactive)
- (insert (org-mac-addressbook-item-get-selected)))
-
-
-(provide 'org-mac-link-grabber)
-
-;;; org-mac-link-grabber.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-mairix.el b/.emacs.d/org-7.4/contrib/lisp/org-mairix.el
deleted file mode 100644
index 1f62b95..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-mairix.el
+++ /dev/null
@@ -1,332 +0,0 @@
-;;; org-mairix.el - Support for hooking mairix search into Org for different MUAs
-;;
-;; Copyright (C) 2007 Georg C. F. Greve
-;; mutt support by Adam Spiers <orgmode at adamspiers dot org>
-;;
-;; Author: Georg C. F. Greve <greve at fsfeurope dot org>
-;; Keywords: outlines, hypermedia, calendar, wp, email, mairix
-;; Purpose: Integrate mairix email searching into Org mode
-;; See http://orgmode.org and http://www.rpcurnow.force9.co.uk/mairix/
-;; Version: 0.5
-;;
-;; This file is Free Software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; It is distributed in the hope that it will be useful, but WITHOUT
-;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
-;; License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; USAGE NOTE
-;;
-;; You will need to configure mairix first, which involves setting up your
-;; .mairixrc in your home directory. Once it is working, you should set up
-;; your way to display results in your favorite way -- usually a MUA.
-;; Currently gnus and mutt are supported.
-;;
-;; After both steps are done, all you should need to hook mairix, org
-;; and your MUA together is to do (require 'org-mairix) in your
-;; startup file. Everything can then be configured normally through
-;; Emacs customisation.
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(require 'org)
-
-;;; The custom variables
-
-(defgroup org-mairix nil
- "Mairix support/integration in org."
- :tag "Org Mairix"
- :group 'org)
-
-(defcustom org-mairix-threaded-links t
- "Should new links be created as threaded links?
-If t, links will be stored as threaded searches.
-If nil, links will be stored as non-threaded searches."
- :group 'org-mairix
- :type 'boolean)
-
-(defcustom org-mairix-augmented-links nil
- "Should new links be created as augmenting searches?
-If t, links will be stored as augmenting searches.
-If nil, links will be stored as normal searches.
-
-Attention: When activating this option, you will need
-to remove old articles from your mairix results group
-in some other way, mairix will not do it for you."
- :group 'org-mairix
- :type 'boolean)
-
-(defcustom org-mairix-display-hook 'org-mairix-gnus-display-results
- "Hook to call to display the results of a successful mairix search.
-Defaults to Gnus, feel free to add your own MUAs or methods."
- :group 'org-mairix
- :type 'hook)
-
-(defcustom org-mairix-open-command "mairix %args% '%search%'"
- "The mairix command-line to use. If your paths are set up
-correctly, you should not need to change this.
-
-'%search%' will get substituted with the search expression, and
-'%args%' with any additional arguments."
- :group 'org-mairix
- :type 'string)
-
-;;; The hooks to integrate mairix into org
-
-(org-add-link-type "mairix" 'org-mairix-open)
-(add-hook 'org-store-link-functions 'org-mairix-store-gnus-link)
-
-;;; Generic org-mairix functions
-
-(defun org-mairix-construct-link (message-id)
- "Construct a mairix: hyperlink based on message-id."
- (concat "mairix:"
- (if org-mairix-threaded-links "t:")
- (if org-mairix-augmented-links "a:")
- "@@"
- (org-remove-angle-brackets message-id)))
-
-(defun org-store-mairix-link-props (&rest plist)
- "Take a property list describing a mail, and add mairix link
-and description properties so that org can build a mairix link to
-it."
- ;; We have to call `org-store-link-props' twice:
- ;;
- ;; - It extracts 'fromname'/'fromaddress' from 'from' property,
- ;; and stores the updated plist to `org-store-link-plist'.
- ;;
- ;; - `org-email-link-description' uses these new properties to
- ;; build a description from the previously stored plist. I
- ;; wrote a tiny patch to `org-email-link-description' so it
- ;; could take a non-stored plist as an optional 2nd argument,
- ;; but the plist provided still needs 'fromname'/'fromaddress'.
- ;;
- ;; - Ideally we would decouple the storing bit of
- ;; `org-store-link-props' from the extraction bit, but lots of
- ;; stuff in `org-store-link' which calls it would need to be
- ;; changed. Maybe just factor out the extraction so it can be
- ;; reused separately?
- (let ((mid (plist-get plist :message-id)))
- (apply 'org-store-link-props
- (append plist
- (list :type "mairix"
- :link (org-mairix-construct-link mid))))
- (apply 'org-store-link-props
- (append org-store-link-plist
- (list :description (org-email-link-description))))))
-
-(defun org-mairix-message-send-and-exit-with-link ()
- "Function that can be assigned as an alternative sending function,
-it sends the message and then stores a mairix link to it before burying
-the buffer just like 'message-send-and-exit' does."
- (interactive)
- (message-send)
- (let* ((message-id (message-fetch-field "Message-Id"))
- (subject (message-fetch-field "Subject"))
- (link (org-mairix-construct-link message-id))
- (desc (concat "Email: '" subject "'")))
- (setq org-stored-links
- (cons (list link desc) org-stored-links)))
- (message-bury (current-buffer)))
-
-(defun org-mairix-open (search)
- "Function to open mairix link.
-
-We first need to split it into its individual parts, and then
-extract the message-id to be passed on to the display function
-before call mairix, evaluate the number of matches returned, and
-make sure to only call display of mairix succeeded in matching."
- (let* ((args ""))
- (if (equal (substring search 0 2) "t:" )
- (progn (setq search (substring search 2 nil))
- (setq args (concat args " --threads"))))
- (if (equal (substring search 0 2) "a:")
- (progn (setq search (substring search 2 nil))
- (setq args (concat args " --augment"))))
- (let ((cmdline (org-mairix-command-substitution
- org-mairix-open-command search args)))
- (print cmdline)
- (setq retval (shell-command-to-string cmdline))
- (string-match "\[0-9\]+" retval)
- (setq matches (string-to-number (match-string 0 retval)))
- (if (eq matches 0) (message "Link failed: no matches, sorry")
- (message "Link returned %d matches" matches)
- (run-hook-with-args 'org-mairix-display-hook search args)))))
-
-(defun org-mairix-command-substitution (cmd search args)
- "Substitute '%search%' and '%args% in mairix search command."
- (while (string-match "%search%" cmd)
- (setq cmd (replace-match search 'fixedcase 'literal cmd)))
- (while (string-match "%args%" cmd)
- (setq cmd (replace-match args 'fixedcase 'literal cmd)))
- cmd)
-
-;;; Functions necessary for integration of external MUAs.
-
-;; Of course we cannot call `org-store-link' from within an external
-;; MUA, so we need some other way of storing a link for later
-;; retrieval by org-mode and/or remember-mode. To do this we use a
-;; temporary file as a kind of dedicated clipboard.
-
-(defcustom org-mairix-link-clipboard "~/.org-mairix-link"
- "Pseudo-clipboard file where mairix URLs get copied to by external
-applications in order to mimic `org-store-link'. Used by
-`org-mairix-insert-link'."
- :group 'org-mairix
- :type 'string)
-
-;; When we resolve some of the issues with `org-store-link' detailed
-;; at <http://thread.gmane.org/gmane.emacs.orgmode/4217/focus=4635>,
-;; we might not need org-mairix-insert-link.
-
-(defun org-mairix-insert-link ()
- "Insert link from file defined by `org-mairix-link-clipboard'."
- (interactive)
- (let ((bytes (cadr (insert-file-contents
- (expand-file-name org-mairix-link-clipboard)))))
- (forward-char bytes)
- (save-excursion
- (forward-char -1)
- (if (looking-at "\n")
- (delete-char 1)))))
-
-;;; Functions necessary for mutt integration
-
-(defgroup org-mairix-mutt nil
- "Use mutt for mairix support in org."
- :tag "Org Mairix Mutt"
- :group 'org-mairix)
-
-(defcustom org-mairix-mutt-display-command
- "xterm -title 'mairix search: %search%' -e 'unset COLUMNS; mutt -f
-~/mail/mairix -e \"push <display-message>\"' &"
- "Command to execute to display mairix search results via mutt within
-an xterm.
-
-'%search%' will get substituted with the search expression, and
-'%args%' with any additional arguments used in the search."
- :group 'org-mairix-mutt
- :type 'string)
-
-(defun org-mairix-mutt-display-results (search args)
- "Display results of mairix search in mutt, using the command line
-defined in `org-mairix-mutt-display-command'."
- ;; By default, async `shell-command' invocations display the temp
- ;; buffer, which is annoying here. We choose a deterministic
- ;; buffer name so we can hide it again immediately.
- ;; Note: `call-process' is synchronous so not useful here.
- (let ((cmd (org-mairix-command-substitution
- org-mairix-mutt-display-command search args))
- (tmpbufname (generate-new-buffer-name " *mairix-view*")))
- (shell-command cmd tmpbufname)
- (delete-windows-on (get-buffer tmpbufname))))
-
-;;; Functions necessary for gnus integration
-
-(defgroup org-mairix-gnus nil
- "Use gnus for mairix support in org."
- :tag "Org Mairix Gnus"
- :group 'org-mairix)
-
-(defcustom org-mairix-gnus-results-group "nnmaildir:mairix"
- "The group that is configured to hold the mairix search results,
-which needs to be setup independently of the org-mairix integration,
-along with general mairix configuration."
- :group 'org-mairix-gnus
- :type 'string)
-
-(defcustom org-mairix-gnus-select-display-group-function
-'org-mairix-gnus-select-display-group-function-gg
- "Hook to call to select the group that contains the matching articles.
-We should not need this, it is owed to a problem of gnus that people were
-not yet able to figure out, see
- http://article.gmane.org/gmane.emacs.gnus.general/65248
- http://article.gmane.org/gmane.emacs.gnus.general/65265
- http://article.gmane.org/gmane.emacs.gnus.user/9596
-for reference.
-
-It seems gnus needs a 'forget/ignore everything you think you
-know about that group' function. Volunteers?"
- :group 'org-mairix-gnus
- :type 'hook)
-
-(defun org-mairix-store-gnus-link ()
- "Store a link to the current gnus message as a Mairix search for its
-Message ID."
-
- ;; gnus integration
- (when (memq major-mode '(gnus-summary-mode gnus-article-mode))
- (and (eq major-mode 'gnus-article-mode) (gnus-article-show-summary))
- (let* ((article (gnus-summary-article-number))
- (header (gnus-summary-article-header article))
- (from (mail-header-from header))
- (message-id (mail-header-id header))
- (subject (gnus-summary-subject-string)))
- (org-store-mairix-link-props :from from
- :subject subject
- :message-id message-id))))
-
-(defun org-mairix-gnus-display-results (search args)
- "Display results of mairix search in Gnus.
-
-Note: This does not work as cleanly as I would like it to. The
-problem being that Gnus should simply reread the group cleanly,
-without remembering anything. At the moment it seems to be unable
-to do that -- so you're likely to see zombies floating around.
-
-If you can improve this, please do!"
- (if (not (equal (substring search 0 2) "m:" ))
- (error "org-mairix-gnus-display-results: display of search other than
-message-id not implemented yet"))
- (setq message-id (substring search 2 nil))
- (require 'gnus)
- (require 'gnus-sum)
- ;; FIXME: (bzg/gg) We might need to make sure gnus is running here,
- ;; and to start it in case it isn't running already. Does
- ;; anyone know a function to do that? It seems main org mode
- ;; does not do this, either.
- (funcall (cdr (assq 'gnus org-link-frame-setup)))
- (if gnus-other-frame-object (select-frame gnus-other-frame-object))
-
- ;; FIXME: This is horribly broken. Please see
- ;; http://article.gmane.org/gmane.emacs.gnus.general/65248
- ;; http://article.gmane.org/gmane.emacs.gnus.general/65265
- ;; http://article.gmane.org/gmane.emacs.gnus.user/9596
- ;; for reference.
- ;;
- ;; It seems gnus needs a "forget/ignore everything you think you
- ;; know about that group" function. Volunteers?
- ;;
- ;; For now different methods seem to work differently well for
- ;; different people. So we're playing hook-selection here to make
- ;; it easy to play around until we found a proper solution.
- (run-hook-with-args 'org-mairix-gnus-select-display-group-function)
- (gnus-summary-select-article
- nil t t (car (gnus-find-matching-articles "message-id" message-id))))
-
-(defun org-mairix-gnus-select-display-group-function-gg ()
- "Georg's hack to select a group that gnus (falsely) believes to be
-empty to then call rebuilding of the summary. It leaves zombies of
-old searches around, though."
- (gnus-group-quick-select-group 0 org-mairix-gnus-results-group)
- (gnus-group-clear-data)
- (gnus-summary-reselect-current-group t t))
-
-(defun org-mairix-gnus-select-display-group-function-bzg ()
- "This is the classic way the org mode is using, and it seems to be
-using better for Bastien, so it may work for you."
- (gnus-group-clear-data org-mairix-gnus-results-group)
- (gnus-group-read-group t nil org-mairix-gnus-results-group))
-
-(provide 'org-mairix)
-
-;;; org-mairix.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-man.el b/.emacs.d/org-7.4/contrib/lisp/org-man.el
deleted file mode 100644
index 27e8cca..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-man.el
+++ /dev/null
@@ -1,64 +0,0 @@
-;;; org-man.el - Support for links to manpages in Org-mode
-;;
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 1.0
-;;
-;; This file is not yet part of GNU Emacs.
-;;
-;; GNU Emacs is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-(require 'org)
-
-(org-add-link-type "man" 'org-man-open)
-(add-hook 'org-store-link-functions 'org-man-store-link)
-
-(defcustom org-man-command 'man
- "The Emacs command to be used to display a man page."
- :group 'org-link
- :type '(choice (const man) (const woman)))
-
-(defun org-man-open (path)
- "Visit the manpage on PATH.
-PATH should be a topic that can be thrown at the man command."
- (funcall org-man-command path))
-
-(defun org-man-store-link ()
- "Store a link to a README file."
- (when (memq major-mode '(Man-mode woman-mode))
- ;; This is a man page, we do make this link
- (let* ((page (org-man-get-page-name))
- (link (concat "man:" page))
- (description (format "Manpage for %s" page)))
- (org-store-link-props
- :type "man"
- :link link
- :description description))))
-
-(defun org-man-get-page-name ()
- "Extract the page name from the buffer name."
- ;; This works for both `Man-mode' and `woman-mode'.
- (if (string-match " \\(\\S-+\\)\\*" (buffer-name))
- (match-string 1 (buffer-name))
- (error "Cannot create link to this man page")))
-
-(provide 'org-man)
-
-;;; org-man.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-mime.el b/.emacs.d/org-7.4/contrib/lisp/org-mime.el
deleted file mode 100644
index bca6e91..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-mime.el
+++ /dev/null
@@ -1,245 +0,0 @@
-;;; org-mime.el --- org html export for text/html MIME emails
-
-;; Copyright (C) 2010 Eric Schulte
-
-;; Author: Eric Schulte
-;; Keywords: mime, mail, email, html
-;; Homepage: http://orgmode.org/worg/org-contrib/org-mime.php
-;; Version: 0.01
-
-;;; License:
-
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; WYSWYG, html mime composition using org-mode
-;;
-;; For mail composed using the orgstruct-mode minor mode, this
-;; provides a function for converting all or part of your mail buffer
-;; to embedded html as exported by org-mode. Call `org-mime-htmlize'
-;; in a message buffer to convert either the active region or the
-;; entire buffer to html.
-;;
-;; Similarly the `org-mime-org-buffer-htmlize' function can be called
-;; from within an org-mode buffer to convert the buffer to html, and
-;; package the results into an email handling with appropriate MIME
-;; encoding.
-;;
-;; you might want to bind this to a key with something like the
-;; following message-mode binding
-;;
-;; (add-hook 'message-mode-hook
-;; (lambda ()
-;; (local-set-key "\C-c\M-o" 'org-mime-htmlize)))
-;;
-;; and the following org-mode binding
-;;
-;; (add-hook 'org-mode-hook
-;; (lambda ()
-;; (local-set-key "\C-c\M-o" 'org-mime-org-buffer-htmlize)))
-
-;;; Code:
-(require 'cl)
-
-(defcustom org-mime-default-header
- "#+OPTIONS: latex:t\n"
- "Default header to control html export options, and ensure
- first line isn't assumed to be a title line."
- :group 'org-mime
- :type 'string)
-
-(defcustom org-mime-library 'mml
- "Library to use for marking up MIME elements."
- :group 'org-mime
- :type '(choice 'mml 'semi 'vm))
-
-(defcustom org-mime-preserve-breaks t
- "Used as temporary value of `org-export-preserve-breaks' during
- mime encoding."
- :group 'org-mime
- :type 'boolean)
-
-(defcustom org-mime-fixedwith-wrap
- "<pre style=\"font-family: courier, monospace;\">\n%s</pre>\n"
- "Format string used to wrap a fixedwidth HTML email."
- :group 'org-mime
- :type 'string)
-
-(defcustom org-mime-html-hook nil
- "Hook to run over the html buffer before attachment to email.
- This could be used for example to post-process html elements."
- :group 'org-mime
- :type 'hook)
-
-;; example hook, for setting a dark background in <pre style="background-color: #EEE;"> elements
-(defun org-mime-change-element-style (element style)
- "Set new default htlm style for <ELEMENT> elements in exported html."
- (while (re-search-forward (format "<%s" element) nil t)
- (replace-match (format "<%s style=\"%s\"" element style))))
-
-(defun org-mime-change-class-style (class style)
- "Set new default htlm style for objects with classs=CLASS in
-exported html."
- (while (re-search-forward (format "class=\"%s\"" class) nil t)
- (replace-match (format "class=\"%s\" style=\"%s\"" class style))))
-
-;; ;; example addition to `org-mime-html-hook' adding a dark background
-;; ;; color to <pre> elements
-;; (add-hook 'org-mime-html-hook
-;; (lambda ()
-;; (org-mime-change-element-style
-;; "pre" (format "color: %s; background-color: %s;"
-;; "#E6E1DC" "#232323"))
-;; (org-mime-change-class-style
-;; "verse" "border-left: 2px solid gray; padding-left: 4px;")))
-
-(defun org-mime-file (ext path id)
- "Markup a file for attachment."
- (case org-mime-library
- ('mml (format
- "<#part type=\"%s\" filename=\"%s\" id=\"<%s>\">\n<#/part>\n"
- ext path id))
- ('semi (concat
- (format
- "--[[%s\nContent-Disposition: inline;\nContent-ID: <%s>][base64]]\n"
- ext id)
- (base64-encode-string
- (with-temp-buffer
- (set-buffer-multibyte nil)
- (binary-insert-encoded-file path)
- (buffer-string)))))
- ('vm "?")))
-
-(defun org-mime-multipart (plain html)
- "Markup a multipart/alternative with text/plain and text/html
- alternatives."
- (case org-mime-library
- ('mml (format (concat "<#multipart type=alternative><#part type=text/plain>"
- "%s<#part type=text/html>%s<#/multipart>\n")
- plain html))
- ('semi (concat
- "--" "<<alternative>>-{\n"
- "--" "[[text/plain]]\n" plain
- "--" "[[text/html]]\n" html
- "--" "}-<<alternative>>\n"))
- ('vm "?")))
-
-(defun org-mime-replace-images (str current-file)
- "Replace images in html files with cid links."
- (let (html-images)
- (cons
- (replace-regexp-in-string ;; replace images in html
- "src=\"\\([^\"]+\\)\""
- (lambda (text)
- (format
- "src=\"cid:%s\""
- (let* ((url (and (string-match "src=\"\\([^\"]+\\)\"" text)
- (match-string 1 text)))
- (path (expand-file-name
- url (file-name-directory current-file)))
- (ext (file-name-extension path))
- (id (replace-regexp-in-string "[\/\\\\]" "_" path)))
- (add-to-list 'html-images
- (org-mime-file (concat "image/" ext) path id))
- id)))
- str)
- html-images)))
-
-(defun org-mime-htmlize (arg)
- "Export a portion of an email body composed using `mml-mode' to
-html using `org-mode'. If called with an active region only
-export that region, otherwise export the entire body."
- (interactive "P")
- (let* ((region-p (org-region-active-p))
- (html-start (or (and region-p (region-beginning))
- (save-excursion
- (goto-char (point-min))
- (search-forward mail-header-separator)
- (+ (point) 1))))
- (html-end (or (and region-p (region-end))
- ;; TODO: should catch signature...
- (point-max)))
- (raw-body (buffer-substring html-start html-end))
- (tmp-file (make-temp-name (expand-file-name "mail" temporary-file-directory)))
- (body (org-export-string raw-body "org" (file-name-directory tmp-file)))
- ;; because we probably don't want to skip part of our mail
- (org-export-skip-text-before-1st-heading nil)
- ;; because we probably don't want to export a huge style file
- (org-export-htmlize-output-type 'inline-css)
- ;; makes the replies with ">"s look nicer
- (org-export-preserve-breaks org-mime-preserve-breaks)
- ;; to hold attachments for inline html images
- (html-and-images
- (org-mime-replace-images
- (org-export-string raw-body "html" (file-name-directory tmp-file))
- tmp-file))
- (html-images (unless arg (cdr html-and-images)))
- (html (org-mime-apply-html-hook
- (if arg
- (format org-mime-fixedwith-wrap body)
- (car html-and-images)))))
- (delete-region html-start html-end)
- (save-excursion
- (goto-char html-start)
- (insert (org-mime-multipart body html)
- (mapconcat 'identity html-images "\n")))))
-
-(defun org-mime-apply-html-hook (html)
- (if org-mime-html-hook
- (with-temp-buffer
- (insert html)
- (goto-char (point-min))
- (run-hooks 'org-mime-html-hook)
- (buffer-string))
- html))
-
-(defun org-mime-org-buffer-htmlize ()
- "Export the current org-mode buffer to HTML using
-`org-export-as-html' and package the results into an email
-handling with appropriate MIME encoding."
- (interactive)
- (require 'reporter)
- (let* ((region-p (org-region-active-p))
- (current-file (buffer-file-name (current-buffer)))
- (html-start (or (and region-p (region-beginning))
- (save-excursion
- (goto-char (point-min)))))
- (html-end (or (and region-p (region-end))
- (point-max)))
- (temp-body-file (make-temp-file "org-mime-export"))
- (raw-body (buffer-substring html-start html-end))
- (body (with-temp-buffer
- (insert raw-body)
- (write-file temp-body-file)
- (org-export-as-org nil nil nil 'string t)))
- (org-link-file-path-type 'absolute)
- ;; because we probably don't want to export a huge style file
- (org-export-htmlize-output-type 'inline-css)
- ;; to hold attachments for inline html images
- (html-and-images (org-mime-replace-images
- (org-export-as-html nil nil nil 'string t)
- current-file))
- (html-images (cdr html-and-images))
- (html (org-mime-apply-html-hook (car html-and-images))))
- ;; dump the exported html into a fresh message buffer
- (reporter-compose-outgoing)
- (goto-char (point-max))
- (prog1 (insert (org-mime-multipart body html)
- (mapconcat 'identity html-images "\n"))
- (delete-file temp-body-file))))
-
-(provide 'org-mime) \ No newline at end of file
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-mtags.el b/.emacs.d/org-7.4/contrib/lisp/org-mtags.el
deleted file mode 100644
index 2406552..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-mtags.el
+++ /dev/null
@@ -1,257 +0,0 @@
-;;; org-mtags.el --- Muse-like tags in Org-mode
-;; Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-;;
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 0.01
-;;
-;; This file is not yet part of GNU Emacs.
-;;
-;; GNU Emacs is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-;;
-;; This modules implements some of the formatting tags available in
-;; Emacs Muse. This is not a way if adding new functionality, but just
-;; a different way to write some formatting directives. The advantage is
-;; that files written in this way can be read by Muse reasonably well,
-;; and that this provides an alternative way of writing formatting
-;; directives in Org, a way that some might find more pleasant to type
-;; and look at that the Org's #+BEGIN..#+END notation.
-
-;; The goal of this development is to make it easier for people to
-;; move between both worlds as they see fit for different tasks.
-
-;; The following muse tags will be translated during export into their
-;; native Org equivalents:
-;;
-;; <br>
-;; Needs to be at the end of a line. Will be translated to "\\".
-;;
-;; <example switches="-n -r">
-;; Needs to be on a line by itself, similarly the </example> tag.
-;; Will be translated into Org's #+BEGIN_EXAMPLE construct.
-;;
-;; <quote>
-;; Needs to be on a line by itself, similarly the </quote> tag.
-;; Will be translated into Org's #+BEGIN_QUOTE construct.
-;;
-;; <comment>
-;; Needs to be on a line by itself, similarly the </comment> tag.
-;; Will be translated into Org's #+BEGIN_COMMENT construct.
-;;
-;; <verse>
-;; Needs to be on a line by itself, similarly the </verse> tag.
-;; Will be translated into Org's #+BEGIN_VERSE construct.
-;;
-;; <contents>
-;; This gets translated into "[TABLE-OF-CONTENTS]". It will not
-;; trigger the production of a table of contents - that is done
-;; in Org with the "#+OPTIONS: toc:t" setting. But it will define
-;; the location where the TOC will be placed.
-;;
-;; <literal style="STYLE"> ;; only latex, html, and docbook supported
-;; in Org.
-;; Needs to be on a line by itself, similarly the </literal> tag.
-;;
-;; <src lang="LANG" switches="-n -r">
-;; Needs to be on a line by itself, similarly the </src> tag.
-;; Will be translated into Org's BEGIN_SRC construct.
-;;
-;; <include file="FILE" markup="MARKUP" lang="LANG"
-;; prefix="str" prefix1="str" switches="-n -r">
-;; Needs to be on a line by itself.
-;; Will be translated into Org's #+INCLUDE construct.
-;;
-;; The lisp/perl/ruby/python tags can be implemented using the
-;; `org-eval.el' module, which see.
-
-(require 'org)
-
-;;; Customization
-
-(defgroup org-mtags nil
- "Options concerning Muse tags in Org mode."
- :tag "Org Muse Tags"
- :group 'org)
-
-(defface org-mtags ; similar to shadow
- (org-compatible-face 'shadow
- '((((class color grayscale) (min-colors 88) (background light))
- (:foreground "grey50"))
- (((class color grayscale) (min-colors 88) (background dark))
- (:foreground "grey70"))
- (((class color) (min-colors 8) (background light))
- (:foreground "green"))
- (((class color) (min-colors 8) (background dark))
- (:foreground "yellow"))))
- "Face for Muse-like tags in Org."
- :group 'org-mtags
- :group 'org-faces)
-
-(defcustom org-mtags-prefer-muse-templates t
- "Non-nil means prefere Muse tags for structure elements.
-This is relevane when expanding the templates defined in the variable
-`org-structure-templates'."
- :group 'org-mtags
- :type 'boolean)
-
-(defconst org-mtags-supported-tags
- '("example" "quote" "comment" "verse" "contents" "literal" "src" "include")
- "The tags that are supported by org-mtags.el for conversion.
-In addition to this list, the <br> tag is supported as well.")
-
-(defconst org-mtags-fontification-re
- (concat
- "^[ \t]*</?\\("
- (mapconcat 'identity org-mtags-supported-tags "\\|")
- "\\)\\>[^>]*>\\|<br>[ \t]*$")
- "Regular expression used for fontifying muse tags.")
-
-(defun org-mtags-replace ()
- "Replace Muse-like tags with the appropriate Org constructs.
-The is done in the entire buffer."
- (interactive) ;; FIXME
- (let ((re (concat "^[ \t]*\\(</?\\("
- (mapconcat 'identity org-mtags-supported-tags "\\|")
- "\\)\\>\\)"))
- info tag rpl style markup lang file prefix prefix1 switches)
- ;; First, do the <br> tag
- (goto-char (point-min))
- (while (re-search-forward "<br>[ \t]*$" nil t)
- (replace-match "\\\\" t t))
- ;; Now, all the other tags
- (goto-char (point-min))
- (while (re-search-forward re nil t)
- (goto-char (match-beginning 1))
- (setq info (org-mtags-get-tag-and-attributes))
- (if (not info)
- (end-of-line 1)
- (setq tag (plist-get info :tag))
- (cond
- ((equal tag "contents")
- (setq rpl "[TABLE-OF-CONTENTS]")
- ;; FIXME: also trigger TOC in options-plist?????
- )
- ((member tag '("quote" "comment" "verse"))
- (if (plist-get info :closing)
- (setq rpl (format "#+END_%s" (upcase tag)))
- (setq rpl (format "#+BEGIN_%s" (upcase tag)))))
- ((equal tag "literal")
- (setq style (plist-get info :style))
- (and style (setq style (downcase style)))
- (if (plist-get info :closing)
- (setq rpl (cond
- ((member style '("latex"))
- "#+END_LaTeX")
- ((member style '("html"))
- "#+END_HTML")
- ((member style '("docbook"))
- "#+END_DOCBOOK")
- ((member style '("ascii"))
- "#+END_ASCII")))
- (setq rpl (cond
- ((member style '("latex"))
- "#+BEGIN_LaTeX")
- ((member style '("html"))
- "#+BEGIN_HTML")
- ((member style '("ascii"))
- "#+BEGIN_ASCII")))))
- ((equal tag "example")
- (if (plist-get info :closing)
- (setq rpl "#+END_EXAMPLE")
- (setq rpl "#+BEGIN_EXAMPLE")
- (when (setq switches (plist-get info :switches))
- (setq rpl (concat rpl " " switches)))))
- ((equal tag "src")
- (if (plist-get info :closing)
- (setq rpl "#+END_SRC")
- (setq rpl "#+BEGIN_SRC")
- (when (setq lang (plist-get info :lang))
- (setq rpl (concat rpl " " lang))
- (when (setq switches (plist-get info :switches))
- (setq rpl (concat rpl " " switches))))))
- ((equal tag "include")
- (setq file (plist-get info :file)
- markup (downcase (plist-get info :markup))
- lang (plist-get info :lang)
- prefix (plist-get info :prefix)
- prefix1 (plist-get info :prefix1)
- switches (plist-get info :switches))
- (setq rpl "#+INCLUDE")
- (setq rpl (concat rpl " " (prin1-to-string file)))
- (when markup
- (setq rpl (concat rpl " " markup))
- (when (and (equal markup "src") lang)
- (setq rpl (concat rpl " " lang))))
- (when prefix
- (setq rpl (concat rpl " :prefix " (prin1-to-string prefix))))
- (when prefix1
- (setq rpl (concat rpl " :prefix1 " (prin1-to-string prefix1))))
- (when switches
- (setq rpl (concat rpl " " switches)))))
- (when rpl
- (goto-char (plist-get info :match-beginning))
- (delete-region (point-at-bol) (plist-get info :match-end))
- (insert rpl))))))
-
-(defun org-mtags-get-tag-and-attributes ()
- "Parse a Muse-like tag at point ant rturn the information about it.
-The return value is a property list which contains all the attributes
-with string values. In addition, it reutnrs the following properties:
-
-:tag The tag as a string.
-:match-beginning The beginning of the match, just before \"<\".
-:match-end The end of the match, just after \">\".
-:closing t when the tag starts with \"</\"."
- (when (looking-at "<\\(/\\)?\\([a-zA-Z]+\\>\\)\\([^>]*\\)>")
- (let ((start 0)
- tag rest prop attributes endp val)
- (setq tag (org-match-string-no-properties 2)
- endp (match-end 1)
- rest (and (match-end 3)
- (org-match-string-no-properties 3))
- attributes (list :tag tag
- :match-beginning (match-beginning 0)
- :match-end (match-end 0)
- :closing endp))
- (when rest
- (while (string-match "\\([a-zA-Z]+\\)=\\([^ \t\n>]+\\|\"[^>]+\"\\)"
- rest start)
- (setq start (match-end 0)
- prop (org-match-string-no-properties 1 rest)
- val (org-remove-double-quotes
- (org-match-string-no-properties 2 rest)))
- (setq attributes (plist-put attributes
- (intern (concat ":" prop)) val))))
- attributes)))
-
-(defun org-mtags-fontify-tags (limit)
- "Fontify the muse-like tags."
- (while (re-search-forward org-mtags-fontification-re limit t)
- (add-text-properties (match-beginning 0) (match-end 0)
- '(face org-mtags font-lock-multiline t
- font-lock-fontified t))))
-
-(add-hook 'org-export-preprocess-hook 'org-mtags-replace)
-(add-hook 'org-font-lock-hook 'org-mtags-fontify-tags)
-
-(provide 'org-mtags)
-
-;;; org-mtags.el ends here
-
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-panel.el b/.emacs.d/org-7.4/contrib/lisp/org-panel.el
deleted file mode 100644
index fe0ec64..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-panel.el
+++ /dev/null
@@ -1,642 +0,0 @@
-;;; org-panel.el --- Simple routines for us with bad memory
-;;
-;; Author: Lennart Borgman (lennart O borgman A gmail O com)
-;; Created: Thu Nov 15 15:35:03 2007
-;; Version: 0.21
-;; Lxast-Updated: Wed Nov 21 03:06:03 2007 (3600 +0100)
-;; URL:
-;; Keywords:
-;; Compatibility:
-;;
-;; Features that might be required by this library:
-;;
-;; `easymenu', `font-lock', `noutline', `org', `outline', `syntax',
-;; `time-date'.
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-;;
-;; This defines a kind of control panel for `org-mode'. This control
-;; panel should make it fast to move around and edit structure etc.
-;;
-;; To bring up the control panel type
-;;
-;; M-x orgpan-panel
-;;
-;; Type ? there for help.
-;;
-;; I suggest you add the following to your .emacs for quick access of
-;; the panel:
-;;
-;; (eval-after-load 'org-mode
-;; (define-key org-mode-map [(control ?c) ?p] 'orgpan-panel))
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Change log:
-;;
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; This program is free software; you can redistribute it and/or
-;; modify it under the terms of the GNU General Public License as
-;; published by the Free Software Foundation; either version 2, or
-;; (at your option) any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-;; General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with this program; see the file COPYING. If not, write to
-;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth
-;; Floor, Boston, MA 02110-1301, USA.
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Code:
-
-(require 'org)
-(require 'outline)
-
-;; Fix-me: this is for testing. A minor mode version interferes badly
-;; with emulation minor modes. On the other hand, the other version
-;; interferes badly with (interactive ...).
-(defvar orgpan-minor-mode-version t)
-
-(defface orgpan-field
- '((t (:inherit 'widget-field)))
- "Face for fields."
- :group 'winsize)
-(defvar orgpan-field-face 'orgpan-field)
-
-(defface orgpan-active-field
- '((t (:inherit 'highlight)))
- "Face for fields."
- :group 'winsize)
-(defvar orgpan-active-field-face 'orgpan-active-field)
-
-(defface orgpan-spaceline
- '((t (:height 0.2)))
- "Face for spacing lines."
- :group 'winsize)
-
-(defcustom orgpan-panel-buttons nil
- "Panel style, if non-nil use buttons.
-If there are buttons in the panel they are used to change the way
-the arrow keys work. The panel looks something like this, with
-the first button chosen:
-
- [Navigate] [Restructure] [TODO/Priority]
- ----------
- up/down, left: Go to, right: Visibility
-
-The line below the buttons try to give a short hint about what
-the arrow keys does. \(Personally I prefer the version without
-buttons since I then do not have to remember which button is
-active.)"
- :type 'boolean
- :group 'winsize)
-
-;; Fix-me: add org-mode-map
-(defconst orgpan-org-mode-commands nil)
-(defconst orgpan-org-commands
- '(
- orgpan-copy-subtree
- orgpan-cut-subtree
- orgpan-paste-subtree
- undo
- ;;
- ;orgpan-occur
- ;;
- org-cycle
- org-global-cycle
- outline-up-heading
- outline-next-visible-heading
- outline-previous-visible-heading
- outline-forward-same-level
- outline-backward-same-level
- org-todo
- org-show-todo-tree
- org-priority-up
- org-priority-down
- org-move-subtree-up
- org-move-subtree-down
- org-do-promote
- org-do-demote
- org-promote-subtree
- org-demote-subtree))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Hook functions etc
-
-;;(defvar orgpan-this-panel-window nil)
-
-(defun orgpan-delete-panel ()
- "Remove the panel."
- (interactive)
- (when (buffer-live-p orgpan-panel-buffer)
- (delete-windows-on orgpan-panel-buffer)
- (kill-buffer orgpan-panel-buffer))
- (setq orgpan-panel-buffer nil)
- (setq orgpan-panel-window nil)
- (orgpan-panel-minor-mode 0)
- (remove-hook 'post-command-hook 'orgpan-minor-post-command)
- (remove-hook 'post-command-hook 'orgpan-mode-post-command)
- ;;(remove-hook 'window-configuration-change-hook 'orgpan-window-config-change)
- )
-
-(defvar orgpan-last-command-was-from-panel nil)
-(defun orgpan-mode-pre-command ()
- (setq orgpan-last-command-was-from-panel nil)
- (condition-case err
- (if (not (and (windowp orgpan-org-window)
- (window-live-p orgpan-org-window)))
- (progn
- (setq this-command 'ignore)
- (orgpan-delete-panel)
- (message "The window belonging to the panel had disappeared, removed panel."))
- (let ((buf (window-buffer orgpan-org-window)))
- (when (with-current-buffer buf
- (derived-mode-p 'org-mode))
- (setq orgpan-last-org-buffer buf))
- ;; Fix me: add a list of those commands that are not
- ;; meaningful from the panel (for example org-time-stamp)
- (when (or (memq this-command orgpan-org-commands)
- (memq this-command orgpan-org-mode-commands)
- ;; For some reason not all org commands are found above:
- (string= "org-" (substring (format "%s" this-command) 0 4)))
- (if (not (with-current-buffer buf
- (derived-mode-p 'org-mode)))
- (progn
- (if (buffer-live-p orgpan-org-buffer)
- (set-window-buffer orgpan-org-window orgpan-org-buffer)
- (message "Please use `l' or `b' to choose an org-mode buffer"))
- (setq this-command 'ignore))
- (setq orgpan-org-buffer (window-buffer orgpan-org-window))
- (setq orgpan-last-command-was-from-panel t)
- (select-window orgpan-org-window)
- ;;(when (active-minibuffer-window
- ;;(set-buffer orgpan-org-buffer)
- ))))
- (error (lwarn 't :warning "orgpan-pre: %S" err))))
-
-(defun orgpan-mode-post-command ()
- (condition-case err
- (progn
- (unless (and (windowp orgpan-panel-window)
- (window-live-p orgpan-panel-window)
- (bufferp orgpan-panel-buffer)
- (buffer-live-p orgpan-panel-buffer))
- ;;(orgpan-delete-panel)
- )
- (when (and orgpan-last-command-was-from-panel
- (windowp orgpan-panel-window)
- (window-live-p orgpan-panel-window))
- (select-window orgpan-panel-window)
- (when (derived-mode-p 'orgpan-mode)
- (setq deactivate-mark t)
- (when orgpan-panel-buttons
- (unless (and orgpan-point
- (= (point) orgpan-point))
- ;; Go backward so it is possible to click on a "button":
- (orgpan-backward-field)))))
- (setq orgpan-this-panel-window nil))
- (error (lwarn 't :warning "orgpan-post: %S" err))))
-
-;; (defun orgpan-window-config-change ()
-;; "Check if any frame is displaying an orgpan panel.
-;; If not remove `orgpan-mode-post-command' and this function from
-;; the hooks."
-;; (condition-case err
-;; (unless (and (
-;; (let ((found-pan nil))
-;; (dolist (f (frame-list))
-;; (dolist (w (window-list f 'nomini))
-;; (with-current-buffer (window-buffer w)
-;; (when (derived-mode-p 'orgpan-mode)
-;; (setq found-pan t)))))
-;; (unless found-pan
-;; (remove-hook 'post-command-hook 'orgpan-mode-post-command)
-;; (remove-hook 'window-configuration-change-hook 'orgpan-window-config-change)))
-;; (error (lwarn 't :warning "Error in orgpan-config-change: %S" err))))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Commands
-
-(defun orgpan-last-buffer ()
- "Open last org-mode buffer in panels org window."
- (interactive)
- (let ((buf (window-buffer orgpan-org-window))
- (last-buf orgpan-last-org-buffer))
- (when (with-current-buffer buf
- (derived-mode-p 'org-mode))
- (setq orgpan-last-org-buffer buf))
- (when (eq last-buf buf)
- (setq last-buf nil))
- (if (not last-buf)
- (orgpan-switch-buffer)
- (set-window-buffer orgpan-org-window last-buf))))
-
-(defun orgpan-switch-buffer ()
- "Switch to next org-mode buffer in panels org window."
- (interactive)
- (let ((buf (window-buffer orgpan-org-window))
- (org-buffers nil))
- (with-current-buffer buf
- (when (derived-mode-p 'org-mode)
- (bury-buffer buf)
- (setq orgpan-last-org-buffer buf)))
- (setq org-buffers (delq nil (mapcar (lambda (buf)
- (when (with-current-buffer buf
- (derived-mode-p 'org-mode))
- buf))
- (buffer-list))))
- (setq org-buffers (delq buf org-buffers))
- (set-window-buffer orgpan-org-window (car org-buffers))
- (setq orgpan-org-buffer (car org-buffers))))
-
-(defun orgpan-paste-subtree ()
- (interactive)
- (if (y-or-n-p "Paste subtree here? ")
- (org-paste-subtree)
- (message "Nothing was pasted")))
-
-(defun orgpan-cut-subtree ()
- (interactive)
- (let ((heading (progn
- (org-back-to-heading)
- (buffer-substring (point) (line-end-position))
- )))
- (if (y-or-n-p (format "Do you want to cut the subtree\n%s\n? " heading))
- (org-cut-subtree)
- (message "Nothing was cut"))))
-
-(defun orgpan-copy-subtree ()
- (interactive)
- (let ((heading (progn
- (org-back-to-heading)
- (buffer-substring (point) (line-end-position))
- )))
- (if (y-or-n-p (format "Do you want to copy the subtree\n%s\n? " heading))
- (org-copy-subtree)
- (message "Nothing was copied"))))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Buttons
-
-(defvar orgpan-ovl-help nil)
-
-(defun orgpan-check-panel-mode ()
- (unless (derived-mode-p 'orgpan-mode)
- (error "Not orgpan-mode in buffer: " major-mode)))
-
-(defun orgpan-display-bindings-help ()
- (orgpan-check-panel-mode)
- (setq orgpan-point (point))
- (let* ((ovls (overlays-at (point)))
- (ovl (car ovls))
- (help (when ovl (overlay-get ovl 'orgpan-explain))))
- (dolist (o (overlays-in (point-min) (point-max)))
- (overlay-put o 'face orgpan-field-face))
- (overlay-put ovl 'face orgpan-active-field-face)
- (overlay-put orgpan-ovl-help 'before-string help)))
-
-(defun orgpan-forward-field ()
- (interactive)
- (orgpan-check-panel-mode)
- (let ((pos (next-overlay-change (point))))
- (unless (overlays-at pos)
- (setq pos (next-overlay-change pos)))
- (when (= pos (point-max))
- (setq pos (point-min))
- (unless (overlays-at pos)
- (setq pos (next-overlay-change pos))))
- (goto-char pos))
- (orgpan-display-bindings-help))
-
-(defun orgpan-backward-field ()
- (interactive)
- (orgpan-check-panel-mode)
- (when (= (point) (point-min))
- (goto-char (point-max)))
- (let ((pos (previous-overlay-change (point))))
- (unless (overlays-at pos)
- (setq pos (previous-overlay-change pos)))
- (goto-char pos))
- (orgpan-display-bindings-help))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Mode
-
-(defconst orgpan-mode-map
- ;; Fix-me: clean up here!
- ;; Fix-me: viper support
- (let ((map (make-sparse-keymap)))
- (define-key map [?q] 'orgpan-delete-panel)
- (define-key map [??] 'orgpan-help)
- ;; Copying etc
- (define-key map [?c] 'orgpan-copy-subtree)
- (define-key map [?x] 'orgpan-cut-subtree)
- (define-key map [?p] 'orgpan-paste-subtree)
- (define-key map [?z] 'undo)
- ;; Buffers:
- (define-key map [?b] 'orgpan-switch-buffer)
- (define-key map [?l] 'orgpan-last-buffer)
- ;; Some keys for moving between headings. Emacs keys for next/prev
- ;; line seems ok:
- (define-key map [(control ?p)] 'outline-previous-visible-heading)
- (define-key map [(control ?n)] 'outline-next-visible-heading)
- (define-key map [(shift control ?p)] 'outline-backward-same-level)
- (define-key map [(shift control ?n)] 'outline-forward-same-level)
- ;; A mnemunic for up:
- (define-key map [(control ?u)] 'outline-up-heading)
- ;; Search sparse tree:
- ;;
- ;; Fix-me: Search does not work, some problem with
- ;; interactive. Probably have to turn the whole thing around and
- ;; always be in the org buffer, but with a minor mode running
- ;; there.
- ;;
- ;;(define-key map [?s] 'org-sparse-tree)
- (define-key map [?s] 'orgpan-occur)
- ;; Same as in org-mode:
- ;;(define-key map [(control ?c)(control ?v)] 'org-show-todo-tree)
- ;; Fix-me: This leads to strange problems:
- ;;(define-key map [t] 'ignore)
- map))
-
-(defun orgpan-occur ()
- "Replacement for `org-occur'.
-Technical reasons."
- (interactive)
- (let ((rgx (read-from-minibuffer "my mini Regexp: ")))
- (setq orgpan-last-command-was-from-panel t)
- (select-window orgpan-org-window)
- (org-occur rgx)))
-
-(defvar orgpan-panel-window nil
- "The window showing `orgpan-panel-buffer'.")
-
-(defvar orgpan-panel-buffer nil
- "The panel buffer.
-There can be only one such buffer at any time.")
-
-(defvar orgpan-org-window nil)
-;;(make-variable-buffer-local 'orgpan-org-window)
-
-;; Fix-me: used?
-(defvar orgpan-org-buffer nil)
-;;(make-variable-buffer-local 'orgpan-org-buffer)
-
-(defvar orgpan-last-org-buffer nil)
-;;(make-variable-buffer-local 'orgpan-last-org-buffer)
-
-(defvar orgpan-point nil)
-;;(make-variable-buffer-local 'orgpan-point)
-
-(defun orgpan-avoid-viper-in-buffer ()
- ;; Fix-me: This is ugly. However see `this-major-mode-requires-vi-state':
- (set (make-local-variable 'viper-emacs-state-mode-list) '(orgpan-mode))
- (set (make-local-variable 'viper-new-major-mode-buffer-list) nil)
- (local-set-key [?\ ] 'ignore))
-
-(define-derived-mode orgpan-mode nil "Org-Panel"
- "Mode for org-simple.el control panel."
- (setq buffer-read-only t)
- (unless orgpan-minor-mode-version
- (add-hook 'pre-command-hook 'orgpan-mode-pre-command nil t)
- (add-hook 'post-command-hook 'orgpan-mode-post-command t))
- (orgpan-avoid-viper-in-buffer)
- (setq cursor-type nil))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Panel layout
-
-(defun orgpan-insert-field (text keymap explain)
- (insert text)
- (let* ((end (point))
- (len (length text))
- (beg (- end len))
- (ovl (make-overlay beg end)))
- (overlay-put ovl 'face orgpan-field-face)
- (overlay-put ovl 'keymap keymap)
- (overlay-put ovl 'orgpan-explain explain)))
-
-(defconst orgpan-with-keymap
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map org-mode-map)
- ;; Users are used to tabbing between fields:
- (define-key map [(tab)] 'orgpan-forward-field)
- (define-key map [(shift tab)] 'orgpan-backward-field)
- ;; Now we must use something else for visibility (first does not work if Viper):
- (define-key map [(meta tab)] 'org-cycle)
- (define-key map [(control meta tab)] 'org-global-cycle)
- map))
-
-(defconst orgpan-without-keymap
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map org-mode-map)
- ;; Visibility (those are in org-mode-map):
- ;;(define-key map [tab] 'org-cycle)
- ;;(define-key map [(shift tab)] 'org-global-cycle)
- ;; Navigate:
- (define-key map [left] 'outline-up-heading)
- (define-key map [right] 'org-cycle)
- (define-key map [up] 'outline-previous-visible-heading)
- (define-key map [down] 'outline-next-visible-heading)
- (define-key map [(shift down)] 'outline-forward-same-level)
- (define-key map [(shift up)] 'outline-backward-same-level)
- ;; Restructure:
- (define-key map [(control up)] 'org-move-subtree-up)
- (define-key map [(control down)] 'org-move-subtree-down)
- (define-key map [(control left)] 'org-do-promote)
- (define-key map [(control right)] 'org-do-demote)
- (define-key map [(control shift left)] 'org-promote-subtree)
- (define-key map [(control shift right)] 'org-demote-subtree)
- ;; Todo etc
- (define-key map [?+] 'org-priority-up)
- (define-key map [?-] 'org-priority-down)
- (define-key map [?t] 'org-todo)
- map))
-
-(defun orgpan-make-panel-without-buttons (buf)
- (with-current-buffer buf
- (insert (propertize "Org Panel" 'face 'orgpan-active-field))
- (insert " ? for help, q quit\n")
- (insert (propertize "arrows" 'face 'font-lock-keyword-face)
- ": Go to, "
- (propertize "C-arrows" 'face 'font-lock-keyword-face)
- ": Edit tree\n"
- (propertize "cxpz" 'face 'font-lock-keyword-face)
- ": copy cut paste undo, "
- (propertize "tT+-" 'face 'font-lock-keyword-face)
- ": todo priority, "
- (propertize "s" 'face 'font-lock-keyword-face)
- " search"
- )
- (set-keymap-parent orgpan-mode-map orgpan-without-keymap)
- ))
-
-(defun orgpan-make-panel-with-buttons (buf)
- (with-current-buffer buf
- (let* ((base-map (make-sparse-keymap))
- (space-line (propertize "\n\n" 'face 'orgpan-spaceline))
- (arrow-face 'font-lock-keyword-face)
- (L (propertize "left" 'face arrow-face))
- (R (propertize "right" 'face arrow-face))
- (U (propertize "up" 'face arrow-face))
- (D (propertize "down" 'face arrow-face)))
- ;;(message D)(sit-for 2)
- (define-key base-map [left] 'ignore)
- (define-key base-map [right] 'ignore)
- (define-key base-map [up] 'ignore)
- (define-key base-map [down] 'ignore)
- (define-key base-map [?q] 'delete-window)
- (define-key base-map [??] 'orgpan-help)
- ;; Navigating
- (let ((map (copy-keymap base-map)))
- (define-key map [left] 'outline-up-heading)
- (define-key map [right] 'org-cycle)
- (define-key map [up] 'outline-previous-visible-heading)
- (define-key map [down] 'outline-next-visible-heading)
- (define-key map [(shift down)] 'outline-forward-same-level)
- (define-key map [(shift up)] 'outline-backward-same-level)
- (orgpan-insert-field "Navigate" map (concat U "/" D ", " L ": Go to, " R ": Visibility")))
- (insert " ")
- (let ((map (copy-keymap base-map)))
- (define-key map [up] 'org-move-subtree-up)
- (define-key map [down] 'org-move-subtree-down)
- (define-key map [left] 'org-do-promote)
- (define-key map [right] 'org-do-demote)
- (define-key map [(shift left)] 'org-promote-subtree)
- (define-key map [(shift right)] 'org-demote-subtree)
- (orgpan-insert-field
- "Restructure" map
- (concat U "/" D ": "
- (propertize "Move" 'face 'font-lock-warning-face)
- ", " L "/" R ": "
- (propertize "Level (w S: Subtree Level)" 'face 'font-lock-warning-face))))
- (insert " ")
- (let ((map (copy-keymap base-map)))
- (define-key map [up] 'org-priority-up)
- (define-key map [down] 'org-priority-down)
- (define-key map [right] 'org-todo)
- (orgpan-insert-field "TODO/priority" map
- (concat R ": TODO, " U "/" D ": Priority")))
- )
- (insert " ? for help, q quit\n")
- (orgpan-display-bindings-help)
- (setq orgpan-ovl-help (make-overlay (point) (point)))
- ))
-
-(defun orgpan-make-panel-buffer ()
- "Make the panel buffer."
- (let* ((buf-name "*Org Panel*"))
- (when orgpan-panel-buffer (kill-buffer orgpan-panel-buffer))
- (setq orgpan-panel-buffer (get-buffer-create buf-name))
- (if orgpan-panel-buttons
- (orgpan-make-panel-with-buttons orgpan-panel-buffer)
- (orgpan-make-panel-without-buttons orgpan-panel-buffer))
- (with-current-buffer orgpan-panel-buffer
- (orgpan-mode)
- (goto-char (point-min)))
- orgpan-panel-buffer))
-
-(defun orgpan-help ()
- (interactive)
- (set-keymap-parent orgpan-with-keymap nil)
- (set-keymap-parent orgpan-without-keymap nil)
- (describe-function 'orgpan-panel)
- (set-keymap-parent orgpan-with-keymap org-mode-map)
- (set-keymap-parent orgpan-without-keymap org-mode-map)
- (message "Use 'l' to remove help window")
- )
-
-(defun orgpan-panel ()
- "Create a control panel for current `org-mode' buffer.
-The control panel may be used to quickly move around and change
-the headings. The idea is that when you want to to a lot of this
-kind of editing you should be able to do that with few
-keystrokes (and without having to remember the complicated
-keystrokes). A typical situation when this perhaps can be useful
-is when you are looking at your notes file \(usually ~/.notes,
-see `remember-data-file') where you have saved quick notes with
-`remember'.
-
-The keys below are defined in the panel. Note that the commands
-are carried out in the `org-mode' buffer that belongs to the
-panel.
-
-\\{orgpan-mode-map}
-
-In addition to the keys above most of the keys in `org-mode' can
-also be used from the panel.
-
-Note: There are two forms of the control panel, one with buttons
-and one without. The default is without, see
-`orgpan-panel-buttons'. If buttons are used choosing a different
-button changes the binding of the arrow keys."
- (interactive)
- (unless (derived-mode-p 'org-mode)
- (error "Buffer is not in org-mode"))
- (orgpan-delete-panel)
- (unless orgpan-org-mode-commands
- (map-keymap (lambda (ev def)
- (when (and def
- (symbolp def)
- (fboundp def))
- (setq orgpan-org-mode-commands
- (cons def orgpan-org-mode-commands))))
- org-mode-map))
- ;;(org-back-to-heading)
- ;;(remove-hook 'window-configuration-change-hook 'orgpan-window-config-change)
- (split-window)
- (set-window-buffer (selected-window) (orgpan-make-panel-buffer))
- (setq orgpan-panel-window (selected-window))
- ;;(set-window-dedicated-p (selected-window) t)
- (fit-window-to-buffer nil nil 3)
- (setq orgpan-org-window (next-window))
- ;; The minor mode version starts here:
- (when orgpan-minor-mode-version
- (select-window orgpan-org-window)
- (orgpan-panel-minor-mode 1)
- (add-hook 'post-command-hook 'orgpan-minor-post-command t)))
-
-(defun orgpan-minor-post-command ()
- (unless (and
- ;; Check org window and buffer
- (windowp orgpan-org-window)
- (window-live-p orgpan-org-window)
- (eq orgpan-org-window (selected-window))
- (derived-mode-p 'org-mode)
- ;; Check panel window and buffer
- (windowp orgpan-panel-window)
- (window-live-p orgpan-panel-window)
- (bufferp orgpan-panel-buffer)
- (buffer-live-p orgpan-panel-buffer)
- (eq (window-buffer orgpan-panel-window) orgpan-panel-buffer)
- ;; Check minor mode
- orgpan-panel-minor-mode)
- (orgpan-delete-panel)))
-
-(define-minor-mode orgpan-panel-minor-mode
- "Minor mode used in `org-mode' buffer when showing panel."
- :keymap orgpan-mode-map
- :lighter " PANEL"
- :group 'orgpan
- )
-
-
-(provide 'org-panel)
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; org-panel.el ends here
-
-
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-registry.el b/.emacs.d/org-7.4/contrib/lisp/org-registry.el
deleted file mode 100644
index ad382f0..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-registry.el
+++ /dev/null
@@ -1,271 +0,0 @@
-;;; org-registry.el --- a registry for Org links
-;;
-;; Copyright 2007, 2008 Bastien Guerry
-;;
-;; Emacs Lisp Archive Entry
-;; Filename: org-registry.el
-;; Version: 0.1a
-;; Author: Bastien Guerry <bzg AT altern DOT org>
-;; Maintainer: Bastien Guerry <bzg AT altern DOT org>
-;; Keywords: org, wp, registry
-;; Description: Shows Org files where the current buffer is linked
-;; URL: http://www.cognition.ens.fr/~guerry/u/org-registry.el
-;;
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with this program; if not, write to the Free Software
-;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-;;; Commentary:
-;;
-;; This library add a registry to your Org setup.
-;;
-;; Org files are full of links inserted with `org-store-link'. This links
-;; point to e-mail, webpages, files, dirs, info pages, man pages, etc.
-;; Actually, they come from potentially *everywhere* since Org lets you
-;; define your own storing/following functions.
-;;
-;; So, what if you are on a e-mail, webpage or whatever and want to know if
-;; this buffer has already been linked to somewhere in your agenda files?
-;;
-;; This is were org-registry comes in handy.
-;;
-;; M-x org-registry-show will tell you the name of the file
-;; C-u M-x org-registry-show will directly jump to the file
-;;
-;; In case there are several files where the link lives in:
-;;
-;; M-x org-registry-show will display them in a new window
-;; C-u M-x org-registry-show will prompt for a file to visit
-;;
-;; Add this to your Org configuration:
-;;
-;; (require 'org-registry)
-;; (org-registry-initialize)
-;;
-;; If you want to update the registry with newly inserted links in the
-;; current buffer: M-x org-registry-update
-;;
-;; If you want this job to be done each time you save an Org buffer,
-;; hook 'org-registry-update to the local 'after-save-hook in org-mode:
-;;
-;; (org-registry-insinuate)
-
-;;; Code:
-
-(eval-when-compile
- (require 'cl))
-
-(defgroup org-registry nil
- "A registry for Org."
- :group 'org)
-
-(defcustom org-registry-file
- (concat (getenv "HOME") "/.org-registry.el")
- "The Org registry file."
- :group 'org-registry
- :type 'file)
-
-(defcustom org-registry-find-file 'find-file-other-window
- "How to find visit files."
- :type 'function
- :group 'org-registry)
-
-(defvar org-registry-alist nil
- "An alist containing the Org registry.")
-
-;;;###autoload
-(defun org-registry-show (&optional visit)
- "Show Org files where there are links pointing to the current
-buffer."
- (interactive "P")
- (org-registry-initialize)
- (let* ((blink (or (org-remember-annotation) ""))
- (link (when (string-match org-bracket-link-regexp blink)
- (match-string-no-properties 1 blink)))
- (desc (or (and (string-match org-bracket-link-regexp blink)
- (match-string-no-properties 3 blink)) "No description"))
- (files (org-registry-assoc-all link))
- file point selection tmphist)
- (cond ((and files visit)
- ;; result(s) to visit
- (cond ((< 1 (length files))
- ;; more than one result
- (setq tmphist (mapcar (lambda(entry)
- (format "%s (%d) [%s]"
- (nth 3 entry) ; file
- (nth 2 entry) ; point
- (nth 1 entry))) files))
- (setq selection (completing-read "File: " tmphist
- nil t nil 'tmphist))
- (string-match "\\(.+\\) (\\([0-9]+\\))" selection)
- (setq file (match-string 1 selection))
- (setq point (string-to-number (match-string 2 selection))))
- ((eq 1 (length files))
- ;; just one result
- (setq file (nth 3 (car files)))
- (setq point (nth 2 (car files)))))
- ;; visit the (selected) file
- (funcall org-registry-find-file file)
- (goto-char point)
- (unless (org-before-first-heading-p)
- (org-show-context)))
- ((and files (not visit))
- ;; result(s) to display
- (cond ((eq 1 (length files))
- ;; show one file
- (message "Link in file %s (%d) [%s]"
- (nth 3 (car files))
- (nth 2 (car files))
- (nth 1 (car files))))
- (t (org-registry-display-files files link))))
- (t (message "No link to this in org-agenda-files")))))
-
-(defun org-registry-display-files (files link)
- "Display files in a separate window."
- (switch-to-buffer-other-window
- (get-buffer-create " *Org registry info*"))
- (erase-buffer)
- (insert (format "Files pointing to %s:\n\n" link))
- (let (file)
- (while (setq file (pop files))
- (insert (format "%s (%d) [%s]\n" (nth 3 file)
- (nth 2 file) (nth 1 file)))))
- (shrink-window-if-larger-than-buffer)
- (other-window 1))
-
-(defun org-registry-assoc-all (link &optional registry)
- "Return all associated entries of LINK in the registry."
- (org-registry-find-all
- (lambda (entry) (string= link (car entry)))
- registry))
-
-(defun org-registry-find-all (test &optional registry)
- "Return all entries satisfying `test' in the registry."
- (delq nil
- (mapcar
- (lambda (x) (and (funcall test x) x))
- (or registry org-registry-alist))))
-
-;;;###autoload
-(defun org-registry-visit ()
- "If an Org file contains a link to the current location, visit
-this file."
- (interactive)
- (org-registry-show t))
-
-;;;###autoload
-(defun org-registry-initialize (&optional from-scratch)
- "Initialize `org-registry-alist'.
-If FROM-SCRATCH is non-nil or the registry does not exist yet,
-create a new registry from scratch and eval it. If the registry
-exists, eval `org-registry-file' and make it the new value for
-`org-registry-alist'."
- (interactive "P")
- (if (or from-scratch (not (file-exists-p org-registry-file)))
- ;; create a new registry
- (let ((files org-agenda-files) file)
- (while (setq file (pop files))
- (setq file (expand-file-name file))
- (mapc (lambda (entry)
- (add-to-list 'org-registry-alist entry))
- (org-registry-get-entries file)))
- (when from-scratch
- (org-registry-create org-registry-alist)))
- ;; eval the registry file
- (with-temp-buffer
- (insert-file-contents org-registry-file)
- (eval-buffer))))
-
-;;;###autoload
-(defun org-registry-insinuate ()
- "Call `org-registry-update' after saving in Org-mode.
-Use with caution. This could slow down things a bit."
- (interactive)
- (add-hook 'org-mode-hook
- (lambda() (add-hook 'after-save-hook
- 'org-registry-update t t))))
-
-(defun org-registry-get-entries (file)
- "List Org links in FILE that will be put in the registry."
- (let (bufstr result)
- (with-temp-buffer
- (insert-file-contents file)
- (goto-char (point-min))
- (while (re-search-forward org-angle-link-re nil t)
- (let* ((point (match-beginning 0))
- (link (match-string-no-properties 0))
- (desc (match-string-no-properties 0)))
- (add-to-list 'result (list link desc point file))))
- (goto-char (point-min))
- (while (re-search-forward org-bracket-link-regexp nil t)
- (let* ((point (match-beginning 0))
- (link (match-string-no-properties 1))
- (desc (or (match-string-no-properties 3) "No description")))
- (add-to-list 'result (list link desc point file)))))
- ;; return the list of new entries
- result))
-
-;;;###autoload
-(defun org-registry-update ()
- "Update the registry for the current Org file."
- (interactive)
- (unless (org-mode-p) (error "Not in org-mode"))
- (let* ((from-file (expand-file-name (buffer-file-name)))
- (new-entries (org-registry-get-entries from-file)))
- (with-temp-buffer
- (unless (file-exists-p org-registry-file)
- (org-registry-initialize t))
- (find-file org-registry-file)
- (goto-char (point-min))
- (while (re-search-forward (concat from-file "\")$") nil t)
- (let ((end (1+ (match-end 0)))
- (beg (progn (re-search-backward "^(\"" nil t)
- (match-beginning 0))))
- (delete-region beg end)))
- (goto-char (point-min))
- (re-search-forward "^(\"" nil t)
- (goto-char (match-beginning 0))
- (mapc (lambda (elem)
- (insert (with-output-to-string (prin1 elem)) "\n"))
- new-entries)
- (save-buffer)
- (kill-buffer (current-buffer)))
- (message (format "Org registry updated for %s"
- (file-name-nondirectory from-file)))))
-
-(defun org-registry-create (entries)
- "Create `org-registry-file' with ENTRIES."
- (let (entry)
- (with-temp-buffer
- (find-file org-registry-file)
- (erase-buffer)
- (insert
- (with-output-to-string
- (princ ";; -*- emacs-lisp -*-\n")
- (princ ";; Org registry\n")
- (princ ";; You shouldn't try to modify this buffer manually\n\n")
- (princ "(setq org-registry-alist\n'(\n")
- (while entries
- (when (setq entry (pop entries))
- (prin1 entry)
- (princ "\n")))
- (princ "))\n")))
- (save-buffer)
- (kill-buffer (current-buffer))))
- (message "Org registry created"))
-
-(provide 'org-registry)
-
-;;; User Options, Variables
-
-;;; org-registry.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-screen.el b/.emacs.d/org-7.4/contrib/lisp/org-screen.el
deleted file mode 100644
index fb1e73f..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-screen.el
+++ /dev/null
@@ -1,108 +0,0 @@
-;;; org-screen.el --- Integreate Org-mode with screen.
-
-;; Copyright (c) 2008 Andrew Hyatt
-;;
-;; Author: Andrew Hyatt <ahyatt at gmail dot com>
-;; Maintainer: Carsten Dominik <carsten at orgmode dot org>
-;;
-;; This file is not yet part of GNU Emacs.
-;;
-;; GNU Emacs is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-;;
-;; This file contains functionality to integrate screen and org-mode.
-;; When using org-mode, it is often useful to take tasks that have
-;; some command-line work associated with them, and associate them
-;; with a screen session. Screen is used rather than a direct
-;; terminal to facilitate portability of the resulting session.
-;;
-;; To use screen in org, in your .emacs file, simply put this file in
-;; a directory in your load-path and write:
-;;
-;; (require 'org-screen)
-;;
-;; When have a task and want to start some command-line activity
-;; associated with that task, go to the end of your item and type:
-;;
-;; M-x org-screen
-;;
-;; This will prompt you for a name of a screen session. Type in a
-;; name and it will insert a link into your org file at your current
-;; location.
-;;
-;; When you want to visit the link, go to the link and type C-c C-o to
-;; open the link.
-;;
-;; You may want to get rid of the constant queries about whether you
-;; really want to execute lisp code. Do so by adding to your .emacs:
-;;
-;; (setq org-confirm-elisp-link-function nil)
-
-(require 'term)
-(require 'org)
-
-(defcustom org-screen-program-name "/usr/bin/screen"
- "Full location of the screen executable."
- :group 'org-screen
- :type 'string)
-
-(defun org-screen (name)
- "Start a screen session with name"
- (interactive "MScreen name: ")
- (save-excursion
- (org-screen-helper name "-S"))
- (insert-string (concat "[[screen:" name "]]")))
-
-(defun org-screen-buffer-name (name)
- "Returns the buffer name corresponding to the screen name given."
- (concat "*screen " name "*"))
-
-(defun org-screen-helper (name arg)
- "This method will create a screen session with a specified name
-and taking the specified screen arguments. Much of this function
-is copied from ansi-term method."
-
- ;; Pick the name of the new buffer.
- (let ((term-ansi-buffer-name
- (generate-new-buffer-name
- (org-screen-buffer-name name))))
- (setq term-ansi-buffer-name
- (term-ansi-make-term
- term-ansi-buffer-name org-screen-program-name nil arg name))
- (set-buffer term-ansi-buffer-name)
- (term-mode)
- (term-char-mode)
- (term-set-escape-char ?\C-x)
- term-ansi-buffer-name))
-
-(defun org-screen-goto (name)
- "Open the screen with the specified name in the window"
- (interactive "MScreen name: ")
- (let ((screen-buffer-name (org-screen-buffer-name name)))
- (if (member screen-buffer-name
- (mapcar 'buffer-name (buffer-list)))
- (switch-to-buffer screen-buffer-name)
- (switch-to-buffer (org-screen-helper name "-dr")))))
-
-(if org-link-abbrev-alist
- (add-to-list 'org-link-abbrev-alist
- '("screen" . "elisp:(org-screen-goto \"%s\")"))
- (setq org-link-abbrev-alist
- '(("screen" . "elisp:(org-screen-goto \"%s\")"))))
-
-(provide 'org-screen)
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-secretary.el b/.emacs.d/org-7.4/contrib/lisp/org-secretary.el
deleted file mode 100644
index 353e5c3..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-secretary.el
+++ /dev/null
@@ -1,232 +0,0 @@
-;;; org-secretary.el --- Team management with org-mode
-;; Copyright (C) 2010 Juan Reyero
-;;
-;; Author: Juan Reyero <juan _at_ juanreyero _dot_ com>
-;; Keywords: outlines, tasks, team, management
-;; Homepage: http://juanreyero.com/article/emacs/org-teams.html
-;; Version: 0.02
-;;
-;; This file is not part of GNU Emacs.
-;;
-;; This file is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; THis file is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-;;
-;; This module implements helper functions for team management. It
-;; makes it easy to keep track of the work of several people. It
-;; keeps context (with whom and where you are) and allows you to use
-;; it to metadata to your notes, and to query the tasks associated
-;; with the people you are with and the place.
-;;
-;; See http://juanreyero.com/article/emacs/org-teams.html for a full
-;; explanation and configuration instructions.
-;;
-;;; Configuration
-;;;;;;;;;;;;;;;;;
-;;
-;; In short; your todos use the TODO keyword, your team's use TASK.
-;; Your org-todo-keywords should look something like this:
-;;
-;; (setq org-todo-keywords
-;; '((sequence "TODO(t)" "|" "DONE(d)" "CANCELLED(c)")
-;; (sequence "TASK(f)" "|" "DONE(d)")
-;; (sequence "MAYBE(m)" "|" "CANCELLED(c)")))
-;;
-;; It helps to distinguish them by color, like this:
-;;
-;; (setq org-todo-keyword-faces
-;; '(("TODO" . (:foreground "DarkOrange1" :weight bold))
-;; ("MAYBE" . (:foreground "sea green"))
-;; ("DONE" . (:foreground "light sea green"))
-;; ("CANCELLED" . (:foreground "forest green"))
-;; ("TASK" . (:foreground "blue"))))
-;;
-;; If you want to keep track of stuck projects you should tag your
-;; projects with :prj:, and define:
-;;
-;; (setq org-tags-exclude-from-inheritance '("prj")
-;; org-stuck-projects '("+prj/-MAYBE-DONE"
-;; ("TODO" "TASK") ()))
-;;
-;; Define a tag that marks TASK entries as yours:
-;;
-;; (setq org-sec-me "juanre")
-;;
-;; Finally, you add the special views to your org-agenda-custom-commands:
-;;
-;; (setq org-agenda-custom-commands
-;; '(("h" "Work todos" tags-todo
-;; "-personal-doat={.+}-dowith={.+}/!-TASK"
-;; ((org-agenda-todo-ignore-scheduled t)))
-;; ("H" "All work todos" tags-todo "-personal/!-TASK-MAYBE"
-;; ((org-agenda-todo-ignore-scheduled nil)))
-;; ("A" "Work todos with doat or dowith" tags-todo
-;; "-personal+doat={.+}|dowith={.+}/!-TASK"
-;; ((org-agenda-todo-ignore-scheduled nil)))
-;; ("j" "TODO dowith and TASK with"
-;; ((org-sec-with-view "TODO dowith")
-;; (org-sec-where-view "TODO doat")
-;; (org-sec-assigned-with-view "TASK with")
-;; (org-sec-stuck-with-view "STUCK with")))
-;; ("J" "Interactive TODO dowith and TASK with"
-;; ((org-sec-who-view "TODO dowith")))))
-;;
-;;; Usage
-;;;;;;;;;
-;;
-;; Do C-c w to say with whom you are meeting (a space-separated list
-;; of names). Maybe do also C-c W to say where you are. Then do C-c a
-;; j to see:
-;; - Todo items defined with TODO (ie, mine) in which the
-;; =dowith= property matches any of the people with me.
-;; - Todo items defined with TODO in which the =doat= property
-;; matches my current location.
-;; - Todo items defined with TASK that are tagged with the name
-;; of any of the people with me (this is, assigned to them).
-;; - Stuck projects tagged with the name of the people with me.
-;;
-;; Use C-c j to add meta-data with the people with me, the
-;; location and the time to entries.
-
-(require 'org)
-
-(defvar org-sec-me nil
- "Tag that defines TASK todo entries associated to me")
-
-(defvar org-sec-with nil
- "Value of the :with: property when doing an
- org-sec-tag-entry. Change it with org-sec-set-with,
- set to C-c w. Defaults to org-sec-me")
-
-(defvar org-sec-where ""
- "Value of the :at: property when doing an
- org-sec-tag-entry. Change it with org-sec-set-with,
- set to C-c W")
-
-(defvar org-sec-with-history '()
- "History list of :with: properties")
-
-(defvar org-sec-where-history '()
- "History list of :where: properties")
-
-(defun org-sec-set-with ()
- "Changes the value of the org-sec-with variable for use in the
- next call of org-sec-tag-entry. Leave it empty to default to
- org-sec-me (you)."
- (interactive)
- (setq org-sec-with (let ((w (read-string "With: " nil
- 'org-sec-with-history "")))
- (if (string= w "")
- nil
- w))))
-(global-set-key "\C-cw" 'org-sec-set-with)
-
-(defun org-sec-set-where ()
- "Changes the value of the org-sec-where variable for use
- in the next call of org-sec-tag-entry."
- (interactive)
- (setq org-sec-where
- (read-string "Where: " nil
- 'org-sec-where-history "")))
-(global-set-key "\C-cW" 'org-sec-set-where)
-
-(defun org-sec-set-dowith ()
- "Sets the value of the dowith property."
- (interactive)
- (let ((do-with
- (read-string "Do with: "
- nil 'org-sec-dowith-history "")))
- (unless (string= do-with "")
- (org-entry-put nil "dowith" do-with))))
-(global-set-key "\C-cd" 'org-sec-set-dowith)
-
-(defun org-sec-set-doat ()
- "Sets the value of the doat property."
- (interactive)
- (let ((do-at (read-string "Do at: "
- nil 'org-sec-doat-history "")))
- (unless (string= do-at "")
- (org-entry-put nil "doat" do-at))))
-(global-set-key "\C-cD" 'org-sec-set-doat)
-
-(defun org-sec-tag-entry ()
- "Adds a :with: property with the value of org-sec-with if
- defined, an :at: property with the value of org-sec-where
- if defined, and an :on: property with the current time."
- (interactive)
- (save-excursion
- (org-entry-put nil "on" (format-time-string
- (org-time-stamp-format 'long)
- (current-time)))
- (unless (string= org-sec-where "")
- (org-entry-put nil "at" org-sec-where))
- (if org-sec-with
- (org-entry-put nil "with" org-sec-with))))
-(global-set-key "\C-cj" 'org-sec-tag-entry)
-
-(defun join (lst sep &optional pre post)
- (mapconcat (function (lambda (x) (concat pre x post))) lst sep))
-
-(defun org-sec-get-with ()
- (if org-sec-with
- org-sec-with
- org-sec-me))
-
-(defun org-sec-with-view (par &optional who)
- "Select tasks marked as dowith=who, where who
- defaults to the value of org-sec-with."
- (org-tags-view '(4) (join (split-string (if who
- who
- (org-sec-get-with)))
- "|" "dowith=\"" "\"")))
-
-(defun org-sec-where-view (par)
- "Select tasks marked as doat=org-sec-where."
- (org-tags-view '(4) (concat "doat={" org-sec-where "}")))
-
-(defun org-sec-assigned-with-view (par &optional who)
- "Select tasks assigned to who, by default org-sec-with."
- (org-tags-view '(4)
- (concat (join (split-string (if who
- who
- (org-sec-get-with)))
- "|")
- "/TASK")))
-
-(defun org-sec-stuck-with-view (par &optional who)
- "Select stuck projects assigned to who, by default
- org-sec-with."
- (let ((org-stuck-projects
- `(,(concat "+prj+"
- (join (split-string (if who
- who
- (org-sec-get-with))) "|")
- "/-MAYBE-DONE")
- ("TODO" "TASK") ())))
- (org-agenda-list-stuck-projects)))
-
-(defun org-sec-who-view (par)
- "Builds agenda for a given user. Queried. "
- (let ((who (read-string "Build todo for user/tag: "
- "" "" "")))
- (org-sec-with-view "TODO dowith" who)
- (org-sec-assigned-with-view "TASK with" who)
- (org-sec-stuck-with-view "STUCK with" who)))
-
-(provide 'org-secretary)
-
-;;; org-secretary.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-special-blocks.el b/.emacs.d/org-7.4/contrib/lisp/org-special-blocks.el
deleted file mode 100644
index 80e2b89..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-special-blocks.el
+++ /dev/null
@@ -1,94 +0,0 @@
-;;; org-special-blocks.el --- Turn blocks into LaTeX envs and HTML divs
-
-;; Copyright (C) 2009 Chris Gray
-
-;; Author: Chris Gray <chrismgray@gmail.com>
-
-;; This file is not currently part of GNU Emacs.
-
-;; This program is free software; you can redistribute it and/or
-;; modify it under the terms of the GNU General Public License as
-;; published by the Free Software Foundation; either version 2, or (at
-;; your option) any later version.
-
-;; This program is distributed in the hope that it will be useful, but
-;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-;; General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with this program ; see the file COPYING. If not, write to
-;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
-
-;;; Commentary:
-;;
-
-;; This package generalizes the #+begin_foo and #+end_foo tokens.
-
-;; To use, put the following in your init file:
-;;
-;; (require 'org-special-blocks)
-
-;; The tokens #+begin_center, #+begin_verse, etc. existed previously.
-;; This package generalizes them (at least for the LaTeX and html
-;; exporters). When a #+begin_foo token is encountered by the LaTeX
-;; exporter, it is expanded into \begin{foo}. The text inside the
-;; environment is not protected, as text inside environments generally
-;; is. When #+begin_foo is encountered by the html exporter, a div
-;; with class foo is inserted into the HTML file. It is up to the
-;; user to add this class to his or her stylesheet if this div is to
-;; mean anything.
-
-(defvar org-special-blocks-ignore-regexp "^\\(LaTeX\\|HTML\\)$"
- "A regexp indicating the names of blocks that should be ignored
-by org-special-blocks. These blocks will presumably be
-interpreted by other mechanisms.")
-
-(defun org-special-blocks-make-special-cookies ()
- "Adds special cookies when #+begin_foo and #+end_foo tokens are
-seen. This is run after a few special cases are taken care of."
- (when (or htmlp latexp)
- (goto-char (point-min))
- (while (re-search-forward "^[ \t]*#\\+\\(begin\\|end\\)_\\(.*\\)$" nil t)
- (unless (org-string-match-p org-special-blocks-ignore-regexp (match-string 2))
- (replace-match
- (if (equal (downcase (match-string 1)) "begin")
- (concat "ORG-" (match-string 2) "-START")
- (concat "ORG-" (match-string 2) "-END"))
- t t)))))
-
-(add-hook 'org-export-preprocess-after-blockquote-hook
- 'org-special-blocks-make-special-cookies)
-
-(defun org-special-blocks-convert-latex-special-cookies ()
- "Converts the special cookies into LaTeX blocks."
- (goto-char (point-min))
- (while (re-search-forward "^ORG-\\([^ \t\n]*\\)[ \t]*\\(.*\\)-\\(START\\|END\\)$" nil t)
- (replace-match
- (if (equal (match-string 3) "START")
- (concat "\\begin{" (match-string 1) "}" (match-string 2))
- (concat "\\end{" (match-string 1) "}"))
- t t)))
-
-
-(add-hook 'org-export-latex-after-blockquotes-hook
- 'org-special-blocks-convert-latex-special-cookies)
-
-(defun org-special-blocks-convert-html-special-cookies ()
- "Converts the special cookies into div blocks."
- ;; Uses the dynamically-bound variable `line'.
- (when (string-match "^ORG-\\(.*\\)-\\(START\\|END\\)$" line)
-; (org-close-par-maybe)
- (message "%s" (match-string 1))
- (if (equal (match-string 2 line) "START")
- (insert "<div class=\"" (match-string 1 line) "\">\n")
- (insert "</div>\n"))
- (throw 'nextline nil)))
-
-(add-hook 'org-export-html-after-blockquotes-hook
- 'org-special-blocks-convert-html-special-cookies)
-
-(provide 'org-special-blocks)
-
-;;; org-special-blocks.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-static-mathjax.el b/.emacs.d/org-7.4/contrib/lisp/org-static-mathjax.el
deleted file mode 100644
index 6a9f0ec..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-static-mathjax.el
+++ /dev/null
@@ -1,171 +0,0 @@
-;;; org-static-mathjax.el --- Muse-like tags in Org-mode
-;;
-;; Author: Jan Böker <jan dot boecker at jboecker dot de>
-
-;; This elisp code integrates Static MathJax into the
-;; HTML export process of Org-mode.
-;;
-;; The supporting files for this package are in contrib/scripts/staticmathjax
-;; Please read the README.org file in that directory for more information.
-
-;; To use it, evaluate it on startup, add the following to your .emacs:
-
-;; (require 'org-static-mathjax)
-;;
-;; You will then have to customize the following two variables:
-;; - org-static-mathjax-app-ini-path
-;; - org-static-mathjax-local-mathjax-path
-;;
-;; If xulrunner is not in your $PATH, you will also need to customize
-;; org-static-mathjax-xulrunner-path.
-;;
-;; If everything is setup correctly, you can trigger Static MathJax on
-;; export to HTML by adding the following line to your Org file:
-;; #+StaticMathJax: embed-fonts:nil output-file-name:"embedded-math.html"
-;;
-;; You can omit either argument.
-;; embed-fonts defaults to nil. If you do not specify output-file-name,
-;; the exported file is overwritten with the static version.
-;;
-;; If embed-fonts is non-nil, the fonts are embedded directly into the
-;; output file using data: URIs.
-;;
-;; output-file-name specifies the file name of the static version. You
-;; can use any arbitrary lisp form here, for example:
-;; output-file-name:(concat (file-name-sans-extension buffer-file-name) "-static.html")
-;;
-;; The StaticMathJax XULRunner application expects a UTF-8 encoded
-;; input file. If the static version displays random characters instead
-;; of your math, add the following line at the top of your Org file:
-;; -*- coding: utf-8; -*-
-;;
-;; License: GPL v2 or later
-
-(defcustom org-static-mathjax-app-ini-path
- (or (expand-file-name
- "../scripts/staticmatchjax/application.ini"
- (file-name-directory (or load-file-name buffer-file-name)))
- "")
- "Path to \"application.ini\" of the Static MathJax XULRunner application.
-If you have extracted StaticMathJax to e.g. ~/.local/staticmathjax, set
-this to ~/.local/staticmathjax/application.ini"
- :type 'string)
-
-(defcustom org-static-mathjax-xulrunner-path
- "xulrunner"
- "Path to your xulrunner binary"
- :type 'string)
-
-(defcustom org-static-mathjax-local-mathjax-path
- ""
- "Extract the MathJax zip file somewhere on your local
-hard drive and specify the path here.
-
-The directory has to be writeable, as org-static-mathjax
-creates a temporary file there during export."
- :type 'string)
-
-(defvar org-static-mathjax-debug
- nil
- "If non-nil, org-static-mathjax will print some debug messages")
-
-(defun org-static-mathjax-hook-installer ()
- "Installs org-static-mathjax-process in after-save-hook.
-
-Sets the following buffer-local variables for org-static-mathjax-process to pick up:
-org-static-mathjax-mathjax-path: The path to MathJax.js as used by Org HTML export
-org-static-mathjax-options: The string given with #+STATICMATHJAX: in the file"
- (let ((static-mathjax-option-string (plist-get opt-plist :static-mathjax)))
- (if static-mathjax-option-string
- (progn (set (make-local-variable 'org-static-mathjax-options) static-mathjax-option-string)
- (set (make-local-variable 'org-static-mathjax-mathjax-path)
- (nth 1 (assq 'path org-export-html-mathjax-options)))
- (let ((mathjax-options (plist-get opt-plist :mathjax)))
- (if mathjax-options
- (if (string-match "\\<path:" mathjax-options)
- (set 'org-static-mathjax-mathjax-path
- (car (read-from-string
- (substring mathjax-options (match-end 0))))))))
- (add-hook 'after-save-hook
- 'org-static-mathjax-process
- nil t)))))
-
-
-(defun org-static-mathjax-process ()
- (save-excursion
- ; some sanity checking
- (if (or (string= org-static-mathjax-app-ini-path "")
- (not (file-exists-p org-static-mathjax-app-ini-path)))
- (error "Static MathJax: You must customize org-static-mathjax-app-ini-path!"))
- (if (or (string= org-static-mathjax-local-mathjax-path "")
- (not (file-exists-p org-static-mathjax-local-mathjax-path)))
- (error "Static MathJax: You must customize org-static-mathjax-local-mathjax-path!"))
-
- ; define variables
- (let* ((options org-static-mathjax-options)
- (output-file-name buffer-file-name)
- (input-file-name (let ((temporary-file-directory (file-name-directory org-static-mathjax-local-mathjax-path)))
- (make-temp-file "org-static-mathjax-" nil ".html")))
- (html-code (buffer-string))
- (mathjax-oldpath (concat "src=\"" org-static-mathjax-mathjax-path))
- (mathjax-newpath (concat "src=\"" org-static-mathjax-local-mathjax-path))
- embed-fonts)
- ; read file-local options
- (mapc
- (lambda (symbol)
- (if (string-match (concat "\\<" (symbol-name symbol) ":") options)
- (set symbol (eval (car (read-from-string
- (substring options (match-end 0))))))))
- '(embed-fonts output-file-name))
-
- ; debug
- (when org-static-mathjax-debug
- (message "output file name, embed-fonts")
- (print output-file-name)
- (print embed-fonts))
-
- ; open (temporary) input file, copy contents there, replace MathJax path with local installation
- (with-temp-buffer
- (insert html-code)
- (goto-char 1)
- (replace-regexp mathjax-oldpath mathjax-newpath)
- (write-file input-file-name))
-
- ; prepare argument list for call-process
- (let ((call-process-args (list org-static-mathjax-xulrunner-path
- nil nil nil
- org-static-mathjax-app-ini-path
- input-file-name
- output-file-name)))
- ; if fonts are embedded, just append the --embed-fonts flag
- (if embed-fonts
- (add-to-list 'call-process-args "--embed-fonts" t))
- ; if fonts are not embedded, the XULRunner app must replace all references
- ; to the font files with the real location (Firefox inserts file:// URLs there,
- ; because we are using a local MathJax installation here)
- (if (not embed-fonts)
- (progn
- (add-to-list 'call-process-args "--final-mathjax-url" t)
- (add-to-list 'call-process-args
- (file-name-directory org-static-mathjax-mathjax-path)
- t)))
-
- ; debug
- (when org-static-mathjax-debug
- (print call-process-args))
- ; call it
- (apply 'call-process call-process-args)
- ; delete our temporary input file
- (kill-buffer)
- (delete-file input-file-name)
- (let ((backup-file (concat input-file-name "~")))
- (if (file-exists-p backup-file)
- (delete-file backup-file)))))))
-
-(add-to-list 'org-export-inbuffer-options-extra
-'("STATICMATHJAX" :static-mathjax))
-
-(add-hook 'org-export-html-final-hook 'org-static-mathjax-hook-installer)
-
-
-(provide 'org-static-mathjax)
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-toc.el b/.emacs.d/org-7.4/contrib/lisp/org-toc.el
deleted file mode 100644
index 2c5eb9c..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-toc.el
+++ /dev/null
@@ -1,488 +0,0 @@
-;;; org-toc.el --- Table of contents for Org-mode buffer
-
-;; Copyright 2007 Bastien Guerry
-;;
-;; Author: Bastien Guerry <bzg AT altern DOT org>
-;; Keywords: Org table of contents
-;; Homepage: http://www.cognition.ens.fr/~guerry/u/org-toc.el
-;; Version: 0.8
-
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with this program; if not, write to the Free Software
-;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-;;; Commentary:
-
-;; This library implements a browsable table of contents for Org files.
-
-;; Put this file into your load-path and the following into your ~/.emacs:
-;; (require 'org-toc)
-
-;;; Code:
-
-(provide 'org-toc)
-(eval-when-compile
- (require 'cl))
-
-;;; Custom variables:
-(defvar org-toc-base-buffer nil)
-(defvar org-toc-columns-shown nil)
-(defvar org-toc-odd-levels-only nil)
-(defvar org-toc-config-alist nil)
-(defvar org-toc-cycle-global-status nil)
-(defalias 'org-show-table-of-contents 'org-toc-show)
-
-(defgroup org-toc nil
- "Options concerning the browsable table of contents of Org-mode."
- :tag "Org TOC"
- :group 'org)
-
-(defcustom org-toc-default-depth 1
- "Default depth when invoking `org-toc-show' without argument."
- :group 'org-toc
- :type '(choice
- (const :tag "same as base buffer" nil)
- (integer :tag "level")))
-
-(defcustom org-toc-follow-mode nil
- "Non-nil means navigating through the table of contents will
-move the point in the Org buffer accordingly."
- :group 'org-toc
- :type 'boolean)
-
-(defcustom org-toc-info-mode nil
- "Non-nil means navigating through the table of contents will
-show the properties for the current headline in the echo-area."
- :group 'org-toc
- :type 'boolean)
-
-(defcustom org-toc-show-subtree-mode nil
- "Non-nil means show subtree when going to headline or following
-it while browsing the table of contents."
- :group 'org-toc
- :type '(choice
- (const :tag "show subtree" t)
- (const :tag "show entry" nil)))
-
-(defcustom org-toc-recenter-mode t
- "Non-nil means recenter the Org buffer when following the
-headlines in the TOC buffer."
- :group 'org-toc
- :type 'boolean)
-
-(defcustom org-toc-recenter 0
- "Where to recenter the Org buffer when unfolding a subtree.
-This variable is only used when `org-toc-recenter-mode' is set to
-'custom. A value >=1000 will call recenter with no arg."
- :group 'org-toc
- :type 'integer)
-
-(defcustom org-toc-info-exclude '("ALLTAGS")
- "A list of excluded properties when displaying info in the
-echo-area. The COLUMNS property is always exluded."
- :group 'org-toc
- :type 'lits)
-
-;;; Org TOC mode:
-(defvar org-toc-mode-map (make-sparse-keymap)
- "Keymap for `org-toc-mode'.")
-
-(defun org-toc-mode ()
- "A major mode for browsing the table of contents of an Org buffer.
-
-\\{org-toc-mode-map}"
- (interactive)
- (kill-all-local-variables)
- (use-local-map org-toc-mode-map)
- (setq mode-name "Org TOC")
- (setq major-mode 'org-toc-mode))
-
-;; toggle modes
-(define-key org-toc-mode-map "f" 'org-toc-follow-mode)
-(define-key org-toc-mode-map "S" 'org-toc-show-subtree-mode)
-(define-key org-toc-mode-map "s" 'org-toc-store-config)
-(define-key org-toc-mode-map "g" 'org-toc-restore-config)
-(define-key org-toc-mode-map "i" 'org-toc-info-mode)
-(define-key org-toc-mode-map "r" 'org-toc-recenter-mode)
-
-;; navigation keys
-(define-key org-toc-mode-map "p" 'org-toc-previous)
-(define-key org-toc-mode-map "n" 'org-toc-next)
-(define-key org-toc-mode-map [(left)] 'org-toc-previous)
-(define-key org-toc-mode-map [(right)] 'org-toc-next)
-(define-key org-toc-mode-map [(up)] 'org-toc-previous)
-(define-key org-toc-mode-map [(down)] 'org-toc-next)
-(define-key org-toc-mode-map "1" (lambda() (interactive) (org-toc-show 1 (point))))
-(define-key org-toc-mode-map "2" (lambda() (interactive) (org-toc-show 2 (point))))
-(define-key org-toc-mode-map "3" (lambda() (interactive) (org-toc-show 3 (point))))
-(define-key org-toc-mode-map "4" (lambda() (interactive) (org-toc-show 4 (point))))
-(define-key org-toc-mode-map " " 'org-toc-goto)
-(define-key org-toc-mode-map "q" 'org-toc-quit)
-(define-key org-toc-mode-map "x" 'org-toc-quit)
-;; go to the location and stay in the base buffer
-(define-key org-toc-mode-map [(tab)] 'org-toc-jump)
-(define-key org-toc-mode-map "v" 'org-toc-jump)
-;; go to the location and delete other windows
-(define-key org-toc-mode-map [(return)]
- (lambda() (interactive) (org-toc-jump t)))
-
-;; special keys
-(define-key org-toc-mode-map "c" 'org-toc-columns)
-(define-key org-toc-mode-map "?" 'org-toc-help)
-(define-key org-toc-mode-map ":" 'org-toc-cycle-subtree)
-(define-key org-toc-mode-map "\C-c\C-o" 'org-open-at-point)
-;; global cycling in the base buffer
-(define-key org-toc-mode-map (kbd "C-S-<iso-lefttab>")
- 'org-toc-cycle-base-buffer)
-;; subtree cycling in the base buffer
-(define-key org-toc-mode-map [(control tab)]
- (lambda() (interactive) (org-toc-goto nil t)))
-
-;;; Toggle functions:
-(defun org-toc-follow-mode ()
- "Toggle follow mode in a `org-toc-mode' buffer."
- (interactive)
- (setq org-toc-follow-mode (not org-toc-follow-mode))
- (message "Follow mode is %s"
- (if org-toc-follow-mode "on" "off")))
-
-(defun org-toc-info-mode ()
- "Toggle info mode in a `org-toc-mode' buffer."
- (interactive)
- (setq org-toc-info-mode (not org-toc-info-mode))
- (message "Info mode is %s"
- (if org-toc-info-mode "on" "off")))
-
-(defun org-toc-show-subtree-mode ()
- "Toggle show subtree mode in a `org-toc-mode' buffer."
- (interactive)
- (setq org-toc-show-subtree-mode (not org-toc-show-subtree-mode))
- (message "Show subtree mode is %s"
- (if org-toc-show-subtree-mode "on" "off")))
-
-(defun org-toc-recenter-mode (&optional line)
- "Toggle recenter mode in a `org-toc-mode' buffer. If LINE is
-specified, then make `org-toc-recenter' use this value."
- (interactive "P")
- (setq org-toc-recenter-mode (not org-toc-recenter-mode))
- (when (numberp line)
- (setq org-toc-recenter-mode t)
- (setq org-toc-recenter line))
- (message "Recenter mode is %s"
- (if org-toc-recenter-mode
- (format "on, line %d" org-toc-recenter) "off")))
-
-(defun org-toc-cycle-subtree ()
- "Locally cycle a headline through two states: 'children and
-'folded"
- (interactive)
- (let ((beg (point))
- (end (save-excursion (end-of-line) (point)))
- (ov (car (overlays-at (point))))
- status)
- (if ov (setq status (overlay-get ov 'status))
- (setq ov (make-overlay beg end)))
- ;; change the folding status of this headline
- (cond ((or (null status) (eq status 'folded))
- (show-children)
- (message "CHILDREN")
- (overlay-put ov 'status 'children))
- ((eq status 'children)
- (show-branches)
- (message "BRANCHES")
- (overlay-put ov 'status 'branches))
- (t (hide-subtree)
- (message "FOLDED")
- (overlay-put ov 'status 'folded)))))
-
-;;; Main show function:
-;; FIXME name this org-before-first-heading-p?
-(defun org-toc-before-first-heading-p ()
- "Before first heading?"
- (save-excursion
- (null (re-search-backward "^\\*+ " nil t))))
-
-;;;###autoload
-(defun org-toc-show (&optional depth position)
- "Show the table of contents of the current Org-mode buffer."
- (interactive "P")
- (if (org-mode-p)
- (progn (setq org-toc-base-buffer (current-buffer))
- (setq org-toc-odd-levels-only org-odd-levels-only))
- (if (eq major-mode 'org-toc-mode)
- (switch-to-buffer org-toc-base-buffer)
- (error "Not in an Org buffer")))
- ;; create the new window display
- (let ((pos (or position
- (save-excursion
- (if (org-toc-before-first-heading-p)
- (progn (re-search-forward "^\\*+ " nil t)
- (match-beginning 0))
- (point))))))
- (setq org-toc-cycle-global-status org-cycle-global-status)
- (delete-other-windows)
- (and (get-buffer "*org-toc*") (kill-buffer "*org-toc*"))
- (switch-to-buffer-other-window
- (make-indirect-buffer org-toc-base-buffer "*org-toc*"))
- ;; make content before 1st headline invisible
- (goto-char (point-min))
- (let* ((beg (point-min))
- (end (and (re-search-forward "^\\*" nil t)
- (1- (match-beginning 0))))
- (ov (make-overlay beg end))
- (help (format "Table of contents for %s (press ? for a quick help):\n"
- (buffer-name org-toc-base-buffer))))
- (overlay-put ov 'invisible t)
- (overlay-put ov 'before-string help))
- ;; build the browsable TOC
- (cond (depth
- (let* ((dpth (if org-toc-odd-levels-only
- (1- (* depth 2)) depth)))
- (org-content dpth)
- (setq org-toc-cycle-global-status
- `(org-content ,dpth))))
- ((null org-toc-default-depth)
- (if (eq org-toc-cycle-global-status 'overview)
- (progn (org-overview)
- (setq org-cycle-global-status 'overview)
- (run-hook-with-args 'org-cycle-hook 'overview))
- (progn (org-overview)
- ;; FIXME org-content to show only headlines?
- (org-content)
- (setq org-cycle-global-status 'contents)
- (run-hook-with-args 'org-cycle-hook 'contents))))
- (t (let* ((dpth0 org-toc-default-depth)
- (dpth (if org-toc-odd-levels-only
- (1- (* dpth0 2)) dpth0)))
- (org-content dpth)
- (setq org-toc-cycle-global-status
- `(org-content ,dpth)))))
- (goto-char pos))
- (move-beginning-of-line nil)
- (org-toc-mode)
- (shrink-window-if-larger-than-buffer)
- (setq buffer-read-only t))
-
-;;; Navigation functions:
-(defun org-toc-goto (&optional jump cycle)
- "From Org TOC buffer, follow the targeted subtree in the Org window.
-If JUMP is non-nil, go to the base buffer.
-If JUMP is 'delete, go to the base buffer and delete other windows.
-If CYCLE is non-nil, cycle the targeted subtree in the Org window."
- (interactive)
- (let ((pos (point))
- (toc-buf (current-buffer)))
- (switch-to-buffer-other-window org-toc-base-buffer)
- (goto-char pos)
- (if cycle (org-cycle)
- (progn (org-overview)
- (if org-toc-show-subtree-mode
- (org-show-subtree)
- (org-show-entry))
- (org-show-context)))
- (if org-toc-recenter-mode
- (if (>= org-toc-recenter 1000) (recenter)
- (recenter org-toc-recenter)))
- (cond ((null jump)
- (switch-to-buffer-other-window toc-buf))
- ((eq jump 'delete)
- (delete-other-windows)))))
-
-(defun org-toc-cycle-base-buffer ()
- "Call `org-cycle' with a prefix argument in the base buffer."
- (interactive)
- (switch-to-buffer-other-window org-toc-base-buffer)
- (org-cycle t)
- (other-window 1))
-
-(defun org-toc-jump (&optional delete)
- "From Org TOC buffer, jump to the targeted subtree in the Org window.
-If DELETE is non-nil, delete other windows when in the Org buffer."
- (interactive "P")
- (if delete (org-toc-goto 'delete)
- (org-toc-goto t)))
-
-(defun org-toc-previous ()
- "Go to the previous headline of the TOC."
- (interactive)
- (if (save-excursion
- (beginning-of-line)
- (re-search-backward "^\\*" nil t))
- (outline-previous-visible-heading 1)
- (message "No previous heading"))
- (if org-toc-info-mode (org-toc-info))
- (if org-toc-follow-mode (org-toc-goto)))
-
-(defun org-toc-next ()
- "Go to the next headline of the TOC."
- (interactive)
- (outline-next-visible-heading 1)
- (if org-toc-info-mode (org-toc-info))
- (if org-toc-follow-mode (org-toc-goto)))
-
-(defun org-toc-quit ()
- "Quit the current Org TOC buffer."
- (interactive)
- (kill-this-buffer)
- (other-window 1)
- (delete-other-windows))
-
-;;; Special functions:
-(defun org-toc-columns ()
- "Toggle columns view in the Org buffer from Org TOC."
- (interactive)
- (let ((indirect-buffer (current-buffer)))
- (switch-to-buffer org-toc-base-buffer)
- (if (not org-toc-columns-shown)
- (progn (org-columns)
- (setq org-toc-columns-shown t))
- (progn (org-columns-remove-overlays)
- (setq org-toc-columns-shown nil)))
- (switch-to-buffer indirect-buffer)))
-
-(defun org-toc-info ()
- "Show properties of current subtree in the echo-area."
- (interactive)
- (let ((pos (point))
- (indirect-buffer (current-buffer))
- props prop msg)
- (switch-to-buffer org-toc-base-buffer)
- (goto-char pos)
- (setq props (org-entry-properties))
- (while (setq prop (pop props))
- (unless (or (equal (car prop) "COLUMNS")
- (member (car prop) org-toc-info-exclude))
- (let ((p (car prop))
- (v (cdr prop)))
- (if (equal p "TAGS")
- (setq v (mapconcat 'identity (split-string v ":" t) " ")))
- (setq p (concat p ":"))
- (add-text-properties 0 (length p) '(face org-special-keyword) p)
- (setq msg (concat msg p " " v " ")))))
- (switch-to-buffer indirect-buffer)
- (message msg)))
-
-;;; Store and restore TOC configuration:
-(defun org-toc-store-config ()
- "Store the current status of the tables of contents in
-`org-toc-config-alist'."
- (interactive)
- (let ((file (buffer-file-name org-toc-base-buffer))
- (pos (point))
- (hlcfg (org-toc-get-headlines-status)))
- (setq org-toc-config-alist
- (delete (assoc file org-toc-config-alist)
- org-toc-config-alist))
- (add-to-list 'org-toc-config-alist
- `(,file ,pos ,org-toc-cycle-global-status ,hlcfg))
- (message "TOC configuration saved: (%s)"
- (if (listp org-toc-cycle-global-status)
- (concat "org-content "
- (number-to-string
- (cadr org-toc-cycle-global-status)))
- (symbol-name org-toc-cycle-global-status)))))
-
-(defun org-toc-restore-config ()
- "Get the stored status in `org-toc-config-alist' and set the
-current table of contents to it."
- (interactive)
- (let* ((file (buffer-file-name org-toc-base-buffer))
- (conf (cdr (assoc file org-toc-config-alist)))
- (pos (car conf))
- (status (cadr conf))
- (hlcfg (caddr conf)) hlcfg0 ov)
- (cond ((listp status)
- (org-toc-show (cadr status) (point)))
- ((eq status 'overview)
- (org-overview)
- (setq org-cycle-global-status 'overview)
- (run-hook-with-args 'org-cycle-hook 'overview))
- (t
- (org-overview)
- (org-content)
- (setq org-cycle-global-status 'contents)
- (run-hook-with-args 'org-cycle-hook 'contents)))
- (while (setq hlcfg0 (pop hlcfg))
- (save-excursion
- (goto-char (point-min))
- (when (search-forward (car hlcfg0) nil t)
- (unless (overlays-at (match-beginning 0))
- (setq ov (make-overlay (match-beginning 0)
- (match-end 0))))
- (cond ((eq (cdr hlcfg0) 'children)
- (show-children)
- (message "CHILDREN")
- (overlay-put ov 'status 'children))
- ((eq (cdr hlcfg0) 'branches)
- (show-branches)
- (message "BRANCHES")
- (overlay-put ov 'status 'branches))))))
- (goto-char pos)
- (if org-toc-follow-mode (org-toc-goto))
- (message "Last TOC configuration restored")
- (sit-for 1)
- (if org-toc-info-mode (org-toc-info))))
-
-(defun org-toc-get-headlines-status ()
- "Return an alist of headlines and their associated folding
-status."
- (let (output ovs)
- (save-excursion
- (goto-char (point-min))
- (while (and (not (eobp))
- (goto-char (next-overlay-change (point))))
- (when (looking-at "^\\*+ ")
- (add-to-list
- 'output
- (cons (buffer-substring-no-properties
- (match-beginning 0)
- (save-excursion
- (end-of-line) (point)))
- (overlay-get
- (car (overlays-at (point))) 'status))))))
- ;; return an alist like (("* Headline" . 'status))
- output))
-
-;; In Org TOC buffer, hide headlines below the first level.
-(defun org-toc-help ()
- "Display a quick help message in the echo-area for `org-toc-mode'."
- (interactive)
- (let ((st-start 0)
- (help-message
- "\[space\] show heading \[1-4\] hide headlines below this level
-\[TAB\] jump to heading \[f\] toggle follow mode (currently %s)
-\[return\] jump and delete others windows \[i\] toggle info mode (currently %s)
-\[S-TAB\] cycle subtree (in Org) \[S\] toggle show subtree mode (currently %s)
-\[C-S-TAB\] global cycle (in Org) \[r\] toggle recenter mode (currently %s)
-\[:\] cycle subtree (in TOC) \[c\] toggle column view (currently %s)
-\[n/p\] next/previous heading \[s\] save TOC configuration
-\[q\] quit the TOC \[g\] restore last TOC configuration"))
- (while (string-match "\\[[^]]+\\]" help-message st-start)
- (add-text-properties (match-beginning 0)
- (match-end 0) '(face bold) help-message)
- (setq st-start (match-end 0)))
- (message help-message
- (if org-toc-follow-mode "on" "off")
- (if org-toc-info-mode "on" "off")
- (if org-toc-show-subtree-mode "on" "off")
- (if org-toc-recenter-mode (format "on, line %s" org-toc-recenter) "off")
- (if org-toc-columns-shown "on" "off"))))
-
-
-;;;;##########################################################################
-;;;; User Options, Variables
-;;;;##########################################################################
-
-
-
-;;; org-toc.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-track.el b/.emacs.d/org-7.4/contrib/lisp/org-track.el
deleted file mode 100644
index e65364e..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-track.el
+++ /dev/null
@@ -1,219 +0,0 @@
-;;; org-track.el --- Track the most recent Org-mode version available.
-;;
-;; Copyright (C) 2009
-;; Free Software Foundation, Inc.
-;;
-;; Author: Bastien Guerry <bzg at altern dot org>
-;; Eric S Fraga <e.fraga at ucl.ac dot uk>
-;; Sebastian Rose <sebastian_rose at gmx dot de>
-;; The Worg people http://orgmode.org/worg/
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 6.29a
-;;
-;; Released under the GNU General Public License version 3
-;; see: http://www.gnu.org/licenses/gpl-3.0.html
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-;;
-;; Download the latest development tarball, unpack and optionally compile it
-;;
-;; Usage:
-;;
-;; (require 'org-track)
-;;
-;; ;; ... somewhere in your setup (use customize):
-;;
-;; (setq org-track-directory "~/test/")
-;; (setq org-track-compile-sources nil)
-;; (setq org-track-remove-package t)
-;;
-;; M-x org-track-update RET
-
-
-
-(require 'url-parse)
-(require 'url-handlers)
-(autoload 'url-file-local-copy "url-handlers")
-(autoload 'url-generic-parse-url "url-parse")
-
-
-
-
-
-;;; Variables:
-
-(defgroup org-track nil
- "Track the most recent Org-mode version available.
-
-To use org-track, adjust `org-track-directory'.
-Org will download the archived latest git version for you,
-unpack it into that directory (i.e. a subdirectory
-`org-mode/' is added), create the autoloads file
-`org-install.el' for you and, optionally, compile the
-sources.
-All you'll have to do is call `M-x org-track-update' from
-time to time."
- :version "22.1"
- :group 'org)
-
-(defcustom org-track-directory "~/.emacs.d/org/lisp"
- "Directory where your org-mode/ directory lives.
-If that directory does not exist, it will be created."
- :type 'directory)
-
-(defcustom org-track-compile-sources t
- "If `nil', never compile org-sources.
-Org will only create the autoloads file `org-install.el' for
-you then. If `t', compile the sources, too.
-Note, that emacs preferes compiled elisp files over
-non-compiled ones."
- :type 'boolean)
-
-(defcustom org-track-org-url "http://orgmode.org/"
- "The URL where the package to download can be found.
-Please append a slash."
- :type 'string)
-
-(defcustom org-track-org-package "org-latest.tar.gz"
- "The basename of the package you use.
-Defaults to the development version of Org-mode.
-This should be a *.tar.gz package, since emacs provides all
-you need to unpack it."
- :type 'string)
-
-(defcustom org-track-remove-package nil
- "Remove org-latest.tar.gz after updates?"
- :type 'boolean)
-
-
-
-
-
-;;; Frontend
-
-(defun org-track-update ()
- "Update to current Org-mode version.
-Also, generate autoloads and evtl. compile the sources."
- (interactive)
- (let* ((base (file-truename org-track-directory))
- (org-exists (file-exists-p
- (file-truename
- (concat base "/org-mode/lisp/org.el"))))
- (nobase (not (file-directory-p
- (file-truename org-track-directory)))))
- (if nobase
- (when (y-or-n-p
- (format "Directory %s does not exist. Create it?" base))
- (make-directory base t)
- (setq nobase nil)))
- (if nobase
- (message "Not creating %s - giving up." org-track-directory)
- (condition-case err
- (progn
- (org-track-fetch-package)
- (org-track-compile-org))
- (error (message "%s" (error-message-string err)))))))
-
-
-
-
-;;; tar related functions
-
-;; `url-retrieve-synchronously' fetches files synchronously. How can we ensure
-;; that? If the maintainers of that package decide, that an assynchronous
-;; download might be better??? (used by `url-file-local-copy')
-
-;;;###autoload
-(defun org-track-fetch-package (&optional directory)
- "Fetch Org package depending on `org-track-fetch-package-extension'.
-If DIRECTORY is defined, unpack the package there, i.e. add the
-subdirectory org-mode/ to DIRECTORY."
- (interactive "Dorg-track directory: ")
- (let* ((pack (concat
- (if (string-match "/$" org-track-org-url)
- org-track-org-url
- (concat org-track-org-url "/"))
- org-track-org-package))
- (base (file-truename
- (or directory org-track-directory)))
- (target (file-truename
- (concat base "/" org-track-org-package)))
- url download tarbuff)
- (message "Fetching to %s - this might take some time..." base)
- (setq url (url-generic-parse-url pack))
- (setq download (url-file-local-copy url)) ;; errors if fail
- (copy-file download target t)
- (delete-file download)
- ;; (tar-mode) leads to dubious errors. We use the auto-mode-alist to
- ;; ensure tar-mode is used:
- (add-to-list 'auto-mode-alist '("org-latest\\.tar\\.gz\\'" . tar-mode))
- (setq tarbuff (find-file target))
- (with-current-buffer tarbuff ;; with-temp-buffer does not work with tar-mode??
- (tar-untar-buffer))
- (kill-buffer tarbuff)
- (if org-track-remove-package
- (delete-file target))))
-
-
-
-
-;;; Compile Org-mode sources
-
-
-;;;###autoload
-(defun org-track-compile-org (&optional directory)
- "Compile all *.el files that come with org-mode.
-Generate the autoloads file `org-install.el'.
-
-DIRECTORY is where the directory org-mode/ lives (i.e. the
- parent directory of your local repo."
- (interactive)
- ;; file-truename expands the filename and removes double slash, if exists:
- (setq directory (file-truename
- (concat
- (or directory
- (file-truename (concat org-track-directory "/org-mode/lisp")))
- "/")))
- (add-to-list 'load-path directory)
- (let ((list-of-org-files (file-expand-wildcards (concat directory "*.el"))))
- ;; create the org-install file
- (require 'autoload)
- (setq esf/org-install-file (concat directory "org-install.el"))
- (find-file esf/org-install-file)
- (erase-buffer)
- (mapc (lambda (x)
- (generate-file-autoloads x))
- list-of-org-files)
- (insert "\n(provide (quote org-install))\n")
- (save-buffer)
- (kill-buffer)
- (byte-compile-file esf/org-install-file t)
-
- (mapc (lambda (f)
- (if (file-exists-p (concat f "c"))
- (delete-file (concat f "c"))))
- list-of-org-files)
- (if org-track-compile-sources
- (mapc (lambda (f) (byte-compile-file f)) list-of-org-files))))
-
-
-(provide 'org-track)
-
-;;; org-track.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-velocity.el b/.emacs.d/org-7.4/contrib/lisp/org-velocity.el
deleted file mode 100644
index 2a1f41b..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-velocity.el
+++ /dev/null
@@ -1,527 +0,0 @@
-;;; org-velocity.el --- something like Notational Velocity for Org.
-
-;; Copyright (C) 2010 Paul M. Rodriguez
-
-;; Author: Paul M. Rodriguez <paulmrodriguez@gmail.com>
-;; Created: 2010-05-05
-;; Version: 2.2
-
-;; This file is not part of GNU Emacs.
-
-;; This program is free software; you can redistribute it and/or
-;; modify it under the terms of the GNU General Public License as
-;; published by the Free Software Foundation version 2.
-
-;; This program is distributed in the hope that it will be useful, but
-;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-;; General Public License for more details.
-
-;; For a copy of the GNU General Public License, search the Internet,
-;; or write to the Free Software Foundation, Inc., 59 Temple Place,
-;; Suite 330, Boston, MA 02111-1307 USA
-
-;;; Commentary:
-;; Org-Velocity.el implements an interface for Org inspired by the
-;; minimalist notetaking program Notational Velocity. The idea is to
-;; allow you to maintain, amass and access brief notes on many
-;; subjects with minimal fuss.
-
-;; It can be used in two ways: to store and access notes from any
-;; buffer a universal bucket file; or as a method for navigating any
-;; Org file.
-
-;; The name of the bucket-file (`org-velocity-bucket') and whether to
-;; always use it (`org-velocity-always-use-bucket-file') are set
-;; through Customize. If the bucket file is set but not always to be
-;; used, then calling Org-Velocity outside of Org-mode uses the bucket
-;; file; calling it in Org mode uses the current buffer. If no bucket
-;; file is set then Org-Velocity only works when called from Org.
-;; Even if the bucket file is always to be used, calling
-;; `org-velocity-read' with an argument will use the current file.
-
-;; The interface, unlike its inspiration, is not incremental.
-;; Org-Velocity prompts for search terms in the usual way; if the user
-;; has customized `org-velocity-use-completion', completion is offered
-;; on the headings in the target file. If the search multiple times
-;; in the target file, a buffer containing a buttonized list of the
-;; headings where it occurs is displayed. Results beyond what can be
-;; indexed are discarded. After clicking on a heading, or typing a
-;; character associated with it, the user is taken to the heading.
-;; (Typing 0 forces a new heading to be created.) If
-;; `org-velocity-edit-indirectly' is so set, the heading and its
-;; subtree are displayed in an indirect buffer. Otherwise the user is
-;; simply taken to the proper buffer and position.
-
-;; If the user simply hits RET at the prompt, without making a choice,
-;; then the search is restored for editing. A blank search quits.
-;; This method of selection is obviously not as slick as the original,
-;; but probably more useful for a keyboard-driven interface.
-
-;; If the search does not occur in the file the user is offered a
-;; choice to create a new heading named with the search. Org-Velocity
-;; will use `org-capture' or `org-remember' if they are loaded,
-;; preferring `org-capture'. Otherwise the user is simply taken to a
-;; new heading at the end of the file.
-
-;; Thanks to Richard Riley, Carsten Dominik, and Bastien Guerry for
-;; their suggestions.
-
-;;; Usage:
-;; (require 'org-velocity)
-;; (setq org-velocity-bucket (concat org-directory "/bucket.org"))
-;; (global-set-key (kbd "C-c v") 'org-velocity-read)
-
-;;; Code:
-(require 'org)
-(require 'button)
-(require 'electric)
-(eval-when-compile (require 'cl))
-
-(defgroup org-velocity nil
- "Notational Velocity-style interface for Org."
- :tag "Org-Velocity"
- :group 'outlines
- :group 'hypermedia)
-
-(defcustom org-velocity-bucket ""
- "Where is the bucket file?"
- :group 'org-velocity
- :type 'file)
-
-(defcustom org-velocity-always-use-bucket nil
- "Use bucket file even when called from an Org buffer?"
- :group 'org-velocity
- :type 'boolean)
-
-(defcustom org-velocity-use-completion nil
- "Complete on heading names?"
- :group 'org-velocity
- :type 'boolean)
-
-(defcustom org-velocity-edit-indirectly t
- "Edit entries in an indirect buffer or just visit the file?"
- :group 'org-velocity
- :type 'boolean)
-
-(defcustom org-velocity-search-method 'phrase
- "Match on whole phrase, any word, or all words?"
- :group 'org-velocity
- :type '(choice
- (const :tag "Match whole phrase" phrase)
- (const :tag "Match any word" any)
- (const :tag "Match all words" all)))
-
-(defcustom org-velocity-create-method 'capture
- "Prefer `org-capture', `org-remember', or neither?"
- :group 'org-velocity
- :type '(choice
- (const :tag "Prefer capture > remember > default." capture)
- (const :tag "Prefer remember > default." remember)
- (const :tag "Edit in buffer." buffer)))
-
-(defcustom org-velocity-allow-regexps nil
- "Allow searches to use regular expressions?"
- :group 'org-velocity
- :type 'boolean)
-
-(defstruct (org-velocity-heading
- (:constructor org-velocity-make-heading)
- (:type list))
- (marker (point-marker))
- (name (substring-no-properties
- (org-get-heading))))
-
-(defconst org-velocity-index
- (eval-when-compile
- (nconc (number-sequence 49 57) ;numbers
- (number-sequence 97 122) ;lowercase letters
- (number-sequence 65 90))) ;uppercase letters
- "List of chars for indexing results.")
-
-(defun org-velocity-use-file ()
- "Return the proper file for Org-Velocity to search.
-If `org-velocity-always-use-bucket' is t, use bucket file; complain
-if missing. Otherwise if this is an Org file, use it."
- (let ((org-velocity-bucket
- (and org-velocity-bucket (expand-file-name org-velocity-bucket))))
- (if org-velocity-always-use-bucket
- (or org-velocity-bucket (error "Bucket required but not defined"))
- (if (and (eq major-mode 'org-mode)
- (buffer-file-name))
- (buffer-file-name)
- (or org-velocity-bucket
- (error "No bucket and not an Org file"))))))
-
-(defsubst org-velocity-display-buffer ()
- "Return the proper buffer for Org-Velocity to display in."
- (get-buffer-create "*Velocity headings*"))
-
-(defsubst org-velocity-bucket-buffer ()
- "Return proper buffer for bucket operations."
- (find-file-noselect (org-velocity-use-file)))
-
-(defun org-velocity-quote (search)
- "Quote SEARCH as a regexp if `org-velocity-allow-regexps' is non-nil.
-Acts like `regexp-quote' on a string, `regexp-opt' on a list."
- (if org-velocity-allow-regexps
- search
- (if (listp search)
- (regexp-opt search)
- (regexp-quote search))))
-
-(defun org-velocity-nearest-heading (position)
- "Return last heading at POSITION.
-If there is no last heading, return nil."
- (save-excursion
- (goto-char position)
- (unless (org-before-first-heading-p)
- (org-back-to-heading)
- (org-velocity-make-heading))))
-
-(defun org-velocity-make-button-action (heading)
- "Return a form to visit HEADING."
- `(lambda (button)
- (run-hooks 'mouse-leave-buffer-hook) ;turn off temporary modes
- (if org-velocity-edit-indirectly
- (org-velocity-edit-entry ',heading)
- (progn
- (message "%s" ,(org-velocity-heading-name heading))
- (switch-to-buffer (marker-buffer
- ,(org-velocity-heading-marker heading)))
- (goto-char (marker-position
- ,(org-velocity-heading-marker heading)))))))
-
-(defun org-velocity-edit-entry (heading)
- "Edit entry at HEADING in an indirect buffer."
- (let ((buffer (make-indirect-buffer
- (marker-buffer (org-velocity-heading-marker heading))
- (generate-new-buffer-name
- (org-velocity-heading-name heading)))))
- (with-current-buffer buffer
- (let ((org-inhibit-startup t))
- (org-mode))
- (goto-char (marker-position (org-velocity-heading-marker heading)))
- (narrow-to-region (point)
- (save-excursion
- (org-end-of-subtree)
- (point)))
- (goto-char (point-min))
- (add-hook 'org-ctrl-c-ctrl-c-hook 'org-velocity-dismiss nil t))
- (pop-to-buffer buffer)
- (set (make-local-variable 'header-line-format)
- (format "%s Use C-c C-c to finish."
- (abbreviate-file-name
- (buffer-file-name
- (marker-buffer
- (org-velocity-heading-marker heading))))))))
-
-(defun org-velocity-dismiss ()
- "Save current entry and close indirect buffer."
- (progn
- (save-buffer)
- (kill-buffer)))
-
-(defun org-velocity-buttonize (heading)
- "Insert HEADING as a text button."
- (insert (format "#%c " (nth (1- (line-number-at-pos))
- org-velocity-index)))
- (let ((action (org-velocity-make-button-action heading)))
- (insert-text-button
- (org-velocity-heading-name heading)
- 'action action))
- (newline))
-
-(defun org-velocity-remember (heading &optional region)
- "Use `org-remember' to record a note to HEADING.
-If there is a REGION that will be inserted."
- (let ((org-remember-templates
- (list (list
- "Velocity entry"
- ?v
- (format "* %s\n\n%%?%s" heading (or region ""))
- (org-velocity-use-file)
- 'bottom))))
- (org-remember nil ?v)))
-
-(defun org-velocity-capture (heading &optional region)
- "Use `org-capture' to record a note to HEADING.
-If there is a REGION that will be inserted."
- (let ((org-capture-templates
- (list `("v"
- "Velocity entry"
- entry
- (file ,(org-velocity-use-file))
- ,(format "* %s\n\n%%?%s" heading (or region ""))))))
- (if (fboundp 'org-capture) ;; quiet compiler
- (org-capture nil "v"))))
-
-(defun org-velocity-insert-heading (heading)
- "Add a new heading named HEADING."
- (with-current-buffer (org-velocity-bucket-buffer)
- (goto-char (point-max))
- (newline)
- (org-insert-heading) (insert heading)
- (newline)
- (goto-char (point-max))))
-
-(defun org-velocity-create-heading (search region)
- "Add and visit a new heading named SEARCH.
-If REGION is non-nil insert as the contents of the heading."
- (org-velocity-insert-heading search)
- (switch-to-buffer (org-velocity-bucket-buffer))
- (when region (insert region)))
-
-(defun org-velocity-all-search (search)
- "Return entries containing all words in SEARCH."
- (when (file-exists-p (org-velocity-use-file))
- (save-excursion
- (delq nil
- (let ((keywords
- (mapcar 'org-velocity-quote
- (split-string search)))
- (case-fold-search t))
- (org-map-entries
- (lambda ()
- (if (loop with limit = (save-excursion
- (org-end-of-subtree)
- (point))
- for word in keywords
- always (save-excursion
- (re-search-forward word limit t)))
- (org-velocity-nearest-heading
- (match-beginning 0))))))))))
-
-(defun org-velocity-generic-search (search)
- "Return entries containing SEARCH."
- (save-excursion
- (delq nil
- (nreverse
- (let (matches (case-fold-search t))
- (goto-char (point-min))
- (while (re-search-forward search
- (point-max) t)
- (push (org-velocity-nearest-heading (match-beginning 0))
- matches)
- (outline-next-heading))
- matches)))))
-
-(defsubst org-velocity-phrase-search (search)
- "Return entries containing SEARCH as a phrase."
- (org-velocity-generic-search (org-velocity-quote search)))
-
-(defsubst org-velocity-any-search (search)
- "Return entries containing any word in SEARCH."
- (org-velocity-generic-search (org-velocity-quote (split-string search))))
-
-(defun org-velocity-present (headings)
- "Buttonize HEADINGS in `org-velocity-display-buffer'."
- (and (listp headings) (delete-dups headings))
- (let ((cdr (nthcdr
- (1- (length org-velocity-index))
- headings)))
- (and (consp cdr) (setcdr cdr nil)))
- (with-current-buffer (org-velocity-display-buffer)
- (mapc
- 'org-velocity-buttonize
- headings)
- (goto-char (point-min))))
-
-(defun org-velocity-create-1 (search region)
- "Create a new heading named SEARCH.
-If REGION is non-nil insert as contents of new heading.
-The possible methods are `org-velocity-capture',
-`org-velocity-remember', or `org-velocity-create-heading', in
-that order. Which is preferred is determined by
-`org-velocity-create-method'."
- (funcall
- (ecase org-velocity-create-method
- (capture (or (and (featurep 'org-capture) 'org-velocity-capture)
- (and (featurep 'org-remember) 'org-velocity-remember)
- 'org-velocity-create-heading))
- (remember (or (and (featurep 'org-remember) 'org-velocity-remember)
- 'org-velocity-create-heading))
- (buffer 'org-velocity-create-heading))
- search region))
-
-(defun org-velocity-create (search &optional ask)
- "Create new heading named SEARCH.
-If ASK is non-nil, ask first."
- (if (or (null ask)
- (y-or-n-p "No match found, create? "))
- ;; if there's a region, we want to insert it
- (let ((region (if (use-region-p)
- (buffer-substring
- (region-beginning)
- (region-end)))))
- (with-current-buffer (org-velocity-bucket-buffer)
- (org-velocity-create-1 search region))
- (when region (message "%s" "Inserted region"))
- search)))
-
-(defun org-velocity-get-matches (search)
- "Return matches for SEARCH in current bucket.
-Use method specified by `org-velocity-search-method'."
- (with-current-buffer (org-velocity-bucket-buffer)
- (case org-velocity-search-method
- ('phrase (org-velocity-phrase-search search))
- ('any (org-velocity-any-search search))
- ('all (org-velocity-all-search search)))))
-
-(defun org-velocity-engine (search)
- "Display a list of headings where SEARCH occurs."
- (with-current-buffer (org-velocity-display-buffer)
- (erase-buffer)
- (setq cursor-type nil))
- (unless (or
- (not (stringp search))
- (string-equal "" search)) ;exit on empty string
- (case
- (with-current-buffer (org-velocity-bucket-buffer)
- (save-excursion
- (let ((matches (org-velocity-get-matches search)))
- (org-velocity-present matches)
- (cond ((zerop (length matches)) 'new)
- ((= (length matches) 1) 'follow)
- ((> (length matches) 1) 'prompt)))))
- ('prompt (progn
- (Electric-pop-up-window (org-velocity-display-buffer))
- (let ((hint (org-velocity-electric-follow-hint)))
- (if hint
- (case hint
- (edit (org-velocity-read nil search))
- (new (org-velocity-create search))
- (otherwise (org-velocity-activate-button hint)))))))
- ('new (unless (org-velocity-create search t)
- (org-velocity-read nil search)))
- ('follow (if (y-or-n-p "One match, follow? ")
- (progn
- (set-buffer (org-velocity-display-buffer))
- (goto-char (point-min))
- (button-activate (next-button (point))))
- (org-velocity-read nil search))))))
-
-(defun org-velocity-position (item list)
- "Return first position of ITEM in LIST."
- (loop for elt in list
- for i from 0
- if (equal elt item)
- return i))
-
-(defun org-velocity-activate-button (char)
- "Go to button on line number associated with CHAR in `org-velocity-index'."
- (goto-char (point-min))
- (forward-line (org-velocity-position char org-velocity-index))
- (goto-char
- (button-start
- (next-button (point))))
- (message "%s" (button-label (button-at (point))))
- (button-activate (button-at (point))))
-
-(defun org-velocity-electric-undefined ()
- "Complain about an undefined key."
- (interactive)
- (message "%s"
- (substitute-command-keys
- "\\[org-velocity-electric-new] for new entry, \\[org-velocity-electric-edit] to edit search, \\[scroll-up] to scroll."))
- (sit-for 4))
-
-(defun org-velocity-electric-follow (ev)
- "Follow a hint indexed by keyboard event EV."
- (interactive (list last-command-event))
- (if (not (> (org-velocity-position ev org-velocity-index)
- (1- (count-lines (point-min) (point-max)))))
- (throw 'org-velocity-select ev)
- (call-interactively 'org-velocity-electric-undefined)))
-
-(defun org-velocity-electric-click (ev)
- "Follow hint indexed by a mouse event EV."
- (interactive "e")
- (throw 'org-velocity-select
- (nth (1- (count-lines
- (point-min)
- (posn-point (event-start ev))))
- org-velocity-index)))
-
-(defun org-velocity-electric-edit ()
- "Edit the search string."
- (interactive)
- (throw 'org-velocity-select 'edit))
-
-(defun org-velocity-electric-new ()
- "Force a new entry."
- (interactive)
- (throw 'org-velocity-select 'new))
-
-(defvar org-velocity-electric-map
- (let ((map (make-sparse-keymap)))
- (define-key map [t] 'org-velocity-electric-undefined) (loop for c in org-velocity-index
- do (define-key map (char-to-string c) 'org-velocity-electric-follow))
- (define-key map "0" 'org-velocity-electric-new)
- (define-key map [tab] 'scroll-up)
- (define-key map [return] 'org-velocity-electric-edit)
- (define-key map [mouse-1] 'org-velocity-electric-click)
- (define-key map [mouse-2] 'org-velocity-electric-click)
- (define-key map [escape escape escape] 'keyboard-quit)
- (define-key map "\C-h" 'help-command)
- map))
-
-(defun org-velocity-electric-follow-hint ()
- "Read index of button electrically."
- (with-current-buffer (org-velocity-display-buffer)
- (use-local-map org-velocity-electric-map)
- (catch 'org-velocity-select
- (Electric-command-loop 'org-velocity-select
- "Follow: "))))
-
-(defun org-velocity-read-with-completion (prompt)
- "Like `completing-read' on entries with PROMPT.
-Use `minibuffer-local-filename-completion-map'."
- (let ((minibuffer-local-completion-map
- minibuffer-local-filename-completion-map))
- (completing-read
- prompt
- (mapcar 'substring-no-properties
- (org-map-entries 'org-get-heading)))))
-
-(defun org-velocity-read-string (prompt &optional initial-input)
- "Read string with PROMPT followed by INITIAL-INPUT."
- ;; The use of initial inputs to the minibuffer is deprecated (see
- ;; `read-from-minibuffer'), but in this case it is the user-friendly
- ;; thing to do.
- (minibuffer-with-setup-hook
- (lexical-let ((initial-input initial-input))
- (lambda ()
- (and initial-input (insert initial-input))
- (goto-char (point-max))))
- (if (and org-velocity-use-completion
- ;; map-entries complains for nonexistent files
- (file-exists-p (org-velocity-use-file)))
- (org-velocity-read-with-completion prompt)
- (read-string prompt))))
-
-(defun org-velocity-read (arg &optional search)
- "Read a search string SEARCH for Org-Velocity interface.
-This means that a buffer will display all headings where SEARCH
-occurs, where one can be selected by a mouse click or by typing
-its index. If SEARCH does not occur, then a new heading may be
-created named SEARCH.
-
-If `org-velocity-bucket' is defined and
-`org-velocity-always-use-bucket' is non-nil, then the bucket file
-will be used; otherwise, this will work when called in any Org
-file. Calling with ARG forces current file."
- (interactive "P")
- (let ((org-velocity-always-use-bucket
- (if arg nil org-velocity-always-use-bucket)))
- ;; complain if inappropriate
- (assert (org-velocity-use-file))
- (unwind-protect
- (org-velocity-engine
- (org-velocity-read-string "Velocity search: " search))
- (progn
- (kill-buffer (org-velocity-display-buffer))
- (delete-other-windows)))))
-
-(provide 'org-velocity)
-;;; org-velocity.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org-wikinodes.el b/.emacs.d/org-7.4/contrib/lisp/org-wikinodes.el
deleted file mode 100644
index 85c32f6..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org-wikinodes.el
+++ /dev/null
@@ -1,339 +0,0 @@
-;;; org-wikinodes.el --- Wiki-like CamelCase links to outline nodes
-
-;; Copyright (C) 2010 Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.01trans
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(require 'org)
-(eval-when-compile
- (require 'cl))
-
-(defgroup org-wikinodes nil
- "Wiki-like CamelCase links words to outline nodes in Org mode."
- :tag "Org WikiNodes"
- :group 'org)
-
-(defconst org-wikinodes-camel-regexp "\\<[A-Z]+[a-z]+[A-Z]+[a-z]+[a-zA-Z]*\\>"
- "Regular expression matching CamelCase words.")
-
-(defcustom org-wikinodes-active t
- "Should CamelCase links be active in the current file?"
- :group 'org-wikinodes
- :type 'boolean)
-(put 'org-wikinodes-active 'safe-local-variable 'booleanp)
-
-(defcustom org-wikinodes-scope 'file
- "The scope of searches for wiki targets.
-Allowed values are:
-
-file Search for targets in the current file only
-directory Search for targets in all org files in the current directory"
- :group 'org-wikinodes
- :type '(choice
- (const :tag "Find targets in current file" file)
- (const :tag "Find targets in current directory" directory)))
-
-(defcustom org-wikinodes-create-targets 'query
- "Non-nil means create Wiki target when following a wiki link fails.
-Allowed values are:
-
-nil never create node, just throw an error if the target does not exist
-query ask the user what to do
-t create the node in the current buffer
-\"file.org\" create the node in the file \"file.org\", in the same directory
-
-If you are using wiki links across files, you need to set `org-wikinodes-scope'
-to `directory'."
- :group 'org-wikinodes
- :type '(choice
- (const :tag "Never automatically create node" nil)
- (const :tag "In current file" t)
- (file :tag "In one special file\n")
- (const :tag "Query the user" query)))
-
-;;; Link activation
-
-(defun org-wikinodes-activate-links (limit)
- "Activate CamelCase words as links to Wiki targets."
- (when org-wikinodes-active
- (let (case-fold-search)
- (if (re-search-forward org-wikinodes-camel-regexp limit t)
- (if (equal (char-after (point-at-bol)) ?*)
- (progn
- ;; in heading - deactivate flyspell
- (org-remove-flyspell-overlays-in (match-beginning 0)
- (match-end 0))
- (add-text-properties (match-beginning 0) (match-end 0)
- '(org-no-flyspell t))
- t)
- ;; this is a wiki link
- (org-remove-flyspell-overlays-in (match-beginning 0)
- (match-end 0))
- (add-text-properties (match-beginning 0) (match-end 0)
- (list 'mouse-face 'highlight
- 'face 'org-link
- 'keymap org-mouse-map
- 'help-echo "Wiki Link"))
- t)))))
-
-;;; Following links and creating non-existing target nodes
-
-(defun org-wikinodes-open-at-point ()
- "Check if the cursor is on a Wiki link and follow the link.
-
-This function goes into `org-open-at-point-functions'."
- (and org-wikinodes-active
- (not (org-on-heading-p))
- (let (case-fold-search) (org-in-regexp org-wikinodes-camel-regexp))
- (progn (org-wikinodes-follow-link (match-string 0)) t)))
-
-(defun org-wikinodes-follow-link (target)
- "Follow a wiki link to TARGET.
-
-This need to be found as an exact headline match, either in the current
-buffer, or in any .org file in the current directory, depending on the
-variable `org-wikinodes-scope'.
-
-If a target headline is not found, it may be created according to the
-setting of `org-wikinodes-create-targets'."
- (if current-prefix-arg (org-wikinodes-clear-direcory-targets-cache))
- (let ((create org-wikinodes-create-targets)
- visiting buffer m pos file rpl)
- (setq pos
- (or (org-find-exact-headline-in-buffer target (current-buffer))
- (and (eq org-wikinodes-scope 'directory)
- (setq file (org-wikinodes-which-file target))
- (org-find-exact-headline-in-buffer
- target (or (get-file-buffer file)
- (find-file-noselect file))))))
- (if pos
- (progn
- (org-mark-ring-push (point))
- (org-goto-marker-or-bmk pos)
- (move-marker pos nil))
- (when (eq create 'query)
- (if (eq org-wikinodes-scope 'directory)
- (progn
- (message "Node \"%s\" does not exist. Should it be created?
-\[RET] in this buffer [TAB] in another file [q]uit" target)
- (setq rpl (read-char-exclusive))
- (cond
- ((member rpl '(?\C-g ?q)) (error "Abort"))
- ((equal rpl ?\C-m) (setq create t))
- ((equal rpl ?\C-i)
- (setq create (file-name-nondirectory
- (read-file-name "Create in file: "))))
- (t (error "Invalid selection"))))
- (if (y-or-n-p (format "Create new node \"%s\" in current buffer? "
- target))
- (setq create t)
- (error "Abort"))))
-
- (cond
- ((not create)
- ;; We are not allowed to create the new node
- (error "No match for link to \"%s\"" target))
- ((stringp create)
- ;; Make new node in another file
- (org-mark-ring-push (point))
- (switch-to-buffer (find-file-noselect create))
- (goto-char (point-max))
- (or (bolp) (newline))
- (insert "\n* " target "\n")
- (backward-char 1)
- (org-wikinodes-add-target-to-cache target)
- (message "New Wiki target `%s' created in file \"%s\""
- target create))
- (t
- ;; Make new node in current buffer
- (org-mark-ring-push (point))
- (goto-char (point-max))
- (or (bolp) (newline))
- (insert "* " target "\n")
- (backward-char 1)
- (org-wikinodes-add-target-to-cache target)
- (message "New Wiki target `%s' created in current buffer"
- target))))))
-
-;;; The target cache
-
-(defvar org-wikinodes-directory-targets-cache nil)
-
-(defun org-wikinodes-clear-cache-when-on-target ()
- "When on a headline that is a Wiki target, clear the cache."
- (when (and (org-on-heading-p)
- (org-in-regexp (format org-complex-heading-regexp-format
- org-wikinodes-camel-regexp))
- (org-in-regexp org-wikinodes-camel-regexp))
- (org-wikinodes-clear-direcory-targets-cache)
- t))
-
-(defun org-wikinodes-clear-direcory-targets-cache ()
- "Clear the cache where to find wiki targets."
- (interactive)
- (setq org-wikinodes-directory-targets-cache nil)
- (message "Wiki target cache cleared, so that it will update when used again"))
-
-(defun org-wikinodes-get-targets ()
- "Return a list of all wiki targets in the current buffer."
- (let ((re (format org-complex-heading-regexp-format
- org-wikinodes-camel-regexp))
- (case-fold-search nil)
- targets)
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (while (re-search-forward re nil t)
- (push (org-match-string-no-properties 4) targets))))
- (nreverse targets)))
-
-(defun org-wikinodes-get-links-for-directory (dir)
- "Return an alist that connects wiki links to files in directory DIR."
- (let ((files (directory-files dir nil "\\`[^.#].*\\.org\\'"))
- (org-inhibit-startup t)
- target-file-alist file visiting m buffer)
- (while (setq file (pop files))
- (setq visiting (org-find-base-buffer-visiting file))
- (setq buffer (or visiting (find-file-noselect file)))
- (with-current-buffer buffer
- (mapc
- (lambda (target)
- (setq target-file-alist (cons (cons target file) target-file-alist)))
- (org-wikinodes-get-targets)))
- (or visiting (kill-buffer buffer)))
- target-file-alist))
-
-(defun org-wikinodes-add-target-to-cache (target &optional file)
- (setq file (or file buffer-file-name (error "No file for new wiki target")))
- (set-text-properties 0 (length target) nil target)
- (let ((dir (file-name-directory (expand-file-name file)))
- a)
- (setq a (assoc dir org-wikinodes-directory-targets-cache))
- (if a
- ;; Push the new target onto the existing list
- (push (cons target (expand-file-name file)) (cdr a))
- ;; Call org-wikinodes-which-file so that the cache will be filled
- (org-wikinodes-which-file target dir))))
-
-(defun org-wikinodes-which-file (target &optional directory)
- "Return the file for wiki headline TARGET DIRECTORY.
-If there is no such wiki target, return nil."
- (setq directory (expand-file-name (or directory default-directory)))
- (unless (assoc directory org-wikinodes-directory-targets-cache)
- (push (cons directory (org-wikinodes-get-links-for-directory directory))
- org-wikinodes-directory-targets-cache))
- (cdr (assoc target (cdr (assoc directory
- org-wikinodes-directory-targets-cache)))))
-
-;;; Exporting Wiki links
-
-(defvar target)
-(defvar target-alist)
-(defvar last-section-target)
-(defvar org-export-target-aliases)
-(defun org-wikinodes-set-wiki-targets-during-export ()
- (let ((line (buffer-substring (point-at-bol) (point-at-eol)))
- (case-fold-search nil)
- wtarget a)
- (when (string-match (format org-complex-heading-regexp-format
- org-wikinodes-camel-regexp)
- line)
- (setq wtarget (match-string 4 line))
- (push (cons wtarget target) target-alist)
- (setq a (or (assoc last-section-target org-export-target-aliases)
- (progn
- (push (list last-section-target)
- org-export-target-aliases)
- (car org-export-target-aliases))))
- (push (caar target-alist) (cdr a)))))
-
-(defvar org-current-export-file)
-(defun org-wikinodes-process-links-for-export ()
- "Process Wiki links in the export preprocess buffer.
-
-Try to find target matches in the wiki scope and replace CamelCase words
-with working links."
- (let ((re org-wikinodes-camel-regexp)
- (case-fold-search nil)
- link file)
- (goto-char (point-min))
- (while (re-search-forward re nil t)
- (org-if-unprotected-at (match-beginning 0)
- (unless (save-match-data
- (or (org-on-heading-p)
- (org-in-regexp org-bracket-link-regexp)
- (org-in-regexp org-plain-link-re)
- (org-in-regexp "<<[^<>]+>>")))
- (setq link (match-string 0))
- (delete-region (match-beginning 0) (match-end 0))
- (save-match-data
- (cond
- ((org-find-exact-headline-in-buffer link (current-buffer))
- ;; Found in current buffer
- (insert (format "[[#%s][%s]]" link link)))
- ((eq org-wikinodes-scope 'file)
- ;; No match in file, and other files are not allowed
- (insert (format "%s" link)))
- ((setq file
- (and (org-string-nw-p org-current-export-file)
- (org-wikinodes-which-file
- link (file-name-directory org-current-export-file))))
- ;; Match in another file in the current directory
- (insert (format "[[file:%s::%s][%s]]" file link link)))
- (t ;; No match for this link
- (insert (format "%s" link))))))))))
-
-;;; Hook the WikiNode mechanism into Org
-
-;; `C-c C-o' should follow wiki links
-(add-hook 'org-open-at-point-functions 'org-wikinodes-open-at-point)
-
-;; `C-c C-c' should clear the cache
-(add-hook 'org-ctrl-c-ctrl-c-hook 'org-wikinodes-clear-cache-when-on-target)
-
-;; Make Wiki haeding create additional link names for headlines
-(add-hook 'org-export-define-heading-targets-headline-hook
- 'org-wikinodes-set-wiki-targets-during-export)
-
-;; Turn Wiki links into links the exporter will treat correctly
-(add-hook 'org-export-preprocess-after-radio-targets-hook
- 'org-wikinodes-process-links-for-export)
-
-;; Activate CamelCase words as part of Org mode font lock
-
-(defun org-wikinodes-add-to-font-lock-keywords ()
- "Add wikinode CamelCase highlighting to `org-font-lock-extra-keywords'."
- (let ((m (member '(org-activate-plain-links) org-font-lock-extra-keywords)))
- (if m
- (setcdr m (cons '(org-wikinodes-activate-links) (cdr m)))
- (message
- "Failed to add wikinodes to `org-font-lock-extra-keywords'."))))
-
-(add-hook 'org-font-lock-set-keywords-hook
- 'org-wikinodes-add-to-font-lock-keywords)
-
-(provide 'org-wikinodes)
-
-;; arch-tag: e3b56e38-a2be-478c-b56c-68a913ec54ec
-
-;;; org-wikinodes.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/org2rem.el b/.emacs.d/org-7.4/contrib/lisp/org2rem.el
deleted file mode 100644
index 5d160dc..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/org2rem.el
+++ /dev/null
@@ -1,653 +0,0 @@
-;;; org2rem.el --- Convert org appointments into reminders
-
-;; Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
-
-;; Author: Bastien Guerry and Shatad Pratap
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 6.09a
-;;
-;; This file is not part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; (require 'org2rem)
-;; To export, do
-;;
-;; M-x org2rem-combine-agenda-files
-;;
-;; Then you can use reming like this:
-;;
-;; $ remind ~/org.rem
-;;
-;; If you want to use this regualrly, try in .emacs
-;;
-;; (add-hook 'org-mode-hook
-;; (lambda() (add-hook 'after-save-hook
-;; 'org-export-remind-all-agenda-files t t)))
-
-(require 'org)
-(require 'org-agenda)
-(require 'org-exp)
-(eval-and-compile
- (require 'cl))
-
-(defgroup org2rem nil
- "Options specific for Remind export of Org-mode files."
- :tag "Org Export Remind"
- :group 'org-export)
-
-(defcustom org-combined-agenda-remind-file "~/org.rem"
- "The file name for the Remind file covering all agenda files.
-This file is created with the command \\[org2rem-all-agenda-files].
-The file name should be absolute, the file will be overwritten without warning."
- :group 'org2rem
- :type 'file)
-
-(defcustom org-remind-combined-name "OrgMode"
- "Calendar name for the combined Remind representing all agenda files."
- :group 'org2rem
- :type 'string)
-
-(defcustom org-remind-use-deadline '(event-if-not-todo todo-due)
- "Contexts where Remind export should use a deadline time stamp.
-This is a list with several symbols in it. Valid symbol are:
-
-event-if-todo Deadlines in TODO entries become calendar events.
-event-if-not-todo Deadlines in non-TODO entries become calendar events.
-todo-due Use deadlines in TODO entries as due-dates"
- :group 'org2rem
- :type '(set :greedy t
- (const :tag "Deadlines in non-TODO entries become events"
- event-if-not-todo)
- (const :tag "Deadline in TODO entries become events"
- event-if-todo)
- (const :tag "Deadlines in TODO entries become due-dates"
- todo-due)))
-
-(defcustom org-remind-use-scheduled '(todo-start)
- "Contexts where Remind export should use a scheduling time stamp.
-This is a list with several symbols in it. Valid symbol are:
-
-event-if-todo Scheduling time stamps in TODO entries become an event.
-event-if-not-todo Scheduling time stamps in non-TODO entries become an event.
-todo-start Scheduling time stamps in TODO entries become start date.
- Some calendar applications show TODO entries only after
- that date."
- :group 'org2rem
- :type '(set :greedy t
- (const :tag
- "SCHEDULED timestamps in non-TODO entries become events"
- event-if-not-todo)
- (const :tag "SCHEDULED timestamps in TODO entries become events"
- event-if-todo)
- (const :tag "SCHEDULED in TODO entries become start date"
- todo-start)))
-
-(defcustom org-remind-categories '(local-tags category)
- "Items that should be entered into the categories field.
-This is a list of symbols, the following are valid:
-
-category The Org-mode category of the current file or tree
-todo-state The todo state, if any
-local-tags The tags, defined in the current line
-all-tags All tags, including inherited ones."
- :group 'org2rem
- :type '(repeat
- (choice
- (const :tag "The file or tree category" category)
- (const :tag "The TODO state" todo-state)
- (const :tag "Tags defined in current line" local-tags)
- (const :tag "All tags, including inherited ones" all-tags))))
-
-(defcustom org-remind-include-todo nil
- "Non-nil means export to remind files should also cover TODO items."
- :group 'org2rem
- :type '(choice
- (const :tag "None" nil)
- (const :tag "Unfinished" t)
- (const :tag "All" all)))
-
-(defcustom org-remind-include-sexps t
- "Non-nil means export to Remind files should also cover sexp entries.
-These are entries like in the diary, but directly in an Org-mode file."
- :group 'org2rem
- :type 'boolean)
-
-(defcustom org-remind-deadline-over-scheduled t
- "Non-nil means use deadline as target when both deadline and
-scheduled present, vice-versa. Default is Non-nil."
- :group 'org2rem
- :type 'boolean)
-
-(defcustom org-remind-escape-percentage t
- "Non-nil means % will be escaped, vice-versa. Default is Non-nil."
- :group 'org2rem
- :type 'boolean)
-
-(defcustom org-remind-extra-warn-days 3
- "Extra days Remind keep reminding."
- :group 'org2rem
- :type 'number)
-
-(defcustom org-remind-advanced-warn-days 3
- "Advanced days Remind start reminding."
- :group 'org2rem
- :type 'number)
-
-(defcustom org-remind-suppress-last-newline nil
- "Non-nil means suppress last newline REM body. Default is nil."
- :group 'org2rem
- :type 'boolean)
-
-(defcustom org-remind-include-body 100
- "Amount of text below headline to be included in Remind export.
-This is a number of characters that should maximally be included.
-Properties, scheduling and clocking lines will always be removed.
-The text will be inserted into the DESCRIPTION field."
- :group 'org2rem
- :type '(choice
- (const :tag "Nothing" nil)
- (const :tag "Everything" t)
- (integer :tag "Max characters")))
-
-(defcustom org-remind-store-UID nil
- "Non-nil means store any created UIDs in properties.
-The Remind standard requires that all entries have a unique identifyer.
-Org will create these identifiers as needed. When this variable is non-nil,
-the created UIDs will be stored in the ID property of the entry. Then the
-next time this entry is exported, it will be exported with the same UID,
-superceeding the previous form of it. This is essential for
-synchronization services.
-This variable is not turned on by default because we want to avoid creating
-a property drawer in every entry if people are only playing with this feature,
-or if they are only using it locally."
- :group 'org2rem
- :type 'boolean)
-
-;;;; Exporting
-
-;;; Remind export
-
-;;;###autoload
-(defun org2rem-this-file ()
- "Export current file as an Remind file.
-The Remind file will be located in the same directory as the Org-mode
-file, but with extension `.rem'."
- (interactive)
- (org2rem nil buffer-file-name))
-
-;;;###autoload
-(defun org2rem-all-agenda-files ()
- "Export all files in `org-agenda-files' to Remind .rem files.
-Each Remind file will be located in the same directory as the Org-mode
-file, but with extension `.rem'."
- (interactive)
- (apply 'org2rem nil (org-agenda-files t)))
-
-;;;###autoload
-(defun org2rem-combine-agenda-files ()
- "Export all files in `org-agenda-files' to a single combined Remind file.
-The file is stored under the name `org-combined-agenda-remind-file'."
- (interactive)
- (apply 'org2rem t (org-agenda-files t)))
-
-(defun org2rem (combine &rest files)
- "Create Remind files for all elements of FILES.
-If COMBINE is non-nil, combine all calendar entries into a single large
-file and store it under the name `org-combined-agenda-remind-file'."
- (save-excursion
- (org-prepare-agenda-buffers files)
- (let* ((dir (org-export-directory
- :ical (list :publishing-directory
- org-export-publishing-directory)))
- file rem-file rem-buffer category started org-agenda-new-buffers)
- (and (get-buffer "*rem-tmp*") (kill-buffer "*rem-tmp*"))
- (when combine
- (setq rem-file
- (if (file-name-absolute-p org-combined-agenda-remind-file)
- org-combined-agenda-remind-file
- (expand-file-name org-combined-agenda-remind-file dir))
- rem-buffer (org-get-agenda-file-buffer rem-file))
- (set-buffer rem-buffer) (erase-buffer))
- (while (setq file (pop files))
- (catch 'nextfile
- (org-check-agenda-file file)
- (set-buffer (org-get-agenda-file-buffer file))
- (unless combine
- (setq rem-file (concat (file-name-as-directory dir)
- (file-name-sans-extension
- (file-name-nondirectory buffer-file-name))
- ".rem"))
- (setq rem-buffer (org-get-agenda-file-buffer rem-file))
- (with-current-buffer rem-buffer (erase-buffer)))
- (setq category (or org-category
- (file-name-sans-extension
- (file-name-nondirectory buffer-file-name))))
- (if (symbolp category) (setq category (symbol-name category)))
- (let ((standard-output rem-buffer))
- (if combine
- (and (not started) (setq started t)
- (org-start-remind-file org-remind-combined-name))
- (org-start-remind-file category))
- (org-print-remind-entries combine)
- (when (or (and combine (not files)) (not combine))
- (org-finish-remind-file)
- (set-buffer rem-buffer)
- (run-hooks 'org-before-save-Remind-file-hook)
- (save-buffer)
- (run-hooks 'org-after-save-Remind-file-hook)
- (and (boundp 'org-wait) (numberp org-wait) (sit-for org-wait))
- ))))
- (org-release-buffers org-agenda-new-buffers))))
-
-(defvar org-before-save-Remind-file-hook nil
- "Hook run before an Remind file has been saved.
-This can be used to modify the result of the export.")
-
-(defvar org-after-save-Remind-file-hook nil
- "Hook run after an Remind file has been saved.
-The Remind buffer is still current when this hook is run.
-A good way to use this is to tell a desktop calenndar application to re-read
-the Remind file.")
-
-(defvar org-agenda-default-appointment-duration) ; defined in org-agenda.el
-(defun org-print-remind-entries (&optional combine)
- "Print Remind entries for the current Org-mode file to `standard-output'.
-When COMBINE is non nil, add the category to each line."
- (require 'org-agenda)
- (let ((re1 (concat org-ts-regexp "\\|<%%([^>\n]+>"))
- (re2 (concat "--?-?\\(" org-ts-regexp "\\)"))
- (dts (org-rem-ts-to-string
- (format-time-string (cdr org-time-stamp-formats) (current-time))
- "start time:"))
- hd ts ts2 state status (inc t) pos b sexp rrule
- scheduledp deadlinep todo prefix due start
- tmp pri categories entry location summary desc uid
- remind-aw remind-ew (org-rem-ew org-remind-extra-warn-days)
- (org-rem-aw org-remind-advanced-warn-days)
- trigger diff-days (dos org-remind-deadline-over-scheduled)
- (suppress-last-newline org-remind-suppress-last-newline)
- (sexp-buffer (get-buffer-create "*rem-tmp*")))
- (org-refresh-category-properties)
- (save-excursion
- (goto-char (point-min))
- (while (re-search-forward re1 nil t)
- (catch :skip
- (org-agenda-skip)
- (when (boundp 'org-remind-verify-function)
- (unless (funcall org-remind-verify-function)
- (outline-next-heading)
- (backward-char 1)
- (throw :skip nil)))
- (setq pos (match-beginning 0)
- ts (match-string 0)
- inc t
- hd (condition-case nil
- (org-remind-cleanup-string
- (org-get-heading))
- (error (throw :skip nil)))
- summary (org-remind-cleanup-string
- (org-entry-get nil "SUMMARY"))
- desc (org-remind-cleanup-string
- (or (org-entry-get nil "DESCRIPTION")
- (and org-remind-include-body (org-get-entry)))
- t org-remind-include-body)
- location (org-remind-cleanup-string
- (org-entry-get nil "LOCATION"))
- uid (if org-remind-store-UID
- (org-id-get-create)
- (or (org-id-get) (org-id-new)))
- categories (org-export-get-remind-categories)
- deadlinep nil scheduledp nil)
- (if (looking-at re2)
- (progn
- (goto-char (match-end 0))
- (setq ts2 (match-string 1)
- inc (not (string-match "[0-9]\\{1,2\\}:[0-9][0-9]" ts2))))
- (setq tmp (buffer-substring (max (point-min)
- (- pos org-ds-keyword-length))
- pos)
- ts2 (if (string-match "[0-9]\\{1,2\\}:[0-9][0-9]-\\([0-9]\\{1,2\\}:[0-9][0-9]\\)" ts)
- (progn
- (setq inc nil)
- (replace-match "\\1" t nil ts))
- ts)
- deadlinep (string-match org-deadline-regexp tmp)
- scheduledp (string-match org-scheduled-regexp tmp)
- todo (org-get-todo-state)
- ;; donep (org-entry-is-done-p)
- ))
- (when (and
- deadlinep
- (if todo
- (not (memq 'event-if-todo org-remind-use-deadline))
- (not (memq 'event-if-not-todo org-remind-use-deadline))))
- (throw :skip t))
- (when (and
- scheduledp
- (if todo
- (not (memq 'event-if-todo org-remind-use-scheduled))
- (not (memq 'event-if-not-todo org-remind-use-scheduled))))
- (throw :skip t))
- (setq prefix (if deadlinep "DEADLINE-" (if scheduledp "SCHEDULED-" "TS-")))
- (if (or (string-match org-tr-regexp hd)
- (string-match org-ts-regexp hd))
- (setq hd (replace-match "" t t hd)))
- (if (string-match "\\+\\([0-9]+\\)\\([dwmy]\\)>" ts)
- (setq rrule ;is recurrence value. later give it good name.
- (* (string-to-number
- (cdr (assoc
- (match-string 2 ts)
- '(("d" . "1")("w" . "7")
- ("m" . "0")("y" . "0")))))
- (string-to-number (match-string 1 ts))))
- (setq rrule nil))
- (setq summary (or summary hd))
- (if (string-match org-bracket-link-regexp summary)
- (setq summary
- (replace-match (if (match-end 3)
- (match-string 3 summary)
- (match-string 1 summary))
- t t summary)))
- (if deadlinep (setq summary (concat "DEADLINE: " summary)))
- (if scheduledp (setq summary (concat "SCHEDULED: " summary)))
- (if (string-match "\\`<%%" ts)
- (with-current-buffer sexp-buffer
- (insert (substring ts 1 -1) " " summary "\n"))
- (princ (format "\n## BEGIN:EVENT
-## UID: %s
-REM %s %s MSG EVENT:%s%s %s%s%%
-## CATEGORIES:%s
-## END:EVENT\n"
- (concat prefix uid)
- (org-rem-ts-to-string ts nil nil rrule)
- (org-rem-ts-to-string ts2 "UNTIL " inc)
- summary
- (if (and desc (string-match "\\S-" desc))
- (concat "%_\\\n" desc) "")
- (if (and location (string-match "\\S-" location))
- (concat "\nLOCATION: " location) "")
- (if suppress-last-newline "" "%_")
- categories)))))
-
- (when (and org-remind-include-sexps
- (condition-case nil (require 'remind) (error nil))
- (fboundp 'remind-export-region))
- ;; Get all the literal sexps
- (goto-char (point-min))
- (while (re-search-forward "^&?%%(" nil t)
- (catch :skip
- (org-agenda-skip)
- (setq b (match-beginning 0))
- (goto-char (1- (match-end 0)))
- (forward-sexp 1)
- (end-of-line 1)
- (setq sexp (buffer-substring b (point)))
- (with-current-buffer sexp-buffer
- (insert sexp "\n"))))
- ;; (princ (org-diary-to-rem-string sexp-buffer))
- (kill-buffer sexp-buffer))
-
- (when org-remind-include-todo
- (setq prefix "TODO-")
- (goto-char (point-min))
- (while (re-search-forward org-todo-line-regexp nil t)
- (catch :skip
- (org-agenda-skip)
- (when (boundp 'org-remind-verify-function)
- (unless (funcall org-remind-verify-function)
- (outline-next-heading)
- (backward-char 1)
- (throw :skip nil)))
- (setq state (match-string 2))
- (setq status (if (member state org-done-keywords)
- "COMPLETED" "NEEDS-ACTION"))
- (when (and state
- (or (not (member state org-done-keywords))
- (eq org-remind-include-todo 'all))
- (not (member org-archive-tag (org-get-tags-at)))
- )
- (setq hd (match-string 3)
- summary (org-remind-cleanup-string
- (org-entry-get nil "SUMMARY"))
- desc (org-remind-cleanup-string
- (or (org-entry-get nil "DESCRIPTION")
- (and org-remind-include-body (org-get-entry)))
- t org-remind-include-body)
- location (org-remind-cleanup-string
- (org-entry-get nil "LOCATION"))
- due (and (member 'todo-due org-remind-use-deadline)
- (org-entry-get nil "DEADLINE"))
- start (and (member 'todo-start org-remind-use-scheduled)
- (org-entry-get nil "SCHEDULED"))
- categories (org-export-get-remind-categories)
- uid (if org-remind-store-UID
- (org-id-get-create)
- (or (org-id-get) (org-id-new))))
-
- (if (and due start)
- (setq diff-days (org-rem-time-diff-days due start)))
-
- (setq remind-aw
- (if due
- (if diff-days
- (if (> diff-days 0)
- (if dos diff-days 0)
- (if dos 0 diff-days))
- 1000)))
-
- (if (and (numberp org-rem-aw) (> org-rem-aw 0))
- (setq remind-aw (+ (or remind-aw 0) org-rem-aw)))
-
- (setq remind-ew
- (if due
- (if diff-days
- (if (> diff-days 0) due nil)
- due)))
-
- (setq trigger (if dos (if due due start) (if start start due)))
- ;; (and trigger (setq trigger (org-rem-ts-to-string trigger nil nil 1 remind-aw)))
- (if trigger
- (setq trigger (concat
- (format "[trigger('%s')] *%d "
- (org-rem-ts-to-remind-date-type trigger) 1)
- (if remind-aw (format "++%d" remind-aw)))))
- (and due (setq due (org-rem-ts-to-remind-date-type due)))
- (and start (setq start (org-rem-ts-to-remind-date-type start)))
- (and remind-ew (setq remind-ew (org-rem-ts-to-remind-date-type remind-ew)))
-
- (if (string-match org-bracket-link-regexp hd)
- (setq hd (replace-match (if (match-end 3) (match-string 3 hd)
- (match-string 1 hd))
- t t hd)))
- (if (string-match org-priority-regexp hd)
- (setq pri (string-to-char (match-string 2 hd))
- hd (concat (substring hd 0 (match-beginning 1))
- (substring hd (match-end 1))))
- (setq pri org-default-priority))
- (setq pri (floor (1+ (* 8. (/ (float (- org-lowest-priority pri))
- (- org-lowest-priority org-highest-priority))))))
-
- (princ (format "\n## BEGIN:TODO
-## UID: %s
-REM %s %s %s MSG TODO: %s%s%s%s%s%s%%
-## CATEGORIES:%s
-## SEQUENCE:1
-## STATUS:%s
-## END:TODO\n"
- (concat prefix uid)
- (or trigger "") ;; dts)
- (if remind-ew (format "UNTIL [trigger('%s' + %d)]" remind-ew (or org-rem-ew 0)) "")
- (if pri (format "PRIORITY %d" pri) "")
- (or summary hd)
- (if (and desc (string-match "\\S-" desc))
- (concat "%_\\\nDESCRIPTION: " desc) "")
- (if (and location (string-match "\\S-" location))
- (concat "LOCATION: " location) "")
- (if start
- (concat
- "%_\\\n['" start "' - today()] "
- "days over, for scheduled date - "
- "[trigger('" start "')]") "")
- (if due
- (concat
- "%_\\\n[today() - '" due "'] "
- "days left, to deadline date - "
- "[trigger('" due "')]") "")
- (if suppress-last-newline "" "%_")
- categories
- status)))))))))
-
-(defun org-export-get-remind-categories ()
- "Get categories according to `org-remind-categories'."
- (let ((cs org-remind-categories) c rtn tmp)
- (while (setq c (pop cs))
- (cond
- ((eq c 'category) (push (org-get-category) rtn))
- ((eq c 'todo-state)
- (setq tmp (org-get-todo-state))
- (and tmp (push tmp rtn)))
- ((eq c 'local-tags)
- (setq rtn (append (nreverse (org-get-local-tags-at (point))) rtn)))
- ((eq c 'all-tags)
- (setq rtn (append (nreverse (org-get-tags-at (point))) rtn)))))
- (mapconcat 'identity (nreverse rtn) ",")))
-
-(defun org-remind-cleanup-string (s &optional is-body maxlength)
- "Take out stuff and quote what needs to be quoted.
-When IS-BODY is non-nil, assume that this is the body of an item, clean up
-whitespace, newlines, drawers, and timestamps, and cut it down to MAXLENGTH
-characters."
- (if (or (not s) (string-match "^[ \t\n]*$" s))
- nil
- (when is-body
- (let ((re (concat "\\(" org-drawer-regexp "\\)[^\000]*?:END:.*\n?"))
- (re2 (concat "^[ \t]*" org-keyword-time-regexp ".*\n?")))
- (while (string-match re s) (setq s (replace-match "" t t s)))
- (while (string-match re2 s) (setq s (replace-match "" t t s)))))
- (if org-remind-escape-percentage
- (let ((start 0))
- (while (string-match "\\([%]\\)" s start)
- (setq start (+ (match-beginning 0) 2)
- s (replace-match "\\1\\1" nil nil s)))))
-
- (let ((start 0))
- (while (string-match "\\([\n]\\)" s start)
- (setq start (+ (match-beginning 0) 4) ;; less than 4 is not correct.
- s (replace-match "%_\\\\\\1" nil nil s))))
-
- (let ((start 0))
- (while (string-match "\\([[]\\)" s start)
- (setq start (+ (match-beginning 0) 5)
- s (replace-match (concat "\[" "\"" "\\1" "\"" "\]") nil nil s))))
-
-;;; (when is-body
-;;; (while (string-match "[ \t]*\n[ \t]*" s)
-;;; (setq s (replace-match "%_" t t s))))
-
- (setq s (org-trim s))
- (if is-body
- (if maxlength
- (if (and (numberp maxlength)
- (> (length s) maxlength))
- (setq s (substring s 0 maxlength)))))
- s))
-
-(defun org-get-entry ()
- "Clean-up description string."
- (save-excursion
- (org-back-to-heading t)
- (buffer-substring (point-at-bol 2) (org-end-of-subtree t))))
-
-(defun org-start-remind-file (name)
- "Start an Remind file by inserting the header."
- (let ((user user-full-name)
- (name (or name "unknown"))
- (timezone (cadr (current-time-zone))))
- (princ
- (format "# -*- Mode: shell-script; auto-fill-mode: nil -*-
-## BEGIN: Reminders
-## VERSION:2.0
-## Emacs with Org-mode
-## Calendar:%s
-## Created by: %s
-## Timezone:%s
-## Calscale:Gregorian\n" name user timezone))))
-
-(defun org-finish-remind-file ()
- "Finish an Remind file by inserting the END statement."
- (princ "\n## END:Reminders\n"))
-
-(defun org-rem-ts-to-remind-date-type (s)
- (format-time-string
- "%Y-%m-%d"
- (apply 'encode-time (butlast (org-parse-time-string s) 3))))
-
-;; (defun org-rem-date-type-to-string (s keyword &optional inc day-repeat day-advance-warn)
-;; (if trigger
-;; (setq trigger
-;; (concat
-;; (format "[trigger('%s')] *%d "
-;; (org-rem-ts-to-remind-date-type trigger) day-repeat)
-;; (if day-advance-warn (format "++%d" day-advance-warn))))))
-
-;; (format-time-string "%Y"
-;; (apply 'encode-time (butlast (org-parse-time-string "<2008-11-20 Thu 10:30>") 3)))
-
-(defun org-rem-ts-to-string (s keyword &optional inc day-repeat day-advance-warn)
- "Take a time string S and convert it to Remind format.
-KEYWORD is added in front, to make a complete line like DTSTART....
-When INC is non-nil, increase the hour by two (if time string contains
-a time), or the day by one (if it does not contain a time)."
- (let ((t1 (org-parse-time-string s 'nodefault))
- t2 fmt have-time time)
- (if (and (car t1) (nth 1 t1) (nth 2 t1))
- (setq t2 t1 have-time t)
- (setq t2 (org-parse-time-string s)))
- (let ((s (car t2)) (mi (nth 1 t2)) (h (nth 2 t2))
- (d (nth 3 t2)) (m (nth 4 t2)) (y (nth 5 t2)))
- (when inc
- (if have-time
- (if org-agenda-default-appointment-duration
- (setq mi (+ org-agenda-default-appointment-duration mi))
- (setq h (+ 2 h)))
- (setq d (1+ d))))
- (setq time (encode-time s mi h d m y)))
- (setq fmt (concat
- "%d %b %Y"
- (if day-advance-warn (format " ++%d" day-advance-warn))
- (if day-repeat (format " *%d" day-repeat))
- (if have-time " AT %H:%M")))
- (concat keyword (format-time-string fmt time))))
-
-(defun org-rem-time-diff-days (end start)
- (floor (/ (apply '- (mapcar
- (lambda (s)
- (let*
- ((t1 (org-parse-time-string s))
- (s (car t1)) (mi (nth 1 t1))
- (h (nth 2 t1)) (d (nth 3 t1))
- (m (nth 4 t1)) (y (nth 5 t1)))
- (float-time (encode-time s mi h d m y))))
- (list end start))) (* 24 60 60))))
-
-(provide 'org2rem)
-
-;; arch-tag: 65985fe9-095c-49c7-a7b6-cb4ee15c0a95
-
-;;; org-exp.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/orgtbl-sqlinsert.el b/.emacs.d/org-7.4/contrib/lisp/orgtbl-sqlinsert.el
deleted file mode 100644
index 648e44c..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/orgtbl-sqlinsert.el
+++ /dev/null
@@ -1,115 +0,0 @@
-;;; orgtbl-sqlinsert.el --- orgtbl to SQL insert statements.
-
-;; Copyright (C) 2008 Free Software Foundation
-
-;; Author: Jason Riedy <jason@acm.org>
-;; Keywords: org, tables, sql
-
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Converts an orgtbl to a sequence of SQL insertion commands.
-;; Table cells are quoted and escaped very conservatively.
-
-;;; Code:
-
-(defun orgtbl-to-sqlinsert (table params)
- "Convert the orgtbl-mode TABLE to SQL insert statements.
-TABLE is a list, each entry either the symbol `hline' for a horizontal
-separator line, or a list of fields for that line.
-PARAMS is a property list of parameters that can influence the conversion.
-
-Names and strings are modified slightly by default. Single-ticks
-are doubled as per SQL's standard mechanism. Backslashes and
-dollar signs are deleted. And tildes are changed to spaces.
-These modifications were chosed for use with TeX. See
-ORGTBL-SQL-STRIP-AND-QUOTE.
-
-Supports all parameters from ORGTBL-TO-GENERIC. New to this function
-are:
-
-:sqlname The name of the database table; defaults to the name of the
- target region.
-
-:nowebname If not nil, used as a wrapping noweb fragment name.
-
-The most important parameters of ORGTBL-TO-GENERIC for SQL are:
-
-:splice When set to t, return only insert statements, don't wrap
- them in a transaction. Default is nil.
-
-:tstart, :tend
- The strings used to begin and commit the transaction.
-
-:hfmt A function that gathers the quoted header names into a
- dynamically scoped variable HDRLIST. Probably should
- not be changed by the user.
-
-The general parameters :skip and :skipcols have already been applied when
-this function is called."
- (let* (hdrlist
- (alignment (mapconcat (lambda (x) (if x "r" "l"))
- org-table-last-alignment ""))
- (nowebname (plist-get params :nowebname))
- (breakvals (plist-get params :breakvals))
- (firstheader t)
- (*orgtbl-default-fmt* 'orgtbl-sql-strip-and-quote)
- (params2
- (list
- :sqlname name
- :tstart (lambda () (concat (if nowebname
- (format "<<%s>>= \n" nowebname)
- "")
- "BEGIN TRANSACTION;"))
- :tend (lambda () (concat "COMMIT;" (if nowebname "\n@ " "")))
- :hfmt (lambda (f) (progn (if firstheader (push f hdrlist)) ""))
- :hlfmt (lambda (lst) (setq firstheader nil))
- :lstart (lambda () (concat "INSERT INTO "
- sqlname "( "
- (mapconcat 'identity (reverse hdrlist)
- ", ")
- " )" (if breakvals "\n" " ")
- "VALUES ( "))
- :lend " );"
- :sep " , "
- :hline nil
- :remove-nil-lines t))
- (params (org-combine-plists params2 params))
- (sqlname (plist-get params :sqlname)))
- (orgtbl-to-generic table params)))
-
-(defun orgtbl-sql-quote (str)
- "Convert single ticks to doubled single ticks and wrap in single ticks."
- (concat "'" (mapconcat 'identity (split-string str "'") "''") "'"))
-
-(defun orgtbl-sql-strip-dollars-escapes-tildes (str)
- "Strip dollarsigns and backslash escapes, replace tildes with spaces."
- (mapconcat 'identity
- (split-string (mapconcat 'identity
- (split-string str "\\$\\|\\\\")
- "")
- "~")
- " "))
-
-(defun orgtbl-sql-strip-and-quote (str)
- "Apply ORGBTL-SQL-QUOTE and ORGTBL-SQL-STRIP-DOLLARS-ESCAPES-TILDES
-to sanitize STR for use in SQL statements."
- (cond ((stringp str)
- (orgtbl-sql-quote (orgtbl-sql-strip-dollars-escapes-tildes str)))
- ((sequencep str) (mapcar 'orgtbl-sql-strip-and-quote str))
- (t nil)))
-
-(provide 'orgtbl-sqlinsert)
-;;; orgtbl-sqlinsert.el ends here
diff --git a/.emacs.d/org-7.4/contrib/lisp/test-org-export-preproc.el b/.emacs.d/org-7.4/contrib/lisp/test-org-export-preproc.el
deleted file mode 100644
index 3af8461..0000000
--- a/.emacs.d/org-7.4/contrib/lisp/test-org-export-preproc.el
+++ /dev/null
@@ -1,39 +0,0 @@
-(require 'org-export-generic)
-
-(defun test-preproc ()
- (interactive)
- (let ((string
- (let ((region
- (buffer-substring
- (if (org-region-active-p) (region-beginning) (point-min))
- (if (org-region-active-p) (region-end) (point-max))))
- (opt-plist (org-combine-plists (org-default-export-plist)
- (org-infile-export-plist)))
- (export-plist '("tikiwiki" :file-suffix ".txt" :key-binding 85 :header-prefix "" :header-suffix "" :title-format "-= %s =-\n" :date-export nil :toc-export nil :body-header-section-numbers nil :body-section-prefix "\n" :body-section-header-prefix
- ("! " "!! " "!!! " "!!!! " "!!!!! " "!!!!!! " "!!!!!!! ")
- :body-section-header-suffix
- (" \n" " \n" " \n" " \n" " \n" " \n")
- :body-line-export-preformated t :body-line-format "%s " :body-line-wrap nil :body-line-fixed-format " %s\n" :body-list-format "* %s\n" :body-number-list-format "# %s\n" :blockquote-start "\n^\n" :blockquote-end "^\n\n" :body-newline-paragraph "\n" :bold-format "__%s__" :italic-format "''%s''" :underline-format "===%s===" :strikethrough-format "--%s--" :code-format "-+%s+-" :verbatim-format "~pp~%s~/pp~")))
- (org-export-preprocess-string
- region
- :for-ascii t
- :skip-before-1st-heading
- (plist-get opt-plist :skip-before-1st-heading)
- :drawers (plist-get export-plist :drawers-export)
- :tags (plist-get export-plist :tags-export)
- :priority (plist-get export-plist :priority-export)
- :footnotes (plist-get export-plist :footnotes-export)
- :timestamps (plist-get export-plist :timestamps-export)
- :todo-keywords (plist-get export-plist :todo-keywords-export)
- :verbatim-multiline t
- :select-tags (plist-get export-plist :select-tags-export)
- :exclude-tags (plist-get export-plist :exclude-tags-export)
- :emph-multiline t
- :archived-trees
- (plist-get export-plist :archived-trees-export)
- :add-text (plist-get opt-plist :text)))))
- (save-excursion
- (switch-to-buffer "*preproc-temp*")
- (point-max)
- (insert string))))
-
diff --git a/.emacs.d/org-7.4/contrib/scripts/.DS_Store b/.emacs.d/org-7.4/contrib/scripts/.DS_Store
deleted file mode 100644
index 5008ddf..0000000
--- a/.emacs.d/org-7.4/contrib/scripts/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/contrib/scripts/.gitignore b/.emacs.d/org-7.4/contrib/scripts/.gitignore
deleted file mode 100644
index 20d5925..0000000
--- a/.emacs.d/org-7.4/contrib/scripts/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-plantuml.jar
diff --git a/.emacs.d/org-7.4/contrib/scripts/StartOzServer.oz b/.emacs.d/org-7.4/contrib/scripts/StartOzServer.oz
deleted file mode 100644
index 4d5144e..0000000
--- a/.emacs.d/org-7.4/contrib/scripts/StartOzServer.oz
+++ /dev/null
@@ -1,220 +0,0 @@
-%%% *************************************************************
-%%% Copyright (C) 2009 Torsten Anders (www.torsten-anders.de)
-%%% This program is free software; you can redistribute it and/or
-%%% modify it under the terms of the GNU General Public License
-%%% as published by the Free Software Foundation; either version 2
-%%% of the License, or (at your option) any later version.
-%%% This program is distributed in the hope that it will be useful,
-%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
-%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-%%% GNU General Public License for more details.
-%%% *************************************************************
-
-%%
-%% This code implements the Oz-side of the Org-babel Oz interface. It
-%% creates a socket server (to which org-babel-oz.el then
-%% connects). Any input to this socket must be an Oz expression. The
-%% input is fed to the OPI oz compiler, and the results are send back
-%% via the socket.
-%%
-
-
-declare
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%
-%% Accessing the OPI compiler
-%%
-
-MyCompiler = Emacs.condSend.compiler
-
-
-/* % testing
-
-%% Feed an expression (result browsed)
-{MyCompiler enqueue(setSwitch(expression true))}
-{Browse
- {MyCompiler enqueue(feedVirtualString("1 + 2" return(result: $)))}}
-{MyCompiler enqueue(setSwitch(expression false))}
-
-%% It is really the OPI: I can use declare!
-{MyCompiler enqueue(setSwitch(expression false))}
-{MyCompiler enqueue(feedVirtualString("declare X=3\n{Browse X*X}"))}
-
-%% Note: expressions starting with keyword declare need keyword in
-{MyCompiler enqueue(setSwitch(expression true))}
-{Browse
- {MyCompiler enqueue(feedVirtualString("declare X=3\nin X*X" return(result: $)))}}
-{MyCompiler enqueue(setSwitch(expression false))}
-
-%% Alternatively you use a session with multiple feeds: first declare (statement), and then feed an expression
-{MyCompiler enqueue(setSwitch(expression false))}
-{MyCompiler enqueue(feedVirtualString("declare X=7" return))}
-{MyCompiler enqueue(setSwitch(expression true))}
-{Browse
- {MyCompiler enqueue(feedVirtualString("X*X" return(result: $)))}}
-{MyCompiler enqueue(setSwitch(expression false))}
-
-%% !!?? does not work?
-%% return nil in case of any error (division by 0)
-{MyCompiler enqueue(setSwitch(expression true))}
-{Browse
- {MyCompiler enqueue(feedVirtualString(
- {LUtils.accum ["try\n"
-% "skip\n" % do something in any case..
- "1 div 0" % my code
-% "1" % my code
- "\ncatch E then {Error.printException E}\n"
- "error\n" % always return nil
- "end\n"]
- List.append}
- return(result: $)))}}
-{MyCompiler enqueue(setSwitch(expression false))}
-
-
-%% !! catching some exceptions does not work??
-
-%% exception is not catched
-try {Bla} catch E then {Error.printException E} {Browse nil} end
-
-%% exception is catched
-try {Browse 1 div 0} catch E then {Error.printException E} {Browse nil} end
-{Browse ok}
-
-
-*/
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%
-%% Socket interface
-%%
-
-
-%%
-%% Create socket
-%%
-
-MyPort = 6001
-
-/** %% Creates a TCP socket server. Expects a Host (e.g., 'localhost') and a PortNo and returns a server plus its corresponding client. This client is an instance of Open.socket, and is the interface for reading and writing into the socket.
-%% MakeServer blocks until the server listens. However, waiting until a connection has been accepted happens in its own thread (i.e. MakeServer does only block until the server listens).
-%% NB: A port can be used only once, so assign it carefully. In case this postnnumber was shortly used before, you may need to wait a bit before reusing it.
-%% */
-%% !! Alternatively, let it assign automatically and output the port number..
-%%
-%% NOTE: for supporting multiple connections see http://www.mozart-oz.org/documentation/op/node13.html#section.sockets.accept
-proc {MakeServer Host PortNo ?MyServer ?MyClient}
- proc {Accept MyClient}
- thread H in % P
- %% suspends until a connection has been accepted
- {MyServer accept(host:H
- acceptClass:Open.socket
- accepted:?MyClient)}
-% {Myserver accept(host:H port:P)} % suspends until a connection has been accepted
- %% !!?? port number of client is usually created randomly..
- {System.showInfo "% connection accepted from host "#H}
- end
- %% !!???
- %% If Accept is called recursively, then server accepts multiple connections. These share the same compiler instance (e.g. variable bindings are shared). For multiple independent compiler instances call the OzServer application multiple times.
- %% However, how shall the output for multiple connections be sorted?? Would using the different client sockets created with the Server accept method work?
- %% NB: The number of clients accepted concurrently must be limited to the number set by {MyServer listen}
- % {Accept}
- end
-in
- MyServer = {New Open.socket init}
- %% To avoid problems with portnumbers, the port could be assigned automatically and then output..
- %%{MyServer bind(port:PortNo)}
- {MyServer bind(host:Host takePort:PortNo)}
- {MyServer listen}
- {System.showInfo "% OzServer started at host "#Host#" and port "#PortNo}
- MyClient = {Accept}
-end
-%%
-MySocket = {MakeServer localhost MyPort _/*MyServer*/}
-
-
-%%
-%% Read socket input
-%%
-
-declare
-%% Copied from OzServer/source/Socket.oz
-local
- proc {Aux Socket Size Stream}
- In = {Socket read(list:$
- size:Size)}
- in
- {Wait In}
- %% !! Is this the right way to stop the processing??
- %%
- %% abort condition when client stream ended (i.e. nothing was sent)
- if In == nil
- then {System.showInfo "socket stream ended"}
- Stream = nil
- else Stream = In | {Aux Socket Size}
- end
- end
-in
- /** %% The socket Server returns a stream of the strings it receives. The Server always waits until someone writes something into the socket, then the input is immediately written to a stream and the Server waits again.
- %% */
- proc {ReadToStream Socket Size Xs}
- thread {Aux Socket Size Xs} end
- end
-end
-
-/* % test
-
-MyStream = {ReadToStream MySocket 1024}
-
-*/
-
-/* % test
-
-%% writing
-{MySocket write(vs:"this is a test")}
-
-*/
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%
-%% Send socket input to compiler and send results back to socket
-%%
-
-%% NOTE: Input code must be expression
-thread
- {ForAll {ReadToStream MySocket 1024}
- proc {$ Code}
- Result
- %% Catch any exception (so the will not cause blocking) and return nil in that case
- FullCode = {LUtils.accum ["try\n"
-% "skip\n" % do something in any case..
- Code
- "\ncatch E then {Error.printException E}\n"
- "error\n" % in case of an error, return 'error'
- "end\n"]
- List.append}
- in
- %% ?? Should I make setting switches etc atomic?
- {MyCompiler enqueue(setSwitch(expression true))}
- Result = {MyCompiler enqueue(feedVirtualString(FullCode return(result: $)))}
- {MyCompiler enqueue(setSwitch(expression false))}
- %%
- {Wait Result}
- {MySocket write(vs: if {VirtualString.is Result}
- then Result
- else {Value.toVirtualString Result 1000 1000}
- end)}
- {Show 'Org-babel result: '#Result}
- end}
-end
-
-
-
-
-
-
-
-
-
diff --git a/.emacs.d/org-7.4/contrib/scripts/dir2org.zsh b/.emacs.d/org-7.4/contrib/scripts/dir2org.zsh
deleted file mode 100755
index f91ff17..0000000
--- a/.emacs.d/org-7.4/contrib/scripts/dir2org.zsh
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/env zsh
-
-# desc:
-#
-# Output an org compatible structure representing the filesystem from
-# the point passed on the command line (or . by default).
-#
-# options:
-# none
-#
-# usage:
-# dir2org.zsh [DIR]...
-#
-# author:
-# Phil Jackson (phil@shellarchive.co.uk)
-
-set -e
-
-function headline {
- local depth="${1}"
- local text="${2}"
-
- printf "%${depth}s %s" "" | tr ' ' '*'
- echo " ${text}"
-}
-
-function scan_and_populate {
- local depth="${1}"
- local dir="${2}"
-
- headline ${depth} "${dir}"
-
- # if there is no files in dir then just move on
- [[ $(ls "${dir}" | wc -l) -eq 0 ]] && return
-
- (( depth += 1 ))
-
- for f in $(ls -d "${dir}"/*); do
- if [ -d "${f}" ]; then
- scan_and_populate ${depth} "${f}"
- else
- headline ${depth} "[[file://${f}][${${f##*/}%.*}]]"
- fi
- done
-
- (( depth -= 1 ))
-}
-
-function main {
- local scan_dir="${1:-$(pwd)}"
- local depth=0
-
- scan_and_populate ${depth} "${scan_dir}"
-}
-
-main "${@}"
diff --git a/.emacs.d/org-7.4/contrib/scripts/ditaa.jar b/.emacs.d/org-7.4/contrib/scripts/ditaa.jar
deleted file mode 100644
index 6f10d4e..0000000
--- a/.emacs.d/org-7.4/contrib/scripts/ditaa.jar
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/contrib/scripts/org2hpda b/.emacs.d/org-7.4/contrib/scripts/org2hpda
deleted file mode 100755
index 6b308f3..0000000
--- a/.emacs.d/org-7.4/contrib/scripts/org2hpda
+++ /dev/null
@@ -1,106 +0,0 @@
-# org2hpda - a small utility to generate hipster pda style printouts from org mode
-# Copyright (C) 2007 Christian Egli
-#
-# Version: 0.6
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# Commentary:
-# ===========
-#
-# set cal-tex-diary to true so that diary entries show up in the calendar
-#
-# Usage:
-# ======
-#
-# run this makefile with
-#
-# make -f org2hpda
-#
-# The makfile will take the entries from your diary file and generate
-# two PDFs containing nicely printed weekly and monthly calendars. One
-# is done in the style of a pocketMod (http://www.pocketmod.com/) and
-# the other is done in the style of the Hipster PDA
-# (http://en.wikipedia.org/wiki/Hipster_PDA).
-#
-# Requirements:
-# =============
-#
-# the pdf* commands are part of the pdfjam package which can be found
-# at http://www.warwick.ac.uk/go/pdfjam
-
-EMACS = emacs -batch -l ~/.emacs
-LATEX = latex
-DIARY = $($(EMACS) -eval "diary-file")
-
-# Number of weeks to be printed. Should be a multiple of 4, because 4
-# of them are merged on one page. Can be set when invoking the script
-# as follows: make NUMBER_OF_WEEKS=8 -f org2hpda
-NUMBER_OF_WEEKS = 4
-
-hipsterFiles = weekCalendar.pdf yearCalendar.pdf monthCalendar3.pdf monthCalendar2.pdf monthCalendar1.pdf
-pocketModFiles = weekCalendar.pdf yearCalendar-rotated.pdf \
- monthCalendar3-rotated.pdf monthCalendar2-rotated.pdf monthCalendar1-rotated.pdf
-
-all: pocketMod.pdf hipsterPDA.pdf
-
-%.dvi: %.tex
- # Quick hack to massage the LaTeX produced by cal-tex
- # quote '@', then increase font size of week calendars,
- # increase font of diary entries in moth calendar and
- # finally reduce links to their destination, i.e.
- # change '[[http://foo][bar]]' to 'bar'
- sed -e 's/\\verb|@|/\@/g' \
- -e 's/documentclass\[11pt\]/documentclass[12pt]/g' \
- -e 's/{\\tiny \\raggedright #3}/{\\small \\raggedright #3}/g' \
- -e 's/\[\[[^]]\+\]\[\([^]]\+\)\]\]/\1/g' \
- < $< > /tmp/temp-org-file.$$$$; mv /tmp/temp-org-file.$$$$ $<
- $(LATEX) $^
-
-%.pdf: %.dvi
- dvipdf $^
-
-%-rotated.pdf: %.pdf
- cp $^ $@
- for n in 1 2 3; do \
- pdf90 --outfile tmp.pdf $@; mv tmp.pdf $@; \
- done
-
-weekCalendar.tex: $(DIARY)
- $(EMACS) -eval "(progn (calendar) (cal-tex-cursor-week-iso $(NUMBER_OF_WEEKS)) (with-current-buffer cal-tex-buffer (write-file \"$@\")))"
-
-monthCalendar1.tex: $(DIARY)
- $(EMACS) -eval "(progn (calendar) (cal-tex-cursor-month-landscape 1) (with-current-buffer cal-tex-buffer (write-file \"$@\")))"
-
-monthCalendar2.tex: $(DIARY)
- $(EMACS) -eval "(progn (calendar) (calendar-forward-month 1) (cal-tex-cursor-month-landscape 1) (with-current-buffer cal-tex-buffer (write-file \"$@\")))"
-
-monthCalendar3.tex: $(DIARY)
- $(EMACS) -eval "(progn (calendar) (calendar-forward-month 2) (cal-tex-cursor-month-landscape 1) (with-current-buffer cal-tex-buffer (write-file \"$@\")))"
-
-yearCalendar.tex: $(DIARY)
- $(EMACS) -eval "(progn (calendar) (calendar-forward-month 2) (cal-tex-cursor-year-landscape 1) (with-current-buffer cal-tex-buffer (write-file \"$@\")))"
-
-pocketMod.pdf: $(pocketModFiles)
- pdfjoin --outfile tmp.pdf $^
- pdfnup tmp.pdf --outfile $@ --nup 4x2 --frame true
-
-hipsterPDA.pdf: $(hipsterFiles)
- pdfnup weekCalendar.pdf --outfile page1.pdf --nup 2x2 --frame true
- pdfjoin --outfile tmp.pdf monthCalendar[1-3]-rotated.pdf yearCalendar-rotated.pdf
- pdfnup tmp.pdf --outfile page2.pdf --nup 2x2 --frame true
- pdfjoin --outfile $@ page1.pdf page2.pdf
-
-clean:
- rm -rf *.aux *.dvi *.tex *.log *.pdf
diff --git a/.emacs.d/org-7.4/contrib/scripts/staticmathjax/.gitignore b/.emacs.d/org-7.4/contrib/scripts/staticmathjax/.gitignore
deleted file mode 100644
index b25c15b..0000000
--- a/.emacs.d/org-7.4/contrib/scripts/staticmathjax/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-*~
diff --git a/.emacs.d/org-7.4/contrib/scripts/staticmathjax/README.org b/.emacs.d/org-7.4/contrib/scripts/staticmathjax/README.org
deleted file mode 100644
index d28fc90..0000000
--- a/.emacs.d/org-7.4/contrib/scripts/staticmathjax/README.org
+++ /dev/null
@@ -1,79 +0,0 @@
-Static MathJax v0.1 README
-#+AUTHOR: Jan Böcker <jan.boecker@jboecker.de>
-
-Static MathJax is a XULRunner application which loads a HTML input
-file that uses MathJax into a browser, waits until MathJax is done
-processing, and then writes the formatted result to an output HTML
-file.
-
-I have only tested exports from Emacs Org-mode as input files. (As of
-2010-08-14, MathJax is used by default with HTML exports in the
-current Org development version.)
-
-Optionally, references to the math fonts used will be converted to
-"data:" URIs, thus embedding the font data into the HTML file itself.
-(see [[http://en.wikipedia.org/wiki/Data_URI_scheme]])
-
-The code is licensed under the GNU General Public License version
-2, or, at your option, any later version.
-
-
-* Usage
- To run Static MathJax, an existing XULRunner installation is
- required. From the directory to which you unpacked Static MathJax,
- run:
-
- xulrunner application.ini <--embed-fonts | --final-mathjax-url <URL>>
- <input file> <output file>
-
- If you prefer to call "staticmathjax" instead of "xulrunner
- application.ini", link xulrunner-stub into the directory:
- ln /usr/lib/xulrunner-1.9.2.8/xulrunner-stub ./staticmathjax
-
- - input file ::
- name of the input file (the result of a HTML export
- from Org-mode). It is assumed that this file uses the
- UTF-8 character encoding.
-
- - output file ::
- name of the output file.
-
- - --embed-fonts ::
- if specified, the math fonts will be embedded into
- the output file using data: URIs
-
- - --final-mathjax-url <URL> ::
- if --embed-fonts is not specified, this
- must be the URL to a MathJax installation folder (e.g. "MathJax"
- if MathJax is installed in a subdirectory, or
- "http://orgmode.org/mathjax" to use the version hosted on the Org
- website.
-
- All references to math fonts in the output file will point to
- this directory.
-
-* Caveats
-
- The input file must not use a MathJax installation on the
- web. Otherwise, due to a security feature of Firefox, MathJax will
- fallback to image fonts. If you have unpacked MathJax to a
- subdirectory "MathJax", specify the following in your Org file:
-
- #+MathJax: path:"MathJax"
-
- The math is rendered in Firefox, so MathJax applies its
- Firefox-specific settings. When viewing the output files in other
- browsers, it will look slightly different than the result that
- running MathJax in that browser would produce.
-
- Internet Explorer does not use the correct font, because it only
- supports the EOT font format. For all other browsers (including
- Firefox), MathJax uses the OTF font format.
-
- Embedding fonts into the HTML file wastes some space due to the
- base64 encoding used in data: URIs.
-
- I have found no way to access stdout or set an exit code in an
- XULRunner app, so any code which calls Static MathJax has no idea if
- processing was successful and when an error occurs, graphical
- message boxes are displayed.
diff --git a/.emacs.d/org-7.4/contrib/scripts/staticmathjax/README.txt b/.emacs.d/org-7.4/contrib/scripts/staticmathjax/README.txt
deleted file mode 100644
index cbcaea1..0000000
--- a/.emacs.d/org-7.4/contrib/scripts/staticmathjax/README.txt
+++ /dev/null
@@ -1,91 +0,0 @@
- Static MathJax v0.1 README
- ==========================
-
-Author: Jan Böcker <jan.boecker@jboecker.de>
-Date: 2010-08-15 13:53:39 CEST
-
-
-Static MathJax is a XULRunner application which loads a HTML input
-file that uses MathJax into a browser, waits until MathJax is done
-processing, and then writes the formatted result to an output HTML
-file.
-
-I have only tested exports from Emacs Org-mode as input files. (As of
-2010-08-14, MathJax is used by default with HTML exports in the
-current Org development version.)
-
-Optionally, references to the math fonts used will be converted to
-"data:" URIs, thus embedding the font data into the HTML file itself.
-(see [http://en.wikipedia.org/wiki/Data_URI_scheme])
-
-The code is licensed under the GNU General Public License version
-2, or, at your option, any later version.
-
-
-Table of Contents
-=================
-1 Usage
-2 Caveats
-
-
-1 Usage
-~~~~~~~~
- To run Static MathJax, an existing XULRunner installation is
- required. From the directory to which you unpacked Static MathJax,
- run:
-
- xulrunner application.ini <--embed-fonts | --final-mathjax-url <URL>>
- <input file> <output file>
-
- If you prefer to call "staticmathjax" instead of "xulrunner
- application.ini", link xulrunner-stub into the directory:
- ln /usr/lib/xulrunner-1.9.2.8/xulrunner-stub ./staticmathjax
-
- input file:
- name of the input file (the result of a HTML export
- from Org-mode). It is assumed that this file uses the
- UTF-8 character encoding.
-
- output file:
- name of the output file.
-
- --embed-fonts:
- if specified, the math fonts will be embedded into
- the output file using data: URIs
-
- --final-mathjax-url <URL>:
- if --embed-fonts is not specified, this
- must be the URL to a MathJax installation folder (e.g. "MathJax"
- if MathJax is installed in a subdirectory, or
- "[http://orgmode.org/mathjax]" to use the version hosted on the Org
- website.
-
- All references to math fonts in the output file will point to
- this directory.
-
-2 Caveats
-~~~~~~~~~~
-
- The input file must not use a MathJax installation on the
- web. Otherwise, due to a security feature of Firefox, MathJax will
- fallback to image fonts. If you have unpacked MathJax to a
- subdirectory "MathJax", specify the following in your Org file:
-
- #+MathJax: path:"MathJax"
-
- The math is rendered in Firefox, so MathJax applies its
- Firefox-specific settings. When viewing the output files in other
- browsers, it will look slightly different than the result that
- running MathJax in that browser would produce.
-
- Internet Explorer does not use the correct font, because it only
- supports the EOT font format. For all other browsers (including
- Firefox), MathJax uses the OTF font format.
-
- Embedding fonts into the HTML file wastes some space due to the
- base64 encoding used in data: URIs.
-
- I have found no way to access stdout or set an exit code in an
- XULRunner app, so any code which calls Static MathJax has no idea if
- processing was successful and when an error occurs, graphical
- message boxes are displayed.
diff --git a/.emacs.d/org-7.4/contrib/scripts/staticmathjax/application.ini b/.emacs.d/org-7.4/contrib/scripts/staticmathjax/application.ini
deleted file mode 100644
index d7957b0..0000000
--- a/.emacs.d/org-7.4/contrib/scripts/staticmathjax/application.ini
+++ /dev/null
@@ -1,11 +0,0 @@
-[App]
-Vendor=Jan Boecker
-Name=StaticMathJax
-Version=0.2
-BuildID=2
-Copyright=Copyright (c) 2010 Jan Boecker
-ID=xulapp@jboecker.de
-
-[Gecko]
-MinVersion=1.8
-
diff --git a/.emacs.d/org-7.4/contrib/scripts/staticmathjax/chrome/chrome.manifest b/.emacs.d/org-7.4/contrib/scripts/staticmathjax/chrome/chrome.manifest
deleted file mode 100644
index a05d8c8..0000000
--- a/.emacs.d/org-7.4/contrib/scripts/staticmathjax/chrome/chrome.manifest
+++ /dev/null
@@ -1 +0,0 @@
-content staticmathjax file:content/
diff --git a/.emacs.d/org-7.4/contrib/scripts/staticmathjax/chrome/content/main.js b/.emacs.d/org-7.4/contrib/scripts/staticmathjax/chrome/content/main.js
deleted file mode 100644
index 2e71f3b..0000000
--- a/.emacs.d/org-7.4/contrib/scripts/staticmathjax/chrome/content/main.js
+++ /dev/null
@@ -1,198 +0,0 @@
-var docFrame;
-var logtextbox;
-var destFile;
-var embedFonts = false;
-var finalMathJaxURL = null;
-
-function log(text)
-{
- logtextbox.setAttribute("value", logtextbox.getAttribute("value") + "\n" + text);
-}
-
-function init()
-{
- try {
- docFrame = document.getElementById("docFrame");
- logtextbox = document.getElementById("logtextbox");
-
- // parse command line arguments
- var cmdLine = window.arguments[0];
- cmdLine = cmdLine.QueryInterface(Components.interfaces.nsICommandLine);
-
- embedFonts = cmdLine.handleFlag("embed-fonts", false);
- finalMathJaxURL = cmdLine.handleFlagWithParam("final-mathjax-url", false);
-
- if (!embedFonts && !finalMathJaxURL) {
- alert("You must eiher specify --embed-fonts or --final-mathjax-url");
- window.close();
- return;
- }
-
- sourceFilePath = cmdLine.getArgument(0);
- destFilePath = cmdLine.getArgument(1);
- if ( !sourceFilePath || !destFilePath ) {
- alert("Not enough parameters, expecting two arguments:\nInput file, output file");
- window.close();
- return;
- }
-
- sourceFile = cmdLine.resolveFile(sourceFilePath);
- if (! (sourceFile.exists() && sourceFile.isFile()) ) {
- alert("Invalid source file path.");
- window.close();
- return;
- }
- sourceURI = cmdLine.resolveURI(sourceFilePath);
-
- // create a nsIFile object for the output file
- try{
- destFile = cmdLine.resolveURI(destFilePath).QueryInterface(Components.interfaces.nsIFileURL).file;
- }catch(e){
- alert("Invalid destination file.\n\nException:\n" + e);
- window.close();
- return;
- }
-
- // add iframeLoaded() as an onload event handler, then navigate to the source file
- docFrame.addEventListener("DOMContentLoaded", iframeLoaded, true);
- docFrame.setAttribute("src", sourceURI.spec);
-
- } catch (e) {
- alert("Error in init():\n\n" + e);
- window.close();
- return;
- }
-}
-
-function iframeLoaded()
-{
- /*
- // print every MathJax signal to the log
- docFrame.contentWindow.MathJax.Hub.Startup.signal.Interest(
- function (message) {log("Startup: "+message)}
- );
- docFrame.contentWindow.MathJax.Hub.signal.Interest(
- function (message) {log("Hub: "+message)}
- );
- */
-
- // tell MathJax to call serialize() when finished
- docFrame.contentWindow.MathJax.Hub.Register.StartupHook("End", function() {serialize();});
-}
-
-function fileURLtoDataURI(url)
-{
- var ios = Components.classes["@mozilla.org/network/io-service;1"]
- .getService(Components.interfaces.nsIIOService);
- var url_object = ios.newURI(url, "", null);
- var file = url_object.QueryInterface(Components.interfaces.nsIFileURL).file;
-
- var data = "";
- var fstream = Components.classes["@mozilla.org/network/file-input-stream;1"].
- createInstance(Components.interfaces.nsIFileInputStream);
- fstream.init(file, -1, -1, false);
- var bstream = Components.classes["@mozilla.org/binaryinputstream;1"].
- createInstance(Components.interfaces.nsIBinaryInputStream);
- bstream.setInputStream(fstream);
-
- var bytes = bstream.readBytes(bstream.available());
- b64bytes = btoa(bytes);
-
- return "data:;base64," + b64bytes;
-
-}
-
-function serialize()
-{
- var MathJaxURL = docFrame.contentWindow.MathJax.Hub.config.root;
-
- var searchURIList = new Array();
- var replacementURIList = new Array();
-
- log("serialize: preprocessing");
-
- // remove the MathJax status message window
- msgdiv = docFrame.contentDocument.getElementById("MathJax_Message");
- msgdiv.parentNode.removeChild(msgdiv);
-
- /* Loop through all CSS rules to find all @font-face rules.
- At this point, they refer to local absolute paths using file:// URLs.
- Replace them either with appropriate URLs relative to finalMathJaxURL
- or with data URIs. */
-
- for (var i = 0; i<docFrame.contentDocument.styleSheets.length; i++) {
- var stylesheet = docFrame.contentDocument.styleSheets[i];
-
- for (var j=0; j< stylesheet.cssRules.length; j++) {
- var rule = stylesheet.cssRules[j];
- if (rule.cssText.match("font-face")) {
-
- url = rule.style.getPropertyValue("src");
- url = url.match(/url\(\"(.+)\"\)/)[1];
-
- // Since the properties seem read-only here, we populate
- // searchURIList and replacementURIList to do text substitution
- // after serialization
- searchURIList.push(url);
- if (embedFonts) {
- replacementURIList.push(fileURLtoDataURI(url));
- } else {
- replacementURIList.push(url.replace(MathJaxURL, finalMathJaxURL));
- }
- }
- }
- }
-
-
- // find and remove the MathJax <script> tag
- try{
- var scriptTags = docFrame.contentDocument.getElementsByTagName("script");
- for (var i=0; i<scriptTags.length; i++) {
- if (scriptTags[i].getAttribute("src") && scriptTags[i].getAttribute("src").match(/MathJax.js/i))
- scriptTags[i].parentNode.removeChild(scriptTags[i]);
- }
- }catch(e){alert(e);}
-
- log("serialize: serializing");
-
- var serializer = new XMLSerializer();
- var xhtml = serializer.serializeToString(docFrame.contentDocument);
-
- log("serialize: postprocessing");
- // make the MathJax URL relative again
- // xhtml = xhtml.replace(findMathJaxURL, "MathJax");
-
- try{
- r1 = RegExp("&lt;!--/\\*--&gt;&lt;!\\[CDATA\\[/\\*&gt;&lt;!--\\*/", "g");
- xhtml = xhtml.replace(r1, "");
- r2 = RegExp("/\\*\\]\\]&gt;\\*/--&gt;", "g");
- xhtml = xhtml.replace(r2, "");
- r3 = RegExp("/\\*\\]\\]&gt;\\*///--&gt;", "g");
- xhtml = xhtml.replace(r3, "");
- }catch(e){alert(e);}
- for (var i=0; i<searchURIList.length; i++)
- xhtml = xhtml.replace(searchURIList[i], replacementURIList[i]);
-
- save(xhtml);
- window.close();
-}
-
-function save(xhtml)
-{
- try {
- var foStream = Components.classes["@mozilla.org/network/file-output-stream;1"].
- createInstance(Components.interfaces.nsIFileOutputStream);
-
- foStream.init(destFile, 0x02 | 0x08 | 0x20, 0666, 0);
- // write, create, truncate
-
- // write in UTF-8 encoding
- var converter = Components.classes["@mozilla.org/intl/converter-output-stream;1"].
- createInstance(Components.interfaces.nsIConverterOutputStream);
- converter.init(foStream, "UTF-8", 0, 0);
- converter.writeString(xhtml);
- converter.close(); // this closes foStream
- } catch (e) {
- alert("Error in save():\n\n" + e);
- }
-}
diff --git a/.emacs.d/org-7.4/contrib/scripts/staticmathjax/chrome/content/main.xul b/.emacs.d/org-7.4/contrib/scripts/staticmathjax/chrome/content/main.xul
deleted file mode 100644
index 35a00f2..0000000
--- a/.emacs.d/org-7.4/contrib/scripts/staticmathjax/chrome/content/main.xul
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-
-<window onload="init();" id="main" title="Static MathJax" width="300" height="300"
-xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<script language="JavaScript" src="chrome://staticmathjax/content/main.js"/>
-
- <browser flex="1" id="docFrame" src="" style="background-color:white;"/>
- <textbox flex="1" id="logtextbox" multiline="true" style="display:none;"/>
-</window>
diff --git a/.emacs.d/org-7.4/contrib/scripts/staticmathjax/defaults/preferences/prefs.js b/.emacs.d/org-7.4/contrib/scripts/staticmathjax/defaults/preferences/prefs.js
deleted file mode 100644
index 0532ce0..0000000
--- a/.emacs.d/org-7.4/contrib/scripts/staticmathjax/defaults/preferences/prefs.js
+++ /dev/null
@@ -1 +0,0 @@
-pref("toolkit.defaultChromeURI", "chrome://staticmathjax/content/main.xul");
diff --git a/.emacs.d/org-7.4/doc/.nosearch b/.emacs.d/org-7.4/doc/.nosearch
deleted file mode 100644
index 50a914b..0000000
--- a/.emacs.d/org-7.4/doc/.nosearch
+++ /dev/null
@@ -1 +0,0 @@
-No search
diff --git a/.emacs.d/org-7.4/doc/dir b/.emacs.d/org-7.4/doc/dir
deleted file mode 100644
index 9610c40..0000000
--- a/.emacs.d/org-7.4/doc/dir
+++ /dev/null
@@ -1,18 +0,0 @@
-This is the file .../info/dir, which contains the
-topmost node of the Info hierarchy, called (dir)Top.
-The first time you invoke Info you start off looking at this node.
-
-File: dir, Node: Top This is the top of the INFO tree
-
- This (the Directory node) gives a menu of major topics.
- Typing "q" exits, "?" lists all Info commands, "d" returns here,
- "h" gives a primer for first-timers,
- "mEmacs<Return>" visits the Emacs manual, etc.
-
- In Emacs, you can click mouse button 2 on a menu item or cross reference
- to select it.
-
-* Menu:
-
-Emacs
-* Org Mode: (org). Outline-based notes management and organizer
diff --git a/.emacs.d/org-7.4/doc/org b/.emacs.d/org-7.4/doc/org
deleted file mode 100644
index 7712859..0000000
--- a/.emacs.d/org-7.4/doc/org
+++ /dev/null
@@ -1,16592 +0,0 @@
-This is org, produced by makeinfo version 4.8 from org.texi.
-
- This manual is for Org version 7.4.
-
- Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-Foundation, Inc.
-
- Permission is granted to copy, distribute and/or modify this
- document under the terms of the GNU Free Documentation License,
- Version 1.3 or any later version published by the Free Software
- Foundation; with no Invariant Sections, with the Front-Cover texts
- being "A GNU Manual," and with the Back-Cover Texts as in (a)
- below. A copy of the license is included in the section entitled
- "GNU Free Documentation License."
-
- (a) The FSF's Back-Cover Text is: "You have the freedom to copy and
- modify this GNU manual. Buying copies from the FSF supports it in
- developing GNU and promoting software freedom."
-
- This document is part of a collection distributed under the GNU
- Free Documentation License. If you want to distribute this
- document separately from the collection, you can do so by adding a
- copy of the license to the document, as described in section 6 of
- the license.
-
-INFO-DIR-SECTION Emacs
-START-INFO-DIR-ENTRY
-* Org Mode: (org). Outline-based notes management and organizer
-END-INFO-DIR-ENTRY
-
-
-File: org, Node: Top, Next: Introduction, Prev: (dir), Up: (dir)
-
-Org Mode Manual
-***************
-
-This manual is for Org version 7.4.
-
- Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-Foundation, Inc.
-
- Permission is granted to copy, distribute and/or modify this
- document under the terms of the GNU Free Documentation License,
- Version 1.3 or any later version published by the Free Software
- Foundation; with no Invariant Sections, with the Front-Cover texts
- being "A GNU Manual," and with the Back-Cover Texts as in (a)
- below. A copy of the license is included in the section entitled
- "GNU Free Documentation License."
-
- (a) The FSF's Back-Cover Text is: "You have the freedom to copy and
- modify this GNU manual. Buying copies from the FSF supports it in
- developing GNU and promoting software freedom."
-
- This document is part of a collection distributed under the GNU
- Free Documentation License. If you want to distribute this
- document separately from the collection, you can do so by adding a
- copy of the license to the document, as described in section 6 of
- the license.
-
-* Menu:
-
-* Introduction:: Getting started
-* Document Structure:: A tree works like your brain
-* Tables:: Pure magic for quick formatting
-* Hyperlinks:: Notes in context
-* TODO Items:: Every tree branch can be a TODO item
-* Tags:: Tagging headlines and matching sets of tags
-* Properties and Columns:: Storing information about an entry
-* Dates and Times:: Making items useful for planning
-* Capture - Refile - Archive:: The ins and outs for projects
-* Agenda Views:: Collecting information into views
-* Markup:: Prepare text for rich export
-* Exporting:: Sharing and publishing of notes
-* Publishing:: Create a web site of linked Org files
-* Working With Source Code:: Export, evaluate, and tangle code blocks
-* Miscellaneous:: All the rest which did not fit elsewhere
-* Hacking:: How to hack your way around
-* MobileOrg:: Viewing and capture on a mobile device
-* History and Acknowledgments:: How Org came into being
-* Main Index:: An index of Org's concepts and features
-* Key Index:: Key bindings and where they are described
-* Command and Function Index:: Command names and some internal functions
-* Variable Index:: Variables mentioned in the manual
-
- --- The Detailed Node Listing ---
-
-Introduction
-
-* Summary:: Brief summary of what Org does
-* Installation:: How to install a downloaded version of Org
-* Activation:: How to activate Org for certain buffers
-* Feedback:: Bug reports, ideas, patches etc.
-* Conventions:: Type-setting conventions in the manual
-
-Document structure
-
-* Outlines:: Org is based on Outline mode
-* Headlines:: How to typeset Org tree headlines
-* Visibility cycling:: Show and hide, much simplified
-* Motion:: Jumping to other headlines
-* Structure editing:: Changing sequence and level of headlines
-* Sparse trees:: Matches embedded in context
-* Plain lists:: Additional structure within an entry
-* Drawers:: Tucking stuff away
-* Blocks:: Folding blocks
-* Footnotes:: How footnotes are defined in Org's syntax
-* Orgstruct mode:: Structure editing outside Org
-
-Tables
-
-* Built-in table editor:: Simple tables
-* Column width and alignment:: Overrule the automatic settings
-* Column groups:: Grouping to trigger vertical lines
-* Orgtbl mode:: The table editor as minor mode
-* The spreadsheet:: The table editor has spreadsheet capabilities
-* Org-Plot:: Plotting from org tables
-
-The spreadsheet
-
-* References:: How to refer to another field or range
-* Formula syntax for Calc:: Using Calc to compute stuff
-* Formula syntax for Lisp:: Writing formulas in Emacs Lisp
-* Field formulas:: Formulas valid for a single field
-* Column formulas:: Formulas valid for an entire column
-* Editing and debugging formulas:: Fixing formulas
-* Updating the table:: Recomputing all dependent fields
-* Advanced features:: Field names, parameters and automatic recalc
-
-Hyperlinks
-
-* Link format:: How links in Org are formatted
-* Internal links:: Links to other places in the current file
-* External links:: URL-like links to the world
-* Handling links:: Creating, inserting and following
-* Using links outside Org:: Linking from my C source code?
-* Link abbreviations:: Shortcuts for writing complex links
-* Search options:: Linking to a specific location
-* Custom searches:: When the default search is not enough
-
-Internal links
-
-* Radio targets:: Make targets trigger links in plain text
-
-TODO items
-
-* TODO basics:: Marking and displaying TODO entries
-* TODO extensions:: Workflow and assignments
-* Progress logging:: Dates and notes for progress
-* Priorities:: Some things are more important than others
-* Breaking down tasks:: Splitting a task into manageable pieces
-* Checkboxes:: Tick-off lists
-
-Extended use of TODO keywords
-
-* Workflow states:: From TODO to DONE in steps
-* TODO types:: I do this, Fred does the rest
-* Multiple sets in one file:: Mixing it all, and still finding your way
-* Fast access to TODO states:: Single letter selection of a state
-* Per-file keywords:: Different files, different requirements
-* Faces for TODO keywords:: Highlighting states
-* TODO dependencies:: When one task needs to wait for others
-
-Progress logging
-
-* Closing items:: When was this entry marked DONE?
-* Tracking TODO state changes:: When did the status change?
-* Tracking your habits:: How consistent have you been?
-
-Tags
-
-* Tag inheritance:: Tags use the tree structure of the outline
-* Setting tags:: How to assign tags to a headline
-* Tag searches:: Searching for combinations of tags
-
-Properties and columns
-
-* Property syntax:: How properties are spelled out
-* Special properties:: Access to other Org-mode features
-* Property searches:: Matching property values
-* Property inheritance:: Passing values down the tree
-* Column view:: Tabular viewing and editing
-* Property API:: Properties for Lisp programmers
-
-Column view
-
-* Defining columns:: The COLUMNS format property
-* Using column view:: How to create and use column view
-* Capturing column view:: A dynamic block for column view
-
-Defining columns
-
-* Scope of column definitions:: Where defined, where valid?
-* Column attributes:: Appearance and content of a column
-
-Dates and times
-
-* Timestamps:: Assigning a time to a tree entry
-* Creating timestamps:: Commands which insert timestamps
-* Deadlines and scheduling:: Planning your work
-* Clocking work time:: Tracking how long you spend on a task
-* Effort estimates:: Planning work effort in advance
-* Relative timer:: Notes with a running timer
-* Countdown timer:: Starting a countdown timer for a task
-
-Creating timestamps
-
-* The date/time prompt:: How Org-mode helps you entering date and time
-* Custom time format:: Making dates look different
-
-Deadlines and scheduling
-
-* Inserting deadline/schedule:: Planning items
-* Repeated tasks:: Items that show up again and again
-
-Clocking work time
-
-* Clocking commands:: Starting and stopping a clock
-* The clock table:: Detailed reports
-* Resolving idle time:: Resolving time when you've been idle
-
-Capture - Refile - Archive
-
-* Capture:: Capturing new stuff
-* Attachments:: Add files to tasks
-* RSS Feeds:: Getting input from RSS feeds
-* Protocols:: External (e.g. Browser) access to Emacs and Org
-* Refiling notes:: Moving a tree from one place to another
-* Archiving:: What to do with finished projects
-
-Capture
-
-* Setting up capture:: Where notes will be stored
-* Using capture:: Commands to invoke and terminate capture
-* Capture templates:: Define the outline of different note types
-
-Capture templates
-
-* Template elements:: What is needed for a complete template entry
-* Template expansion:: Filling in information about time and context
-
-Archiving
-
-* Moving subtrees:: Moving a tree to an archive file
-* Internal archiving:: Switch off a tree but keep it in the file
-
-Agenda views
-
-* Agenda files:: Files being searched for agenda information
-* Agenda dispatcher:: Keyboard access to agenda views
-* Built-in agenda views:: What is available out of the box?
-* Presentation and sorting:: How agenda items are prepared for display
-* Agenda commands:: Remote editing of Org trees
-* Custom agenda views:: Defining special searches and views
-* Exporting Agenda Views:: Writing a view to a file
-* Agenda column view:: Using column view for collected entries
-
-The built-in agenda views
-
-* Weekly/daily agenda:: The calendar page with current tasks
-* Global TODO list:: All unfinished action items
-* Matching tags and properties:: Structured information with fine-tuned search
-* Timeline:: Time-sorted view for single file
-* Search view:: Find entries by searching for text
-* Stuck projects:: Find projects you need to review
-
-Presentation and sorting
-
-* Categories:: Not all tasks are equal
-* Time-of-day specifications:: How the agenda knows the time
-* Sorting of agenda items:: The order of things
-
-Custom agenda views
-
-* Storing searches:: Type once, use often
-* Block agenda:: All the stuff you need in a single buffer
-* Setting Options:: Changing the rules
-
-Markup for rich export
-
-* Structural markup elements:: The basic structure as seen by the exporter
-* Images and tables:: Tables and Images will be included
-* Literal examples:: Source code examples with special formatting
-* Include files:: Include additional files into a document
-* Index entries:: Making an index
-* Macro replacement:: Use macros to create complex output
-* Embedded LaTeX:: LaTeX can be freely used inside Org documents
-
-Structural markup elements
-
-* Document title:: Where the title is taken from
-* Headings and sections:: The document structure as seen by the exporter
-* Table of contents:: The if and where of the table of contents
-* Initial text:: Text before the first heading?
-* Lists:: Lists
-* Paragraphs:: Paragraphs
-* Footnote markup:: Footnotes
-* Emphasis and monospace:: Bold, italic, etc.
-* Horizontal rules:: Make a line
-* Comment lines:: What will *not* be exported
-
-Embedded LaTeX
-
-* Special symbols:: Greek letters and other symbols
-* Subscripts and superscripts:: Simple syntax for raising/lowering text
-* LaTeX fragments:: Complex formulas made easy
-* Previewing LaTeX fragments:: What will this snippet look like?
-* CDLaTeX mode:: Speed up entering of formulas
-
-Exporting
-
-* Selective export:: Using tags to select and exclude trees
-* Export options:: Per-file export settings
-* The export dispatcher:: How to access exporter commands
-* ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding
-* HTML export:: Exporting to HTML
-* LaTeX and PDF export:: Exporting to LaTeX, and processing to PDF
-* DocBook export:: Exporting to DocBook
-* TaskJuggler export:: Exporting to TaskJuggler
-* Freemind export:: Exporting to Freemind mind maps
-* XOXO export:: Exporting to XOXO
-* iCalendar export:: Exporting in iCalendar format
-
-HTML export
-
-* HTML Export commands:: How to invoke HTML export
-* Quoting HTML tags:: Using direct HTML in Org-mode
-* Links in HTML export:: How links will be interpreted and formatted
-* Tables in HTML export:: How to modify the formatting of tables
-* Images in HTML export:: How to insert figures into HTML output
-* Math formatting in HTML export:: Beautiful math also on the web
-* Text areas in HTML export:: An alternative way to show an example
-* CSS support:: Changing the appearance of the output
-* JavaScript support:: Info and Folding in a web browser
-
-LaTeX and PDF export
-
-* LaTeX/PDF export commands:: Which key invokes which commands
-* Header and sectioning:: Setting up the export file structure
-* Quoting LaTeX code:: Incorporating literal LaTeX code
-* Tables in LaTeX export:: Options for exporting tables to LaTeX
-* Images in LaTeX export:: How to insert figures into LaTeX output
-* Beamer class export:: Turning the file into a presentation
-
-DocBook export
-
-* DocBook export commands:: How to invoke DocBook export
-* Quoting DocBook code:: Incorporating DocBook code in Org files
-* Recursive sections:: Recursive sections in DocBook
-* Tables in DocBook export:: Tables are exported as HTML tables
-* Images in DocBook export:: How to insert figures into DocBook output
-* Special characters:: How to handle special characters
-
-Publishing
-
-* Configuration:: Defining projects
-* Uploading files:: How to get files up on the server
-* Sample configuration:: Example projects
-* Triggering publication:: Publication commands
-
-Configuration
-
-* Project alist:: The central configuration variable
-* Sources and destinations:: From here to there
-* Selecting files:: What files are part of the project?
-* Publishing action:: Setting the function doing the publishing
-* Publishing options:: Tweaking HTML export
-* Publishing links:: Which links keep working after publishing?
-* Sitemap:: Generating a list of all pages
-* Generating an index:: An index that reaches across pages
-
-Sample configuration
-
-* Simple example:: One-component publishing
-* Complex example:: A multi-component publishing example
-
-Working with source code
-
-* Structure of code blocks:: Code block syntax described
-* Editing source code:: Language major-mode editing
-* Exporting code blocks:: Export contents and/or results
-* Extracting source code:: Create pure source code files
-* Evaluating code blocks:: Place results of evaluation in the Org-mode buffer
-* Library of Babel:: Use and contribute to a library of useful code blocks
-* Languages:: List of supported code block languages
-* Header arguments:: Configure code block functionality
-* Results of evaluation:: How evaluation results are handled
-* Noweb reference syntax:: Literate programming in Org-mode
-* Key bindings and useful functions:: Work quickly with code blocks
-* Batch execution:: Call functions from the command line
-
-Header arguments
-
-* Using header arguments:: Different ways to set header arguments
-* Specific header arguments:: List of header arguments
-
-Using header arguments
-
-* System-wide header arguments:: Set global default values
-* Language-specific header arguments:: Set default values by language
-* Buffer-wide header arguments:: Set default values for a specific buffer
-* Header arguments in Org-mode properties:: Set default values for a buffer or heading
-* Code block specific header arguments:: The most common way to set values
-* Header arguments in function calls:: The most specific level
-
-Specific header arguments
-
-* var:: Pass arguments to code blocks
-* results:: Specify the type of results and how they will
- be collected and handled
-* file:: Specify a path for file output
-* dir:: Specify the default (possibly remote)
- directory for code block execution
-* exports:: Export code and/or results
-* tangle:: Toggle tangling and specify file name
-* comments:: Toggle insertion of comments in tangled
- code files
-* no-expand:: Turn off variable assignment and noweb
- expansion during tangling
-* session:: Preserve the state of code evaluation
-* noweb:: Toggle expansion of noweb references
-* cache:: Avoid re-evaluating unchanged code blocks
-* hlines:: Handle horizontal lines in tables
-* colnames:: Handle column names in tables
-* rownames:: Handle row names in tables
-* shebang:: Make tangled files executable
-* eval:: Limit evaluation of specific code blocks
-
-Miscellaneous
-
-* Completion:: M-TAB knows what you need
-* Easy Templates:: Quick insertion of structural elements
-* Speed keys:: Electric commands at the beginning of a headline
-* Code evaluation security:: Org mode files evaluate inline code
-* Customization:: Adapting Org to your taste
-* In-buffer settings:: Overview of the #+KEYWORDS
-* The very busy C-c C-c key:: When in doubt, press C-c C-c
-* Clean view:: Getting rid of leading stars in the outline
-* TTY keys:: Using Org on a tty
-* Interaction:: Other Emacs packages
-
-Interaction with other packages
-
-* Cooperation:: Packages Org cooperates with
-* Conflicts:: Packages that lead to conflicts
-
-Hacking
-
-* Hooks:: Who to reach into Org's internals
-* Add-on packages:: Available extensions
-* Adding hyperlink types:: New custom link types
-* Context-sensitive commands:: How to add functionality to such commands
-* Tables in arbitrary syntax:: Orgtbl for LaTeX and other programs
-* Dynamic blocks:: Automatically filled blocks
-* Special agenda views:: Customized views
-* Extracting agenda information:: Postprocessing of agenda information
-* Using the property API:: Writing programs that use entry properties
-* Using the mapping API:: Mapping over all or selected entries
-
-Tables and lists in arbitrary syntax
-
-* Radio tables:: Sending and receiving radio tables
-* A LaTeX example:: Step by step, almost a tutorial
-* Translator functions:: Copy and modify
-* Radio lists:: Doing the same for lists
-
-MobileOrg
-
-* Setting up the staging area:: Where to interact with the mobile device
-* Pushing to MobileOrg:: Uploading Org files and agendas
-* Pulling from MobileOrg:: Integrating captured and flagged items
-
-
-File: org, Node: Introduction, Next: Document Structure, Prev: Top, Up: Top
-
-1 Introduction
-**************
-
-* Menu:
-
-* Summary:: Brief summary of what Org does
-* Installation:: How to install a downloaded version of Org
-* Activation:: How to activate Org for certain buffers
-* Feedback:: Bug reports, ideas, patches etc.
-* Conventions:: Type-setting conventions in the manual
-
-
-File: org, Node: Summary, Next: Installation, Prev: Introduction, Up: Introduction
-
-1.1 Summary
-===========
-
-Org is a mode for keeping notes, maintaining TODO lists, and doing
-project planning with a fast and effective plain-text system.
-
- Org develops organizational tasks around NOTES files that contain
-lists or information about projects as plain text. Org is implemented
-on top of Outline mode, which makes it possible to keep the content of
-large files well structured. Visibility cycling and structure editing
-help to work with the tree. Tables are easily created with a built-in
-table editor. Org supports TODO items, deadlines, timestamps, and
-scheduling. It dynamically compiles entries into an agenda that
-utilizes and smoothly integrates much of the Emacs calendar and diary.
-Plain text URL-like links connect to websites, emails, Usenet messages,
-BBDB entries, and any files related to the projects. For printing and
-sharing of notes, an Org file can be exported as a structured ASCII
-file, as HTML, or (TODO and agenda items only) as an iCalendar file.
-It can also serve as a publishing tool for a set of linked web pages.
-
- As a project planning environment, Org works by adding metadata to
-outline nodes. Based on this data, specific entries can be extracted
-in queries and create dynamic agenda views.
-
- Org mode contains the Org Babel environment which allows you to work
-with embedded source code blocks in a file, to facilitate code
-evaluation, documentation, and tangling.
-
- Org's automatic, context-sensitive table editor with spreadsheet
-capabilities can be integrated into any major mode by activating the
-minor Orgtbl mode. Using a translation step, it can be used to maintain
-tables in arbitrary file types, for example in LaTeX. The structure
-editing and list creation capabilities can be used outside Org with the
-minor Orgstruct mode.
-
- Org keeps simple things simple. When first fired up, it should feel
-like a straightforward, easy to use outliner. Complexity is not
-imposed, but a large amount of functionality is available when you need
-it. Org is a toolbox and can be used in different ways and for
-different ends, for example:
-
- * an outline extension with visibility cycling and structure editing
- * an ASCII system and table editor for taking structured notes
- * a TODO list editor
- * a full agenda and planner with deadlines and work scheduling
- * an environment in which to implement David Allen's GTD system
- * a simple hypertext system, with HTML and LaTeX export
- * a publishing tool to create a set of interlinked webpages
- * an environment for literate programming
-
- There is a website for Org which provides links to the newest
-version of Org, as well as additional information, frequently asked
-questions (FAQ), links to tutorials, etc. This page is located at
-`http://orgmode.org'.
-
-
-File: org, Node: Installation, Next: Activation, Prev: Summary, Up: Introduction
-
-1.2 Installation
-================
-
-Important: If you are using a version of Org that is part of the Emacs
-distribution or an XEmacs package, please skip this section and go
-directly to *Note Activation::.
-
- If you have downloaded Org from the Web, either as a distribution
-`.zip' or `.tar' file, or as a Git archive, you must take the following
-steps to install it: go into the unpacked Org distribution directory
-and edit the top section of the file `Makefile'. You must set the name
-of the Emacs binary (likely either `emacs' or `xemacs'), and the paths
-to the directories where local Lisp and Info files are kept. If you
-don't have access to the system-wide directories, you can simply run
-Org directly from the distribution directory by adding the `lisp'
-subdirectory to the Emacs load path. To do this, add the following
-line to `.emacs':
-
- (setq load-path (cons "~/path/to/orgdir/lisp" load-path))
-
-If you plan to use code from the `contrib' subdirectory, do a similar
-step for this directory:
-
- (setq load-path (cons "~/path/to/orgdir/contrib/lisp" load-path))
-
-Now byte-compile the Lisp files with the shell command:
-
- make
-
-If you are running Org from the distribution directory, this is all.
-If you want to install Org into the system directories, use (as
-administrator)
-
- make install
-
- Installing Info files is system dependent, because of differences in
-the `install-info' program. In Debian it copies the info files into the
-correct directory and modifies the info directory file. In many other
-systems, the files need to be copied to the correct directory
-separately, and `install-info' then only modifies the directory file.
-Check your system documentation to find out which of the following
-commands you need:
-
- make install-info
- make install-info-debian
-
- Then add the following line to `.emacs'. It is needed so that Emacs
-can autoload functions that are located in files not immediately loaded
-when Org-mode starts.
- (require 'org-install)
-
- Do not forget to activate Org as described in the following section.
-
-
-File: org, Node: Activation, Next: Feedback, Prev: Installation, Up: Introduction
-
-1.3 Activation
-==============
-
-Add the following lines to your `.emacs' file. The last three lines
-define _global_ keys for the commands `org-store-link', `org-agenda',
-and `org-iswitchb'--please choose suitable keys yourself.
-
- ;; The following lines are always needed. Choose your own keys.
- (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
- (global-set-key "\C-cl" 'org-store-link)
- (global-set-key "\C-ca" 'org-agenda)
- (global-set-key "\C-cb" 'org-iswitchb)
-
- Furthermore, you must activate `font-lock-mode' in Org buffers,
-because significant functionality depends on font-locking being active.
-You can do this with either one of the following two lines (XEmacs
-users must use the second option):
- (global-font-lock-mode 1) ; for all buffers
- (add-hook 'org-mode-hook 'turn-on-font-lock) ; Org buffers only
-
- With this setup, all files with extension `.org' will be put into
-Org-mode. As an alternative, make the first line of a file look like
-this:
-
- MY PROJECTS -*- mode: org; -*-
-
-which will select Org-mode for this buffer no matter what the file's
-name is. See also the variable `org-insert-mode-line-in-empty-file'.
-
- Many commands in Org work on the region if the region is active. To
-make use of this, you need to have `transient-mark-mode'
-(`zmacs-regions' in XEmacs) turned on. In Emacs 23 this is the default,
-in Emacs 22 you need to do this yourself with
- (transient-mark-mode 1)
- If you do not like `transient-mark-mode', you can create an active
-region by using the mouse to select a region, or pressing `C-<SPC>'
-twice before moving the cursor.
-
-
-File: org, Node: Feedback, Next: Conventions, Prev: Activation, Up: Introduction
-
-1.4 Feedback
-============
-
-If you find problems with Org, or if you have questions, remarks, or
-ideas about it, please mail to the Org mailing list
-<emacs-orgmode@gnu.org>. If you are not a member of the mailing list,
-your mail will be passed to the list after a moderator has approved
-it(1).
-
- For bug reports, please first try to reproduce the bug with the
-latest version of Org available--if you are running an outdated
-version, it is quite possible that the bug has been fixed already. If
-the bug persists, prepare a report and provide as much information as
-possible, including the version information of Emacs (`M-x
-emacs-version <RET>') and Org (`M-x org-version <RET>'), as well as the
-Org related setup in `.emacs'. The easiest way to do this is to use
-the command
- M-x org-submit-bug-report
- which will put all this information into an Emacs mail buffer so
-that you only need to add your description. If you re not sending the
-Email from within Emacs, please copy and paste the content into your
-Email program.
-
- If an error occurs, a backtrace can be very useful (see below on how
-to create one). Often a small example file helps, along with clear
-information about:
-
- 1. What exactly did you do?
-
- 2. What did you expect to happen?
-
- 3. What happened instead?
- Thank you for helping to improve this program.
-
-How to create a useful backtrace
-................................
-
-If working with Org produces an error with a message you don't
-understand, you may have hit a bug. The best way to report this is by
-providing, in addition to what was mentioned above, a _backtrace_.
-This is information from the built-in debugger about where and how the
-error occurred. Here is how to produce a useful backtrace:
-
- 1. Reload uncompiled versions of all Org-mode Lisp files. The
- backtrace contains much more information if it is produced with
- uncompiled code. To do this, use
- C-u M-x org-reload RET
- or select `Org -> Refresh/Reload -> Reload Org uncompiled' from the
- menu.
-
- 2. Go to the `Options' menu and select `Enter Debugger on Error'
- (XEmacs has this option in the `Troubleshooting' sub-menu).
-
- 3. Do whatever you have to do to hit the error. Don't forget to
- document the steps you take.
-
- 4. When you hit the error, a `*Backtrace*' buffer will appear on the
- screen. Save this buffer to a file (for example using `C-x C-w')
- and attach it to your bug report.
-
- ---------- Footnotes ----------
-
- (1) Please consider subscribing to the mailing list, in order to
-minimize the work the mailing list moderators have to do.
-
-
-File: org, Node: Conventions, Prev: Feedback, Up: Introduction
-
-1.5 Typesetting conventions used in this manual
-===============================================
-
-Org uses three types of keywords: TODO keywords, tags, and property
-names. In this manual we use the following conventions:
-
-`TODO'
-`WAITING'
- TODO keywords are written with all capitals, even if they are
- user-defined.
-
-`boss'
-`ARCHIVE'
- User-defined tags are written in lowercase; built-in tags with
- special meaning are written with all capitals.
-
-`Release'
-`PRIORITY'
- User-defined properties are capitalized; built-in properties with
- special meaning are written with all capitals.
-
- The manual lists both the keys and the corresponding commands for
-accessing functionality. Org mode often uses the same key for
-different functions, depending on context. The command that is bound
-to such keys has a generic name, like `org-metaright'. In the manual
-we will, wherever possible, give the function that is internally called
-by the generic command. For example, in the chapter on document
-structure, `M-<right>' will be listed to call `org-do-demote', while in
-the chapter on tables, it will be listed to call
-org-table-move-column-right.
-
- If you prefer, you can compile the manual without the command names
-by unsetting the flag `cmdnames' in `org.texi'.
-
-
-File: org, Node: Document Structure, Next: Tables, Prev: Introduction, Up: Top
-
-2 Document structure
-********************
-
-Org is based on Outline mode and provides flexible commands to edit the
-structure of the document.
-
-* Menu:
-
-* Outlines:: Org is based on Outline mode
-* Headlines:: How to typeset Org tree headlines
-* Visibility cycling:: Show and hide, much simplified
-* Motion:: Jumping to other headlines
-* Structure editing:: Changing sequence and level of headlines
-* Sparse trees:: Matches embedded in context
-* Plain lists:: Additional structure within an entry
-* Drawers:: Tucking stuff away
-* Blocks:: Folding blocks
-* Footnotes:: How footnotes are defined in Org's syntax
-* Orgstruct mode:: Structure editing outside Org
-
-
-File: org, Node: Outlines, Next: Headlines, Prev: Document Structure, Up: Document Structure
-
-2.1 Outlines
-============
-
-Org is implemented on top of Outline mode. Outlines allow a document
-to be organized in a hierarchical structure, which (at least for me) is
-the best representation of notes and thoughts. An overview of this
-structure is achieved by folding (hiding) large parts of the document
-to show only the general document structure and the parts currently
-being worked on. Org greatly simplifies the use of outlines by
-compressing the entire show/hide functionality into a single command,
-`org-cycle', which is bound to the <TAB> key.
-
-
-File: org, Node: Headlines, Next: Visibility cycling, Prev: Outlines, Up: Document Structure
-
-2.2 Headlines
-=============
-
-Headlines define the structure of an outline tree. The headlines in Org
-start with one or more stars, on the left margin(1). For example:
-
- * Top level headline
- ** Second level
- *** 3rd level
- some text
- *** 3rd level
- more text
-
- * Another top level headline
-
-Some people find the many stars too noisy and would prefer an outline
-that has whitespace followed by a single star as headline starters.
-*Note Clean view::, describes a setup to realize this.
-
- An empty line after the end of a subtree is considered part of it and
-will be hidden when the subtree is folded. However, if you leave at
-least two empty lines, one empty line will remain visible after folding
-the subtree, in order to structure the collapsed view. See the
-variable `org-cycle-separator-lines' to modify this behavior.
-
- ---------- Footnotes ----------
-
- (1) See the variables `org-special-ctrl-a/e', `org-special-ctrl-k',
-and `org-ctrl-k-protect-subtree' to configure special behavior of `C-a',
-`C-e', and `C-k' in headlines.
-
-
-File: org, Node: Visibility cycling, Next: Motion, Prev: Headlines, Up: Document Structure
-
-2.3 Visibility cycling
-======================
-
-Outlines make it possible to hide parts of the text in the buffer. Org
-uses just two commands, bound to <TAB> and `S-<TAB>' to change the
-visibility in the buffer.
-
-`<TAB>' (`org-cycle')
- _Subtree cycling_: Rotate current subtree among the states
-
- ,-> FOLDED -> CHILDREN -> SUBTREE --.
- '-----------------------------------'
-
- The cursor must be on a headline for this to work(1). When the
- cursor is at the beginning of the buffer and the first line is not
- a headline, then <TAB> actually runs global cycling (see
- below)(2). Also when called with a prefix argument (`C-u <TAB>'),
- global cycling is invoked.
-
-`S-<TAB>' (`org-global-cycle')
-C-u <TAB>
- _Global cycling_: Rotate the entire buffer among the states
-
- ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
- '--------------------------------------'
-
- When `S-<TAB>' is called with a numeric prefix argument N, the
- CONTENTS view up to headlines of level N will be shown. Note that
- inside tables, `S-<TAB>' jumps to the previous field.
-
-`C-u C-u C-u <TAB>' (`show-all')
- Show all, including drawers.
-
-`C-c C-r' (`org-reveal')
- Reveal context around point, showing the current entry, the
- following heading and the hierarchy above. Useful for working
- near a location that has been exposed by a sparse tree command
- (*note Sparse trees::) or an agenda command (*note Agenda
- commands::). With a prefix argument show, on each level, all
- sibling headings. With double prefix arg, also show the entire
- subtree of the parent.
-
-`C-c C-k' (`show-branches')
- Expose all the headings of the subtree, CONTENT view for just one
- subtree.
-
-`C-c C-x b' (`org-tree-to-indirect-buffer')
- Show the current subtree in an indirect buffer(3). With a numeric
- prefix argument N, go up to level N and then take that tree. If N
- is negative then go up that many levels. With a `C-u' prefix, do
- not remove the previously used indirect buffer.
-
- When Emacs first visits an Org file, the global state is set to
-OVERVIEW, i.e. only the top level headlines are visible. This can be
-configured through the variable `org-startup-folded', or on a per-file
-basis by adding one of the following lines anywhere in the buffer:
-
- #+STARTUP: overview
- #+STARTUP: content
- #+STARTUP: showall
- #+STARTUP: showeverything
-
-Furthermore, any entries with a `VISIBILITY' property (*note Properties
-and Columns::) will get their visibility adapted accordingly. Allowed
-values for this property are `folded', `children', `content', and `all'.
-`C-u C-u <TAB>' (`org-set-startup-visibility')
- Switch back to the startup visibility of the buffer, i.e. whatever
- is requested by startup options and `VISIBILITY' properties in
- individual entries.
-
- ---------- Footnotes ----------
-
- (1) see, however, the option `org-cycle-emulate-tab'.
-
- (2) see the option `org-cycle-global-at-bob'.
-
- (3) The indirect buffer (*note Indirect Buffers: (emacs)Indirect
-Buffers.) will contain the entire buffer, but will be narrowed to the
-current tree. Editing the indirect buffer will also change the
-original buffer, but without affecting visibility in that buffer.
-
-
-File: org, Node: Motion, Next: Structure editing, Prev: Visibility cycling, Up: Document Structure
-
-2.4 Motion
-==========
-
-The following commands jump to other headlines in the buffer.
-
-`C-c C-n' (`outline-next-visible-heading')
- Next heading.
-
-`C-c C-p' (`outline-previous-visible-heading')
- Previous heading.
-
-`C-c C-f' (`org-forward-same-level')
- Next heading same level.
-
-`C-c C-b' (`org-backward-same-level')
- Previous heading same level.
-
-`C-c C-u' (`outline-up-heading')
- Backward to higher level heading.
-
-`C-c C-j' (`org-goto')
- Jump to a different place without changing the current outline
- visibility. Shows the document structure in a temporary buffer,
- where you can use the following keys to find your destination:
- <TAB> Cycle visibility.
- <down> / <up> Next/previous visible headline.
- <RET> Select this location.
- / Do a Sparse-tree search
- The following keys work if you turn off `org-goto-auto-isearch'
- n / p Next/previous visible headline.
- f / b Next/previous headline same level.
- u One level up.
- 0-9 Digit argument.
- q Quit
- See also the variable `org-goto-interface'.
-
-
-File: org, Node: Structure editing, Next: Sparse trees, Prev: Motion, Up: Document Structure
-
-2.5 Structure editing
-=====================
-
-`M-<RET>' (`org-insert-heading')
- Insert new heading with same level as current. If the cursor is
- in a plain list item, a new item is created (*note Plain lists::).
- To force creation of a new headline, use a prefix argument, or
- first press <RET> to get to the beginning of the next line. When
- this command is used in the middle of a line, the line is split
- and the rest of the line becomes the new headline(1). If the
- command is used at the beginning of a headline, the new headline is
- created before the current line. If at the beginning of any other
- line, the content of that line is made the new heading. If the
- command is used at the end of a folded subtree (i.e. behind the
- ellipses at the end of a headline), then a headline like the
- current one will be inserted after the end of the subtree.
-
-`C-<RET>' (`org-insert-heading-respect-content')
- Just like `M-<RET>', except when adding a new heading below the
- current heading, the new heading is placed after the body instead
- of before it. This command works from anywhere in the entry.
-
-`M-S-<RET>' (`org-insert-todo-heading')
- Insert new TODO entry with same level as current heading. See
- also the variable `org-treat-insert-todo-heading-as-state-change'.
-
-`C-S-<RET>' (`org-insert-todo-heading-respect-content')
- Insert new TODO entry with same level as current heading. Like
- `C-<RET>', the new headline will be inserted after the current
- subtree.
-
-`<TAB>' (`org-cycle')
- In a new entry with no text yet, the first <TAB> demotes the entry
- to become a child of the previous one. The next <TAB> makes it a
- parent, and so on, all the way to top level. Yet another <TAB>,
- and you are back to the initial level.
-
-`M-<left>' (`org-do-promote')
- Promote current heading by one level.
-
-`M-<right>' (`org-do-demote')
- Demote current heading by one level.
-
-`M-S-<left>' (`org-promote-subtree')
- Promote the current subtree by one level.
-
-`M-S-<right>' (`org-demote-subtree')
- Demote the current subtree by one level.
-
-`M-S-<up>' (`org-move-subtree-up')
- Move subtree up (swap with previous subtree of same level).
-
-`M-S-<down>' (`org-move-subtree-down')
- Move subtree down (swap with next subtree of same level).
-
-`C-c C-x C-w' (`org-cut-subtree')
- Kill subtree, i.e. remove it from buffer but save in kill ring.
- With a numeric prefix argument N, kill N sequential subtrees.
-
-`C-c C-x M-w' (`org-copy-subtree')
- Copy subtree to kill ring. With a numeric prefix argument N, copy
- the N sequential subtrees.
-
-`C-c C-x C-y' (`org-paste-subtree')
- Yank subtree from kill ring. This does modify the level of the
- subtree to make sure the tree fits in nicely at the yank position.
- The yank level can also be specified with a numeric prefix
- argument, or by yanking after a headline marker like `****'.
-
-`C-y' (`org-yank')
- Depending on the variables `org-yank-adjusted-subtrees' and
- `org-yank-folded-subtrees', Org's internal `yank' command will
- paste subtrees folded and in a clever way, using the same command
- as `C-c C-x C-y'. With the default settings, no level adjustment
- will take place, but the yanked tree will be folded unless doing
- so would swallow text previously visible. Any prefix argument to
- this command will force a normal `yank' to be executed, with the
- prefix passed along. A good way to force a normal yank is `C-u
- C-y'. If you use `yank-pop' after a yank, it will yank previous
- kill items plainly, without adjustment and folding.
-
-`C-c C-x c' (`org-clone-subtree-with-time-shift')
- Clone a subtree by making a number of sibling copies of it. You
- will be prompted for the number of copies to make, and you can
- also specify if any timestamps in the entry should be shifted.
- This can be useful, for example, to create a number of tasks
- related to a series of lectures to prepare. For more details, see
- the docstring of the command `org-clone-subtree-with-time-shift'.
-
-`C-c C-w' (`org-refile')
- Refile entry or region to a different location. *Note Refiling
- notes::.
-
-`C-c ^' (`org-sort-entries-or-items')
- Sort same-level entries. When there is an active region, all
- entries in the region will be sorted. Otherwise the children of
- the current headline are sorted. The command prompts for the
- sorting method, which can be alphabetically, numerically, by time
- (first timestamp with active preferred, creation time, scheduled
- time, deadline time), by priority, by TODO keyword (in the
- sequence the keywords have been defined in the setup) or by the
- value of a property. Reverse sorting is possible as well. You
- can also supply your own function to extract the sorting key.
- With a `C-u' prefix, sorting will be case-sensitive. With two
- `C-u C-u' prefixes, duplicate entries will also be removed.
-
-`C-x n s' (`org-narrow-to-subtree')
- Narrow buffer to current subtree.
-
-`C-x n w' (`widen')
- Widen buffer to remove narrowing.
-
-`C-c *' (`org-toggle-heading')
- Turn a normal line or plain list item into a headline (so that it
- becomes a subheading at its location). Also turn a headline into
- a normal line by removing the stars. If there is an active
- region, turn all lines in the region into headlines. If the first
- line in the region was an item, turn only the item lines into
- headlines. Finally, if the first line is a headline, remove the
- stars from all headlines in the region.
-
- When there is an active region (Transient Mark mode), promotion and
-demotion work on all headlines in the region. To select a region of
-headlines, it is best to place both point and mark at the beginning of a
-line, mark at the beginning of the first headline, and point at the line
-just after the last headline to change. Note that when the cursor is
-inside a table (*note Tables::), the Meta-Cursor keys have different
-functionality.
-
- ---------- Footnotes ----------
-
- (1) If you do not want the line to be split, customize the variable
-`org-M-RET-may-split-line'.
-
-
-File: org, Node: Sparse trees, Next: Plain lists, Prev: Structure editing, Up: Document Structure
-
-2.6 Sparse trees
-================
-
-An important feature of Org-mode is the ability to construct _sparse
-trees_ for selected information in an outline tree, so that the entire
-document is folded as much as possible, but the selected information is
-made visible along with the headline structure above it(1). Just try
-it out and you will see immediately how it works.
-
- Org-mode contains several commands creating such trees, all these
-commands can be accessed through a dispatcher:
-
-`C-c /' (`org-sparse-tree')
- This prompts for an extra key to select a sparse-tree creating
- command.
-
-`C-c / r' (`org-occur')
- Occur. Prompts for a regexp and shows a sparse tree with all
- matches. If the match is in a headline, the headline is made
- visible. If the match is in the body of an entry, headline and
- body are made visible. In order to provide minimal context, also
- the full hierarchy of headlines above the match is shown, as well
- as the headline following the match. Each match is also
- highlighted; the highlights disappear when the buffer is changed
- by an editing command(2), or by pressing `C-c C-c'. When called
- with a `C-u' prefix argument, previous highlights are kept, so
- several calls to this command can be stacked.
-
-For frequently used sparse trees of specific search strings, you can
-use the variable `org-agenda-custom-commands' to define fast keyboard
-access to specific sparse trees. These commands will then be
-accessible through the agenda dispatcher (*note Agenda dispatcher::).
-For example:
-
- (setq org-agenda-custom-commands
- '(("f" occur-tree "FIXME")))
-
-will define the key `C-c a f' as a shortcut for creating a sparse tree
-matching the string `FIXME'.
-
- The other sparse tree commands select headings based on TODO
-keywords, tags, or properties and will be discussed later in this
-manual.
-
- To print a sparse tree, you can use the Emacs command
-`ps-print-buffer-with-faces' which does not print invisible parts of
-the document (3). Or you can use the command `C-c C-e v' to export
-only the visible part of the document and print the resulting file.
-
- ---------- Footnotes ----------
-
- (1) See also the variables `org-show-hierarchy-above',
-`org-show-following-heading', `org-show-siblings', and
-`org-show-entry-below' for detailed control on how much context is
-shown around each match.
-
- (2) This depends on the option `org-remove-highlights-with-change'
-
- (3) This does not work under XEmacs, because XEmacs uses selective
-display for outlining, not text properties.
-
-
-File: org, Node: Plain lists, Next: Drawers, Prev: Sparse trees, Up: Document Structure
-
-2.7 Plain lists
-===============
-
-Within an entry of the outline tree, hand-formatted lists can provide
-additional structure. They also provide a way to create lists of
-checkboxes (*note Checkboxes::). Org supports editing such lists, and
-every exporter (*note Exporting::) can parse and format them.
-
- Org knows ordered lists, unordered lists, and description lists.
- * _Unordered_ list items start with `-', `+', or `*'(1) as bullets.
-
- * _Ordered_ list items start with a numeral followed by either a
- period or a right parenthesis(2), such as `1.' or `1)'. If you
- want a list to start with a different value (e.g. 20), start the
- text of the item with `[@20]'(3). Those constructs can be used in
- any item of the list in order to enforce a particular numbering.
-
- * _Description_ list items are unordered list items, and contain the
- separator ` :: ' to separate the description _term_ from the
- description.
-
- Items belonging to the same list must have the same indentation on
-the first line. In particular, if an ordered list reaches number
-`10.', then the 2-digit numbers must be written left-aligned with the
-other numbers in the list.
-
- Two methods(4) are provided to terminate lists. A list ends before
-the next line that is indented like the bullet/number or less, or it
-ends before two blank lines(5). In both cases, all levels of the list
-are closed(6). For finer control, you can end lists with any pattern
-set in `org-list-end-regexp'. Here is an example:
-
- ** Lord of the Rings
- My favorite scenes are (in this order)
- 1. The attack of the Rohirrim
- 2. Eowyn's fight with the witch king
- + this was already my favorite scene in the book
- + I really like Miranda Otto.
- 3. Peter Jackson being shot by Legolas
- He makes a really funny face when it happens.
- - on DVD only
- But in the end, no individual scenes matter but the film as a whole.
- Important actors in this film are:
- - Elijah Wood :: He plays Frodo
- - Sean Austin :: He plays Sam, Frodo's friend. I still remember
- him very well from his role as Mikey Walsh in The Goonies.
-
- Org supports these lists by tuning filling and wrapping commands to
-deal with them correctly(7), and by exporting them properly (*note
-Exporting::). Since indentation is what governs the structure of these
-lists, many structural constructs like `#+BEGIN_...' blocks can be
-indented to signal that they should be considered as a list item.
-
- If you find that using a different bullet for a sub-list (than that
-used for the current list-level) improves readability, customize the
-variable `org-list-demote-modify-bullet'.
-
- The following commands act on items when the cursor is in the first
-line of an item (the line with the bullet or number). Some of them
-imply the application of automatic rules to keep list structure intact.
-If some of these actions get in your way, configure
-`org-list-automatic-rules' to disable them individually.
-
-`<TAB>' (`org-cycle')
- Items can be folded just like headline levels. Normally this
- works only if the cursor is on a plain list item. For more
- details, see the variable `org-cycle-include-plain-lists'. If
- this variable is set to `integrate', plain list items will be
- treated like low-level headlines. The level of an item is then
- given by the indentation of the bullet/number. Items are always
- subordinate to real headlines, however; the hierarchies remain
- completely separated.
-
-`M-<RET>' (`org-insert-heading')
- Insert new item at current level. With a prefix argument, force a
- new heading (*note Structure editing::). If this command is used
- in the middle of a line, the line is _split_ and the rest of the
- line becomes the new item(8). If this command is executed _before
- an item's body_, the new item is created _before_ the current
- item. If the command is executed in the white space before the
- text that is part of an item but does not contain the bullet, a
- bullet is added to the current line.
-
- As a new item cannot be inserted in a structural construct (like
- an example or source code block) within a list, Org will instead
- insert it right before the structure, or return an error.
-
-M-S-<RET>
- Insert a new item with a checkbox (*note Checkboxes::).
-
-`<TAB>' (`org-cycle')
- In a new item with no text yet, the first <TAB> demotes the item to
- become a child of the previous one. Subsequent <TAB>s move the
- item to meaningful levels in the list and eventually get it back
- to its initial position.
-
-S-<up>
-S-<down>
- Jump to the previous/next item in the current list, but only if
- `org-support-shift-select' is off. If not, you can still use
- paragraph jumping commands like `C-<up>' and `C-<down>' to quite
- similar effect.
-
-M-S-<up>
-M-S-<down>
- Move the item including subitems up/down (swap with previous/next
- item of same indentation). If the list is ordered, renumbering is
- automatic.
-
-M-<left>
-M-<right>
- Decrease/increase the indentation of an item, leaving children
- alone.
-
-M-S-<left>
-M-S-<right>
- Decrease/increase the indentation of the item, including subitems.
- Initially, the item tree is selected based on current indentation.
- When these commands are executed several times in direct
- succession, the initially selected region is used, even if the new
- indentation would imply a different hierarchy. To use the new
- hierarchy, break the command chain with a cursor motion or so.
-
- As a special case, using this command on the very first item of a
- list will move the whole list. This behavior can be disabled by
- configuring `org-list-automatic-rules'. The global indentation of
- a list has no influence on the text _after_ the list.
-
-C-c C-c
- If there is a checkbox (*note Checkboxes::) in the item line,
- toggle the state of the checkbox. Also, makes sure that all the
- items on this list level use the same bullet and that the
- numbering of list items (if applicable) is correct.
-
-C-c -
- Cycle the entire list level through the different
- itemize/enumerate bullets (`-', `+', `*', `1.', `1)') or a subset
- of them, depending on `org-plain-list-ordered-item-terminator',
- the type of list, and its position(9). With a numeric prefix
- argument N, select the Nth bullet from this list. If there is an
- active region when calling this, all lines will be converted to
- list items. If the first line already was a list item, any item
- markers will be removed from the list. Finally, even without an
- active region, a normal line will be converted into a list item.
-
-C-c *
- Turn a plain list item into a headline (so that it becomes a
- subheading at its location). *Note Structure editing::, for a
- detailed explanation.
-
-S-<left>/<right>
- This command also cycles bullet styles when the cursor in on the
- bullet or anywhere in an item line, details depending on
- `org-support-shift-select'.
-
-C-c ^
- Sort the plain list. You will be prompted for the sorting method:
- numerically, alphabetically, by time, or by custom function.
-
- ---------- Footnotes ----------
-
- (1) When using `*' as a bullet, lines must be indented or they will
-be seen as top-level headlines. Also, when you are hiding leading
-stars to get a clean outline view, plain list items starting with a
-star are visually indistinguishable from true headlines. In short:
-even though `*' is supported, it may be better to not use it for plain
-list items.
-
- (2) You can filter out any of them by configuring
-`org-plain-list-ordered-item-terminator'.
-
- (3) If there's a checkbox in the item, the cookie must be put
-_before_ the checkbox.
-
- (4) To disable either of them, configure `org-list-ending-method'.
-
- (5) See also `org-empty-line-terminates-plain-lists'.
-
- (6) So you cannot have a sublist, some text and then another sublist
-while still in the same top-level list item. This used to be possible,
-but it was only supported in the HTML exporter and difficult to manage
-with automatic indentation.
-
- (7) Org only changes the filling settings for Emacs. For XEmacs,
-you should use Kyle E. Jones' `filladapt.el'. To turn this on, put
-into `.emacs': `(require 'filladapt)'
-
- (8) If you do not want the line to be split, customize the variable
-`org-M-RET-may-split-line'.
-
- (9) See `bullet' rule in `org-list-automatic-rules' for more
-information.
-
-
-File: org, Node: Drawers, Next: Blocks, Prev: Plain lists, Up: Document Structure
-
-2.8 Drawers
-===========
-
-Sometimes you want to keep information associated with an entry, but you
-normally don't want to see it. For this, Org-mode has _drawers_.
-Drawers need to be configured with the variable `org-drawers'(1).
-Drawers look like this:
-
- ** This is a headline
- Still outside the drawer
- :DRAWERNAME:
- This is inside the drawer.
- :END:
- After the drawer.
-
- Visibility cycling (*note Visibility cycling::) on the headline will
-hide and show the entry, but keep the drawer collapsed to a single
-line. In order to look inside the drawer, you need to move the cursor
-to the drawer line and press <TAB> there. Org-mode uses the
-`PROPERTIES' drawer for storing properties (*note Properties and
-Columns::), and you can also arrange for state change notes (*note
-Tracking TODO state changes::) and clock times (*note Clocking work
-time::) to be stored in a drawer `LOGBOOK'. If you want to store a
-quick note in the LOGBOOK drawer, in a similar way to state changes, use
-
-`C-c C-z'
- Add a time-stamped note to the LOGBOOK drawer.
-
- ---------- Footnotes ----------
-
- (1) You can define drawers on a per-file basis with a line like
-`#+DRAWERS: HIDDEN PROPERTIES STATE'
-
-
-File: org, Node: Blocks, Next: Footnotes, Prev: Drawers, Up: Document Structure
-
-2.9 Blocks
-==========
-
-Org-mode uses begin...end blocks for various purposes from including
-source code examples (*note Literal examples::) to capturing time
-logging information (*note Clocking work time::). These blocks can be
-folded and unfolded by pressing TAB in the begin line. You can also
-get all blocks folded at startup by configuring the variable
-`org-hide-block-startup' or on a per-file basis by using
-
- #+STARTUP: hideblocks
- #+STARTUP: nohideblocks
-
-
-File: org, Node: Footnotes, Next: Orgstruct mode, Prev: Blocks, Up: Document Structure
-
-2.10 Footnotes
-==============
-
-Org-mode supports the creation of footnotes. In contrast to the
-`footnote.el' package, Org-mode's footnotes are designed for work on a
-larger document, not only for one-off documents like emails. The basic
-syntax is similar to the one used by `footnote.el', i.e. a footnote is
-defined in a paragraph that is started by a footnote marker in square
-brackets in column 0, no indentation allowed. If you need a paragraph
-break inside a footnote, use the LaTeX idiom `\par'. The footnote
-reference is simply the marker in square brackets, inside text. For
-example:
-
- The Org homepage[fn:1] now looks a lot better than it used to.
- ...
- [fn:1] The link is: http://orgmode.org
-
- Org-mode extends the number-based syntax to _named_ footnotes and
-optional inline definition. Using plain numbers as markers (as
-`footnote.el' does) is supported for backward compatibility, but not
-encouraged because of possible conflicts with LaTeX snippets (*note
-Embedded LaTeX::). Here are the valid references:
-
-`[1]'
- A plain numeric footnote marker. Compatible with `footnote.el',
- but not recommended because something like `[1]' could easily be
- part of a code snippet.
-
-`[fn:name]'
- A named footnote reference, where `name' is a unique label word,
- or, for simplicity of automatic creation, a number.
-
-`[fn:: This is the inline definition of this footnote]'
- A LaTeX-like anonymous footnote where the definition is given
- directly at the reference point.
-
-`[fn:name: a definition]'
- An inline definition of a footnote, which also specifies a name
- for the note. Since Org allows multiple references to the same
- note, you can then use `[fn:name]' to create additional references.
-
- Footnote labels can be created automatically, or you can create
-names yourself. This is handled by the variable
-`org-footnote-auto-label' and its corresponding `#+STARTUP' keywords.
-See the docstring of that variable for details.
-
-The following command handles footnotes:
-
-`C-c C-x f'
- The footnote action command.
-
- When the cursor is on a footnote reference, jump to the
- definition. When it is at a definition, jump to the (first)
- reference.
-
- Otherwise, create a new footnote. Depending on the variable
- `org-footnote-define-inline'(1), the definition will be placed
- right into the text as part of the reference, or separately into
- the location determined by the variable `org-footnote-section'.
-
- When this command is called with a prefix argument, a menu of
- additional options is offered:
- s Sort the footnote definitions by reference sequence. During editing,
- Org makes no effort to sort footnote definitions into a particular
- sequence. If you want them sorted, use this command, which will
- also move entries according to `org-footnote-section'. Automatic
- sorting after each insertion/deletion can be configured using the
- variable `org-footnote-auto-adjust'.
- r Renumber the simple `fn:N' footnotes. Automatic renumbering
- after each insertion/deletion can be configured using the variable
- `org-footnote-auto-adjust'.
- S Short for first `r', then `s' action.
- n Normalize the footnotes by collecting all definitions (including
- inline definitions) into a special section, and then numbering them
- in sequence. The references will then also be numbers. This is
- meant to be the final step before finishing a document (e.g. sending
- off an email). The exporters do this automatically, and so could
- something like `message-send-hook'.
- d Delete the footnote at point, and all definitions of and references
- to it.
- Depending on the variable `org-footnote-auto-adjust'(2),
- renumbering and sorting footnotes can be automatic after each
- insertion or deletion.
-
-`C-c C-c'
- If the cursor is on a footnote reference, jump to the definition.
- If it is a the definition, jump back to the reference. When
- called at a footnote location with a prefix argument, offer the
- same menu as `C-c C-x f'.
-
-`C-c C-o or mouse-1/2'
- Footnote labels are also links to the corresponding
- definition/reference, and you can use the usual commands to follow
- these links.
-
- ---------- Footnotes ----------
-
- (1) The corresponding in-buffer setting is: `#+STARTUP: fninline' or
-`#+STARTUP: nofninline'
-
- (2) the corresponding in-buffer options are `fnadjust' and
-`nofnadjust'.
-
-
-File: org, Node: Orgstruct mode, Prev: Footnotes, Up: Document Structure
-
-2.11 The Orgstruct minor mode
-=============================
-
-If you like the intuitive way the Org-mode structure editing and list
-formatting works, you might want to use these commands in other modes
-like Text mode or Mail mode as well. The minor mode `orgstruct-mode'
-makes this possible. Toggle the mode with `M-x orgstruct-mode', or
-turn it on by default, for example in Mail mode, with one of:
-
- (add-hook 'mail-mode-hook 'turn-on-orgstruct)
- (add-hook 'mail-mode-hook 'turn-on-orgstruct++)
-
- When this mode is active and the cursor is on a line that looks to
-Org like a headline or the first line of a list item, most structure
-editing commands will work, even if the same keys normally have
-different functionality in the major mode you are using. If the cursor
-is not in one of those special lines, Orgstruct mode lurks silently in
-the shadows. When you use `orgstruct++-mode', Org will also export
-indentation and autofill settings into that mode, and detect item
-context after the first line of an item.
-
-
-File: org, Node: Tables, Next: Hyperlinks, Prev: Document Structure, Up: Top
-
-3 Tables
-********
-
-Org comes with a fast and intuitive table editor. Spreadsheet-like
-calculations are supported using the Emacs `calc' package (*note Calc:
-(Calc)Top.).
-
-* Menu:
-
-* Built-in table editor:: Simple tables
-* Column width and alignment:: Overrule the automatic settings
-* Column groups:: Grouping to trigger vertical lines
-* Orgtbl mode:: The table editor as minor mode
-* The spreadsheet:: The table editor has spreadsheet capabilities
-* Org-Plot:: Plotting from org tables
-
-
-File: org, Node: Built-in table editor, Next: Column width and alignment, Prev: Tables, Up: Tables
-
-3.1 The built-in table editor
-=============================
-
-Org makes it easy to format tables in plain ASCII. Any line with `|'
-as the first non-whitespace character is considered part of a table.
-`|' is also the column separator. A table might look like this:
-
- | Name | Phone | Age |
- |-------+-------+-----|
- | Peter | 1234 | 17 |
- | Anna | 4321 | 25 |
-
- A table is re-aligned automatically each time you press <TAB> or
-<RET> or `C-c C-c' inside the table. <TAB> also moves to the next
-field (<RET> to the next row) and creates new table rows at the end of
-the table or before horizontal lines. The indentation of the table is
-set by the first line. Any line starting with `|-' is considered as a
-horizontal separator line and will be expanded on the next re-align to
-span the whole table width. So, to create the above table, you would
-only type
-
- |Name|Phone|Age|
- |-
-
-and then press <TAB> to align the table and start filling in fields.
-Even faster would be to type `|Name|Phone|Age' followed by `C-c <RET>'.
-
- When typing text into a field, Org treats <DEL>, <Backspace>, and
-all character keys in a special way, so that inserting and deleting
-avoids shifting other fields. Also, when typing _immediately after the
-cursor was moved into a new field with `<TAB>', `S-<TAB>' or `<RET>'_,
-the field is automatically made blank. If this behavior is too
-unpredictable for you, configure the variables
-`org-enable-table-editor' and `org-table-auto-blank-field'.
-
-Creation and conversion
-.......................
-
-`C-c | (`org-table-create-or-convert-from-region')'
- Convert the active region to table. If every line contains at
- least one TAB character, the function assumes that the material is
- tab separated. If every line contains a comma, comma-separated
- values (CSV) are assumed. If not, lines are split at whitespace
- into fields. You can use a prefix argument to force a specific
- separator: `C-u' forces CSV, `C-u C-u' forces TAB, and a numeric
- argument N indicates that at least N consecutive spaces, or
- alternatively a TAB will be the separator.
- If there is no active region, this command creates an empty Org
- table. But it's easier just to start typing, like
- `|Name|Phone|Age <RET> |- <TAB>'.
-
-Re-aligning and field motion
-............................
-
-`C-c C-c (`org-table-align')'
- Re-align the table without moving the cursor.
-
-`<TAB> (`org-table-next-field')'
- Re-align the table, move to the next field. Creates a new row if
- necessary.
-
-`S-<TAB> (`org-table-previous-field')'
- Re-align, move to previous field.
-
-`<RET> (`org-table-next-row')'
- Re-align the table and move down to next row. Creates a new row if
- necessary. At the beginning or end of a line, <RET> still does
- NEWLINE, so it can be used to split a table.
-
-`M-a (`org-table-beginning-of-field')'
- Move to beginning of the current table field, or on to the
- previous field.
-
-`M-e (`org-table-end-of-field')'
- Move to end of the current table field, or on to the next field.
-
-Column and row editing
-......................
-
-`M-<left> (`org-table-move-column-left')'
-`M-<right> (`org-table-move-column-right')'
- Move the current column left/right.
-
-`M-S-<left> (`org-table-delete-column')'
- Kill the current column.
-
-`M-S-<right> (`org-table-insert-column')'
- Insert a new column to the left of the cursor position.
-
-`M-<up> (`org-table-move-row-up')'
-`M-<down> (`org-table-move-row-down')'
- Move the current row up/down.
-
-`M-S-<up> (`org-table-kill-row')'
- Kill the current row or horizontal line.
-
-`M-S-<down> (`org-table-insert-row')'
- Insert a new row above the current row. With a prefix argument,
- the line is created below the current one.
-
-`C-c - (`org-table-insert-hline')'
- Insert a horizontal line below current row. With a prefix
- argument, the line is created above the current line.
-
-`C-c <RET> (`org-table-hline-and-move')'
- Insert a horizontal line below current row, and move the cursor
- into the row below that line.
-
-`C-c ^ (`org-table-sort-lines')'
- Sort the table lines in the region. The position of point
- indicates the column to be used for sorting, and the range of
- lines is the range between the nearest horizontal separator lines,
- or the entire table. If point is before the first column, you
- will be prompted for the sorting column. If there is an active
- region, the mark specifies the first line and the sorting column,
- while point should be in the last line to be included into the
- sorting. The command prompts for the sorting type
- (alphabetically, numerically, or by time). When called with a
- prefix argument, alphabetic sorting will be case-sensitive.
-
-Regions
-.......
-
-`C-c C-x M-w (`org-table-copy-region')'
- Copy a rectangular region from a table to a special clipboard.
- Point and mark determine edge fields of the rectangle. If there
- is no active region, copy just the current field. The process
- ignores horizontal separator lines.
-
-`C-c C-x C-w (`org-table-cut-region')'
- Copy a rectangular region from a table to a special clipboard, and
- blank all fields in the rectangle. So this is the "cut" operation.
-
-`C-c C-x C-y (`org-table-paste-rectangle')'
- Paste a rectangular region into a table. The upper left corner
- ends up in the current field. All involved fields will be
- overwritten. If the rectangle does not fit into the present table,
- the table is enlarged as needed. The process ignores horizontal
- separator lines.
-
-`M-<RET> (`org-table-wrap-region')'
- Split the current field at the cursor position and move the rest
- to the line below. If there is an active region, and both point
- and mark are in the same column, the text in the column is wrapped
- to minimum width for the given number of lines. A numeric prefix
- argument may be used to change the number of desired lines. If
- there is no region, but you specify a prefix argument, the current
- field is made blank, and the content is appended to the field
- above.
-
-Calculations
-............
-
-`C-c + (`org-table-sum')'
- Sum the numbers in the current column, or in the rectangle defined
- by the active region. The result is shown in the echo area and can
- be inserted with `C-y'.
-
-`S-<RET> (`org-table-copy-down')'
- When current field is empty, copy from first non-empty field
- above. When not empty, copy current field down to next row and
- move cursor along with it. Depending on the variable
- `org-table-copy-increment', integer field values will be
- incremented during copy. Integers that are too large will not be
- incremented. Also, a `0' prefix argument temporarily disables the
- increment. This key is also used by shift-selection and related
- modes (*note Conflicts::).
-
-Miscellaneous
-.............
-
-`C-c ` (`org-table-edit-field')'
- Edit the current field in a separate window. This is useful for
- fields that are not fully visible (*note Column width and
- alignment::). When called with a `C-u' prefix, just make the full
- field visible, so that it can be edited in place.
-
-`M-x org-table-import'
- Import a file as a table. The table should be TAB or whitespace
- separated. Use, for example, to import a spreadsheet table or data
- from a database, because these programs generally can write
- TAB-separated text files. This command works by inserting the
- file into the buffer and then converting the region to a table.
- Any prefix argument is passed on to the converter, which uses it
- to determine the separator.
-
-`C-c | (`org-table-create-or-convert-from-region')'
- Tables can also be imported by pasting tabular text into the Org
- buffer, selecting the pasted text with `C-x C-x' and then using the
- `C-c |' command (see above under Creation and conversion).
-
-`M-x org-table-export'
- Export the table, by default as a TAB-separated file. Use for data
- exchange with, for example, spreadsheet or database programs. The
- format used to export the file can be configured in the variable
- `org-table-export-default-format'. You may also use properties
- `TABLE_EXPORT_FILE' and `TABLE_EXPORT_FORMAT' to specify the file
- name and the format for table export in a subtree. Org supports
- quite general formats for exported tables. The exporter format is
- the same as the format used by Orgtbl radio tables, see *Note
- Translator functions::, for a detailed description.
-
- If you don't like the automatic table editor because it gets in your
-way on lines which you would like to start with `|', you can turn it
-off with
-
- (setq org-enable-table-editor nil)
-
-Then the only table command that still works is `C-c C-c' to do a
-manual re-align.
-
-
-File: org, Node: Column width and alignment, Next: Column groups, Prev: Built-in table editor, Up: Tables
-
-3.2 Column width and alignment
-==============================
-
-The width of columns is automatically determined by the table editor.
-And also the alignment of a column is determined automatically from the
-fraction of number-like versus non-number fields in the column.
-
- Sometimes a single field or a few fields need to carry more text,
-leading to inconveniently wide columns. Or maybe you want to make a
-table with several columns having a fixed width, regardless of content.
-To set(1) the width of a column, one field anywhere in the column may
-contain just the string `<N>' where `N' is an integer specifying the
-width of the column in characters. The next re-align will then set the
-width of this column to this value.
-
- |---+------------------------------| |---+--------|
- | | | | | <6> |
- | 1 | one | | 1 | one |
- | 2 | two | ----\ | 2 | two |
- | 3 | This is a long chunk of text | ----/ | 3 | This=> |
- | 4 | four | | 4 | four |
- |---+------------------------------| |---+--------|
-
-Fields that are wider become clipped and end in the string `=>'. Note
-that the full text is still in the buffer but is hidden. To see the
-full text, hold the mouse over the field--a tool-tip window will show
-the full content. To edit such a field, use the command `C-c `' (that
-is `C-c' followed by the backquote). This will open a new window with
-the full field. Edit it and finish with `C-c C-c'.
-
- When visiting a file containing a table with narrowed columns, the
-necessary character hiding has not yet happened, and the table needs to
-be aligned before it looks nice. Setting the option
-`org-startup-align-all-tables' will realign all tables in a file upon
-visiting, but also slow down startup. You can also set this option on
-a per-file basis with:
-
- #+STARTUP: align
- #+STARTUP: noalign
-
- If you would like to overrule the automatic alignment of number-rich
-columns to the right and of string-rich column to the left, you can use
-`<r>', `c'(2) or `<l>' in a similar fashion. You may also combine
-alignment and field width like this: `<l10>'.
-
- Lines which only contain these formatting cookies will be removed
-automatically when exporting the document.
-
- ---------- Footnotes ----------
-
- (1) This feature does not work on XEmacs.
-
- (2) Centering does not work inside Emacs, but it does have an effect
-when exporting to HTML.
-
-
-File: org, Node: Column groups, Next: Orgtbl mode, Prev: Column width and alignment, Up: Tables
-
-3.3 Column groups
-=================
-
-When Org exports tables, it does so by default without vertical lines
-because that is visually more satisfying in general. Occasionally
-however, vertical lines can be useful to structure a table into groups
-of columns, much like horizontal lines can do for groups of rows. In
-order to specify column groups, you can use a special row where the
-first field contains only `/'. The further fields can either contain
-`<' to indicate that this column should start a group, `>' to indicate
-the end of a column, or `<>' to make a column a group of its own.
-Boundaries between column groups will upon export be marked with
-vertical lines. Here is an example:
-
- | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
- |---+-----+-----+-----+---------+------------|
- | / | < | | > | < | > |
- | 1 | 1 | 1 | 1 | 1 | 1 |
- | 2 | 4 | 8 | 16 | 1.4142 | 1.1892 |
- | 3 | 9 | 27 | 81 | 1.7321 | 1.3161 |
- |---+-----+-----+-----+---------+------------|
- #+TBLFM: $2=$1^2::$3=$1^3::$4=$1^4::$5=sqrt($1)::$6=sqrt(sqrt(($1)))
-
- It is also sufficient to just insert the column group starters after
-every vertical line you would like to have:
-
- | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
- |----+-----+-----+-----+---------+------------|
- | / | < | | | < | |
-
-
-File: org, Node: Orgtbl mode, Next: The spreadsheet, Prev: Column groups, Up: Tables
-
-3.4 The Orgtbl minor mode
-=========================
-
-If you like the intuitive way the Org table editor works, you might
-also want to use it in other modes like Text mode or Mail mode. The
-minor mode Orgtbl mode makes this possible. You can always toggle the
-mode with `M-x orgtbl-mode'. To turn it on by default, for example in
-mail mode, use
-
- (add-hook 'mail-mode-hook 'turn-on-orgtbl)
-
- Furthermore, with some special setup, it is possible to maintain
-tables in arbitrary syntax with Orgtbl mode. For example, it is
-possible to construct LaTeX tables with the underlying ease and power of
-Orgtbl mode, including spreadsheet capabilities. For details, see
-*Note Tables in arbitrary syntax::.
-
-
-File: org, Node: The spreadsheet, Next: Org-Plot, Prev: Orgtbl mode, Up: Tables
-
-3.5 The spreadsheet
-===================
-
-The table editor makes use of the Emacs `calc' package to implement
-spreadsheet-like capabilities. It can also evaluate Emacs Lisp forms to
-derive fields from other fields. While fully featured, Org's
-implementation is not identical to other spreadsheets. For example,
-Org knows the concept of a _column formula_ that will be applied to all
-non-header fields in a column without having to copy the formula to
-each relevant field. There is also a formula debugger, and a formula
-editor with features for highlighting fields in the table corresponding
-to the references at the point in the formula, moving these references
-by arrow keys
-
-* Menu:
-
-* References:: How to refer to another field or range
-* Formula syntax for Calc:: Using Calc to compute stuff
-* Formula syntax for Lisp:: Writing formulas in Emacs Lisp
-* Field formulas:: Formulas valid for a single field
-* Column formulas:: Formulas valid for an entire column
-* Editing and debugging formulas:: Fixing formulas
-* Updating the table:: Recomputing all dependent fields
-* Advanced features:: Field names, parameters and automatic recalc
-
-
-File: org, Node: References, Next: Formula syntax for Calc, Prev: The spreadsheet, Up: The spreadsheet
-
-3.5.1 References
-----------------
-
-To compute fields in the table from other fields, formulas must
-reference other fields or ranges. In Org, fields can be referenced by
-name, by absolute coordinates, and by relative coordinates. To find
-out what the coordinates of a field are, press `C-c ?' in that field,
-or press `C-c }' to toggle the display of a grid.
-
-Field references
-................
-
-Formulas can reference the value of another field in two ways. Like in
-any other spreadsheet, you may reference fields with a letter/number
-combination like `B3', meaning the 2nd field in the 3rd row.
-
-Org also uses another, more general operator that looks like this:
- @ROW$COLUMN
-
-Column references can be absolute like `1', `2',...`N', or relative to
-the current column like `+1' or `-2'.
-
- The row specification only counts data lines and ignores horizontal
-separator lines (hlines). You can use absolute row numbers `1'...`N',
-and row numbers relative to the current row like `+3' or `-1'. Or
-specify the row relative to one of the hlines: `I' refers to the first
-hline(1), `II' to the second, etc. `-I' refers to the first such line
-above the current line, `+I' to the first such line below the current
-line. You can also write `III+2' which is the second data line after
-the third hline in the table.
-
- `0' refers to the current row and column. Also, if you omit either
-the column or the row part of the reference, the current row/column is
-implied.
-
- Org's references with _unsigned_ numbers are fixed references in the
-sense that if you use the same reference in the formula for two
-different fields, the same field will be referenced each time. Org's
-references with _signed_ numbers are floating references because the
-same reference operator can reference different fields depending on the
-field being calculated by the formula.
-
- As a special case, references like `$LR5' and `$LR12' can be used to
-refer in a stable way to the 5th and 12th field in the last row of the
-table.
-
- Here are a few examples:
-
- @2$3 2nd row, 3rd column
- C2 same as previous
- $5 column 5 in the current row
- E& same as previous
- @2 current column, row 2
- @-1$-3 the field one row up, three columns to the left
- @-I$2 field just under hline above current row, column 2
-
-Range references
-................
-
-You may reference a rectangular range of fields by specifying two field
-references connected by two dots `..'. If both fields are in the
-current row, you may simply use `$2..$7', but if at least one field is
-in a different row, you need to use the general `@row$column' format at
-least for the first field (i.e the reference must start with `@' in
-order to be interpreted correctly). Examples:
-
- $1..$3 First three fields in the current row.
- $P..$Q Range, using column names (see under Advanced)
- @2$1..@4$3 6 fields between these two fields.
- A2..C4 Same as above.
- @-1$-2..@-1 3 numbers from the column to the left, 2 up to current row
-
-Range references return a vector of values that can be fed into Calc
-vector functions. Empty fields in ranges are normally suppressed, so
-that the vector contains only the non-empty fields (but see the `E'
-mode switch below). If there are no non-empty fields, `[0]' is
-returned to avoid syntax errors in formulas.
-
-Field coordinates in formulas
-.............................
-
-For Calc formulas and Lisp formulas `@#' and `$#' can be used to get
-the row or column number of the field where the formula result goes.
-The traditional Lisp formula equivalents are `org-table-current-dline'
-and `org-table-current-column'. Examples:
-
- if(@# % 2, $#, string("")) column number on odd lines only
- $3 = remote(FOO, @@#$2) copy column 2 from table FOO into
- column 3 of the current table
-
-For the second example, table FOO must have at least as many rows as
-the current table. Inefficient(2) for large number of rows.
-
-Named references
-................
-
-`$name' is interpreted as the name of a column, parameter or constant.
-Constants are defined globally through the variable
-`org-table-formula-constants', and locally (for the file) through a
-line like
-
- #+CONSTANTS: c=299792458. pi=3.14 eps=2.4e-6
-
-Also properties (*note Properties and Columns::) can be used as
-constants in table formulas: for a property `:Xyz:' use the name
-`$PROP_Xyz', and the property will be searched in the current outline
-entry and in the hierarchy above it. If you have the `constants.el'
-package, it will also be used to resolve constants, including natural
-constants like `$h' for Planck's constant, and units like `$km' for
-kilometers(3). Column names and parameters can be specified in special
-table lines. These are described below, see *Note Advanced features::.
-All names must start with a letter, and further consist of letters and
-numbers.
-
-Remote references
-.................
-
-You may also reference constants, fields and ranges from a different
-table, either in the current file or even in a different file. The
-syntax is
-
- remote(NAME-OR-ID,REF)
-
-where NAME can be the name of a table in the current file as set by a
-`#+TBLNAME: NAME' line before the table. It can also be the ID of an
-entry, even in a different file, and the reference then refers to the
-first table in that entry. REF is an absolute field or range reference
-as described above for example `@3$3' or `$somename', valid in the
-referenced table.
-
- ---------- Footnotes ----------
-
- (1) Note that only hlines are counted that _separate_ table lines.
-If the table starts with a hline above the header, it does not count.
-
- (2) The computation time scales as O(N^2) because table FOO is
-parsed for each field to be copied.
-
- (3) `constants.el' can supply the values of constants in two
-different unit systems, `SI' and `cgs'. Which one is used depends on
-the value of the variable `constants-unit-system'. You can use the
-`#+STARTUP' options `constSI' and `constcgs' to set this value for the
-current buffer.
-
-
-File: org, Node: Formula syntax for Calc, Next: Formula syntax for Lisp, Prev: References, Up: The spreadsheet
-
-3.5.2 Formula syntax for Calc
------------------------------
-
-A formula can be any algebraic expression understood by the Emacs
-`Calc' package. Note that `calc' has the non-standard convention that
-`/' has lower precedence than `*', so that `a/b*c' is interpreted as
-`a/(b*c)'. Before evaluation by `calc-eval' (*note calc-eval:
-(Calc)Calling Calc from Your Programs.), variable substitution takes
-place according to the rules described above. The range vectors can be
-directly fed into the Calc vector functions like `vmean' and `vsum'.
-
- A formula can contain an optional mode string after a semicolon.
-This string consists of flags to influence Calc and other modes during
-execution. By default, Org uses the standard Calc modes (precision 12,
-angular units degrees, fraction and symbolic modes off). The display
-format, however, has been changed to `(float 8)' to keep tables
-compact. The default settings can be configured using the variable
-`org-calc-default-modes'.
-
- p20 set the internal Calc calculation precision to 20 digits
- n3 s3 e2 f4 Normal, scientific, engineering, or fixed
- format of the result of Calc passed back to Org.
- Calc formatting is unlimited in precision as
- long as the Calc calculation precision is greater.
- D R angle modes: degrees, radians
- F S fraction and symbolic modes
- N interpret all fields as numbers, use 0 for non-numbers
- T force text interpretation
- E keep empty fields in ranges
- L literal
-
-Unless you use large integer numbers or high-precision-calculation and
--display for floating point numbers you may alternatively provide a
-`printf' format specifier to reformat the Calc result after it has been
-passed back to Org instead of letting Calc already do the formatting(1).
-A few examples:
-
- $1+$2 Sum of first and second field
- $1+$2;%.2f Same, format result to two decimals
- exp($2)+exp($1) Math functions can be used
- $0;%.1f Reformat current cell to 1 decimal
- ($3-32)*5/9 Degrees F -> C conversion
- $c/$1/$cm Hz -> cm conversion, using `constants.el'
- tan($1);Dp3s1 Compute in degrees, precision 3, display SCI 1
- sin($1);Dp3%.1e Same, but use printf specifier for display
- vmean($2..$7) Compute column range mean, using vector function
- vmean($2..$7);EN Same, but treat empty fields as 0
- taylor($3,x=7,2) Taylor series of $3, at x=7, second degree
-
- Calc also contains a complete set of logical operations. For example
-
- if($1<20,teen,string("")) "teen" if age $1 less than 20, else empty
-
- ---------- Footnotes ----------
-
- (1) The `printf' reformatting is limited in precision because the
-value passed to it is converted into an `integer' or `double'. The
-`integer' is limited in size by truncating the signed value to 32 bits.
-The `double' is limited in precision to 64 bits overall which leaves
-approximately 16 significant decimal digits.
-
-
-File: org, Node: Formula syntax for Lisp, Next: Field formulas, Prev: Formula syntax for Calc, Up: The spreadsheet
-
-3.5.3 Emacs Lisp forms as formulas
-----------------------------------
-
-It is also possible to write a formula in Emacs Lisp; this can be
-useful for string manipulation and control structures, if Calc's
-functionality is not enough. If a formula starts with a single-quote
-followed by an opening parenthesis, then it is evaluated as a Lisp
-form. The evaluation should return either a string or a number. Just
-as with `calc' formulas, you can specify modes and a printf format
-after a semicolon. With Emacs Lisp forms, you need to be conscious
-about the way field references are interpolated into the form. By
-default, a reference will be interpolated as a Lisp string (in
-double-quotes) containing the field. If you provide the `N' mode
-switch, all referenced elements will be numbers (non-number fields will
-be zero) and interpolated as Lisp numbers, without quotes. If you
-provide the `L' flag, all fields will be interpolated literally,
-without quotes. I.e., if you want a reference to be interpreted as a
-string by the Lisp form, enclose the reference operator itself in
-double-quotes, like `"$3"'. Ranges are inserted as space-separated
-fields, so you can +embed them in list or vector syntax. Here are a
-few examples--note how the `N' mode is used when we do computations in
-Lisp:
-
- Swap the first two characters of the content of column 1
- '(concat (substring $1 1 2) (substring $1 0 1) (substring $1 2))
- Add columns 1 and 2, equivalent to Calc's `$1+$2'
- '(+ $1 $2);N
- Compute the sum of columns 1-4, like Calc's `vsum($1..$4)'
- '(apply '+ '($1..$4));N
-
-
-File: org, Node: Field formulas, Next: Column formulas, Prev: Formula syntax for Lisp, Up: The spreadsheet
-
-3.5.4 Field formulas
---------------------
-
-To assign a formula to a particular field, type it directly into the
-field, preceded by `:=', for example `:=$1+$2'. When you press <TAB>
-or <RET> or `C-c C-c' with the cursor still in the field, the formula
-will be stored as the formula for this field, evaluated, and the
-current field replaced with the result.
-
- Formulas are stored in a special line starting with `#+TBLFM:'
-directly below the table. If you type the equation in the 4th field of
-the 3rd data line in the table, the formula will look like
-`@3$4=$1+$2'. When inserting/deleting/swapping column and rows with
-the appropriate commands, absolute references (but not relative ones)
-in stored formulas are modified in order to still reference the same
-field. Of course this is not true if you edit the table structure with
-normal editing commands--then you must fix the equations yourself. The
-left-hand side of a formula may also be a named field (*note Advanced
-features::), or a last-row reference like `$LR3'.
-
- Instead of typing an equation into the field, you may also use the
-following command
-
-`C-u C-c = (`org-table-eval-formula')'
- Install a new formula for the current field. The command prompts
- for a formula with default taken from the `#+TBLFM:' line, applies
- it to the current field, and stores it.
-
-
-File: org, Node: Column formulas, Next: Editing and debugging formulas, Prev: Field formulas, Up: The spreadsheet
-
-3.5.5 Column formulas
----------------------
-
-Often in a table, the same formula should be used for all fields in a
-particular column. Instead of having to copy the formula to all fields
-in that column, Org allows you to assign a single formula to an entire
-column. If the table contains horizontal separator hlines, everything
-before the first such line is considered part of the table _header_ and
-will not be modified by column formulas.
-
- To assign a formula to a column, type it directly into any field in
-the column, preceded by an equal sign, like `=$1+$2'. When you press
-<TAB> or <RET> or `C-c C-c' with the cursor still in the field, the
-formula will be stored as the formula for the current column, evaluated
-and the current field replaced with the result. If the field contains
-only `=', the previously stored formula for this column is used. For
-each column, Org will only remember the most recently used formula. In
-the `#+TBLFM:' line, column formulas will look like `$4=$1+$2'. The
-left-hand side of a column formula cannot currently be the name of
-column, it must be the numeric column reference.
-
- Instead of typing an equation into the field, you may also use the
-following command:
-
-`C-c = (`org-table-eval-formula')'
- Install a new formula for the current column and replace current
- field with the result of the formula. The command prompts for a
- formula, with default taken from the `#+TBLFM' line, applies it to
- the current field and stores it. With a numeric prefix
- argument(e.g. `C-5 C-c =') the command will apply it to that many
- consecutive fields in the current column.
-
-
-File: org, Node: Editing and debugging formulas, Next: Updating the table, Prev: Column formulas, Up: The spreadsheet
-
-3.5.6 Editing and debugging formulas
-------------------------------------
-
-You can edit individual formulas in the minibuffer or directly in the
-field. Org can also prepare a special buffer with all active formulas
-of a table. When offering a formula for editing, Org converts
-references to the standard format (like `B3' or `D&') if possible. If
-you prefer to only work with the internal format (like `@3$2' or `$4'),
-configure the variable `org-table-use-standard-references'.
-
-`C-c = or C-u C-c = (`org-table-eval-formula')'
- Edit the formula associated with the current column/field in the
- minibuffer. See *Note Column formulas::, and *Note Field
- formulas::.
-
-`C-u C-u C-c = (`org-table-eval-formula')'
- Re-insert the active formula (either a field formula, or a column
- formula) into the current field, so that you can edit it directly
- in the field. The advantage over editing in the minibuffer is
- that you can use the command `C-c ?'.
-
-`C-c ? (`org-table-field-info')'
- While editing a formula in a table field, highlight the field(s)
- referenced by the reference at the cursor position in the formula.
-
-`C-c }'
- Toggle the display of row and column numbers for a table, using
- overlays (`org-table-toggle-coordinate-overlays'). These are
- updated each time the table is aligned; you can force it with `C-c
- C-c'.
-
-`C-c {'
- Toggle the formula debugger on and off
- (`org-table-toggle-formula-debugger'). See below.
-
-`C-c ' (`org-table-edit-formulas')'
- Edit all formulas for the current table in a special buffer, where
- the formulas will be displayed one per line. If the current field
- has an active formula, the cursor in the formula editor will mark
- it. While inside the special buffer, Org will automatically
- highlight any field or range reference at the cursor position.
- You may edit, remove and add formulas, and use the following
- commands:
- `C-c C-c or C-x C-s (`org-table-fedit-finish')'
- Exit the formula editor and store the modified formulas.
- With `C-u' prefix, also apply the new formulas to the entire
- table.
-
- `C-c C-q (`org-table-fedit-abort')'
- Exit the formula editor without installing changes.
-
- `C-c C-r (`org-table-fedit-toggle-ref-type')'
- Toggle all references in the formula editor between standard
- (like `B3') and internal (like `@3$2').
-
- `<TAB> (`org-table-fedit-lisp-indent')'
- Pretty-print or indent Lisp formula at point. When in a line
- containing a Lisp formula, format the formula according to
- Emacs Lisp rules. Another <TAB> collapses the formula back
- again. In the open formula, <TAB> re-indents just like in
- Emacs Lisp mode.
-
- `M-<TAB> (`lisp-complete-symbol')'
- Complete Lisp symbols, just like in Emacs Lisp mode.
-
- `S-<up>/<down>/<left>/<right>'
- Shift the reference at point. For example, if the reference
- is `B3' and you press `S-<right>', it will become `C3'. This
- also works for relative references and for hline references.
-
- `M-S-<up> (`org-table-fedit-line-up')'
- `M-S-<down> (`org-table-fedit-line-down')'
- Move the test line for column formulas in the Org buffer up
- and down.
-
- `M-<up> (`org-table-fedit-scroll-down')'
- `M-<down> (`org-table-fedit-scroll-up')'
- Scroll the window displaying the table.
-
- `C-c }'
- Turn the coordinate grid in the table on and off.
-
- Making a table field blank does not remove the formula associated
-with the field, because that is stored in a different line (the
-`#+TBLFM' line)--during the next recalculation the field will be filled
-again. To remove a formula from a field, you have to give an empty
-reply when prompted for the formula, or to edit the `#+TBLFM' line.
-
- You may edit the `#+TBLFM' directly and re-apply the changed
-equations with `C-c C-c' in that line or with the normal recalculation
-commands in the table.
-
-Debugging formulas
-..................
-
-When the evaluation of a formula leads to an error, the field content
-becomes the string `#ERROR'. If you would like see what is going on
-during variable substitution and calculation in order to find a bug,
-turn on formula debugging in the `Tbl' menu and repeat the calculation,
-for example by pressing `C-u C-u C-c = <RET>' in a field. Detailed
-information will be displayed.
-
-
-File: org, Node: Updating the table, Next: Advanced features, Prev: Editing and debugging formulas, Up: The spreadsheet
-
-3.5.7 Updating the table
-------------------------
-
-Recalculation of a table is normally not automatic, but needs to be
-triggered by a command. See *Note Advanced features::, for a way to
-make recalculation at least semi-automatic.
-
- In order to recalculate a line of a table or the entire table, use
-the following commands:
-
-`C-c * (`org-table-recalculate')'
- Recalculate the current row by first applying the stored column
- formulas from left to right, and all field formulas in the current
- row.
-
-`C-u C-c *'
-`C-u C-c C-c'
- Recompute the entire table, line by line. Any lines before the
- first hline are left alone, assuming that these are part of the
- table header.
-
-`C-u C-u C-c * or C-u C-u C-c C-c (`org-table-iterate')'
- Iterate the table by recomputing it until no further changes occur.
- This may be necessary if some computed fields use the value of
- other fields that are computed later in the calculation sequence.
-
-`M-x org-table-recalculate-buffer-tables'
- Recompute all tables in the current buffer.
-
-`M-x org-table-iterate-buffer-tables'
- Iterate all tables in the current buffer, in order to converge
- table-to-table dependencies.
-
-
-File: org, Node: Advanced features, Prev: Updating the table, Up: The spreadsheet
-
-3.5.8 Advanced features
------------------------
-
-If you want the recalculation of fields to happen automatically, or if
-you want to be able to assign names to fields and columns, you need to
-reserve the first column of the table for special marking characters.
-`C-# (`org-table-rotate-recalc-marks')'
- Rotate the calculation mark in first column through the states ` ',
- `#', `*', `!', `$'. When there is an active region, change all
- marks in the region.
-
- Here is an example of a table that collects exam results of students
-and makes use of these features:
-
- |---+---------+--------+--------+--------+-------+------|
- | | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note |
- |---+---------+--------+--------+--------+-------+------|
- | ! | | P1 | P2 | P3 | Tot | |
- | # | Maximum | 10 | 15 | 25 | 50 | 10.0 |
- | ^ | | m1 | m2 | m3 | mt | |
- |---+---------+--------+--------+--------+-------+------|
- | # | Peter | 10 | 8 | 23 | 41 | 8.2 |
- | # | Sam | 2 | 4 | 3 | 9 | 1.8 |
- |---+---------+--------+--------+--------+-------+------|
- | | Average | | | | 29.7 | |
- | ^ | | | | | at | |
- | $ | max=50 | | | | | |
- |---+---------+--------+--------+--------+-------+------|
- #+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(@-II..@-I);%.1f
-
-Important: please note that for these special tables, recalculating the
-table with `C-u C-c *' will only affect rows that are marked `#' or
-`*', and fields that have a formula assigned to the field itself. The
-column formulas are not applied in rows with empty first field.
-
- The marking characters have the following meaning:
-`!'
- The fields in this line define names for the columns, so that you
- may refer to a column as `$Tot' instead of `$6'.
-
-`^'
- This row defines names for the fields _above_ the row. With such
- a definition, any formula in the table may use `$m1' to refer to
- the value `10'. Also, if you assign a formula to a names field, it
- will be stored as `$name=...'.
-
-`_'
- Similar to `^', but defines names for the fields in the row
- _below_.
-
-`$'
- Fields in this row can define _parameters_ for formulas. For
- example, if a field in a `$' row contains `max=50', then formulas
- in this table can refer to the value 50 using `$max'. Parameters
- work exactly like constants, only that they can be defined on a
- per-table basis.
-
-`#'
- Fields in this row are automatically recalculated when pressing
- <TAB> or <RET> or `S-<TAB>' in this row. Also, this row is
- selected for a global recalculation with `C-u C-c *'. Unmarked
- lines will be left alone by this command.
-
-`*'
- Selects this line for global recalculation with `C-u C-c *', but
- not for automatic recalculation. Use this when automatic
- recalculation slows down editing too much.
-
-`'
- Unmarked lines are exempt from recalculation with `C-u C-c *'.
- All lines that should be recalculated should be marked with `#' or
- `*'.
-
-`/'
- Do not export this line. Useful for lines that contain the
- narrowing `<N>' markers or column group markers.
-
- Finally, just to whet your appetite for what can be done with the
-fantastic `calc.el' package, here is a table that computes the Taylor
-series of degree `n' at location `x' for a couple of functions.
-
- |---+-------------+---+-----+--------------------------------------|
- | | Func | n | x | Result |
- |---+-------------+---+-----+--------------------------------------|
- | # | exp(x) | 1 | x | 1 + x |
- | # | exp(x) | 2 | x | 1 + x + x^2 / 2 |
- | # | exp(x) | 3 | x | 1 + x + x^2 / 2 + x^3 / 6 |
- | # | x^2+sqrt(x) | 2 | x=0 | x*(0.5 / 0) + x^2 (2 - 0.25 / 0) / 2 |
- | # | x^2+sqrt(x) | 2 | x=1 | 2 + 2.5 x - 2.5 + 0.875 (x - 1)^2 |
- | * | tan(x) | 3 | x | 0.0175 x + 1.77e-6 x^3 |
- |---+-------------+---+-----+--------------------------------------|
- #+TBLFM: $5=taylor($2,$4,$3);n3
-
-
-File: org, Node: Org-Plot, Prev: The spreadsheet, Up: Tables
-
-3.6 Org-Plot
-============
-
-Org-Plot can produce 2D and 3D graphs of information stored in org
-tables using `Gnuplot' `http://www.gnuplot.info/' and `gnuplot-mode'
-`http://cars9.uchicago.edu/~ravel/software/gnuplot-mode.html'. To see
-this in action, ensure that you have both Gnuplot and Gnuplot mode
-installed on your system, then call `org-plot/gnuplot' on the following
-table.
-
- #+PLOT: title:"Citas" ind:1 deps:(3) type:2d with:histograms set:"yrange [0:]"
- | Sede | Max cites | H-index |
- |-----------+-----------+---------|
- | Chile | 257.72 | 21.39 |
- | Leeds | 165.77 | 19.68 |
- | Sao Paolo | 71.00 | 11.50 |
- | Stockholm | 134.19 | 14.33 |
- | Morelia | 257.56 | 17.67 |
-
- Notice that Org Plot is smart enough to apply the table's headers as
-labels. Further control over the labels, type, content, and appearance
-of plots can be exercised through the `#+PLOT:' lines preceding a
-table. See below for a complete list of Org-plot options. For more
-information and examples see the Org-plot tutorial at
-`http://orgmode.org/worg/org-tutorials/org-plot.php'.
-
-Plot Options
-............
-
-`set'
- Specify any `gnuplot' option to be set when graphing.
-
-`title'
- Specify the title of the plot.
-
-`ind'
- Specify which column of the table to use as the `x' axis.
-
-`deps'
- Specify the columns to graph as a Lisp style list, surrounded by
- parentheses and separated by spaces for example `dep:(3 4)' to
- graph the third and fourth columns (defaults to graphing all other
- columns aside from the `ind' column).
-
-`type'
- Specify whether the plot will be `2d', `3d', or `grid'.
-
-`with'
- Specify a `with' option to be inserted for every col being plotted
- (e.g. `lines', `points', `boxes', `impulses', etc...). Defaults
- to `lines'.
-
-`file'
- If you want to plot to a file, specify
- `"PATH/TO/DESIRED/OUTPUT-FILE"'.
-
-`labels'
- List of labels to be used for the `deps' (defaults to the column
- headers if they exist).
-
-`line'
- Specify an entire line to be inserted in the Gnuplot script.
-
-`map'
- When plotting `3d' or `grid' types, set this to `t' to graph a
- flat mapping rather than a `3d' slope.
-
-`timefmt'
- Specify format of Org-mode timestamps as they will be parsed by
- Gnuplot. Defaults to `%Y-%m-%d-%H:%M:%S'.
-
-`script'
- If you want total control, you can specify a script file (place
- the file name between double-quotes) which will be used to plot.
- Before plotting, every instance of `$datafile' in the specified
- script will be replaced with the path to the generated data file.
- Note: even if you set this option, you may still want to specify
- the plot type, as that can impact the content of the data file.
-
-
-File: org, Node: Hyperlinks, Next: TODO Items, Prev: Tables, Up: Top
-
-4 Hyperlinks
-************
-
-Like HTML, Org provides links inside a file, external links to other
-files, Usenet articles, emails, and much more.
-
-* Menu:
-
-* Link format:: How links in Org are formatted
-* Internal links:: Links to other places in the current file
-* External links:: URL-like links to the world
-* Handling links:: Creating, inserting and following
-* Using links outside Org:: Linking from my C source code?
-* Link abbreviations:: Shortcuts for writing complex links
-* Search options:: Linking to a specific location
-* Custom searches:: When the default search is not enough
-
-
-File: org, Node: Link format, Next: Internal links, Prev: Hyperlinks, Up: Hyperlinks
-
-4.1 Link format
-===============
-
-Org will recognize plain URL-like links and activate them as clickable
-links. The general link format, however, looks like this:
-
- [[link][description]] or alternatively [[link]]
-
-Once a link in the buffer is complete (all brackets present), Org will
-change the display so that `description' is displayed instead of
-`[[link][description]]' and `link' is displayed instead of `[[link]]'.
-Links will be highlighted in the face `org-link', which by default is
-an underlined face. You can directly edit the visible part of a link.
-Note that this can be either the `link' part (if there is no
-description) or the `description' part. To edit also the invisible
-`link' part, use `C-c C-l' with the cursor on the link.
-
- If you place the cursor at the beginning or just behind the end of
-the displayed text and press <BACKSPACE>, you will remove the
-(invisible) bracket at that location. This makes the link incomplete
-and the internals are again displayed as plain text. Inserting the
-missing bracket hides the link internals again. To show the internal
-structure of all links, use the menu entry `Org->Hyperlinks->Literal
-links'.
-
-
-File: org, Node: Internal links, Next: External links, Prev: Link format, Up: Hyperlinks
-
-4.2 Internal links
-==================
-
-If the link does not look like a URL, it is considered to be internal
-in the current file. The most important case is a link like
-`[[#my-custom-id]]' which will link to the entry with the `CUSTOM_ID'
-property `my-custom-id'. Such custom IDs are very good for HTML export
-(*note HTML export::) where they produce pretty section links. You are
-responsible yourself to make sure these custom IDs are unique in a file.
-
- Links such as `[[My Target]]' or `[[My Target][Find my target]]'
-lead to a text search in the current file.
-
- The link can be followed with `C-c C-o' when the cursor is on the
-link, or with a mouse click (*note Handling links::). Links to custom
-IDs will point to the corresponding headline. The preferred match for
-a text link is a dedicated target: the same string in double angular
-brackets. Targets may be located anywhere; sometimes it is convenient
-to put them into a comment line. For example
-
- # <<My Target>>
-
-In HTML export (*note HTML export::), such targets will become named
-anchors for direct access through `http' links(1).
-
- If no dedicated target exists, Org will search for a headline that
-is exactly the link text but may also include a TODO keyword and
-tags(2). In non-Org files, the search will look for the words in the
-link text. In the above example the search would be for `my target'.
-
- Following a link pushes a mark onto Org's own mark ring. You can
-return to the previous position with `C-c &'. Using this command
-several times in direct succession goes back to positions recorded
-earlier.
-
-* Menu:
-
-* Radio targets:: Make targets trigger links in plain text
-
- ---------- Footnotes ----------
-
- (1) Note that text before the first headline is usually not
-exported, so the first such target should be after the first headline,
-or in the line directly before the first headline.
-
- (2) To insert a link targeting a headline, in-buffer completion can
-be used. Just type a star followed by a few optional letters into the
-buffer and press `M-<TAB>'. All headlines in the current buffer will
-be offered as completions.
-
-
-File: org, Node: Radio targets, Prev: Internal links, Up: Internal links
-
-4.2.1 Radio targets
--------------------
-
-Org can automatically turn any occurrences of certain target names in
-normal text into a link. So without explicitly creating a link, the
-text connects to the target radioing its position. Radio targets are
-enclosed by triple angular brackets. For example, a target `<<<My
-Target>>>' causes each occurrence of `my target' in normal text to
-become activated as a link. The Org file is scanned automatically for
-radio targets only when the file is first loaded into Emacs. To update
-the target list during editing, press `C-c C-c' with the cursor on or
-at a target.
-
-
-File: org, Node: External links, Next: Handling links, Prev: Internal links, Up: Hyperlinks
-
-4.3 External links
-==================
-
-Org supports links to files, websites, Usenet and email messages, BBDB
-database entries and links to both IRC conversations and their logs.
-External links are URL-like locators. They start with a short
-identifying string followed by a colon. There can be no space after
-the colon. The following list shows examples for each link type.
-
- http://www.astro.uva.nl/~dominik on the web
- doi:10.1000/182 DOI for an electronic resource
- file:/home/dominik/images/jupiter.jpg file, absolute path
- /home/dominik/images/jupiter.jpg same as above
- file:papers/last.pdf file, relative path
- ./papers/last.pdf same as above
- file:/myself@some.where:papers/last.pdf file, path on remote machine
- /myself@some.where:papers/last.pdf same as above
- file:sometextfile::NNN file with line number to jump to
- file:projects.org another Org file
- file:projects.org::some words text search in Org file
- file:projects.org::*task title heading search in Org file
- docview:papers/last.pdf::NNN open file in doc-view mode at page NNN
- id:B7423F4D-2E8A-471B-8810-C40F074717E9 Link to heading by ID
- news:comp.emacs Usenet link
- mailto:adent@galaxy.net Mail link
- vm:folder VM folder link
- vm:folder#id VM message link
- vm://myself@some.where.org/folder#id VM on remote machine
- wl:folder WANDERLUST folder link
- wl:folder#id WANDERLUST message link
- mhe:folder MH-E folder link
- mhe:folder#id MH-E message link
- rmail:folder RMAIL folder link
- rmail:folder#id RMAIL message link
- gnus:group Gnus group link
- gnus:group#id Gnus article link
- bbdb:R.*Stallman BBDB link (with regexp)
- irc:/irc.com/#emacs/bob IRC link
- info:org:External%20links Info node link (with encoded space)
- shell:ls *.org A shell command
- elisp:org-agenda Interactive Elisp command
- elisp:(find-file-other-frame "Elisp.org") Elisp form to evaluate
-
- A link should be enclosed in double brackets and may contain a
-descriptive text to be displayed instead of the URL (*note Link
-format::), for example:
-
- [[http://www.gnu.org/software/emacs/][GNU Emacs]]
-
-If the description is a file name or URL that points to an image, HTML
-export (*note HTML export::) will inline the image as a clickable
-button. If there is no description at all and the link points to an
-image, that image will be inlined into the exported HTML file.
-
- Org also finds external links in the normal text and activates them
-as links. If spaces must be part of the link (for example in
-`bbdb:Richard Stallman'), or if you need to remove ambiguities about
-the end of the link, enclose them in square brackets.
-
-
-File: org, Node: Handling links, Next: Using links outside Org, Prev: External links, Up: Hyperlinks
-
-4.4 Handling links
-==================
-
-Org provides methods to create a link in the correct syntax, to insert
-it into an Org file, and to follow the link.
-
-`C-c l (`org-store-link')'
- Store a link to the current location. This is a _global_ command
- (you must create the key binding yourself) which can be used in
- any buffer to create a link. The link will be stored for later
- insertion into an Org buffer (see below). What kind of link will
- be created depends on the current buffer:
-
- Org-mode buffers
- For Org files, if there is a `<<target>>' at the cursor, the link
- points to the target. Otherwise it points to the current
- headline, which will also be the description.
-
- If the headline has a `CUSTOM_ID' property, a link to this custom
- ID will be stored. In addition or alternatively (depending on the
- value of `org-link-to-org-use-id'), a globally unique `ID'
- property will be created and/or used to construct a link. So
- using this command in Org buffers will potentially create two
- links: a human-readable from the custom ID, and one that is
- globally unique and works even if the entry is moved from file to
- file. Later, when inserting the link, you need to decide which one
- to use.
-
- Email/News clients: VM, Rmail, Wanderlust, MH-E, Gnus
- Pretty much all Emacs mail clients are supported. The link will
- point to the current article, or, in some GNUS buffers, to the
- group. The description is constructed from the author and the
- subject.
-
- Web browsers: W3 and W3M
- Here the link will be the current URL, with the page title as
- description.
-
- Contacts: BBDB
- Links created in a BBDB buffer will point to the current entry.
-
- Chat: IRC
- For IRC links, if you set the variable `org-irc-link-to-logs' to
- `t', a `file:/' style link to the relevant point in the logs for
- the current conversation is created. Otherwise an `irc:/' style
- link to the user/channel/server under the point will be stored.
-
- Other files
- For any other files, the link will point to the file, with a
- search string (*note Search options::) pointing to the contents of
- the current line. If there is an active region, the selected
- words will form the basis of the search string. If the
- automatically created link is not working correctly or accurately
- enough, you can write custom functions to select the search string
- and to do the search for particular file types--see *Note Custom
- searches::. The key binding `C-c l' is only a suggestion--see
- *Note Installation::.
-
- Agenda view
- When the cursor is in an agenda view, the created link points to
- the entry referenced by the current line.
-
-`C-c C-l (`org-insert-link')'
- Insert a link(1). This prompts for a link to be inserted into the
- buffer. You can just type a link, using text for an internal
- link, or one of the link type prefixes mentioned in the examples
- above. The link will be inserted into the buffer(2), along with a
- descriptive text. If some text was selected when this command is
- called, the selected text becomes the default description.
-
- Inserting stored links
- All links stored during the current session are part of the
- history for this prompt, so you can access them with <up> and
- <down> (or `M-p/n').
-
- Completion support
- Completion with <TAB> will help you to insert valid link prefixes
- like `http:' or `ftp:', including the prefixes defined through
- link abbreviations (*note Link abbreviations::). If you press
- <RET> after inserting only the PREFIX, Org will offer specific
- completion support for some link types(3) For example, if you
- type `file <RET>', file name completion (alternative access: `C-u
- C-c C-l', see below) will be offered, and after `bbdb <RET>' you
- can complete contact names.
-
-`C-u C-c C-l'
- When `C-c C-l' is called with a `C-u' prefix argument, a link to a
- file will be inserted and you may use file name completion to
- select the name of the file. The path to the file is inserted
- relative to the directory of the current Org file, if the linked
- file is in the current directory or in a sub-directory of it, or
- if the path is written relative to the current directory using
- `../'. Otherwise an absolute path is used, if possible with `~/'
- for your home directory. You can force an absolute path with two
- `C-u' prefixes.
-
-`C-c C-l (with cursor on existing link)'
- When the cursor is on an existing link, `C-c C-l' allows you to
- edit the link and description parts of the link.
-
-`C-c C-o (`org-open-at-point')'
- Open link at point. This will launch a web browser for URLs (using
- `browse-url-at-point'), run VM/MH-E/Wanderlust/Rmail/Gnus/BBDB for
- the corresponding links, and execute the command in a shell link.
- When the cursor is on an internal link, this command runs the
- corresponding search. When the cursor is on a TAG list in a
- headline, it creates the corresponding TAGS view. If the cursor
- is on a timestamp, it compiles the agenda for that date.
- Furthermore, it will visit text and remote files in `file:' links
- with Emacs and select a suitable application for local non-text
- files. Classification of files is based on file extension only.
- See option `org-file-apps'. If you want to override the default
- application and visit the file with Emacs, use a `C-u' prefix. If
- you want to avoid opening in Emacs, use a `C-u C-u' prefix.
- If the cursor is on a headline, but not on a link, offer all links
- in the headline and entry text.
-
-`<RET>'
- When `org-return-follows-link' is set, `<RET>' will also follow
- the link at point.
-
-`mouse-2'
-`mouse-1'
- On links, `mouse-2' will open the link just as `C-c C-o' would.
- Under Emacs 22 and later, `mouse-1' will also follow a link.
-
-`mouse-3'
- Like `mouse-2', but force file links to be opened with Emacs, and
- internal links to be displayed in another window(4).
-
-`C-c C-x C-v (`org-toggle-inline-images')'
- Toggle the inline display of linked images. Normally this will
- only inline images that have no description part in the link, i.e.
- images that will also be inlined during export. When called with
- a prefix argument, also display images that do have a link
- description. You can ask for inline images to be displayed at
- startup by configuring the variable
- `org-startup-with-inline-images'(5).
-
-`C-c % (`org-mark-ring-push')'
- Push the current position onto the mark ring, to be able to return
- easily. Commands following an internal link do this automatically.
-
-`C-c & (`org-mark-ring-goto')'
- Jump back to a recorded position. A position is recorded by the
- commands following internal links, and by `C-c %'. Using this
- command several times in direct succession moves through a ring of
- previously recorded positions.
-
-`C-c C-x C-n (`org-next-link')'
-`C-c C-x C-p (`org-previous-link')'
- Move forward/backward to the next link in the buffer. At the
- limit of the buffer, the search fails once, and then wraps around.
- The key bindings for this are really too long; you might want to
- bind this also to `C-n' and `C-p'
- (add-hook 'org-load-hook
- (lambda ()
- (define-key 'org-mode-map "\C-n" 'org-next-link)
- (define-key 'org-mode-map "\C-p" 'org-previous-link)))
-
- ---------- Footnotes ----------
-
- (1) Note that you don't have to use this command to insert a link.
-Links in Org are plain text, and you can type or paste them straight
-into the buffer. By using this command, the links are automatically
-enclosed in double brackets, and you will be asked for the optional
-descriptive text.
-
- (2) After insertion of a stored link, the link will be removed from
-the list of stored links. To keep it in the list later use, use a
-triple `C-u' prefix argument to `C-c C-l', or configure the option
-`org-keep-stored-link-after-insertion'.
-
- (3) This works by calling a special function
-`org-PREFIX-complete-link'.
-
- (4) See the variable `org-display-internal-link-with-indirect-buffer'
-
- (5) with corresponding `#+STARTUP' keywords `inlineimages' and
-`inlineimages'
-
-
-File: org, Node: Using links outside Org, Next: Link abbreviations, Prev: Handling links, Up: Hyperlinks
-
-4.5 Using links outside Org
-===========================
-
-You can insert and follow links that have Org syntax not only in Org,
-but in any Emacs buffer. For this, you should create two global
-commands, like this (please select suitable global keys yourself):
-
- (global-set-key "\C-c L" 'org-insert-link-global)
- (global-set-key "\C-c o" 'org-open-at-point-global)
-
-
-File: org, Node: Link abbreviations, Next: Search options, Prev: Using links outside Org, Up: Hyperlinks
-
-4.6 Link abbreviations
-======================
-
-Long URLs can be cumbersome to type, and often many similar links are
-needed in a document. For this you can use link abbreviations. An
-abbreviated link looks like this
-
- [[linkword:tag][description]]
-
-where the tag is optional. The linkword must be a word, starting with
-a letter, followed by letters, numbers, `-', and `_'. Abbreviations
-are resolved according to the information in the variable
-`org-link-abbrev-alist' that relates the linkwords to replacement text.
-Here is an example:
-
- (setq org-link-abbrev-alist
- '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=")
- ("google" . "http://www.google.com/search?q=")
- ("gmap" . "http://maps.google.com/maps?q=%s")
- ("omap" . "http://nominatim.openstreetmap.org/search?q=%s&polygon=1")
- ("ads" . "http://adsabs.harvard.edu/cgi-bin/nph-abs_connect?author=%s&db_key=AST")))
-
- If the replacement text contains the string `%s', it will be
-replaced with the tag. Otherwise the tag will be appended to the string
-in order to create the link. You may also specify a function that will
-be called with the tag as the only argument to create the link.
-
- With the above setting, you could link to a specific bug with
-`[[bugzilla:129]]', search the web for `OrgMode' with
-`[[google:OrgMode]]', show the map location of the Free Software
-Foundation `[[gmap:51 Franklin Street, Boston]]' or of Carsten office
-`[[omap:Science Park 904, Amsterdam, The Netherlands]]' and find out
-what the Org author is doing besides Emacs hacking with
-`[[ads:Dominik,C]]'.
-
- If you need special abbreviations just for a single Org buffer, you
-can define them in the file with
-
- #+LINK: bugzilla http://10.1.2.9/bugzilla/show_bug.cgi?id=
- #+LINK: google http://www.google.com/search?q=%s
-
-In-buffer completion (*note Completion::) can be used after `[' to
-complete link abbreviations. You may also define a function
-`org-PREFIX-complete-link' that implements special (e.g. completion)
-support for inserting such a link with `C-c C-l'. Such a function
-should not accept any arguments, and return the full link with prefix.
-
-
-File: org, Node: Search options, Next: Custom searches, Prev: Link abbreviations, Up: Hyperlinks
-
-4.7 Search options in file links
-================================
-
-File links can contain additional information to make Emacs jump to a
-particular location in the file when following a link. This can be a
-line number or a search option after a double(1) colon. For example,
-when the command `C-c l' creates a link (*note Handling links::) to a
-file, it encodes the words in the current line as a search string that
-can be used to find this line back later when following the link with
-`C-c C-o'.
-
- Here is the syntax of the different ways to attach a search to a file
-link, together with an explanation:
-
- [[file:~/code/main.c::255]]
- [[file:~/xx.org::My Target]]
- [[file:~/xx.org::*My Target]]
- [[file:~/xx.org::#my-custom-id]]
- [[file:~/xx.org::/regexp/]]
-
-`255'
- Jump to line 255.
-
-`My Target'
- Search for a link target `<<My Target>>', or do a text search for
- `my target', similar to the search in internal links, see *Note
- Internal links::. In HTML export (*note HTML export::), such a
- file link will become an HTML reference to the corresponding named
- anchor in the linked file.
-
-`*My Target'
- In an Org file, restrict search to headlines.
-
-`#my-custom-id'
- Link to a heading with a `CUSTOM_ID' property
-
-`/regexp/'
- Do a regular expression search for `regexp'. This uses the Emacs
- command `occur' to list all matches in a separate window. If the
- target file is in Org-mode, `org-occur' is used to create a sparse
- tree with the matches.
-
- As a degenerate case, a file link with an empty file name can be used
-to search the current file. For example, `[[file:::find me]]' does a
-search for `find me' in the current file, just as `[[find me]]' would.
-
- ---------- Footnotes ----------
-
- (1) For backward compatibility, line numbers can also follow a
-single colon.
-
-
-File: org, Node: Custom searches, Prev: Search options, Up: Hyperlinks
-
-4.8 Custom Searches
-===================
-
-The default mechanism for creating search strings and for doing the
-actual search related to a file link may not work correctly in all
-cases. For example, BibTeX database files have many entries like
-`year="1993"' which would not result in good search strings, because
-the only unique identification for a BibTeX entry is the citation key.
-
- If you come across such a problem, you can write custom functions to
-set the right search string for a particular file type, and to do the
-search for the string in the file. Using `add-hook', these functions
-need to be added to the hook variables
-`org-create-file-search-functions' and
-`org-execute-file-search-functions'. See the docstring for these
-variables for more information. Org actually uses this mechanism for
-BibTeX database files, and you can use the corresponding code as an
-implementation example. See the file `org-bibtex.el'.
-
-
-File: org, Node: TODO Items, Next: Tags, Prev: Hyperlinks, Up: Top
-
-5 TODO items
-************
-
-Org-mode does not maintain TODO lists as separate documents(1).
-Instead, TODO items are an integral part of the notes file, because
-TODO items usually come up while taking notes! With Org mode, simply
-mark any entry in a tree as being a TODO item. In this way,
-information is not duplicated, and the entire context from which the
-TODO item emerged is always present.
-
- Of course, this technique for managing TODO items scatters them
-throughout your notes file. Org-mode compensates for this by providing
-methods to give you an overview of all the things that you have to do.
-
-* Menu:
-
-* TODO basics:: Marking and displaying TODO entries
-* TODO extensions:: Workflow and assignments
-* Progress logging:: Dates and notes for progress
-* Priorities:: Some things are more important than others
-* Breaking down tasks:: Splitting a task into manageable pieces
-* Checkboxes:: Tick-off lists
-
- ---------- Footnotes ----------
-
- (1) Of course, you can make a document that contains only long lists
-of TODO items, but this is not required.
-
-
-File: org, Node: TODO basics, Next: TODO extensions, Prev: TODO Items, Up: TODO Items
-
-5.1 Basic TODO functionality
-============================
-
-Any headline becomes a TODO item when it starts with the word `TODO',
-for example:
-
- *** TODO Write letter to Sam Fortune
-
-The most important commands to work with TODO entries are:
-
-`C-c C-t (`org-todo')'
- Rotate the TODO state of the current item among
-
- ,-> (unmarked) -> TODO -> DONE --.
- '--------------------------------'
-
- The same rotation can also be done "remotely" from the timeline and
- agenda buffers with the `t' command key (*note Agenda commands::).
-
-`C-u C-c C-t'
- Select a specific keyword using completion or (if it has been set
- up) the fast selection interface. For the latter, you need to
- assign keys to TODO states, see *Note Per-file keywords::, and
- *Note Setting tags::, for more information.
-
-`S-<right> / S-<left>'
- Select the following/preceding TODO state, similar to cycling.
- Useful mostly if more than two TODO states are possible (*note
- TODO extensions::). See also *Note Conflicts::, for a discussion
- of the interaction with `shift-selection-mode'. See also the
- variable `org-treat-S-cursor-todo-selection-as-state-change'.
-
-`C-c / t (`org-show-todo-key')'
- View TODO items in a _sparse tree_ (*note Sparse trees::). Folds
- the entire buffer, but shows all TODO items (with not-DONE state)
- and the headings hierarchy above them. With a prefix argument (or
- by using `C-c / T'), search for a specific TODO. You will be
- prompted for the keyword, and you can also give a list of keywords
- like `KWD1|KWD2|...' to list entries that match any one of these
- keywords. With numeric prefix argument N, show the tree for the
- Nth keyword in the variable `org-todo-keywords'. With two prefix
- arguments, find all TODO states, both un-done and done.
-
-`C-c a t (`org-todo-list')'
- Show the global TODO list. Collects the TODO items (with not-DONE
- states) from all agenda files (*note Agenda Views::) into a single
- buffer. The new buffer will be in `agenda-mode', which provides
- commands to examine and manipulate the TODO entries from the new
- buffer (*note Agenda commands::). *Note Global TODO list::, for
- more information.
-
-`S-M-<RET> (`org-insert-todo-heading')'
- Insert a new TODO entry below the current one.
-
-Changing a TODO state can also trigger tag changes. See the docstring
-of the option `org-todo-state-tags-triggers' for details.
-
-
-File: org, Node: TODO extensions, Next: Progress logging, Prev: TODO basics, Up: TODO Items
-
-5.2 Extended use of TODO keywords
-=================================
-
-By default, marked TODO entries have one of only two states: TODO and
-DONE. Org-mode allows you to classify TODO items in more complex ways
-with _TODO keywords_ (stored in `org-todo-keywords'). With special
-setup, the TODO keyword system can work differently in different files.
-
- Note that tags are another way to classify headlines in general and
-TODO items in particular (*note Tags::).
-
-* Menu:
-
-* Workflow states:: From TODO to DONE in steps
-* TODO types:: I do this, Fred does the rest
-* Multiple sets in one file:: Mixing it all, and still finding your way
-* Fast access to TODO states:: Single letter selection of a state
-* Per-file keywords:: Different files, different requirements
-* Faces for TODO keywords:: Highlighting states
-* TODO dependencies:: When one task needs to wait for others
-
-
-File: org, Node: Workflow states, Next: TODO types, Prev: TODO extensions, Up: TODO extensions
-
-5.2.1 TODO keywords as workflow states
---------------------------------------
-
-You can use TODO keywords to indicate different _sequential_ states in
-the process of working on an item, for example(1):
-
- (setq org-todo-keywords
- '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
-
- The vertical bar separates the TODO keywords (states that _need
-action_) from the DONE states (which need _no further action_). If you
-don't provide the separator bar, the last state is used as the DONE
-state. With this setup, the command `C-c C-t' will cycle an entry from
-TODO to FEEDBACK, then to VERIFY, and finally to DONE and DELEGATED.
-You may also use a numeric prefix argument to quickly select a specific
-state. For example `C-3 C-c C-t' will change the state immediately to
-VERIFY. Or you can use `S-<left>' to go backward through the sequence.
-If you define many keywords, you can use in-buffer completion (*note
-Completion::) or even a special one-key selection scheme (*note Fast
-access to TODO states::) to insert these words into the buffer.
-Changing a TODO state can be logged with a timestamp, see *Note
-Tracking TODO state changes::, for more information.
-
- ---------- Footnotes ----------
-
- (1) Changing this variable only becomes effective after restarting
-Org-mode in a buffer.
-
-
-File: org, Node: TODO types, Next: Multiple sets in one file, Prev: Workflow states, Up: TODO extensions
-
-5.2.2 TODO keywords as types
-----------------------------
-
-The second possibility is to use TODO keywords to indicate different
-_types_ of action items. For example, you might want to indicate that
-items are for "work" or "home". Or, when you work with several people
-on a single project, you might want to assign action items directly to
-persons, by using their names as TODO keywords. This would be set up
-like this:
-
- (setq org-todo-keywords '((type "Fred" "Sara" "Lucy" "|" "DONE")))
-
- In this case, different keywords do not indicate a sequence, but
-rather different types. So the normal work flow would be to assign a
-task to a person, and later to mark it DONE. Org-mode supports this
-style by adapting the workings of the command `C-c C-t'(1). When used
-several times in succession, it will still cycle through all names, in
-order to first select the right type for a task. But when you return
-to the item after some time and execute `C-c C-t' again, it will switch
-from any name directly to DONE. Use prefix arguments or completion to
-quickly select a specific name. You can also review the items of a
-specific TODO type in a sparse tree by using a numeric prefix to `C-c /
-t'. For example, to see all things Lucy has to do, you would use `C-3
-C-c / t'. To collect Lucy's items from all agenda files into a single
-buffer, you would use the numeric prefix argument as well when creating
-the global TODO list: `C-3 C-c a t'.
-
- ---------- Footnotes ----------
-
- (1) This is also true for the `t' command in the timeline and agenda
-buffers.
-
-
-File: org, Node: Multiple sets in one file, Next: Fast access to TODO states, Prev: TODO types, Up: TODO extensions
-
-5.2.3 Multiple keyword sets in one file
----------------------------------------
-
-Sometimes you may want to use different sets of TODO keywords in
-parallel. For example, you may want to have the basic `TODO'/`DONE',
-but also a workflow for bug fixing, and a separate state indicating
-that an item has been canceled (so it is not DONE, but also does not
-require action). Your setup would then look like this:
-
- (setq org-todo-keywords
- '((sequence "TODO" "|" "DONE")
- (sequence "REPORT" "BUG" "KNOWNCAUSE" "|" "FIXED")
- (sequence "|" "CANCELED")))
-
- The keywords should all be different, this helps Org-mode to keep
-track of which subsequence should be used for a given entry. In this
-setup, `C-c C-t' only operates within a subsequence, so it switches from
-`DONE' to (nothing) to `TODO', and from `FIXED' to (nothing) to
-`REPORT'. Therefore you need a mechanism to initially select the
-correct sequence. Besides the obvious ways like typing a keyword or
-using completion, you may also apply the following commands:
-
-`C-u C-u C-c C-t'
-`C-S-<right>'
-`C-S-<left>'
- These keys jump from one TODO subset to the next. In the above
- example, `C-u C-u C-c C-t' or `C-S-<right>' would jump from `TODO'
- or `DONE' to `REPORT', and any of the words in the second row to
- `CANCELED'. Note that the `C-S-' key binding conflict with
- `shift-selection-mode' (*note Conflicts::).
-
-`S-<right>'
-`S-<left>'
- `S-<<left>>' and `S-<<right>>' and walk through _all_ keywords
- from all sets, so for example `S-<<right>>' would switch from
- `DONE' to `REPORT' in the example above. See also *Note
- Conflicts::, for a discussion of the interaction with
- `shift-selection-mode'.
-
-
-File: org, Node: Fast access to TODO states, Next: Per-file keywords, Prev: Multiple sets in one file, Up: TODO extensions
-
-5.2.4 Fast access to TODO states
---------------------------------
-
-If you would like to quickly change an entry to an arbitrary TODO state
-instead of cycling through the states, you can set up keys for
-single-letter access to the states. This is done by adding the section
-key after each keyword, in parentheses. For example:
-
- (setq org-todo-keywords
- '((sequence "TODO(t)" "|" "DONE(d)")
- (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")
- (sequence "|" "CANCELED(c)")))
-
- If you then press `C-c C-t' followed by the selection key, the entry
-will be switched to this state. <SPC> can be used to remove any TODO
-keyword from an entry.(1)
-
- ---------- Footnotes ----------
-
- (1) Check also the variable `org-fast-tag-selection-include-todo',
-it allows you to change the TODO state through the tags interface
-(*note Setting tags::), in case you like to mingle the two concepts.
-Note that this means you need to come up with unique keys across both
-sets of keywords.
-
-
-File: org, Node: Per-file keywords, Next: Faces for TODO keywords, Prev: Fast access to TODO states, Up: TODO extensions
-
-5.2.5 Setting up keywords for individual files
-----------------------------------------------
-
-It can be very useful to use different aspects of the TODO mechanism in
-different files. For file-local settings, you need to add special lines
-to the file which set the keywords and interpretation for that file
-only. For example, to set one of the two examples discussed above, you
-need one of the following lines, starting in column zero anywhere in the
-file:
-
- #+TODO: TODO FEEDBACK VERIFY | DONE CANCELED
- (you may also write `#+SEQ_TODO' to be explicit about the
-interpretation, but it means the same as `#+TODO'), or
- #+TYP_TODO: Fred Sara Lucy Mike | DONE
-
- A setup for using several sets in parallel would be:
-
- #+TODO: TODO | DONE
- #+TODO: REPORT BUG KNOWNCAUSE | FIXED
- #+TODO: | CANCELED
-
-To make sure you are using the correct keyword, type `#+' into the
-buffer and then use `M-<TAB>' completion.
-
- Remember that the keywords after the vertical bar (or the last
-keyword if no bar is there) must always mean that the item is DONE
-(although you may use a different word). After changing one of these
-lines, use `C-c C-c' with the cursor still in the line to make the
-changes known to Org-mode(1).
-
- ---------- Footnotes ----------
-
- (1) Org-mode parses these lines only when Org-mode is activated
-after visiting a file. `C-c C-c' with the cursor in a line starting
-with `#+' is simply restarting Org-mode for the current buffer.
-
-
-File: org, Node: Faces for TODO keywords, Next: TODO dependencies, Prev: Per-file keywords, Up: TODO extensions
-
-5.2.6 Faces for TODO keywords
------------------------------
-
-Org-mode highlights TODO keywords with special faces: `org-todo' for
-keywords indicating that an item still has to be acted upon, and
-`org-done' for keywords indicating that an item is finished. If you
-are using more than 2 different states, you might want to use special
-faces for some of them. This can be done using the variable
-`org-todo-keyword-faces'. For example:
-
- (setq org-todo-keyword-faces
- '(("TODO" . org-warning) ("STARTED" . "yellow")
- ("CANCELED" . (:foreground "blue" :weight bold))))
-
- While using a list with face properties as shown for CANCELED
-_should_ work, this does not aways seem to be the case. If necessary,
-define a special face and use that. A string is interpreted as a
-color. The variable `org-faces-easy-properties' determines if that
-color is interpreted as a foreground or a background color.
-
-
-File: org, Node: TODO dependencies, Prev: Faces for TODO keywords, Up: TODO extensions
-
-5.2.7 TODO dependencies
------------------------
-
-The structure of Org files (hierarchy and lists) makes it easy to
-define TODO dependencies. Usually, a parent TODO task should not be
-marked DONE until all subtasks (defined as children tasks) are marked
-as DONE. And sometimes there is a logical sequence to a number of
-(sub)tasks, so that one task cannot be acted upon before all siblings
-above it are done. If you customize the variable
-`org-enforce-todo-dependencies', Org will block entries from changing
-state to DONE while they have children that are not DONE. Furthermore,
-if an entry has a property `ORDERED', each of its children will be
-blocked until all earlier siblings are marked DONE. Here is an example:
-
- * TODO Blocked until (two) is done
- ** DONE one
- ** TODO two
-
- * Parent
- :PROPERTIES:
- :ORDERED: t
- :END:
- ** TODO a
- ** TODO b, needs to wait for (a)
- ** TODO c, needs to wait for (a) and (b)
-
-`C-c C-x o (`org-toggle-ordered-property')'
- Toggle the `ORDERED' property of the current entry. A property is
- used for this behavior because this should be local to the current
- entry, not inherited like a tag. However, if you would like to
- track the value of this property with a tag for better visibility,
- customize the variable `org-track-ordered-property-with-tag'.
-
-`C-u C-u C-u C-c C-t'
- Change TODO state, circumventing any state blocking.
-
- If you set the variable `org-agenda-dim-blocked-tasks', TODO entries
-that cannot be closed because of such dependencies will be shown in a
-dimmed font or even made invisible in agenda views (*note Agenda
-Views::).
-
- You can also block changes of TODO states by looking at checkboxes
-(*note Checkboxes::). If you set the variable
-`org-enforce-todo-checkbox-dependencies', an entry that has unchecked
-checkboxes will be blocked from switching to DONE.
-
- If you need more complex dependency structures, for example
-dependencies between entries in different trees or files, check out the
-contributed module `org-depend.el'.
-
-
-File: org, Node: Progress logging, Next: Priorities, Prev: TODO extensions, Up: TODO Items
-
-5.3 Progress logging
-====================
-
-Org-mode can automatically record a timestamp and possibly a note when
-you mark a TODO item as DONE, or even each time you change the state of
-a TODO item. This system is highly configurable, settings can be on a
-per-keyword basis and can be localized to a file or even a subtree. For
-information on how to clock working time for a task, see *Note Clocking
-work time::.
-
-* Menu:
-
-* Closing items:: When was this entry marked DONE?
-* Tracking TODO state changes:: When did the status change?
-* Tracking your habits:: How consistent have you been?
-
-
-File: org, Node: Closing items, Next: Tracking TODO state changes, Prev: Progress logging, Up: Progress logging
-
-5.3.1 Closing items
--------------------
-
-The most basic logging is to keep track of _when_ a certain TODO item
-was finished. This is achieved with(1)
-
- (setq org-log-done 'time)
-
-Then each time you turn an entry from a TODO (not-done) state into any
-of the DONE states, a line `CLOSED: [timestamp]' will be inserted just
-after the headline. If you turn the entry back into a TODO item
-through further state cycling, that line will be removed again. If you
-want to record a note along with the timestamp, use(2)
-
- (setq org-log-done 'note)
-
-You will then be prompted for a note, and that note will be stored below
-the entry with a `Closing Note' heading.
-
- In the timeline (*note Timeline::) and in the agenda (*note
-Weekly/daily agenda::), you can then use the `l' key to display the
-TODO items with a `CLOSED' timestamp on each day, giving you an
-overview of what has been done.
-
- ---------- Footnotes ----------
-
- (1) The corresponding in-buffer setting is: `#+STARTUP: logdone'
-
- (2) The corresponding in-buffer setting is: `#+STARTUP: lognotedone'
-
-
-File: org, Node: Tracking TODO state changes, Next: Tracking your habits, Prev: Closing items, Up: Progress logging
-
-5.3.2 Tracking TODO state changes
----------------------------------
-
-When TODO keywords are used as workflow states (*note Workflow
-states::), you might want to keep track of when a state change occurred
-and maybe take a note about this change. You can either record just a
-timestamp, or a time-stamped note for a change. These records will be
-inserted after the headline as an itemized list, newest first(1). When
-taking a lot of notes, you might want to get the notes out of the way
-into a drawer (*note Drawers::). Customize the variable
-`org-log-into-drawer' to get this behavior--the recommended drawer for
-this is called `LOGBOOK'. You can also overrule the setting of this
-variable for a subtree by setting a `LOG_INTO_DRAWER' property.
-
- Since it is normally too much to record a note for every state,
-Org-mode expects configuration on a per-keyword basis for this. This
-is achieved by adding special markers `!' (for a timestamp) and `@'
-(for a note) in parentheses after each keyword. For example, with the
-setting
-
- (setq org-todo-keywords
- '((sequence "TODO(t)" "WAIT(w@/!)" "|" "DONE(d!)" "CANCELED(c@)")))
-
-you not only define global TODO keywords and fast access keys, but also
-request that a time is recorded when the entry is set to DONE(2), and
-that a note is recorded when switching to WAIT or CANCELED. The
-setting for WAIT is even more special: the `!' after the slash means
-that in addition to the note taken when entering the state, a timestamp
-should be recorded when leaving the WAIT state, if and only if the
-target state does not configure logging for entering it. So it has no
-effect when switching from WAIT to DONE, because DONE is configured to
-record a timestamp only. But when switching from WAIT back to TODO,
-the `/!' in the WAIT setting now triggers a timestamp even though TODO
-has no logging configured.
-
- You can use the exact same syntax for setting logging preferences
-local to a buffer:
- #+TODO: TODO(t) WAIT(w@/!) | DONE(d!) CANCELED(c@)
-
- In order to define logging settings that are local to a subtree or a
-single item, define a LOGGING property in this entry. Any non-empty
-LOGGING property resets all logging settings to nil. You may then turn
-on logging for this specific tree using STARTUP keywords like
-`lognotedone' or `logrepeat', as well as adding state specific settings
-like `TODO(!)'. For example
-
- * TODO Log each state with only a time
- :PROPERTIES:
- :LOGGING: TODO(!) WAIT(!) DONE(!) CANCELED(!)
- :END:
- * TODO Only log when switching to WAIT, and when repeating
- :PROPERTIES:
- :LOGGING: WAIT(@) logrepeat
- :END:
- * TODO No logging at all
- :PROPERTIES:
- :LOGGING: nil
- :END:
-
- ---------- Footnotes ----------
-
- (1) See the variable `org-log-states-order-reversed'
-
- (2) It is possible that Org-mode will record two timestamps when you
-are using both `org-log-done' and state change logging. However, it
-will never prompt for two notes--if you have configured both, the state
-change recording note will take precedence and cancel the `Closing
-Note'.
-
-
-File: org, Node: Tracking your habits, Prev: Tracking TODO state changes, Up: Progress logging
-
-5.3.3 Tracking your habits
---------------------------
-
-Org has the ability to track the consistency of a special category of
-TODOs, called "habits". A habit has the following properties:
-
- 1. You have enabled the `habits' module by customizing the variable
- `org-modules'.
-
- 2. The habit is a TODO, with a TODO keyword representing an open
- state.
-
- 3. The property `STYLE' is set to the value `habit'.
-
- 4. The TODO has a scheduled date, usually with a `.+' style repeat
- interval. A `++' style may be appropriate for habits with time
- constraints, e.g., must be done on weekends, or a `+' style for an
- unusual habit that can have a backlog, e.g., weekly reports.
-
- 5. The TODO may also have minimum and maximum ranges specified by
- using the syntax `.+2d/3d', which says that you want to do the
- task at least every three days, but at most every two days.
-
- 6. You must also have state logging for the `DONE' state enabled, in
- order for historical data to be represented in the consistency
- graph. If it's not enabled it's not an error, but the consistency
- graphs will be largely meaningless.
-
- To give you an idea of what the above rules look like in action,
-here's an actual habit with some history:
-
- ** TODO Shave
- SCHEDULED: <2009-10-17 Sat .+2d/4d>
- - State "DONE" from "TODO" [2009-10-15 Thu]
- - State "DONE" from "TODO" [2009-10-12 Mon]
- - State "DONE" from "TODO" [2009-10-10 Sat]
- - State "DONE" from "TODO" [2009-10-04 Sun]
- - State "DONE" from "TODO" [2009-10-02 Fri]
- - State "DONE" from "TODO" [2009-09-29 Tue]
- - State "DONE" from "TODO" [2009-09-25 Fri]
- - State "DONE" from "TODO" [2009-09-19 Sat]
- - State "DONE" from "TODO" [2009-09-16 Wed]
- - State "DONE" from "TODO" [2009-09-12 Sat]
- :PROPERTIES:
- :STYLE: habit
- :LAST_REPEAT: [2009-10-19 Mon 00:36]
- :END:
-
- What this habit says is: I want to shave at most every 2 days (given
-by the `SCHEDULED' date and repeat interval) and at least every 4 days.
-If today is the 15th, then the habit first appears in the agenda on
-Oct 17, after the minimum of 2 days has elapsed, and will appear
-overdue on Oct 19, after four days have elapsed.
-
- What's really useful about habits is that they are displayed along
-with a consistency graph, to show how consistent you've been at getting
-that task done in the past. This graph shows every day that the task
-was done over the past three weeks, with colors for each day. The
-colors used are:
-
-`Blue'
- If the task wasn't to be done yet on that day.
-
-`Green'
- If the task could have been done on that day.
-
-`Yellow'
- If the task was going to be overdue the next day.
-
-`Red'
- If the task was overdue on that day.
-
- In addition to coloring each day, the day is also marked with an
-asterisk if the task was actually done that day, and an exclamation
-mark to show where the current day falls in the graph.
-
- There are several configuration variables that can be used to change
-the way habits are displayed in the agenda.
-
-`org-habit-graph-column'
- The buffer column at which the consistency graph should be drawn.
- This will overwrite any text in that column, so it's a good idea
- to keep your habits' titles brief and to the point.
-
-`org-habit-preceding-days'
- The amount of history, in days before today, to appear in
- consistency graphs.
-
-`org-habit-following-days'
- The number of days after today that will appear in consistency
- graphs.
-
-`org-habit-show-habits-only-for-today'
- If non-nil, only show habits in today's agenda view. This is set
- to true by default.
-
- Lastly, pressing `K' in the agenda buffer will cause habits to
-temporarily be disabled and they won't appear at all. Press `K' again
-to bring them back. They are also subject to tag filtering, if you
-have habits which should only be done in certain contexts, for example.
-
-
-File: org, Node: Priorities, Next: Breaking down tasks, Prev: Progress logging, Up: TODO Items
-
-5.4 Priorities
-==============
-
-If you use Org-mode extensively, you may end up with enough TODO items
-that it starts to make sense to prioritize them. Prioritizing can be
-done by placing a _priority cookie_ into the headline of a TODO item,
-like this
-
- *** TODO [#A] Write letter to Sam Fortune
-
-By default, Org-mode supports three priorities: `A', `B', and `C'. `A'
-is the highest priority. An entry without a cookie is treated just
-like priority `B'. Priorities make a difference only for sorting in
-the agenda (*note Weekly/daily agenda::); outside the agenda, they have
-no inherent meaning to Org-mode. The cookies can be highlighted with
-special faces by customizing the variable `org-priority-faces'.
-
- Priorities can be attached to any outline node; they do not need to
-be TODO items.
-
-`C-c ,'
- Set the priority of the current headline (`org-priority'). The
- command prompts for a priority character `A', `B' or `C'. When
- you press <SPC> instead, the priority cookie is removed from the
- headline. The priorities can also be changed "remotely" from the
- timeline and agenda buffer with the `,' command (*note Agenda
- commands::).
-
-`S-<up> (`org-priority-up')'
-`S-<down> (`org-priority-down')'
- Increase/decrease priority of current headline(1). Note that
- these keys are also used to modify timestamps (*note Creating
- timestamps::). See also *Note Conflicts::, for a discussion of
- the interaction with `shift-selection-mode'.
-
- You can change the range of allowed priorities by setting the
-variables `org-highest-priority', `org-lowest-priority', and
-`org-default-priority'. For an individual buffer, you may set these
-values (highest, lowest, default) like this (please make sure that the
-highest priority is earlier in the alphabet than the lowest priority):
-
- #+PRIORITIES: A C B
-
- ---------- Footnotes ----------
-
- (1) See also the option `org-priority-start-cycle-with-default'.
-
-
-File: org, Node: Breaking down tasks, Next: Checkboxes, Prev: Priorities, Up: TODO Items
-
-5.5 Breaking tasks down into subtasks
-=====================================
-
-It is often advisable to break down large tasks into smaller, manageable
-subtasks. You can do this by creating an outline tree below a TODO
-item, with detailed subtasks on the tree(1). To keep the overview over
-the fraction of subtasks that are already completed, insert either
-`[/]' or `[%]' anywhere in the headline. These cookies will be updated
-each time the TODO status of a child changes, or when pressing `C-c
-C-c' on the cookie. For example:
-
- * Organize Party [33%]
- ** TODO Call people [1/2]
- *** TODO Peter
- *** DONE Sarah
- ** TODO Buy food
- ** DONE Talk to neighbor
-
- If a heading has both checkboxes and TODO children below it, the
-meaning of the statistics cookie become ambiguous. Set the property
-`COOKIE_DATA' to either `checkbox' or `todo' to resolve this issue.
-
- If you would like to have the statistics cookie count any TODO
-entries in the subtree (not just direct children), configure the
-variable `org-hierarchical-todo-statistics'. To do this for a single
-subtree, include the word `recursive' into the value of the
-`COOKIE_DATA' property.
-
- * Parent capturing statistics [2/20]
- :PROPERTIES:
- :COOKIE_DATA: todo recursive
- :END:
-
- If you would like a TODO entry to automatically change to DONE when
-all children are done, you can use the following setup:
-
- (defun org-summary-todo (n-done n-not-done)
- "Switch entry to DONE when all subentries are done, to TODO otherwise."
- (let (org-log-done org-log-states) ; turn off logging
- (org-todo (if (= n-not-done 0) "DONE" "TODO"))))
-
- (add-hook 'org-after-todo-statistics-hook 'org-summary-todo)
-
- Another possibility is the use of checkboxes to identify (a
-hierarchy of) a large number of subtasks (*note Checkboxes::).
-
- ---------- Footnotes ----------
-
- (1) To keep subtasks out of the global TODO list, see the
-`org-agenda-todo-list-sublevels'.
-
-
-File: org, Node: Checkboxes, Prev: Breaking down tasks, Up: TODO Items
-
-5.6 Checkboxes
-==============
-
-Every item in a plain list(1) (*note Plain lists::) can be made into a
-checkbox by starting it with the string `[ ]'. This feature is similar
-to TODO items (*note TODO Items::), but is more lightweight.
-Checkboxes are not included into the global TODO list, so they are
-often great to split a task into a number of simple steps. Or you can
-use them in a shopping list. To toggle a checkbox, use `C-c C-c', or
-use the mouse (thanks to Piotr Zielinski's `org-mouse.el').
-
- Here is an example of a checkbox list.
-
- * TODO Organize party [2/4]
- - [-] call people [1/3]
- - [ ] Peter
- - [X] Sarah
- - [ ] Sam
- - [X] order food
- - [ ] think about what music to play
- - [X] talk to the neighbors
-
- Checkboxes work hierarchically, so if a checkbox item has children
-that are checkboxes, toggling one of the children checkboxes will make
-the parent checkbox reflect if none, some, or all of the children are
-checked.
-
- The `[2/4]' and `[1/3]' in the first and second line are cookies
-indicating how many checkboxes present in this entry have been checked
-off, and the total number of checkboxes present. This can give you an
-idea on how many checkboxes remain, even without opening a folded
-entry. The cookies can be placed into a headline or into (the first
-line of) a plain list item. Each cookie covers checkboxes of direct
-children structurally below the headline/item on which the cookie
-appears(2). You have to insert the cookie yourself by typing either
-`[/]' or `[%]'. With `[/]' you get an `n out of m' result, as in the
-examples above. With `[%]' you get information about the percentage of
-checkboxes checked (in the above example, this would be `[50%]' and
-`[33%]', respectively). In a headline, a cookie can count either
-checkboxes below the heading or TODO states of children, and it will
-display whatever was changed last. Set the property `COOKIE_DATA' to
-either `checkbox' or `todo' to resolve this issue.
-
- If the current outline node has an `ORDERED' property, checkboxes
-must be checked off in sequence, and an error will be thrown if you try
-to check off a box while there are unchecked boxes above it.
-
-The following commands work with checkboxes:
-
-`C-c C-c (`org-toggle-checkbox')'
- Toggle checkbox status or (with prefix arg) checkbox presence at
- point. With double prefix argument, set it to `[-]', which is
- considered to be an intermediate state.
-
-`C-c C-x C-b (`org-toggle-checkbox')'
- Toggle checkbox status or (with prefix arg) checkbox presence at
- point. With double prefix argument, set it to `[-]', which is
- considered to be an intermediate state.
- - If there is an active region, toggle the first checkbox in
- the region and set all remaining boxes to the same status as
- the first. With a prefix arg, add or remove the checkbox for
- all items in the region.
-
- - If the cursor is in a headline, toggle checkboxes in the
- region between this headline and the next (so _not_ the
- entire subtree).
-
- - If there is no active region, just toggle the checkbox at
- point.
-
-`M-S-<RET> (`org-insert-todo-heading')'
- Insert a new item with a checkbox. This works only if the cursor
- is already in a plain list item (*note Plain lists::).
-
-`C-c C-x o (`org-toggle-ordered-property')'
- Toggle the `ORDERED' property of the entry, to toggle if
- checkboxes must be checked off in sequence. A property is used
- for this behavior because this should be local to the current
- entry, not inherited like a tag. However, if you would like to
- track the value of this property with a tag for better visibility,
- customize the variable `org-track-ordered-property-with-tag'.
-
-`C-c # (`org-update-statistics-cookies')'
- Update the statistics cookie in the current outline entry. When
- called with a `C-u' prefix, update the entire file. Checkbox
- statistic cookies are updated automatically if you toggle
- checkboxes with `C-c C-c' and make new ones with `M-S-<RET>'.
- TODO statistics cookies update when changing TODO states. If you
- delete boxes/entries or add/change them by hand, use this command
- to get things back into sync. Or simply toggle any entry twice
- (checkboxes with `C-c C-c').
-
- ---------- Footnotes ----------
-
- (1) With the exception of description lists. But you can allow it by
-modifying `org-list-automatic-rules' accordingly.
-
- (2) Set the variable `org-hierarchical-checkbox-statistics' if you
-want such cookies to represent the all checkboxes below the cookie, not
-just the direct children.
-
-
-File: org, Node: Tags, Next: Properties and Columns, Prev: TODO Items, Up: Top
-
-6 Tags
-******
-
-An excellent way to implement labels and contexts for cross-correlating
-information is to assign tags to headlines. Org-mode has extensive
-support for tags.
-
- Every headline can contain a list of tags; they occur at the end of
-the headline. Tags are normal words containing letters, numbers, `_',
-and `@'. Tags must be preceded and followed by a single colon, e.g.,
-`:work:'. Several tags can be specified, as in `:work:urgent:'. Tags
-will by default be in bold face with the same color as the headline.
-You may specify special faces for specific tags using the variable
-`org-tag-faces', in much the same way as you can for TODO keywords
-(*note Faces for TODO keywords::).
-
-* Menu:
-
-* Tag inheritance:: Tags use the tree structure of the outline
-* Setting tags:: How to assign tags to a headline
-* Tag searches:: Searching for combinations of tags
-
-
-File: org, Node: Tag inheritance, Next: Setting tags, Prev: Tags, Up: Tags
-
-6.1 Tag inheritance
-===================
-
-Tags make use of the hierarchical structure of outline trees. If a
-heading has a certain tag, all subheadings will inherit the tag as
-well. For example, in the list
-
- * Meeting with the French group :work:
- ** Summary by Frank :boss:notes:
- *** TODO Prepare slides for him :action:
-
-the final heading will have the tags `:work:', `:boss:', `:notes:', and
-`:action:' even though the final heading is not explicitly marked with
-those tags. You can also set tags that all entries in a file should
-inherit just as if these tags were defined in a hypothetical level zero
-that surrounds the entire file. Use a line like this(1):
-
- #+FILETAGS: :Peter:Boss:Secret:
-
-To limit tag inheritance to specific tags, or to turn it off entirely,
-use the variables `org-use-tag-inheritance' and
-`org-tags-exclude-from-inheritance'.
-
- When a headline matches during a tags search while tag inheritance
-is turned on, all the sublevels in the same tree will (for a simple
-match form) match as well(2). The list of matches may then become very
-long. If you only want to see the first tags match in a subtree,
-configure the variable `org-tags-match-list-sublevels' (not
-recommended).
-
- ---------- Footnotes ----------
-
- (1) As with all these in-buffer settings, pressing `C-c C-c'
-activates any changes in the line.
-
- (2) This is only true if the search does not involve more complex
-tests including properties (*note Property searches::).
-
-
-File: org, Node: Setting tags, Next: Tag searches, Prev: Tag inheritance, Up: Tags
-
-6.2 Setting tags
-================
-
-Tags can simply be typed into the buffer at the end of a headline.
-After a colon, `M-<TAB>' offers completion on tags. There is also a
-special command for inserting tags:
-
-`C-c C-q (`org-set-tags-command')'
- Enter new tags for the current headline. Org-mode will either
- offer completion or a special single-key interface for setting
- tags, see below. After pressing <RET>, the tags will be inserted
- and aligned to `org-tags-column'. When called with a `C-u'
- prefix, all tags in the current buffer will be aligned to that
- column, just to make things look nice. TAGS are automatically
- realigned after promotion, demotion, and TODO state changes (*note
- TODO basics::).
-
-`C-c C-c (`org-set-tags-command')'
- When the cursor is in a headline, this does the same as `C-c C-q'.
-
- Org will support tag insertion based on a _list of tags_. By
-default this list is constructed dynamically, containing all tags
-currently used in the buffer. You may also globally specify a hard list
-of tags with the variable `org-tag-alist'. Finally you can set the
-default tags for a given file with lines like
-
- #+TAGS: @work @home @tennisclub
- #+TAGS: laptop car pc sailboat
-
- If you have globally defined your preferred set of tags using the
-variable `org-tag-alist', but would like to use a dynamic tag list in a
-specific file, add an empty TAGS option line to that file:
-
- #+TAGS:
-
- If you have a preferred set of tags that you would like to use in
-every file, in addition to those defined on a per-file basis by TAGS
-option lines, then you may specify a list of tags with the variable
-`org-tag-persistent-alist'. You may turn this off on a per-file basis
-by adding a STARTUP option line to that file:
-
- #+STARTUP: noptag
-
- By default Org-mode uses the standard minibuffer completion
-facilities for entering tags. However, it also implements another,
-quicker, tag selection method called _fast tag selection_. This allows
-you to select and deselect tags with just a single key press. For this
-to work well you should assign unique letters to most of your commonly
-used tags. You can do this globally by configuring the variable
-`org-tag-alist' in your `.emacs' file. For example, you may find the
-need to tag many items in different files with `:@home:'. In this case
-you can set something like:
-
- (setq org-tag-alist '(("@work" . ?w) ("@home" . ?h) ("laptop" . ?l)))
-
-If the tag is only relevant to the file you are working on, then you
-can instead set the TAGS option line as:
-
- #+TAGS: @work(w) @home(h) @tennisclub(t) laptop(l) pc(p)
-
-The tags interface will show the available tags in a splash window. If
-you want to start a new line after a specific tag, insert `\n' into the
-tag list
-
- #+TAGS: @work(w) @home(h) @tennisclub(t) \n laptop(l) pc(p)
-
-or write them in two lines:
-
- #+TAGS: @work(w) @home(h) @tennisclub(t)
- #+TAGS: laptop(l) pc(p)
-
-You can also group together tags that are mutually exclusive by using
-braces, as in:
-
- #+TAGS: { @work(w) @home(h) @tennisclub(t) } laptop(l) pc(p)
-
-you indicate that at most one of `@work', `@home', and `@tennisclub'
-should be selected. Multiple such groups are allowed.
-
-Don't forget to press `C-c C-c' with the cursor in one of these lines
-to activate any changes.
-
-To set these mutually exclusive groups in the variable `org-tags-alist',
-you must use the dummy tags `:startgroup' and `:endgroup' instead of
-the braces. Similarly, you can use `:newline' to indicate a line
-break. The previous example would be set globally by the following
-configuration:
-
- (setq org-tag-alist '((:startgroup . nil)
- ("@work" . ?w) ("@home" . ?h)
- ("@tennisclub" . ?t)
- (:endgroup . nil)
- ("laptop" . ?l) ("pc" . ?p)))
-
- If at least one tag has a selection key then pressing `C-c C-c' will
-automatically present you with a special interface, listing inherited
-tags, the tags of the current headline, and a list of all valid tags
-with corresponding keys(1). In this interface, you can use the
-following keys:
-
-`a-z...'
- Pressing keys assigned to tags will add or remove them from the
- list of tags in the current line. Selecting a tag in a group of
- mutually exclusive tags will turn off any other tags from that
- group.
-
-`<TAB>'
- Enter a tag in the minibuffer, even if the tag is not in the
- predefined list. You will be able to complete on all tags present
- in the buffer.
-
-`<SPC>'
- Clear all tags for this line.
-
-`<RET>'
- Accept the modified set.
-
-`C-g'
- Abort without installing changes.
-
-`q'
- If `q' is not assigned to a tag, it aborts like `C-g'.
-
-`!'
- Turn off groups of mutually exclusive tags. Use this to (as an
- exception) assign several tags from such a group.
-
-`C-c'
- Toggle auto-exit after the next change (see below). If you are
- using expert mode, the first `C-c' will display the selection
- window.
-
-This method lets you assign tags to a headline with very few keys. With
-the above setup, you could clear the current tags and set `@home',
-`laptop' and `pc' tags with just the following keys: `C-c C-c <SPC> h l
-p <RET>'. Switching from `@home' to `@work' would be done with `C-c
-C-c w <RET>' or alternatively with `C-c C-c C-c w'. Adding the
-non-predefined tag `Sarah' could be done with `C-c C-c <TAB> S a r a h
-<RET> <RET>'.
-
- If you find that most of the time you need only a single key press to
-modify your list of tags, set the variable
-`org-fast-tag-selection-single-key'. Then you no longer have to press
-<RET> to exit fast tag selection--it will immediately exit after the
-first change. If you then occasionally need more keys, press `C-c' to
-turn off auto-exit for the current tag selection process (in effect:
-start selection with `C-c C-c C-c' instead of `C-c C-c'). If you set
-the variable to the value `expert', the special window is not even
-shown for single-key tag selection, it comes up only when you press an
-extra `C-c'.
-
- ---------- Footnotes ----------
-
- (1) Keys will automatically be assigned to tags which have no
-configured keys.
-
-
-File: org, Node: Tag searches, Prev: Setting tags, Up: Tags
-
-6.3 Tag searches
-================
-
-Once a system of tags has been set up, it can be used to collect related
-information into special lists.
-
-`C-c / m or C-c ,org-match-sparse-tree (`')'
- Create a sparse tree with all headlines matching a tags search.
- With a `C-u' prefix argument, ignore headlines that are not a TODO
- line.
-
-`C-c a m (`org-tags-view')'
- Create a global list of tag matches from all agenda files. *Note
- Matching tags and properties::.
-
-`C-c a M (`org-tags-view')'
- Create a global list of tag matches from all agenda files, but
- check only TODO items and force checking subitems (see variable
- `org-tags-match-list-sublevels').
-
- These commands all prompt for a match string which allows basic
-Boolean logic like `+boss+urgent-project1', to find entries with tags
-`boss' and `urgent', but not `project1', or `Kathy|Sally' to find
-entries which are tagged, like `Kathy' or `Sally'. The full syntax of
-the search string is rich and allows also matching against TODO
-keywords, entry levels and properties. For a complete description with
-many examples, see *Note Matching tags and properties::.
-
-
-File: org, Node: Properties and Columns, Next: Dates and Times, Prev: Tags, Up: Top
-
-7 Properties and columns
-************************
-
-Properties are a set of key-value pairs associated with an entry. There
-are two main applications for properties in Org-mode. First, properties
-are like tags, but with a value. Second, you can use properties to
-implement (very basic) database capabilities in an Org buffer. For an
-example of the first application, imagine maintaining a file where you
-document bugs and plan releases for a piece of software. Instead of
-using tags like `:release_1:', `:release_2:', one can use a property,
-say `:Release:', that in different subtrees has different values, such
-as `1.0' or `2.0'. For an example of the second application of
-properties, imagine keeping track of your music CDs, where properties
-could be things such as the album, artist, date of release, number of
-tracks, and so on.
-
- Properties can be conveniently edited and viewed in column view
-(*note Column view::).
-
-* Menu:
-
-* Property syntax:: How properties are spelled out
-* Special properties:: Access to other Org-mode features
-* Property searches:: Matching property values
-* Property inheritance:: Passing values down the tree
-* Column view:: Tabular viewing and editing
-* Property API:: Properties for Lisp programmers
-
-
-File: org, Node: Property syntax, Next: Special properties, Prev: Properties and Columns, Up: Properties and Columns
-
-7.1 Property syntax
-===================
-
-Properties are key-value pairs. They need to be inserted into a special
-drawer (*note Drawers::) with the name `PROPERTIES'. Each property is
-specified on a single line, with the key (surrounded by colons) first,
-and the value after it. Here is an example:
-
- * CD collection
- ** Classic
- *** Goldberg Variations
- :PROPERTIES:
- :Title: Goldberg Variations
- :Composer: J.S. Bach
- :Artist: Glen Gould
- :Publisher: Deutsche Grammophon
- :NDisks: 1
- :END:
-
- You may define the allowed values for a particular property `:Xyz:'
-by setting a property `:Xyz_ALL:'. This special property is
-_inherited_, so if you set it in a level 1 entry, it will apply to the
-entire tree. When allowed values are defined, setting the
-corresponding property becomes easier and is less prone to typing
-errors. For the example with the CD collection, we can predefine
-publishers and the number of disks in a box like this:
-
- * CD collection
- :PROPERTIES:
- :NDisks_ALL: 1 2 3 4
- :Publisher_ALL: "Deutsche Grammophon" Philips EMI
- :END:
-
- If you want to set properties that can be inherited by any entry in a
-file, use a line like
- #+PROPERTY: NDisks_ALL 1 2 3 4
-
- Property values set with the global variable `org-global-properties'
-can be inherited by all entries in all Org files.
-
-The following commands help to work with properties:
-
-`M-<TAB> (`org-complete')'
- After an initial colon in a line, complete property keys. All
- keys used in the current file will be offered as possible
- completions.
-
-`C-c C-x p (`org-set-property')'
- Set a property. This prompts for a property name and a value. If
- necessary, the property drawer is created as well.
-
-`M-x org-insert-property-drawer'
- Insert a property drawer into the current entry. The drawer will
- be inserted early in the entry, but after the lines with planning
- information like deadlines.
-
-`C-c C-c (`org-property-action')'
- With the cursor in a property drawer, this executes property
- commands.
-
-`C-c C-c s (`org-set-property')'
- Set a property in the current entry. Both the property and the
- value can be inserted using completion.
-
-`S-<right> (`org-property-next-allowed-value')'
-`S-<left> (`org-property-previous-allowed-value')'
- Switch property at point to the next/previous allowed value.
-
-`C-c C-c d (`org-delete-property')'
- Remove a property from the current entry.
-
-`C-c C-c D (`org-delete-property-globally')'
- Globally remove a property, from all entries in the current file.
-
-`C-c C-c c (`org-compute-property-at-point')'
- Compute the property at point, using the operator and scope from
- the nearest column format definition.
-
-
-File: org, Node: Special properties, Next: Property searches, Prev: Property syntax, Up: Properties and Columns
-
-7.2 Special properties
-======================
-
-Special properties provide an alternative access method to Org-mode
-features, like the TODO state or the priority of an entry, discussed in
-the previous chapters. This interface exists so that you can include
-these states in a column view (*note Column view::), or to use them in
-queries. The following property names are special and should not be
-used as keys in the properties drawer:
-
- TODO The TODO keyword of the entry.
- TAGS The tags defined directly in the headline.
- ALLTAGS All tags, including inherited ones.
- CATEGORY The category of an entry.
- PRIORITY The priority of the entry, a string with a single letter.
- DEADLINE The deadline time string, without the angular brackets.
- SCHEDULED The scheduling timestamp, without the angular brackets.
- CLOSED When was this entry closed?
- TIMESTAMP The first keyword-less timestamp in the entry.
- TIMESTAMP_IA The first inactive timestamp in the entry.
- CLOCKSUM The sum of CLOCK intervals in the subtree. `org-clock-sum'
- must be run first to compute the values.
- BLOCKED "t" if task is currently blocked by children or siblings
- ITEM The content of the entry.
-
-
-File: org, Node: Property searches, Next: Property inheritance, Prev: Special properties, Up: Properties and Columns
-
-7.3 Property searches
-=====================
-
-To create sparse trees and special lists with selection based on
-properties, the same commands are used as for tag searches (*note Tag
-searches::).
-`C-c / m or C-c ,org-match-sparse-tree (`')'
- Create a sparse tree with all matching entries. With a `C-u'
- prefix argument, ignore headlines that are not a TODO line.
-
-`C-c a m (`org-tags-view')'
- Create a global list of tag/property matches from all agenda
- files. *Note Matching tags and properties::.
-
-`C-c a M (`org-tags-view')'
- Create a global list of tag matches from all agenda files, but
- check only TODO items and force checking of subitems (see variable
- `org-tags-match-list-sublevels').
-
- The syntax for the search string is described in *Note Matching tags
-and properties::.
-
- There is also a special command for creating sparse trees based on a
-single property:
-
-`C-c / p'
- Create a sparse tree based on the value of a property. This first
- prompts for the name of a property, and then for a value. A
- sparse tree is created with all entries that define this property
- with the given value. If you enclose the value in curly braces,
- it is interpreted as a regular expression and matched against the
- property values.
-
-
-File: org, Node: Property inheritance, Next: Column view, Prev: Property searches, Up: Properties and Columns
-
-7.4 Property Inheritance
-========================
-
-The outline structure of Org-mode documents lends itself to an
-inheritance model of properties: if the parent in a tree has a certain
-property, the children can inherit this property. Org-mode does not
-turn this on by default, because it can slow down property searches
-significantly and is often not needed. However, if you find inheritance
-useful, you can turn it on by setting the variable
-`org-use-property-inheritance'. It may be set to `t' to make all
-properties inherited from the parent, to a list of properties that
-should be inherited, or to a regular expression that matches inherited
-properties. If a property has the value `nil', this is interpreted as
-an explicit undefine of the property, so that inheritance search will
-stop at this value and return `nil'.
-
- Org-mode has a few properties for which inheritance is hard-coded, at
-least for the special applications for which they are used:
-
-`COLUMNS'
- The `:COLUMNS:' property defines the format of column view (*note
- Column view::). It is inherited in the sense that the level where
- a `:COLUMNS:' property is defined is used as the starting point
- for a column view table, independently of the location in the
- subtree from where columns view is turned on.
-
-`CATEGORY'
- For agenda view, a category set through a `:CATEGORY:' property
- applies to the entire subtree.
-
-`ARCHIVE'
- For archiving, the `:ARCHIVE:' property may define the archive
- location for the entire subtree (*note Moving subtrees::).
-
-`LOGGING'
- The LOGGING property may define logging settings for an entry or a
- subtree (*note Tracking TODO state changes::).
-
-
-File: org, Node: Column view, Next: Property API, Prev: Property inheritance, Up: Properties and Columns
-
-7.5 Column view
-===============
-
-A great way to view and edit properties in an outline tree is _column
-view_. In column view, each outline node is turned into a table row.
-Columns in this table provide access to properties of the entries.
-Org-mode implements columns by overlaying a tabular structure over the
-headline of each item. While the headlines have been turned into a
-table row, you can still change the visibility of the outline tree.
-For example, you get a compact table by switching to CONTENTS view
-(`S-<TAB> S-<TAB>', or simply `c' while column view is active), but you
-can still open, read, and edit the entry below each headline. Or, you
-can switch to column view after executing a sparse tree command and in
-this way get a table only for the selected items. Column view also
-works in agenda buffers (*note Agenda Views::) where queries have
-collected selected items, possibly from a number of files.
-
-* Menu:
-
-* Defining columns:: The COLUMNS format property
-* Using column view:: How to create and use column view
-* Capturing column view:: A dynamic block for column view
-
-
-File: org, Node: Defining columns, Next: Using column view, Prev: Column view, Up: Column view
-
-7.5.1 Defining columns
-----------------------
-
-Setting up a column view first requires defining the columns. This is
-done by defining a column format line.
-
-* Menu:
-
-* Scope of column definitions:: Where defined, where valid?
-* Column attributes:: Appearance and content of a column
-
-
-File: org, Node: Scope of column definitions, Next: Column attributes, Prev: Defining columns, Up: Defining columns
-
-7.5.1.1 Scope of column definitions
-...................................
-
-To define a column format for an entire file, use a line like
-
- #+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
-
- To specify a format that only applies to a specific tree, add a
-`:COLUMNS:' property to the top node of that tree, for example:
-
- ** Top node for columns view
- :PROPERTIES:
- :COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
- :END:
-
- If a `:COLUMNS:' property is present in an entry, it defines columns
-for the entry itself, and for the entire subtree below it. Since the
-column definition is part of the hierarchical structure of the document,
-you can define columns on level 1 that are general enough for all
-sublevels, and more specific columns further down, when you edit a
-deeper part of the tree.
-
-
-File: org, Node: Column attributes, Prev: Scope of column definitions, Up: Defining columns
-
-7.5.1.2 Column attributes
-.........................
-
-A column definition sets the attributes of a column. The general
-definition looks like this:
-
- %[WIDTH]PROPERTY[(TITLE)][{SUMMARY-TYPE}]
-
-Except for the percent sign and the property name, all items are
-optional. The individual parts have the following meaning:
-
- WIDTH An integer specifying the width of the column in characters.
- If omitted, the width will be determined automatically.
- PROPERTY The property that should be edited in this column.
- Special properties representing meta data are allowed here
- as well (*note Special properties::)
- TITLE The header text for the column. If omitted, the property
- name is used.
- {SUMMARY-TYPE} The summary type. If specified, the column values for
- parent nodes are computed from the children.
- Supported summary types are:
- {+} Sum numbers in this column.
- {+;%.1f} Like `+', but format result with `%.1f'.
- {$} Currency, short for `+;%.2f'.
- {:} Sum times, HH:MM, plain numbers are hours.
- {X} Checkbox status, `[X]' if all children are `[X]'.
- {X/} Checkbox status, `[n/m]'.
- {X%} Checkbox status, `[n%]'.
- {min} Smallest number in column.
- {max} Largest number.
- {mean} Arithmetic mean of numbers.
- {:min} Smallest time value in column.
- {:max} Largest time value.
- {:mean} Arithmetic mean of time values.
- {@min} Minimum age (in days/hours/mins/seconds).
- {@max} Maximum age (in days/hours/mins/seconds).
- {@mean} Arithmetic mean of ages (in days/hours/mins/seconds).
- {est+} Add low-high estimates.
-
-Be aware that you can only have one summary type for any property you
-include. Subsequent columns referencing the same property will all
-display the same summary information.
-
- The `est+' summary type requires further explanation. It is used for
-combining estimates, expressed as low-high ranges. For example, instead
-of estimating a particular task will take 5 days, you might estimate it
-as 5-6 days if you're fairly confident you know how much work is
-required, or 1-10 days if you don't really know what needs to be done.
-Both ranges average at 5.5 days, but the first represents a more
-predictable delivery.
-
- When combining a set of such estimates, simply adding the lows and
-highs produces an unrealistically wide result. Instead, `est+' adds the
-statistical mean and variance of the sub-tasks, generating a final
-estimate from the sum. For example, suppose you had ten tasks, each of
-which was estimated at 0.5 to 2 days of work. Straight addition
-produces an estimate of 5 to 20 days, representing what to expect if
-everything goes either extremely well or extremely poorly. In contrast,
-`est+' estimates the full job more realistically, at 10-15 days.
-
- Here is an example for a complete columns definition, along with
-allowed values.
-
- :COLUMNS: %25ITEM %9Approved(Approved?){X} %Owner %11Status \(1)
- %10Time_Estimate{:} %CLOCKSUM
- :Owner_ALL: Tammy Mark Karl Lisa Don
- :Status_ALL: "In progress" "Not started yet" "Finished" ""
- :Approved_ALL: "[ ]" "[X]"
-
-The first column, `%25ITEM', means the first 25 characters of the item
-itself, i.e. of the headline. You probably always should start the
-column definition with the `ITEM' specifier. The other specifiers
-create columns `Owner' with a list of names as allowed values, for
-`Status' with four different possible values, and for a checkbox field
-`Approved'. When no width is given after the `%' character, the column
-will be exactly as wide as it needs to be in order to fully display all
-values. The `Approved' column does have a modified title (`Approved?',
-with a question mark). Summaries will be created for the
-`Time_Estimate' column by adding time duration expressions like HH:MM,
-and for the `Approved' column, by providing an `[X]' status if all
-children have been checked. The `CLOCKSUM' column is special, it lists
-the sum of CLOCK intervals in the subtree.
-
- ---------- Footnotes ----------
-
- (1) Please note that the COLUMNS definition must be on a single
-line--it is wrapped here only because of formatting constraints.
-
-
-File: org, Node: Using column view, Next: Capturing column view, Prev: Defining columns, Up: Column view
-
-7.5.2 Using column view
------------------------
-
-Turning column view on and off
-..............................
-
-`C-c C-x C-c (`org-columns')'
- Turn on column view. If the cursor is before the first headline
- in the file, column view is turned on for the entire file, using
- the `#+COLUMNS' definition. If the cursor is somewhere inside the
- outline, this command searches the hierarchy, up from point, for a
- `:COLUMNS:' property that defines a format. When one is found,
- the column view table is established for the tree starting at the
- entry that contains the `:COLUMNS:' property. If no such property
- is found, the format is taken from the `#+COLUMNS' line or from
- the variable `org-columns-default-format', and column view is
- established for the current entry and its subtree.
-
-`r (`org-columns-redo')'
- Recreate the column view, to include recent changes made in the
- buffer.
-
-`g (`org-columns-redo')'
- Same as `r'.
-
-`q (`org-columns-quit')'
- Exit column view.
-
-Editing values
-..............
-
-`<left> <right> <up> <down>'
- Move through the column view from field to field.
-
-`S-<left>/<right>'
- Switch to the next/previous allowed value of the field. For this,
- you have to have specified allowed values for a property.
-
-`1..9,0'
- Directly select the Nth allowed value, `0' selects the 10th value.
-
-`n (`org-columns-next-allowed-value')'
-`p (`org-columns-previous-allowed-value')'
- Same as `S-<left>/<right>'
-
-`e (`org-columns-edit-value')'
- Edit the property at point. For the special properties, this will
- invoke the same interface that you normally use to change that
- property. For example, when editing a TAGS property, the tag
- completion or fast selection interface will pop up.
-
-`C-c C-c (`org-columns-set-tags-or-toggle')'
- When there is a checkbox at point, toggle it.
-
-`v (`org-columns-show-value')'
- View the full value of this property. This is useful if the width
- of the column is smaller than that of the value.
-
-`a (`org-columns-edit-allowed')'
- Edit the list of allowed values for this property. If the list is
- found in the hierarchy, the modified values is stored there. If
- no list is found, the new value is stored in the first entry that
- is part of the current column view.
-
-Modifying the table structure
-.............................
-
-`< (`org-columns-narrow')'
-`> (`org-columns-widen')'
- Make the column narrower/wider by one character.
-
-`S-M-<right> (`org-columns-new')'
- Insert a new column, to the left of the current column.
-
-`S-M-<left> (`org-columns-delete')'
- Delete the current column.
-
-
-File: org, Node: Capturing column view, Prev: Using column view, Up: Column view
-
-7.5.3 Capturing column view
----------------------------
-
-Since column view is just an overlay over a buffer, it cannot be
-exported or printed directly. If you want to capture a column view, use
-a `columnview' dynamic block (*note Dynamic blocks::). The frame of
-this block looks like this:
-
- * The column view
- #+BEGIN: columnview :hlines 1 :id "label"
-
- #+END:
-
-This dynamic block has the following parameters:
-
-`:id'
- This is the most important parameter. Column view is a feature
- that is often localized to a certain (sub)tree, and the capture
- block might be at a different location in the file. To identify
- the tree whose view to capture, you can use 4 values:
- local use the tree in which the capture block is located
- global make a global view, including all headings in the file
- "file:PATH-TO-FILE"
- run column view at the top of this file
- "ID" call column view in the tree that has an `:ID:'
- property with the value label. You can use
- `M-x org-id-copy' to create a globally unique ID for
- the current entry and copy it to the kill-ring.
-
-`:hlines'
- When `t', insert an hline after every line. When a number N,
- insert an hline before each headline with level `<= N'.
-
-`:vlines'
- When set to `t', force column groups to get vertical lines.
-
-`:maxlevel'
- When set to a number, don't capture entries below this level.
-
-`:skip-empty-rows'
- When set to `t', skip rows where the only non-empty specifier of
- the column view is `ITEM'.
-
-
-The following commands insert or update the dynamic block:
-
-`C-c C-x i (`org-insert-columns-dblock')'
- Insert a dynamic block capturing a column view. You will be
- prompted for the scope or ID of the view.
-
-`C-c C-c or C-c C-x C-u (`org-dblock-update')'
- Update dynamic block at point. The cursor needs to be in the
- `#+BEGIN' line of the dynamic block.
-
-`C-u C-c C-x C-u (`org-update-all-dblocks')'
- Update all dynamic blocks (*note Dynamic blocks::). This is
- useful if you have several clock table blocks, column-capturing
- blocks or other dynamic blocks in a buffer.
-
- You can add formulas to the column view table and you may add
-plotting instructions in front of the table--these will survive an
-update of the block. If there is a `#+TBLFM:' after the table, the
-table will actually be recalculated automatically after an update.
-
- An alternative way to capture and process property values into a
-table is provided by Eric Schulte's `org-collector.el' which is a
-contributed package(1). It provides a general API to collect
-properties from entries in a certain scope, and arbitrary Lisp
-expressions to process these values before inserting them into a table
-or a dynamic block.
-
- ---------- Footnotes ----------
-
- (1) Contributed packages are not part of Emacs, but are distributed
-with the main distribution of Org (visit `http://orgmode.org').
-
-
-File: org, Node: Property API, Prev: Column view, Up: Properties and Columns
-
-7.6 The Property API
-====================
-
-There is a full API for accessing and changing properties. This API can
-be used by Emacs Lisp programs to work with properties and to implement
-features based on them. For more information see *Note Using the
-property API::.
-
-
-File: org, Node: Dates and Times, Next: Capture - Refile - Archive, Prev: Properties and Columns, Up: Top
-
-8 Dates and times
-*****************
-
-To assist project planning, TODO items can be labeled with a date and/or
-a time. The specially formatted string carrying the date and time
-information is called a _timestamp_ in Org-mode. This may be a little
-confusing because timestamp is often used as indicating when something
-was created or last changed. However, in Org-mode this term is used in
-a much wider sense.
-
-* Menu:
-
-* Timestamps:: Assigning a time to a tree entry
-* Creating timestamps:: Commands which insert timestamps
-* Deadlines and scheduling:: Planning your work
-* Clocking work time:: Tracking how long you spend on a task
-* Effort estimates:: Planning work effort in advance
-* Relative timer:: Notes with a running timer
-* Countdown timer:: Starting a countdown timer for a task
-
-
-File: org, Node: Timestamps, Next: Creating timestamps, Prev: Dates and Times, Up: Dates and Times
-
-8.1 Timestamps, deadlines, and scheduling
-=========================================
-
-A timestamp is a specification of a date (possibly with a time or a
-range of times) in a special format, either `<2003-09-16 Tue>' or
-`<2003-09-16 Tue 09:39>' or `<2003-09-16 Tue 12:00-12:30>'(1). A
-timestamp can appear anywhere in the headline or body of an Org tree
-entry. Its presence causes entries to be shown on specific dates in
-the agenda (*note Weekly/daily agenda::). We distinguish:
-
-PLAIN TIMESTAMP; EVENT; APPOINTMENT
- A simple timestamp just assigns a date/time to an item. This is
- just like writing down an appointment or event in a paper agenda.
- In the timeline and agenda displays, the headline of an entry
- associated with a plain timestamp will be shown exactly on that
- date.
-
- * Meet Peter at the movies <2006-11-01 Wed 19:15>
- * Discussion on climate change <2006-11-02 Thu 20:00-22:00>
-
-TIMESTAMP WITH REPEATER INTERVAL
- A timestamp may contain a _repeater interval_, indicating that it
- applies not only on the given date, but again and again after a
- certain interval of N days (d), weeks (w), months (m), or years
- (y). The following will show up in the agenda every Wednesday:
-
- * Pick up Sam at school <2007-05-16 Wed 12:30 +1w>
-
-DIARY-STYLE SEXP ENTRIES
- For more complex date specifications, Org-mode supports using the
- special sexp diary entries implemented in the Emacs calendar/diary
- package. For example
-
- * The nerd meeting on every 2nd Thursday of the month
- <%%(diary-float t 4 2)>
-
-TIME/DATE RANGE
- Two timestamps connected by `--' denote a range. The headline
- will be shown on the first and last day of the range, and on any
- dates that are displayed and fall in the range. Here is an
- example:
-
- ** Meeting in Amsterdam
- <2004-08-23 Mon>--<2004-08-26 Thu>
-
-INACTIVE TIMESTAMP
- Just like a plain timestamp, but with square brackets instead of
- angular ones. These timestamps are inactive in the sense that
- they do _not_ trigger an entry to show up in the agenda.
-
- * Gillian comes late for the fifth time [2006-11-01 Wed]
-
-
- ---------- Footnotes ----------
-
- (1) This is inspired by the standard ISO 8601 date/time format. To
-use an alternative format, see *Note Custom time format::.
-
-
-File: org, Node: Creating timestamps, Next: Deadlines and scheduling, Prev: Timestamps, Up: Dates and Times
-
-8.2 Creating timestamps
-=======================
-
-For Org-mode to recognize timestamps, they need to be in the specific
-format. All commands listed below produce timestamps in the correct
-format.
-
-`C-c . (`org-time-stamp')'
- Prompt for a date and insert a corresponding timestamp. When the
- cursor is at an existing timestamp in the buffer, the command is
- used to modify this timestamp instead of inserting a new one.
- When this command is used twice in succession, a time range is
- inserted.
-
-`C-c ! (`org-time-stamp-inactive')'
- Like `C-c .', but insert an inactive timestamp that will not cause
- an agenda entry.
-
-`C-u C-c .'
-`C-u C-c !'
- Like `C-c .' and `C-c !', but use the alternative format which
- contains date and time. The default time can be rounded to
- multiples of 5 minutes, see the option
- `org-time-stamp-rounding-minutes'.
-
-`C-c < (`org-date-from-calendar')'
- Insert a timestamp corresponding to the cursor date in the
- Calendar.
-
-`C-c > (`org-goto-calendar')'
- Access the Emacs calendar for the current date. If there is a
- timestamp in the current line, go to the corresponding date
- instead.
-
-`C-c C-o (`org-open-at-point')'
- Access the agenda for the date given by the timestamp or -range at
- point (*note Weekly/daily agenda::).
-
-`S-<left> (`org-timestamp-down-day')'
-`S-<right> (`org-timestamp-up-day')'
- Change date at cursor by one day. These key bindings conflict with
- shift-selection and related modes (*note Conflicts::).
-
-`S-<up> (`org-timestamp-up')'
-`S-<down> (`org-timestamp-down-down')'
- Change the item under the cursor in a timestamp. The cursor can
- be on a year, month, day, hour or minute. When the timestamp
- contains a time range like `15:30-16:30', modifying the first time
- will also shift the second, shifting the time block with constant
- length. To change the length, modify the second time. Note that
- if the cursor is in a headline and not at a timestamp, these same
- keys modify the priority of an item. (*note Priorities::). The
- key bindings also conflict with shift-selection and related modes
- (*note Conflicts::).
-
-`C-c C-y (`org-evaluate-time-range')'
- Evaluate a time range by computing the difference between start
- and end. With a prefix argument, insert result after the time
- range (in a table: into the following column).
-
-* Menu:
-
-* The date/time prompt:: How Org-mode helps you entering date and time
-* Custom time format:: Making dates look different
-
-
-File: org, Node: The date/time prompt, Next: Custom time format, Prev: Creating timestamps, Up: Creating timestamps
-
-8.2.1 The date/time prompt
---------------------------
-
-When Org-mode prompts for a date/time, the default is shown in default
-date/time format, and the prompt therefore seems to ask for a specific
-format. But it will in fact accept any string containing some date
-and/or time information, and it is really smart about interpreting your
-input. You can, for example, use `C-y' to paste a (possibly
-multi-line) string copied from an email message. Org-mode will find
-whatever information is in there and derive anything you have not
-specified from the _default date and time_. The default is usually the
-current date and time, but when modifying an existing timestamp, or
-when entering the second stamp of a range, it is taken from the stamp
-in the buffer. When filling in information, Org-mode assumes that most
-of the time you will want to enter a date in the future: if you omit
-the month/year and the given day/month is before today, it will assume
-that you mean a future date(1). If the date has been automatically
-shifted into the future, the time prompt will show this with `(=>F).'
-
- For example, let's assume that today is June 13, 2006. Here is how
-various inputs will be interpreted, the items filled in by Org-mode are
-in bold.
-
- 3-2-5 --> 2003-02-05
- 2/5/3 --> 2003-02-05
- 14 --> 2006-06-14
- 12 --> 2006-07-12
- 2/5 --> 2007-02-05
- Fri --> nearest Friday (default date or later)
- sep 15 --> 2006-09-15
- feb 15 --> 2007-02-15
- sep 12 9 --> 2009-09-12
- 12:45 --> 2006-06-13 12:45
- 22 sept 0:34 --> 2006-09-22 0:34
- w4 --> ISO week for of the current year 2006
- 2012 w4 fri --> Friday of ISO week 4 in 2012
- 2012-w04-5 --> Same as above
-
- Furthermore you can specify a relative date by giving, as the
-_first_ thing in the input: a plus/minus sign, a number and a letter
-([dwmy]) to indicate change in days, weeks, months, or years. With a
-single plus or minus, the date is always relative to today. With a
-double plus or minus, it is relative to the default date. If instead of
-a single letter, you use the abbreviation of day name, the date will be
-the Nth such day. E.g.
-
- +0 --> today
- . --> today
- +4d --> four days from today
- +4 --> same as above
- +2w --> two weeks from today
- ++5 --> five days from default date
- +2tue --> second Tuesday from now.
-
- The function understands English month and weekday abbreviations. If
-you want to use unabbreviated names and/or other languages, configure
-the variables `parse-time-months' and `parse-time-weekdays'.
-
- You can specify a time range by giving start and end times or by
-giving a start time and a duration (in HH:MM format). Use `-' or `-{}-'
-as the separator in the former case and use '+' as the separator in the
-latter case. E.g.
-
- 11am-1:15pm --> 11:00-13:15
- 11am--1:15pm --> same as above
- 11am+2:15 --> same as above
-
- Parallel to the minibuffer prompt, a calendar is popped up(2). When
-you exit the date prompt, either by clicking on a date in the calendar,
-or by pressing <RET>, the date selected in the calendar will be
-combined with the information entered at the prompt. You can control
-the calendar fully from the minibuffer:
-
- <RET> Choose date at cursor in calendar.
- mouse-1 Select date by clicking on it.
- S-<right>/<left> One day forward/backward.
- S-<down>/<up> One week forward/backward.
- M-S-<right>/<left> One month forward/backward.
- > / < Scroll calendar forward/backward by one month.
- M-v / C-v Scroll calendar forward/backward by 3 months.
-
- The actions of the date/time prompt may seem complex, but I assure
-you they will grow on you, and you will start getting annoyed by pretty
-much any other way of entering a date/time out there. To help you
-understand what is going on, the current interpretation of your input
-will be displayed live in the minibuffer(3).
-
- ---------- Footnotes ----------
-
- (1) See the variable `org-read-date-prefer-future'. You may set
-that variable to the symbol `time' to even make a time before now shift
-the date to tomorrow.
-
- (2) If you don't need/want the calendar, configure the variable
-`org-popup-calendar-for-date-prompt'.
-
- (3) If you find this distracting, turn the display of with
-`org-read-date-display-live'.
-
-
-File: org, Node: Custom time format, Prev: The date/time prompt, Up: Creating timestamps
-
-8.2.2 Custom time format
-------------------------
-
-Org-mode uses the standard ISO notation for dates and times as it is
-defined in ISO 8601. If you cannot get used to this and require another
-representation of date and time to keep you happy, you can get it by
-customizing the variables `org-display-custom-times' and
-`org-time-stamp-custom-formats'.
-
-`C-c C-x C-t (`org-toggle-time-stamp-overlays')'
- Toggle the display of custom formats for dates and times.
-
-Org-mode needs the default format for scanning, so the custom date/time
-format does not _replace_ the default format--instead it is put _over_
-the default format using text properties. This has the following
-consequences:
- * You cannot place the cursor onto a timestamp anymore, only before
- or after.
-
- * The `S-<up>/<down>' keys can no longer be used to adjust each
- component of a timestamp. If the cursor is at the beginning of
- the stamp, `S-<up>/<down>' will change the stamp by one day, just
- like `S-<left>/<right>'. At the end of the stamp, the time will
- be changed by one minute.
-
- * If the timestamp contains a range of clock times or a repeater,
- these will not be overlaid, but remain in the buffer as they were.
-
- * When you delete a timestamp character-by-character, it will only
- disappear from the buffer after _all_ (invisible) characters
- belonging to the ISO timestamp have been removed.
-
- * If the custom timestamp format is longer than the default and you
- are using dates in tables, table alignment will be messed up. If
- the custom format is shorter, things do work as expected.
-
-
-File: org, Node: Deadlines and scheduling, Next: Clocking work time, Prev: Creating timestamps, Up: Dates and Times
-
-8.3 Deadlines and scheduling
-============================
-
-A timestamp may be preceded by special keywords to facilitate planning:
-
-DEADLINE
- Meaning: the task (most likely a TODO item, though not
- necessarily) is supposed to be finished on that date.
-
- On the deadline date, the task will be listed in the agenda. In
- addition, the agenda for _today_ will carry a warning about the
- approaching or missed deadline, starting
- `org-deadline-warning-days' before the due date, and continuing
- until the entry is marked DONE. An example:
-
- *** TODO write article about the Earth for the Guide
- The editor in charge is [[bbdb:Ford Prefect]]
- DEADLINE: <2004-02-29 Sun>
-
- You can specify a different lead time for warnings for a specific
- deadlines using the following syntax. Here is an example with a
- warning period of 5 days `DEADLINE: <2004-02-29 Sun -5d>'.
-
-SCHEDULED
- Meaning: you are planning to start working on that task on the
- given date.
-
- The headline will be listed under the given date(1). In addition,
- a reminder that the scheduled date has passed will be present in
- the compilation for _today_, until the entry is marked DONE, i.e.
- the task will automatically be forwarded until completed.
-
- *** TODO Call Trillian for a date on New Years Eve.
- SCHEDULED: <2004-12-25 Sat>
-
- Important: Scheduling an item in Org-mode should not be understood
- in the same way that we understand scheduling a meeting. Setting
- a date for a meeting is just a simple appointment, you should mark
- this entry with a simple plain timestamp, to get this item shown
- on the date where it applies. This is a frequent misunderstanding
- by Org users. In Org-mode, scheduling means setting a date when
- you want to start working on an action item.
-
- You may use timestamps with repeaters in scheduling and deadline
-entries. Org-mode will issue early and late warnings based on the
-assumption that the timestamp represents the nearest instance of the
-repeater. However, the use of diary sexp entries like `<%%(diary-float
-t 42)>' in scheduling and deadline timestamps is limited. Org-mode
-does not know enough about the internals of each sexp function to issue
-early and late warnings. However, it will show the item on each day
-where the sexp entry matches.
-
-* Menu:
-
-* Inserting deadline/schedule:: Planning items
-* Repeated tasks:: Items that show up again and again
-
- ---------- Footnotes ----------
-
- (1) It will still be listed on that date after it has been marked
-DONE. If you don't like this, set the variable
-`org-agenda-skip-scheduled-if-done'.
-
-
-File: org, Node: Inserting deadline/schedule, Next: Repeated tasks, Prev: Deadlines and scheduling, Up: Deadlines and scheduling
-
-8.3.1 Inserting deadlines or schedules
---------------------------------------
-
-The following commands allow you to quickly insert a deadline or to
-schedule an item:
-
-`C-c C-d (`org-deadline')'
- Insert `DEADLINE' keyword along with a stamp. The insertion will
- happen in the line directly following the headline. When called
- with a prefix arg, an existing deadline will be removed from the
- entry. Depending on the variable `org-log-redeadline'(1), a note
- will be taken when changing an existing deadline.
-
-`C-c C-s (`org-schedule')'
- Insert `SCHEDULED' keyword along with a stamp. The insertion will
- happen in the line directly following the headline. Any CLOSED
- timestamp will be removed. When called with a prefix argument,
- remove the scheduling date from the entry. Depending on the
- variable `org-log-reschedule'(2), a note will be taken when
- changing an existing scheduling time.
-
-`C-c C-x C-k (`org-mark-entry-for-agenda-action')'
- Mark the current entry for agenda action. After you have marked
- the entry like this, you can open the agenda or the calendar to
- find an appropriate date. With the cursor on the selected date,
- press `k s' or `k d' to schedule the marked item.
-
-`C-c / d (`org-check-deadlines')'
- Create a sparse tree with all deadlines that are either past-due,
- or which will become due within `org-deadline-warning-days'. With
- `C-u' prefix, show all deadlines in the file. With a numeric
- prefix, check that many days. For example, `C-1 C-c / d' shows
- all deadlines due tomorrow.
-
-`C-c / b (`org-check-before-date')'
- Sparse tree for deadlines and scheduled items before a given date.
-
-`C-c / a (`org-check-after-date')'
- Sparse tree for deadlines and scheduled items after a given date.
-
- ---------- Footnotes ----------
-
- (1) with corresponding `#+STARTUP' keywords `logredeadline',
-`lognoteredeadline', and `nologredeadline'
-
- (2) with corresponding `#+STARTUP' keywords `logredeadline',
-`lognoteredeadline', and `nologredeadline'
-
-
-File: org, Node: Repeated tasks, Prev: Inserting deadline/schedule, Up: Deadlines and scheduling
-
-8.3.2 Repeated tasks
---------------------
-
-Some tasks need to be repeated again and again. Org-mode helps to
-organize such tasks using a so-called repeater in a DEADLINE, SCHEDULED,
-or plain timestamp. In the following example
- ** TODO Pay the rent
- DEADLINE: <2005-10-01 Sat +1m>
- the `+1m' is a repeater; the intended interpretation is that the task
-has a deadline on <2005-10-01> and repeats itself every (one) month
-starting from that time. If you need both a repeater and a special
-warning period in a deadline entry, the repeater should come first and
-the warning period last: `DEADLINE: <2005-10-01 Sat +1m -3d>'.
-
- Deadlines and scheduled items produce entries in the agenda when
-they are over-due, so it is important to be able to mark such an entry
-as completed once you have done so. When you mark a DEADLINE or a
-SCHEDULE with the TODO keyword DONE, it will no longer produce entries
-in the agenda. The problem with this is, however, that then also the
-_next_ instance of the repeated entry will not be active. Org-mode
-deals with this in the following way: When you try to mark such an
-entry DONE (using `C-c C-t'), it will shift the base date of the
-repeating timestamp by the repeater interval, and immediately set the
-entry state back to TODO(1). In the example above, setting the state
-to DONE would actually switch the date like this:
-
- ** TODO Pay the rent
- DEADLINE: <2005-11-01 Tue +1m>
-
- A timestamp(2) will be added under the deadline, to keep a record
-that you actually acted on the previous instance of this deadline.
-
- As a consequence of shifting the base date, this entry will no
-longer be visible in the agenda when checking past dates, but all
-future instances will be visible.
-
- With the `+1m' cookie, the date shift will always be exactly one
-month. So if you have not paid the rent for three months, marking this
-entry DONE will still keep it as an overdue deadline. Depending on the
-task, this may not be the best way to handle it. For example, if you
-forgot to call your father for 3 weeks, it does not make sense to call
-him 3 times in a single day to make up for it. Finally, there are tasks
-like changing batteries which should always repeat a certain time after
-the last time you did it. For these tasks, Org-mode has special
-repeaters `++' and `.+'. For example:
-
- ** TODO Call Father
- DEADLINE: <2008-02-10 Sun ++1w>
- Marking this DONE will shift the date by at least one week,
- but also by as many weeks as it takes to get this date into
- the future. However, it stays on a Sunday, even if you called
- and marked it done on Saturday.
- ** TODO Check the batteries in the smoke detectors
- DEADLINE: <2005-11-01 Tue .+1m>
- Marking this DONE will shift the date to one month after
- today.
-
- You may have both scheduling and deadline information for a specific
-task--just make sure that the repeater intervals on both are the same.
-
- An alternative to using a repeater is to create a number of copies
-of a task subtree, with dates shifted in each copy. The command `C-c
-C-x c' was created for this purpose, it is described in *Note Structure
-editing::.
-
- ---------- Footnotes ----------
-
- (1) In fact, the target state is taken from, in this sequence, the
-`REPEAT_TO_STATE' property or the variable `org-todo-repeat-to-state'.
-If neither of these is specified, the target state defaults to the
-first state of the TODO state sequence.
-
- (2) You can change this using the option `org-log-repeat', or the
-`#+STARTUP' options `logrepeat', `lognoterepeat', and `nologrepeat'.
-With `lognoterepeat', you will also be prompted for a note.
-
-
-File: org, Node: Clocking work time, Next: Effort estimates, Prev: Deadlines and scheduling, Up: Dates and Times
-
-8.4 Clocking work time
-======================
-
-Org-mode allows you to clock the time you spend on specific tasks in a
-project. When you start working on an item, you can start the clock.
-When you stop working on that task, or when you mark the task done, the
-clock is stopped and the corresponding time interval is recorded. It
-also computes the total time spent on each subtree of a project. And it
-remembers a history or tasks recently clocked, to that you can jump
-quickly between a number of tasks absorbing your time.
-
- To save the clock history across Emacs sessions, use
- (setq org-clock-persist 'history)
- (org-clock-persistence-insinuate)
- When you clock into a new task after resuming Emacs, the incomplete
-clock(1) will be found (*note Resolving idle time::) and you will be
-prompted about what to do with it.
-
-* Menu:
-
-* Clocking commands:: Starting and stopping a clock
-* The clock table:: Detailed reports
-* Resolving idle time:: Resolving time when you've been idle
-
- ---------- Footnotes ----------
-
- (1) To resume the clock under the assumption that you have worked on
-this task while outside Emacs, use `(setq org-clock-persist t)'.
-
-
-File: org, Node: Clocking commands, Next: The clock table, Prev: Clocking work time, Up: Clocking work time
-
-8.4.1 Clocking commands
------------------------
-
-`C-c C-x C-i (`org-clock-in')'
- Start the clock on the current item (clock-in). This inserts the
- CLOCK keyword together with a timestamp. If this is not the first
- clocking of this item, the multiple CLOCK lines will be wrapped
- into a `:LOGBOOK:' drawer (see also the variable
- `org-clock-into-drawer'). When called with a `C-u' prefix
- argument, select the task from a list of recently clocked tasks.
- With two `C-u C-u' prefixes, clock into the task at point and mark
- it as the default task. The default task will always be available
- when selecting a clocking task, with letter `d'.
- While the clock is running, the current clocking time is shown in
- the mode line, along with the title of the task. The clock time
- shown will be all time ever clocked for this task and its
- children. If the task has an effort estimate (*note Effort
- estimates::), the mode line displays the current clocking time
- against it(1) If the task is a repeating one (*note Repeated
- tasks::), only the time since the last reset of the task (2) will
- be shown. More control over what time is shown can be exercised
- with the `CLOCK_MODELINE_TOTAL' property. It may have the values
- `current' to show only the current clocking instance, `today' to
- show all time clocked on this tasks today (see also the variable
- `org-extend-today-until'), `all' to include all time, or `auto'
- which is the default(3).
- Clicking with `mouse-1' onto the mode line entry will pop up a
- menu with clocking options.
-
-`C-c C-x C-o (`org-clock-out')'
- Stop the clock (clock-out). This inserts another timestamp at the
- same location where the clock was last started. It also directly
- computes the resulting time in inserts it after the time range as
- `=> HH:MM'. See the variable `org-log-note-clock-out' for the
- possibility to record an additional note together with the
- clock-out timestamp(4).
-
-`C-c C-x C-e (`org-clock-modify-effort-estimate')'
- Update the effort estimate for the current clock task.
-
-`C-c C-c or C-c C-y (`org-evaluate-time-range')'
- Recompute the time interval after changing one of the timestamps.
- This is only necessary if you edit the timestamps directly. If
- you change them with `S-<cursor>' keys, the update is automatic.
-
-`C-c C-t (`org-todo')'
- Changing the TODO state of an item to DONE automatically stops the
- clock if it is running in this same item.
-
-`C-c C-x C-x (`org-clock-cancel')'
- Cancel the current clock. This is useful if a clock was started by
- mistake, or if you ended up working on something else.
-
-`C-c C-x C-j (`org-clock-goto')'
- Jump to the headline of the currently clocked in task. With a
- `C-u' prefix arg, select the target task from a list of recently
- clocked tasks.
-
-`C-c C-x C-d (`org-clock-display')'
- Display time summaries for each subtree in the current buffer.
- This puts overlays at the end of each headline, showing the total
- time recorded under that heading, including the time of any
- subheadings. You can use visibility cycling to study the tree, but
- the overlays disappear when you change the buffer (see variable
- `org-remove-highlights-with-change') or press `C-c C-c'.
-
- The `l' key may be used in the timeline (*note Timeline::) and in
-the agenda (*note Weekly/daily agenda::) to show which tasks have been
-worked on or closed during a day.
-
- ---------- Footnotes ----------
-
- (1) To add an effort estimate "on the fly", hook a function doing
-this to `org-clock-in-prepare-hook'.
-
- (2) as recorded by the `LAST_REPEAT' property
-
- (3) See also the variable `org-clock-modeline-total'.
-
- (4) The corresponding in-buffer setting is: `#+STARTUP:
-lognoteclock-out'
-
-
-File: org, Node: The clock table, Next: Resolving idle time, Prev: Clocking commands, Up: Clocking work time
-
-8.4.2 The clock table
----------------------
-
-Org mode can produce quite complex reports based on the time clocking
-information. Such a report is called a _clock table_, because it is
-formatted as one or several Org tables.
-
-`C-c C-x C-r (`org-clock-report')'
- Insert a dynamic block (*note Dynamic blocks::) containing a clock
- report as an Org-mode table into the current file. When the
- cursor is at an existing clock table, just update it. When called
- with a prefix argument, jump to the first clock report in the
- current document and update it.
-
-`C-c C-c or C-c C-x C-u (`org-dblock-update')'
- Update dynamic block at point. The cursor needs to be in the
- `#+BEGIN' line of the dynamic block.
-
-`C-u C-c C-x C-u'
- Update all dynamic blocks (*note Dynamic blocks::). This is
- useful if you have several clock table blocks in a buffer.
-
-`S-<left>'
-`S-<right> (`org-clocktable-try-shift')'
- Shift the current `:block' interval and update the table. The
- cursor needs to be in the `#+BEGIN: clocktable' line for this
- command. If `:block' is `today', it will be shifted to `today-1'
- etc.
-
- Here is an example of the frame for a clock table as it is inserted
-into the buffer with the `C-c C-x C-r' command:
-
- #+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file
- #+END: clocktable
- The `BEGIN' line and specify a number of options to define the scope,
-structure, and formatting of the report. Defaults for all these
-options can be configured in the variable `org-clocktable-defaults'.
-
-First there are options that determine which clock entries are to be
-selected:
- :maxlevel Maximum level depth to which times are listed in the table.
- Clocks at deeper levels will be summed into the upper level.
- :scope The scope to consider. This can be any of the following:
- nil the current buffer or narrowed region
- file the full current buffer
- subtree the subtree where the clocktable is located
- treeN the surrounding level N tree, for example `tree3'
- tree the surrounding level 1 tree
- agenda all agenda files
- ("file"..) scan these files
- file-with-archives current file and its archives
- agenda-with-archives all agenda files, including archives
- :block The time block to consider. This block is specified either
- absolute, or relative to the current time and may be any of
- these formats:
- 2007-12-31 New year eve 2007
- 2007-12 December 2007
- 2007-W50 ISO-week 50 in 2007
- 2007-Q2 2nd quarter in 2007
- 2007 the year 2007
- today, yesterday, today-N a relative day
- thisweek, lastweek, thisweek-N a relative week
- thismonth, lastmonth, thismonth-N a relative month
- thisyear, lastyear, thisyear-N a relative year
- Use `S-<left>/<right>' keys to shift the time interval.
- :tstart A time string specifying when to start considering times.
- :tend A time string specifying when to stop considering times.
- :step `week' or `day', to split the table into chunks.
- To use this, `:block' or `:tstart', `:tend' are needed.
- :stepskip0 Do not show steps that have zero time.
- :fileskip0 Do not show table sections from files which did not contribute.
- :tags A tags match to select entries that should contribute.
-
- Then there are options which determine the formatting of the table.
-There options are interpreted by the function
-`org-clocktable-write-default', but you can specify your own function
-using the `:formatter' parameter.
- :emphasize When `t', emphasize level one and level two items.
- :link Link the item headlines in the table to their origins.
- :narrow An integer to limit the width of the headline column in
- the org table. If you write it like `50!', then the
- headline will also be shortened in export.
- :indent Indent each headline field according to its level.
- :tcolumns Number of columns to be used for times. If this is smaller
- than `:maxlevel', lower levels will be lumped into one column.
- :level Should a level number column be included?
- :compact Abbreviation for `:level nil :indent t :narrow 40! :tcolumns 1'
- All are overwritten except if there is an explicit `:narrow'
- :timestamp A timestamp for the entry, when available. Look for SCHEDULED,
- DEADLINE, TIMESTAMP and TIMESTAMP_IA, in this order.
- :formula Content of a `#+TBLFM' line to be added and evaluated.
- As a special case, `:formula %' adds a column with % time.
- If you do not specify a formula here, any existing formula
- below the clock table will survive updates and be evaluated.
- :formatter A function to format clock data and insert it into the buffer.
- To get a clock summary of the current level 1 tree, for the current
-day, you could write
- #+BEGIN: clocktable :maxlevel 2 :block today :scope tree1 :link t
- #+END: clocktable
- and to use a specific time range you could write(1)
- #+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>"
- :tend "<2006-08-10 Thu 12:00>"
- #+END: clocktable
- A summary of the current subtree with % times would be
- #+BEGIN: clocktable :scope subtree :link t :formula %
- #+END: clocktable
- A horizontally compact representation of everything clocked during
-last week would be
- #+BEGIN: clocktable :scope agenda :block lastweek :compact t
- #+END: clocktable
-
- ---------- Footnotes ----------
-
- (1) Note that all parameters must be specified in a single line--the
-line is broken here only to fit it into the manual.
-
-
-File: org, Node: Resolving idle time, Prev: The clock table, Up: Clocking work time
-
-8.4.3 Resolving idle time
--------------------------
-
-If you clock in on a work item, and then walk away from your
-computer--perhaps to take a phone call--you often need to "resolve" the
-time you were away by either subtracting it from the current clock, or
-applying it to another one.
-
- By customizing the variable `org-clock-idle-time' to some integer,
-such as 10 or 15, Emacs can alert you when you get back to your
-computer after being idle for that many minutes(1), and ask what you
-want to do with the idle time. There will be a question waiting for
-you when you get back, indicating how much idle time has passed
-(constantly updated with the current amount), as well as a set of
-choices to correct the discrepancy:
-
-`k'
- To keep some or all of the minutes and stay clocked in, press `k'.
- Org will ask how many of the minutes to keep. Press <RET> to
- keep them all, effectively changing nothing, or enter a number to
- keep that many minutes.
-
-`K'
- If you use the shift key and press `K', it will keep however many
- minutes you request and then immediately clock out of that task.
- If you keep all of the minutes, this is the same as just clocking
- out of the current task.
-
-`s'
- To keep none of the minutes, use `s' to subtract all the away time
- from the clock, and then check back in from the moment you
- returned.
-
-`S'
- To keep none of the minutes and just clock out at the start of the
- away time, use the shift key and press `S'. Remember that using
- shift will always leave you clocked out, no matter which option
- you choose.
-
-`C'
- To cancel the clock altogether, use `C'. Note that if instead of
- canceling you subtract the away time, and the resulting clock
- amount is less than a minute, the clock will still be canceled
- rather than clutter up the log with an empty entry.
-
- What if you subtracted those away minutes from the current clock,
-and now want to apply them to a new clock? Simply clock in to any task
-immediately after the subtraction. Org will notice that you have
-subtracted time "on the books", so to speak, and will ask if you want
-to apply those minutes to the next task you clock in on.
-
- There is one other instance when this clock resolution magic occurs.
-Say you were clocked in and hacking away, and suddenly your cat chased
-a mouse who scared a hamster that crashed into your UPS's power button!
-You suddenly lose all your buffers, but thanks to auto-save you still
-have your recent Org mode changes, including your last clock in.
-
- If you restart Emacs and clock into any task, Org will notice that
-you have a dangling clock which was never clocked out from your last
-session. Using that clock's starting time as the beginning of the
-unaccounted-for period, Org will ask how you want to resolve that time.
-The logic and behavior is identical to dealing with away time due to
-idleness; it's just happening due to a recovery event rather than a set
-amount of idle time.
-
- You can also check all the files visited by your Org agenda for
-dangling clocks at any time using `M-x org-resolve-clocks'.
-
- ---------- Footnotes ----------
-
- (1) On computers using Mac OS X, idleness is based on actual user
-idleness, not just Emacs' idle time. For X11, you can install a
-utility program `x11idle.c', available in the UTILITIES directory of
-the Org git distribution, to get the same general treatment of
-idleness. On other systems, idle time refers to Emacs idle time only.
-
-
-File: org, Node: Effort estimates, Next: Relative timer, Prev: Clocking work time, Up: Dates and Times
-
-8.5 Effort estimates
-====================
-
-If you want to plan your work in a very detailed way, or if you need to
-produce offers with quotations of the estimated work effort, you may
-want to assign effort estimates to entries. If you are also clocking
-your work, you may later want to compare the planned effort with the
-actual working time, a great way to improve planning estimates. Effort
-estimates are stored in a special property `Effort'(1). You can set
-the effort for an entry with the following commands:
-
-`C-c C-x e (`org-set-effort')'
- Set the effort estimate for the current entry. With a numeric
- prefix argument, set it to the Nth allowed value (see below).
- This command is also accessible from the agenda with the `e' key.
-
-`C-c C-x C-e (`org-clock-modify-effort-estimate')'
- Modify the effort estimate of the item currently being clocked.
-
- Clearly the best way to work with effort estimates is through column
-view (*note Column view::). You should start by setting up discrete
-values for effort estimates, and a `COLUMNS' format that displays these
-values together with clock sums (if you want to clock your time). For
-a specific buffer you can use
-
- #+PROPERTY: Effort_ALL 0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00 8:00
- #+COLUMNS: %40ITEM(Task) %17Effort(Estimated Effort){:} %CLOCKSUM
-
-or, even better, you can set up these values globally by customizing the
-variables `org-global-properties' and `org-columns-default-format'. In
-particular if you want to use this setup also in the agenda, a global
-setup may be advised.
-
- The way to assign estimates to individual items is then to switch to
-column mode, and to use `S-<right>' and `S-<left>' to change the value.
-The values you enter will immediately be summed up in the hierarchy.
-In the column next to it, any clocked time will be displayed.
-
- If you switch to column view in the daily/weekly agenda, the effort
-column will summarize the estimated work effort for each day(2), and
-you can use this to find space in your schedule. To get an overview of
-the entire part of the day that is committed, you can set the option
-`org-agenda-columns-add-appointments-to-effort-sum'. The appointments
-on a day that take place over a specified time interval will then also
-be added to the load estimate of the day.
-
- Effort estimates can be used in secondary agenda filtering that is
-triggered with the `/' key in the agenda (*note Agenda commands::). If
-you have these estimates defined consistently, two or three key presses
-will narrow down the list to stuff that fits into an available time
-slot.
-
- ---------- Footnotes ----------
-
- (1) You may change the property being used with the variable
-`org-effort-property'.
-
- (2) Please note the pitfalls of summing hierarchical data in a flat
-list (*note Agenda column view::).
-
-
-File: org, Node: Relative timer, Next: Countdown timer, Prev: Effort estimates, Up: Dates and Times
-
-8.6 Taking notes with a relative timer
-======================================
-
-When taking notes during, for example, a meeting or a video viewing, it
-can be useful to have access to times relative to a starting time. Org
-provides such a relative timer and make it easy to create timed notes.
-
-`C-c C-x . (`org-timer')'
- Insert a relative time into the buffer. The first time you use
- this, the timer will be started. When called with a prefix
- argument, the timer is restarted.
-
-`C-c C-x - (`org-timer-item')'
- Insert a description list item with the current relative time.
- With a prefix argument, first reset the timer to 0.
-
-`M-<RET> (`org-insert-heading')'
- Once the timer list is started, you can also use `M-<RET>' to
- insert new timer items.
-
-`C-c C-x ,'
- Pause the timer, or continue it if it is already paused
- (`org-timer-pause-or-continue').
-
-`C-u C-c C-x ,'
- Stop the timer. After this, you can only start a new timer, not
- continue the old one. This command also removes the timer from
- the mode line.
-
-`C-c C-x 0 (`org-timer-start')'
- Reset the timer without inserting anything into the buffer. By
- default, the timer is reset to 0. When called with a `C-u'
- prefix, reset the timer to specific starting offset. The user is
- prompted for the offset, with a default taken from a timer string
- at point, if any, So this can be used to restart taking notes
- after a break in the process. When called with a double prefix
- argument `C-u C-u', change all timer strings in the active region
- by a certain amount. This can be used to fix timer strings if the
- timer was not started at exactly the right moment.
-
-
-File: org, Node: Countdown timer, Prev: Relative timer, Up: Dates and Times
-
-8.7 Countdown timer
-===================
-
-Calling `org-timer-set-timer' from an Org-mode buffer runs a countdown
-timer. Use <;> from agenda buffers, <C-c C-x ;> everwhere else.
-
- `org-timer-set-timer' prompts the user for a duration and displays a
-countdown timer in the modeline. `org-timer-default-timer' sets the
-default countdown value. Giving a prefix numeric argument overrides
-this default value.
-
-
-File: org, Node: Capture - Refile - Archive, Next: Agenda Views, Prev: Dates and Times, Up: Top
-
-9 Capture - Refile - Archive
-****************************
-
-An important part of any organization system is the ability to quickly
-capture new ideas and tasks, and to associate reference material with
-them. Org does this using a process called capture. It also can store
-files related to a task (attachments) in a special directory. Once in
-the system, tasks and projects need to be moved around. Moving
-completed project trees to an archive file keeps the system compact and
-fast.
-
-* Menu:
-
-* Capture:: Capturing new stuff
-* Attachments:: Add files to tasks
-* RSS Feeds:: Getting input from RSS feeds
-* Protocols:: External (e.g. Browser) access to Emacs and Org
-* Refiling notes:: Moving a tree from one place to another
-* Archiving:: What to do with finished projects
-
-
-File: org, Node: Capture, Next: Attachments, Prev: Capture - Refile - Archive, Up: Capture - Refile - Archive
-
-9.1 Capture
-===========
-
-Org's method for capturing new items is heavily inspired by John Wiegley
-excellent remember package. Up to version 6.36 Org used a special setup
-for `remember.el'. `org-remember.el' is still part of Org-mode for
-backward compatibility with existing setups. You can find the
-documentation for org-remember at `http://orgmode.org/org-remember.pdf'.
-
- The new capturing setup described here is preferred and should be
-used by new users. To convert your `org-remember-templates', run the
-command
- M-x org-capture-import-remember-templates <RET>
- and then customize the new variable with `M-x customize-variable
-org-capture-templates', check the result, and save the customization.
-You can then use both remember and capture until you are familiar with
-the new mechanism.
-
- Capture lets you quickly store notes with little interruption of
-your work flow. The basic process of capturing is very similar to
-remember, but Org does enhance it with templates and more.
-
-* Menu:
-
-* Setting up capture:: Where notes will be stored
-* Using capture:: Commands to invoke and terminate capture
-* Capture templates:: Define the outline of different note types
-
-
-File: org, Node: Setting up capture, Next: Using capture, Prev: Capture, Up: Capture
-
-9.1.1 Setting up capture
-------------------------
-
-The following customization sets a default target file for notes, and
-defines a global key(1) for capturing new material.
-
- (setq org-default-notes-file (concat org-directory "/notes.org"))
- (define-key global-map "\C-cc" 'org-capture)
-
- ---------- Footnotes ----------
-
- (1) Please select your own key, `C-c c' is only a suggestion.
-
-
-File: org, Node: Using capture, Next: Capture templates, Prev: Setting up capture, Up: Capture
-
-9.1.2 Using capture
--------------------
-
-`C-c c (`org-capture')'
- Call the command `org-capture'. Note that this keybinding is
- global and not active by default - you need to install it. If you
- have templates defined *note Capture templates::, it will offer
- these templates for selection or use a new Org outline node as the
- default template. It will insert the template into the target
- file and switch to an indirect buffer narrowed to this new node.
- You may then insert the information you want.
-
-`C-c C-c (`org-capture-finalize')'
- Once you have finished entering information into the capture
- buffer, `C-c C-c' will return you to the window configuration
- before the capture process, so that you can resume your work
- without further distraction. When called with a prefix arg,
- finalize and then jump to the captured item.
-
-`C-c C-w (`org-capture-refile')'
- Finalize the capture process by refiling (*note Refiling notes::)
- the note to a different place. Please realize that this is a
- normal refiling command that will be executed--so the cursor
- position at the moment you run this command is important. If you
- have inserted a tree with a parent and children, first move the
- cursor back to the parent. Any prefix argument given to this
- command will be passed on to the `org-refile' command.
-
-`C-c C-k (`org-capture-kill')'
- Abort the capture process and return to the previous state.
-
-
- You can also call `org-capture' in a special way from the agenda,
-using the `k c' key combination. With this access, any timestamps
-inserted by the selected capture template will default to the cursor
-date in the agenda, rather than to the current date.
-
- To find the locations of the last stored capture, use `org-capture'
-with prefix commands:
-
-`C-u C-c c'
- Visit the target location of a cpature template. You get to
- select the template in the usual way.
-
-`C-u C-u C-c c'
- Visit the last stored capture item in its buffer.
-
-
-File: org, Node: Capture templates, Prev: Using capture, Up: Capture
-
-9.1.3 Capture templates
------------------------
-
-You can use templates for different types of capture items, and for
-different target locations. The easiest way to create such templates is
-through the customize interface.
-
-`C-c c C'
- Customize the variable `org-capture-templates'.
-
- Before we give the formal description of template definitions, let's
-look at an example. Say you would like to use one template to create
-general TODO entries, and you want to put these entries under the
-heading `Tasks' in your file `~/org/gtd.org'. Also, a date tree in the
-file `journal.org' should capture journal entries. A possible
-configuration would look like:
-
- (setq org-capture-templates
- '(("t" "Todo" entry (file+headline "~/org/gtd.org" "Tasks")
- "* TODO %?\n %i\n %a")
- ("j" "Journal" entry (file+datetree "~/org/journal.org")
- "* %?\nEntered on %U\n %i\n %a")))
-
-If you then press `C-c c t', Org will prepare the template for you like
-this:
- * TODO
- [[file:LINK TO WHERE YOU INITIATED CAPTURE]]
-
-During expansion of the template, `%a' has been replaced by a link to
-the location from where you called the capture command. This can be
-extremely useful for deriving tasks from emails, for example. You fill
-in the task definition, press `C-c C-c' and Org returns you to the same
-place where you started the capture process.
-
-* Menu:
-
-* Template elements:: What is needed for a complete template entry
-* Template expansion:: Filling in information about time and context
-
-
-File: org, Node: Template elements, Next: Template expansion, Prev: Capture templates, Up: Capture templates
-
-9.1.3.1 Template elements
-.........................
-
-Now lets look at the elements of a template definition. Each entry in
-`org-capture-templates' is a list with the following items:
-
-KEYS
- The keys that will select the template, as a string, characters
- only, for example `"a"' for a template to be selected with a
- single key, or `"bt"' for selection with two keys. When using
- several keys, keys using the same prefix key must be sequential in
- the list and preceded by a 2-element entry explaining the prefix
- key, for example
- ("b" "Templates for marking stuff to buy")
- If you do not define a template for the `C' key, this key will be
- used to open the customize buffer for this complex variable.
-
-DESCRIPTION
- A short string describing the template, which will be shown during
- selection.
-
-TYPE
- The type of entry, a symbol. Valid values are:
- `entry'
- An Org-mode node, with a headline. Will be filed as the child
- of the target entry or as a top-level entry. The target file
- should be an Org-mode file.
-
- `item'
- A plain list item, placed in the first plain list at the
- target location. Again the target file should be an Org file.
-
- `checkitem'
- A checkbox item. This only differs from the plain list item
- by the default template.
-
- `table-line'
- a new line in the first table at the target location. Where
- exactly the line will be inserted depends on the properties
- `:prepend' and `:table-line-pos' (see below).
-
- `plain'
- Text to be inserted as it is.
-
-TARGET
- Specification of where the captured item should be placed. In
- Org-mode files, targets usually define a node. Entries will
- become children of this node. Other types will be added to the
- table or list in the body of this node. Most target
- specifications contain a file name. If that file name is the
- empty string, it defaults to `org-default-notes-file'.
-
- Valid values are:
- `(file "path/to/file")'
- Text will be placed at the beginning or end of that file.
-
- `(id "id of existing org entry")'
- Filing as child of this entry, or in the body of the entry.
-
- `(file+headline "path/to/file" "node headline")'
- Fast configuration if the target heading is unique in the
- file.
-
- `(file+olp "path/to/file" "Level 1 heading" "Level 2" ...)'
- For non-unique headings, the full path is safer.
-
- `(file+regexp "path/to/file" "regexp to find location")'
- Use a regular expression to position the cursor.
-
- `(file+datetree "path/to/file")'
- Will create a heading in a date tree for today's date.
-
- `(file+datetree+prompt "path/to/file")'
- Will create a heading in a date tree, but will prompt for the
- date.
-
- `(file+function "path/to/file" function-finding-location)'
- A function to find the right location in the file.
-
- `(clock)'
- File to the entry that is currently being clocked.
-
- `(function function-finding-location)'
- Most general way, write your own function to find both file
- and location.
-
-TEMPLATE
- The template for creating the capture item. If you leave this
- empty, an appropriate default template will be used. Otherwise
- this is a string with escape codes, which will be replaced
- depending on time and context of the capture call. The string
- with escapes may be loaded from a template file, using the special
- syntax `(file "path/to/template")'. See below for more details.
-
-PROPERTIES
- The rest of the entry is a property list of additional options.
- Recognized properties are:
- `:prepend'
- Normally new captured information will be appended at the
- target location (last child, last table line, last list
- item...). Setting this property will change that.
-
- `:immediate-finish'
- When set, do not offer to edit the information, just file it
- away immediately. This makes sense if the template only needs
- information that can be added automatically.
-
- `:empty-lines'
- Set this to the number of lines to insert before and after
- the new item. Default 0, only common other value is 1.
-
- `:clock-in'
- Start the clock in this item.
-
- `:clock-resume'
- If starting the capture interrupted a clock, restart that
- clock when finished with the capture.
-
- `:unnarrowed'
- Do not narrow the target buffer, simply show the full buffer.
- Default is to narrow it so that you only see the new
- material.
-
- `:kill-buffer'
- If the target file was not yet visited when capture was
- invoked, kill the buffer again after capture is completed.
-
-
-File: org, Node: Template expansion, Prev: Template elements, Up: Capture templates
-
-9.1.3.2 Template expansion
-..........................
-
-In the template itself, special `%'-escapes(1) allow dynamic insertion
-of content:
-
- %^{PROMPT} prompt the user for a string and replace this sequence with it.
- You may specify a default value and a completion table with
- %^{prompt|default|completion2|completion3...}
- The arrow keys access a prompt-specific history.
- %a annotation, normally the link created with `org-store-link'
- %A like `%a', but prompt for the description part
- %i initial content, the region when capture is called while the
- region is active.
- The entire text will be indented like `%i' itself.
- %t timestamp, date only
- %T timestamp with date and time
- %u, %U like the above, but inactive timestamps
- %^t like `%t', but prompt for date. Similarly `%^T', `%^u', `%^U'
- You may define a prompt like `%^{Birthday}t'
- %n user name (taken from `user-full-name')
- %c Current kill ring head.
- %x Content of the X clipboard.
- %^C Interactive selection of which kill or clip to use.
- %^L Like `%^C', but insert as link.
- %k title of the currently clocked task
- %K link to the currently clocked task
- %^g prompt for tags, with completion on tags in target file.
- %^G prompt for tags, with completion all tags in all agenda files.
- %^{PROP}p Prompt the user for a value for property PROP
- %:keyword specific information for certain link types, see below
- %[FILE] insert the contents of the file given by FILE
- %(SEXP) evaluate Elisp SEXP and replace with the result
-
-For specific link types, the following keywords will be defined(2):
-
- Link type | Available keywords
- -------------------+----------------------------------------------
- bbdb | %:name %:company
- irc | %:server %:port %:nick
- vm, wl, mh, mew, rmail | %:type %:subject %:message-id
- | %:from %:fromname %:fromaddress
- | %:to %:toname %:toaddress
- | %:date (message date header field)
- | %:date-timestamp (date as active timestamp)
- | %:date-timestamp-inactive (date as inactive timestamp)
- | %:fromto (either "to NAME" or "from NAME")(3)
- gnus | %:group, for messages also all email fields
- w3, w3m | %:url
- info | %:file %:node
- calendar | %:date
-
-To place the cursor after template expansion use:
-
- %? After completing the template, position cursor here.
-
- ---------- Footnotes ----------
-
- (1) If you need one of these sequences literally, escape the `%'
-with a backslash.
-
- (2) If you define your own link types (*note Adding hyperlink
-types::), any property you store with `org-store-link-props' can be
-accessed in capture templates in a similar way.
-
- (3) This will always be the other, not the user. See the variable
-`org-from-is-user-regexp'.
-
-
-File: org, Node: Attachments, Next: RSS Feeds, Prev: Capture, Up: Capture - Refile - Archive
-
-9.2 Attachments
-===============
-
-It is often useful to associate reference material with an outline
-node/task. Small chunks of plain text can simply be stored in the
-subtree of a project. Hyperlinks (*note Hyperlinks::) can establish
-associations with files that live elsewhere on your computer or in the
-cloud, like emails or source code files belonging to a project.
-Another method is attachments, which are files located in a directory
-belonging to an outline node. Org uses directories named by the unique
-ID of each entry. These directories are located in the `data'
-directory which lives in the same directory where your Org file
-lives(1). If you initialize this directory with `git init', Org will
-automatically commit changes when it sees them. The attachment system
-has been contributed to Org by John Wiegley.
-
- In cases where it seems better to do so, you can also attach a
-directory of your choice to an entry. You can also make children
-inherit the attachment directory from a parent, so that an entire
-subtree uses the same attached directory.
-
-The following commands deal with attachments:
-
-`C-c C-a (`org-attach')'
- The dispatcher for commands related to the attachment system.
- After these keys, a list of commands is displayed and you must
- press an additional key to select a command:
-
- `a (`org-attach-attach')'
- Select a file and move it into the task's attachment
- directory. The file will be copied, moved, or linked,
- depending on `org-attach-method'. Note that hard links are
- not supported on all systems.
-
- `c/m/l'
- Attach a file using the copy/move/link method. Note that
- hard links are not supported on all systems.
-
- `n (`org-attach-new')'
- Create a new attachment as an Emacs buffer.
-
- `z (`org-attach-sync')'
- Synchronize the current task with its attachment directory,
- in case you added attachments yourself.
-
- `p (`org-attach-open')'
- Open current task's attachment. If there is more than one,
- prompt for a file name first. Opening will follow the rules
- set by `org-file-apps'. For more details, see the
- information on following hyperlinks (*note Handling links::).
-
- `O (`org-attach-open-in-emacs')'
- Also open the attachment, but force opening the file in Emacs.
-
- `f (`org-attach-reveal')'
- Open the current task's attachment directory.
-
- `F (`org-attach-reveal-in-emacs')'
- Also open the directory, but force using `dired' in Emacs.
-
- `d (`org-attach-delete-one')'
- Select and delete a single attachment.
-
- `D (`org-attach-delete-all')'
- Delete all of a task's attachments. A safer way is to open
- the directory in `dired' and delete from there.
-
- `s (`org-attach-set-directory')'
- Set a specific directory as the entry's attachment directory.
- This works by putting the directory path into the
- `ATTACH_DIR' property.
-
- `i (`org-attach-set-inherit')'
- Set the `ATTACH_DIR_INHERIT' property, so that children will
- use the same directory for attachments as the parent does.
-
- ---------- Footnotes ----------
-
- (1) If you move entries or Org files from one directory to another,
-you may want to configure `org-attach-directory' to contain an absolute
-path.
-
-
-File: org, Node: RSS Feeds, Next: Protocols, Prev: Attachments, Up: Capture - Refile - Archive
-
-9.3 RSS feeds
-=============
-
-Org can add and change entries based on information found in RSS feeds
-and Atom feeds. You could use this to make a task out of each new
-podcast in a podcast feed. Or you could use a phone-based
-note-creating service on the web to import tasks into Org. To access
-feeds, configure the variable `org-feed-alist'. The docstring of this
-variable has detailed information. Here is just an example:
-
- (setq org-feed-alist
- '(("Slashdot"
- "http://rss.slashdot.org/Slashdot/slashdot"
- "~/txt/org/feeds.org" "Slashdot Entries")))
-
-will configure that new items from the feed provided by
-`rss.slashdot.org' will result in new entries in the file
-`~/org/feeds.org' under the heading `Slashdot Entries', whenever the
-following command is used:
-
-`C-c C-x g (`org-feed-update-all')'
-
-`C-c C-x g'
- Collect items from the feeds configured in `org-feed-alist' and
- act upon them.
-
-`C-c C-x G (`org-feed-goto-inbox')'
- Prompt for a feed name and go to the inbox configured for this
- feed.
-
- Under the same headline, Org will create a drawer `FEEDSTATUS' in
-which it will store information about the status of items in the feed,
-to avoid adding the same item several times. You should add
-`FEEDSTATUS' to the list of drawers in that file:
-
- #+DRAWERS: LOGBOOK PROPERTIES FEEDSTATUS
-
- For more information, including how to read atom feeds, see
-`org-feed.el' and the docstring of `org-feed-alist'.
-
-
-File: org, Node: Protocols, Next: Refiling notes, Prev: RSS Feeds, Up: Capture - Refile - Archive
-
-9.4 Protocols for external access
-=================================
-
-You can set up Org for handling protocol calls from outside
-applications that are passed to Emacs through the `emacsserver'. For
-example, you can configure bookmarks in your web browser to send a link
-to the current page to Org and create a note from it using capture
-(*note Capture::). Or you could create a bookmark that will tell Emacs
-to open the local source file of a remote website you are looking at
-with the browser. See
-`http://orgmode.org/worg/org-contrib/org-protocol.php' for detailed
-documentation and setup instructions.
-
-
-File: org, Node: Refiling notes, Next: Archiving, Prev: Protocols, Up: Capture - Refile - Archive
-
-9.5 Refiling notes
-==================
-
-When reviewing the captured data, you may want to refile some of the
-entries into a different list, for example into a project. Cutting,
-finding the right location, and then pasting the note is cumbersome.
-To simplify this process, you can use the following special command:
-
-`C-c C-w (`org-refile')'
- Refile the entry or region at point. This command offers possible
- locations for refiling the entry and lets you select one with
- completion. The item (or all items in the region) is filed below
- the target heading as a subitem. Depending on
- `org-reverse-note-order', it will be either the first or last
- subitem.
- By default, all level 1 headlines in the current buffer are
- considered to be targets, but you can have more complex
- definitions across a number of files. See the variable
- `org-refile-targets' for details. If you would like to select a
- location via a file-path-like completion along the outline path,
- see the variables `org-refile-use-outline-path' and
- `org-outline-path-complete-in-steps'. If you would like to be
- able to create new nodes as new parents for refiling on the fly,
- check the variable `org-refile-allow-creating-parent-nodes'. When
- the variable `org-log-refile'(1) is set, a time stamp or a note
- will be recorded when an entry has been refiled.
-
-`C-u C-c C-w'
- Use the refile interface to jump to a heading.
-
-`C-u C-u C-c C-w (`org-refile-goto-last-stored')'
- Jump to the location where `org-refile' last moved a tree to.
-
-`C-2 C-c C-w'
- Refile as the child of the item currently being clocked.
-
-`C-0 C-c C-w or C-u C-u C-u C-c C-w'
-
-`C-0 C-c C-w or C-u C-u C-u C-c C-w (`org-refile-cache-clear')'
- Clear the target cache. Caching of refile targets can be turned
- on by setting `org-refile-use-cache'. To make the command see new
- possible targets, you have to clear the cache with this command.
-
- ---------- Footnotes ----------
-
- (1) with corresponding `#+STARTUP' keywords `logrefile',
-`lognoterefile', and `nologrefile'
-
-
-File: org, Node: Archiving, Prev: Refiling notes, Up: Capture - Refile - Archive
-
-9.6 Archiving
-=============
-
-When a project represented by a (sub)tree is finished, you may want to
-move the tree out of the way and to stop it from contributing to the
-agenda. Archiving is important to keep your working files compact and
-global searches like the construction of agenda views fast.
-
-`C-c C-x C-a (`org-archive-subtree-default')'
- Archive the current entry using the command specified in the
- variable `org-archive-default-command'.
-
-* Menu:
-
-* Moving subtrees:: Moving a tree to an archive file
-* Internal archiving:: Switch off a tree but keep it in the file
-
-
-File: org, Node: Moving subtrees, Next: Internal archiving, Prev: Archiving, Up: Archiving
-
-9.6.1 Moving a tree to the archive file
----------------------------------------
-
-The most common archiving action is to move a project tree to another
-file, the archive file.
-
-`C-c C-x C-s or short C-c $ (`org-archive-subtree')'
- Archive the subtree starting at the cursor position to the location
- given by `org-archive-location'.
-
-`C-u C-c C-x C-s'
- Check if any direct children of the current headline could be
- moved to the archive. To do this, each subtree is checked for
- open TODO entries. If none are found, the command offers to move
- it to the archive location. If the cursor is _not_ on a headline
- when this command is invoked, the level 1 trees will be checked.
-
- The default archive location is a file in the same directory as the
-current file, with the name derived by appending `_archive' to the
-current file name. For information and examples on how to change this,
-see the documentation string of the variable `org-archive-location'.
-There is also an in-buffer option for setting this variable, for
-example(1):
-
- #+ARCHIVE: %s_done::
-
-If you would like to have a special ARCHIVE location for a single entry
-or a (sub)tree, give the entry an `:ARCHIVE:' property with the
-location as the value (*note Properties and Columns::).
-
- When a subtree is moved, it receives a number of special properties
-that record context information like the file from where the entry
-came, its outline path the archiving time etc. Configure the variable
-`org-archive-save-context-info' to adjust the amount of information
-added.
-
- ---------- Footnotes ----------
-
- (1) For backward compatibility, the following also works: If there
-are several such lines in a file, each specifies the archive location
-for the text below it. The first such line also applies to any text
-before its definition. However, using this method is _strongly_
-deprecated as it is incompatible with the outline structure of the
-document. The correct method for setting multiple archive locations in
-a buffer is using properties.
-
-
-File: org, Node: Internal archiving, Prev: Moving subtrees, Up: Archiving
-
-9.6.2 Internal archiving
-------------------------
-
-If you want to just switch off (for agenda views) certain subtrees
-without moving them to a different file, you can use the `ARCHIVE tag'.
-
- A headline that is marked with the ARCHIVE tag (*note Tags::) stays
-at its location in the outline tree, but behaves in the following way:
- - It does not open when you attempt to do so with a visibility
- cycling command (*note Visibility cycling::). You can force
- cycling archived subtrees with `C-<TAB>', or by setting the option
- `org-cycle-open-archived-trees'. Also normal outline commands like
- `show-all' will open archived subtrees.
-
- - During sparse tree construction (*note Sparse trees::), matches in
- archived subtrees are not exposed, unless you configure the option
- `org-sparse-tree-open-archived-trees'.
-
- - During agenda view construction (*note Agenda Views::), the
- content of archived trees is ignored unless you configure the
- option `org-agenda-skip-archived-trees', in which case these trees
- will always be included. In the agenda you can press `v a' to get
- archives temporarily included.
-
- - Archived trees are not exported (*note Exporting::), only the
- headline is. Configure the details using the variable
- `org-export-with-archived-trees'.
-
- - Archived trees are excluded from column view unless the variable
- `org-columns-skip-archived-trees' is configured to `nil'.
-
- The following commands help manage the ARCHIVE tag:
-
-`C-c C-x a (`org-toggle-archive-tag')'
- Toggle the ARCHIVE tag for the current headline. When the tag is
- set, the headline changes to a shadowed face, and the subtree
- below it is hidden.
-
-`C-u C-c C-x a'
- Check if any direct children of the current headline should be
- archived. To do this, each subtree is checked for open TODO
- entries. If none are found, the command offers to set the ARCHIVE
- tag for the child. If the cursor is _not_ on a headline when this
- command is invoked, the level 1 trees will be checked.
-
-`C-TAB (`org-force-cycle-archived')'
- Cycle a tree even if it is tagged with ARCHIVE.
-
-`C-c C-x A (`org-archive-to-archive-sibling')'
- Move the current entry to the _Archive Sibling_. This is a
- sibling of the entry with the heading `Archive' and the tag
- `ARCHIVE'. The entry becomes a child of that sibling and in this
- way retains a lot of its original context, including inherited
- tags and approximate position in the outline.
-
-
-File: org, Node: Agenda Views, Next: Markup, Prev: Capture - Refile - Archive, Up: Top
-
-10 Agenda views
-***************
-
-Due to the way Org works, TODO items, time-stamped items, and tagged
-headlines can be scattered throughout a file or even a number of files.
-To get an overview of open action items, or of events that are
-important for a particular date, this information must be collected,
-sorted and displayed in an organized way.
-
- Org can select items based on various criteria and display them in a
-separate buffer. Seven different view types are provided:
-
- * an _agenda_ that is like a calendar and shows information for
- specific dates,
-
- * a _TODO list_ that covers all unfinished action items,
-
- * a _match view_, showings headlines based on the tags, properties,
- and TODO state associated with them,
-
- * a _timeline view_ that shows all events in a single Org file, in
- time-sorted view,
-
- * a _text search view_ that shows all entries from multiple files
- that contain specified keywords,
-
- * a _stuck projects view_ showing projects that currently don't move
- along, and
-
- * _custom views_ that are special searches and combinations of
- different views.
-
-The extracted information is displayed in a special _agenda buffer_.
-This buffer is read-only, but provides commands to visit the
-corresponding locations in the original Org files, and even to edit
-these files remotely.
-
- Two variables control how the agenda buffer is displayed and whether
-the window configuration is restored when the agenda exits:
-`org-agenda-window-setup' and `org-agenda-restore-windows-after-quit'.
-
-* Menu:
-
-* Agenda files:: Files being searched for agenda information
-* Agenda dispatcher:: Keyboard access to agenda views
-* Built-in agenda views:: What is available out of the box?
-* Presentation and sorting:: How agenda items are prepared for display
-* Agenda commands:: Remote editing of Org trees
-* Custom agenda views:: Defining special searches and views
-* Exporting Agenda Views:: Writing a view to a file
-* Agenda column view:: Using column view for collected entries
-
-
-File: org, Node: Agenda files, Next: Agenda dispatcher, Prev: Agenda Views, Up: Agenda Views
-
-10.1 Agenda files
-=================
-
-The information to be shown is normally collected from all _agenda
-files_, the files listed in the variable `org-agenda-files'(1). If a
-directory is part of this list, all files with the extension `.org' in
-this directory will be part of the list.
-
- Thus, even if you only work with a single Org file, that file should
-be put into the list(2). You can customize `org-agenda-files', but the
-easiest way to maintain it is through the following commands
-
-`C-c [ (`org-agenda-to-front')'
- Add current file to the list of agenda files. The file is added to
- the front of the list. If it was already in the list, it is moved
- to the front. With a prefix argument, file is added/moved to the
- end.
-
-`C-c ] (`org-remove-file')'
- Remove current file from the list of agenda files.
-
-`C-' (`org-cycle-agenda-files')'
-`C-,'
- Cycle through agenda file list, visiting one file after the other.
-
-`M-x org-iswitchb'
- Command to use an `iswitchb'-like interface to switch to and
- between Org buffers.
-
-The Org menu contains the current list of files and can be used to
-visit any of them.
-
- If you would like to focus the agenda temporarily on a file not in
-this list, or on just one file in the list, or even on only a subtree
-in a file, then this can be done in different ways. For a single
-agenda command, you may press `<' once or several times in the
-dispatcher (*note Agenda dispatcher::). To restrict the agenda scope
-for an extended period, use the following commands:
-
-`C-c C-x < (`org-agenda-set-restriction-lock')'
- Permanently restrict the agenda to the current subtree. When with
- a prefix argument, or with the cursor before the first headline in
- a file, the agenda scope is set to the entire file. This
- restriction remains in effect until removed with `C-c C-x >', or
- by typing either `<' or `>' in the agenda dispatcher. If there is
- a window displaying an agenda view, the new restriction takes
- effect immediately.
-
-`C-c C-x > (`org-agenda-remove-restriction-lock')'
- Remove the permanent restriction created by `C-c C-x <'.
-
-When working with `speedbar.el', you can use the following commands in
-the Speedbar frame:
-`< in the speedbar frame (`org-speedbar-set-agenda-restriction')'
- Permanently restrict the agenda to the item--either an Org file or
- a subtree in such a file--at the cursor in the Speedbar frame. If
- there is a window displaying an agenda view, the new restriction
- takes effect immediately.
-
-`> in the speedbar frame (`org-agenda-remove-restriction-lock')'
- Lift the restriction.
-
- ---------- Footnotes ----------
-
- (1) If the value of that variable is not a list, but a single file
-name, then the list of agenda files will be maintained in that external
-file.
-
- (2) When using the dispatcher, pressing `<' before selecting a
-command will actually limit the command to the current file, and ignore
-`org-agenda-files' until the next dispatcher command.
-
-
-File: org, Node: Agenda dispatcher, Next: Built-in agenda views, Prev: Agenda files, Up: Agenda Views
-
-10.2 The agenda dispatcher
-==========================
-
-The views are created through a dispatcher, which should be bound to a
-global key--for example `C-c a' (*note Installation::). In the
-following we will assume that `C-c a' is indeed how the dispatcher is
-accessed and list keyboard access to commands accordingly. After
-pressing `C-c a', an additional letter is required to execute a
-command. The dispatcher offers the following default commands:
-`a'
- Create the calendar-like agenda (*note Weekly/daily agenda::).
-
-`t / T'
- Create a list of all TODO items (*note Global TODO list::).
-
-`m / M'
- Create a list of headlines matching a TAGS expression (*note
- Matching tags and properties::).
-
-`L'
- Create the timeline view for the current buffer (*note Timeline::).
-
-`s'
- Create a list of entries selected by a boolean expression of
- keywords and/or regular expressions that must or must not occur in
- the entry.
-
-`/'
- Search for a regular expression in all agenda files and
- additionally in the files listed in
- `org-agenda-text-search-extra-files'. This uses the Emacs command
- `multi-occur'. A prefix argument can be used to specify the
- number of context lines for each match, default is 1.
-
-`# / !'
- Create a list of stuck projects (*note Stuck projects::).
-
-`<'
- Restrict an agenda command to the current buffer(1). After
- pressing `<', you still need to press the character selecting the
- command.
-
-`< <'
- If there is an active region, restrict the following agenda
- command to the region. Otherwise, restrict it to the current
- subtree(2). After pressing `< <', you still need to press the
- character selecting the command.
-
- You can also define custom commands that will be accessible through
-the dispatcher, just like the default commands. This includes the
-possibility to create extended agenda buffers that contain several
-blocks together, for example the weekly agenda, the global TODO list and
-a number of special tags matches. *Note Custom agenda views::.
-
- ---------- Footnotes ----------
-
- (1) For backward compatibility, you can also press `1' to restrict
-to the current buffer.
-
- (2) For backward compatibility, you can also press `0' to restrict
-to the current region/subtree.
-
-
-File: org, Node: Built-in agenda views, Next: Presentation and sorting, Prev: Agenda dispatcher, Up: Agenda Views
-
-10.3 The built-in agenda views
-==============================
-
-In this section we describe the built-in views.
-
-* Menu:
-
-* Weekly/daily agenda:: The calendar page with current tasks
-* Global TODO list:: All unfinished action items
-* Matching tags and properties:: Structured information with fine-tuned search
-* Timeline:: Time-sorted view for single file
-* Search view:: Find entries by searching for text
-* Stuck projects:: Find projects you need to review
-
-
-File: org, Node: Weekly/daily agenda, Next: Global TODO list, Prev: Built-in agenda views, Up: Built-in agenda views
-
-10.3.1 The weekly/daily agenda
-------------------------------
-
-The purpose of the weekly/daily _agenda_ is to act like a page of a
-paper agenda, showing all the tasks for the current week or day.
-
-`C-c a a (`org-agenda-list')'
- Compile an agenda for the current week from a list of Org files.
- The agenda shows the entries for each day. With a numeric
- prefix(1) (like `C-u 2 1 C-c a a') you may set the number of days
- to be displayed.
-
- The default number of days displayed in the agenda is set by the
-variable `org-agenda-span' (or the obsolete `org-agenda-ndays'). This
-variable can be set to any number of days you want to see by default in
-the agenda, or to a span name, such a `day', `week', `month' or `year'.
-
- Remote editing from the agenda buffer means, for example, that you
-can change the dates of deadlines and appointments from the agenda
-buffer. The commands available in the Agenda buffer are listed in
-*Note Agenda commands::.
-
-Calendar/Diary integration
-..........................
-
-Emacs contains the calendar and diary by Edward M. Reingold. The
-calendar displays a three-month calendar with holidays from different
-countries and cultures. The diary allows you to keep track of
-anniversaries, lunar phases, sunrise/set, recurrent appointments
-(weekly, monthly) and more. In this way, it is quite complementary to
-Org. It can be very useful to combine output from Org with the diary.
-
- In order to include entries from the Emacs diary into Org-mode's
-agenda, you only need to customize the variable
-
- (setq org-agenda-include-diary t)
-
-After that, everything will happen automatically. All diary entries
-including holidays, anniversaries, etc., will be included in the agenda
-buffer created by Org-mode. <SPC>, <TAB>, and <RET> can be used from
-the agenda buffer to jump to the diary file in order to edit existing
-diary entries. The `i' command to insert new entries for the current
-date works in the agenda buffer, as well as the commands `S', `M', and
-`C' to display Sunrise/Sunset times, show lunar phases and to convert
-to other calendars, respectively. `c' can be used to switch back and
-forth between calendar and agenda.
-
- If you are using the diary only for sexp entries and holidays, it is
-faster to not use the above setting, but instead to copy or even move
-the entries into an Org file. Org-mode evaluates diary-style sexp
-entries, and does it faster because there is no overhead for first
-creating the diary display. Note that the sexp entries must start at
-the left margin, no whitespace is allowed before them. For example,
-the following segment of an Org file will be processed and entries will
-be made in the agenda:
-
- * Birthdays and similar stuff
- #+CATEGORY: Holiday
- %%(org-calendar-holiday) ; special function for holiday names
- #+CATEGORY: Ann
- %%(diary-anniversary 5 14 1956)(2) Arthur Dent is %d years old
- %%(diary-anniversary 10 2 1869) Mahatma Gandhi would be %d years old
-
-Anniversaries from BBDB
-.......................
-
-If you are using the Big Brothers Database to store your contacts, you
-will very likely prefer to store anniversaries in BBDB rather than in a
-separate Org or diary file. Org supports this and will show BBDB
-anniversaries as part of the agenda. All you need to do is to add the
-following to one your your agenda files:
-
- * Anniversaries
- :PROPERTIES:
- :CATEGORY: Anniv
- :END:
- %%(org-bbdb-anniversaries)
-
- You can then go ahead and define anniversaries for a BBDB record.
-Basically, you need to press `C-o anniversary <RET>' with the cursor in
-a BBDB record and then add the date in the format `YYYY-MM-DD',
-followed by a space and the class of the anniversary (`birthday' or
-`wedding', or a format string). If you omit the class, it will default
-to `birthday'. Here are a few examples, the header for the file
-`org-bbdb.el' contains more detailed information.
-
- 1973-06-22
- 1955-08-02 wedding
- 2008-04-14 %s released version 6.01 of org-mode, %d years ago
-
- After a change to BBDB, or for the first agenda display during an
-Emacs session, the agenda display will suffer a short delay as Org
-updates its hash with anniversaries. However, from then on things will
-be very fast--much faster in fact than a long list of
-`%%(diary-anniversary)' entries in an Org or Diary file.
-
-Appointment reminders
-.....................
-
-Org can interact with Emacs appointments notification facility. To add
-all the appointments of your agenda files, use the command
-`org-agenda-to-appt'. This command also lets you filter through the
-list of your appointments and add only those belonging to a specific
-category or matching a regular expression. See the docstring for
-details.
-
- ---------- Footnotes ----------
-
- (1) For backward compatibility, the universal prefix `C-u' causes
-all TODO entries to be listed before the agenda. This feature is
-deprecated, use the dedicated TODO list, or a block agenda instead
-(*note Block agenda::).
-
- (2) Note that the order of the arguments (month, day, year) depends
-on the setting of `calendar-date-style'.
-
-
-File: org, Node: Global TODO list, Next: Matching tags and properties, Prev: Weekly/daily agenda, Up: Built-in agenda views
-
-10.3.2 The global TODO list
----------------------------
-
-The global TODO list contains all unfinished TODO items formatted and
-collected into a single place.
-
-`C-c a t (`org-todo-list')'
- Show the global TODO list. This collects the TODO items from all
- agenda files (*note Agenda Views::) into a single buffer. By
- default, this lists items with a state the is not a DONE state.
- The buffer is in `agenda-mode', so there are commands to examine
- and manipulate the TODO entries directly from that buffer (*note
- Agenda commands::).
-
-`C-c a T (`org-todo-list')'
- Like the above, but allows selection of a specific TODO keyword.
- You can also do this by specifying a prefix argument to `C-c a t'.
- You are prompted for a keyword, and you may also specify several
- keywords by separating them with `|' as the boolean OR operator.
- With a numeric prefix, the Nth keyword in `org-todo-keywords' is
- selected. The `r' key in the agenda buffer regenerates it, and
- you can give a prefix argument to this command to change the
- selected TODO keyword, for example `3 r'. If you often need a
- search for a specific keyword, define a custom command for it
- (*note Agenda dispatcher::).
- Matching specific TODO keywords can also be done as part of a tags
- search (*note Tag searches::).
-
- Remote editing of TODO items means that you can change the state of a
-TODO entry with a single key press. The commands available in the TODO
-list are described in *Note Agenda commands::.
-
- Normally the global TODO list simply shows all headlines with TODO
-keywords. This list can become very long. There are two ways to keep
-it more compact:
- - Some people view a TODO item that has been _scheduled_ for
- execution or have a _deadline_ (*note Timestamps::) as no longer
- _open_. Configure the variables
- `org-agenda-todo-ignore-scheduled',
- `org-agenda-todo-ignore-deadlines',
- `org-agenda-todo-ignore-timestamp' and/or
- `org-agenda-todo-ignore-with-date' to exclude such items from the
- global TODO list.
-
- - TODO items may have sublevels to break up the task into subtasks.
- In such cases it may be enough to list only the highest level TODO
- headline and omit the sublevels from the global list. Configure
- the variable `org-agenda-todo-list-sublevels' to get this behavior.
-
-
-File: org, Node: Matching tags and properties, Next: Timeline, Prev: Global TODO list, Up: Built-in agenda views
-
-10.3.3 Matching tags and properties
------------------------------------
-
-If headlines in the agenda files are marked with _tags_ (*note Tags::),
-or have properties (*note Properties and Columns::), you can select
-headlines based on this metadata and collect them into an agenda
-buffer. The match syntax described here also applies when creating
-sparse trees with `C-c / m'.
-
-`C-c a m (`org-tags-view')'
- Produce a list of all headlines that match a given set of tags.
- The command prompts for a selection criterion, which is a boolean
- logic expression with tags, like `+work+urgent-withboss' or
- `work|home' (*note Tags::). If you often need a specific search,
- define a custom command for it (*note Agenda dispatcher::).
-
-`C-c a M (`org-tags-view')'
- Like `C-c a m', but only select headlines that are also TODO items
- in a not-DONE state and force checking subitems (see variable
- `org-tags-match-list-sublevels'). To exclude scheduled/deadline
- items, see the variable
- `org-agenda-tags-todo-honor-ignore-options'. Matching specific
- TODO keywords together with a tags match is also possible, see
- *Note Tag searches::.
-
- The commands available in the tags list are described in *Note
-Agenda commands::.
-
-Match syntax
-............
-
-A search string can use Boolean operators `&' for AND and `|' for OR.
-`&' binds more strongly than `|'. Parentheses are currently not
-implemented. Each element in the search is either a tag, a regular
-expression matching tags, or an expression like `PROPERTY OPERATOR
-VALUE' with a comparison operator, accessing a property value. Each
-element may be preceded by `-', to select against it, and `+' is
-syntactic sugar for positive selection. The AND operator `&' is
-optional when `+' or `-' is present. Here are some examples, using
-only tags.
-
-`+work-boss'
- Select headlines tagged `:work:', but discard those also tagged
- `:boss:'.
-
-`work|laptop'
- Selects lines tagged `:work:' or `:laptop:'.
-
-`work|laptop+night'
- Like before, but require the `:laptop:' lines to be tagged also
- `:night:'.
-
- Instead of a tag, you may also specify a regular expression enclosed
-in curly braces. For example, `work+{^boss.*}' matches headlines that
-contain the tag `:work:' and any tag starting with `boss'.
-
- You may also test for properties (*note Properties and Columns::) at
-the same time as matching tags. The properties may be real properties,
-or special properties that represent other metadata (*note Special
-properties::). For example, the "property" `TODO' represents the TODO
-keyword of the entry. Or, the "property" `LEVEL' represents the level
-of an entry. So a search `+LEVEL=3+boss-TODO="DONE"' lists all level
-three headlines that have the tag `boss' and are _not_ marked with the
-TODO keyword DONE. In buffers with `org-odd-levels-only' set, `LEVEL'
-does not count the number of stars, but `LEVEL=2' will correspond to 3
-stars etc.
-
- Here are more examples:
-`work+TODO="WAITING"'
- Select `:work:'-tagged TODO lines with the specific TODO keyword
- `WAITING'.
-
-`work+TODO="WAITING"|home+TODO="WAITING"'
- Waiting tasks both at work and at home.
-
- When matching properties, a number of different operators can be
-used to test the value of a property. Here is a complex example:
-
- +work-boss+PRIORITY="A"+Coffee="unlimited"+Effort<2 \
- +With={Sarah\|Denny}+SCHEDULED>="<2008-10-11>"
-
-The type of comparison will depend on how the comparison value is
-written:
- - If the comparison value is a plain number, a numerical comparison
- is done, and the allowed operators are `<', `=', `>', `<=', `>=',
- and `<>'.
-
- - If the comparison value is enclosed in double-quotes, a string
- comparison is done, and the same operators are allowed.
-
- - If the comparison value is enclosed in double-quotes _and_ angular
- brackets (like `DEADLINE<="<2008-12-24 18:30>"'), both values are
- assumed to be date/time specifications in the standard Org way,
- and the comparison will be done accordingly. Special values that
- will be recognized are `"<now>"' for now (including time), and
- `"<today>"', and `"<tomorrow>"' for these days at 0:00 hours, i.e.
- without a time specification. Also strings like `"<+5d>"' or
- `"<-2m>"' with units `d', `w', `m', and `y' for day, week, month,
- and year, respectively, can be used.
-
- - If the comparison value is enclosed in curly braces, a regexp
- match is performed, with `=' meaning that the regexp matches the
- property value, and `<>' meaning that it does not match.
-
- So the search string in the example finds entries tagged `:work:' but
-not `:boss:', which also have a priority value `A', a `:Coffee:'
-property with the value `unlimited', an `Effort' property that is
-numerically smaller than 2, a `:With:' property that is matched by the
-regular expression `Sarah\|Denny', and that are scheduled on or after
-October 11, 2008.
-
- Accessing TODO, LEVEL, and CATEGORY during a search is fast.
-Accessing any other properties will slow down the search. However,
-once you have paid the price by accessing one property, testing
-additional properties is cheap again.
-
- You can configure Org-mode to use property inheritance during a
-search, but beware that this can slow down searches considerably. See
-*Note Property inheritance::, for details.
-
- For backward compatibility, and also for typing speed, there is also
-a different way to test TODO states in a search. For this, terminate
-the tags/property part of the search string (which may include several
-terms connected with `|') with a `/' and then specify a Boolean
-expression just for TODO keywords. The syntax is then similar to that
-for tags, but should be applied with care: for example, a positive
-selection on several TODO keywords cannot meaningfully be combined with
-boolean AND. However, _negative selection_ combined with AND can be
-meaningful. To make sure that only lines are checked that actually
-have any TODO keyword (resulting in a speed-up), use `C-c a M', or
-equivalently start the TODO part after the slash with `!'. Using `C-c
-a M' or `/!' will not match TODO keywords in a DONE state. Examples:
-
-`work/WAITING'
- Same as `work+TODO="WAITING"'
-
-`work/!-WAITING-NEXT'
- Select `:work:'-tagged TODO lines that are neither `WAITING' nor
- `NEXT'
-
-`work/!+WAITING|+NEXT'
- Select `:work:'-tagged TODO lines that are either `WAITING' or
- `NEXT'.
-
-
-File: org, Node: Timeline, Next: Search view, Prev: Matching tags and properties, Up: Built-in agenda views
-
-10.3.4 Timeline for a single file
----------------------------------
-
-The timeline summarizes all time-stamped items from a single Org-mode
-file in a _time-sorted view_. The main purpose of this command is to
-give an overview over events in a project.
-
-`C-c a L (`org-timeline')'
- Show a time-sorted view of the Org file, with all time-stamped
- items. When called with a `C-u' prefix, all unfinished TODO
- entries (scheduled or not) are also listed under the current date.
-
-The commands available in the timeline buffer are listed in *Note
-Agenda commands::.
-
-
-File: org, Node: Search view, Next: Stuck projects, Prev: Timeline, Up: Built-in agenda views
-
-10.3.5 Search view
-------------------
-
-This agenda view is a general text search facility for Org-mode entries.
-It is particularly useful to find notes.
-
-`C-c a s (`org-search-view')'
- This is a special search that lets you select entries by matching
- a substring or specific words using a boolean logic.
- For example, the search string `computer equipment' will find entries
-that contain `computer equipment' as a substring. If the two words are
-separated by more space or a line break, the search will still match.
-Search view can also search for specific keywords in the entry, using
-Boolean logic. The search string `+computer +wifi -ethernet
--{8\.11[bg]}' will search for note entries that contain the keywords
-`computer' and `wifi', but not the keyword `ethernet', and which are
-also not matched by the regular expression `8\.11[bg]', meaning to
-exclude both 8.11b and 8.11g. The first `+' is necessary to turn on
-word search, other `+' characters are optional. For more details, see
-the docstring of the command `org-search-view'.
-
- Note that in addition to the agenda files, this command will also
-search the files listed in `org-agenda-text-search-extra-files'.
-
-
-File: org, Node: Stuck projects, Prev: Search view, Up: Built-in agenda views
-
-10.3.6 Stuck projects
----------------------
-
-If you are following a system like David Allen's GTD to organize your
-work, one of the "duties" you have is a regular review to make sure
-that all projects move along. A _stuck_ project is a project that has
-no defined next actions, so it will never show up in the TODO lists
-Org-mode produces. During the review, you need to identify such
-projects and define next actions for them.
-
-`C-c a # (`org-agenda-list-stuck-projects')'
- List projects that are stuck.
-
-`C-c a !'
- Customize the variable `org-stuck-projects' to define what a stuck
- project is and how to find it.
-
- You almost certainly will have to configure this view before it will
-work for you. The built-in default assumes that all your projects are
-level-2 headlines, and that a project is not stuck if it has at least
-one entry marked with a TODO keyword TODO or NEXT or NEXTACTION.
-
- Let's assume that you, in your own way of using Org-mode, identify
-projects with a tag PROJECT, and that you use a TODO keyword MAYBE to
-indicate a project that should not be considered yet. Let's further
-assume that the TODO keyword DONE marks finished projects, and that NEXT
-and TODO indicate next actions. The tag @SHOP indicates shopping and
-is a next action even without the NEXT tag. Finally, if the project
-contains the special word IGNORE anywhere, it should not be listed
-either. In this case you would start by identifying eligible projects
-with a tags/todo match(1) `+PROJECT/-MAYBE-DONE', and then check for
-TODO, NEXT, @SHOP, and IGNORE in the subtree to identify projects that
-are not stuck. The correct customization for this is
-
- (setq org-stuck-projects
- '("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@SHOP")
- "\\<IGNORE\\>"))
-
- Note that if a project is identified as non-stuck, the subtree of
-this entry will still be searched for stuck projects.
-
- ---------- Footnotes ----------
-
- (1) *Note Tag searches::.
-
-
-File: org, Node: Presentation and sorting, Next: Agenda commands, Prev: Built-in agenda views, Up: Agenda Views
-
-10.4 Presentation and sorting
-=============================
-
-Before displaying items in an agenda view, Org-mode visually prepares
-the items and sorts them. Each item occupies a single line. The line
-starts with a _prefix_ that contains the _category_ (*note
-Categories::) of the item and other important information. You can
-customize the prefix using the option `org-agenda-prefix-format'. The
-prefix is followed by a cleaned-up version of the outline headline
-associated with the item.
-
-* Menu:
-
-* Categories:: Not all tasks are equal
-* Time-of-day specifications:: How the agenda knows the time
-* Sorting of agenda items:: The order of things
-
-
-File: org, Node: Categories, Next: Time-of-day specifications, Prev: Presentation and sorting, Up: Presentation and sorting
-
-10.4.1 Categories
------------------
-
-The category is a broad label assigned to each agenda item. By default,
-the category is simply derived from the file name, but you can also
-specify it with a special line in the buffer, like this(1):
-
- #+CATEGORY: Thesis
-
-If you would like to have a special CATEGORY for a single entry or a
-(sub)tree, give the entry a `:CATEGORY:' property with the special
-category you want to apply as the value.
-
-The display in the agenda buffer looks best if the category is not
-longer than 10 characters.
-
-You can set up icons for category by customizing the
-`org-agenda-category-icon-alist' variable.
-
- ---------- Footnotes ----------
-
- (1) For backward compatibility, the following also works: if there
-are several such lines in a file, each specifies the category for the
-text below it. The first category also applies to any text before the
-first CATEGORY line. However, using this method is _strongly_
-deprecated as it is incompatible with the outline structure of the
-document. The correct method for setting multiple categories in a
-buffer is using a property.
-
-
-File: org, Node: Time-of-day specifications, Next: Sorting of agenda items, Prev: Categories, Up: Presentation and sorting
-
-10.4.2 Time-of-day specifications
----------------------------------
-
-Org-mode checks each agenda item for a time-of-day specification. The
-time can be part of the timestamp that triggered inclusion into the
-agenda, for example as in `<2005-05-10 Tue 19:00>'. Time ranges can be
-specified with two timestamps, like
-`<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>'.
-
- In the headline of the entry itself, a time(range) may also appear as
-plain text (like `12:45' or a `8:30-1pm'). If the agenda integrates
-the Emacs diary (*note Weekly/daily agenda::), time specifications in
-diary entries are recognized as well.
-
- For agenda display, Org-mode extracts the time and displays it in a
-standard 24 hour format as part of the prefix. The example times in
-the previous paragraphs would end up in the agenda like this:
-
- 8:30-13:00 Arthur Dent lies in front of the bulldozer
- 12:45...... Ford Prefect arrives and takes Arthur to the pub
- 19:00...... The Vogon reads his poem
- 20:30-22:15 Marvin escorts the Hitchhikers to the bridge
-
- If the agenda is in single-day mode, or for the display of today, the
-timed entries are embedded in a time grid, like
-
- 8:00...... ------------------
- 8:30-13:00 Arthur Dent lies in front of the bulldozer
- 10:00...... ------------------
- 12:00...... ------------------
- 12:45...... Ford Prefect arrives and takes Arthur to the pub
- 14:00...... ------------------
- 16:00...... ------------------
- 18:00...... ------------------
- 19:00...... The Vogon reads his poem
- 20:00...... ------------------
- 20:30-22:15 Marvin escorts the Hitchhikers to the bridge
-
- The time grid can be turned on and off with the variable
-`org-agenda-use-time-grid', and can be configured with
-`org-agenda-time-grid'.
-
-
-File: org, Node: Sorting of agenda items, Prev: Time-of-day specifications, Up: Presentation and sorting
-
-10.4.3 Sorting of agenda items
-------------------------------
-
-Before being inserted into a view, the items are sorted. How this is
-done depends on the type of view.
- * For the daily/weekly agenda, the items for each day are sorted.
- The default order is to first collect all items containing an
- explicit time-of-day specification. These entries will be shown
- at the beginning of the list, as a _schedule_ for the day. After
- that, items remain grouped in categories, in the sequence given by
- `org-agenda-files'. Within each category, items are sorted by
- priority (*note Priorities::), which is composed of the base
- priority (2000 for priority `A', 1000 for `B', and 0 for `C'),
- plus additional increments for overdue scheduled or deadline items.
-
- * For the TODO list, items remain in the order of categories, but
- within each category, sorting takes place according to priority
- (*note Priorities::). The priority used for sorting derives from
- the priority cookie, with additions depending on how close an item
- is to its due or scheduled date.
-
- * For tags matches, items are not sorted at all, but just appear in
- the sequence in which they are found in the agenda files.
-
- Sorting can be customized using the variable
-`org-agenda-sorting-strategy', and may also include criteria based on
-the estimated effort of an entry (*note Effort estimates::).
-
-
-File: org, Node: Agenda commands, Next: Custom agenda views, Prev: Presentation and sorting, Up: Agenda Views
-
-10.5 Commands in the agenda buffer
-==================================
-
-Entries in the agenda buffer are linked back to the Org file or diary
-file where they originate. You are not allowed to edit the agenda
-buffer itself, but commands are provided to show and jump to the
-original entry location, and to edit the Org files "remotely" from the
-agenda buffer. In this way, all information is stored only once,
-removing the risk that your agenda and note files may diverge.
-
- Some commands can be executed with mouse clicks on agenda lines. For
-the other commands, the cursor needs to be in the desired line.
-
-Motion
-......
-
-`n (`org-agenda-next-line')'
- Next line (same as <up> and `C-p').
-
-`p (`org-agenda-previous-line')'
- Previous line (same as <down> and `C-n').
-
-View/Go to Org file
-...................
-
-`<SPC> or mouse-3 (`org-agenda-show-and-scroll-up')'
- Display the original location of the item in another window. With
- prefix arg, make sure that the entire entry is made visible in the
- outline, not only the heading.
-
-`L (`org-agenda-recenter')'
- Display original location and recenter that window.
-
-`<TAB> or mouse-2 (`org-agenda-goto')'
- Go to the original location of the item in another window.
-
-`<RET> (`org-agenda-switch-to')'
- Go to the original location of the item and delete other windows.
-
-`F (`org-agenda-follow-mode')'
- Toggle Follow mode. In Follow mode, as you move the cursor through
- the agenda buffer, the other window always shows the corresponding
- location in the Org file. The initial setting for this mode in new
- agenda buffers can be set with the variable
- `org-agenda-start-with-follow-mode'.
-
-`C-c C-x b (`org-agenda-tree-to-indirect-buffer')'
- Display the entire subtree of the current item in an indirect
- buffer. With a numeric prefix argument N, go up to level N and
- then take that tree. If N is negative, go up that many levels.
- With a `C-u' prefix, do not remove the previously used indirect
- buffer.
-
-`C-c C-o (`org-agenda-open-link')'
- Follow a link in the entry. This will offer a selection of any
- links in the text belonging to the referenced Org node. If there
- is only one link, it will be followed without a selection prompt.
-
-Change display
-..............
-
-`o'
- Delete other windows.
-
-`v d or short d (`org-aganda-day-view')'
-`v w or short w (`org-aganda-day-view')'
-`v m (`org-agenda-month-view')'
-`v y (`org-agenda-month-year')'
- Switch to day/week/month/year view. When switching to day or week
- view, this setting becomes the default for subsequent agenda
- commands. Since month and year views are slow to create, they do
- not become the default. A numeric prefix argument may be used to
- jump directly to a specific day of the year, ISO week, month, or
- year, respectively. For example, `32 d' jumps to February 1st, `9
- w' to ISO week number 9. When setting day, week, or month view, a
- year may be encoded in the prefix argument as well. For example,
- `200712 w' will jump to week 12 in 2007. If such a year
- specification has only one or two digits, it will be mapped to the
- interval 1938-2037.
-
-`f (`org-agenda-later')'
- Go forward in time to display the following
- `org-agenda-current-span' days. For example, if the display
- covers a week, switch to the following week. With prefix arg, go
- forward that many times `org-agenda-current-span' days.
-
-`b (`org-agenda-earlier')'
- Go backward in time to display earlier dates.
-
-`. (`org-agenda-goto-today')'
- Go to today.
-
-`j (`org-agenda-goto-date')'
- Prompt for a date and go there.
-
-`J (`org-agenda-clock-goto')'
- Go to the currently clocked-in task in the agenda buffer.
-
-`D (`org-agenda-toggle-diary')'
- Toggle the inclusion of diary entries. See *Note Weekly/daily
- agenda::.
-
-`v l or short l (`org-agenda-log-mode')'
- Toggle Logbook mode. In Logbook mode, entries that were marked
- DONE while logging was on (variable `org-log-done') are shown in
- the agenda, as are entries that have been clocked on that day.
- You can configure the entry types that should be included in log
- mode using the variable `org-agenda-log-mode-items'. When called
- with a `C-u' prefix, show all possible logbook entries, including
- state changes. When called with two prefix args `C-u C-u', show
- only logging information, nothing else. `v L' is equivalent to
- `C-u v l'.
-
-`v [ or short [ (`org-agenda-manipulate-query-add')'
- Include inactive timestamps into the current view. Only for
- weekly/daily agenda and timeline views.
-
-`v a (`org-agenda-archives-mode')'
-`v A (`org-agenda-archives-mode 'files')'
- Toggle Archives mode. In Archives mode, trees that are marked
- `ARCHIVED' are also scanned when producing the agenda. When you
- use the capital `A', even all archive files are included. To exit
- archives mode, press `v a' again.
-
-`v R or short R (`org-agenda-clockreport-mode')'
- Toggle Clockreport mode. In Clockreport mode, the daily/weekly
- agenda will always show a table with the clocked times for the
- timespan and file scope covered by the current agenda view. The
- initial setting for this mode in new agenda buffers can be set
- with the variable `org-agenda-start-with-clockreport-mode'. By
- using a prefix argument when toggling this mode (i.e. `C-u R'),
- the clock table will not show contributions from entries that are
- hidden by agenda filtering(1).
-
-`v E or short E (`org-agenda-entry-text-mode')'
- Toggle entry text mode. In entry text mode, a number of lines
- from the Org outline node referenced by an agenda line will be
- displayed below the line. The maximum number of lines is given by
- the variable `org-agenda-entry-text-maxlines'. Calling this
- command with a numeric prefix argument will temporarily modify
- that number to the prefix value.
-
-`G (`org-agenda-toggle-time-grid')'
- Toggle the time grid on and off. See also the variables
- `org-agenda-use-time-grid' and `org-agenda-time-grid'.
-
-`r (`org-agenda-rodo')'
- Recreate the agenda buffer, for example to reflect the changes
- after modification of the timestamps of items with `S-<left>' and
- `S-<right>'. When the buffer is the global TODO list, a prefix
- argument is interpreted to create a selective list for a specific
- TODO keyword.
-
-`g (`org-agenda-rodo')'
- Same as `r'.
-
-`C-x C-s or short s (`org-save-all-org-buffers')'
- Save all Org buffers in the current Emacs session, and also the
- locations of IDs.
-
-`C-c C-x C-c (`org-agenda-columns')'
- Invoke column view (*note Column view::) in the agenda buffer.
- The column view format is taken from the entry at point, or (if
- there is no entry at point), from the first entry in the agenda
- view. So whatever the format for that entry would be in the
- original buffer (taken from a property, from a `#+COLUMNS' line,
- or from the default variable `org-columns-default-format'), will
- be used in the agenda.
-
-`C-c C-x > (`org-agenda-remove-restriction-lock')'
- Remove the restriction lock on the agenda, if it is currently
- restricted to a file or subtree (*note Agenda files::).
-
-Secondary filtering and query editing
-.....................................
-
-`/ (`org-agenda-filter-by-tag')'
- Filter the current agenda view with respect to a tag and/or effort
- estimates. The difference between this and a custom agenda
- command is that filtering is very fast, so that you can switch
- quickly between different filters without having to recreate the
- agenda.(2)
-
- You will be prompted for a tag selection letter; <SPC> will mean
- any tag at all. Pressing <TAB> at that prompt will offer use
- completion to select a tag (including any tags that do not have a
- selection character). The command then hides all entries that do
- not contain or inherit this tag. When called with prefix arg,
- remove the entries that _do_ have the tag. A second `/' at the
- prompt will turn off the filter and unhide any hidden entries. If
- the first key you press is either `+' or `-', the previous filter
- will be narrowed by requiring or forbidding the selected
- additional tag. Instead of pressing `+' or `-' after `/', you can
- also immediately use the `\' command.
-
- In order to filter for effort estimates, you should set up allowed
- efforts globally, for example
- (setq org-global-properties
- '(("Effort_ALL". "0 0:10 0:30 1:00 2:00 3:00 4:00")))
- You can then filter for an effort by first typing an operator, one
- of `<', `>', and `=', and then the one-digit index of an effort
- estimate in your array of allowed values, where `0' means the 10th
- value. The filter will then restrict to entries with effort
- smaller-or-equal, equal, or larger-or-equal than the selected
- value. If the digits 0-9 are not used as fast access keys to
- tags, you can also simply press the index digit directly without
- an operator. In this case, `<' will be assumed. For application
- of the operator, entries without a defined effort will be treated
- according to the value of `org-sort-agenda-noeffort-is-high'. To
- filter for tasks without effort definition, press `?' as the
- operator.
-
- Org also supports automatic, context-aware tag filtering. If the
- variable `org-agenda-auto-exclude-function' is set to a
- user-defined function, that function can decide which tags should
- be excluded from the agenda automatically. Once this is set, the
- `/' command then accepts `RET' as a sub-option key and runs the
- auto exclusion logic. For example, let's say you use a `Net' tag
- to identify tasks which need network access, an `Errand' tag for
- errands in town, and a `Call' tag for making phone calls. You
- could auto-exclude these tags based on the availability of the
- Internet, and outside of business hours, with something like this:
-
- (defun org-my-auto-exclude-function (tag)
- (and (cond
- ((string= tag "Net")
- (/= 0 (call-process "/sbin/ping" nil nil nil
- "-c1" "-q" "-t1" "mail.gnu.org")))
- ((or (string= tag "Errand") (string= tag "Call"))
- (let ((hour (nth 2 (decode-time))))
- (or (< hour 8) (> hour 21)))))
- (concat "-" tag)))
-
- (setq org-agenda-auto-exclude-function 'org-my-auto-exclude-function)
-
-`,org-agenda-filter-by-tag-refine (`')'
- Narrow the current agenda filter by an additional condition. When
- called with prefix arg, remove the entries that _do_ have the tag,
- or that do match the effort criterion. You can achieve the same
- effect by pressing `+' or `-' as the first key after the `/'
- command.
-
-`[ ] { }'
-
- in search view
- add new search words (`[' and `]') or new regular expressions
- (`{' and `}') to the query string. The opening bracket/brace
- will add a positive search term prefixed by `+', indicating
- that this search term must occur/match in the entry. The
- closing bracket/brace will add a negative search term which
- must not occur/match in the entry for it to be selected.
-
-Remote editing
-..............
-
-`0-9'
- Digit argument.
-
-`C-_ (`org-agenda-undo')'
- Undo a change due to a remote editing command. The change is
- undone both in the agenda buffer and in the remote buffer.
-
-`t (`org-agenda-todo')'
- Change the TODO state of the item, both in the agenda and in the
- original org file.
-
-`C-S-<right> (`org-agenda-todo-nextset')'
-
-`C-S-<left> (`org-agenda-todo-previousset')'
- Switch to the next/previous set of TODO keywords.
-
-`C-k (`org-agenda-kill')'
- Delete the current agenda item along with the entire subtree
- belonging to it in the original Org file. If the text to be
- deleted remotely is longer than one line, the kill needs to be
- confirmed by the user. See variable `org-agenda-confirm-kill'.
-
-`C-c C-w (`org-agenda-refile')'
- Refile the entry at point.
-
-`C-c C-x C-a or short a (`org-agenda-archive-default-with-confirmation')'
- Archive the subtree corresponding to the entry at point using the
- default archiving command set in `org-archive-default-command'.
- When using the `a' key, confirmation will be required.
-
-`C-c C-x a (`org-agenda-toggle-archive-tag')'
- Toggle the ARCHIVE tag for the current headline.
-
-`C-c C-x A (`org-agenda-archive-to-archive-sibling')'
- Move the subtree corresponding to the current entry to its _archive
- sibling_.
-
-`C-c C-x C-s or short $ (`org-agenda-archive')'
- Archive the subtree corresponding to the current headline. This
- means the entry will be moved to the configured archive location,
- most likely a different file.
-
-`T (`org-agenda-show-tags')'
- Show all tags associated with the current item. This is useful if
- you have turned off `org-agenda-show-inherited-tags', but still
- want to see all tags of a headline occasionally.
-
-`: (`org-agenda-set-tags')'
- Set tags for the current headline. If there is an active region
- in the agenda, change a tag for all headings in the region.
-
-`,'
- Set the priority for the current item (`org-agenda-priority').
- Org-mode prompts for the priority character. If you reply with
- <SPC>, the priority cookie is removed from the entry.
-
-`P (`org-agenda-show-priority')'
- Display weighted priority of current item.
-
-`+ or S-<up> (`org-agenda-priority-up')'
- Increase the priority of the current item. The priority is
- changed in the original buffer, but the agenda is not resorted.
- Use the `r' key for this.
-
-`- or S-<down> (`org-agenda-priority-down')'
- Decrease the priority of the current item.
-
-`z or C-c C-z (`org-agenda-add-note')'
- Add a note to the entry. This note will be recorded, and then
- filed to the same location where state change notes are put.
- Depending on `org-log-into-drawer', this may be inside a drawer.
-
-`C-c C-a (`org-attach')'
- Dispatcher for all command related to attachments.
-
-`C-c C-s (`org-agenda-schedule')'
- Schedule this item. With prefix arg remove the scheduling
- timestamp
-
-`C-c C-d (`org-agenda-deadline')'
- Set a deadline for this item. With prefix arg remove the deadline.
-
-`k (`org-agenda-action')'
- Agenda actions, to set dates for selected items to the cursor date.
- This command also works in the calendar! The command prompts for
- an additional key:
- m Mark the entry at point for action. You can also make entries
- in Org files with `C-c C-x C-k'.
- d Set the deadline of the marked entry to the date at point.
- s Schedule the marked entry at the date at point.
- r Call `org-capture' with the cursor date as default date.
- Press `r' afterward to refresh the agenda and see the effect of the
- command.
-
-`S-<right> (`org-agenda-do-date-later')'
- Change the timestamp associated with the current line by one day
- into the future. With a numeric prefix argument, change it by
- that many days. For example, `3 6 5 S-<right>' will change it by
- a year. With a `C-u' prefix, change the time by one hour. If you
- immediately repeat the command, it will continue to change hours
- even without the prefix arg. With a double `C-u C-u' prefix, do
- the same for changing minutes. The stamp is changed in the
- original Org file, but the change is not directly reflected in the
- agenda buffer. Use `r' or `g' to update the buffer.
-
-`S-<left> (`org-agenda-do-date-earlier')'
- Change the timestamp associated with the current line by one day
- into the past.
-
-`> (`org-agenda-date-prompt')'
- Change the timestamp associated with the current line. The key
- `>' has been chosen, because it is the same as `S-.' on my
- keyboard.
-
-`I (`org-agenda-clock-in')'
- Start the clock on the current item. If a clock is running
- already, it is stopped first.
-
-`O (`org-agenda-clock-out')'
- Stop the previously started clock.
-
-`X (`org-agenda-clock-cancel')'
- Cancel the currently running clock.
-
-`J (`org-agenda-clock-goto')'
- Jump to the running clock in another window.
-
-Bulk remote editing selected entries
-....................................
-
-`m (`org-agenda-bulk-mark')'
- Mark the entry at point for bulk action. With prefix arg, mark
- that many successive entries.
-
-`u (`org-agenda-bulk-unmark')'
- Unmark entry for bulk action.
-
-`U (`org-agenda-bulk-remove-all-marks')'
- Unmark all marked entries for bulk action.
-
-`B (`org-agenda-bulk-action')'
- Bulk action: act on all marked entries in the agenda. This will
- prompt for another key to select the action to be applied. The
- prefix arg to `B' will be passed through to the `s' and `d'
- commands, to bulk-remove these special timestamps.
- r Prompt for a single refile target and move all entries. The entries
- will no longer be in the agenda; refresh (`g') to bring them back.
- $ Archive all selected entries.
- A Archive entries by moving them to their respective archive siblings.
- t Change TODO state. This prompts for a single TODO keyword and
- changes the state of all selected entries, bypassing blocking and
- suppressing logging notes (but not time stamps).
- + Add a tag to all selected entries.
- - Remove a tag from all selected entries.
- s Schedule all items to a new date. To shift existing schedule dates
- by a fixed number of days, use something starting with double plus
- at the prompt, for example `++8d' or `++2w'.
- S Reschedule randomly by N days. N will be prompted for. With prefix
- arg (`C-u B S'), scatter only accross weekdays.
- d Set deadline to a specific date.
-
-Calendar commands
-.................
-
-`c (`org-agenda-goto-calendar')'
- Open the Emacs calendar and move to the date at the agenda cursor.
-
-`c (`org-calendar-goto-agenda')'
- When in the calendar, compute and show the Org-mode agenda for the
- date at the cursor.
-
-`i (`org-agenda-diary-entry')'
- Insert a new entry into the diary, using the date at the cursor
- and (for block entries) the date at the mark. This will add to
- the Emacs diary file(3), in a way similar to the `i' command in
- the calendar. The diary file will pop up in another window, where
- you can add the entry.
-
- If you configure `org-agenda-diary-file' to point to an Org-mode
- file, Org will create entries (in org-mode syntax) in that file
- instead. Most entries will be stored in a date-based outline tree
- that will later make it easy to archive appointments from previous
- months/years. The tree will be built under an entry with a
- `DATE_TREE' property, or else with years as top-level entries.
- Emacs will prompt you for the entry text--if you specify it, the
- entry will be created in `org-agenda-diary-file' without further
- interaction. If you directly press <RET> at the prompt without
- typing text, the target file will be shown in another window for
- you to finish the entry there. See also the `k r' command.
-
-`M (`org-agenda-phases-of-moon')'
- Show the phases of the moon for the three months around current
- date.
-
-`S (`org-agenda-sunrise-sunset')'
- Show sunrise and sunset times. The geographical location must be
- set with calendar variables, see the documentation for the Emacs
- calendar.
-
-`C (`org-agenda-convert-date')'
- Convert the date at cursor into many other cultural and historic
- calendars.
-
-`H (`org-agenda-holidays')'
- Show holidays for three months around the cursor date.
-
-`M-x org-export-icalendar-combine-agenda-files'
- Export a single iCalendar file containing entries from all agenda
- files. This is a globally available command, and also available
- in the agenda menu.
-
-Exporting to a file
-...................
-
-`C-x C-w (`org-write-agenda')'
- Write the agenda view to a file. Depending on the extension of
- the selected file name, the view will be exported as HTML
- (extension `.html' or `.htm'), Postscript (extension `.ps'), PDF
- (extension `.pdf'), and plain text (any other extension). When
- called with a `C-u' prefix argument, immediately open the newly
- created file. Use the variable `org-agenda-exporter-settings' to
- set options for `ps-print' and for `htmlize' to be used during
- export.
-
-Quit and Exit
-.............
-
-`q (`org-agenda-quit')'
- Quit agenda, remove the agenda buffer.
-
-`x (`org-agenda-exit')'
- Exit agenda, remove the agenda buffer and all buffers loaded by
- Emacs for the compilation of the agenda. Buffers created by the
- user to visit Org files will not be removed.
-
- ---------- Footnotes ----------
-
- (1) Only tags filtering will be respected here, effort filtering is
-ignored.
-
- (2) Custom commands can preset a filter by binding the variable
-`org-agenda-filter-preset' as an option. This filter will then be
-applied to the view and persist as a basic filter through refreshes and
-more secondary filtering. The filter is a global property of the
-entire agenda view--in a block agenda, you should only set this in the
-global options section, not in the section of an individual block.
-
- (3) This file is parsed for the agenda when
-`org-agenda-include-diary' is set.
-
-
-File: org, Node: Custom agenda views, Next: Exporting Agenda Views, Prev: Agenda commands, Up: Agenda Views
-
-10.6 Custom agenda views
-========================
-
-Custom agenda commands serve two purposes: to store and quickly access
-frequently used TODO and tags searches, and to create special composite
-agenda buffers. Custom agenda commands will be accessible through the
-dispatcher (*note Agenda dispatcher::), just like the default commands.
-
-* Menu:
-
-* Storing searches:: Type once, use often
-* Block agenda:: All the stuff you need in a single buffer
-* Setting Options:: Changing the rules
-
-
-File: org, Node: Storing searches, Next: Block agenda, Prev: Custom agenda views, Up: Custom agenda views
-
-10.6.1 Storing searches
------------------------
-
-The first application of custom searches is the definition of keyboard
-shortcuts for frequently used searches, either creating an agenda
-buffer, or a sparse tree (the latter covering of course only the current
-buffer). Custom commands are configured in the variable
-`org-agenda-custom-commands'. You can customize this variable, for
-example by pressing `C-c a C'. You can also directly set it with Emacs
-Lisp in `.emacs'. The following example contains all valid search
-types:
-
- (setq org-agenda-custom-commands
- '(("w" todo "WAITING")
- ("W" todo-tree "WAITING")
- ("u" tags "+boss-urgent")
- ("v" tags-todo "+boss-urgent")
- ("U" tags-tree "+boss-urgent")
- ("f" occur-tree "\\<FIXME\\>")
- ("h" . "HOME+Name tags searches") ; description for "h" prefix
- ("hl" tags "+home+Lisa")
- ("hp" tags "+home+Peter")
- ("hk" tags "+home+Kim")))
-
-The initial string in each entry defines the keys you have to press
-after the dispatcher command `C-c a' in order to access the command.
-Usually this will be just a single character, but if you have many
-similar commands, you can also define two-letter combinations where the
-first character is the same in several combinations and serves as a
-prefix key(1). The second parameter is the search type, followed by
-the string or regular expression to be used for the matching. The
-example above will therefore define:
-
-`C-c a w'
- as a global search for TODO entries with `WAITING' as the TODO
- keyword
-
-`C-c a W'
- as the same search, but only in the current buffer and displaying
- the results as a sparse tree
-
-`C-c a u'
- as a global tags search for headlines marked `:boss:' but not
- `:urgent:'
-
-`C-c a v'
- as the same search as `C-c a u', but limiting the search to
- headlines that are also TODO items
-
-`C-c a U'
- as the same search as `C-c a u', but only in the current buffer and
- displaying the result as a sparse tree
-
-`C-c a f'
- to create a sparse tree (again: current buffer only) with all
- entries containing the word `FIXME'
-
-`C-c a h'
- as a prefix command for a HOME tags search where you have to press
- an additional key (`l', `p' or `k') to select a name (Lisa, Peter,
- or Kim) as additional tag to match.
-
- ---------- Footnotes ----------
-
- (1) You can provide a description for a prefix key by inserting a
-cons cell with the prefix and the description.
-
-
-File: org, Node: Block agenda, Next: Setting Options, Prev: Storing searches, Up: Custom agenda views
-
-10.6.2 Block agenda
--------------------
-
-Another possibility is the construction of agenda views that comprise
-the results of _several_ commands, each of which creates a block in the
-agenda buffer. The available commands include `agenda' for the daily
-or weekly agenda (as created with `C-c a a'), `alltodo' for the global
-TODO list (as constructed with `C-c a t'), and the matching commands
-discussed above: `todo', `tags', and `tags-todo'. Here are two
-examples:
-
- (setq org-agenda-custom-commands
- '(("h" "Agenda and Home-related tasks"
- ((agenda "")
- (tags-todo "home")
- (tags "garden")))
- ("o" "Agenda and Office-related tasks"
- ((agenda "")
- (tags-todo "work")
- (tags "office")))))
-
-This will define `C-c a h' to create a multi-block view for stuff you
-need to attend to at home. The resulting agenda buffer will contain
-your agenda for the current week, all TODO items that carry the tag
-`home', and also all lines tagged with `garden'. Finally the command
-`C-c a o' provides a similar view for office tasks.
-
-
-File: org, Node: Setting Options, Prev: Block agenda, Up: Custom agenda views
-
-10.6.3 Setting options for custom commands
-------------------------------------------
-
-Org-mode contains a number of variables regulating agenda construction
-and display. The global variables define the behavior for all agenda
-commands, including the custom commands. However, if you want to change
-some settings just for a single custom view, you can do so. Setting
-options requires inserting a list of variable names and values at the
-right spot in `org-agenda-custom-commands'. For example:
-
- (setq org-agenda-custom-commands
- '(("w" todo "WAITING"
- ((org-agenda-sorting-strategy '(priority-down))
- (org-agenda-prefix-format " Mixed: ")))
- ("U" tags-tree "+boss-urgent"
- ((org-show-following-heading nil)
- (org-show-hierarchy-above nil)))
- ("N" search ""
- ((org-agenda-files '("~org/notes.org"))
- (org-agenda-text-search-extra-files nil)))))
-
-Now the `C-c a w' command will sort the collected entries only by
-priority, and the prefix format is modified to just say ` Mixed: '
-instead of giving the category of the entry. The sparse tags tree of
-`C-c a U' will now turn out ultra-compact, because neither the headline
-hierarchy above the match, nor the headline following the match will be
-shown. The command `C-c a N' will do a text search limited to only a
-single file.
-
- For command sets creating a block agenda,
-`org-agenda-custom-commands' has two separate spots for setting
-options. You can add options that should be valid for just a single
-command in the set, and options that should be valid for all commands in
-the set. The former are just added to the command entry; the latter
-must come after the list of command entries. Going back to the block
-agenda example (*note Block agenda::), let's change the sorting strategy
-for the `C-c a h' commands to `priority-down', but let's sort the
-results for GARDEN tags query in the opposite order, `priority-up'.
-This would look like this:
-
- (setq org-agenda-custom-commands
- '(("h" "Agenda and Home-related tasks"
- ((agenda)
- (tags-todo "home")
- (tags "garden"
- ((org-agenda-sorting-strategy '(priority-up)))))
- ((org-agenda-sorting-strategy '(priority-down))))
- ("o" "Agenda and Office-related tasks"
- ((agenda)
- (tags-todo "work")
- (tags "office")))))
-
- As you see, the values and parentheses setting is a little complex.
-When in doubt, use the customize interface to set this variable--it
-fully supports its structure. Just one caveat: when setting options in
-this interface, the _values_ are just Lisp expressions. So if the
-value is a string, you need to add the double-quotes around the value
-yourself.
-
-
-File: org, Node: Exporting Agenda Views, Next: Agenda column view, Prev: Custom agenda views, Up: Agenda Views
-
-10.7 Exporting Agenda Views
-===========================
-
-If you are away from your computer, it can be very useful to have a
-printed version of some agenda views to carry around. Org-mode can
-export custom agenda views as plain text, HTML(1), Postscript, PDF(2),
-and iCalendar files. If you want to do this only occasionally, use the
-command
-
-`C-x C-w (`org-write-agenda')'
- Write the agenda view to a file. Depending on the extension of
- the selected file name, the view will be exported as HTML
- (extension `.html' or `.htm'), Postscript (extension `.ps'),
- iCalendar (extension `.ics'), or plain text (any other extension).
- Use the variable `org-agenda-exporter-settings' to set options
- for `ps-print' and for `htmlize' to be used during export, for
- example
-
- (setq org-agenda-exporter-settings
- '((ps-number-of-columns 2)
- (ps-landscape-mode t)
- (org-agenda-add-entry-text-maxlines 5)
- (htmlize-output-type 'css)))
-
- If you need to export certain agenda views frequently, you can
-associate any custom agenda command with a list of output file names
-(3). Here is an example that first defines custom commands for the
-agenda and the global TODO list, together with a number of files to
-which to export them. Then we define two block agenda commands and
-specify file names for them as well. File names can be relative to the
-current working directory, or absolute.
-
- (setq org-agenda-custom-commands
- '(("X" agenda "" nil ("agenda.html" "agenda.ps"))
- ("Y" alltodo "" nil ("todo.html" "todo.txt" "todo.ps"))
- ("h" "Agenda and Home-related tasks"
- ((agenda "")
- (tags-todo "home")
- (tags "garden"))
- nil
- ("~/views/home.html"))
- ("o" "Agenda and Office-related tasks"
- ((agenda)
- (tags-todo "work")
- (tags "office"))
- nil
- ("~/views/office.ps" "~/calendars/office.ics"))))
-
- The extension of the file name determines the type of export. If it
-is `.html', Org-mode will use the `htmlize.el' package to convert the
-buffer to HTML and save it to this file name. If the extension is
-`.ps', `ps-print-buffer-with-faces' is used to produce Postscript
-output. If the extension is `.ics', iCalendar export is run export
-over all files that were used to construct the agenda, and limit the
-export to entries listed in the agenda. Any other extension produces a
-plain ASCII file.
-
- The export files are _not_ created when you use one of those
-commands interactively because this might use too much overhead.
-Instead, there is a special command to produce _all_ specified files in
-one step:
-
-`C-c a e (`org-store-agenda-views')'
- Export all agenda views that have export file names associated with
- them.
-
- You can use the options section of the custom agenda commands to also
-set options for the export commands. For example:
-
- (setq org-agenda-custom-commands
- '(("X" agenda ""
- ((ps-number-of-columns 2)
- (ps-landscape-mode t)
- (org-agenda-prefix-format " [ ] ")
- (org-agenda-with-colors nil)
- (org-agenda-remove-tags t))
- ("theagenda.ps"))))
-
-This command sets two options for the Postscript exporter, to make it
-print in two columns in landscape format--the resulting page can be cut
-in two and then used in a paper agenda. The remaining settings modify
-the agenda prefix to omit category and scheduling information, and
-instead include a checkbox to check off items. We also remove the tags
-to make the lines compact, and we don't want to use colors for the
-black-and-white printer. Settings specified in
-`org-agenda-exporter-settings' will also apply, but the settings in
-`org-agenda-custom-commands' take precedence.
-
-From the command line you may also use
- emacs -f org-batch-store-agenda-views -kill
- or, if you need to modify some parameters(4)
- emacs -eval '(org-batch-store-agenda-views \
- org-agenda-span month \
- org-agenda-start-day "2007-11-01" \
- org-agenda-include-diary nil \
- org-agenda-files (quote ("~/org/project.org")))' \
- -kill
- which will create the agenda views restricted to the file
-`~/org/project.org', without diary entries and with a 30-day extent.
-
- You can also extract agenda information in a way that allows further
-processing by other programs. See *Note Extracting agenda
-information::, for more information.
-
- ---------- Footnotes ----------
-
- (1) You need to install Hrvoje Niksic's `htmlize.el'.
-
- (2) To create PDF output, the ghostscript `ps2pdf' utility must be
-installed on the system. Selecting a PDF file with also create the
-postscript file.
-
- (3) If you want to store standard views like the weekly agenda or
-the global TODO list as well, you need to define custom commands for
-them in order to be able to specify file names.
-
- (4) Quoting depends on the system you use, please check the FAQ for
-examples.
-
-
-File: org, Node: Agenda column view, Prev: Exporting Agenda Views, Up: Agenda Views
-
-10.8 Using column view in the agenda
-====================================
-
-Column view (*note Column view::) is normally used to view and edit
-properties embedded in the hierarchical structure of an Org file. It
-can be quite useful to use column view also from the agenda, where
-entries are collected by certain criteria.
-
-`C-c C-x C-c (`org-agenda-columns')'
- Turn on column view in the agenda.
-
- To understand how to use this properly, it is important to realize
-that the entries in the agenda are no longer in their proper outline
-environment. This causes the following issues:
-
- 1. Org needs to make a decision which `COLUMNS' format to use. Since
- the entries in the agenda are collected from different files, and
- different files may have different `COLUMNS' formats, this is a
- non-trivial problem. Org first checks if the variable
- `org-overriding-columns-format' is currently set, and if so, takes
- the format from there. Otherwise it takes the format associated
- with the first item in the agenda, or, if that item does not have
- a specific format (defined in a property, or in its file), it uses
- `org-columns-default-format'.
-
- 2. If any of the columns has a summary type defined (*note Column
- attributes::), turning on column view in the agenda will visit all
- relevant agenda files and make sure that the computations of this
- property are up to date. This is also true for the special
- `CLOCKSUM' property. Org will then sum the values displayed in
- the agenda. In the daily/weekly agenda, the sums will cover a
- single day; in all other views they cover the entire block. It is
- vital to realize that the agenda may show the same entry _twice_
- (for example as scheduled and as a deadline), and it may show two
- entries from the same hierarchy (for example a _parent_ and its
- _child_). In these cases, the summation in the agenda will lead
- to incorrect results because some values will count double.
-
- 3. When the column view in the agenda shows the `CLOCKSUM', that is
- always the entire clocked time for this item. So even in the
- daily/weekly agenda, the clocksum listed in column view may
- originate from times outside the current view. This has the
- advantage that you can compare these values with a column listing
- the planned total effort for a task--one of the major applications
- for column view in the agenda. If you want information about
- clocked time in the displayed period use clock table mode (press
- `R' in the agenda).
-
-
-File: org, Node: Markup, Next: Exporting, Prev: Agenda Views, Up: Top
-
-11 Markup for rich export
-*************************
-
-When exporting Org-mode documents, the exporter tries to reflect the
-structure of the document as accurately as possible in the backend.
-Since export targets like HTML, LaTeX, or DocBook allow much richer
-formatting, Org-mode has rules on how to prepare text for rich export.
-This section summarizes the markup rules used in an Org-mode buffer.
-
-* Menu:
-
-* Structural markup elements:: The basic structure as seen by the exporter
-* Images and tables:: Tables and Images will be included
-* Literal examples:: Source code examples with special formatting
-* Include files:: Include additional files into a document
-* Index entries:: Making an index
-* Macro replacement:: Use macros to create complex output
-* Embedded LaTeX:: LaTeX can be freely used inside Org documents
-
-
-File: org, Node: Structural markup elements, Next: Images and tables, Prev: Markup, Up: Markup
-
-11.1 Structural markup elements
-===============================
-
-* Menu:
-
-* Document title:: Where the title is taken from
-* Headings and sections:: The document structure as seen by the exporter
-* Table of contents:: The if and where of the table of contents
-* Initial text:: Text before the first heading?
-* Lists:: Lists
-* Paragraphs:: Paragraphs
-* Footnote markup:: Footnotes
-* Emphasis and monospace:: Bold, italic, etc.
-* Horizontal rules:: Make a line
-* Comment lines:: What will *not* be exported
-
-
-File: org, Node: Document title, Next: Headings and sections, Prev: Structural markup elements, Up: Structural markup elements
-
-Document title
---------------
-
-The title of the exported document is taken from the special line
-
- #+TITLE: This is the title of the document
-
-If this line does not exist, the title is derived from the first
-non-empty, non-comment line in the buffer. If no such line exists, or
-if you have turned off exporting of the text before the first headline
-(see below), the title will be the file name without extension.
-
- If you are exporting only a subtree by marking is as the region, the
-heading of the subtree will become the title of the document. If the
-subtree has a property `EXPORT_TITLE', that will take precedence.
-
-
-File: org, Node: Headings and sections, Next: Table of contents, Prev: Document title, Up: Structural markup elements
-
-Headings and sections
----------------------
-
-The outline structure of the document as described in *Note Document
-Structure::, forms the basis for defining sections of the exported
-document. However, since the outline structure is also used for (for
-example) lists of tasks, only the first three outline levels will be
-used as headings. Deeper levels will become itemized lists. You can
-change the location of this switch globally by setting the variable
-`org-export-headline-levels', or on a per-file basis with a line
-
- #+OPTIONS: H:4
-
-
-File: org, Node: Table of contents, Next: Initial text, Prev: Headings and sections, Up: Structural markup elements
-
-Table of contents
------------------
-
-The table of contents is normally inserted directly before the first
-headline of the file. If you would like to get it to a different
-location, insert the string `[TABLE-OF-CONTENTS]' on a line by itself
-at the desired location. The depth of the table of contents is by
-default the same as the number of headline levels, but you can choose a
-smaller number, or turn off the table of contents entirely, by
-configuring the variable `org-export-with-toc', or on a per-file basis
-with a line like
-
- #+OPTIONS: toc:2 (only to two levels in TOC)
- #+OPTIONS: toc:nil (no TOC at all)
-
-
-File: org, Node: Initial text, Next: Lists, Prev: Table of contents, Up: Structural markup elements
-
-Text before the first headline
-------------------------------
-
-Org-mode normally exports the text before the first headline, and even
-uses the first line as the document title. The text will be fully
-marked up. If you need to include literal HTML, LaTeX, or DocBook
-code, use the special constructs described below in the sections for
-the individual exporters.
-
- Some people like to use the space before the first headline for
-setup and internal links and therefore would like to control the
-exported text before the first headline in a different way. You can do
-so by setting the variable `org-export-skip-text-before-1st-heading' to
-`t'. On a per-file basis, you can get the same effect with `#+OPTIONS:
-skip:t'.
-
-If you still want to have some text before the first headline, use the
-`#+TEXT' construct:
-
- #+OPTIONS: skip:t
- #+TEXT: This text will go before the *first* headline.
- #+TEXT: [TABLE-OF-CONTENTS]
- #+TEXT: This goes between the table of contents and the first headline
-
-
-File: org, Node: Lists, Next: Paragraphs, Prev: Initial text, Up: Structural markup elements
-
-Lists
------
-
-Plain lists as described in *Note Plain lists::, are translated to the
-backend's syntax for such lists. Most backends support unordered,
-ordered, and description lists.
-
-
-File: org, Node: Paragraphs, Next: Footnote markup, Prev: Lists, Up: Structural markup elements
-
-Paragraphs, line breaks, and quoting
-------------------------------------
-
-Paragraphs are separated by at least one empty line. If you need to
-enforce a line break within a paragraph, use `\\' at the end of a line.
-
- To keep the line breaks in a region, but otherwise use normal
-formatting, you can use this construct, which can also be used to
-format poetry.
-
- #+BEGIN_VERSE
- Great clouds overhead
- Tiny black birds rise and fall
- Snow covers Emacs
-
- -- AlexSchroeder
- #+END_VERSE
-
- When quoting a passage from another document, it is customary to
-format this as a paragraph that is indented on both the left and the
-right margin. You can include quotations in Org-mode documents like
-this:
-
- #+BEGIN_QUOTE
- Everything should be made as simple as possible,
- but not any simpler -- Albert Einstein
- #+END_QUOTE
-
- If you would like to center some text, do it like this:
- #+BEGIN_CENTER
- Everything should be made as simple as possible, \\
- but not any simpler
- #+END_CENTER
-
-
-File: org, Node: Footnote markup, Next: Emphasis and monospace, Prev: Paragraphs, Up: Structural markup elements
-
-Footnote markup
----------------
-
-Footnotes defined in the way described in *Note Footnotes::, will be
-exported by all backends. Org allows multiple references to the same
-note, and different backends support this to varying degrees.
-
-
-File: org, Node: Emphasis and monospace, Next: Horizontal rules, Prev: Footnote markup, Up: Structural markup elements
-
-Emphasis and monospace
-----------------------
-
-You can make words *bold*, /italic/, _underlined_, `=code=' and
-`~verbatim~', and, if you must, `+strike-through+'. Text in the code
-and verbatim string is not processed for Org-mode specific syntax; it
-is exported verbatim.
-
-
-File: org, Node: Horizontal rules, Next: Comment lines, Prev: Emphasis and monospace, Up: Structural markup elements
-
-Horizontal rules
-----------------
-
-A line consisting of only dashes, and at least 5 of them, will be
-exported as a horizontal line (`<hr/>' in HTML).
-
-
-File: org, Node: Comment lines, Prev: Horizontal rules, Up: Structural markup elements
-
-Comment lines
--------------
-
-Lines starting with `#' in column zero are treated as comments and will
-never be exported. If you want an indented line to be treated as a
-comment, start it with `#+ '. Also entire subtrees starting with the
-word `COMMENT' will never be exported. Finally, regions surrounded by
-`#+BEGIN_COMMENT' ... `#+END_COMMENT' will not be exported.
-
-`C-c ;'
- Toggle the COMMENT keyword at the beginning of an entry.
-
-
-File: org, Node: Images and tables, Next: Literal examples, Prev: Structural markup elements, Up: Markup
-
-11.2 Images and Tables
-======================
-
-Both the native Org-mode tables (*note Tables::) and tables formatted
-with the `table.el' package will be exported properly. For Org-mode
-tables, the lines before the first horizontal separator line will
-become table header lines. You can use the following lines somewhere
-before the table to assign a caption and a label for cross references,
-and in the text you can refer to the object with `\ref{tab:basic-data}':
-
- #+CAPTION: This is the caption for the next table (or link)
- #+LABEL: tbl:basic-data
- | ... | ...|
- |-----|----|
-
- Some backends (HTML, LaTeX, and DocBook) allow you to directly
-include images into the exported document. Org does this, if a link to
-an image files does not have a description part, for example
-`[[./img/a.jpg]]'. If you wish to define a caption for the image and
-maybe a label for internal cross references, make sure that the link is
-on a line by itself and precede it with `#+CAPTION' and `#+LABEL' as
-follows:
-
- #+CAPTION: This is the caption for the next figure link (or table)
- #+LABEL: fig:SED-HR4049
- [[./img/a.jpg]]
-
- You may also define additional attributes for the figure. As this is
-backend-specific, see the sections about the individual backends for
-more information.
-
- *Note the discussion of image links: Handling links.
-
-
-File: org, Node: Literal examples, Next: Include files, Prev: Images and tables, Up: Markup
-
-11.3 Literal examples
-=====================
-
-You can include literal examples that should not be subjected to
-markup. Such examples will be typeset in monospace, so this is well
-suited for source code and similar examples.
-
- #+BEGIN_EXAMPLE
- Some example from a text file.
- #+END_EXAMPLE
-
- Note that such blocks may be indented in order to align nicely with
-indented text and in particular with plain list structure (*note Plain
-lists::). For simplicity when using small examples, you can also start
-the example lines with a colon followed by a space. There may also be
-additional whitespace before the colon:
-
- Here is an example
- : Some example from a text file.
-
- If the example is source code from a programming language, or any
-other text that can be marked up by font-lock in Emacs, you can ask for
-the example to look like the fontified Emacs buffer(1). This is done
-with the `src' block, where you also need to specify the name of the
-major mode that should be used to fontify the example:
-
- #+BEGIN_SRC emacs-lisp
- (defun org-xor (a b)
- "Exclusive or."
- (if a (not b) b))
- #+END_SRC
-
- Both in `example' and in `src' snippets, you can add a `-n' switch
-to the end of the `BEGIN' line, to get the lines of the example
-numbered. If you use a `+n' switch, the numbering from the previous
-numbered snippet will be continued in the current one. In literal
-examples, Org will interpret strings like `(ref:name)' as labels, and
-use them as targets for special hyperlinks like `[[(name)]]' (i.e. the
-reference name enclosed in single parenthesis). In HTML, hovering the
-mouse over such a link will remote-highlight the corresponding code
-line, which is kind of cool.
-
- You can also add a `-r' switch which removes the labels from the
-source code(2). With the `-n' switch, links to these references will
-be labeled by the line numbers from the code listing, otherwise links
-will use the labels with no parentheses. Here is an example:
-
- #+BEGIN_SRC emacs-lisp -n -r
- (save-excursion (ref:sc)
- (goto-char (point-min)) (ref:jump)
- #+END_SRC
- In line [[(sc)]] we remember the current position. [[(jump)][Line (jump)]]
- jumps to point-min.
-
- If the syntax for the label format conflicts with the language
-syntax, use a `-l' switch to change the format, for example
-`#+BEGIN_SRC pascal -n -r -l "((%s))"'. See also the variable
-`org-coderef-label-format'.
-
- HTML export also allows examples to be published as text areas,
-*Note Text areas in HTML export::.
-
-`C-c ''
- Edit the source code example at point in its native mode. This
- works by switching to a temporary buffer with the source code.
- You need to exit by pressing `C-c '' again(3). The edited version
- will then replace the old version in the Org buffer. Fixed-width
- regions (where each line starts with a colon followed by a space)
- will be edited using `artist-mode'(4) to allow creating ASCII
- drawings easily. Using this command in an empty line will create
- a new fixed-width region.
-
-`C-c l'
- Calling `org-store-link' while editing a source code example in a
- temporary buffer created with `C-c '' will prompt for a label.
- Make sure that it is unique in the current buffer, and insert it
- with the proper formatting like `(ref:label)' at the end of the
- current line. Then the label is stored as a link `(label)', for
- retrieval with `C-c C-l'.
-
- ---------- Footnotes ----------
-
- (1) This works automatically for the HTML backend (it requires
-version 1.34 of the `htmlize.el' package, which is distributed with
-Org). Fontified code chunks in LaTeX can be achieved using either the
-listings or the minted (http://code.google.com/p/minted) package. To
-use listings, turn on the variable `org-export-latex-listings' and
-ensure that the listings package is included by the LaTeX header (e.g.
-by configuring `org-export-latex-packages-alist'). See the listings
-documentation for configuration options, including obtaining colored
-output. For minted it is necessary to install the program pygments
-(http://pygments.org), in addition to setting
-`org-export-latex-minted', ensuring that the minted package is included
-by the LaTeX header, and ensuring that the `-shell-escape' option is
-passed to `pdflatex' (see `org-latex-to-pdf-process'). See the
-documentation of the variables `org-export-latex-listings' and
-`org-export-latex-minted' for further details.
-
- (2) Adding `-k' to `-n -r' will keep the labels in the source code
-while using line numbers for the links, which might be useful to
-explain those in an org-mode example code.
-
- (3) Upon exit, lines starting with `*' or `#' will get a comma
-prepended, to keep them from being interpreted by Org as outline nodes
-or special comments. These commas will be stripped for editing with
-`C-c '', and also for export.
-
- (4) You may select a different-mode with the variable
-`org-edit-fixed-width-region-mode'.
-
-
-File: org, Node: Include files, Next: Index entries, Prev: Literal examples, Up: Markup
-
-11.4 Include files
-==================
-
-During export, you can include the content of another file. For
-example, to include your `.emacs' file, you could use:
-
- #+INCLUDE: "~/.emacs" src emacs-lisp
- The optional second and third parameter are the markup (e.g. `quote',
-`example', or `src'), and, if the markup is `src', the language for
-formatting the contents. The markup is optional; if it is not given,
-the text will be assumed to be in Org-mode format and will be processed
-normally. The include line will also allow additional keyword
-parameters `:prefix1' and `:prefix' to specify prefixes for the first
-line and for each following line, `:minlevel' in order to get org-mode
-content demoted to a specified level, as well as any options accepted
-by the selected markup. For example, to include a file as an item, use
-
- #+INCLUDE: "~/snippets/xx" :prefix1 " + " :prefix " "
-
-`C-c ''
- Visit the include file at point.
-
-
-File: org, Node: Index entries, Next: Macro replacement, Prev: Include files, Up: Markup
-
-11.5 Index entries
-==================
-
-You can specify entries that will be used for generating an index during
-publishing. This is done by lines starting with `#+INDEX'. An entry
-the contains an exclamation mark will create a sub item. See *Note
-Generating an index:: for more information.
-
- * Curriculum Vitae
- #+INDEX: CV
- #+INDEX: Application!CV
-
-
-File: org, Node: Macro replacement, Next: Embedded LaTeX, Prev: Index entries, Up: Markup
-
-11.6 Macro replacement
-======================
-
-You can define text snippets with
-
- #+MACRO: name replacement text $1, $2 are arguments
-
-which can be referenced anywhere in the document (even in code
-examples) with `{{{name(arg1,arg2)}}}'. In addition to defined macros,
-`{{{title}}}', `{{{author}}}', etc., will reference information set by
-the `#+TITLE:', `#+AUTHOR:', and similar lines. Also,
-`{{{date(FORMAT)}}}' and `{{{modification-time(FORMAT)}}}' refer to
-current date time and to the modification time of the file being
-exported, respectively. FORMAT should be a format string understood by
-`format-time-string'.
-
- Macro expansion takes place during export, and some people use it to
-construct complex HTML code.
-
-
-File: org, Node: Embedded LaTeX, Prev: Macro replacement, Up: Markup
-
-11.7 Embedded LaTeX
-===================
-
-Plain ASCII is normally sufficient for almost all note taking.
-Exceptions include scientific notes, which often require mathematical
-symbols and the occasional formula. LaTeX(1) is widely used to
-typeset scientific documents. Org-mode supports embedding LaTeX code
-into its files, because many academics are used to writing and reading
-LaTeX source code, and because it can be readily processed to produce
-pretty output for a number of export backends.
-
-* Menu:
-
-* Special symbols:: Greek letters and other symbols
-* Subscripts and superscripts:: Simple syntax for raising/lowering text
-* LaTeX fragments:: Complex formulas made easy
-* Previewing LaTeX fragments:: What will this snippet look like?
-* CDLaTeX mode:: Speed up entering of formulas
-
- ---------- Footnotes ----------
-
- (1) LaTeX is a macro system based on Donald E. Knuth's TeX system.
-Many of the features described here as "LaTeX" are really from TeX, but
-for simplicity I am blurring this distinction.
-
-
-File: org, Node: Special symbols, Next: Subscripts and superscripts, Prev: Embedded LaTeX, Up: Embedded LaTeX
-
-11.7.1 Special symbols
-----------------------
-
-You can use LaTeX macros to insert special symbols like `\alpha' to
-indicate the Greek letter, or `\to' to indicate an arrow. Completion
-for these macros is available, just type `\' and maybe a few letters,
-and press `M-<TAB>' to see possible completions. Unlike LaTeX code,
-Org-mode allows these macros to be present without surrounding math
-delimiters, for example:
-
- Angles are written as Greek letters \alpha, \beta and \gamma.
-
- During export, these symbols will be transformed into the native
-format of the exporter backend. Strings like `\alpha' will be exported
-as `&alpha;' in the HTML output, and as `$\alpha$' in the LaTeX output.
-Similarly, `\nbsp' will become `&nbsp;' in HTML and `~' in LaTeX. If
-you need such a symbol inside a word, terminate it like this:
-`\Aacute{}stor'.
-
- A large number of entities is provided, with names taken from both
-HTML and LaTeX; see the variable `org-entities' for the complete list.
-`\-' is treated as a shy hyphen, and `--', `---', and `...' are all
-converted into special commands creating hyphens of different lengths
-or a compact set of dots.
-
- If you would like to see entities displayed as UTF8 characters, use
-the following command(1):
-
-`C-c C-x \'
- Toggle display of entities as UTF-8 characters. This does not
- change the buffer content which remains plain ASCII, but it
- overlays the UTF-8 character for display purposes only.
-
- ---------- Footnotes ----------
-
- (1) You can turn this on by default by setting the variable
-`org-pretty-entities', or on a per-file base with the `#+STARTUP'
-option `entitiespretty'.
-
-
-File: org, Node: Subscripts and superscripts, Next: LaTeX fragments, Prev: Special symbols, Up: Embedded LaTeX
-
-11.7.2 Subscripts and superscripts
-----------------------------------
-
-Just like in LaTeX, `^' and `_' are used to indicate super- and
-subscripts. Again, these can be used without embedding them in
-math-mode delimiters. To increase the readability of ASCII text, it is
-not necessary (but OK) to surround multi-character sub- and superscripts
-with curly braces. For example
-
- The mass of the sun is M_sun = 1.989 x 10^30 kg. The radius of
- the sun is R_{sun} = 6.96 x 10^8 m.
-
- To avoid interpretation as raised or lowered text, you can quote `^'
-and `_' with a backslash: `\^' and `\_'. If you write a text where the
-underscore is often used in a different context, Org's convention to
-always interpret these as subscripts can get in your way. Configure the
-variable `org-export-with-sub-superscripts' to globally change this
-convention, or use, on a per-file basis:
-
- #+OPTIONS: ^:{}
-
-With this setting, `a_b' will not be interpreted as a subscript, but
-`a_{b}' will.
-
-`C-c C-x \'
- In addition to showing entities as UTF-8 characters, this command
- will also format sub- and superscripts in a WYSIWYM way.
-
-
-File: org, Node: LaTeX fragments, Next: Previewing LaTeX fragments, Prev: Subscripts and superscripts, Up: Embedded LaTeX
-
-11.7.3 LaTeX fragments
-----------------------
-
-Going beyond symbols and sub- and superscripts, a full formula language
-is needed. Org-mode can contain LaTeX math fragments, and it supports
-ways to process these for several export backends. When exporting to
-LaTeX, the code is obviously left as it is. When exporting to HTML,
-Org invokes the MathJax library (http://www.mathjax.org) (*note Math
-formatting in HTML export::) to process and display the math(1).
-Finally, it can also process the mathematical expressions into
-images(2) that can be displayed in a browser or in DocBook documents.
-
- LaTeX fragments don't need any special marking at all. The following
-snippets will be identified as LaTeX source code:
- * Environments of any kind(3). The only requirement is that the
- `\begin' statement appears on a new line, preceded by only
- whitespace.
-
- * Text within the usual LaTeX math delimiters. To avoid conflicts
- with currency specifications, single `$' characters are only
- recognized as math delimiters if the enclosed text contains at
- most two line breaks, is directly attached to the `$' characters
- with no whitespace in between, and if the closing `$' is followed
- by whitespace, punctuation or a dash. For the other delimiters,
- there is no such restriction, so when in doubt, use `\(...\)' as
- inline math delimiters.
-
-For example:
-
- \begin{equation} % arbitrary environments,
- x=\sqrt{b} % even tables, figures
- \end{equation} % etc
-
- If $a^2=b$ and \( b=2 \), then the solution must be
- either $$ a=+\sqrt{2} $$ or \[ a=-\sqrt{2} \].
-
-If you need any of the delimiter ASCII sequences for other purposes, you
-can configure the option `org-format-latex-options' to deselect the
-ones you do not wish to have interpreted by the LaTeX converter.
-
- LaTeX processing can be configured with the variable
-`org-export-with-LaTeX-fragments'. The default setting is `t' which
-means `MathJax' for HTML, and no processing for DocBook, ASCII and
-LaTeX backends. You can also set this variable on a per-file basis
-using one of these lines:
-
- #+OPTIONS: LaTeX:t Do the right thing automatically (MathJax)
- #+OPTIONS: LaTeX:dvipng Force using dvipng images
- #+OPTIONS: LaTeX:nil Do not process LaTeX fragments at all
- #+OPTIONS: LaTeX:verbatim Verbatim export, for jsMath or so
-
- ---------- Footnotes ----------
-
- (1) If you plan to use this regularly or on pages with significant
-page views, you should install `MathJax' on your own server in order to
-limit the load of our server.
-
- (2) For this to work you need to be on a system with a working LaTeX
-installation. You also need the `dvipng' program, available at
-`http://sourceforge.net/projects/dvipng/'. The LaTeX header that will
-be used when processing a fragment can be configured with the variable
-`org-format-latex-header'.
-
- (3) When `MathJax' is used, only the environment recognized by
-`MathJax' will be processed. When `dvipng' is used to create images,
-any LaTeX environments will be handled.
-
-
-File: org, Node: Previewing LaTeX fragments, Next: CDLaTeX mode, Prev: LaTeX fragments, Up: Embedded LaTeX
-
-11.7.4 Previewing LaTeX fragments
----------------------------------
-
-If you have `dvipng' installed, LaTeX fragments can be processed to
-produce preview images of the typeset expressions:
-
-`C-c C-x C-l'
- Produce a preview image of the LaTeX fragment at point and overlay
- it over the source code. If there is no fragment at point,
- process all fragments in the current entry (between two
- headlines). When called with a prefix argument, process the
- entire subtree. When called with two prefix arguments, or when
- the cursor is before the first headline, process the entire buffer.
-
-`C-c C-c'
- Remove the overlay preview images.
-
- You can customize the variable `org-format-latex-options' to
-influence some aspects of the preview. In particular, the `:scale' (and
-for HTML export, `:html-scale') property can be used to adjust the size
-of the preview images.
-
-
-File: org, Node: CDLaTeX mode, Prev: Previewing LaTeX fragments, Up: Embedded LaTeX
-
-11.7.5 Using CDLaTeX to enter math
-----------------------------------
-
-CDLaTeX mode is a minor mode that is normally used in combination with a
-major LaTeX mode like AUCTeX in order to speed-up insertion of
-environments and math templates. Inside Org-mode, you can make use of
-some of the features of CDLaTeX mode. You need to install `cdlatex.el'
-and `texmathp.el' (the latter comes also with AUCTeX) from
-`http://www.astro.uva.nl/~dominik/Tools/cdlatex'. Don't use CDLaTeX
-mode itself under Org-mode, but use the light version
-`org-cdlatex-mode' that comes as part of Org-mode. Turn it on for the
-current buffer with `M-x org-cdlatex-mode', or for all Org files with
-
- (add-hook 'org-mode-hook 'turn-on-org-cdlatex)
-
- When this mode is enabled, the following features are present (for
-more details see the documentation of CDLaTeX mode):
- * Environment templates can be inserted with `C-c {'.
-
- * The <TAB> key will do template expansion if the cursor is inside a
- LaTeX fragment(1). For example, <TAB> will expand `fr' to
- `\frac{}{}' and position the cursor correctly inside the first
- brace. Another <TAB> will get you into the second brace. Even
- outside fragments, <TAB> will expand environment abbreviations at
- the beginning of a line. For example, if you write `equ' at the
- beginning of a line and press <TAB>, this abbreviation will be
- expanded to an `equation' environment. To get a list of all
- abbreviations, type `M-x cdlatex-command-help'.
-
- * Pressing `_' and `^' inside a LaTeX fragment will insert these
- characters together with a pair of braces. If you use <TAB> to
- move out of the braces, and if the braces surround only a single
- character or macro, they are removed again (depending on the
- variable `cdlatex-simplify-sub-super-scripts').
-
- * Pressing the backquote ``' followed by a character inserts math
- macros, also outside LaTeX fragments. If you wait more than 1.5
- seconds after the backquote, a help window will pop up.
-
- * Pressing the single-quote `'' followed by another character
- modifies the symbol before point with an accent or a font. If you
- wait more than 1.5 seconds after the single-quote, a help window
- will pop up. Character modification will work only inside LaTeX
- fragments; outside the quote is normal.
-
- ---------- Footnotes ----------
-
- (1) Org-mode has a method to test if the cursor is inside such a
-fragment, see the documentation of the function
-`org-inside-LaTeX-fragment-p'.
-
-
-File: org, Node: Exporting, Next: Publishing, Prev: Markup, Up: Top
-
-12 Exporting
-************
-
-Org-mode documents can be exported into a variety of other formats. For
-printing and sharing of notes, ASCII export produces a readable and
-simple version of an Org file. HTML export allows you to publish a
-notes file on the web, while the XOXO format provides a solid base for
-exchange with a broad range of other applications. LaTeX export lets
-you use Org-mode and its structured editing functions to easily create
-LaTeX files. DocBook export makes it possible to convert Org files to
-many other formats using DocBook tools. For project management you can
-create gantt and resource charts by using TaskJuggler export. To
-incorporate entries with associated times like deadlines or
-appointments into a desktop calendar program like iCal, Org-mode can
-also produce extracts in the iCalendar format. Currently Org-mode only
-supports export, not import of these different formats.
-
- Org supports export of selected regions when `transient-mark-mode' is
-enabled (default in Emacs 23).
-
-* Menu:
-
-* Selective export:: Using tags to select and exclude trees
-* Export options:: Per-file export settings
-* The export dispatcher:: How to access exporter commands
-* ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding
-* HTML export:: Exporting to HTML
-* LaTeX and PDF export:: Exporting to LaTeX, and processing to PDF
-* DocBook export:: Exporting to DocBook
-* TaskJuggler export:: Exporting to TaskJuggler
-* Freemind export:: Exporting to Freemind mind maps
-* XOXO export:: Exporting to XOXO
-* iCalendar export:: Exporting in iCalendar format
-
-
-File: org, Node: Selective export, Next: Export options, Prev: Exporting, Up: Exporting
-
-12.1 Selective export
-=====================
-
-You may use tags to select the parts of a document that should be
-exported, or to exclude parts from export. This behavior is governed
-by two variables: `org-export-select-tags' and
-`org-export-exclude-tags'.
-
- Org first checks if any of the _select_ tags is present in the
-buffer. If yes, all trees that do not carry one of these tags will be
-excluded. If a selected tree is a subtree, the heading hierarchy above
-it will also be selected for export, but not the text below those
-headings.
-
-If none of the select tags is found, the whole buffer will be selected
-for export.
-
-Finally, all subtrees that are marked by any of the _exclude_ tags will
-be removed from the export buffer.
-
-
-File: org, Node: Export options, Next: The export dispatcher, Prev: Selective export, Up: Exporting
-
-12.2 Export options
-===================
-
-The exporter recognizes special lines in the buffer which provide
-additional information. These lines may be put anywhere in the file.
-The whole set of lines can be inserted into the buffer with `C-c C-e
-t'. For individual lines, a good way to make sure the keyword is
-correct is to type `#+' and then use `M-<TAB>' completion (*note
-Completion::). For a summary of other in-buffer settings not
-specifically related to export, see *Note In-buffer settings::. In
-particular, note that you can place commonly-used (export) options in a
-separate file which can be included using `#+SETUPFILE'.
-
-`C-c C-e t (`org-insert-export-options-template')'
- Insert template with export options, see example below.
-
- #+TITLE: the title to be shown (default is the buffer name)
- #+AUTHOR: the author (default taken from `user-full-name')
- #+DATE: a date, fixed, or a format string for `format-time-string'
- #+EMAIL: his/her email address (default from `user-mail-address')
- #+DESCRIPTION: the page description, e.g. for the XHTML meta tag
- #+KEYWORDS: the page keywords, e.g. for the XHTML meta tag
- #+LANGUAGE: language for HTML, e.g. `en' (`org-export-default-language')
- #+TEXT: Some descriptive text to be inserted at the beginning.
- #+TEXT: Several lines may be given.
- #+OPTIONS: H:2 num:t toc:t \n:nil @:t ::t |:t ^:t f:t TeX:t ...
- #+BIND: lisp-var lisp-val, e.g.: org-export-latex-low-levels itemize
- You need to confirm using these, or configure `org-export-allow-BIND'
- #+LINK_UP: the ``up'' link of an exported page
- #+LINK_HOME: the ``home'' link of an exported page
- #+LATEX_HEADER: extra line(s) for the LaTeX header, like \usepackage{xyz}
- #+EXPORT_SELECT_TAGS: Tags that select a tree for export
- #+EXPORT_EXCLUDE_TAGS: Tags that exclude a tree from export
- #+XSLT: the XSLT stylesheet used by DocBook exporter to generate FO file
-
-The OPTIONS line is a compact(1) form to specify export settings. Here
-you can:
- H: set the number of headline levels for export
- num: turn on/off section-numbers
- toc: turn on/off table of contents, or set level limit (integer)
- \n: turn on/off line-break-preservation (DOES NOT WORK)
- @: turn on/off quoted HTML tags
- :: turn on/off fixed-width sections
- |: turn on/off tables
- ^: turn on/off TeX-like syntax for sub- and superscripts. If
- you write "^:{}", `a_{b}' will be interpreted, but
- the simple `a_b' will be left as it is.
- -: turn on/off conversion of special strings.
- f: turn on/off footnotes like this[1].
- todo: turn on/off inclusion of TODO keywords into exported text
- pri: turn on/off priority cookies
- tags: turn on/off inclusion of tags, may also be `not-in-toc'
- <: turn on/off inclusion of any time/date stamps like DEADLINES
- *: turn on/off emphasized text (bold, italic, underlined)
- TeX: turn on/off simple TeX macros in plain text
- LaTeX: configure export of LaTeX fragments. Default `auto'
- skip: turn on/off skipping the text before the first heading
- author: turn on/off inclusion of author name/email into exported file
- email: turn on/off inclusion of author email into exported file
- creator: turn on/off inclusion of creator info into exported file
- timestamp: turn on/off inclusion creation time into exported file
- d: turn on/off inclusion of drawers
- These options take effect in both the HTML and LaTeX export, except
-for `TeX' and `LaTeX', which are respectively `t' and `nil' for the
-LaTeX export. The default values for these and many other options are
-given by a set of variables. For a list of such variables, the
-corresponding OPTIONS keys and also the publishing keys (*note Project
-alist::), see the constant `org-export-plist-vars'.
-
- When exporting only a single subtree by selecting it with `C-c @'
-before calling an export command, the subtree can overrule some of the
-file's export settings with properties `EXPORT_FILE_NAME',
-`EXPORT_TITLE', `EXPORT_TEXT', `EXPORT_AUTHOR', `EXPORT_DATE', and
-`EXPORT_OPTIONS'.
-
- ---------- Footnotes ----------
-
- (1) If you want to configure many options this way, you can use
-several OPTIONS lines.
-
-
-File: org, Node: The export dispatcher, Next: ASCII/Latin-1/UTF-8 export, Prev: Export options, Up: Exporting
-
-12.3 The export dispatcher
-==========================
-
-All export commands can be reached using the export dispatcher, which
-is a prefix key that prompts for an additional key specifying the
-command. Normally the entire file is exported, but if there is an
-active region that contains one outline tree, the first heading is used
-as document title and the subtrees are exported.
-
-`C-c C-e (`org-export')'
- Dispatcher for export and publishing commands. Displays a
- help-window listing the additional key(s) needed to launch an
- export or publishing command. The prefix arg is passed through to
- the exporter. A double prefix `C-u C-u' causes most commands to
- be executed in the background, in a separate Emacs process(1).
-
-`C-c C-e v (`org-export-visible')'
- Like `C-c C-e', but only export the text that is currently visible
- (i.e. not hidden by outline visibility).
-
-`C-u C-u C-c C-e (`org-export')'
- Call the exporter, but reverse the setting of
- `org-export-run-in-background', i.e. request background processing
- if not set, or force processing in the current Emacs process if
- set.
-
- ---------- Footnotes ----------
-
- (1) To make this behavior the default, customize the variable
-`org-export-run-in-background'.
-
-
-File: org, Node: ASCII/Latin-1/UTF-8 export, Next: HTML export, Prev: The export dispatcher, Up: Exporting
-
-12.4 ASCII/Latin-1/UTF-8 export
-===============================
-
-ASCII export produces a simple and very readable version of an Org-mode
-file, containing only plain ASCII. Latin-1 and UTF-8 export augment
-the file with special characters and symbols available in these
-encodings.
-
-`C-c C-e a (`org-export-as-ascii')'
- Export as ASCII file. For an Org file, `myfile.org', the ASCII
- file will be `myfile.txt'. The file will be overwritten without
- warning. If there is an active region(1), only the region will be
- exported. If the selected region is a single tree(2), the tree
- head will become the document title. If the tree head entry has
- or inherits an `EXPORT_FILE_NAME' property, that name will be used
- for the export.
-
-`C-c C-e A (`org-export-as-ascii-to-buffer')'
- Export to a temporary buffer. Do not create a file.
-
-`C-c C-e n (`org-export-as-latin1')'
-`C-c C-e N (`org-export-as-latin1-to-buffer')'
- Like the above commands, but use Latin-1 encoding.
-
-`C-c C-e u (`org-export-as-utf8')'
-`C-c C-e U (`org-export-as-utf8-to-buffer')'
- Like the above commands, but use UTF-8 encoding.
-
-`C-c C-e v a/n/u'
- Export only the visible part of the document.
-
- In the exported version, the first 3 outline levels will become
-headlines, defining a general document structure. Additional levels
-will be exported as itemized lists. If you want that transition to
-occur at a different level, specify it with a prefix argument. For
-example,
-
- C-1 C-c C-e a
-
-creates only top level headlines and does the rest as items. When
-headlines are converted to items, the indentation of the text following
-the headline is changed to fit nicely under the item. This is done with
-the assumption that the first body line indicates the base indentation
-of the body text. Any indentation larger than this is adjusted to
-preserve the layout relative to the first line. Should there be lines
-with less indentation than the first, these are left alone.
-
- Links will be exported in a footnote-like style, with the
-descriptive part in the text and the link in a note before the next
-heading. See the variable `org-export-ascii-links-to-notes' for
-details and other options.
-
- ---------- Footnotes ----------
-
- (1) This requires `transient-mark-mode' be turned on.
-
- (2) To select the current subtree, use `C-c @'.
-
-
-File: org, Node: HTML export, Next: LaTeX and PDF export, Prev: ASCII/Latin-1/UTF-8 export, Up: Exporting
-
-12.5 HTML export
-================
-
-Org-mode contains an HTML (XHTML 1.0 strict) exporter with extensive
-HTML formatting, in ways similar to John Gruber's _markdown_ language,
-but with additional support for tables.
-
-* Menu:
-
-* HTML Export commands:: How to invoke HTML export
-* Quoting HTML tags:: Using direct HTML in Org-mode
-* Links in HTML export:: How links will be interpreted and formatted
-* Tables in HTML export:: How to modify the formatting of tables
-* Images in HTML export:: How to insert figures into HTML output
-* Math formatting in HTML export:: Beautiful math also on the web
-* Text areas in HTML export:: An alternative way to show an example
-* CSS support:: Changing the appearance of the output
-* JavaScript support:: Info and Folding in a web browser
-
-
-File: org, Node: HTML Export commands, Next: Quoting HTML tags, Prev: HTML export, Up: HTML export
-
-12.5.1 HTML export commands
----------------------------
-
-`C-c C-e h (`org-export-as-html')'
- Export as HTML file `myfile.html'. For an Org file `myfile.org',
- the ASCII file will be `myfile.html'. The file will be overwritten
- without warning. If there is an active region(1), only the region
- will be exported. If the selected region is a single tree(2), the
- tree head will become the document title. If the tree head entry
- has, or inherits, an `EXPORT_FILE_NAME' property, that name will
- be used for the export.
-
-`C-c C-e b (`org-export-as-html-and-open')'
- Export as HTML file and immediately open it with a browser.
-
-`C-c C-e H (`org-export-as-html-to-buffer')'
- Export to a temporary buffer. Do not create a file.
-
-`C-c C-e R (`org-export-region-as-html')'
- Export the active region to a temporary buffer. With a prefix
- argument, do not produce the file header and footer, but just the
- plain HTML section for the region. This is good for cut-and-paste
- operations.
-
-`C-c C-e v h/b/H/R'
- Export only the visible part of the document.
-
-`M-x org-export-region-as-html'
- Convert the region to HTML under the assumption that it was
- Org-mode syntax before. This is a global command that can be
- invoked in any buffer.
-
-`M-x org-replace-region-by-HTML'
- Replace the active region (assumed to be in Org-mode syntax) by
- HTML code.
-
- In the exported version, the first 3 outline levels will become
-headlines, defining a general document structure. Additional levels
-will be exported as itemized lists. If you want that transition to
-occur at a different level, specify it with a numeric prefix argument.
-For example,
-
- C-2 C-c C-e b
-
-creates two levels of headings and does the rest as items.
-
- ---------- Footnotes ----------
-
- (1) This requires `transient-mark-mode' be turned on.
-
- (2) To select the current subtree, use `C-c @'.
-
-
-File: org, Node: Quoting HTML tags, Next: Links in HTML export, Prev: HTML Export commands, Up: HTML export
-
-12.5.2 Quoting HTML tags
-------------------------
-
-Plain `<' and `>' are always transformed to `&lt;' and `&gt;' in HTML
-export. If you want to include simple HTML tags which should be
-interpreted as such, mark them with `@' as in `@<b>bold text@</b>'.
-Note that this really works only for simple tags. For more extensive
-HTML that should be copied verbatim to the exported file use either
-
- #+HTML: Literal HTML code for export
-
-or
-
- #+BEGIN_HTML
- All lines between these markers are exported literally
- #+END_HTML
-
-
-File: org, Node: Links in HTML export, Next: Tables in HTML export, Prev: Quoting HTML tags, Up: HTML export
-
-12.5.3 Links in HTML export
----------------------------
-
-Internal links (*note Internal links::) will continue to work in HTML.
-This includes automatic links created by radio targets (*note Radio
-targets::). Links to external files will still work if the target file
-is on the same relative path as the published Org file. Links to other
-`.org' files will be translated into HTML links under the assumption
-that an HTML version also exists of the linked file, at the same
-relative path. `id:' links can then be used to jump to specific
-entries across files. For information related to linking files while
-publishing them to a publishing directory see *Note Publishing links::.
-
- If you want to specify attributes for links, you can do so using a
-special `#+ATTR_HTML' line to define attributes that will be added to
-the `<a>' or `<img>' tags. Here is an example that sets `title' and
-`style' attributes for a link:
-
- #+ATTR_HTML: title="The Org-mode homepage" style="color:red;"
- [[http://orgmode.org]]
-
-
-File: org, Node: Tables in HTML export, Next: Images in HTML export, Prev: Links in HTML export, Up: HTML export
-
-12.5.4 Tables
--------------
-
-Org-mode tables are exported to HTML using the table tag defined in
-`org-export-html-table-tag'. The default setting makes tables without
-cell borders and frame. If you would like to change this for individual
-tables, place something like the following before the table:
-
- #+CAPTION: This is a table with lines around and between cells
- #+ATTR_HTML: border="2" rules="all" frame="all"
-
-
-File: org, Node: Images in HTML export, Next: Math formatting in HTML export, Prev: Tables in HTML export, Up: HTML export
-
-12.5.5 Images in HTML export
-----------------------------
-
-HTML export can inline images given as links in the Org file, and it
-can make an image the clickable part of a link. By default(1), images
-are inlined if a link does not have a description. So
-`[[file:myimg.jpg]]' will be inlined, while `[[file:myimg.jpg][the
-image]]' will just produce a link `the image' that points to the image.
-If the description part itself is a `file:' link or a `http:' URL
-pointing to an image, this image will be inlined and activated so that
-clicking on the image will activate the link. For example, to include
-a thumbnail that will link to a high resolution version of the image,
-you could use:
-
- [[file:highres.jpg][file:thumb.jpg]]
-
- If you need to add attributes to an inlined image, use a
-`#+ATTR_HTML'. In the example below we specify the `alt' and `title'
-attributes to support text viewers and accessibility, and align it to
-the right.
-
- #+CAPTION: A black cat stalking a spider
- #+ATTR_HTML: alt="cat/spider image" title="Action!" align="right"
- [[./img/a.jpg]]
-
-and you could use `http' addresses just as well.
-
- ---------- Footnotes ----------
-
- (1) But see the variable `org-export-html-inline-images'.
-
-
-File: org, Node: Math formatting in HTML export, Next: Text areas in HTML export, Prev: Images in HTML export, Up: HTML export
-
-12.5.6 Math formatting in HTML export
--------------------------------------
-
-LaTeX math snippets (*note LaTeX fragments::) can be displayed in two
-different ways on HTML pages. The default is to use the MathJax system
-(http://www.mathjax.org) which should work out of the box with Org mode
-installation because `http://orgmode.org' serves `MathJax' for Org-mode
-users for small applications and for testing purposes. If you plan to
-use this regularly or on pages with significant page views, you should
-install(1) MathJax on your own server in order to limit the load of our
-server. To configure `MathJax', use the variable
-`org-export-html-mathjax-options' or insert something like the
-following into the buffer:
-
- #+MATHJAX: align:"left" mathml:t path:"/MathJax/MathJax.js"
-
-See the docstring of the variable `org-export-html-mathjax-options' for
-the meaning of the parameters in this line.
-
- If you prefer, you can also request that LaTeX fragments are
-processed into small images that will be inserted into the browser
-page. Before the availability of MathJax, this was the default method
-for Org files. This method requires that the `dvipng' program is
-available on your system. You can still get this processing with
-
- #+OPTIONS: LaTeX:dvipng
-
- ---------- Footnotes ----------
-
- (1) Installation instructions can be found on the MathJax website,
-see `http://www.mathjax.org/resources/docs/?installation.html'.
-
-
-File: org, Node: Text areas in HTML export, Next: CSS support, Prev: Math formatting in HTML export, Up: HTML export
-
-12.5.7 Text areas in HTML export
---------------------------------
-
-An alternative way to publish literal code examples in HTML is to use
-text areas, where the example can even be edited before pasting it into
-an application. It is triggered by a `-t' switch at an `example' or
-`src' block. Using this switch disables any options for syntax and
-label highlighting, and line numbering, which may be present. You may
-also use `-h' and `-w' switches to specify the height and width of the
-text area, which default to the number of lines in the example, and 80,
-respectively. For example
-
- #+BEGIN_EXAMPLE -t -w 40
- (defun org-xor (a b)
- "Exclusive or."
- (if a (not b) b))
- #+END_EXAMPLE
-
-
-File: org, Node: CSS support, Next: JavaScript support, Prev: Text areas in HTML export, Up: HTML export
-
-12.5.8 CSS support
-------------------
-
-You can also give style information for the exported file. The HTML
-exporter assigns the following special CSS classes(1) to appropriate
-parts of the document--your style specifications may change these, in
-addition to any of the standard classes like for headlines, tables, etc.
- p.author author information, including email
- p.date publishing date
- p.creator creator info, about org-mode version
- .title document title
- .todo TODO keywords, all not-done states
- .done the DONE keywords, all stated the count as done
- .WAITING each TODO keyword also uses a class named after itself
- .timestamp timestamp
- .timestamp-kwd keyword associated with a timestamp, like SCHEDULED
- .timestamp-wrapper span around keyword plus timestamp
- .tag tag in a headline
- ._HOME each tag uses itself as a class, "@" replaced by "_"
- .target target for links
- .linenr the line number in a code example
- .code-highlighted for highlighting referenced code lines
- div.outline-N div for outline level N (headline plus text))
- div.outline-text-N extra div for text at outline level N
- .section-number-N section number in headlines, different for each level
- div.figure how to format an inlined image
- pre.src formatted source code
- pre.example normal example
- p.verse verse paragraph
- div.footnotes footnote section headline
- p.footnote footnote definition paragraph, containing a footnote
- .footref a footnote reference number (always a <sup>)
- .footnum footnote number in footnote definition (always <sup>)
-
- Each exported file contains a compact default style that defines
-these classes in a basic way(2). You may overwrite these settings, or
-add to them by using the variables `org-export-html-style' (for
-Org-wide settings) and `org-export-html-style-extra' (for more
-fine-grained settings, like file-local settings). To set the latter
-variable individually for each file, you can use
-
- #+STYLE: <link rel="stylesheet" type="text/css" href="stylesheet.css" />
-
-For longer style definitions, you can use several such lines. You
-could also directly write a `<style>' `</style>' section in this way,
-without referring to an external file.
-
- In order to add styles to a subtree, use the `:HTML_CONTAINER_CLASS:'
-property to assign a class to the tree. In order to specify CSS styles
-for a particular headline, you can use the id specified in a
-`:CUSTOM_ID:' property.
-
- ---------- Footnotes ----------
-
- (1) If the classes on TODO keywords and tags lead to conflicts, use
-the variables `org-export-html-todo-kwd-class-prefix' and
-`org-export-html-tag-class-prefix' to make them unique.
-
- (2) This style is defined in the constant
-`org-export-html-style-default', which you should not modify. To turn
-inclusion of these defaults off, customize
-`org-export-html-style-include-default'
-
-
-File: org, Node: JavaScript support, Prev: CSS support, Up: HTML export
-
-12.5.9 JavaScript supported display of web pages
-------------------------------------------------
-
-Sebastian Rose has written a JavaScript program especially designed to
-enhance the web viewing experience of HTML files created with Org. This
-program allows you to view large files in two different ways. The
-first one is an _Info_-like mode where each section is displayed
-separately and navigation can be done with the `n' and `p' keys (and
-some other keys as well, press `?' for an overview of the available
-keys). The second view type is a _folding_ view much like Org provides
-inside Emacs. The script is available at
-`http://orgmode.org/org-info.js' and you can find the documentation for
-it at `http://orgmode.org/worg/code/org-info-js/'. We host the script
-at our site, but if you use it a lot, you might not want to be
-dependent on `orgmode.org' and prefer to install a local copy on your
-own web server.
-
- To use the script, you need to make sure that the `org-jsinfo.el'
-module gets loaded. It should be loaded by default, but you can try
-`M-x customize-variable <RET> org-modules <RET>' to convince yourself
-that this is indeed the case. All it then takes to make use of the
-program is adding a single line to the Org file:
-
- #+INFOJS_OPT: view:info toc:nil
-
-If this line is found, the HTML header will automatically contain the
-code needed to invoke the script. Using the line above, you can set
-the following viewing options:
-
- path: The path to the script. The default is to grab the script from
- `http://orgmode.org/org-info.js', but you might want to have
- a local copy and use a path like `../scripts/org-info.js'.
- view: Initial view when website is first shown. Possible values are:
- info Info-like interface with one section per page.
- overview Folding interface, initially showing only top-level.
- content Folding interface, starting with all headlines visible.
- showall Folding interface, all headlines and text visible.
- sdepth: Maximum headline level that will still become an independent
- section for info and folding modes. The default is taken from
- `org-export-headline-levels' (= the `H' switch in `#+OPTIONS').
- If this is smaller than in `org-export-headline-levels', each
- info/folding section can still contain child headlines.
- toc: Should the table of contents _initially_ be visible?
- Even when `nil', you can always get to the "toc" with `i'.
- tdepth: The depth of the table of contents. The defaults are taken from
- the variables `org-export-headline-levels' and `org-export-with-toc'.
- ftoc: Does the CSS of the page specify a fixed position for the "toc"?
- If yes, the toc will never be displayed as a section.
- ltoc: Should there be short contents (children) in each section?
- Make this `above' if the section should be above initial text.
- mouse: Headings are highlighted when the mouse is over them. Should be
- `underline' (default) or a background color like `#cccccc'.
- buttons: Should view-toggle buttons be everywhere? When `nil' (the
- default), only one such button will be present.
- You can choose default values for these options by customizing the
-variable `org-infojs-options'. If you always want to apply the script
-to your pages, configure the variable `org-export-html-use-infojs'.
-
-
-File: org, Node: LaTeX and PDF export, Next: DocBook export, Prev: HTML export, Up: Exporting
-
-12.6 LaTeX and PDF export
-=========================
-
-Org-mode contains a LaTeX exporter written by Bastien Guerry. With
-further processing(1), this backend is also used to produce PDF output.
-Since the LaTeX output uses `hyperref' to implement links and cross
-references, the PDF output file will be fully linked.
-
-* Menu:
-
-* LaTeX/PDF export commands:: Which key invokes which commands
-* Header and sectioning:: Setting up the export file structure
-* Quoting LaTeX code:: Incorporating literal LaTeX code
-* Tables in LaTeX export:: Options for exporting tables to LaTeX
-* Images in LaTeX export:: How to insert figures into LaTeX output
-* Beamer class export:: Turning the file into a presentation
-
- ---------- Footnotes ----------
-
- (1) The default LaTeX output is designed for processing with pdftex
-or latex. It includes packages that are not compatible with xetex and
-possibly luatex. See the variables
-`org-export-latex-default-packages-alist' and
-`org-export-latex-packages-alist'.
-
-
-File: org, Node: LaTeX/PDF export commands, Next: Header and sectioning, Prev: LaTeX and PDF export, Up: LaTeX and PDF export
-
-12.6.1 LaTeX export commands
-----------------------------
-
-`C-c C-e l (`org-export-as-latex')'
- Export as LaTeX file `myfile.tex'. For an Org file `myfile.org',
- the ASCII file will be `myfile.tex'. The file will be overwritten
- without warning. If there is an active region(1), only the region
- will be exported. If the selected region is a single tree(2), the
- tree head will become the document title. If the tree head entry
- has or inherits an `EXPORT_FILE_NAME' property, that name will be
- used for the export.
-
-`C-c C-e L (`org-export-as-latex-to-buffer')'
- Export to a temporary buffer. Do not create a file.
-
-`C-c C-e v l/L'
- Export only the visible part of the document.
-
-`M-x org-export-region-as-latex'
- Convert the region to LaTeX under the assumption that it was
- Org-mode syntax before. This is a global command that can be
- invoked in any buffer.
-
-`M-x org-replace-region-by-latex'
- Replace the active region (assumed to be in Org-mode syntax) by
- LaTeX code.
-
-`C-c C-e p (`org-export-as-pdf')'
- Export as LaTeX and then process to PDF.
-
-`C-c C-e d (`org-export-as-pdf-and-open')'
- Export as LaTeX and then process to PDF, then open the resulting
- PDF file.
-
- In the exported version, the first 3 outline levels will become
-headlines, defining a general document structure. Additional levels
-will be exported as description lists. The exporter can ignore them or
-convert them to a custom string depending on `org-latex-low-levels'.
-
- If you want that transition to occur at a different level, specify it
-with a numeric prefix argument. For example,
-
- C-2 C-c C-e l
-
-creates two levels of headings and does the rest as items.
-
- ---------- Footnotes ----------
-
- (1) This requires `transient-mark-mode' be turned on.
-
- (2) To select the current subtree, use `C-c @'.
-
-
-File: org, Node: Header and sectioning, Next: Quoting LaTeX code, Prev: LaTeX/PDF export commands, Up: LaTeX and PDF export
-
-12.6.2 Header and sectioning structure
---------------------------------------
-
-By default, the LaTeX output uses the class `article'.
-
- You can change this globally by setting a different value for
-`org-export-latex-default-class' or locally by adding an option like
-`#+LaTeX_CLASS: myclass' in your file, or with a `:LaTeX_CLASS:'
-property that applies when exporting a region containing only this
-(sub)tree. The class must be listed in `org-export-latex-classes'.
-This variable defines a header template for each class(1), and allows
-you to define the sectioning structure for each class. You can also
-define your own classes there. `#+LaTeX_CLASS_OPTIONS' or a
-`LaTeX_CLASS_OPTIONS' property can specify the options for the
-`\documentclass' macro. You can also use `#+LATEX_HEADER:
-\usepackage{xyz}' to add lines to the header. See the docstring of
-`org-export-latex-classes' for more information.
-
- ---------- Footnotes ----------
-
- (1) Into which the values of
-`org-export-latex-default-packages-alist' and
-`org-export-latex-packages-alist' are spliced.
-
-
-File: org, Node: Quoting LaTeX code, Next: Tables in LaTeX export, Prev: Header and sectioning, Up: LaTeX and PDF export
-
-12.6.3 Quoting LaTeX code
--------------------------
-
-Embedded LaTeX as described in *Note Embedded LaTeX::, will be correctly
-inserted into the LaTeX file. This includes simple macros like
-`\ref{LABEL}' to create a cross reference to a figure. Furthermore,
-you can add special code that should only be present in LaTeX export
-with the following constructs:
-
- #+LaTeX: Literal LaTeX code for export
-
-or
-
- #+BEGIN_LaTeX
- All lines between these markers are exported literally
- #+END_LaTeX
-
-
-File: org, Node: Tables in LaTeX export, Next: Images in LaTeX export, Prev: Quoting LaTeX code, Up: LaTeX and PDF export
-
-12.6.4 Tables in LaTeX export
------------------------------
-
-For LaTeX export of a table, you can specify a label and a caption
-(*note Images and tables::). You can also use the `ATTR_LaTeX' line to
-request a `longtable' environment for the table, so that it may span
-several pages, or provide the `multicolumn' keyword that will make the
-table span the page in a multicolumn environment (`table*' environment).
-Finally, you can set the alignment string:
-
- #+CAPTION: A long table
- #+LABEL: tbl:long
- #+ATTR_LaTeX: longtable align=l|lp{3cm}r|l
- | ..... | ..... |
- | ..... | ..... |
-
-
-File: org, Node: Images in LaTeX export, Next: Beamer class export, Prev: Tables in LaTeX export, Up: LaTeX and PDF export
-
-12.6.5 Images in LaTeX export
------------------------------
-
-Images that are linked to without a description part in the link, like
-`[[file:img.jpg]]' or `[[./img.jpg]]' will be inserted into the PDF
-output file resulting from LaTeX processing. Org will use an
-`\includegraphics' macro to insert the image. If you have specified a
-caption and/or a label as described in *Note Images and tables::, the
-figure will be wrapped into a `figure' environment and thus become a
-floating element. You can use an `#+ATTR_LaTeX:' line to specify the
-various options that can be used in the optional argument of the
-`\includegraphics' macro. To modify the placement option of the
-`figure' environment, add something like `placement=[h!]' to the
-Attributes.
-
- If you would like to let text flow around the image, add the word
-`wrap' to the `#+ATTR_LaTeX:' line, which will make the figure occupy
-the left half of the page. To fine-tune, the `placement' field will be
-the set of additional arguments needed by the `wrapfigure' environment.
-Note that if you change the size of the image, you need to use
-compatible settings for `\includegraphics' and `wrapfigure'.
-
- #+CAPTION: The black-body emission of the disk around HR 4049
- #+LABEL: fig:SED-HR4049
- #+ATTR_LaTeX: width=5cm,angle=90
- [[./img/sed-hr4049.pdf]]
-
- #+ATTR_LaTeX: width=0.38\textwidth wrap placement={r}{0.4\textwidth}
- [[./img/hst.png]]
-
- If you need references to a label created in this way, write
-`\ref{fig:SED-HR4049}' just like in LaTeX.
-
-
-File: org, Node: Beamer class export, Prev: Images in LaTeX export, Up: LaTeX and PDF export
-
-12.6.6 Beamer class export
---------------------------
-
-The LaTeX class `beamer' allows production of high quality presentations
-using LaTeX and pdf processing. Org-mode has special support for
-turning an Org-mode file or tree into a `beamer' presentation.
-
- When the LaTeX class for the current buffer (as set with
-`#+LaTeX_CLASS: beamer') or subtree (set with a `LaTeX_CLASS' property)
-is `beamer', a special export mode will turn the file or tree into a
-beamer presentation. Any tree with not-too-deep level nesting should
-in principle be exportable as a beamer presentation. By default, the
-top-level entries (or the first level below the selected subtree
-heading) will be turned into frames, and the outline structure below
-this level will become itemize lists. You can also configure the
-variable `org-beamer-frame-level' to a different level--then the
-hierarchy above frames will produce the sectioning structure of the
-presentation.
-
- A template for useful in-buffer settings or properties can be
-inserted into the buffer with `M-x org-insert-beamer-options-template'.
-Among other things, this will install a column view format which is
-very handy for editing special properties used by beamer.
-
- You can influence the structure of the presentation using the
-following properties:
-
-`BEAMER_env'
- The environment that should be used to format this entry. Valid
- environments are defined in the constant
- `org-beamer-environments-default', and you can define more in
- `org-beamer-environments-extra'. If this property is set, the
- entry will also get a `:B_environment:' tag to make this visible.
- This tag has no semantic meaning, it is only a visual aid.
-
-`BEAMER_envargs'
- The beamer-special arguments that should be used for the
- environment, like `[t]' or `[<+->]' of `<2-3>'. If the
- `BEAMER_col' property is also set, something like `C[t]' can be
- added here as well to set an options argument for the implied
- `columns' environment. `c[t]' or `c<2->' will set an options for
- the implied `column' environment.
-
-`BEAMER_col'
- The width of a column that should start with this entry. If this
- property is set, the entry will also get a `:BMCOL:' property to
- make this visible. Also this tag is only a visual aid. When this
- is a plain number, it will be interpreted as a fraction of
- `\textwidth'. Otherwise it will be assumed that you have
- specified the units, like `3cm'. The first such property in a
- frame will start a `columns' environment to surround the columns.
- This environment is closed when an entry has a `BEAMER_col'
- property with value 0 or 1, or automatically at the end of the
- frame.
-
-`BEAMER_extra'
- Additional commands that should be inserted after the environment
- has been opened. For example, when creating a frame, this can be
- used to specify transitions.
-
- Frames will automatically receive a `fragile' option if they contain
-source code that uses the verbatim environment. Special `beamer'
-specific code can be inserted using `#+BEAMER:' and
-`#+BEGIN_beamer...#+end_beamer' constructs, similar to other export
-backends, but with the difference that `#+LaTeX:' stuff will be included
-in the presentation as well.
-
- Outline nodes with `BEAMER_env' property value `note' or `noteNH'
-will be formatted as beamer notes, i,e, they will be wrapped into
-`\note{...}'. The former will include the heading as part of the note
-text, the latter will ignore the heading of that node. To simplify note
-generation, it is actually enough to mark the note with a _tag_ (either
-`:B_note:' or `:B_noteNH:') instead of creating the `BEAMER_env'
-property.
-
- You can turn on a special minor mode `org-beamer-mode' for editing
-support with
-
- #+STARTUP: beamer
-
-`C-c C-b (`org-beamer-select-environment')'
- In `org-beamer-mode', this key offers fast selection of a beamer
- environment or the `BEAMER_col' property.
-
- Column view provides a great way to set the environment of a node
-and other important parameters. Make sure you are using a COLUMN
-format that is geared toward this special purpose. The command `M-x
-org-insert-beamer-options-template' defines such a format.
-
- Here is a simple example Org document that is intended for beamer
-export.
-
- #+LaTeX_CLASS: beamer
- #+TITLE: Example Presentation
- #+AUTHOR: Carsten Dominik
- #+LaTeX_CLASS_OPTIONS: [presentation]
- #+BEAMER_FRAME_LEVEL: 2
- #+BEAMER_HEADER_EXTRA: \usetheme{Madrid}\usecolortheme{default}
- #+COLUMNS: %35ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Args) %4BEAMER_col(Col) %8BEAMER_extra(Ex)
-
- * This is the first structural section
-
- ** Frame 1 \\ with a subtitle
- *** Thanks to Eric Fraga :BMCOL:B_block:
- :PROPERTIES:
- :BEAMER_env: block
- :BEAMER_envargs: C[t]
- :BEAMER_col: 0.5
- :END:
- for the first viable beamer setup in Org
- *** Thanks to everyone else :BMCOL:B_block:
- :PROPERTIES:
- :BEAMER_col: 0.5
- :BEAMER_env: block
- :BEAMER_envargs: <2->
- :END:
- for contributing to the discussion
- **** This will be formatted as a beamer note :B_note:
- ** Frame 2 \\ where we will not use columns
- *** Request :B_block:
- Please test this stuff!
- :PROPERTIES:
- :BEAMER_env: block
- :END:
-
- For more information, see the documentation on Worg.
-
-
-File: org, Node: DocBook export, Next: TaskJuggler export, Prev: LaTeX and PDF export, Up: Exporting
-
-12.7 DocBook export
-===================
-
-Org contains a DocBook exporter written by Baoqiu Cui. Once an Org
-file is exported to DocBook format, it can be further processed to
-produce other formats, including PDF, HTML, man pages, etc., using many
-available DocBook tools and stylesheets.
-
- Currently DocBook exporter only supports DocBook V5.0.
-
-* Menu:
-
-* DocBook export commands:: How to invoke DocBook export
-* Quoting DocBook code:: Incorporating DocBook code in Org files
-* Recursive sections:: Recursive sections in DocBook
-* Tables in DocBook export:: Tables are exported as HTML tables
-* Images in DocBook export:: How to insert figures into DocBook output
-* Special characters:: How to handle special characters
-
-
-File: org, Node: DocBook export commands, Next: Quoting DocBook code, Prev: DocBook export, Up: DocBook export
-
-12.7.1 DocBook export commands
-------------------------------
-
-`C-c C-e D (`org-export-as-docbook')'
- Export as DocBook file. For an Org file, `myfile.org', the
- DocBook XML file will be `myfile.xml'. The file will be
- overwritten without warning. If there is an active region(1),
- only the region will be exported. If the selected region is a
- single tree(2), the tree head will become the document title. If
- the tree head entry has, or inherits, an `EXPORT_FILE_NAME'
- property, that name will be used for the export.
-
-`C-c C-e V (`org-export-as-docbook-pdf-and-open')'
- Export as DocBook file, process to PDF, then open the resulting
- PDF file.
-
- Note that, in order to produce PDF output based on exported
- DocBook file, you need to have XSLT processor and XSL-FO processor
- software installed on your system. Check variables
- `org-export-docbook-xslt-proc-command' and
- `org-export-docbook-xsl-fo-proc-command'.
-
- The stylesheet argument `%s' in variable
- `org-export-docbook-xslt-proc-command' is replaced by the value of
- variable `org-export-docbook-xslt-stylesheet', which needs to be
- set by the user. You can also overrule this global setting on a
- per-file basis by adding an in-buffer setting `#+XSLT:' to the Org
- file.
-
-`C-c C-e v D'
- Export only the visible part of the document.
-
- ---------- Footnotes ----------
-
- (1) This requires `transient-mark-mode' to be turned on
-
- (2) To select the current subtree, use `C-c @'.
-
-
-File: org, Node: Quoting DocBook code, Next: Recursive sections, Prev: DocBook export commands, Up: DocBook export
-
-12.7.2 Quoting DocBook code
----------------------------
-
-You can quote DocBook code in Org files and copy it verbatim into
-exported DocBook file with the following constructs:
-
- #+DOCBOOK: Literal DocBook code for export
-
-or
-
- #+BEGIN_DOCBOOK
- All lines between these markers are exported by DocBook exporter
- literally.
- #+END_DOCBOOK
-
- For example, you can use the following lines to include a DocBook
-warning admonition. As to what this warning says, you should pay
-attention to the document context when quoting DocBook code in Org
-files. You may make exported DocBook XML files invalid by not quoting
-DocBook code correctly.
-
- #+BEGIN_DOCBOOK
- <warning>
- <para>You should know what you are doing when quoting DocBook XML code
- in your Org file. Invalid DocBook XML may be generated by
- DocBook exporter if you are not careful!</para>
- </warning>
- #+END_DOCBOOK
-
-
-File: org, Node: Recursive sections, Next: Tables in DocBook export, Prev: Quoting DocBook code, Up: DocBook export
-
-12.7.3 Recursive sections
--------------------------
-
-DocBook exporter exports Org files as articles using the `article'
-element in DocBook. Recursive sections, i.e. `section' elements, are
-used in exported articles. Top level headlines in Org files are
-exported as top level sections, and lower level headlines are exported
-as nested sections. The entire structure of Org files will be exported
-completely, no matter how many nested levels of headlines there are.
-
- Using recursive sections makes it easy to port and reuse exported
-DocBook code in other DocBook document types like `book' or `set'.
-
-
-File: org, Node: Tables in DocBook export, Next: Images in DocBook export, Prev: Recursive sections, Up: DocBook export
-
-12.7.4 Tables in DocBook export
--------------------------------
-
-Tables in Org files are exported as HTML tables, which have been
-supported since DocBook V4.3.
-
- If a table does not have a caption, an informal table is generated
-using the `informaltable' element; otherwise, a formal table will be
-generated using the `table' element.
-
-
-File: org, Node: Images in DocBook export, Next: Special characters, Prev: Tables in DocBook export, Up: DocBook export
-
-12.7.5 Images in DocBook export
--------------------------------
-
-Images that are linked to without a description part in the link, like
-`[[file:img.jpg]]' or `[[./img.jpg]]', will be exported to DocBook
-using `mediaobject' elements. Each `mediaobject' element contains an
-`imageobject' that wraps an `imagedata' element. If you have specified
-a caption for an image as described in *Note Images and tables::, a
-`caption' element will be added in `mediaobject'. If a label is also
-specified, it will be exported as an `xml:id' attribute of the
-`mediaobject' element.
-
- Image attributes supported by the `imagedata' element, like `align'
-or `width', can be specified in two ways: you can either customize
-variable `org-export-docbook-default-image-attributes' or use the
-`#+ATTR_DOCBOOK:' line. Attributes specified in variable
-`org-export-docbook-default-image-attributes' are applied to all inline
-images in the Org file to be exported (unless they are overridden by
-image attributes specified in `#+ATTR_DOCBOOK:' lines).
-
- The `#+ATTR_DOCBOOK:' line can be used to specify additional image
-attributes or override default image attributes for individual images.
-If the same attribute appears in both the `#+ATTR_DOCBOOK:' line and
-variable `org-export-docbook-default-image-attributes', the former
-takes precedence. Here is an example about how image attributes can be
-set:
-
- #+CAPTION: The logo of Org-mode
- #+LABEL: unicorn-svg
- #+ATTR_DOCBOOK: scalefit="1" width="100%" depth="100%"
- [[./img/org-mode-unicorn.svg]]
-
- By default, DocBook exporter recognizes the following image file
-types: `jpeg', `jpg', `png', `gif', and `svg'. You can customize
-variable `org-export-docbook-inline-image-extensions' to add more types
-to this list as long as DocBook supports them.
-
-
-File: org, Node: Special characters, Prev: Images in DocBook export, Up: DocBook export
-
-12.7.6 Special characters in DocBook export
--------------------------------------------
-
-Special characters that are written in TeX-like syntax, such as
-`\alpha', `\Gamma', and `\Zeta', are supported by DocBook exporter.
-These characters are rewritten to XML entities, like `&alpha;',
-`&Gamma;', and `&Zeta;', based on the list saved in variable
-`org-entities'. As long as the generated DocBook file includes the
-corresponding entities, these special characters are recognized.
-
- You can customize variable `org-export-docbook-doctype' to include
-the entities you need. For example, you can set variable
-`org-export-docbook-doctype' to the following value to recognize all
-special characters included in XHTML entities:
-
- "<!DOCTYPE article [
- <!ENTITY % xhtml1-symbol PUBLIC
- \"-//W3C//ENTITIES Symbol for HTML//EN//XML\"
- \"http://www.w3.org/2003/entities/2007/xhtml1-symbol.ent\"
- >
- %xhtml1-symbol;
- ]>
- "
-
-
-File: org, Node: TaskJuggler export, Next: Freemind export, Prev: DocBook export, Up: Exporting
-
-12.8 TaskJuggler export
-=======================
-
-TaskJuggler (http://www.taskjuggler.org/) is a project management tool.
-It provides an optimizing scheduler that computes your project time
-lines and resource assignments based on the project outline and the
-constraints that you have provided.
-
- The TaskJuggler exporter is a bit different from other exporters,
-such as the HTML and LaTeX exporters for example, in that it does not
-export all the nodes of a document or strictly follow the order of the
-nodes in the document.
-
- Instead the TaskJuggler exporter looks for a tree that defines the
-tasks and a optionally tree that defines the resources for this
-project. It then creates a TaskJuggler file based on these trees and
-the attributes defined in all the nodes.
-
-12.8.1 TaskJuggler export commands
-----------------------------------
-
-`C-c C-e j (`org-export-as-taskjuggler')'
- Export as TaskJuggler file.
-
-`C-c C-e J (`org-export-as-taskjuggler-and-open')'
- Export as TaskJuggler file and then open the file with
- TaskJugglerUI.
-
-12.8.2 Tasks
-------------
-
-Create your tasks as you usually do with Org-mode. Assign efforts to
-each task using properties (it's easiest to do this in the column
-view). You should end up with something similar to the example by Peter
-Jones in
-`http://www.contextualdevelopment.com/static/artifacts/articles/2008/project-planning/project-planning.org'.
-Now mark the top node of your tasks with a tag named
-`:taskjuggler_project:' (or whatever you customized
-`org-export-taskjuggler-project-tag' to). You are now ready to export
-the project plan with `C-c C-e J' which will export the project plan and
-open a gantt chart in TaskJugglerUI.
-
-12.8.3 Resources
-----------------
-
-Next you can define resources and assign those to work on specific
-tasks. You can group your resources hierarchically. Tag the top node of
-the resources with `:taskjuggler_resource:' (or whatever you customized
-`org-export-taskjuggler-resource-tag' to). You can optionally assign an
-identifier (named `resource_id') to the resources (using the standard
-Org properties commands, *note Property syntax::) or you can let the
-exporter generate identifiers automatically (the exporter picks the
-first word of the headline as the identifier as long as it is
-unique--see the documentation of `org-taskjuggler-get-unique-id').
-Using that identifier you can then allocate resources to tasks. This is
-again done with the `allocate' property on the tasks. Do this in column
-view or when on the task type `C-c C-x p allocate <RET> <resource_id>
-<RET>'.
-
- Once the allocations are done you can again export to TaskJuggler
-and check in the Resource Allocation Graph which person is working on
-what task at what time.
-
-12.8.4 Export of properties
----------------------------
-
-The exporter also takes TODO state information into consideration, i.e.
-if a task is marked as done it will have the corresponding attribute in
-TaskJuggler (`complete 100'). Also it will export any property on a task
-resource or resource node which is known to TaskJuggler, such as
-`limits', `vacation', `shift', `booking', `efficiency', `journalentry',
-`rate' for resources or `account', `start', `note', `duration', `end',
-`journalentry', `milestone', `reference', `responsible', `scheduling',
-etc for tasks.
-
-12.8.5 Dependencies
--------------------
-
-The exporter will handle dependencies that are defined in the tasks
-either with the `ORDERED' attribute (*note TODO dependencies::), with
-the `BLOCKER' attribute (see `org-depend.el') or alternatively with a
-`depends' attribute. Both the `BLOCKER' and the `depends' attribute can
-be either `previous-sibling' or a reference to an identifier (named
-`task_id') which is defined for another task in the project. `BLOCKER'
-and the `depends' attribute can define multiple dependencies separated
-by either space or comma. You can also specify optional attributes on
-the dependency by simply appending it. The following examples should
-illustrate this:
-
- * Preparation
- :PROPERTIES:
- :task_id: preparation
- :ORDERED: t
- :END:
- * Training material
- :PROPERTIES:
- :task_id: training_material
- :ORDERED: t
- :END:
- ** Markup Guidelines
- :PROPERTIES:
- :Effort: 2.0
- :END:
- ** Workflow Guidelines
- :PROPERTIES:
- :Effort: 2.0
- :END:
- * Presentation
- :PROPERTIES:
- :Effort: 2.0
- :BLOCKER: training_material { gapduration 1d } preparation
- :END:
-
-12.8.6 Reports
---------------
-
-TaskJuggler can produce many kinds of reports (e.g. gantt chart,
-resource allocation, etc). The user defines what kind of reports should
-be generated for a project in the TaskJuggler file. The exporter will
-automatically insert some default reports in the file. These defaults
-are defined in `org-export-taskjuggler-default-reports'. They can be
-modified using customize along with a number of other options. For a
-more complete list, see `M-x customize-group <RET>
-org-export-taskjuggler <RET>'.
-
- For more information and examples see the Org-taskjuggler tutorial at
-`http://orgmode.org/worg/org-tutorials/org-taskjuggler.php'.
-
-
-File: org, Node: Freemind export, Next: XOXO export, Prev: TaskJuggler export, Up: Exporting
-
-12.9 Freemind export
-====================
-
-The Freemind exporter was written by Lennart Borgman.
-
-`C-c C-e m (`org-export-as-freemind')'
- Export as Freemind mind map `myfile.mm'.
-
-
-File: org, Node: XOXO export, Next: iCalendar export, Prev: Freemind export, Up: Exporting
-
-12.10 XOXO export
-=================
-
-Org-mode contains an exporter that produces XOXO-style output.
-Currently, this exporter only handles the general outline structure and
-does not interpret any additional Org-mode features.
-
-`C-c C-e x (`org-export-as-xoxo')'
- Export as XOXO file `myfile.html'.
-
-`C-c C-e v x'
- Export only the visible part of the document.
-
-
-File: org, Node: iCalendar export, Prev: XOXO export, Up: Exporting
-
-12.11 iCalendar export
-======================
-
-Some people use Org-mode for keeping track of projects, but still
-prefer a standard calendar application for anniversaries and
-appointments. In this case it can be useful to show deadlines and
-other time-stamped items in Org files in the calendar application.
-Org-mode can export calendar information in the standard iCalendar
-format. If you also want to have TODO entries included in the export,
-configure the variable `org-icalendar-include-todo'. Plain timestamps
-are exported as VEVENT, and TODO items as VTODO. It will also create
-events from deadlines that are in non-TODO items. Deadlines and
-scheduling dates in TODO items will be used to set the start and due
-dates for the TODO entry(1). As categories, it will use the tags
-locally defined in the heading, and the file/tree category(2). See the
-variable `org-icalendar-alarm-time' for a way to assign alarms to
-entries with a time.
-
- The iCalendar standard requires each entry to have a globally unique
-identifier (UID). Org creates these identifiers during export. If you
-set the variable `org-icalendar-store-UID', the UID will be stored in
-the `:ID:' property of the entry and re-used next time you report this
-entry. Since a single entry can give rise to multiple iCalendar
-entries (as a timestamp, a deadline, a scheduled item, and as a TODO
-item), Org adds prefixes to the UID, depending on what triggered the
-inclusion of the entry. In this way the UID remains unique, but a
-synchronization program can still figure out from which entry all the
-different instances originate.
-
-`C-c C-e i (`org-export-icalendar-this-file')'
- Create iCalendar entries for the current file and store them in
- the same directory, using a file extension `.ics'.
-
-`C-c C-e I (`org-export-icalendar-all-agenda-files')'
- Like `C-c C-e i', but do this for all files in `org-agenda-files'.
- For each of these files, a separate iCalendar file will be
- written.
-
-`C-c C-e c (`org-export-icalendar-combine-agenda-files')'
- Create a single large iCalendar file from all files in
- `org-agenda-files' and write it to the file given by
- `org-combined-agenda-icalendar-file'.
-
- The export will honor SUMMARY, DESCRIPTION and LOCATION(3)
-properties if the selected entries have them. If not, the summary will
-be derived from the headline, and the description from the body
-(limited to `org-icalendar-include-body' characters).
-
- How this calendar is best read and updated, depends on the
-application you are using. The FAQ covers this issue.
-
- ---------- Footnotes ----------
-
- (1) See the variables `org-icalendar-use-deadline' and
-`org-icalendar-use-scheduled'.
-
- (2) To add inherited tags or the TODO state, configure the variable
-`org-icalendar-categories'.
-
- (3) The LOCATION property can be inherited from higher in the
-hierarchy if you configure `org-use-property-inheritance' accordingly.
-
-
-File: org, Node: Publishing, Next: Working With Source Code, Prev: Exporting, Up: Top
-
-13 Publishing
-*************
-
-Org includes a publishing management system that allows you to configure
-automatic HTML conversion of _projects_ composed of interlinked org
-files. You can also configure Org to automatically upload your
-exported HTML pages and related attachments, such as images and source
-code files, to a web server.
-
- You can also use Org to convert files into PDF, or even combine HTML
-and PDF conversion so that files are available in both formats on the
-server.
-
- Publishing has been contributed to Org by David O'Toole.
-
-* Menu:
-
-* Configuration:: Defining projects
-* Uploading files:: How to get files up on the server
-* Sample configuration:: Example projects
-* Triggering publication:: Publication commands
-
-
-File: org, Node: Configuration, Next: Uploading files, Prev: Publishing, Up: Publishing
-
-13.1 Configuration
-==================
-
-Publishing needs significant configuration to specify files, destination
-and many other properties of a project.
-
-* Menu:
-
-* Project alist:: The central configuration variable
-* Sources and destinations:: From here to there
-* Selecting files:: What files are part of the project?
-* Publishing action:: Setting the function doing the publishing
-* Publishing options:: Tweaking HTML export
-* Publishing links:: Which links keep working after publishing?
-* Sitemap:: Generating a list of all pages
-* Generating an index:: An index that reaches across pages
-
-
-File: org, Node: Project alist, Next: Sources and destinations, Prev: Configuration, Up: Configuration
-
-13.1.1 The variable `org-publish-project-alist'
------------------------------------------------
-
-Publishing is configured almost entirely through setting the value of
-one variable, called `org-publish-project-alist'. Each element of the
-list configures one project, and may be in one of the two following
-forms:
-
- ("project-name" :property value :property value ...)
- i.e. a well-formed property list with alternating keys and values
- or
- ("project-name" :components ("project-name" "project-name" ...))
-
- In both cases, projects are configured by specifying property
-values. A project defines the set of files that will be published, as
-well as the publishing configuration to use when publishing those
-files. When a project takes the second form listed above, the
-individual members of the `:components' property are taken to be
-sub-projects, which group together files requiring different publishing
-options. When you publish such a "meta-project", all the components
-will also be published, in the sequence given.
-
-
-File: org, Node: Sources and destinations, Next: Selecting files, Prev: Project alist, Up: Configuration
-
-13.1.2 Sources and destinations for files
------------------------------------------
-
-Most properties are optional, but some should always be set. In
-particular, Org needs to know where to look for source files, and where
-to put published files.
-
-`:base-directory' Directory containing publishing source files
-`:publishing-directory'Directory where output files will be published.
- You can directly publish to a webserver using a
- file name syntax appropriate for the Emacs
- `tramp' package. Or you can publish to a local
- directory and use external tools to upload your
- website (*note Uploading files::).
-`:preparation-function'Function or list of functions to be called before
- starting the publishing process, for example, to
- run `make' for updating files to be published.
- The project property list is scoped into this
- call as the variable `project-plist'.
-`:completion-function' Function or list of functions called after
- finishing the publishing process, for example, to
- change permissions of the resulting files. The
- project property list is scoped into this call as
- the variable `project-plist'.
-
-
-File: org, Node: Selecting files, Next: Publishing action, Prev: Sources and destinations, Up: Configuration
-
-13.1.3 Selecting files
-----------------------
-
-By default, all files with extension `.org' in the base directory are
-considered part of the project. This can be modified by setting the
-properties
-`:base-extension' Extension (without the dot!) of source files. This
- actually is a regular expression. Set this to the
- symbol `any' if you want to get all files in
- `:base-directory', even without extension.
-`:exclude' Regular expression to match file names that should
- not be published, even though they have been selected
- on the basis of their extension.
-`:include' List of files to be included regardless of
- `:base-extension' and `:exclude'.
-`:recursive' Non-nil means, check base-directory recursively for
- files to publish.
-
-
-File: org, Node: Publishing action, Next: Publishing options, Prev: Selecting files, Up: Configuration
-
-13.1.4 Publishing action
-------------------------
-
-Publishing means that a file is copied to the destination directory and
-possibly transformed in the process. The default transformation is to
-export Org files as HTML files, and this is done by the function
-`org-publish-org-to-html' which calls the HTML exporter (*note HTML
-export::). But you also can publish your content as PDF files using
-`org-publish-org-to-pdf', or as `ascii', `latin1' or `utf8' encoded
-files using the corresponding functions. If you want to publish the
-Org file itself, but with archived, commented, and tag-excluded trees
-removed, use `org-publish-org-to-org' and set the parameters
-`:plain-source' and/or `:htmlized-source'. This will produce
-`file.org' and `file.org.html' in the publishing directory(1). Other
-files like images only need to be copied to the publishing destination;
-for this you may use `org-publish-attachment'. For non-Org files, you
-always need to specify the publishing function:
-
-`:publishing-function' Function executing the publication of a file.
- This may also be a list of functions, which will
- all be called in turn.
-`:plain-source' Non-nil means, publish plain source.
-`:htmlized-source' Non-nil means, publish htmlized source.
-
- The function must accept three arguments: a property list containing
-at least a `:publishing-directory' property, the name of the file to be
-published, and the path to the publishing directory of the output file.
-It should take the specified file, make the necessary transformation
-(if any) and place the result into the destination folder.
-
- ---------- Footnotes ----------
-
- (1) `file-source.org' and `file-source.org.html' if source and
-publishing directories are equal. Note that with this kind of setup,
-you need to add `:exclude "-source\\.org"' to the project definition in
-`org-publish-project-alist' to prevent the published source files from
-being considered as new org files the next time the project is
-published.
-
-
-File: org, Node: Publishing options, Next: Publishing links, Prev: Publishing action, Up: Configuration
-
-13.1.5 Options for the HTML/LaTeX exporters
--------------------------------------------
-
-The property list can be used to set many export options for the HTML
-and LaTeX exporters. In most cases, these properties correspond to user
-variables in Org. The table below lists these properties along with
-the variable they belong to. See the documentation string for the
-respective variable for details.
-
-`:link-up' `org-export-html-link-up'
-`:link-home' `org-export-html-link-home'
-`:language' `org-export-default-language'
-`:customtime' `org-display-custom-times'
-`:headline-levels' `org-export-headline-levels'
-`:section-numbers' `org-export-with-section-numbers'
-`:section-number-format'`org-export-section-number-format'
-`:table-of-contents' `org-export-with-toc'
-`:preserve-breaks' `org-export-preserve-breaks'
-`:archived-trees' `org-export-with-archived-trees'
-`:emphasize' `org-export-with-emphasize'
-`:sub-superscript' `org-export-with-sub-superscripts'
-`:special-strings' `org-export-with-special-strings'
-`:footnotes' `org-export-with-footnotes'
-`:drawers' `org-export-with-drawers'
-`:tags' `org-export-with-tags'
-`:todo-keywords' `org-export-with-todo-keywords'
-`:priority' `org-export-with-priority'
-`:TeX-macros' `org-export-with-TeX-macros'
-`:LaTeX-fragments' `org-export-with-LaTeX-fragments'
-`:latex-listings' `org-export-latex-listings'
-`:skip-before-1st-heading'`org-export-skip-text-before-1st-heading'
-`:fixed-width' `org-export-with-fixed-width'
-`:timestamps' `org-export-with-timestamps'
-`:author-info' `org-export-author-info'
-`:email-info' `org-export-email-info'
-`:creator-info' `org-export-creator-info'
-`:tables' `org-export-with-tables'
-`:table-auto-headline' `org-export-highlight-first-table-line'
-`:style-include-default'`org-export-html-style-include-default'
-`:style' `org-export-html-style'
-`:style-extra' `org-export-html-style-extra'
-`:convert-org-links' `org-export-html-link-org-files-as-html'
-`:inline-images' `org-export-html-inline-images'
-`:html-extension' `org-export-html-extension'
-`:xml-declaration' `org-export-html-xml-declaration'
-`:html-table-tag' `org-export-html-table-tag'
-`:expand-quoted-html' `org-export-html-expand'
-`:timestamp' `org-export-html-with-timestamp'
-`:publishing-directory' `org-export-publishing-directory'
-`:preamble' `org-export-html-preamble'
-`:postamble' `org-export-html-postamble'
-`:auto-preamble' `org-export-html-auto-preamble'
-`:auto-postamble' `org-export-html-auto-postamble'
-`:author' `user-full-name'
-`:email' `user-mail-address' : `addr;addr;..'
-`:select-tags' `org-export-select-tags'
-`:exclude-tags' `org-export-exclude-tags'
-`:latex-image-options' `org-export-latex-image-default-option'
-
- Most of the `org-export-with-*' variables have the same effect in
-both HTML and LaTeX exporters, except for `:TeX-macros' and
-`:LaTeX-fragments', respectively `nil' and `t' in the LaTeX export.
-
- When a property is given a value in `org-publish-project-alist', its
-setting overrides the value of the corresponding user variable (if any)
-during publishing. Options set within a file (*note Export options::),
-however, override everything.
-
-
-File: org, Node: Publishing links, Next: Sitemap, Prev: Publishing options, Up: Configuration
-
-13.1.6 Links between published files
-------------------------------------
-
-To create a link from one Org file to another, you would use something
-like `[[file:foo.org][The foo]]' or simply `file:foo.org.' (*note
-Hyperlinks::). When published, this link becomes a link to `foo.html'.
-In this way, you can interlink the pages of your "org web" project and
-the links will work as expected when you publish them to HTML. If you
-also publish the Org source file and want to link to that, use an
-`http:' link instead of a `file:' link, because `file:' links are
-converted to link to the corresponding `html' file.
-
- You may also link to related files, such as images. Provided you are
-careful with relative file names, and provided you have also configured
-Org to upload the related files, these links will work too. See *Note
-Complex example::, for an example of this usage.
-
- Sometimes an Org file to be published may contain links that are
-only valid in your production environment, but not in the publishing
-location. In this case, use the property
-
-`:link-validation-function' Function to validate links
-
-to define a function for checking link validity. This function must
-accept two arguments, the file name and a directory relative to which
-the file name is interpreted in the production environment. If this
-function returns `nil', then the HTML generator will only insert a
-description into the HTML file, but no link. One option for this
-function is `org-publish-validate-link' which checks if the given file
-is part of any project in `org-publish-project-alist'.
-
-
-File: org, Node: Sitemap, Next: Generating an index, Prev: Publishing links, Up: Configuration
-
-13.1.7 Generating a sitemap
----------------------------
-
-The following properties may be used to control publishing of a map of
-files for a given project.
-
-`:auto-sitemap' When non-nil, publish a sitemap during
- `org-publish-current-project' or
- `org-publish-all'.
-`:sitemap-filename' Filename for output of sitemap. Defaults to
- `sitemap.org' (which becomes `sitemap.html').
-`:sitemap-title' Title of sitemap page. Defaults to name of
- file.
-`:sitemap-function' Plug-in function to use for generation of the
- sitemap. Defaults to
- `org-publish-org-sitemap', which generates a
- plain list of links to all files in the
- project.
-`:sitemap-sort-folders' Where folders should appear in the sitemap.
- Set this to `first' (default) or `last' to
- display folders first or last, respectively.
- Any other value will mix files and folders.
-`:sitemap-alphabetically' The site map is normally sorted
- alphabetically. Set this explicitly to `nil'
- to turn off sorting.
-`:sitemap-ignore-case' Should sorting be case-sensitive? Default
- `nil'.
-
-
-File: org, Node: Generating an index, Prev: Sitemap, Up: Configuration
-
-13.1.8 Generating an index
---------------------------
-
-Org-mode can generate an index across the files of a publishing project.
-
-`:makeindex' When non-nil, generate in index in the file
- `theindex.org' and publish it as `theindex.html'.
-
- The file will be create when first publishing a project with the
-`:makeindex' set. The file only contains a statement `#+include:
-"theindex.inc"'. You can then built around this include statement by
-adding a title, style information etc.
-
-
-File: org, Node: Uploading files, Next: Sample configuration, Prev: Configuration, Up: Publishing
-
-13.2 Uploading files
-====================
-
-For those people already utilizing third party sync tools such as
-`rsync' or `unison', it might be preferable not to use the built in
-remote publishing facilities of Org-mode which rely heavily on Tramp.
-Tramp, while very useful and powerful, tends not to be so efficient for
-multiple file transfer and has been known to cause problems under heavy
-usage.
-
- Specialized synchronization utilities offer several advantages. In
-addition to timestamp comparison, they also do content and
-permissions/attribute checks. For this reason you might prefer to
-publish your web to a local directory (possibly even in place with your
-Org files) and then use `unison' or `rsync' to do the synchronization
-with the remote host.
-
- Since Unison (for example) can be configured as to which files to
-transfer to a certain remote destination, it can greatly simplify the
-project publishing definition. Simply keep all files in the correct
-location, process your Org files with `org-publish' and let the
-synchronization tool do the rest. You do not need, in this scenario,
-to include attachments such as `jpg', `css' or `gif' files in the
-project definition since the 3rd party tool syncs them.
-
- Publishing to a local directory is also much faster than to a remote
-one, so that you can afford more easily to republish entire projects.
-If you set `org-publish-use-timestamps-flag' to `nil', you gain the main
-benefit of re-including any changed external files such as source
-example files you might include with `#+INCLUDE'. The timestamp
-mechanism in Org is not smart enough to detect if included files have
-been modified.
-
-
-File: org, Node: Sample configuration, Next: Triggering publication, Prev: Uploading files, Up: Publishing
-
-13.3 Sample configuration
-=========================
-
-Below we provide two example configurations. The first one is a simple
-project publishing only a set of Org files. The second example is more
-complex, with a multi-component project.
-
-* Menu:
-
-* Simple example:: One-component publishing
-* Complex example:: A multi-component publishing example
-
-
-File: org, Node: Simple example, Next: Complex example, Prev: Sample configuration, Up: Sample configuration
-
-13.3.1 Example: simple publishing configuration
------------------------------------------------
-
-This example publishes a set of Org files to the `public_html'
-directory on the local machine.
-
- (setq org-publish-project-alist
- '(("org"
- :base-directory "~/org/"
- :publishing-directory "~/public_html"
- :section-numbers nil
- :table-of-contents nil
- :style "<link rel=\"stylesheet\"
- href=\"../other/mystyle.css\"
- type=\"text/css\"/>")))
-
-
-File: org, Node: Complex example, Prev: Simple example, Up: Sample configuration
-
-13.3.2 Example: complex publishing configuration
-------------------------------------------------
-
-This more complicated example publishes an entire website, including
-Org files converted to HTML, image files, Emacs Lisp source code, and
-style sheets. The publishing directory is remote and private files are
-excluded.
-
- To ensure that links are preserved, care should be taken to replicate
-your directory structure on the web server, and to use relative file
-paths. For example, if your Org files are kept in `~/org' and your
-publishable images in `~/images', you would link to an image with
- file:../images/myimage.png
- On the web server, the relative path to the image should be the
-same. You can accomplish this by setting up an "images" folder in the
-right place on the web server, and publishing images to it.
-
- (setq org-publish-project-alist
- '(("orgfiles"
- :base-directory "~/org/"
- :base-extension "org"
- :publishing-directory "/ssh:user@host:~/html/notebook/"
- :publishing-function org-publish-org-to-html
- :exclude "PrivatePage.org" ;; regexp
- :headline-levels 3
- :section-numbers nil
- :table-of-contents nil
- :style "<link rel=\"stylesheet\"
- href=\"../other/mystyle.css\" type=\"text/css\"/>"
- :auto-preamble t
- :auto-postamble nil)
-
- ("images"
- :base-directory "~/images/"
- :base-extension "jpg\\|gif\\|png"
- :publishing-directory "/ssh:user@host:~/html/images/"
- :publishing-function org-publish-attachment)
-
- ("other"
- :base-directory "~/other/"
- :base-extension "css\\|el"
- :publishing-directory "/ssh:user@host:~/html/other/"
- :publishing-function org-publish-attachment)
- ("website" :components ("orgfiles" "images" "other"))))
-
-
-File: org, Node: Triggering publication, Prev: Sample configuration, Up: Publishing
-
-13.4 Triggering publication
-===========================
-
-Once properly configured, Org can publish with the following commands:
-
-`C-c C-e X (`org-publish')'
- Prompt for a specific project and publish all files that belong to
- it.
-
-`C-c C-e P (`org-publish-current-project')'
- Publish the project containing the current file.
-
-`C-c C-e F (`org-publish-current-file')'
- Publish only the current file.
-
-`C-c C-e E (`org-publish-all')'
- Publish every project.
-
- Org uses timestamps to track when a file has changed. The above
-functions normally only publish changed files. You can override this
-and force publishing of all files by giving a prefix argument to any of
-the commands above, or by customizing the variable
-`org-publish-use-timestamps-flag'. This may be necessary in particular
-if files include other files via `#+SETUPFILE:' or `#+INCLUDE:'.
-
-
-File: org, Node: Working With Source Code, Next: Miscellaneous, Prev: Publishing, Up: Top
-
-14 Working with source code
-***************************
-
-Source code can be included in Org-mode documents using a `src' block,
-e.g.
-
- #+BEGIN_SRC emacs-lisp
- (defun org-xor (a b)
- "Exclusive or."
- (if a (not b) b))
- #+END_SRC
-
- Org-mode provides a number of features for working with live source
-code, including editing of code blocks in their native major-mode,
-evaluation of code blocks, tangling of code blocks, and exporting code
-blocks and their results in several formats. This functionality was
-contributed by Eric Schulte and Dan Davison, and was originally named
-Org-babel.
-
- The following sections describe Org-mode's code block handling
-facilities.
-
-* Menu:
-
-* Structure of code blocks:: Code block syntax described
-* Editing source code:: Language major-mode editing
-* Exporting code blocks:: Export contents and/or results
-* Extracting source code:: Create pure source code files
-* Evaluating code blocks:: Place results of evaluation in the Org-mode buffer
-* Library of Babel:: Use and contribute to a library of useful code blocks
-* Languages:: List of supported code block languages
-* Header arguments:: Configure code block functionality
-* Results of evaluation:: How evaluation results are handled
-* Noweb reference syntax:: Literate programming in Org-mode
-* Key bindings and useful functions:: Work quickly with code blocks
-* Batch execution:: Call functions from the command line
-
-
-File: org, Node: Structure of code blocks, Next: Editing source code, Prev: Working With Source Code, Up: Working With Source Code
-
-14.1 Structure of code blocks
-=============================
-
-The structure of code blocks is as follows:
-
- #+srcname: <name>
- #+begin_src <language> <switches> <header arguments>
- <body>
- #+end_src
-
- code blocks can also be embedded in text as so called inline code
-blocks as
-
- src_<language>{<body>}
-
- or
-
- src_<language>[<header arguments>]{<body>}
-
-`<name>'
- This name is associated with the code block. This is similar to
- the `#+tblname' lines that can be used to name tables in Org-mode
- files. Referencing the name of a code block makes it possible to
- evaluate the block from other places in the file, other files, or
- from Org-mode table formulas (see *Note The spreadsheet::).
-
-`<language>'
- The language of the code in the block.
-
-`<switches>'
- Switches controlling exportation of the code block (see switches
- discussion in *Note Literal examples::)
-
-`<header arguments>'
- Optional header arguments control many aspects of evaluation,
- export and tangling of code blocks. See the *Note Header
- arguments:: section. Header arguments can also be set on a
- per-buffer or per-subtree basis using properties.
-
-`<body>'
- The source code.
-
-
-File: org, Node: Editing source code, Next: Exporting code blocks, Prev: Structure of code blocks, Up: Working With Source Code
-
-14.2 Editing source code
-========================
-
-Use `C-c '' to edit the current code block. This brings up a language
-major-mode edit buffer containing the body of the code block. Saving
-this buffer will write the new contents back to the Org buffer. Use
-`C-c '' again to exit.
-
- The `org-src-mode' minor mode will be active in the edit buffer. The
-following variables can be used to configure the behavior of the edit
-buffer. See also the customization group `org-edit-structure' for
-further configuration options.
-
-`org-src-lang-modes'
- If an Emacs major-mode named `<lang>-mode' exists, where `<lang>'
- is the language named in the header line of the code block, then
- the edit buffer will be placed in that major-mode. This variable
- can be used to map arbitrary language names to existing major
- modes.
-
-`org-src-window-setup'
- Controls the way Emacs windows are rearranged when the edit buffer
- is created.
-
-`org-src-preserve-indentation'
- This variable is especially useful for tangling languages such as
- Python, in which whitespace indentation in the output is critical.
-
-`org-src-ask-before-returning-to-edit-buffer'
- By default, Org will ask before returning to an open edit buffer.
- Set this variable to nil to switch without asking.
-
-
-File: org, Node: Exporting code blocks, Next: Extracting source code, Prev: Editing source code, Up: Working With Source Code
-
-14.3 Exporting code blocks
-==========================
-
-It is possible to export the _contents_ of code blocks, the _results_
-of code block evaluation, _neither_, or _both_. For most languages,
-the default exports the contents of code blocks. However, for some
-languages (e.g. `ditaa') the default exports the results of code block
-evaluation. For information on exporting code block bodies, see *Note
-Literal examples::.
-
- The `:exports' header argument can be used to specify export
-behavior:
-
-Header arguments:
-.................
-
-`:exports code'
- The default in most languages. The body of the code block is
- exported, as described in *Note Literal examples::.
-
-`:exports results'
- The code block will be evaluated and the results will be placed in
- the Org-mode buffer for export, either updating previous results
- of the code block located anywhere in the buffer or, if no
- previous results exist, placing the results immediately after the
- code block. The body of the code block will not be exported.
-
-`:exports both'
- Both the code block and its results will be exported.
-
-`:exports none'
- Neither the code block nor its results will be exported.
-
- It is possible to inhibit the evaluation of code blocks during
-export. Setting the `org-export-babel-evaluate' variable to `nil' will
-ensure that no code blocks are evaluated as part of the export process.
-This can be useful in situations where potentially untrusted Org-mode
-files are exported in an automated fashion, for example when Org-mode
-is used as the markup language for a wiki.
-
-
-File: org, Node: Extracting source code, Next: Evaluating code blocks, Prev: Exporting code blocks, Up: Working With Source Code
-
-14.4 Extracting source code
-===========================
-
-Creating pure source code files by extracting code from source blocks is
-referred to as "tangling"--a term adopted from the literate programming
-community. During "tangling" of code blocks their bodies are expanded
-using `org-babel-expand-src-block' which can expand both variable and
-"noweb" style references (see *Note Noweb reference syntax::).
-
-Header arguments
-................
-
-`:tangle no'
- The default. The code block is not included in the tangled output.
-
-`:tangle yes'
- Include the code block in the tangled output. The output file name
- is the name of the org file with the extension `.org' replaced by
- the extension for the block language.
-
-`:tangle filename'
- Include the code block in the tangled output to file `filename'.
-
-Functions
-.........
-
-`org-babel-tangle'
- Tangle the current file. Bound to `C-c C-v t'.
-
-`org-babel-tangle-file'
- Choose a file to tangle. Bound to `C-c C-v f'.
-
-Hooks
-.....
-
-`org-babel-post-tangle-hook'
- This hook is run from within code files tangled by
- `org-babel-tangle'. Example applications could include
- post-processing, compilation or evaluation of tangled code files.
-
-
-File: org, Node: Evaluating code blocks, Next: Library of Babel, Prev: Extracting source code, Up: Working With Source Code
-
-14.5 Evaluating code blocks
-===========================
-
-Code blocks can be evaluated(1) and the results placed in the Org-mode
-buffer. By default, evaluation is only turned on for `emacs-lisp' code
-blocks, however support exists for evaluating blocks in many languages.
-See *Note Languages:: for a list of supported languages. See *Note
-Structure of code blocks:: for information on the syntax used to define
-a code block.
-
- There are a number of ways to evaluate code blocks. The simplest is
-to press `C-c C-c' or `C-c C-v e' with the point on a code block(2).
-This will call the `org-babel-execute-src-block' function to evaluate
-the block and insert its results into the Org-mode buffer.
-
- It is also possible to evaluate named code blocks from anywhere in an
-Org-mode buffer or an Org-mode table. `#+call' (or synonymously
-`#+function' or `#+lob') lines can be used to remotely execute code
-blocks located in the current Org-mode buffer or in the "Library of
-Babel" (see *Note Library of Babel::). These lines use the following
-syntax.
-
- #+call: <name>(<arguments>) <header arguments>
- #+function: <name>(<arguments>) <header arguments>
- #+lob: <name>(<arguments>) <header arguments>
-
-`<name>'
- The name of the code block to be evaluated.
-
-`<arguments>'
- Arguments specified in this section will be passed to the code
- block.
-
-`<header arguments>'
- Header arguments can be placed after the function invocation. See
- *Note Header arguments:: for more information on header arguments.
-
- ---------- Footnotes ----------
-
- (1) Whenever code is evaluated there is a potential for that code to
-do harm. Org-mode provides a number of safeguards to ensure that it
-only evaluates code with explicit confirmation from the user. For
-information on these safeguards (and on how to disable them) see *Note
-Code evaluation security::.
-
- (2) The `org-babel-no-eval-on-ctrl-c-ctrl-c' variable can be used to
-remove code evaluation from the `C-c C-c' key binding.
-
-
-File: org, Node: Library of Babel, Next: Languages, Prev: Evaluating code blocks, Up: Working With Source Code
-
-14.6 Library of Babel
-=====================
-
-The "Library of Babel" is a library of code blocks that can be called
-from any Org-mode file. The library is housed in an Org-mode file
-located in the `contrib' directory of Org-mode. Org-mode users can
-deposit functions they believe to be generally useful in the library.
-
- Code blocks defined in the "Library of Babel" can be called remotely
-as if they were in the current Org-mode buffer (see *Note Evaluating
-code blocks:: for information on the syntax of remote code block
-evaluation).
-
- Code blocks located in any Org-mode file can be loaded into the
-"Library of Babel" with the `org-babel-lob-ingest' function, bound to
-`C-c C-v i'.
-
-
-File: org, Node: Languages, Next: Header arguments, Prev: Library of Babel, Up: Working With Source Code
-
-14.7 Languages
-==============
-
-Code blocks in the following languages are supported.
-
-Language Identifier Language Identifier
-Asymptote asymptote C C
-C++ C++ Clojure clojure
-CSS css ditaa ditaa
-Graphviz dot Emacs Lisp emacs-lisp
-gnuplot gnuplot Haskell haskell
-LaTeX latex MATLAB matlab
-Mscgen mscgen Objective Caml ocaml
-Octave octave Oz oz
-Perl perl Python python
-R R Ruby ruby
-Sass sass GNU Screen screen
-shell sh SQL sql
-SQLite sqlite
-
- Language-specific documentation is available for some languages. If
-available, it can be found at
-`http://orgmode.org/worg/org-contrib/babel/languages'.
-
- The `org-babel-load-languages' controls which languages are enabled
-for evaluation (by default only `emacs-lisp' is enabled). This
-variable can be set using the customization interface or by adding code
-like the following to your emacs configuration.
-
- The following disables `emacs-lisp' evaluation and enables
- evaluation of `R' code blocks.
-
- (org-babel-do-load-languages
- 'org-babel-load-languages
- '((emacs-lisp . nil)
- (R . t)))
-
- It is also possible to enable support for a language by loading the
-related elisp file with `require'.
-
- The following adds support for evaluating `clojure' code blocks.
-
- (require 'ob-clojure)
-
-
-File: org, Node: Header arguments, Next: Results of evaluation, Prev: Languages, Up: Working With Source Code
-
-14.8 Header arguments
-=====================
-
-Code block functionality can be configured with header arguments. This
-section provides an overview of the use of header arguments, and then
-describes each header argument in detail.
-
-* Menu:
-
-* Using header arguments:: Different ways to set header arguments
-* Specific header arguments:: List of header arguments
-
-
-File: org, Node: Using header arguments, Next: Specific header arguments, Prev: Header arguments, Up: Header arguments
-
-14.8.1 Using header arguments
------------------------------
-
-The values of header arguments can be set in six different ways, each
-more specific (and having higher priority) than the last.
-
-* Menu:
-
-* System-wide header arguments:: Set global default values
-* Language-specific header arguments:: Set default values by language
-* Buffer-wide header arguments:: Set default values for a specific buffer
-* Header arguments in Org-mode properties:: Set default values for a buffer or heading
-* Code block specific header arguments:: The most common way to set values
-* Header arguments in function calls:: The most specific level
-
-
-File: org, Node: System-wide header arguments, Next: Language-specific header arguments, Prev: Using header arguments, Up: Using header arguments
-
-System-wide header arguments
-............................
-
-System-wide values of header arguments can be specified by customizing
-the `org-babel-default-header-args' variable:
-
- :session => "none"
- :results => "replace"
- :exports => "code"
- :cache => "no"
- :noweb => "no"
-
- For example, the following example could be used to set the default
-value of `:noweb' header arguments to `yes'. This would have the
-effect of expanding `:noweb' references by default when evaluating
-source code blocks.
-
- (setq org-babel-default-header-args
- (cons '(:noweb . "yes")
- (assq-delete-all :noweb org-babel-default-header-args)))
-
-
-File: org, Node: Language-specific header arguments, Next: Buffer-wide header arguments, Prev: System-wide header arguments, Up: Using header arguments
-
-Language-specific header arguments
-..................................
-
-Each language can define its own set of default header arguments. See
-the language-specific documentation available online at
-`http://orgmode.org/worg/org-contrib/babel'.
-
-
-File: org, Node: Buffer-wide header arguments, Next: Header arguments in Org-mode properties, Prev: Language-specific header arguments, Up: Using header arguments
-
-Buffer-wide header arguments
-............................
-
-Buffer-wide header arguments may be specified through the use of a
-special line placed anywhere in an Org-mode file. The line consists of
-the `#+BABEL:' keyword followed by a series of header arguments which
-may be specified using the standard header argument syntax.
-
- For example the following would set `session' to `*R*', and
-`results' to `silent' for every code block in the buffer, ensuring that
-all execution took place in the same session, and no results would be
-inserted into the buffer.
-
- #+BABEL: :session *R* :results silent
-
-
-File: org, Node: Header arguments in Org-mode properties, Next: Code block specific header arguments, Prev: Buffer-wide header arguments, Up: Using header arguments
-
-Header arguments in Org-mode properties
-.......................................
-
-Header arguments are also read from Org-mode properties (see *Note
-Property syntax::), which can be set on a buffer-wide or per-heading
-basis. An example of setting a header argument for all code blocks in a
-buffer is
-
- #+property: tangle yes
-
- When properties are used to set default header arguments, they are
-looked up with inheritance, so the value of the `:cache' header
-argument will default to `yes' in all code blocks in the subtree rooted
-at the following heading:
-
- * outline header
- :PROPERTIES:
- :cache: yes
- :END:
-
- Properties defined in this way override the properties set in
-`org-babel-default-header-args'. It is convenient to use the
-`org-set-property' function bound to `C-c C-x p' to set properties in
-Org-mode documents.
-
-
-File: org, Node: Code block specific header arguments, Next: Header arguments in function calls, Prev: Header arguments in Org-mode properties, Up: Using header arguments
-
-Code block specific header arguments
-....................................
-
-The most common way to assign values to header arguments is at the code
-block level. This can be done by listing a sequence of header
-arguments and their values as part of the `#+begin_src' line.
-Properties set in this way override both the values of
-`org-babel-default-header-args' and header arguments specified as
-properties. In the following example, the `:results' header argument
-is set to `silent', meaning the results of execution will not be
-inserted in the buffer, and the `:exports' header argument is set to
-`code', meaning only the body of the code block will be preserved on
-export to HTML or LaTeX.
-
- #+source: factorial
- #+begin_src haskell :results silent :exports code :var n=0
- fac 0 = 1
- fac n = n * fac (n-1)
- #+end_src
- Similarly, it is possible to set header arguments for inline code
-blocks:
-
- src_haskell[:exports both]{fac 5}
-
-
-File: org, Node: Header arguments in function calls, Prev: Code block specific header arguments, Up: Using header arguments
-
-Header arguments in function calls
-..................................
-
-At the most specific level, header arguments for "Library of Babel" or
-function call lines can be set as shown below:
-
- #+call: factorial(n=5) :exports results
-
-
-File: org, Node: Specific header arguments, Prev: Using header arguments, Up: Header arguments
-
-14.8.2 Specific header arguments
---------------------------------
-
-The following header arguments are defined:
-
-* Menu:
-
-* var:: Pass arguments to code blocks
-* results:: Specify the type of results and how they will
- be collected and handled
-* file:: Specify a path for file output
-* dir:: Specify the default (possibly remote)
- directory for code block execution
-* exports:: Export code and/or results
-* tangle:: Toggle tangling and specify file name
-* comments:: Toggle insertion of comments in tangled
- code files
-* no-expand:: Turn off variable assignment and noweb
- expansion during tangling
-* session:: Preserve the state of code evaluation
-* noweb:: Toggle expansion of noweb references
-* cache:: Avoid re-evaluating unchanged code blocks
-* hlines:: Handle horizontal lines in tables
-* colnames:: Handle column names in tables
-* rownames:: Handle row names in tables
-* shebang:: Make tangled files executable
-* eval:: Limit evaluation of specific code blocks
-
-
-File: org, Node: var, Next: results, Prev: Specific header arguments, Up: Specific header arguments
-
-14.8.2.1 `:var'
-...............
-
-The `:var' header argument is used to pass arguments to code blocks.
-The specifics of how arguments are included in a code block vary by
-language; these are addressed in the language-specific documentation.
-However, the syntax used to specify arguments is the same across all
-languages. The values passed to arguments can be literal values,
-values from org-mode tables and literal example blocks, or the results
-of other code blocks.
-
- These values can be indexed in a manner similar to arrays--see the
-"indexable variable values" heading below.
-
- The following syntax is used to pass arguments to code blocks using
-the `:var' header argument.
-
- :var name=assign
-
- where `assign' can take one of the following forms
-
- * literal value either a string `"string"' or a number `9'.
-
- * reference a table name:
-
- #+tblname: example-table
- | 1 |
- | 2 |
- | 3 |
- | 4 |
-
- #+source: table-length
- #+begin_src emacs-lisp :var table=example-table
- (length table)
- #+end_src
-
- #+results: table-length
- : 4
-
- a code block name, as assigned by `#+srcname:', followed by
- parentheses:
-
- #+begin_src emacs-lisp :var length=table-length()
- (* 2 length)
- #+end_src
-
- #+results:
- : 8
-
- In addition, an argument can be passed to the code block referenced
- by `:var'. The argument is passed within the parentheses
- following the code block name:
-
- #+source: double
- #+begin_src emacs-lisp :var input=8
- (* 2 input)
- #+end_src
-
- #+results: double
- : 16
-
- #+source: squared
- #+begin_src emacs-lisp :var input=double(input=1)
- (* input input)
- #+end_src
-
- #+results: squared
- : 4
-
-Alternate argument syntax
-.........................
-
-It is also possible to specify arguments in a potentially more natural
-way using the `#+source:' line of a code block. As in the following
-example arguments can be packed inside of parenthesis, separated by
-commas, following the source name.
-
- #+source: double(input=0, x=2)
- #+begin_src emacs-lisp
- (* 2 (+ input x))
- #+end_src
-
-Indexable variable values
-.........................
-
-It is possible to reference portions of variable values by "indexing"
-into the variables. Indexes are 0 based with negative values counting
-back from the end. If an index is separated by `,'s then each
-subsequent section will index into the next deepest nesting or
-dimension of the value. The following example assigns the last cell of
-the first row the table `example-table' to the variable `data':
-
- #+results: example-table
- | 1 | a |
- | 2 | b |
- | 3 | c |
- | 4 | d |
-
- #+begin_src emacs-lisp :var data=example-table[0,-1]
- data
- #+end_src
-
- #+results:
- : a
-
- Ranges of variable values can be referenced using two integers
-separated by a `:', in which case the entire inclusive range is
-referenced. For example the following assigns the middle three rows of
-`example-table' to `data'.
-
- #+results: example-table
- | 1 | a |
- | 2 | b |
- | 3 | c |
- | 4 | d |
- | 5 | 3 |
-
- #+begin_src emacs-lisp :var data=example-table[1:3]
- data
- #+end_src
-
- #+results:
- | 2 | b |
- | 3 | c |
- | 4 | d |
-
- Additionally, an empty index, or the single character `*', are both
-interpreted to mean the entire range and as such are equivalent to
-`0:-1', as shown in the following example in which the entire first
-column is referenced.
-
- #+results: example-table
- | 1 | a |
- | 2 | b |
- | 3 | c |
- | 4 | d |
-
- #+begin_src emacs-lisp :var data=example-table[,0]
- data
- #+end_src
-
- #+results:
- | 1 | 2 | 3 | 4 |
-
- It is possible to index into the results of code blocks as well as
-tables. Any number of dimensions can be indexed. Dimensions are
-separated from one another by commas, as shown in the following example.
-
- #+source: 3D
- #+begin_src emacs-lisp
- '(((1 2 3) (4 5 6) (7 8 9))
- ((10 11 12) (13 14 15) (16 17 18))
- ((19 20 21) (22 23 24) (25 26 27)))
- #+end_src
-
- #+begin_src emacs-lisp :var data=3D[1,,1]
- data
- #+end_src
-
- #+results:
- | 11 | 14 | 17 |
-
-
-File: org, Node: results, Next: file, Prev: var, Up: Specific header arguments
-
-14.8.2.2 `:results'
-...................
-
-There are three classes of `:results' header argument. Only one option
-per class may be supplied per code block.
-
- * collection header arguments specify how the results should be
- collected from the code block
-
- * type header arguments specify what type of result the code block
- will return--which has implications for how they will be inserted
- into the Org-mode buffer
-
- * handling header arguments specify how the results of evaluating
- the code block should be handled.
-
-Collection
-..........
-
-The following options are mutually exclusive, and specify how the
-results should be collected from the code block.
-
- * `value' This is the default. The result is the value of the last
- statement in the code block. This header argument places the
- evaluation in functional mode. Note that in some languages, e.g.,
- Python, use of this result type requires that a `return' statement
- be included in the body of the source code block. E.g., `:results
- value'.
-
- * `output' The result is the collection of everything printed to
- STDOUT during the execution of the code block. This header
- argument places the evaluation in scripting mode. E.g., `:results
- output'.
-
-Type
-....
-
-The following options are mutually exclusive and specify what type of
-results the code block will return. By default, results are inserted
-as either a table or scalar depending on their value.
-
- * `table', `vector' The results should be interpreted as an Org-mode
- table. If a single value is returned, it will be converted into a
- table with one row and one column. E.g., `:results value table'.
-
- * `list' The results should be interpreted as an Org-mode list. If
- a single scalar value is returned it will be converted into a list
- with only one element.
-
- * `scalar', `verbatim' The results should be interpreted
- literally--they will not be converted into a table. The results
- will be inserted into the Org-mode buffer as quoted text. E.g.,
- `:results value verbatim'.
-
- * `file' The results will be interpreted as the path to a file, and
- will be inserted into the Org-mode buffer as a file link. E.g.,
- `:results value file'.
-
- * `raw', `org' The results are interpreted as raw Org-mode code and
- are inserted directly into the buffer. If the results look like a
- table they will be aligned as such by Org-mode. E.g., `:results
- value raw'.
-
- * `html' Results are assumed to be HTML and will be enclosed in a
- `begin_html' block. E.g., `:results value html'.
-
- * `latex' Results assumed to be LaTeX and are enclosed in a
- `begin_latex' block. E.g., `:results value latex'.
-
- * `code' Result are assumed to be parseable code and are enclosed in
- a code block. E.g., `:results value code'.
-
- * `pp' The result is converted to pretty-printed code and is
- enclosed in a code block. This option currently supports Emacs
- Lisp, Python, and Ruby. E.g., `:results value pp'.
-
-Handling
-........
-
-The following results options indicate what happens with the results
-once they are collected.
-
- * `silent' The results will be echoed in the minibuffer but will not
- be inserted into the Org-mode buffer. E.g., `:results output
- silent'.
-
- * `replace' The default value. Any existing results will be
- removed, and the new results will be inserted into the Org-mode
- buffer in their place. E.g., `:results output replace'.
-
- * `append' If there are pre-existing results of the code block then
- the new results will be appended to the existing results.
- Otherwise the new results will be inserted as with `replace'.
-
- * `prepend' If there are pre-existing results of the code block then
- the new results will be prepended to the existing results.
- Otherwise the new results will be inserted as with `replace'.
-
-
-File: org, Node: file, Next: dir, Prev: results, Up: Specific header arguments
-
-14.8.2.3 `:file'
-................
-
-The header argument `:file' is used to specify a path for file output.
-An Org-mode style `file:' link is inserted into the buffer as the result
-(see *Note Link format::). Common examples are graphical output from R,
-gnuplot, ditaa and LaTeX code blocks.
-
- Note that for some languages, including R, gnuplot, LaTeX and ditaa,
-graphical output is sent to the specified file without the file being
-referenced explicitly in the code block. See the documentation for the
-individual languages for details. In contrast, general purpose
-languages such as Python and Ruby require that the code explicitly
-create output corresponding to the path indicated by `:file'.
-
-
-File: org, Node: dir, Next: exports, Prev: file, Up: Specific header arguments
-
-14.8.2.4 `:dir' and remote execution
-....................................
-
-While the `:file' header argument can be used to specify the path to the
-output file, `:dir' specifies the default directory during code block
-execution. If it is absent, then the directory associated with the
-current buffer is used. In other words, supplying `:dir path'
-temporarily has the same effect as changing the current directory with
-`M-x cd path', and then not supplying `:dir'. Under the surface, `:dir'
-simply sets the value of the Emacs variable `default-directory'.
-
- When using `:dir', you should supply a relative path for file output
-(e.g. `:file myfile.jpg' or `:file results/myfile.jpg') in which case
-that path will be interpreted relative to the default directory.
-
- In other words, if you want your plot to go into a folder called
-`Work' in your home directory, you could use
-
- #+begin_src R :file myplot.png :dir ~/Work
- matplot(matrix(rnorm(100), 10), type="l")
- #+end_src
-
-Remote execution
-................
-
-A directory on a remote machine can be specified using tramp file
-syntax, in which case the code will be evaluated on the remote machine.
-An example is
-
- #+begin_src R :file plot.png :dir /dand@yakuba.princeton.edu:
- plot(1:10, main=system("hostname", intern=TRUE))
- #+end_src
-
- Text results will be returned to the local Org-mode buffer as usual,
-and file output will be created on the remote machine with relative
-paths interpreted relative to the remote directory. An Org-mode link to
-the remote file will be created.
-
- So, in the above example a plot will be created on the remote
-machine, and a link of the following form will be inserted in the org
-buffer:
-
- [[file:/scp:dand@yakuba.princeton.edu:/home/dand/plot.png][plot.png]]
-
- Most of this functionality follows immediately from the fact that
-`:dir' sets the value of the Emacs variable `default-directory', thanks
-to tramp. Those using XEmacs, or GNU Emacs prior to version 23 may need
-to install tramp separately in order for these features to work
-correctly.
-
-Further points
-..............
-
- * If `:dir' is used in conjunction with `:session', although it will
- determine the starting directory for a new session as expected, no
- attempt is currently made to alter the directory associated with
- an existing session.
-
- * `:dir' should typically not be used to create files during export
- with `:exports results' or `:exports both'. The reason is that, in
- order to retain portability of exported material between machines,
- during export links inserted into the buffer will *not* be
- expanded against `default directory'. Therefore, if
- `default-directory' is altered using `:dir', it is probable that
- the file will be created in a location to which the link does not
- point.
-
-
-File: org, Node: exports, Next: tangle, Prev: dir, Up: Specific header arguments
-
-14.8.2.5 `:exports'
-...................
-
-The `:exports' header argument specifies what should be included in HTML
-or LaTeX exports of the Org-mode file.
-
- * `code' The default. The body of code is included into the
- exported file. E.g., `:exports code'.
-
- * `results' The result of evaluating the code is included in the
- exported file. E.g., `:exports results'.
-
- * `both' Both the code and results are included in the exported
- file. E.g., `:exports both'.
-
- * `none' Nothing is included in the exported file. E.g., `:exports
- none'.
-
-
-File: org, Node: tangle, Next: comments, Prev: exports, Up: Specific header arguments
-
-14.8.2.6 `:tangle'
-..................
-
-The `:tangle' header argument specifies whether or not the code block
-should be included in tangled extraction of source code files.
-
- * `tangle' The code block is exported to a source code file named
- after the basename (name w/o extension) of the Org-mode file.
- E.g., `:tangle yes'.
-
- * `no' The default. The code block is not exported to a source code
- file. E.g., `:tangle no'.
-
- * other Any other string passed to the `:tangle' header argument is
- interpreted as a file basename to which the block will be
- exported. E.g., `:tangle basename'.
-
-
-File: org, Node: comments, Next: no-expand, Prev: tangle, Up: Specific header arguments
-
-14.8.2.7 `:comments'
-....................
-
-By default code blocks are tangled to source-code files without any
-insertion of comments beyond those which may already exist in the body
-of the code block. The `:comments' header argument can be set as
-follows to control the insertion of extra comments into the tangled
-code file.
-
- * `no' The default. No extra comments are inserted during tangling.
-
- * `link' The code block is wrapped in comments which contain
- pointers back to the original Org file from which the code was
- tangled.
-
- * `yes' A synonym for "link" to maintain backwards compatibility.
-
- * `org' Include text from the org-mode file as a comment.
-
- The text is picked from the leading context of the tangled code
- and is limited by the nearest headline or source block as the case
- may be.
-
- * `both' Turns on both the "link" and "org" comment options.
-
-
-File: org, Node: no-expand, Next: session, Prev: comments, Up: Specific header arguments
-
-14.8.2.8 `:no-expand'
-.....................
-
-By default, code blocks are expanded with `org-babel-expand-src-block'
-during tangling. This has the effect of assigning values to variables
-specified with `:var' (see *Note var::), and of replacing "noweb"
-references (see *Note Noweb reference syntax::) with their targets. The
-`:no-expand' header argument can be used to turn off this behavior.
-
-
-File: org, Node: session, Next: noweb, Prev: no-expand, Up: Specific header arguments
-
-14.8.2.9 `:session'
-...................
-
-The `:session' header argument starts a session for an interpreted
-language where state is preserved.
-
- By default, a session is not started.
-
- A string passed to the `:session' header argument will give the
-session a name. This makes it possible to run concurrent sessions for
-each interpreted language.
-
-
-File: org, Node: noweb, Next: cache, Prev: session, Up: Specific header arguments
-
-14.8.2.10 `:noweb'
-..................
-
-The `:noweb' header argument controls expansion of "noweb" style (see
-*Note Noweb reference syntax::) references in a code block. This header
-argument can have one of three values: `yes' `no' or `tangle'.
-
- * `yes' All "noweb" syntax references in the body of the code block
- will be expanded before the block is evaluated, tangled or
- exported.
-
- * `no' The default. No "noweb" syntax specific action is taken on
- evaluating code blocks, However, noweb references will still be
- expanded during tangling.
-
- * `tangle' All "noweb" syntax references in the body of the code
- block will be expanded before the block is tangled, however
- "noweb" references will not be expanded when the block is
- evaluated or exported.
-
-Noweb prefix lines
-..................
-
-Noweb insertions are now placed behind the line prefix of the
-`<<reference>>'. This behavior is illustrated in the following
-example. Because the `<<example>>' noweb reference appears behind the
-SQL comment syntax, each line of the expanded noweb reference will be
-commented.
-
- This code block:
-
- -- <<example>>
-
- expands to:
-
- -- this is the
- -- multi-line body of example
-
- Note that noweb replacement text that does not contain any newlines
-will not be affected by this change, so it is still possible to use
-inline noweb references.
-
-
-File: org, Node: cache, Next: hlines, Prev: noweb, Up: Specific header arguments
-
-14.8.2.11 `:cache'
-..................
-
-The `:cache' header argument controls the use of in-buffer caching of
-the results of evaluating code blocks. It can be used to avoid
-re-evaluating unchanged code blocks. This header argument can have one
-of two values: `yes' or `no'.
-
- * `no' The default. No caching takes place, and the code block will
- be evaluated every time it is called.
-
- * `yes' Every time the code block is run a SHA1 hash of the code and
- arguments passed to the block will be generated. This hash is
- packed into the `#+results:' line and will be checked on subsequent
- executions of the code block. If the code block has not changed
- since the last time it was evaluated, it will not be re-evaluated.
-
-
-File: org, Node: hlines, Next: colnames, Prev: cache, Up: Specific header arguments
-
-14.8.2.12 `:hlines'
-...................
-
-Tables are frequently represented with one or more horizontal lines, or
-hlines. The `:hlines' argument to a code block accepts the values
-`yes' or `no', with a default value of `no'.
-
- * `no' Strips horizontal lines from the input table. In most
- languages this is the desired effect because an `hline' symbol is
- interpreted as an unbound variable and raises an error. Setting
- `:hlines no' or relying on the default value yields the following
- results.
-
- #+tblname: many-cols
- | a | b | c |
- |---+---+---|
- | d | e | f |
- |---+---+---|
- | g | h | i |
-
- #+source: echo-table
- #+begin_src python :var tab=many-cols
- return tab
- #+end_src
-
- #+results: echo-table
- | a | b | c |
- | d | e | f |
- | g | h | i |
-
- * `yes' Leaves hlines in the table. Setting `:hlines yes' has this
- effect.
-
- #+tblname: many-cols
- | a | b | c |
- |---+---+---|
- | d | e | f |
- |---+---+---|
- | g | h | i |
-
- #+source: echo-table
- #+begin_src python :var tab=many-cols :hlines yes
- return tab
- #+end_src
-
- #+results: echo-table
- | a | b | c |
- |---+---+---|
- | d | e | f |
- |---+---+---|
- | g | h | i |
-
-
-File: org, Node: colnames, Next: rownames, Prev: hlines, Up: Specific header arguments
-
-14.8.2.13 `:colnames'
-.....................
-
-The `:colnames' header argument accepts the values `yes', `no', or
-`nil' for unassigned. The default value is `nil'.
-
- * `nil' If an input table looks like it has column names (because
- its second row is an hline), then the column names will be removed
- from the table before processing, then reapplied to the results.
-
- #+tblname: less-cols
- | a |
- |---|
- | b |
- | c |
-
- #+srcname: echo-table-again
- #+begin_src python :var tab=less-cols
- return [[val + '*' for val in row] for row in tab]
- #+end_src
-
- #+results: echo-table-again
- | a |
- |----|
- | b* |
- | c* |
-
- * `no' No column name pre-processing takes place
-
- * `yes' Column names are removed and reapplied as with `nil' even if
- the table does not "look like" it has column names (i.e. the
- second row is not an hline)
-
-
-File: org, Node: rownames, Next: shebang, Prev: colnames, Up: Specific header arguments
-
-14.8.2.14 `:rownames'
-.....................
-
-The `:rownames' header argument can take on the values `yes' or `no',
-with a default value of `no'.
-
- * `no' No row name pre-processing will take place.
-
- * `yes' The first column of the table is removed from the table
- before processing, and is then reapplied to the results.
-
- #+tblname: with-rownames
- | one | 1 | 2 | 3 | 4 | 5 |
- | two | 6 | 7 | 8 | 9 | 10 |
-
- #+srcname: echo-table-once-again
- #+begin_src python :var tab=with-rownames :rownames yes
- return [[val + 10 for val in row] for row in tab]
- #+end_src
-
- #+results: echo-table-once-again
- | one | 11 | 12 | 13 | 14 | 15 |
- | two | 16 | 17 | 18 | 19 | 20 |
-
-
-File: org, Node: shebang, Next: eval, Prev: rownames, Up: Specific header arguments
-
-14.8.2.15 `:shebang'
-....................
-
-Setting the `:shebang' header argument to a string value (e.g.
-`:shebang "#!/bin/bash"') causes the string to be inserted as the first
-line of any tangled file holding the code block, and the file
-permissions of the tangled file are set to make it executable.
-
-
-File: org, Node: eval, Prev: shebang, Up: Specific header arguments
-
-14.8.2.16 `:eval'
-.................
-
-The `:eval' header argument can be used to limit the evaluation of
-specific code blocks. `:eval' accepts two arguments "never" and
-"query". `:eval never' will ensure that a code block is never
-evaluated, this can be useful for protecting against the evaluation of
-dangerous code blocks. `:eval query' will require a query for every
-execution of a code block regardless of the value of the
-`org-confirm-babel-evaluate' variable.
-
-
-File: org, Node: Results of evaluation, Next: Noweb reference syntax, Prev: Header arguments, Up: Working With Source Code
-
-14.9 Results of evaluation
-==========================
-
-The way in which results are handled depends on whether a session is
-invoked, as well as on whether `:results value' or `:results output' is
-used. The following table shows the possibilities:
-
- Non-session Session
-`:results value' value of last value of last expression
- expression
-`:results output' contents of STDOUT concatenation of interpreter
- output
-
- Note: With `:results value', the result in both `:session' and
-non-session is returned to Org-mode as a table (a one- or
-two-dimensional vector of strings or numbers) when appropriate.
-
-14.9.1 Non-session
-------------------
-
-14.9.1.1 `:results value'
-.........................
-
-This is the default. Internally, the value is obtained by wrapping the
-code in a function definition in the external language, and evaluating
-that function. Therefore, code should be written as if it were the body
-of such a function. In particular, note that Python does not
-automatically return a value from a function unless a `return'
-statement is present, and so a `return' statement will usually be
-required in Python.
-
- This is the only one of the four evaluation contexts in which the
-code is automatically wrapped in a function definition.
-
-14.9.1.2 `:results output'
-..........................
-
-The code is passed to the interpreter as an external process, and the
-contents of the standard output stream are returned as text. (In certain
-languages this also contains the error output stream; this is an area
-for future work.)
-
-14.9.2 Session
---------------
-
-14.9.2.1 `:results value'
-.........................
-
-The code is passed to the interpreter running as an interactive Emacs
-inferior process. The result returned is the result of the last
-evaluation performed by the interpreter. (This is obtained in a
-language-specific manner: the value of the variable `_' in Python and
-Ruby, and the value of `.Last.value' in R).
-
-14.9.2.2 `:results output'
-..........................
-
-The code is passed to the interpreter running as an interactive Emacs
-inferior process. The result returned is the concatenation of the
-sequence of (text) output from the interactive interpreter. Notice that
-this is not necessarily the same as what would be sent to `STDOUT' if
-the same code were passed to a non-interactive interpreter running as
-an external process. For example, compare the following two blocks:
-
- #+begin_src python :results output
- print "hello"
- 2
- print "bye"
- #+end_src
-
- #+resname:
- : hello
- : bye
-
- In non-session mode, the `2' is not printed and does not appear.
- #+begin_src python :results output :session
- print "hello"
- 2
- print "bye"
- #+end_src
-
- #+resname:
- : hello
- : 2
- : bye
-
- But in `:session' mode, the interactive interpreter receives input
-`2' and prints out its value, `2'. (Indeed, the other print statements
-are unnecessary here).
-
-
-File: org, Node: Noweb reference syntax, Next: Key bindings and useful functions, Prev: Results of evaluation, Up: Working With Source Code
-
-14.10 Noweb reference syntax
-============================
-
-The "noweb" (see `http://www.cs.tufts.edu/~nr/noweb/') Literate
-Programming system allows named blocks of code to be referenced by
-using the familiar Noweb syntax:
-
- <<code-block-name>>
-
- When a code block is tangled or evaluated, whether or not "noweb"
-references are expanded depends upon the value of the `:noweb' header
-argument. If `:noweb yes', then a Noweb reference is expanded before
-evaluation. If `:noweb no', the default, then the reference is not
-expanded before evaluation.
-
- Note: the default value, `:noweb no', was chosen to ensure that
-correct code is not broken in a language, such as Ruby, where `<<arg>>'
-is a syntactically valid construct. If `<<arg>>' is not syntactically
-valid in languages that you use, then please consider setting the
-default value.
-
-
-File: org, Node: Key bindings and useful functions, Next: Batch execution, Prev: Noweb reference syntax, Up: Working With Source Code
-
-14.11 Key bindings and useful functions
-=======================================
-
-Many common Org-mode key sequences are re-bound depending on the
-context.
-
- Within a code block, the following key bindings are active:
-
-`C-c C-c' org-babel-execute-src-block
-`C-c C-o' org-babel-open-src-block-result
-`C-<up>' org-babel-load-in-session
-`M-<down>' org-babel-pop-to-session
-
- In an Org-mode buffer, the following key bindings are active:
-
-`C-c C-v a' or `C-c C-v org-babel-sha1-hash
-C-a'
-`C-c C-v b' or `C-c C-v org-babel-execute-buffer
-C-b'
-`C-c C-v f' or `C-c C-v org-babel-tangle-file
-C-f'
-`C-c C-v g' org-babel-goto-named-source-block
-`C-c C-v h' org-babel-describe-bindings
-`C-c C-v l' or `C-c C-v org-babel-lob-ingest
-C-l'
-`C-c C-v p' or `C-c C-v org-babel-expand-src-block
-C-p'
-`C-c C-v s' or `C-c C-v org-babel-execute-subtree
-C-s'
-`C-c C-v t' or `C-c C-v org-babel-tangle
-C-t'
-`C-c C-v z' or `C-c C-v org-babel-switch-to-session
-C-z'
-
-
-File: org, Node: Batch execution, Prev: Key bindings and useful functions, Up: Working With Source Code
-
-14.12 Batch execution
-=====================
-
-It is possible to call functions from the command line. This shell
-script calls `org-babel-tangle' on every one of its arguments.
-
- Be sure to adjust the paths to fit your system.
-
- #!/bin/sh
- # -*- mode: shell-script -*-
- #
- # tangle files with org-mode
- #
- DIR=`pwd`
- FILES=""
- ORGINSTALL="~/src/org/lisp/org-install.el"
-
- # wrap each argument in the code required to call tangle on it
- for i in $@; do
- FILES="$FILES \"$i\""
- done
-
- emacs -Q --batch -l $ORGINSTALL \
- --eval "(progn
- (add-to-list 'load-path (expand-file-name \"~/src/org/lisp/\"))
- (add-to-list 'load-path (expand-file-name \"~/src/org/contrib/lisp/\"))
- (require 'org)(require 'org-exp)(require 'ob)(require 'ob-tangle)
- (mapc (lambda (file)
- (find-file (expand-file-name file \"$DIR\"))
- (org-babel-tangle)
- (kill-buffer)) '($FILES)))" 2>&1 |grep tangled
-
-
-File: org, Node: Miscellaneous, Next: Hacking, Prev: Working With Source Code, Up: Top
-
-15 Miscellaneous
-****************
-
-* Menu:
-
-* Completion:: M-TAB knows what you need
-* Easy Templates:: Quick insertion of structural elements
-* Speed keys:: Electric commands at the beginning of a headline
-* Code evaluation security:: Org mode files evaluate inline code
-* Customization:: Adapting Org to your taste
-* In-buffer settings:: Overview of the #+KEYWORDS
-* The very busy C-c C-c key:: When in doubt, press C-c C-c
-* Clean view:: Getting rid of leading stars in the outline
-* TTY keys:: Using Org on a tty
-* Interaction:: Other Emacs packages
-
-
-File: org, Node: Completion, Next: Easy Templates, Prev: Miscellaneous, Up: Miscellaneous
-
-15.1 Completion
-===============
-
-Emacs would not be Emacs without completion, and Org-mode uses it
-whenever it makes sense. If you prefer an iswitchb- or ido-like
-interface for some of the completion prompts, you can specify your
-preference by setting at most one of the variables
-`org-completion-use-iswitchb' `org-completion-use-ido'.
-
- Org supports in-buffer completion. This type of completion does not
-make use of the minibuffer. You simply type a few letters into the
-buffer and use the key to complete text right there.
-
-`M-<TAB>'
- Complete word at point
- * At the beginning of a headline, complete TODO keywords.
-
- * After `\', complete TeX symbols supported by the exporter.
-
- * After `*', complete headlines in the current buffer so that
- they can be used in search links like `[[*find this
- headline]]'.
-
- * After `:' in a headline, complete tags. The list of tags is
- taken from the variable `org-tag-alist' (possibly set through
- the `#+TAGS' in-buffer option, *note Setting tags::), or it
- is created dynamically from all tags used in the current
- buffer.
-
- * After `:' and not in a headline, complete property keys. The
- list of keys is constructed dynamically from all keys used in
- the current buffer.
-
- * After `[', complete link abbreviations (*note Link
- abbreviations::).
-
- * After `#+', complete the special keywords like `TYP_TODO' or
- `OPTIONS' which set file-specific options for Org-mode. When
- the option keyword is already complete, pressing `M-<TAB>'
- again will insert example settings for this keyword.
-
- * In the line after `#+STARTUP: ', complete startup keywords,
- i.e. valid keys for this line.
-
- * Elsewhere, complete dictionary words using Ispell.
-
-
-File: org, Node: Easy Templates, Next: Speed keys, Prev: Completion, Up: Miscellaneous
-
-15.2 Easy Templates
-===================
-
-Org-mode supports insertion of empty structural elements (like
-`#+BEGIN_SRC' and `#+END_SRC' pairs) with just a few key strokes. This
-is achieved through a native template expansion mechanism. Note that
-Emacs has several other template mechanisms which could be used in a
-similar way, for example `yasnippet'.
-
- To insert a structural element, type a `<', followed by a template
-selector and `<TAB>'. Completion takes effect only when the above
-keystrokes are typed on a line by itself.
-
- The following template selectors are currently supported.
-
-`s' `#+begin_src ... #+end_src'
-`e' `#+begin_example ... #+end_example'
-`q' `#+begin_quote ... #+end_quote'
-`v' `#+begin_verse ... #+end_verse'
-`c' `#+begin_center ... #+end_center'
-`l' `#+begin_latex ... #+end_latex'
-`L' `#+latex:'
-`h' `#+begin_html ... #+end_html'
-`H' `#+html:'
-`a' `#+begin_ascii ... #+end_ascii'
-`A' `#+ascii:'
-`i' `#+include:' line
-
- For example, on an empty line, typing "<e" and then pressing TAB,
-will expand into a complete EXAMPLE template.
-
- You can install additional templates by customizing the variable
-`org-structure-template-alist'. See the docstring of the variable for
-additional details.
-
-
-File: org, Node: Speed keys, Next: Code evaluation security, Prev: Easy Templates, Up: Miscellaneous
-
-15.3 Speed keys
-===============
-
-Single keys can be made to execute commands when the cursor is at the
-beginning of a headline, i.e. before the first star. Configure the
-variable `org-use-speed-commands' to activate this feature. There is a
-pre-defined list of commands, and you can add more such commands using
-the variable `org-speed-commands-user'. Speed keys do not only speed up
-navigation and other commands, but they also provide an alternative way
-to execute commands bound to keys that are not or not easily available
-on a TTY, or on a small mobile device with a limited keyboard.
-
- To see which commands are available, activate the feature and press
-`?' with the cursor at the beginning of a headline.
-
-
-File: org, Node: Code evaluation security, Next: Customization, Prev: Speed keys, Up: Miscellaneous
-
-15.4 Code evaluation and security issues
-========================================
-
-Org provides tools to work with the code snippets, including evaluating
-them.
-
- Running code on your machine always comes with a security risk.
-Badly written or malicious code can be executed on purpose or by
-accident. Org has default settings which will only evaluate such code
-if you give explicit permission to do so, and as a casual user of these
-features you should leave these precautions intact.
-
- For people who regularly work with such code, the confirmation
-prompts can become annoying, and you might want to turn them off. This
-can be done, but you must be aware of the risks that are involved.
-
- Code evaluation can happen under the following circumstances:
-
-Source code blocks
- Source code blocks can be evaluated during export, or when
- pressing `C-c C-c' in the block. The most important thing to
- realize here is that Org mode files which contain code snippets
- are, in a certain sense, like executable files. So you should
- accept them and load them into Emacs only from trusted
- sources--just like you would do with a program you install on your
- computer.
-
- Make sure you know what you are doing before customizing the
- variables which take off the default security brakes.
-
- -- User Option: org-confirm-babel-evaluate
- When set to t user is queried before code block evaluation
-
-Following `shell' and `elisp' links
- Org has two link types that can directly evaluate code (*note
- External links::). These links can be problematic because the
- code to be evaluated is not visible.
-
- -- User Option: org-confirm-shell-link-function
- Function to queries user about shell link execution.
-
- -- User Option: org-confirm-elisp-link-function
- Functions to query user for Emacs Lisp link execution.
-
-Formulas in tables
- Formulas in tables (*note The spreadsheet::) are code that is
- evaluated either by the calc interpreter, or by the Emacs Lisp
- interpreter.
-
-
-File: org, Node: Customization, Next: In-buffer settings, Prev: Code evaluation security, Up: Miscellaneous
-
-15.5 Customization
-==================
-
-There are more than 180 variables that can be used to customize Org.
-For the sake of compactness of the manual, I am not describing the
-variables here. A structured overview of customization variables is
-available with `M-x org-customize'. Or select `Browse Org Group' from
-the `Org->Customization' menu. Many settings can also be activated on
-a per-file basis, by putting special lines into the buffer (*note
-In-buffer settings::).
-
-
-File: org, Node: In-buffer settings, Next: The very busy C-c C-c key, Prev: Customization, Up: Miscellaneous
-
-15.6 Summary of in-buffer settings
-==================================
-
-Org-mode uses special lines in the buffer to define settings on a
-per-file basis. These lines start with a `#+' followed by a keyword, a
-colon, and then individual words defining a setting. Several setting
-words can be in the same line, but you can also have multiple lines for
-the keyword. While these settings are described throughout the manual,
-here is a summary. After changing any of those lines in the buffer,
-press `C-c C-c' with the cursor still in the line to activate the
-changes immediately. Otherwise they become effective only when the
-file is visited again in a new Emacs session.
-
-`#+ARCHIVE: %s_done::'
- This line sets the archive location for the agenda file. It
- applies for all subsequent lines until the next `#+ARCHIVE' line,
- or the end of the file. The first such line also applies to any
- entries before it. The corresponding variable is
- `org-archive-location'.
-
-`#+CATEGORY:'
- This line sets the category for the agenda file. The category
- applies for all subsequent lines until the next `#+CATEGORY' line,
- or the end of the file. The first such line also applies to any
- entries before it.
-
-`#+COLUMNS: %25ITEM .....'
- Set the default format for columns view. This format applies when
- columns view is invoked in locations where no `COLUMNS' property
- applies.
-
-`#+CONSTANTS: name1=value1 ...'
- Set file-local values for constants to be used in table formulas.
- This line sets the local variable
- `org-table-formula-constants-local'. The global version of this
- variable is `org-table-formula-constants'.
-
-`#+FILETAGS: :tag1:tag2:tag3:'
- Set tags that can be inherited by any entry in the file, including
- the top-level entries.
-
-`#+DRAWERS: NAME1 .....'
- Set the file-local set of drawers. The corresponding global
- variable is `org-drawers'.
-
-`#+LINK: linkword replace'
- These lines (several are allowed) specify link abbreviations.
- *Note Link abbreviations::. The corresponding variable is
- `org-link-abbrev-alist'.
-
-`#+PRIORITIES: highest lowest default'
- This line sets the limits and the default for the priorities. All
- three must be either letters A-Z or numbers 0-9. The highest
- priority must have a lower ASCII number than the lowest priority.
-
-`#+PROPERTY: Property_Name Value'
- This line sets a default inheritance value for entries in the
- current buffer, most useful for specifying the allowed values of a
- property.
-
-`#+SETUPFILE: file'
- This line defines a file that holds more in-buffer setup.
- Normally this is entirely ignored. Only when the buffer is parsed
- for option-setting lines (i.e. when starting Org-mode for a file,
- when pressing `C-c C-c' in a settings line, or when exporting),
- then the contents of this file are parsed as if they had been
- included in the buffer. In particular, the file can be any other
- Org-mode file with internal setup. You can visit the file the
- cursor is in the line with `C-c ''.
-
-`#+STARTUP:'
- This line sets options to be used at startup of Org-mode, when an
- Org file is being visited.
-
- The first set of options deals with the initial visibility of the
- outline tree. The corresponding variable for global default
- settings is `org-startup-folded', with a default value `t', which
- means `overview'.
- overview top-level headlines only
- content all headlines
- showall no folding of any entries
- showeverything show even drawer contents
-
- Dynamic virtual indentation is controlled by the variable
- `org-startup-indented'(1)
- indent start with `org-indent-mode' turned on
- noindent start with `org-indent-mode' turned off
-
- Then there are options for aligning tables upon visiting a file.
- This is useful in files containing narrowed table columns. The
- corresponding variable is `org-startup-align-all-tables', with a
- default value `nil'.
- align align all tables
- noalign don't align tables on startup
-
- When visiting a file, inline images can be automatically
- displayed. The corresponding variable is
- `org-startup-with-inline-images', with a default value `nil' to
- avoid delays when visiting a file.
- inlineimages show inline images
- noinlineimages don't show inline images on startup
-
- Logging the closing and reopening of TODO items and clock
- intervals can be configured using these options (see variables
- `org-log-done', `org-log-note-clock-out' and `org-log-repeat')
- logdone record a timestamp when an item is marked DONE
- lognotedone record timestamp and a note when DONE
- nologdone don't record when items are marked DONE
- logrepeat record a time when reinstating a repeating item
- lognoterepeat record a note when reinstating a repeating item
- nologrepeat do not record when reinstating repeating item
- lognoteclock-out record a note when clocking out
- nolognoteclock-out don't record a note when clocking out
- logreschedule record a timestamp when scheduling time changes
- lognotereschedule record a note when scheduling time changes
- nologreschedule do not record when a scheduling date changes
- logredeadline record a timestamp when deadline changes
- lognoteredeadline record a note when deadline changes
- nologredeadline do not record when a deadline date changes
- logrefile record a timestamp when refiling
- lognoterefile record a note when refiling
- nologrefile do not record when refiling
- Here are the options for hiding leading stars in outline headings,
- and for indenting outlines. The corresponding variables are
- `org-hide-leading-stars' and `org-odd-levels-only', both with a
- default setting `nil' (meaning `showstars' and `oddeven').
- hidestars make all but one of the stars starting a headline invisible.
- showstars show all stars starting a headline
- indent virtual indentation according to outline level
- noindent no virtual indentation according to outline level
- odd allow only odd outline levels (1,3,...)
- oddeven allow all outline levels
- To turn on custom format overlays over timestamps (variables
- `org-put-time-stamp-overlays' and
- `org-time-stamp-overlay-formats'), use
- customtime overlay custom time format
- The following options influence the table spreadsheet (variable
- `constants-unit-system').
- constcgs `constants.el' should use the c-g-s unit system
- constSI `constants.el' should use the SI unit system
- To influence footnote settings, use the following keywords. The
- corresponding variables are `org-footnote-define-inline',
- `org-footnote-auto-label', and `org-footnote-auto-adjust'.
- fninline define footnotes inline
- fnnoinline define footnotes in separate section
- fnlocal define footnotes near first reference, but not inline
- fnprompt prompt for footnote labels
- fnauto create [fn:1]-like labels automatically (default)
- fnconfirm offer automatic label for editing or confirmation
- fnplain create [1]-like labels automatically
- fnadjust automatically renumber and sort footnotes
- nofnadjust do not renumber and sort automatically
- To hide blocks on startup, use these keywords. The corresponding
- variable is `org-hide-block-startup'.
- hideblocks Hide all begin/end blocks on startup
- nohideblocks Do not hide blocks on startup
- The display of entities as UTF-8 characters is governed by the
- variable `org-pretty-entities' and the keywords
- entitiespretty Show entities as UTF-8 characters where possible
- entitiesplain Leave entities plain
-
-`#+TAGS: TAG1(c1) TAG2(c2)'
- These lines (several such lines are allowed) specify the valid
- tags in this file, and (potentially) the corresponding _fast tag
- selection_ keys. The corresponding variable is `org-tag-alist'.
-
-`#+TBLFM:'
- This line contains the formulas for the table directly above the
- line.
-
-`#+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+DATE:,'
-`#+OPTIONS:, #+BIND:, #+XSLT:,'
-`#+DESCRIPTION:, #+KEYWORDS:,'
-`#+LATEX_HEADER:, #+STYLE:, #+LINK_UP:, #+LINK_HOME:,'
-`#+EXPORT_SELECT_TAGS:, #+EXPORT_EXCLUDE_TAGS:'
- These lines provide settings for exporting files. For more
- details see *Note Export options::.
-
-`#+TODO: #+SEQ_TODO: #+TYP_TODO:'
- These lines set the TODO keywords and their interpretation in the
- current file. The corresponding variable is `org-todo-keywords'.
-
- ---------- Footnotes ----------
-
- (1) Emacs 23 and Org-mode 6.29 are required
-
-
-File: org, Node: The very busy C-c C-c key, Next: Clean view, Prev: In-buffer settings, Up: Miscellaneous
-
-15.7 The very busy C-c C-c key
-==============================
-
-The key `C-c C-c' has many purposes in Org, which are all mentioned
-scattered throughout this manual. One specific function of this key is
-to add _tags_ to a headline (*note Tags::). In many other
-circumstances it means something like _"Hey Org, look here and update
-according to what you see here"_. Here is a summary of what this means
-in different contexts.
-
- - If there are highlights in the buffer from the creation of a sparse
- tree, or from clock display, remove these highlights.
-
- - If the cursor is in one of the special `#+KEYWORD' lines, this
- triggers scanning the buffer for these lines and updating the
- information.
-
- - If the cursor is inside a table, realign the table. This command
- works even if the automatic table editor has been turned off.
-
- - If the cursor is on a `#+TBLFM' line, re-apply the formulas to the
- entire table.
-
- - If the current buffer is a capture buffer, close the note and file
- it. With a prefix argument, file it, without further interaction,
- to the default location.
-
- - If the cursor is on a `<<<target>>>', update radio targets and
- corresponding links in this buffer.
-
- - If the cursor is in a property line or at the start or end of a
- property drawer, offer property commands.
-
- - If the cursor is at a footnote reference, go to the corresponding
- definition, and vice versa.
-
- - If the cursor is on a statistics cookie, update it.
-
- - If the cursor is in a plain list item with a checkbox, toggle the
- status of the checkbox.
-
- - If the cursor is on a numbered item in a plain list, renumber the
- ordered list.
-
- - If the cursor is on the `#+BEGIN' line of a dynamic block, the
- block is updated.
-
-
-File: org, Node: Clean view, Next: TTY keys, Prev: The very busy C-c C-c key, Up: Miscellaneous
-
-15.8 A cleaner outline view
-===========================
-
-Some people find it noisy and distracting that the Org headlines start
-with a potentially large number of stars, and that text below the
-headlines is not indented. While this is no problem when writing a
-_book-like_ document where the outline headings are really section
-headings, in a more _list-oriented_ outline, indented structure is a
-lot cleaner:
-
- * Top level headline | * Top level headline
- ** Second level | * Second level
- *** 3rd level | * 3rd level
- some text | some text
- *** 3rd level | * 3rd level
- more text | more text
- * Another top level headline | * Another top level headline
-
-If you are using at least Emacs 23.2(1) and version 6.29 of Org, this
-kind of view can be achieved dynamically at display time using
-`org-indent-mode'. In this minor mode, all lines are prefixed for
-display with the necessary amount of space(2). Also headlines are
-prefixed with additional stars, so that the amount of indentation
-shifts by two(3) spaces per level. All headline stars but the last
-one are made invisible using the `org-hide' face(4) - see below under
-`2.' for more information on how this works. You can turn on
-`org-indent-mode' for all files by customizing the variable
-`org-startup-indented', or you can turn it on for individual files using
-
- #+STARTUP: indent
-
- If you want a similar effect in an earlier version of Emacs and/or
-Org, or if you want the indentation to be hard space characters so that
-the plain text file looks as similar as possible to the Emacs display,
-Org supports you in the following way:
-
- 1. _Indentation of text below headlines_
- You may indent text below each headline to make the left boundary
- line up with the headline, like
-
- *** 3rd level
- more text, now indented
-
- Org supports this with paragraph filling, line wrapping, and
- structure editing(5), preserving or adapting the indentation as
- appropriate.
-
- 2. _Hiding leading stars_
- You can modify the display in such a way that all leading stars
- become invisible. To do this in a global way, configure the
- variable `org-hide-leading-stars' or change this on a per-file
- basis with
-
- #+STARTUP: hidestars
- #+STARTUP: showstars
-
- With hidden stars, the tree becomes:
-
- * Top level headline
- * Second level
- * 3rd level
- ...
-
- The leading stars are not truly replaced by whitespace, they are
- only fontified with the face `org-hide' that uses the background
- color as font color. If you are not using either white or black
- background, you may have to customize this face to get the wanted
- effect. Another possibility is to set this font such that the
- extra stars are almost invisible, for example using the color
- `grey90' on a white background.
-
- 3. Things become cleaner still if you skip all the even levels and
- use only odd levels 1, 3, 5..., effectively adding two stars to go
- from one outline level to the next(6). In this way we get the
- outline view shown at the beginning of this section. In order to
- make the structure editing and export commands handle this
- convention correctly, configure the variable
- `org-odd-levels-only', or set this on a per-file basis with one of
- the following lines:
-
- #+STARTUP: odd
- #+STARTUP: oddeven
-
- You can convert an Org file from single-star-per-level to the
- double-star-per-level convention with `M-x
- org-convert-to-odd-levels RET' in that file. The reverse
- operation is `M-x org-convert-to-oddeven-levels'.
-
- ---------- Footnotes ----------
-
- (1) Emacs 23.1 can actually crash with `org-indent-mode'
-
- (2) `org-indent-mode' also sets the `wrap-prefix' property, such
-that `visual-line-mode' (or purely setting `word-wrap') wraps long
-lines (including headlines) correctly indented.
-
- (3) See the variable `org-indent-indentation-per-level'.
-
- (4) Turning on `org-indent-mode' sets `org-hide-leading-stars' to
-`t' and `org-adapt-indentation' to `nil'.
-
- (5) See also the variable `org-adapt-indentation'.
-
- (6) When you need to specify a level for a property search or refile
-targets, `LEVEL=2' will correspond to 3 stars, etc.
-
-
-File: org, Node: TTY keys, Next: Interaction, Prev: Clean view, Up: Miscellaneous
-
-15.9 Using Org on a tty
-=======================
-
-Because Org contains a large number of commands, by default many of
-Org's core commands are bound to keys that are generally not accessible
-on a tty, such as the cursor keys (<left>, <right>, <up>, <down>),
-<TAB> and <RET>, in particular when used together with modifiers like
-<Meta> and/or <Shift>. To access these commands on a tty when special
-keys are unavailable, the following alternative bindings can be used.
-The tty bindings below will likely be more cumbersome; you may find for
-some of the bindings below that a customized workaround suits you
-better. For example, changing a timestamp is really only fun with
-`S-<cursor>' keys, whereas on a tty you would rather use `C-c .' to
-re-insert the timestamp.
-
-Default Alternative 1 Speed Alternative 2
- key
-`S-<TAB>' `C-u <TAB>' `C'
-`M-<left>' `C-c C-x l' `l' `<Esc> <left>'
-`M-S-<left>'`C-c C-x L' `L'
-`M-<right>' `C-c C-x r' `r' `<Esc>
- <right>'
-`M-S-<right>'`C-c C-x R' `R'
-`M-<up>' `C-c C-x u' ` ' `<Esc> <up>'
-`M-S-<up>' `C-c C-x U' `U'
-`M-<down>' `C-c C-x d' ` ' `<Esc> <down>'
-`M-S-<down>'`C-c C-x D' `D'
-`S-<RET>' `C-c C-x c' ` '
-`M-<RET>' `C-c C-x m' ` ' `<Esc> <RET>'
-`M-S-<RET>' `C-c C-x M' ` '
-`S-<left>' `C-c <left>' ` '
-`S-<right>' `C-c <right>' ` '
-`S-<up>' `C-c <up>' ` '
-`S-<down>' `C-c <down>' ` '
-`C-S-<left>'`C-c C-x ` '
- <left>'
-`C-S-<right>'`C-c C-x ` '
- <right>'
-
-
-File: org, Node: Interaction, Prev: TTY keys, Up: Miscellaneous
-
-15.10 Interaction with other packages
-=====================================
-
-Org lives in the world of GNU Emacs and interacts in various ways with
-other code out there.
-
-* Menu:
-
-* Cooperation:: Packages Org cooperates with
-* Conflicts:: Packages that lead to conflicts
-
-
-File: org, Node: Cooperation, Next: Conflicts, Prev: Interaction, Up: Interaction
-
-15.10.1 Packages that Org cooperates with
------------------------------------------
-
-`calc.el' by Dave Gillespie
- Org uses the Calc package for implementing spreadsheet
- functionality in its tables (*note The spreadsheet::). Org checks
- for the availability of Calc by looking for the function
- `calc-eval' which will have been autoloaded during setup if Calc
- has been installed properly. As of Emacs 22, Calc is part of the
- Emacs distribution. Another possibility for interaction between
- the two packages is using Calc for embedded calculations. *Note
- Embedded Mode: (Calc)Embedded Mode.
-
-`constants.el' by Carsten Dominik
- In a table formula (*note The spreadsheet::), it is possible to use
- names for natural constants or units. Instead of defining your own
- constants in the variable `org-table-formula-constants', install
- the `constants' package which defines a large number of constants
- and units, and lets you use unit prefixes like `M' for `Mega',
- etc. You will need version 2.0 of this package, available at
- `http://www.astro.uva.nl/~dominik/Tools'. Org checks for the
- function `constants-get', which has to be autoloaded in your
- setup. See the installation instructions in the file
- `constants.el'.
-
-`cdlatex.el' by Carsten Dominik
- Org-mode can make use of the CDLaTeX package to efficiently enter
- LaTeX fragments into Org files. See *Note CDLaTeX mode::.
-
-`imenu.el' by Ake Stenhoff and Lars Lindberg
- Imenu allows menu access to an index of items in a file. Org-mode
- supports Imenu--all you need to do to get the index is the
- following:
- (add-hook 'org-mode-hook
- (lambda () (imenu-add-to-menubar "Imenu")))
- By default the index is two levels deep--you can modify the depth
- using the option `org-imenu-depth'.
-
-`remember.el' by John Wiegley
- Org used to use this package for capture, but no longer does.
-
-`speedbar.el' by Eric M. Ludlam
- Speedbar is a package that creates a special frame displaying
- files and index items in files. Org-mode supports Speedbar and
- allows you to drill into Org files directly from the Speedbar. It
- also allows you to restrict the scope of agenda commands to a file
- or a subtree by using the command `<' in the Speedbar frame.
-
-`table.el' by Takaaki Ota
- Complex ASCII tables with automatic line wrapping, column- and
- row-spanning, and alignment can be created using the Emacs table
- package by Takaaki Ota (`http://sourceforge.net/projects/table',
- and also part of Emacs 22). Org-mode will recognize these tables
- and export them properly. Because of interference with other
- Org-mode functionality, you unfortunately cannot edit these tables
- directly in the buffer. Instead, you need to use the command `C-c
- '' to edit them, similar to source code snippets.
-
- `C-c ' (`org-edit-special')'
- Edit a `table.el' table. Works when the cursor is in a
- table.el table.
-
- `C-c ~ (`org-table-create-with-table.el')'
- Insert a `table.el' table. If there is already a table at
- point, this command converts it between the `table.el' format
- and the Org-mode format. See the documentation string of the
- command `org-convert-table' for the restrictions under which
- this is possible.
- `table.el' is part of Emacs since Emacs 22.
-
-`footnote.el' by Steven L. Baur
- Org-mode recognizes numerical footnotes as provided by this
- package. However, Org-mode also has its own footnote support
- (*note Footnotes::), which makes using `footnote.el' unnecessary.
-
-
-File: org, Node: Conflicts, Prev: Cooperation, Up: Interaction
-
-15.10.2 Packages that lead to conflicts with Org-mode
------------------------------------------------------
-
- In Emacs 23, `shift-selection-mode' is on by default, meaning that
- cursor motions combined with the shift key should start or enlarge
- regions. This conflicts with the use of `S-<cursor>' commands in
- Org to change timestamps, TODO keywords, priorities, and item
- bullet types if the cursor is at such a location. By default,
- `S-<cursor>' commands outside special contexts don't do anything,
- but you can customize the variable `org-support-shift-select'.
- Org-mode then tries to accommodate shift selection by (i) using it
- outside of the special contexts where special commands apply, and
- by (ii) extending an existing active region even if the cursor
- moves across a special context.
-
-`CUA.el' by Kim. F. Storm
- Key bindings in Org conflict with the `S-<cursor>' keys used by
- CUA mode (as well as `pc-select-mode' and `s-region-mode') to
- select and extend the region. In fact, Emacs 23 has this built-in
- in the form of `shift-selection-mode', see previous paragraph. If
- you are using Emacs 23, you probably don't want to use another
- package for this purpose. However, if you prefer to leave these
- keys to a different package while working in Org-mode, configure
- the variable `org-replace-disputed-keys'. When set, Org will move
- the following key bindings in Org files, and in the agenda buffer
- (but not during date selection).
-
- S-UP -> M-p S-DOWN -> M-n
- S-LEFT -> M-- S-RIGHT -> M-+
- C-S-LEFT -> M-S-- C-S-RIGHT -> M-S-+
-
- Yes, these are unfortunately more difficult to remember. If you
- want to have other replacement keys, look at the variable
- `org-disputed-keys'.
-
-`yasnippet.el'
- The way Org-mode binds the TAB key (binding to `[tab]' instead of
- `"\t"') overrules YASnippet's access to this key. The following
- code fixed this problem:
-
- (add-hook 'org-mode-hook
- (lambda ()
- (org-set-local 'yas/trigger-key [tab])
- (define-key yas/keymap [tab] 'yas/next-field-group)))
-
-`windmove.el' by Hovav Shacham
- This package also uses the `S-<cursor>' keys, so everything written
- in the paragraph above about CUA mode also applies here. If you
- want make the windmove function active in locations where Org-mode
- does not have special functionality on `S-<cursor>', add this to
- your configuration:
-
- ;; Make windmove work in org-mode:
- (add-hook 'org-shiftup-final-hook 'windmove-up)
- (add-hook 'org-shiftleft-final-hook 'windmove-left)
- (add-hook 'org-shiftdown-final-hook 'windmove-down)
- (add-hook 'org-shiftright-final-hook 'windmove-right)
-
-`viper.el' by Michael Kifer
- Viper uses `C-c /' and therefore makes this key not access the
- corresponding Org-mode command `org-sparse-tree'. You need to find
- another key for this command, or override the key in
- `viper-vi-global-user-map' with
-
- (define-key viper-vi-global-user-map "C-c /" 'org-sparse-tree)
-
-
-
-File: org, Node: Hacking, Next: MobileOrg, Prev: Miscellaneous, Up: Top
-
-Appendix A Hacking
-******************
-
-This appendix covers some aspects where users can extend the
-functionality of Org.
-
-* Menu:
-
-* Hooks:: Who to reach into Org's internals
-* Add-on packages:: Available extensions
-* Adding hyperlink types:: New custom link types
-* Context-sensitive commands:: How to add functionality to such commands
-* Tables in arbitrary syntax:: Orgtbl for LaTeX and other programs
-* Dynamic blocks:: Automatically filled blocks
-* Special agenda views:: Customized views
-* Extracting agenda information:: Postprocessing of agenda information
-* Using the property API:: Writing programs that use entry properties
-* Using the mapping API:: Mapping over all or selected entries
-
-
-File: org, Node: Hooks, Next: Add-on packages, Prev: Hacking, Up: Hacking
-
-A.1 Hooks
-=========
-
-Org has a large number of hook variables that can be used to add
-functionality. This appendix about hacking is going to illustrate the
-use of some of them. A complete list of all hooks with documentation is
-maintained by the Worg project and can be found at
-`http://orgmode.org/worg/org-configs/org-hooks.php'.
-
-
-File: org, Node: Add-on packages, Next: Adding hyperlink types, Prev: Hooks, Up: Hacking
-
-A.2 Add-on packages
-===================
-
-A large number of add-on packages have been written by various authors.
-These packages are not part of Emacs, but they are distributed as
-contributed packages with the separate release available at the
-Org-mode home page at `http://orgmode.org'. The list of contributed
-packages, along with documentation about each package, is maintained by
-the Worg project at `http://orgmode.org/worg/org-contrib/'.
-
-
-File: org, Node: Adding hyperlink types, Next: Context-sensitive commands, Prev: Add-on packages, Up: Hacking
-
-A.3 Adding hyperlink types
-==========================
-
-Org has a large number of hyperlink types built-in (*note
-Hyperlinks::). If you would like to add new link types, Org provides
-an interface for doing so. Let's look at an example file,
-`org-man.el', that will add support for creating links like
-`[[man:printf][The printf manpage]]' to show Unix manual pages inside
-Emacs:
-
- ;;; org-man.el - Support for links to manpages in Org
-
- (require 'org)
-
- (org-add-link-type "man" 'org-man-open)
- (add-hook 'org-store-link-functions 'org-man-store-link)
-
- (defcustom org-man-command 'man
- "The Emacs command to be used to display a man page."
- :group 'org-link
- :type '(choice (const man) (const woman)))
-
- (defun org-man-open (path)
- "Visit the manpage on PATH.
- PATH should be a topic that can be thrown at the man command."
- (funcall org-man-command path))
-
- (defun org-man-store-link ()
- "Store a link to a manpage."
- (when (memq major-mode '(Man-mode woman-mode))
- ;; This is a man page, we do make this link
- (let* ((page (org-man-get-page-name))
- (link (concat "man:" page))
- (description (format "Manpage for %s" page)))
- (org-store-link-props
- :type "man"
- :link link
- :description description))))
-
- (defun org-man-get-page-name ()
- "Extract the page name from the buffer name."
- ;; This works for both `Man-mode' and `woman-mode'.
- (if (string-match " \\(\\S-+\\)\\*" (buffer-name))
- (match-string 1 (buffer-name))
- (error "Cannot create link to this man page")))
-
- (provide 'org-man)
-
- ;;; org-man.el ends here
-
-You would activate this new link type in `.emacs' with
-
- (require 'org-man)
-
-Let's go through the file and see what it does.
- 1. It does `(require 'org)' to make sure that `org.el' has been
- loaded.
-
- 2. The next line calls `org-add-link-type' to define a new link type
- with prefix `man'. The call also contains the name of a function
- that will be called to follow such a link.
-
- 3. The next line adds a function to `org-store-link-functions', in
- order to allow the command `C-c l' to record a useful link in a
- buffer displaying a man page.
-
- The rest of the file defines the necessary variables and functions.
-First there is a customization variable that determines which Emacs
-command should be used to display man pages. There are two options,
-`man' and `woman'. Then the function to follow a link is defined. It
-gets the link path as an argument--in this case the link path is just a
-topic for the manual command. The function calls the value of
-`org-man-command' to display the man page.
-
- Finally the function `org-man-store-link' is defined. When you try
-to store a link with `C-c l', this function will be called to try to
-make a link. The function must first decide if it is supposed to
-create the link for this buffer type; we do this by checking the value
-of the variable `major-mode'. If not, the function must exit and
-return the value `nil'. If yes, the link is created by getting the
-manual topic from the buffer name and prefixing it with the string
-`man:'. Then it must call the command `org-store-link-props' and set
-the `:type' and `:link' properties. Optionally you can also set the
-`:description' property to provide a default for the link description
-when the link is later inserted into an Org buffer with `C-c C-l'.
-
- When it makes sense for your new link type, you may also define a
-function `org-PREFIX-complete-link' that implements special (e.g.
-completion) support for inserting such a link with `C-c C-l'. Such a
-function should not accept any arguments, and return the full link with
-prefix.
-
-
-File: org, Node: Context-sensitive commands, Next: Tables in arbitrary syntax, Prev: Adding hyperlink types, Up: Hacking
-
-A.4 Context-sensitive commands
-==============================
-
-Org has several commands that act differently depending on context.
-The most important example it the `C-c C-c' (*note The very busy C-c
-C-c key::). Also the `M-cursor' and `M-S-cursor' keys have this
-property.
-
- Add-ons can tap into this functionality by providing a function that
-detects special context for that add-on and executes functionality
-appropriate for the context. Here is an example from Dan Davison's
-`org-R.el' which allows you to evaluate commands based on the `R'
-programming language (1). For this package, special contexts are lines
-that start with `#+R:' or `#+RR:'.
-
- (defun org-R-apply-maybe ()
- "Detect if this is context for org-R and execute R commands."
- (if (save-excursion
- (beginning-of-line 1)
- (looking-at "#\\+RR?:"))
- (progn (call-interactively 'org-R-apply)
- t) ;; to signal that we took action
- nil)) ;; to signal that we did not
-
- (add-hook 'org-ctrl-c-ctrl-c-hook 'org-R-apply-maybe)
-
- The function first checks if the cursor is in such a line. If that
-is the case, `org-R-apply' is called and the function returns `t' to
-signal that action was taken, and `C-c C-c' will stop looking for other
-contexts. If the function finds it should do nothing locally, it
-returns `nil' so that other, similar functions can have a try.
-
- ---------- Footnotes ----------
-
- (1) `org-R.el' has been replaced by the org-mode functionality
-described in *Note Working With Source Code:: and is now obsolete.
-
-
-File: org, Node: Tables in arbitrary syntax, Next: Dynamic blocks, Prev: Context-sensitive commands, Up: Hacking
-
-A.5 Tables and lists in arbitrary syntax
-========================================
-
-Since Orgtbl mode can be used as a minor mode in arbitrary buffers, a
-frequent feature request has been to make it work with native tables in
-specific languages, for example LaTeX. However, this is extremely hard
-to do in a general way, would lead to a customization nightmare, and
-would take away much of the simplicity of the Orgtbl-mode table editor.
-
- This appendix describes a different approach. We keep the Orgtbl
-mode table in its native format (the source table), and use a custom
-function to translate the table to the correct syntax, and to install
-it in the right location (the target table). This puts the burden of
-writing conversion functions on the user, but it allows for a very
-flexible system.
-
- Bastien added the ability to do the same with lists, in Orgstruct
-mode. You can use Org's facilities to edit and structure lists by
-turning `orgstruct-mode' on, then locally exporting such lists in
-another format (HTML, LaTeX or Texinfo.)
-
-* Menu:
-
-* Radio tables:: Sending and receiving radio tables
-* A LaTeX example:: Step by step, almost a tutorial
-* Translator functions:: Copy and modify
-* Radio lists:: Doing the same for lists
-
-
-File: org, Node: Radio tables, Next: A LaTeX example, Prev: Tables in arbitrary syntax, Up: Tables in arbitrary syntax
-
-A.5.1 Radio tables
-------------------
-
-To define the location of the target table, you first need to create two
-lines that are comments in the current mode, but contain magic words for
-Orgtbl mode to find. Orgtbl mode will insert the translated table
-between these lines, replacing whatever was there before. For example:
-
- /* BEGIN RECEIVE ORGTBL table_name */
- /* END RECEIVE ORGTBL table_name */
-
-Just above the source table, we put a special line that tells Orgtbl
-mode how to translate this table and where to install it. For example:
- #+ORGTBL: SEND table_name translation_function arguments....
-
-`table_name' is the reference name for the table that is also used in
-the receiver lines. `translation_function' is the Lisp function that
-does the translation. Furthermore, the line can contain a list of
-arguments (alternating key and value) at the end. The arguments will be
-passed as a property list to the translation function for
-interpretation. A few standard parameters are already recognized and
-acted upon before the translation function is called:
-
-`:skip N'
- Skip the first N lines of the table. Hlines do count as separate
- lines for this parameter!
-
-`:skipcols (n1 n2 ...)'
- List of columns that should be skipped. If the table has a column
- with calculation marks, that column is automatically discarded as
- well. Please note that the translator function sees the table
- _after_ the removal of these columns, the function never knows
- that there have been additional columns.
-
-The one problem remaining is how to keep the source table in the buffer
-without disturbing the normal workings of the file, for example during
-compilation of a C file or processing of a LaTeX file. There are a
-number of different solutions:
-
- * The table could be placed in a block comment if that is supported
- by the language. For example, in C mode you could wrap the table
- between `/*' and `*/' lines.
-
- * Sometimes it is possible to put the table after some kind of END
- statement, for example `\bye' in TeX and `\end{document}' in LaTeX.
-
- * You can just comment the table line-by-line whenever you want to
- process the file, and uncomment it whenever you need to edit the
- table. This only sounds tedious--the command `M-x
- orgtbl-toggle-comment' makes this comment-toggling very easy, in
- particular if you bind it to a key.
-
-
-File: org, Node: A LaTeX example, Next: Translator functions, Prev: Radio tables, Up: Tables in arbitrary syntax
-
-A.5.2 A LaTeX example of radio tables
--------------------------------------
-
-The best way to wrap the source table in LaTeX is to use the `comment'
-environment provided by `comment.sty'. It has to be activated by
-placing `\usepackage{comment}' into the document header. Orgtbl mode
-can insert a radio table skeleton(1) with the command `M-x
-orgtbl-insert-radio-table'. You will be prompted for a table name,
-let's say we use `salesfigures'. You will then get the following
-template:
-
- % BEGIN RECEIVE ORGTBL salesfigures
- % END RECEIVE ORGTBL salesfigures
- \begin{comment}
- #+ORGTBL: SEND salesfigures orgtbl-to-latex
- | | |
- \end{comment}
-
-The `#+ORGTBL: SEND' line tells Orgtbl mode to use the function
-`orgtbl-to-latex' to convert the table into LaTeX and to put it into
-the receiver location with name `salesfigures'. You may now fill in
-the table--feel free to use the spreadsheet features(2):
-
- % BEGIN RECEIVE ORGTBL salesfigures
- % END RECEIVE ORGTBL salesfigures
- \begin{comment}
- #+ORGTBL: SEND salesfigures orgtbl-to-latex
- | Month | Days | Nr sold | per day |
- |-------+------+---------+---------|
- | Jan | 23 | 55 | 2.4 |
- | Feb | 21 | 16 | 0.8 |
- | March | 22 | 278 | 12.6 |
- #+TBLFM: $4=$3/$2;%.1f
- % $ (optional extra dollar to keep font-lock happy, see footnote)
- \end{comment}
-
-When you are done, press `C-c C-c' in the table to get the converted
-table inserted between the two marker lines.
-
- Now let's assume you want to make the table header by hand, because
-you want to control how columns are aligned, etc. In this case we make
-sure that the table translator skips the first 2 lines of the source
-table, and tell the command to work as a splice, i.e. to not produce
-header and footer commands of the target table:
-
- \begin{tabular}{lrrr}
- Month & \multicolumn{1}{c}{Days} & Nr.\ sold & per day\\
- % BEGIN RECEIVE ORGTBL salesfigures
- % END RECEIVE ORGTBL salesfigures
- \end{tabular}
- %
- \begin{comment}
- #+ORGTBL: SEND salesfigures orgtbl-to-latex :splice t :skip 2
- | Month | Days | Nr sold | per day |
- |-------+------+---------+---------|
- | Jan | 23 | 55 | 2.4 |
- | Feb | 21 | 16 | 0.8 |
- | March | 22 | 278 | 12.6 |
- #+TBLFM: $4=$3/$2;%.1f
- \end{comment}
-
- The LaTeX translator function `orgtbl-to-latex' is already part of
-Orgtbl mode. It uses a `tabular' environment to typeset the table and
-marks horizontal lines with `\hline'. Furthermore, it interprets the
-following parameters (see also *note Translator functions::):
-
-`:splice nil/t'
- When set to t, return only table body lines, don't wrap them into a
- tabular environment. Default is nil.
-
-`:fmt fmt'
- A format to be used to wrap each field, it should contain `%s' for
- the original field value. For example, to wrap each field value
- in dollars, you could use `:fmt "$%s$"'. This may also be a
- property list with column numbers and formats. for example `:fmt
- (2 "$%s$" 4 "%s\\%%")'. A function of one argument can be used in
- place of the strings; the function must return a formatted string.
-
-`:efmt efmt'
- Use this format to print numbers with exponentials. The format
- should have `%s' twice for inserting mantissa and exponent, for
- example `"%s\\times10^{%s}"'. The default is `"%s\\,(%s)"'. This
- may also be a property list with column numbers and formats, for
- example `:efmt (2 "$%s\\times10^{%s}$" 4 "$%s\\cdot10^{%s}$")'.
- After `efmt' has been applied to a value, `fmt' will also be
- applied. Similar to `fmt', functions of two arguments can be
- supplied instead of strings.
-
- ---------- Footnotes ----------
-
- (1) By default this works only for LaTeX, HTML, and Texinfo.
-Configure the variable `orgtbl-radio-tables' to install templates for
-other modes.
-
- (2) If the `#+TBLFM' line contains an odd number of dollar
-characters, this may cause problems with font-lock in LaTeX mode. As
-shown in the example you can fix this by adding an extra line inside the
-`comment' environment that is used to balance the dollar expressions.
-If you are using AUCTeX with the font-latex library, a much better
-solution is to add the `comment' environment to the variable
-`LaTeX-verbatim-environments'.
-
-
-File: org, Node: Translator functions, Next: Radio lists, Prev: A LaTeX example, Up: Tables in arbitrary syntax
-
-A.5.3 Translator functions
---------------------------
-
-Orgtbl mode has several translator functions built-in: `orgtbl-to-csv'
-(comma-separated values), `orgtbl-to-tsv' (TAB-separated values)
-`orgtbl-to-latex', `orgtbl-to-html', and `orgtbl-to-texinfo'. Except
-for `orgtbl-to-html'(1), these all use a generic translator,
-`orgtbl-to-generic'. For example, `orgtbl-to-latex' itself is a very
-short function that computes the column definitions for the `tabular'
-environment, defines a few field and line separators and then hands
-processing over to the generic translator. Here is the entire code:
-
- (defun orgtbl-to-latex (table params)
- "Convert the Orgtbl mode TABLE to LaTeX."
- (let* ((alignment (mapconcat (lambda (x) (if x "r" "l"))
- org-table-last-alignment ""))
- (params2
- (list
- :tstart (concat "\\begin{tabular}{" alignment "}")
- :tend "\\end{tabular}"
- :lstart "" :lend " \\\\" :sep " & "
- :efmt "%s\\,(%s)" :hline "\\hline")))
- (orgtbl-to-generic table (org-combine-plists params2 params))))
-
- As you can see, the properties passed into the function (variable
-PARAMS) are combined with the ones newly defined in the function
-(variable PARAMS2). The ones passed into the function (i.e. the ones
-set by the `ORGTBL SEND' line) take precedence. So if you would like
-to use the LaTeX translator, but wanted the line endings to be
-`\\[2mm]' instead of the default `\\', you could just overrule the
-default with
-
- #+ORGTBL: SEND test orgtbl-to-latex :lend " \\\\[2mm]"
-
- For a new language, you can either write your own converter function
-in analogy with the LaTeX translator, or you can use the generic
-function directly. For example, if you have a language where a table
-is started with `!BTBL!', ended with `!ETBL!', and where table lines are
-started with `!BL!', ended with `!EL!', and where the field separator
-is a TAB, you could call the generic translator like this (on a single
-line!):
-
- #+ORGTBL: SEND test orgtbl-to-generic :tstart "!BTBL!" :tend "!ETBL!"
- :lstart "!BL! " :lend " !EL!" :sep "\t"
-
-Please check the documentation string of the function
-`orgtbl-to-generic' for a full list of parameters understood by that
-function, and remember that you can pass each of them into
-`orgtbl-to-latex', `orgtbl-to-texinfo', and any other function using
-the generic function.
-
- Of course you can also write a completely new function doing
-complicated things the generic translator cannot do. A translator
-function takes two arguments. The first argument is the table, a list
-of lines, each line either the symbol `hline' or a list of fields. The
-second argument is the property list containing all parameters
-specified in the `#+ORGTBL: SEND' line. The function must return a
-single string containing the formatted table. If you write a generally
-useful translator, please post it on <emacs-orgmode@gnu.org> so that
-others can benefit from your work.
-
- ---------- Footnotes ----------
-
- (1) The HTML translator uses the same code that produces tables
-during HTML export.
-
-
-File: org, Node: Radio lists, Prev: Translator functions, Up: Tables in arbitrary syntax
-
-A.5.4 Radio lists
------------------
-
-Sending and receiving radio lists works exactly the same way as sending
-and receiving radio tables (*note Radio tables::). As for radio
-tables, you can insert radio list templates in HTML, LaTeX and Texinfo
-modes by calling `org-list-insert-radio-list'.
-
- Here are the differences with radio tables:
-
- - Orgstruct mode must be active.
-
- - Use the `ORGLST' keyword instead of `ORGTBL'.
-
- - The available translation functions for radio lists don't take
- parameters.
-
- - `C-c C-c' will work when pressed on the first item of the list.
-
- Here is a LaTeX example. Let's say that you have this in your LaTeX
-file:
-
- % BEGIN RECEIVE ORGLST to-buy
- % END RECEIVE ORGLST to-buy
- \begin{comment}
- #+ORGLST: SEND to-buy org-list-to-latex
- - a new house
- - a new computer
- + a new keyboard
- + a new mouse
- - a new life
- \end{comment}
-
- Pressing `C-c C-c' on `a new house' and will insert the converted
-LaTeX list between the two marker lines.
-
-
-File: org, Node: Dynamic blocks, Next: Special agenda views, Prev: Tables in arbitrary syntax, Up: Hacking
-
-A.6 Dynamic blocks
-==================
-
-Org documents can contain _dynamic blocks_. These are specially marked
-regions that are updated by some user-written function. A good example
-for such a block is the clock table inserted by the command `C-c C-x
-C-r' (*note Clocking work time::).
-
- Dynamic blocks are enclosed by a BEGIN-END structure that assigns a
-name to the block and can also specify parameters for the function
-producing the content of the block.
-
- #+BEGIN: myblock :parameter1 value1 :parameter2 value2 ...
-
- #+END:
-
- Dynamic blocks are updated with the following commands
-
-`C-c C-x C-u (`org-dblock-update')'
- Update dynamic block at point.
-
-`C-u C-c C-x C-u'
- Update all dynamic blocks in the current file.
-
- Updating a dynamic block means to remove all the text between BEGIN
-and END, parse the BEGIN line for parameters and then call the specific
-writer function for this block to insert the new content. If you want
-to use the original content in the writer function, you can use the
-extra parameter `:content'.
-
- For a block with name `myblock', the writer function is
-`org-dblock-write:myblock' with as only parameter a property list with
-the parameters given in the begin line. Here is a trivial example of a
-block that keeps track of when the block update function was last run:
-
- #+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
-
- #+END:
-
-The corresponding block writer function could look like this:
-
- (defun org-dblock-write:block-update-time (params)
- (let ((fmt (or (plist-get params :format) "%d. %m. %Y")))
- (insert "Last block update at: "
- (format-time-string fmt (current-time)))))
-
- If you want to make sure that all dynamic blocks are always
-up-to-date, you could add the function `org-update-all-dblocks' to a
-hook, for example `before-save-hook'. `org-update-all-dblocks' is
-written in a way such that it does nothing in buffers that are not in
-`org-mode'.
-
-
-File: org, Node: Special agenda views, Next: Extracting agenda information, Prev: Dynamic blocks, Up: Hacking
-
-A.7 Special agenda views
-========================
-
-Org provides a special hook that can be used to narrow down the
-selection made by these agenda views: `todo', `alltodo', `tags',
-`tags-todo', `tags-tree'. You may specify a function that is used at
-each match to verify if the match should indeed be part of the agenda
-view, and if not, how much should be skipped.
-
- Let's say you want to produce a list of projects that contain a
-WAITING tag anywhere in the project tree. Let's further assume that
-you have marked all tree headings that define a project with the TODO
-keyword PROJECT. In this case you would run a TODO search for the
-keyword PROJECT, but skip the match unless there is a WAITING tag
-anywhere in the subtree belonging to the project line.
-
- To achieve this, you must write a function that searches the subtree
-for the tag. If the tag is found, the function must return `nil' to
-indicate that this match should not be skipped. If there is no such
-tag, return the location of the end of the subtree, to indicate that
-search should continue from there.
-
- (defun my-skip-unless-waiting ()
- "Skip trees that are not waiting"
- (let ((subtree-end (save-excursion (org-end-of-subtree t))))
- (if (re-search-forward ":waiting:" subtree-end t)
- nil ; tag found, do not skip
- subtree-end))) ; tag not found, continue after end of subtree
-
- Now you may use this function in an agenda custom command, for
-example like this:
-
- (org-add-agenda-custom-command
- '("b" todo "PROJECT"
- ((org-agenda-skip-function 'my-skip-unless-waiting)
- (org-agenda-overriding-header "Projects waiting for something: "))))
-
- Note that this also binds `org-agenda-overriding-header' to get a
-meaningful header in the agenda view.
-
- A general way to create custom searches is to base them on a search
-for entries with a certain level limit. If you want to study all
-entries with your custom search function, simply do a search for
-`LEVEL>0'(1), and then use `org-agenda-skip-function' to select the
-entries you really want to have.
-
- You may also put a Lisp form into `org-agenda-skip-function'. In
-particular, you may use the functions `org-agenda-skip-entry-if' and
-`org-agenda-skip-subtree-if' in this form, for example:
-
-`'(org-agenda-skip-entry-if 'scheduled)'
- Skip current entry if it has been scheduled.
-
-`'(org-agenda-skip-entry-if 'notscheduled)'
- Skip current entry if it has not been scheduled.
-
-`'(org-agenda-skip-entry-if 'deadline)'
- Skip current entry if it has a deadline.
-
-`'(org-agenda-skip-entry-if 'scheduled 'deadline)'
- Skip current entry if it has a deadline, or if it is scheduled.
-
-`'(org-agenda-skip-entry-if 'todo '("TODO" "WAITING"))'
- Skip current entry if the TODO keyword is TODO or WAITING.
-
-`'(org-agenda-skip-entry-if 'todo 'done)'
- Skip current entry if the TODO keyword marks a DONE state.
-
-`'(org-agenda-skip-entry-if 'timestamp)'
- Skip current entry if it has any timestamp, may also be deadline
- or scheduled.
-
-`'(org-agenda-skip-entry 'regexp "regular expression")'
- Skip current entry if the regular expression matches in the entry.
-
-`'(org-agenda-skip-entry 'notregexp "regular expression")'
- Skip current entry unless the regular expression matches.
-
-`'(org-agenda-skip-subtree-if 'regexp "regular expression")'
- Same as above, but check and skip the entire subtree.
-
- Therefore we could also have written the search for WAITING projects
-like this, even without defining a special function:
-
- (org-add-agenda-custom-command
- '("b" todo "PROJECT"
- ((org-agenda-skip-function '(org-agenda-skip-subtree-if
- 'regexp ":waiting:"))
- (org-agenda-overriding-header "Projects waiting for something: "))))
-
- ---------- Footnotes ----------
-
- (1) Note that, when using `org-odd-levels-only', a level number
-corresponds to order in the hierarchy, not to the number of stars.
-
-
-File: org, Node: Extracting agenda information, Next: Using the property API, Prev: Special agenda views, Up: Hacking
-
-A.8 Extracting agenda information
-=================================
-
-Org provides commands to access agenda information for the command line
-in Emacs batch mode. This extracted information can be sent directly
-to a printer, or it can be read by a program that does further
-processing of the data. The first of these commands is the function
-`org-batch-agenda', that produces an agenda view and sends it as ASCII
-text to STDOUT. The command takes a single string as parameter. If
-the string has length 1, it is used as a key to one of the commands you
-have configured in `org-agenda-custom-commands', basically any key you
-can use after `C-c a'. For example, to directly print the current TODO
-list, you could use
-
- emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr
-
- If the parameter is a string with 2 or more characters, it is used
-as a tags/TODO match string. For example, to print your local shopping
-list (all items with the tag `shop', but excluding the tag `NewYork'),
-you could use
-
- emacs -batch -l ~/.emacs \
- -eval '(org-batch-agenda "+shop-NewYork")' | lpr
-
-You may also modify parameters on the fly like this:
-
- emacs -batch -l ~/.emacs \
- -eval '(org-batch-agenda "a" \
- org-agenda-span month \
- org-agenda-include-diary nil \
- org-agenda-files (quote ("~/org/project.org")))' \
- | lpr
-
-which will produce a 30-day agenda, fully restricted to the Org file
-`~/org/projects.org', not even including the diary.
-
- If you want to process the agenda data in more sophisticated ways,
-you can use the command `org-batch-agenda-csv' to get a comma-separated
-list of values for each agenda item. Each line in the output will
-contain a number of fields separated by commas. The fields in a line
-are:
-
- category The category of the item
- head The headline, without TODO keyword, TAGS and PRIORITY
- type The type of the agenda entry, can be
- todo selected in TODO match
- tagsmatch selected in tags match
- diary imported from diary
- deadline a deadline
- scheduled scheduled
- timestamp appointment, selected by timestamp
- closed entry was closed on date
- upcoming-deadline warning about nearing deadline
- past-scheduled forwarded scheduled item
- block entry has date block including date
- todo The TODO keyword, if any
- tags All tags including inherited ones, separated by colons
- date The relevant date, like 2007-2-14
- time The time, like 15:00-16:50
- extra String with extra planning info
- priority-l The priority letter if any was given
- priority-n The computed numerical priority
-
-Time and date will only be given if a timestamp (or deadline/scheduled)
-led to the selection of the item.
-
- A CSV list like this is very easy to use in a post-processing script.
-For example, here is a Perl program that gets the TODO list from
-Emacs/Org and prints all the items, preceded by a checkbox:
-
- #!/usr/bin/perl
-
- # define the Emacs command to run
- $cmd = "emacs -batch -l ~/.emacs -eval '(org-batch-agenda-csv \"t\")'";
-
- # run it and capture the output
- $agenda = qx{$cmd 2>/dev/null};
-
- # loop over all lines
- foreach $line (split(/\n/,$agenda)) {
- # get the individual values
- ($category,$head,$type,$todo,$tags,$date,$time,$extra,
- $priority_l,$priority_n) = split(/,/,$line);
- # process and print
- print "[ ] $head\n";
- }
-
-
-File: org, Node: Using the property API, Next: Using the mapping API, Prev: Extracting agenda information, Up: Hacking
-
-A.9 Using the property API
-==========================
-
-Here is a description of the functions that can be used to work with
-properties.
-
- -- Function: org-entry-properties &optional pom which
- Get all properties of the entry at point-or-marker POM.
- This includes the TODO keyword, the tags, time strings for
- deadline, scheduled, and clocking, and any additional properties
- defined in the entry. The return value is an alist. Keys may
- occur multiple times if the property key was used several times.
- POM may also be nil, in which case the current entry is used. If
- WHICH is nil or `all', get all properties. If WHICH is `special'
- or `standard', only get that subclass.
-
- -- Function: org-entry-get pom property &optional inherit
- Get value of PROPERTY for entry at point-or-marker POM. By
- default, this only looks at properties defined locally in the
- entry. If INHERIT is non-nil and the entry does not have the
- property, then also check higher levels of the hierarchy. If
- INHERIT is the symbol `selective', use inheritance if and only if
- the setting of `org-use-property-inheritance' selects PROPERTY for
- inheritance.
-
- -- Function: org-entry-delete pom property
- Delete the property PROPERTY from entry at point-or-marker POM.
-
- -- Function: org-entry-put pom property value
- Set PROPERTY to VALUE for entry at point-or-marker POM.
-
- -- Function: org-buffer-property-keys &optional include-specials
- Get all property keys in the current buffer.
-
- -- Function: org-insert-property-drawer
- Insert a property drawer at point.
-
- -- Function: org-entry-put-multivalued-property pom property &rest
- values
- Set PROPERTY at point-or-marker POM to VALUES. VALUES should be a
- list of strings. They will be concatenated, with spaces as
- separators.
-
- -- Function: org-entry-get-multivalued-property pom property
- Treat the value of the property PROPERTY as a whitespace-separated
- list of values and return the values as a list of strings.
-
- -- Function: org-entry-add-to-multivalued-property pom property value
- Treat the value of the property PROPERTY as a whitespace-separated
- list of values and make sure that VALUE is in this list.
-
- -- Function: org-entry-remove-from-multivalued-property pom property
- value
- Treat the value of the property PROPERTY as a whitespace-separated
- list of values and make sure that VALUE is _not_ in this list.
-
- -- Function: org-entry-member-in-multivalued-property pom property
- value
- Treat the value of the property PROPERTY as a whitespace-separated
- list of values and check if VALUE is in this list.
-
- -- User Option: org-property-allowed-value-functions
- Hook for functions supplying allowed values for a specific
- property. The functions must take a single argument, the name of
- the property, and return a flat list of allowed values. If `:ETC'
- is one of the values, use the values as completion help, but allow
- also other values to be entered. The functions must return `nil'
- if they are not responsible for this property.
-
-
-File: org, Node: Using the mapping API, Prev: Using the property API, Up: Hacking
-
-A.10 Using the mapping API
-==========================
-
-Org has sophisticated mapping capabilities to find all entries
-satisfying certain criteria. Internally, this functionality is used to
-produce agenda views, but there is also an API that can be used to
-execute arbitrary functions for each or selected entries. The main
-entry point for this API is:
-
- -- Function: org-map-entries func &optional match scope &rest skip
- Call FUNC at each headline selected by MATCH in SCOPE.
-
- FUNC is a function or a Lisp form. The function will be called
- without arguments, with the cursor positioned at the beginning of
- the headline. The return values of all calls to the function will
- be collected and returned as a list.
-
- The call to FUNC will be wrapped into a save-excursion form, so
- FUNC does not need to preserve point. After evaluation, the
- cursor will be moved to the end of the line (presumably of the
- headline of the processed entry) and search continues from there.
- Under some circumstances, this may not produce the wanted results.
- For example, if you have removed (e.g. archived) the current
- (sub)tree it could mean that the next entry will be skipped
- entirely. In such cases, you can specify the position from where
- search should continue by making FUNC set the variable
- `org-map-continue-from' to the desired buffer position.
-
- MATCH is a tags/property/todo match as it is used in the agenda
- match view. Only headlines that are matched by this query will be
- considered during the iteration. When MATCH is nil or t, all
- headlines will be visited by the iteration.
-
- SCOPE determines the scope of this command. It can be any of:
-
- nil the current buffer, respecting the restriction if any
- tree the subtree started with the entry at point
- file the current buffer, without restriction
- file-with-archives
- the current buffer, and any archives associated with it
- agenda all agenda files
- agenda-with-archives
- all agenda files with any archive files associated with them
- (file1 file2 ...)
- if this is a list, all files in the list will be scanned
- The remaining args are treated as settings for the skipping
- facilities of the scanner. The following items can be given here:
-
- archive skip trees with the archive tag
- comment skip trees with the COMMENT keyword
- function or Lisp form
- will be used as value for `org-agenda-skip-function',
- so whenever the function returns t, FUNC
- will not be called for that entry and search will
- continue from the point where the function leaves it
-
- The function given to that mapping routine can really do anything
-you like. It can use the property API (*note Using the property API::)
-to gather more information about the entry, or in order to change
-metadata in the entry. Here are a couple of functions that might be
-handy:
-
- -- Function: org-todo &optional arg
- Change the TODO state of the entry. See the docstring of the
- functions for the many possible values for the argument ARG.
-
- -- Function: org-priority &optional action
- Change the priority of the entry. See the docstring of this
- function for the possible values for ACTION.
-
- -- Function: org-toggle-tag tag &optional onoff
- Toggle the tag TAG in the current entry. Setting ONOFF to either
- `on' or `off' will not toggle tag, but ensure that it is either on
- or off.
-
- -- Function: org-promote
- Promote the current entry.
-
- -- Function: org-demote
- Demote the current entry.
-
- Here is a simple example that will turn all entries in the current
-file with a tag `TOMORROW' into TODO entries with the keyword
-`UPCOMING'. Entries in comment trees and in archive trees will be
-ignored.
-
- (org-map-entries
- '(org-todo "UPCOMING")
- "+TOMORROW" 'file 'archive 'comment)
-
- The following example counts the number of entries with TODO keyword
-`WAITING', in all agenda files.
-
- (length (org-map-entries t "/+WAITING" 'agenda))
-
-
-File: org, Node: MobileOrg, Next: History and Acknowledgments, Prev: Hacking, Up: Top
-
-Appendix B MobileOrg
-********************
-
-MobileOrg (http://mobileorg.ncogni.to/) is an application for the
-iPhone/iPod Touch series of devices, developed by Richard Moreland.
-MobileOrg offers offline viewing and capture support for an Org-mode
-system rooted on a "real" computer. It does also allow you to record
-changes to existing entries. Android users should check out MobileOrg
-Android (http://wiki.github.com/matburt/mobileorg-android/) by Matt
-Jones.
-
- This appendix describes the support Org has for creating agenda
-views in a format that can be displayed by MobileOrg, and for
-integrating notes captured and changes made by MobileOrg into the main
-system.
-
- For changing tags and TODO states in MobileOrg, you should have set
-up the customization variables `org-todo-keywords' and `org-tags-alist'
-to cover all important tags and TODO keywords, even if individual files
-use only part of these. MobileOrg will also offer you states and tags
-set up with in-buffer settings, but it will understand the logistics of
-TODO state sets (*note Per-file keywords::) and mutually exclusive tags
-(*note Setting tags::) only for those set in these variables.
-
-* Menu:
-
-* Setting up the staging area:: Where to interact with the mobile device
-* Pushing to MobileOrg:: Uploading Org files and agendas
-* Pulling from MobileOrg:: Integrating captured and flagged items
-
-
-File: org, Node: Setting up the staging area, Next: Pushing to MobileOrg, Prev: MobileOrg, Up: MobileOrg
-
-B.1 Setting up the staging area
-===============================
-
-MobileOrg needs to interact with Emacs through a directory on a server.
-If you are using a public server, you should consider to encrypt the
-files that are uploaded to the server. This can be done with Org-mode
-7.02 and with MobileOrg 1.5 (iPhone version), and you need an `openssl'
-installation on your system. To turn on encryption, set a password in
-MobileOrg and, on the Emacs side, configure the variable
-`org-mobile-use-encryption'(1).
-
- The easiest way to create that directory is to use a free
-Dropbox.com (http://dropbox.com) account(2). When MobileOrg first
-connects to your Dropbox, it will create a directory MobileOrg inside
-the Dropbox. After the directory has been created, tell Emacs about it:
-
- (setq org-mobile-directory "~/Dropbox/MobileOrg")
-
- Org-mode has commands to put files for MobileOrg into that directory,
-and to read captured notes from there.
-
- ---------- Footnotes ----------
-
- (1) If you can safely store the password in your Emacs setup, you
-might also want to configure `org-mobile-encryption-password'. Please
-read the docstring of that variable. Note that encryption will apply
-only to the contents of the `.org' files. The file names themselves
-will remain visible.
-
- (2) If you cannot use Dropbox, or if your version of MobileOrg does
-not support it, you can use a webdav server. For more information,
-check out the documentation of MobileOrg and also this FAQ entry
-(http://orgmode.org/worg/org-faq.php#mobileorg_webdav).
-
-
-File: org, Node: Pushing to MobileOrg, Next: Pulling from MobileOrg, Prev: Setting up the staging area, Up: MobileOrg
-
-B.2 Pushing to MobileOrg
-========================
-
-This operation copies all files currently listed in `org-mobile-files'
-to the directory `org-mobile-directory'. By default this list contains
-all agenda files (as listed in `org-agenda-files'), but additional files
-can be included by customizing `org-mobiles-files'. File names will be
-staged with paths relative to `org-directory', so all files should be
-inside this directory. The push operation also creates a special Org
-file `agendas.org' with all custom agenda view defined by the user(1).
-Finally, Org writes the file `index.org', containing links to all other
-files. MobileOrg first reads this file from the server, and then
-downloads all agendas and Org files listed in it. To speed up the
-download, MobileOrg will only read files whose checksums(2) have
-changed.
-
- ---------- Footnotes ----------
-
- (1) While creating the agendas, Org-mode will force ID properties on
-all referenced entries, so that these entries can be uniquely identified
-if MobileOrg flags them for further action. If you do not want to get
-these properties in so many entries, you can set the variable
-`org-mobile-force-id-on-agenda-items' to `nil'. Org mode will then
-rely on outline paths, in the hope that these will be unique enough.
-
- (2) stored automatically in the file `checksums.dat'
-
-
-File: org, Node: Pulling from MobileOrg, Prev: Pushing to MobileOrg, Up: MobileOrg
-
-B.3 Pulling from MobileOrg
-==========================
-
-When MobileOrg synchronizes with the server, it not only pulls the Org
-files for viewing. It also appends captured entries and pointers to
-flagged and changed entries to the file `mobileorg.org' on the server.
-Org has a _pull_ operation that integrates this information into an
-inbox file and operates on the pointers to flagged entries. Here is
-how it works:
-
- 1. Org moves all entries found in `mobileorg.org'(1) and appends them
- to the file pointed to by the variable
- `org-mobile-inbox-for-pull'. Each captured entry and each editing
- event will be a top-level entry in the inbox file.
-
- 2. After moving the entries, Org will attempt to implement the
- changes made in MobileOrg. Some changes are applied directly and
- without user interaction. Examples are all changes to tags, TODO
- state, headline and body text that can be cleanly applied.
- Entries that have been flagged for further action will receive a
- tag `:FLAGGED:', so that they can be easily found again. When
- there is a problem finding an entry or applying the change, the
- pointer entry will remain in the inbox and will be marked with an
- error message. You need to later resolve these issues by hand.
-
- 3. Org will then generate an agenda view with all flagged entries.
- The user should then go through these entries and do whatever
- actions are necessary. If a note has been stored while flagging
- an entry in MobileOrg, that note will be displayed in the echo
- area when the cursor is on the corresponding agenda line.
- `?'
- Pressing `?' in that special agenda will display the full
- flagging note in another window and also push it onto the
- kill ring. So you could use `? z C-y C-c C-c' to store that
- flagging note as a normal note in the entry. Pressing `?'
- twice in succession will offer to remove the `:FLAGGED:' tag
- along with the recorded flagging note (which is stored in a
- property). In this way you indicate that the intended
- processing for this flagged entry is finished.
-
- If you are not able to process all flagged entries directly, you can
-always return to this agenda view(2) using `C-c a ?'.
-
- ---------- Footnotes ----------
-
- (1) `mobileorg.org' will be empty after this operation.
-
- (2) Note, however, that there is a subtle difference. The view
-created automatically by `M-x org-mobile-pull <RET>' is guaranteed to
-search all files that have been addressed by the last pull. This might
-include a file that is not currently in your list of agenda files. If
-you later use `C-c a ?' to regenerate the view, only the current agenda
-files will be searched.
-
-
-File: org, Node: History and Acknowledgments, Next: Main Index, Prev: MobileOrg, Up: Top
-
-Appendix C History and acknowledgments
-**************************************
-
-Org was born in 2003, out of frustration over the user interface of the
-Emacs Outline mode. I was trying to organize my notes and projects,
-and using Emacs seemed to be the natural way to go. However, having to
-remember eleven different commands with two or three keys per command,
-only to hide and show parts of the outline tree, that seemed entirely
-unacceptable to me. Also, when using outlines to take notes, I
-constantly wanted to restructure the tree, organizing it parallel to my
-thoughts and plans. _Visibility cycling_ and _structure editing_ were
-originally implemented in the package `outline-magic.el', but quickly
-moved to the more general `org.el'. As this environment became
-comfortable for project planning, the next step was adding _TODO
-entries_, basic _timestamps_, and _table support_. These areas
-highlighted the two main goals that Org still has today: to be a new,
-outline-based, plain text mode with innovative and intuitive editing
-features, and to incorporate project planning functionality directly
-into a notes file.
-
- Since the first release, literally thousands of emails to me or to
-<emacs-orgmode@gnu.org> have provided a constant stream of bug reports,
-feedback, new ideas, and sometimes patches and add-on code. Many
-thanks to everyone who has helped to improve this package. I am trying
-to keep here a list of the people who had significant influence in
-shaping one or more aspects of Org. The list may not be complete, if I
-have forgotten someone, please accept my apologies and let me know.
-
- Before I get to this list, a few special mentions are in order:
-
-Bastien Guerry
- Bastien has written a large number of extensions to Org (most of
- them integrated into the core by now), including the LaTeX
- exporter and the plain list parser. His support during the early
- days, when he basically acted as co-maintainer, was central to the
- success of this project. Bastien also invented Worg, helped
- establishing the Web presence of Org, and sponsors hosting costs
- for the orgmode.org website.
-
-Eric Schulte and Dan Davison
- Eric and Dan are jointly responsible for the Org-babel system,
- which turns Org into a multi-language environment for evaluating
- code and doing literate programming and reproducible research.
-
-John Wiegley
- John has contributed a number of great ideas and patches directly
- to Org, including the attachment system (`org-attach.el'),
- integration with Apple Mail (`org-mac-message.el'), hierarchical
- dependencies of TODO items, habit tracking (`org-habits.el'), and
- encryption (`org-crypt.el'). Also, the capture system is really
- an extended copy of his great `remember.el'.
-
-Sebastian Rose
- Without Sebastian, the HTML/XHTML publishing of Org would be the
- pitiful work of an ignorant amateur. Sebastian has pushed this
- part of Org onto a much higher level. He also wrote
- `org-info.js', a Java script for displaying webpages derived from
- Org using an Info-like or a folding interface with single-key
- navigation.
-
-OK, now to the full list of contributions! Again, please let me know
-what I am missing here!
-
- * Russel Adams came up with the idea for drawers.
-
- * Thomas Baumann wrote `org-bbdb.el' and `org-mhe.el'.
-
- * Christophe Bataillon created the great unicorn logo that we use on
- the Org-mode website.
-
- * Alex Bochannek provided a patch for rounding timestamps.
-
- * Jan Böcker wrote `org-docview.el'.
-
- * Brad Bozarth showed how to pull RSS feed data into Org-mode files.
-
- * Tom Breton wrote `org-choose.el'.
-
- * Charles Cave's suggestion sparked the implementation of templates
- for Remember, which are now templates for capture.
-
- * Pavel Chalmoviansky influenced the agenda treatment of items with
- specified time.
-
- * Gregory Chernov patched support for Lisp forms into table
- calculations and improved XEmacs compatibility, in particular by
- porting `nouline.el' to XEmacs.
-
- * Sacha Chua suggested copying some linking code from Planner.
-
- * Baoqiu Cui contributed the DocBook exporter.
-
- * Eddward DeVilla proposed and tested checkbox statistics. He also
- came up with the idea of properties, and that there should be an
- API for them.
-
- * Nick Dokos tracked down several nasty bugs.
-
- * Kees Dullemond used to edit projects lists directly in HTML and so
- inspired some of the early development, including HTML export. He
- also asked for a way to narrow wide table columns.
-
- * Thomas S. Dye contributed documentation on Worg and helped
- integrating the Org-Babel documentation into the manual.
-
- * Christian Egli converted the documentation into Texinfo format,
- inspired the agenda, patched CSS formatting into the HTML
- exporter, and wrote `org-taskjuggler.el'.
-
- * David Emery provided a patch for custom CSS support in exported
- HTML agendas.
-
- * Nic Ferrier contributed mailcap and XOXO support.
-
- * Miguel A. Figueroa-Villanueva implemented hierarchical checkboxes.
-
- * John Foerch figured out how to make incremental search show context
- around a match in a hidden outline tree.
-
- * Raimar Finken wrote `org-git-line.el'.
-
- * Mikael Fornius works as a mailing list moderator.
-
- * Austin Frank works as a mailing list moderator.
-
- * Eric Fraga drove the development of BEAMER export with ideas and
- testing.
-
- * Barry Gidden did proofreading the manual in preparation for the
- book publication through Network Theory Ltd.
-
- * Niels Giesen had the idea to automatically archive DONE trees.
-
- * Nicolas Goaziou rewrote much of the plain list code.
-
- * Kai Grossjohann pointed out key-binding conflicts with other
- packages.
-
- * Brian Gough of Network Theory Ltd publishes the Org mode manual as
- a book.
-
- * Bernt Hansen has driven much of the support for auto-repeating
- tasks, task state change logging, and the clocktable. His clear
- explanations have been critical when we started to adopt the Git
- version control system.
-
- * Manuel Hermenegildo has contributed various ideas, small fixes and
- patches.
-
- * Phil Jackson wrote `org-irc.el'.
-
- * Scott Jaderholm proposed footnotes, control over whitespace between
- folded entries, and column view for properties.
-
- * Matt Jones wrote MobileOrg Android.
-
- * Tokuya Kameshima wrote `org-wl.el' and `org-mew.el'.
-
- * Shidai Liu ("Leo") asked for embedded LaTeX and tested it. He also
- provided frequent feedback and some patches.
-
- * Matt Lundin has proposed last-row references for table formulas
- and named invisible anchors. He has also worked a lot on the FAQ.
-
- * David Maus wrote `org-atom.el', maintains the issues file for Org,
- and is a prolific contributor on the mailing list with competent
- replies, small fixes and patches.
-
- * Jason F. McBrayer suggested agenda export to CSV format.
-
- * Max Mikhanosha came up with the idea of refiling.
-
- * Dmitri Minaev sent a patch to set priority limits on a per-file
- basis.
-
- * Stefan Monnier provided a patch to keep the Emacs-Lisp compiler
- happy.
-
- * Richard Moreland wrote MobileOrg for the iPhone.
-
- * Rick Moynihan proposed allowing multiple TODO sequences in a file
- and being able to quickly restrict the agenda to a subtree.
-
- * Todd Neal provided patches for links to Info files and Elisp forms.
-
- * Greg Newman refreshed the unicorn logo into its current form.
-
- * Tim O'Callaghan suggested in-file links, search options for general
- file links, and TAGS.
-
- * Osamu Okano wrote `orgcard2ref.pl', a Perl program to create a text
- version of the reference card.
-
- * Takeshi Okano translated the manual and David O'Toole's tutorial
- into Japanese.
-
- * Oliver Oppitz suggested multi-state TODO items.
-
- * Scott Otterson sparked the introduction of descriptive text for
- links, among other things.
-
- * Pete Phillips helped during the development of the TAGS feature,
- and provided frequent feedback.
-
- * Martin Pohlack provided the code snippet to bundle character
- insertion into bundles of 20 for undo.
-
- * T.V. Raman reported bugs and suggested improvements.
-
- * Matthias Rempe (Oelde) provided ideas, Windows support, and quality
- control.
-
- * Paul Rivier provided the basic implementation of named footnotes.
- He also acted as mailing list moderator for some time.
-
- * Kevin Rogers contributed code to access VM files on remote hosts.
-
- * Frank Ruell solved the mystery of the `keymapp nil' bug, a
- conflict with `allout.el'.
-
- * Jason Riedy generalized the send-receive mechanism for Orgtbl
- tables with extensive patches.
-
- * Philip Rooke created the Org reference card, provided lots of
- feedback, developed and applied standards to the Org documentation.
-
- * Christian Schlauer proposed angular brackets around links, among
- other things.
-
- * Paul Sexton wrote `org-ctags.el'.
-
- * Linking to VM/BBDB/Gnus was first inspired by Tom Shannon's
- `organizer-mode.el'.
-
- * Ilya Shlyakhter proposed the Archive Sibling, line numbering in
- literal examples, and remote highlighting for referenced code
- lines.
-
- * Stathis Sideris wrote the `ditaa.jar' ASCII to PNG converter that
- is now packaged into Org's `contrib' directory.
-
- * Daniel Sinder came up with the idea of internal archiving by
- locking subtrees.
-
- * Dale Smith proposed link abbreviations.
-
- * James TD Smith has contributed a large number of patches for useful
- tweaks and features.
-
- * Adam Spiers asked for global linking commands, inspired the link
- extension system, added support for mairix, and proposed the
- mapping API.
-
- * Ulf Stegemann created the table to translate special symbols to
- HTML, LaTeX, UTF-8, Latin-1 and ASCII.
-
- * Andy Stewart contributed code to `org-w3m.el', to copy HTML content
- with links transformation to Org syntax.
-
- * David O'Toole wrote `org-publish.el' and drafted the manual
- chapter about publishing.
-
- * Sebastien Vauban reported many issues with LaTeX and BEAMER export
- and enabled source code highlighling in Gnus.
-
- * Stefan Vollmar organized a video-recorded talk at the
- Max-Planck-Institute for Neurology. He also inspired the creation
- of a concept index for HTML export.
-
- * Ju"rgen Vollmer contributed code generating the table of contents
- in HTML output.
-
- * Samuel Wales has provided important feedback and bug reports.
-
- * Chris Wallace provided a patch implementing the `QUOTE' keyword.
-
- * David Wainberg suggested archiving, and improvements to the linking
- system.
-
- * Carsten Wimmer suggested some changes and helped fix a bug in
- linking to Gnus.
-
- * Roland Winkler requested additional key bindings to make Org work
- on a tty.
-
- * Piotr Zielinski wrote `org-mouse.el', proposed agenda blocks and
- contributed various ideas and code snippets.
-
-
-File: org, Node: Main Index, Next: Key Index, Prev: History and Acknowledgments, Up: Top
-
-Concept index
-*************
-
-
-* Menu:
-
-* #+ARCHIVE: Moving subtrees. (line 27)
-* #+ATTR_DOCBOOK: Images in DocBook export.
- (line 30)
-* #+ATTR_HTML <1>: Links in HTML export.
- (line 21)
-* #+ATTR_HTML <2>: Tables in HTML export.
- (line 11)
-* #+ATTR_HTML: Images in HTML export.
- (line 24)
-* #+ATTR_LaTeX <1>: Images in LaTeX export.
- (line 25)
-* #+ATTR_LaTeX: Tables in LaTeX export.
- (line 13)
-* #+AUTHOR: Export options. (line 19)
-* #+BEGIN, clocktable: The clock table. (line 35)
-* #+BEGIN, columnview: Capturing column view.
- (line 11)
-* #+BEGIN:dynamic block: Dynamic blocks. (line 15)
-* #+BEGIN_CENTER: Paragraphs. (line 31)
-* #+BEGIN_COMMENT: Comment lines. (line 6)
-* #+BEGIN_DOCBOOK: Quoting DocBook code.
- (line 11)
-* #+BEGIN_EXAMPLE: Literal examples. (line 8)
-* #+BEGIN_HTML: Quoting HTML tags. (line 12)
-* #+BEGIN_LaTeX: Quoting LaTeX code. (line 14)
-* #+BEGIN_QUOTE: Paragraphs. (line 26)
-* #+BEGIN_SRC: Literal examples. (line 27)
-* #+BEGIN_VERSE: Paragraphs. (line 13)
-* #+BIND: Export options. (line 19)
-* #+CAPTION <1>: Images in HTML export.
- (line 24)
-* #+CAPTION <2>: Tables in HTML export.
- (line 11)
-* #+CAPTION <3>: Images in DocBook export.
- (line 30)
-* #+CAPTION <4>: Images and tables. (line 6)
-* #+CAPTION <5>: Images in LaTeX export.
- (line 25)
-* #+CAPTION: Tables in LaTeX export.
- (line 13)
-* #+CATEGORY: Categories. (line 6)
-* #+COLUMNS: Scope of column definitions.
- (line 8)
-* #+CONSTANTS: References. (line 99)
-* #+DATE: Export options. (line 19)
-* #+DESCRIPTION: Export options. (line 19)
-* #+DOCBOOK: Quoting DocBook code.
- (line 9)
-* #+DRAWERS: Drawers. (line 6)
-* #+EMAIL: Export options. (line 19)
-* #+EXPORT_EXCLUDE_TAGS: Export options. (line 19)
-* #+EXPORT_SELECT_TAGS: Export options. (line 19)
-* #+FILETAGS: Tag inheritance. (line 20)
-* #+HTML: Quoting HTML tags. (line 12)
-* #+INCLUDE: Include files. (line 7)
-* #+INFOJS_OPT: JavaScript support. (line 26)
-* #+KEYWORDS: Export options. (line 19)
-* #+LABEL <1>: Images and tables. (line 6)
-* #+LABEL <2>: Images in LaTeX export.
- (line 25)
-* #+LABEL <3>: Tables in LaTeX export.
- (line 13)
-* #+LABEL: Images in DocBook export.
- (line 30)
-* #+LANGUAGE: Export options. (line 19)
-* #+LaTeX: Quoting LaTeX code. (line 12)
-* #+LATEX_CLASS: Header and sectioning.
- (line 8)
-* #+LATEX_CLASS_OPTIONS: Header and sectioning.
- (line 8)
-* #+LATEX_HEADER <1>: Export options. (line 19)
-* #+LATEX_HEADER: Header and sectioning.
- (line 8)
-* #+LINK: Link abbreviations. (line 41)
-* #+LINK_HOME: Export options. (line 19)
-* #+LINK_UP: Export options. (line 19)
-* #+MACRO: Macro replacement. (line 6)
-* #+OPTIONS <1>: Headings and sections.
- (line 14)
-* #+OPTIONS: Export options. (line 19)
-* #+ORGLST: Radio lists. (line 25)
-* #+ORGTBL: Radio tables. (line 15)
-* #+ORGTBL, SEND: A LaTeX example. (line 14)
-* #+PLOT: Org-Plot. (line 6)
-* #+PRIORITIES: Priorities. (line 44)
-* #+PROPERTY: Property syntax. (line 37)
-* #+SEQ_TODO: Per-file keywords. (line 6)
-* #+SETUPFILE: In-buffer settings. (line 61)
-* #+STARTUP:: In-buffer settings. (line 74)
-* #+STYLE: CSS support. (line 44)
-* #+TAGS: Setting tags. (line 29)
-* #+TBLFM: Field formulas. (line 12)
-* #+TBLNAME: References. (line 120)
-* #+TEXT <1>: Initial text. (line 6)
-* #+TEXT: Export options. (line 19)
-* #+TITLE <1>: Document title. (line 8)
-* #+TITLE: Export options. (line 19)
-* #+TODO: Per-file keywords. (line 6)
-* #+TYP_TODO: Per-file keywords. (line 6)
-* #+XSLT: Export options. (line 19)
-* abbreviation, links: Link abbreviations. (line 6)
-* acknowledgments: History and Acknowledgments.
- (line 6)
-* action, for publishing: Publishing action. (line 6)
-* activation: Activation. (line 6)
-* active region <1>: Structure editing. (line 124)
-* active region <2>: ASCII/Latin-1/UTF-8 export.
- (line 11)
-* active region <3>: Built-in table editor.
- (line 156)
-* active region <4>: HTML Export commands.
- (line 6)
-* active region <5>: LaTeX/PDF export commands.
- (line 6)
-* active region: DocBook export commands.
- (line 6)
-* add-on packages: Add-on packages. (line 6)
-* add-ons, context-sensitive commands: Context-sensitive commands.
- (line 6)
-* agenda: Weekly/daily agenda. (line 6)
-* agenda dispatcher: Agenda dispatcher. (line 6)
-* agenda files: Agenda files. (line 6)
-* agenda files, removing buffers: Agenda commands. (line 486)
-* agenda views: Agenda Views. (line 6)
-* agenda views, custom: Custom agenda views. (line 6)
-* agenda views, exporting <1>: Exporting Agenda Views.
- (line 13)
-* agenda views, exporting <2>: Agenda commands. (line 473)
-* agenda views, exporting: Exporting Agenda Views.
- (line 6)
-* agenda views, user-defined: Special agenda views.
- (line 6)
-* agenda, column view: Agenda column view. (line 6)
-* agenda, pipe: Extracting agenda information.
- (line 6)
-* agenda, with block views: Block agenda. (line 6)
-* align, STARTUP keyword: In-buffer settings. (line 94)
-* alignment in tables: Column width and alignment.
- (line 6)
-* anniversaries, from BBDB: Weekly/daily agenda. (line 69)
-* API, for mapping: Using the mapping API.
- (line 6)
-* API, for properties <1>: Using the property API.
- (line 6)
-* API, for properties: Property API. (line 6)
-* appointment reminders: Weekly/daily agenda. (line 102)
-* appt.el: Weekly/daily agenda. (line 102)
-* archive locations: Moving subtrees. (line 20)
-* archiving: Archiving. (line 6)
-* ASCII export: ASCII/Latin-1/UTF-8 export.
- (line 6)
-* Atom feeds: RSS Feeds. (line 6)
-* attachments: Attachments. (line 6)
-* author: Feedback. (line 6)
-* author info, in export: Export options. (line 39)
-* autoload: Activation. (line 6)
-* babel, languages: Languages. (line 6)
-* babel, library of: Library of Babel. (line 6)
-* backtrace of an error: Feedback. (line 40)
-* Baur, Steven L.: Cooperation. (line 74)
-* BBDB links: External links. (line 6)
-* BBDB, anniversaries: Weekly/daily agenda. (line 69)
-* block agenda: Block agenda. (line 6)
-* blocking, of checkboxes: Checkboxes. (line 46)
-* blocks, folding: Blocks. (line 6)
-* bold text, markup rules: Emphasis and monospace.
- (line 6)
-* Boolean logic, for tag/property searches: Matching tags and properties.
- (line 34)
-* bug reports: Feedback. (line 6)
-* C-c C-c, overview: The very busy C-c C-c key.
- (line 6)
-* calc package: The spreadsheet. (line 6)
-* calc.el: Cooperation. (line 6)
-* calculations, in tables <1>: The spreadsheet. (line 6)
-* calculations, in tables: Built-in table editor.
- (line 156)
-* calendar commands, from agenda: Agenda commands. (line 422)
-* calendar integration: Weekly/daily agenda. (line 28)
-* calendar, for selecting date: The date/time prompt.
- (line 70)
-* capture <1>: Capture. (line 6)
-* capture: Capture - Refile - Archive.
- (line 6)
-* category: Categories. (line 6)
-* category, require for tags/property match: Matching tags and properties.
- (line 59)
-* CDLaTeX: CDLaTeX mode. (line 6)
-* cdlatex.el: Cooperation. (line 29)
-* checkbox blocking: Checkboxes. (line 46)
-* checkbox statistics: Checkboxes. (line 30)
-* checkboxes: Checkboxes. (line 6)
-* checkboxes and TODO dependencies: TODO dependencies. (line 44)
-* children, subtree visibility state: Visibility cycling. (line 10)
-* clean outline view: Clean view. (line 6)
-* clocking time: Clocking work time. (line 6)
-* clocktable, dynamic block: The clock table. (line 6)
-* code block, batch execution: Batch execution. (line 6)
-* code block, editing: Editing source code. (line 6)
-* code block, evaluating: Evaluating code blocks.
- (line 6)
-* code block, exporting: Exporting code blocks.
- (line 6)
-* code block, extracting source code: Extracting source code.
- (line 6)
-* code block, header arguments: Header arguments. (line 6)
-* code block, key bindings: Key bindings and useful functions.
- (line 6)
-* code block, languages: Languages. (line 6)
-* code block, library: Library of Babel. (line 6)
-* code block, noweb reference: Noweb reference syntax.
- (line 6)
-* code block, results of evaluation: Results of evaluation.
- (line 6)
-* code block, structure: Structure of code blocks.
- (line 6)
-* code line references, markup rules: Literal examples. (line 6)
-* code text, markup rules: Emphasis and monospace.
- (line 6)
-* column formula: Column formulas. (line 6)
-* column view, for properties: Defining columns. (line 6)
-* column view, in agenda: Agenda column view. (line 6)
-* column, of field coordinates: References. (line 84)
-* commands, in agenda buffer: Agenda commands. (line 6)
-* comment lines: Comment lines. (line 6)
-* completion, of dictionary words: Completion. (line 6)
-* completion, of file names: Handling links. (line 89)
-* completion, of link abbreviations: Completion. (line 6)
-* completion, of links: Handling links. (line 66)
-* completion, of option keywords <1>: Export options. (line 6)
-* completion, of option keywords <2>: Per-file keywords. (line 24)
-* completion, of option keywords: Completion. (line 6)
-* completion, of property keys: Completion. (line 6)
-* completion, of tags <1>: Completion. (line 6)
-* completion, of tags: Setting tags. (line 11)
-* completion, of TeX symbols: Completion. (line 6)
-* completion, of TODO keywords <1>: Workflow states. (line 15)
-* completion, of TODO keywords: Completion. (line 6)
-* constants, in calculations: References. (line 99)
-* constants.el: Cooperation. (line 17)
-* constcgs, STARTUP keyword: In-buffer settings. (line 140)
-* constSI, STARTUP keyword: In-buffer settings. (line 140)
-* content, STARTUP keyword <1>: Visibility cycling. (line 55)
-* content, STARTUP keyword: In-buffer settings. (line 80)
-* contents, global visibility state: Visibility cycling. (line 22)
-* context-sensitive commands, hooks: Context-sensitive commands.
- (line 6)
-* coordinates, of field: References. (line 84)
-* copying, of subtrees: Structure editing. (line 6)
-* Countdown timer: Countdown timer. (line 6)
-* creating timestamps: Creating timestamps. (line 6)
-* CSS, for HTML export: CSS support. (line 6)
-* CUA.el: Conflicts. (line 19)
-* Cui, Baoqiu: DocBook export. (line 6)
-* custom agenda views: Custom agenda views. (line 6)
-* custom date/time format: Custom time format. (line 6)
-* custom search strings: Custom searches. (line 6)
-* customization: Customization. (line 6)
-* customtime, STARTUP keyword: In-buffer settings. (line 137)
-* cutting, of subtrees: Structure editing. (line 6)
-* cycling, of TODO states: TODO basics. (line 14)
-* cycling, visibility: Visibility cycling. (line 6)
-* daily agenda: Weekly/daily agenda. (line 6)
-* date format, custom: Custom time format. (line 6)
-* date range: Timestamps. (line 40)
-* date stamp: Dates and Times. (line 6)
-* date stamps: Timestamps. (line 6)
-* date, reading in minibuffer: The date/time prompt.
- (line 6)
-* dates: Dates and Times. (line 6)
-* Davison, Dan: Working With Source Code.
- (line 6)
-* DEADLINE keyword: Deadlines and scheduling.
- (line 9)
-* deadlines: Timestamps. (line 6)
-* debugging, of table formulas: Editing and debugging formulas.
- (line 98)
-* demotion, of subtrees: Structure editing. (line 6)
-* dependencies, of TODO states: TODO dependencies. (line 6)
-* diary entries, creating from agenda: Agenda commands. (line 427)
-* diary integration: Weekly/daily agenda. (line 28)
-* dictionary word completion: Completion. (line 6)
-* directories, for publishing: Sources and destinations.
- (line 6)
-* dispatcher, for export commands: The export dispatcher.
- (line 6)
-* dispatching agenda commands: Agenda dispatcher. (line 6)
-* display changing, in agenda: Agenda commands. (line 64)
-* DocBook export: DocBook export. (line 6)
-* DocBook recursive sections: Recursive sections. (line 6)
-* document structure: Document Structure. (line 6)
-* document title, markup rules: Document title. (line 6)
-* Dominik, Carsten: Cooperation. (line 29)
-* DONE, final TODO keyword: Per-file keywords. (line 27)
-* drawer, for properties: Property syntax. (line 6)
-* drawer, for state change recording: Tracking TODO state changes.
- (line 6)
-* drawers: Drawers. (line 6)
-* dvipng: Math formatting in HTML export.
- (line 6)
-* dynamic blocks: Dynamic blocks. (line 6)
-* dynamic indentation: Clean view. (line 6)
-* editing tables: Tables. (line 6)
-* editing, of table formulas: Editing and debugging formulas.
- (line 6)
-* effort estimates: Effort estimates. (line 6)
-* effort filtering, in agenda: Agenda commands. (line 179)
-* Elisp links: External links. (line 6)
-* emacsserver: Protocols. (line 6)
-* emphasized text: Export options. (line 39)
-* entitiesplain, STARTUP keyword: In-buffer settings. (line 160)
-* entitiespretty, STARTUP keyword: In-buffer settings. (line 160)
-* evaluate time range: Creating timestamps. (line 59)
-* even, STARTUP keyword: In-buffer settings. (line 128)
-* export, selective by tags: Selective export. (line 6)
-* exporting: Exporting. (line 6)
-* exporting agenda views <1>: Exporting Agenda Views.
- (line 13)
-* exporting agenda views: Agenda commands. (line 473)
-* exporting, not: Comment lines. (line 6)
-* extended TODO keywords: TODO extensions. (line 6)
-* external archiving: Moving subtrees. (line 6)
-* external links: External links. (line 6)
-* external links, in HTML export: Links in HTML export.
- (line 6)
-* faces, for TODO keywords: Faces for TODO keywords.
- (line 6)
-* FAQ: Summary. (line 53)
-* feedback: Feedback. (line 6)
-* field coordinates: References. (line 84)
-* field formula: Field formulas. (line 6)
-* field references: References. (line 15)
-* file links: External links. (line 6)
-* file links, searching: Search options. (line 6)
-* file name completion: Handling links. (line 89)
-* files for agenda: Agenda files. (line 6)
-* files, adding to agenda list: Agenda files. (line 15)
-* files, selecting for publishing: Selecting files. (line 6)
-* filtering, by tag and effort, in agenda: Agenda commands. (line 179)
-* fixed-width sections: Export options. (line 39)
-* fnadjust, STARTUP keyword: In-buffer settings. (line 145)
-* fnauto, STARTUP keyword: In-buffer settings. (line 145)
-* fnconfirm, STARTUP keyword: In-buffer settings. (line 145)
-* fninline, STARTUP keyword: In-buffer settings. (line 145)
-* fnlocal, STARTUP keyword: In-buffer settings. (line 145)
-* fnplain, STARTUP keyword: In-buffer settings. (line 145)
-* fnprompt, STARTUP keyword: In-buffer settings. (line 145)
-* folded, subtree visibility state: Visibility cycling. (line 10)
-* folding, sparse trees: Sparse trees. (line 6)
-* following links: Handling links. (line 101)
-* footnote.el <1>: Footnote markup. (line 6)
-* footnote.el: Cooperation. (line 74)
-* footnotes <1>: Footnotes. (line 6)
-* footnotes: Export options. (line 39)
-* footnotes, markup rules: Footnote markup. (line 6)
-* format specifier: Formula syntax for Calc.
- (line 14)
-* format, of links: Link format. (line 6)
-* formatting source code, markup rules: Literal examples. (line 23)
-* formula debugging: Editing and debugging formulas.
- (line 98)
-* formula editing: Editing and debugging formulas.
- (line 6)
-* formula syntax, Calc: Formula syntax for Calc.
- (line 6)
-* formula, for individual table field: Field formulas. (line 6)
-* formula, for table column: Column formulas. (line 6)
-* formula, in tables: Built-in table editor.
- (line 156)
-* Freemind export: Freemind export. (line 6)
-* Gillespie, Dave: Cooperation. (line 6)
-* global cycling: Visibility cycling. (line 22)
-* global key bindings: Activation. (line 6)
-* global TODO list: Global TODO list. (line 6)
-* global visibility states: Visibility cycling. (line 22)
-* Gnus links: External links. (line 6)
-* graph, in tables: Org-Plot. (line 6)
-* grouping columns in tables: Column groups. (line 6)
-* Guerry, Bastien: LaTeX and PDF export.
- (line 6)
-* habits: Tracking your habits.
- (line 6)
-* hacking: Hacking. (line 6)
-* header, for LaTeX files: Header and sectioning.
- (line 6)
-* headings and sections, markup rules: Headings and sections.
- (line 6)
-* headline levels: Export options. (line 39)
-* headline levels, for exporting <1>: LaTeX/PDF export commands.
- (line 37)
-* headline levels, for exporting <2>: HTML Export commands.
- (line 39)
-* headline levels, for exporting: ASCII/Latin-1/UTF-8 export.
- (line 34)
-* headline navigation: Motion. (line 6)
-* headline tagging: Tags. (line 6)
-* headline, promotion and demotion: Structure editing. (line 6)
-* headlines: Headlines. (line 6)
-* hide text: Visibility cycling. (line 6)
-* hideblocks, STARTUP keyword <1>: In-buffer settings. (line 156)
-* hideblocks, STARTUP keyword: Blocks. (line 13)
-* hidestars, STARTUP keyword: In-buffer settings. (line 128)
-* hiding leading stars: Clean view. (line 6)
-* history: History and Acknowledgments.
- (line 6)
-* hooks: Hooks. (line 6)
-* horizontal rules, markup rules: Horizontal rules. (line 6)
-* HTML entities: Special symbols. (line 6)
-* HTML export: HTML export. (line 6)
-* HTML export, CSS: CSS support. (line 6)
-* HTML, and Orgtbl mode: Translator functions.
- (line 6)
-* hyperlinks: Hyperlinks. (line 6)
-* hyperlinks, adding new types: Adding hyperlink types.
- (line 6)
-* iCalendar export: iCalendar export. (line 6)
-* idle, resolve, dangling: Resolving idle time. (line 6)
-* images, inline in DocBook: Images in DocBook export.
- (line 6)
-* images, inline in HTML: Images in HTML export.
- (line 6)
-* images, inline in LaTeX: Images in LaTeX export.
- (line 6)
-* images, inlining: Handling links. (line 134)
-* imenu.el: Cooperation. (line 33)
-* in-buffer settings: In-buffer settings. (line 6)
-* inactive timestamp: Timestamps. (line 49)
-* include files, markup rules: Include files. (line 6)
-* indent, STARTUP keyword: In-buffer settings. (line 86)
-* index entries, for publishing: Index entries. (line 6)
-* index, in a publishing project: Generating an index. (line 6)
-* Info links: External links. (line 6)
-* inheritance, of properties: Property inheritance.
- (line 6)
-* inheritance, of tags: Tag inheritance. (line 6)
-* inlined images, markup rules: Images and tables. (line 18)
-* inlineimages, STARTUP keyword <1>: In-buffer settings. (line 101)
-* inlineimages, STARTUP keyword: Handling links. (line 134)
-* inlining images: Handling links. (line 134)
-* inlining images in DocBook: Images in DocBook export.
- (line 6)
-* inlining images in HTML: Images in HTML export.
- (line 6)
-* inlining images in LaTeX: Images in LaTeX export.
- (line 6)
-* inserting links: Handling links. (line 66)
-* insertion, of templates: Easy Templates. (line 6)
-* installation: Installation. (line 6)
-* internal links: Internal links. (line 6)
-* internal links, in HTML export: Links in HTML export.
- (line 6)
-* introduction: Introduction. (line 6)
-* iPhone: MobileOrg. (line 6)
-* IRC links: External links. (line 6)
-* italic text, markup rules: Emphasis and monospace.
- (line 6)
-* jumping, to headlines: Motion. (line 6)
-* key bindings, global: Activation. (line 6)
-* keyword options: Per-file keywords. (line 6)
-* LaTeX class: Header and sectioning.
- (line 6)
-* LaTeX entities: Special symbols. (line 6)
-* LaTeX export: LaTeX and PDF export.
- (line 6)
-* LaTeX fragments <1>: Export options. (line 39)
-* LaTeX fragments: LaTeX fragments. (line 6)
-* LaTeX fragments, markup rules: Special symbols. (line 6)
-* LaTeX fragments, preview: Previewing LaTeX fragments.
- (line 6)
-* LaTeX header: Header and sectioning.
- (line 6)
-* LaTeX interpretation: Embedded LaTeX. (line 6)
-* LaTeX sectioning structure: Header and sectioning.
- (line 6)
-* LaTeX, and Orgtbl mode: A LaTeX example. (line 6)
-* Latin-1 export: ASCII/Latin-1/UTF-8 export.
- (line 6)
-* level, require for tags/property match: Matching tags and properties.
- (line 59)
-* line-break preservation: Export options. (line 39)
-* link abbreviations: Link abbreviations. (line 6)
-* link abbreviations, completion of: Completion. (line 6)
-* link completion: Handling links. (line 66)
-* link format: Link format. (line 6)
-* links, external: External links. (line 6)
-* links, finding next/previous: Handling links. (line 154)
-* links, handling: Handling links. (line 6)
-* links, in HTML export: Links in HTML export.
- (line 6)
-* links, internal: Internal links. (line 6)
-* links, publishing: Publishing links. (line 6)
-* links, radio targets: Radio targets. (line 6)
-* links, returning to: Handling links. (line 147)
-* Lisp forms, as table formulas: Formula syntax for Lisp.
- (line 6)
-* lists, in other modes: Tables in arbitrary syntax.
- (line 6)
-* lists, markup rules: Lists. (line 6)
-* lists, ordered: Plain lists. (line 6)
-* lists, plain: Plain lists. (line 6)
-* literal examples, markup rules: Literal examples. (line 6)
-* logdone, STARTUP keyword: In-buffer settings. (line 107)
-* logging, of progress: Progress logging. (line 6)
-* lognoteclock-out, STARTUP keyword: In-buffer settings. (line 107)
-* lognotedone, STARTUP keyword: In-buffer settings. (line 107)
-* lognoteredeadline, STARTUP keyword: In-buffer settings. (line 107)
-* lognoterefile, STARTUP keyword: In-buffer settings. (line 107)
-* lognoterepeat, STARTUP keyword: In-buffer settings. (line 107)
-* lognotereschedule, STARTUP keyword: In-buffer settings. (line 107)
-* logredeadline, STARTUP keyword: In-buffer settings. (line 107)
-* logrefile, STARTUP keyword: In-buffer settings. (line 107)
-* logrepeat, STARTUP keyword: In-buffer settings. (line 107)
-* logreschedule, STARTUP keyword: In-buffer settings. (line 107)
-* Ludlam, Eric M.: Cooperation. (line 45)
-* macro replacement, during export: Macro replacement. (line 6)
-* maintainer: Feedback. (line 6)
-* mapping entries, API: Using the mapping API.
- (line 6)
-* mark ring: Handling links. (line 143)
-* marking characters, tables: Advanced features. (line 38)
-* match view: Matching tags and properties.
- (line 6)
-* matching, of properties: Matching tags and properties.
- (line 6)
-* matching, of tags: Matching tags and properties.
- (line 6)
-* matching, tags: Tags. (line 6)
-* math symbols: Special symbols. (line 6)
-* MathJax: Math formatting in HTML export.
- (line 6)
-* MH-E links: External links. (line 6)
-* mind map: Freemind export. (line 6)
-* minor mode for structure editing: Orgstruct mode. (line 6)
-* minor mode for tables: Orgtbl mode. (line 6)
-* MobileOrg: MobileOrg. (line 6)
-* mode, for calc: Formula syntax for Calc.
- (line 14)
-* motion commands in agenda: Agenda commands. (line 19)
-* motion, between headlines: Motion. (line 6)
-* name, of column or field: References. (line 120)
-* named references: References. (line 99)
-* names as TODO keywords: TODO types. (line 6)
-* narrow columns in tables: Column width and alignment.
- (line 6)
-* noalign, STARTUP keyword: In-buffer settings. (line 94)
-* nofnadjust, STARTUP keyword: In-buffer settings. (line 145)
-* nofninline, STARTUP keyword: In-buffer settings. (line 145)
-* nohideblocks, STARTUP keyword <1>: In-buffer settings. (line 156)
-* nohideblocks, STARTUP keyword: Blocks. (line 13)
-* noindent, STARTUP keyword: In-buffer settings. (line 86)
-* noinlineimages, STARTUP keyword <1>: In-buffer settings. (line 101)
-* noinlineimages, STARTUP keyword: Handling links. (line 134)
-* nologdone, STARTUP keyword: In-buffer settings. (line 107)
-* nolognoteclock-out, STARTUP keyword: In-buffer settings. (line 107)
-* nologredeadline, STARTUP keyword: In-buffer settings. (line 107)
-* nologrefile, STARTUP keyword: In-buffer settings. (line 107)
-* nologrepeat, STARTUP keyword: In-buffer settings. (line 107)
-* nologreschedule, STARTUP keyword: In-buffer settings. (line 107)
-* occur, command: Sparse trees. (line 6)
-* odd, STARTUP keyword: In-buffer settings. (line 128)
-* odd-levels-only outlines: Clean view. (line 6)
-* option keyword completion: Completion. (line 6)
-* options, for custom agenda views: Setting Options. (line 6)
-* options, for customization: Customization. (line 6)
-* options, for export: Export options. (line 6)
-* options, for publishing: Publishing options. (line 6)
-* ordered lists: Plain lists. (line 6)
-* org-agenda, command: Weekly/daily agenda. (line 9)
-* org-hide-block-startup: In-buffer settings. (line 155)
-* org-list-insert-radio-list: Radio lists. (line 6)
-* Org-mode, turning on: Activation. (line 23)
-* org-pretty-entities: In-buffer settings. (line 159)
-* org-publish-project-alist: Project alist. (line 6)
-* Orgstruct mode: Orgstruct mode. (line 6)
-* Orgtbl mode <1>: Orgtbl mode. (line 6)
-* Orgtbl mode: Tables in arbitrary syntax.
- (line 6)
-* Ota, Takaaki: Cooperation. (line 52)
-* Outline mode: Outlines. (line 6)
-* outline tree: Headlines. (line 6)
-* outlines: Outlines. (line 6)
-* overview, global visibility state: Visibility cycling. (line 22)
-* overview, STARTUP keyword <1>: In-buffer settings. (line 80)
-* overview, STARTUP keyword: Visibility cycling. (line 55)
-* packages, interaction with other: Interaction. (line 6)
-* paragraphs, markup rules: Paragraphs. (line 6)
-* pasting, of subtrees: Structure editing. (line 6)
-* PDF export <1>: DocBook export. (line 6)
-* PDF export: LaTeX and PDF export.
- (line 6)
-* per-file keywords: Per-file keywords. (line 6)
-* plain lists: Plain lists. (line 6)
-* plain text external links: External links. (line 57)
-* plot tables using Gnuplot: Org-Plot. (line 6)
-* presentation, of agenda items: Presentation and sorting.
- (line 6)
-* printing sparse trees: Sparse trees. (line 47)
-* priorities: Priorities. (line 6)
-* priorities, of agenda items: Sorting of agenda items.
- (line 6)
-* progress logging: Progress logging. (line 6)
-* Project management: TaskJuggler export. (line 6)
-* projects, for publishing: Project alist. (line 6)
-* promotion, of subtrees: Structure editing. (line 6)
-* properties: Properties and Columns.
- (line 6)
-* properties, API <1>: Property API. (line 6)
-* properties, API: Using the property API.
- (line 6)
-* properties, column view: Defining columns. (line 6)
-* properties, inheritance: Property inheritance.
- (line 6)
-* properties, searching: Property searches. (line 6)
-* properties, special: Special properties. (line 6)
-* property EXPORT_FILE_NAME <1>: DocBook export commands.
- (line 7)
-* property EXPORT_FILE_NAME: LaTeX/PDF export commands.
- (line 7)
-* property syntax: Property syntax. (line 6)
-* property, _ALL: Property syntax. (line 37)
-* property, ARCHIVE <1>: Moving subtrees. (line 29)
-* property, ARCHIVE: Property inheritance.
- (line 34)
-* property, ATTACH_DIR: Attachments. (line 71)
-* property, ATTACH_DIR_INHERIT: Attachments. (line 76)
-* property, CATEGORY <1>: Categories. (line 12)
-* property, CATEGORY: Property inheritance.
- (line 30)
-* property, COLUMNS <1>: In-buffer settings. (line 30)
-* property, COLUMNS: Property inheritance.
- (line 22)
-* property, COOKIE_DATA <1>: Breaking down tasks. (line 21)
-* property, COOKIE_DATA: Checkboxes. (line 30)
-* property, CUSTOM_ID <1>: Handling links. (line 21)
-* property, CUSTOM_ID: Internal links. (line 6)
-* property, DESCRIPTION: iCalendar export. (line 46)
-* property, Effort: Effort estimates. (line 6)
-* property, EXPORT_FILE_NAME <1>: HTML Export commands.
- (line 7)
-* property, EXPORT_FILE_NAME: ASCII/Latin-1/UTF-8 export.
- (line 12)
-* property, EXPORT_TITLE: Document title. (line 15)
-* property, ID <1>: Handling links. (line 21)
-* property, ID <2>: Capturing column view.
- (line 22)
-* property, ID: iCalendar export. (line 21)
-* property, LATEX_CLASS: Header and sectioning.
- (line 8)
-* property, LATEX_CLASS_OPTIONS: Header and sectioning.
- (line 8)
-* property, LOCATION: iCalendar export. (line 46)
-* property, LOG_INTO_DRAWER: Tracking TODO state changes.
- (line 6)
-* property, LOGGING <1>: Property inheritance.
- (line 38)
-* property, LOGGING: Tracking TODO state changes.
- (line 42)
-* property, ORDERED <1>: TODO dependencies. (line 30)
-* property, ORDERED <2>: Checkboxes. (line 46)
-* property, ORDERED: TODO dependencies. (line 6)
-* property, special, ALLTAGS: Special properties. (line 13)
-* property, special, BLOCKED: Special properties. (line 13)
-* property, special, CATEGORY: Special properties. (line 13)
-* property, special, CLOCKSUM <1>: Special properties. (line 13)
-* property, special, CLOCKSUM: Agenda column view. (line 28)
-* property, special, CLOSED: Special properties. (line 13)
-* property, special, DEADLINE: Special properties. (line 13)
-* property, special, ITEM: Special properties. (line 13)
-* property, special, PRIORITY: Special properties. (line 13)
-* property, special, SCHEDULED: Special properties. (line 13)
-* property, special, TAGS: Special properties. (line 13)
-* property, special, TIMESTAMP: Special properties. (line 13)
-* property, special, TIMESTAMP_IA: Special properties. (line 13)
-* property, special, TODO: Special properties. (line 13)
-* property, SUMMARY: iCalendar export. (line 46)
-* property, VISIBILITY: Visibility cycling. (line 65)
-* property: CLOCK_MODELINE_TOTAL: Clocking commands. (line 16)
-* property: LAST_REPEAT: Clocking commands. (line 16)
-* protocols, for external access: Protocols. (line 6)
-* publishing: Publishing. (line 6)
-* query editing, in agenda: Agenda commands. (line 179)
-* quoted HTML tags: Export options. (line 39)
-* radio lists: Radio lists. (line 6)
-* radio tables: Radio tables. (line 6)
-* radio targets: Radio targets. (line 6)
-* range references: References. (line 62)
-* ranges, time: Timestamps. (line 6)
-* recomputing table fields: Updating the table. (line 6)
-* references: References. (line 6)
-* references, named: References. (line 99)
-* references, remote: References. (line 120)
-* references, to a different table: References. (line 120)
-* references, to fields: References. (line 15)
-* references, to ranges: References. (line 62)
-* refiling notes: Refiling notes. (line 6)
-* region, active <1>: ASCII/Latin-1/UTF-8 export.
- (line 11)
-* region, active <2>: HTML Export commands.
- (line 6)
-* region, active <3>: LaTeX/PDF export commands.
- (line 6)
-* region, active <4>: DocBook export commands.
- (line 6)
-* region, active <5>: Structure editing. (line 124)
-* region, active: Built-in table editor.
- (line 156)
-* regular expressions, with tags search: Matching tags and properties.
- (line 55)
-* relative timer: Relative timer. (line 6)
-* remember.el: Cooperation. (line 42)
-* remote editing, bulk, from agenda: Agenda commands. (line 388)
-* remote editing, from agenda: Agenda commands. (line 258)
-* remote editing, undo: Agenda commands. (line 259)
-* remote references: References. (line 120)
-* repeated tasks: Repeated tasks. (line 6)
-* report, of clocked time: The clock table. (line 6)
-* resolve idle time: Resolving idle time. (line 6)
-* RMAIL links: External links. (line 6)
-* Rose, Sebastian: JavaScript support. (line 6)
-* row, of field coordinates: References. (line 84)
-* RSS feeds: RSS Feeds. (line 6)
-* rsync: Uploading files. (line 6)
-* SCHEDULED keyword: Deadlines and scheduling.
- (line 27)
-* scheduling: Timestamps. (line 6)
-* Schulte, Eric: Working With Source Code.
- (line 6)
-* Scripts, for agenda processing: Extracting agenda information.
- (line 6)
-* search option in file links: Search options. (line 6)
-* search strings, custom: Custom searches. (line 6)
-* search view: Search view. (line 6)
-* searching for tags: Tag searches. (line 6)
-* searching, for text: Search view. (line 6)
-* searching, of properties: Property searches. (line 6)
-* section-numbers: Export options. (line 39)
-* sectioning structure, for LaTeX export: Header and sectioning.
- (line 6)
-* setting tags: Setting tags. (line 6)
-* SHELL links: External links. (line 6)
-* shift-selection-mode <1>: Plain lists. (line 101)
-* shift-selection-mode: Conflicts. (line 6)
-* show all, command: Visibility cycling. (line 33)
-* show all, global visibility state: Visibility cycling. (line 22)
-* show hidden text: Visibility cycling. (line 6)
-* showall, STARTUP keyword <1>: Visibility cycling. (line 55)
-* showall, STARTUP keyword: In-buffer settings. (line 80)
-* showeverything, STARTUP keyword <1>: Visibility cycling. (line 55)
-* showeverything, STARTUP keyword: In-buffer settings. (line 80)
-* showstars, STARTUP keyword: In-buffer settings. (line 128)
-* sitemap, of published pages: Sitemap. (line 6)
-* sorting, of agenda items: Sorting of agenda items.
- (line 6)
-* sorting, of subtrees: Structure editing. (line 6)
-* source code, batch execution: Batch execution. (line 6)
-* source code, block header arguments: Header arguments. (line 6)
-* source code, block structure: Structure of code blocks.
- (line 6)
-* source code, editing: Editing source code. (line 6)
-* source code, evaluating: Evaluating code blocks.
- (line 6)
-* source code, exporting: Exporting code blocks.
- (line 6)
-* source code, extracting: Extracting source code.
- (line 6)
-* source code, languages: Languages. (line 6)
-* source code, library: Library of Babel. (line 6)
-* source code, noweb reference: Noweb reference syntax.
- (line 6)
-* source code, results of evaluation: Results of evaluation.
- (line 6)
-* source code, working with: Working With Source Code.
- (line 6)
-* sparse tree, for deadlines: Inserting deadline/schedule.
- (line 31)
-* sparse tree, for TODO: TODO basics. (line 36)
-* sparse tree, tag based: Tags. (line 6)
-* sparse trees: Sparse trees. (line 6)
-* Special characters in DocBook export: Special characters. (line 6)
-* special keywords: In-buffer settings. (line 6)
-* special strings: Export options. (line 39)
-* special symbols: Special symbols. (line 6)
-* speed keys: Speed keys. (line 6)
-* speedbar.el: Cooperation. (line 45)
-* spreadsheet capabilities: The spreadsheet. (line 6)
-* square brackets, around links: External links. (line 57)
-* statistics, for checkboxes: Checkboxes. (line 30)
-* statistics, for TODO items: Breaking down tasks. (line 6)
-* storing links: Handling links. (line 10)
-* Storm, Kim. F.: Conflicts. (line 19)
-* strike-through text, markup rules: Emphasis and monospace.
- (line 6)
-* structure editing: Structure editing. (line 6)
-* structure of document: Document Structure. (line 6)
-* sublevels, inclusion into tags match: Tag inheritance. (line 6)
-* sublevels, inclusion into TODO list: Global TODO list. (line 35)
-* subscript: Subscripts and superscripts.
- (line 6)
-* subtree cycling: Visibility cycling. (line 10)
-* subtree visibility states: Visibility cycling. (line 10)
-* subtree, cut and paste: Structure editing. (line 6)
-* subtree, subtree visibility state: Visibility cycling. (line 10)
-* subtrees, cut and paste: Structure editing. (line 6)
-* summary: Summary. (line 6)
-* superscript: Subscripts and superscripts.
- (line 6)
-* syntax, noweb: Noweb reference syntax.
- (line 6)
-* syntax, of formulas: Formula syntax for Calc.
- (line 6)
-* table editor, built-in: Built-in table editor.
- (line 6)
-* table editor, table.el: Cooperation. (line 52)
-* table of contents: Export options. (line 39)
-* table of contents, markup rules: Table of contents. (line 6)
-* table.el: Cooperation. (line 49)
-* tables <1>: Tables. (line 6)
-* tables: Export options. (line 39)
-* tables, in DocBook export: Tables in DocBook export.
- (line 6)
-* tables, in HTML: Tables in HTML export.
- (line 6)
-* tables, in LaTeX export: Tables in LaTeX export.
- (line 6)
-* tables, in other modes: Tables in arbitrary syntax.
- (line 6)
-* tables, markup rules: Images and tables. (line 6)
-* tag completion: Completion. (line 6)
-* tag filtering, in agenda: Agenda commands. (line 179)
-* tag inheritance: Tag inheritance. (line 6)
-* tag searches: Tag searches. (line 6)
-* tags: Tags. (line 6)
-* tags view: Matching tags and properties.
- (line 6)
-* tags, setting: Setting tags. (line 6)
-* targets, for links: Internal links. (line 6)
-* targets, radio: Radio targets. (line 6)
-* TaskJuggler export: TaskJuggler export. (line 6)
-* tasks, breaking down: Breaking down tasks. (line 6)
-* tasks, repeated: Repeated tasks. (line 6)
-* template insertion: Easy Templates. (line 6)
-* templates, for Capture: Capture templates. (line 6)
-* TeX interpretation: Embedded LaTeX. (line 6)
-* TeX macros <1>: Special symbols. (line 6)
-* TeX macros: Export options. (line 39)
-* TeX symbol completion: Completion. (line 6)
-* TeX-like syntax for sub- and superscripts: Export options. (line 39)
-* text areas, in HTML: Text areas in HTML export.
- (line 6)
-* text before first headline, markup rules: Initial text. (line 6)
-* text search: Search view. (line 6)
-* thanks: History and Acknowledgments.
- (line 6)
-* time clocking: Clocking work time. (line 6)
-* time format, custom: Custom time format. (line 6)
-* time grid: Time-of-day specifications.
- (line 26)
-* time info, in export: Export options. (line 39)
-* time, reading in minibuffer: The date/time prompt.
- (line 6)
-* time-of-day specification: Time-of-day specifications.
- (line 6)
-* time-sorted view: Timeline. (line 6)
-* timeline, single file: Timeline. (line 6)
-* timerange: Timestamps. (line 40)
-* times: Dates and Times. (line 6)
-* timestamp <1>: Timestamps. (line 14)
-* timestamp: Dates and Times. (line 6)
-* timestamp, inactive: Timestamps. (line 49)
-* timestamp, with repeater interval: Timestamps. (line 24)
-* timestamps: Timestamps. (line 6)
-* timestamps, creating: Creating timestamps. (line 6)
-* TODO dependencies: TODO dependencies. (line 6)
-* TODO items: TODO Items. (line 6)
-* TODO keyword matching: Global TODO list. (line 18)
-* TODO keyword matching, with tags search: Matching tags and properties.
- (line 59)
-* TODO keyword sets: Multiple sets in one file.
- (line 6)
-* TODO keywords completion: Completion. (line 6)
-* TODO list, global: Global TODO list. (line 6)
-* TODO types: TODO types. (line 6)
-* TODO workflow: Workflow states. (line 6)
-* transient mark mode <1>: Structure editing. (line 124)
-* transient mark mode: Built-in table editor.
- (line 156)
-* transient-mark-mode <1>: HTML Export commands.
- (line 6)
-* transient-mark-mode <2>: LaTeX/PDF export commands.
- (line 6)
-* transient-mark-mode <3>: ASCII/Latin-1/UTF-8 export.
- (line 11)
-* transient-mark-mode: DocBook export commands.
- (line 6)
-* translator function: Translator functions.
- (line 6)
-* trees, sparse: Sparse trees. (line 6)
-* trees, visibility: Visibility cycling. (line 6)
-* tty key bindings: TTY keys. (line 6)
-* types as TODO keywords: TODO types. (line 6)
-* underlined text, markup rules: Emphasis and monospace.
- (line 6)
-* undoing remote-editing events: Agenda commands. (line 259)
-* unison: Uploading files. (line 6)
-* updating, table: Updating the table. (line 6)
-* URL links: External links. (line 6)
-* USENET links: External links. (line 6)
-* UTF-8 export: ASCII/Latin-1/UTF-8 export.
- (line 6)
-* variables, for customization: Customization. (line 6)
-* vectors, in table calculations: Formula syntax for Calc.
- (line 11)
-* verbatim text, markup rules: Emphasis and monospace.
- (line 6)
-* viper.el: Conflicts. (line 62)
-* visibility cycling: Visibility cycling. (line 6)
-* visibility cycling, drawers: Drawers. (line 6)
-* visible text, printing: Sparse trees. (line 47)
-* VM links: External links. (line 6)
-* WANDERLUST links: External links. (line 6)
-* weekly agenda: Weekly/daily agenda. (line 6)
-* Wiegley, John: Cooperation. (line 42)
-* windmove.el: Conflicts. (line 49)
-* workflow states as TODO keywords: Workflow states. (line 6)
-* XEmacs: Installation. (line 6)
-* XOXO export: XOXO export. (line 6)
-* yasnippet.el: Conflicts. (line 39)
-
-
-File: org, Node: Key Index, Next: Command and Function Index, Prev: Main Index, Up: Top
-
-Key index
-*********
-
-
-* Menu:
-
-* $: Agenda commands. (line 293)
-* ': CDLaTeX mode. (line 42)
-* +: Agenda commands. (line 315)
-* ,: Agenda commands. (line 307)
-* ,org-agenda-filter-by-tag-refine: Agenda commands. (line 238)
-* -: Agenda commands. (line 320)
-* .: Agenda commands. (line 90)
-* /: Agenda commands. (line 179)
-* :: Agenda commands. (line 303)
-* ;: Countdown timer. (line 6)
-* < <1>: Agenda files. (line 56)
-* < <2>: The date/time prompt.
- (line 76)
-* <: Using column view. (line 70)
-* <RET> <1>: The date/time prompt.
- (line 76)
-* <RET> <2>: Agenda commands. (line 37)
-* <RET> <3>: Setting tags. (line 115)
-* <RET> <4>: Handling links. (line 118)
-* <RET>: Built-in table editor.
- (line 65)
-* <SPC> <1>: Agenda commands. (line 28)
-* <SPC>: Setting tags. (line 112)
-* <TAB> <1>: Editing and debugging formulas.
- (line 56)
-* <TAB> <2>: Visibility cycling. (line 10)
-* <TAB> <3>: Structure editing. (line 32)
-* <TAB> <4>: Plain lists. (line 91)
-* <TAB> <5>: Built-in table editor.
- (line 58)
-* <TAB> <6>: CDLaTeX mode. (line 22)
-* <TAB> <7>: Agenda commands. (line 34)
-* <TAB>: Setting tags. (line 107)
-* > <1>: The date/time prompt.
- (line 76)
-* > <2>: Using column view. (line 70)
-* > <3>: Agenda commands. (line 365)
-* >: Agenda files. (line 60)
-* ?: Pulling from MobileOrg.
- (line 33)
-* [: Agenda commands. (line 245)
-* ]: Agenda commands. (line 245)
-* ^: CDLaTeX mode. (line 32)
-* _: CDLaTeX mode. (line 32)
-* `: CDLaTeX mode. (line 38)
-* a <1>: Agenda commands. (line 281)
-* a: Using column view. (line 59)
-* b: Agenda commands. (line 87)
-* B: Agenda commands. (line 396)
-* c: Agenda commands. (line 422)
-* C: Agenda commands. (line 455)
-* c: Agenda commands. (line 423)
-* C-#: Advanced features. (line 9)
-* C-': Agenda files. (line 22)
-* C-,: Agenda files. (line 22)
-* C-0 C-c C-w: Refiling notes. (line 40)
-* C-<RET>: Structure editing. (line 18)
-* C-_: Agenda commands. (line 259)
-* C-c !: Creating timestamps. (line 15)
-* C-c #: Checkboxes. (line 83)
-* C-c $: Moving subtrees. (line 9)
-* C-c %: Handling links. (line 140)
-* C-c &: Handling links. (line 144)
-* C-c ' <1>: Literal examples. (line 65)
-* C-c ' <2>: Editing source code. (line 6)
-* C-c ' <3>: Editing and debugging formulas.
- (line 36)
-* C-c ' <4>: Include files. (line 22)
-* C-c ': Cooperation. (line 61)
-* C-c * <1>: Plain lists. (line 146)
-* C-c * <2>: Structure editing. (line 113)
-* C-c *: Updating the table. (line 13)
-* C-c +: Built-in table editor.
- (line 156)
-* C-c ,: Priorities. (line 24)
-* C-c ,org-match-sparse-tree <1>: Property searches. (line 9)
-* C-c ,org-match-sparse-tree: Tag searches. (line 9)
-* C-c - <1>: Built-in table editor.
- (line 101)
-* C-c -: Plain lists. (line 135)
-* C-c .: Creating timestamps. (line 10)
-* C-c / <1>: Sparse trees. (line 15)
-* C-c /: Conflicts. (line 62)
-* C-c / a: Inserting deadline/schedule.
- (line 38)
-* C-c / b: Inserting deadline/schedule.
- (line 35)
-* C-c / d: Inserting deadline/schedule.
- (line 28)
-* C-c / m <1>: Property searches. (line 9)
-* C-c / m: Tag searches. (line 9)
-* C-c / p: Property searches. (line 28)
-* C-c / r: Sparse trees. (line 17)
-* C-c / t: TODO basics. (line 33)
-* C-c ;: Comment lines. (line 12)
-* C-c <: Creating timestamps. (line 26)
-* C-c <RET>: Built-in table editor.
- (line 105)
-* C-c = <1>: Column formulas. (line 27)
-* C-c =: Editing and debugging formulas.
- (line 13)
-* C-c >: Creating timestamps. (line 30)
-* C-c ?: Editing and debugging formulas.
- (line 22)
-* C-c [: Agenda files. (line 15)
-* C-c ]: Agenda files. (line 19)
-* C-c ^ <1>: Plain lists. (line 156)
-* C-c ^ <2>: Built-in table editor.
- (line 109)
-* C-c ^: Structure editing. (line 94)
-* C-c `: Built-in table editor.
- (line 174)
-* C-c a !: Stuck projects. (line 14)
-* C-c a #: Stuck projects. (line 13)
-* C-c a ?: Pulling from MobileOrg.
- (line 43)
-* C-c a a: Weekly/daily agenda. (line 9)
-* C-c a C: Storing searches. (line 9)
-* C-c a e: Exporting Agenda Views.
- (line 65)
-* C-c a L: Timeline. (line 10)
-* C-c a m: Property searches. (line 11)
-* C-c a M: Tag searches. (line 16)
-* C-c a m: Tag searches. (line 12)
-* C-c a M: Property searches. (line 15)
-* C-c a m: Matching tags and properties.
- (line 12)
-* C-c a M: Matching tags and properties.
- (line 17)
-* C-c a s: Search view. (line 9)
-* C-c a t <1>: TODO basics. (line 44)
-* C-c a t: Global TODO list. (line 9)
-* C-c a T: Global TODO list. (line 15)
-* C-c c: Using capture. (line 6)
-* C-c c C: Capture templates. (line 10)
-* C-c C-a <1>: Attachments. (line 26)
-* C-c C-a: Agenda commands. (line 328)
-* C-c C-a a: Attachments. (line 31)
-* C-c C-a c: Attachments. (line 37)
-* C-c C-a d: Attachments. (line 63)
-* C-c C-a D: Attachments. (line 66)
-* C-c C-a F: Attachments. (line 60)
-* C-c C-a f: Attachments. (line 57)
-* C-c C-a i: Attachments. (line 75)
-* C-c C-a l: Attachments. (line 37)
-* C-c C-a m: Attachments. (line 37)
-* C-c C-a n: Attachments. (line 41)
-* C-c C-a o: Attachments. (line 48)
-* C-c C-a O: Attachments. (line 54)
-* C-c C-a s: Attachments. (line 70)
-* C-c C-a z: Attachments. (line 44)
-* C-c C-b <1>: Motion. (line 15)
-* C-c C-b: Beamer class export. (line 83)
-* C-c C-c <1>: Previewing LaTeX fragments.
- (line 15)
-* C-c C-c <2>: Clocking commands. (line 41)
-* C-c C-c <3>: The clock table. (line 15)
-* C-c C-c <4>: Clocking commands. (line 41)
-* C-c C-c <5>: Using capture. (line 15)
-* C-c C-c <6>: Cooperation. (line 52)
-* C-c C-c <7>: The very busy C-c C-c key.
- (line 6)
-* C-c C-c <8>: Plain lists. (line 129)
-* C-c C-c <9>: Footnotes. (line 87)
-* C-c C-c <10>: Built-in table editor.
- (line 57)
-* C-c C-c <11>: Capturing column view.
- (line 51)
-* C-c C-c <12>: Using column view. (line 52)
-* C-c C-c <13>: Editing and debugging formulas.
- (line 91)
-* C-c C-c <14>: Key bindings and useful functions.
- (line 11)
-* C-c C-c <15>: Property syntax. (line 57)
-* C-c C-c <16>: Evaluating code blocks.
- (line 13)
-* C-c C-c <17>: Checkboxes. (line 52)
-* C-c C-c: Setting tags. (line 18)
-* C-c C-c c: Property syntax. (line 75)
-* C-c C-c d: Property syntax. (line 69)
-* C-c C-c D: Property syntax. (line 72)
-* C-c C-c s: Property syntax. (line 61)
-* C-c C-d <1>: Inserting deadline/schedule.
- (line 9)
-* C-c C-d: Agenda commands. (line 335)
-* C-c C-e: The export dispatcher.
- (line 12)
-* C-c C-e A: ASCII/Latin-1/UTF-8 export.
- (line 18)
-* C-c C-e a: ASCII/Latin-1/UTF-8 export.
- (line 11)
-* C-c C-e b: HTML Export commands.
- (line 13)
-* C-c C-e c: iCalendar export. (line 39)
-* C-c C-e D: DocBook export commands.
- (line 6)
-* C-c C-e d: LaTeX/PDF export commands.
- (line 31)
-* C-c C-e E: Triggering publication.
- (line 16)
-* C-c C-e F: Triggering publication.
- (line 13)
-* C-c C-e H: HTML Export commands.
- (line 16)
-* C-c C-e h: HTML Export commands.
- (line 6)
-* C-c C-e I: iCalendar export. (line 34)
-* C-c C-e i: iCalendar export. (line 32)
-* C-c C-e j: TaskJuggler export. (line 24)
-* C-c C-e J: TaskJuggler export. (line 27)
-* C-c C-e l: LaTeX/PDF export commands.
- (line 6)
-* C-c C-e L: LaTeX/PDF export commands.
- (line 13)
-* C-c C-e m: Freemind export. (line 8)
-* C-c C-e N: ASCII/Latin-1/UTF-8 export.
- (line 24)
-* C-c C-e n: ASCII/Latin-1/UTF-8 export.
- (line 21)
-* C-c C-e P: Triggering publication.
- (line 10)
-* C-c C-e p: LaTeX/PDF export commands.
- (line 28)
-* C-c C-e R: HTML Export commands.
- (line 19)
-* C-c C-e t: Export options. (line 16)
-* C-c C-e U: ASCII/Latin-1/UTF-8 export.
- (line 28)
-* C-c C-e u: ASCII/Latin-1/UTF-8 export.
- (line 25)
-* C-c C-e V: DocBook export commands.
- (line 13)
-* C-c C-e v <1>: The export dispatcher.
- (line 17)
-* C-c C-e v: Sparse trees. (line 47)
-* C-c C-e v D: DocBook export commands.
- (line 32)
-* C-c C-e v x: XOXO export. (line 11)
-* C-c C-e X: Triggering publication.
- (line 8)
-* C-c C-e x: XOXO export. (line 10)
-* C-c C-f: Motion. (line 12)
-* C-c C-j: Motion. (line 21)
-* C-c C-k <1>: Visibility cycling. (line 43)
-* C-c C-k: Using capture. (line 31)
-* C-c C-l: Handling links. (line 65)
-* C-c C-n: Motion. (line 8)
-* C-c C-o <1>: Handling links. (line 101)
-* C-c C-o <2>: Agenda commands. (line 56)
-* C-c C-o <3>: Key bindings and useful functions.
- (line 11)
-* C-c C-o <4>: Footnotes. (line 91)
-* C-c C-o: Creating timestamps. (line 35)
-* C-c C-p: Motion. (line 9)
-* C-c C-q <1>: Editing and debugging formulas.
- (line 49)
-* C-c C-q: Setting tags. (line 10)
-* C-c C-r <1>: Visibility cycling. (line 34)
-* C-c C-r: Editing and debugging formulas.
- (line 52)
-* C-c C-s <1>: Inserting deadline/schedule.
- (line 14)
-* C-c C-s: Agenda commands. (line 331)
-* C-c C-t <1>: TODO basics. (line 13)
-* C-c C-t: Clocking commands. (line 46)
-* C-c C-u: Motion. (line 18)
-* C-c C-v a: Key bindings and useful functions.
- (line 18)
-* C-c C-v b: Key bindings and useful functions.
- (line 18)
-* C-c C-v C-a: Key bindings and useful functions.
- (line 18)
-* C-c C-v C-b: Key bindings and useful functions.
- (line 18)
-* C-c C-v C-f: Key bindings and useful functions.
- (line 20)
-* C-c C-v C-l: Key bindings and useful functions.
- (line 25)
-* C-c C-v C-p: Key bindings and useful functions.
- (line 26)
-* C-c C-v C-s: Key bindings and useful functions.
- (line 28)
-* C-c C-v C-t: Key bindings and useful functions.
- (line 30)
-* C-c C-v C-z: Key bindings and useful functions.
- (line 32)
-* C-c C-v f: Key bindings and useful functions.
- (line 20)
-* C-c C-v g: Key bindings and useful functions.
- (line 22)
-* C-c C-v h: Key bindings and useful functions.
- (line 24)
-* C-c C-v i: Library of Babel. (line 16)
-* C-c C-v l: Key bindings and useful functions.
- (line 25)
-* C-c C-v p: Key bindings and useful functions.
- (line 26)
-* C-c C-v s: Key bindings and useful functions.
- (line 28)
-* C-c C-v t <1>: Extracting source code.
- (line 26)
-* C-c C-v t: Key bindings and useful functions.
- (line 30)
-* C-c C-v z: Key bindings and useful functions.
- (line 32)
-* C-c C-w <1>: Structure editing. (line 90)
-* C-c C-w <2>: Agenda commands. (line 278)
-* C-c C-w <3>: Refiling notes. (line 11)
-* C-c C-w: Using capture. (line 22)
-* C-c C-x ,: Relative timer. (line 21)
-* C-c C-x -: Relative timer. (line 13)
-* C-c C-x .: Relative timer. (line 10)
-* C-c C-x 0: Relative timer. (line 30)
-* C-c C-x ;: Countdown timer. (line 6)
-* C-c C-x <: Agenda files. (line 42)
-* C-c C-x > <1>: Agenda commands. (line 172)
-* C-c C-x >: Agenda files. (line 49)
-* C-c C-x \ <1>: Subscripts and superscripts.
- (line 27)
-* C-c C-x \: Special symbols. (line 31)
-* C-c C-x A <1>: Internal archiving. (line 49)
-* C-c C-x A: Agenda commands. (line 289)
-* C-c C-x a <1>: Agenda commands. (line 286)
-* C-c C-x a: Internal archiving. (line 36)
-* C-c C-x b <1>: Visibility cycling. (line 47)
-* C-c C-x b: Agenda commands. (line 47)
-* C-c C-x c: Structure editing. (line 82)
-* C-c C-x C-a <1>: Agenda commands. (line 281)
-* C-c C-x C-a: Archiving. (line 11)
-* C-c C-x C-b: Checkboxes. (line 55)
-* C-c C-x C-c <1>: Using column view. (line 9)
-* C-c C-x C-c <2>: Agenda column view. (line 11)
-* C-c C-x C-c: Agenda commands. (line 161)
-* C-c C-x C-d: Clocking commands. (line 59)
-* C-c C-x C-e <1>: Clocking commands. (line 38)
-* C-c C-x C-e: Effort estimates. (line 17)
-* C-c C-x C-i: Clocking commands. (line 6)
-* C-c C-x C-j: Clocking commands. (line 54)
-* C-c C-x C-k: Inserting deadline/schedule.
- (line 22)
-* C-c C-x C-l: Previewing LaTeX fragments.
- (line 9)
-* C-c C-x C-n: Handling links. (line 150)
-* C-c C-x C-o: Clocking commands. (line 30)
-* C-c C-x C-p: Handling links. (line 150)
-* C-c C-x C-r: The clock table. (line 10)
-* C-c C-x C-s <1>: Agenda commands. (line 293)
-* C-c C-x C-s: Moving subtrees. (line 9)
-* C-c C-x C-t: Custom time format. (line 12)
-* C-c C-x C-u <1>: Capturing column view.
- (line 51)
-* C-c C-x C-u <2>: Dynamic blocks. (line 21)
-* C-c C-x C-u: The clock table. (line 15)
-* C-c C-x C-v: Handling links. (line 131)
-* C-c C-x C-w <1>: Built-in table editor.
- (line 130)
-* C-c C-x C-w: Structure editing. (line 56)
-* C-c C-x C-x: Clocking commands. (line 50)
-* C-c C-x C-y <1>: Built-in table editor.
- (line 134)
-* C-c C-x C-y: Structure editing. (line 64)
-* C-c C-x e: Effort estimates. (line 14)
-* C-c C-x f: Footnotes. (line 51)
-* C-c C-x G: RSS Feeds. (line 27)
-* C-c C-x g: RSS Feeds. (line 23)
-* C-c C-x i: Capturing column view.
- (line 49)
-* C-c C-x M-w <1>: Structure editing. (line 60)
-* C-c C-x M-w: Built-in table editor.
- (line 126)
-* C-c C-x o <1>: Checkboxes. (line 75)
-* C-c C-x o: TODO dependencies. (line 29)
-* C-c C-x p <1>: Header arguments in Org-mode properties.
- (line 23)
-* C-c C-x p: Property syntax. (line 48)
-* C-c C-y <1>: Creating timestamps. (line 56)
-* C-c C-y: Clocking commands. (line 41)
-* C-c C-z <1>: Agenda commands. (line 323)
-* C-c C-z: Drawers. (line 28)
-* C-c l <1>: Handling links. (line 9)
-* C-c l: Literal examples. (line 73)
-* C-c { <1>: Editing and debugging formulas.
- (line 32)
-* C-c {: CDLaTeX mode. (line 20)
-* C-c |: Built-in table editor.
- (line 41)
-* C-c }: Editing and debugging formulas.
- (line 80)
-* C-c ~: Cooperation. (line 63)
-* C-k: Agenda commands. (line 272)
-* C-S-<left> <1>: Multiple sets in one file.
- (line 25)
-* C-S-<left>: Agenda commands. (line 270)
-* C-S-<RET>: Structure editing. (line 27)
-* C-S-<right> <1>: Agenda commands. (line 267)
-* C-S-<right>: Multiple sets in one file.
- (line 25)
-* C-TAB: Internal archiving. (line 46)
-* C-u C-c !: Creating timestamps. (line 19)
-* C-u C-c *: Updating the table. (line 16)
-* C-u C-c .: Creating timestamps. (line 19)
-* C-u C-c = <1>: Field formulas. (line 26)
-* C-u C-c =: Editing and debugging formulas.
- (line 13)
-* C-u C-c c: Using capture. (line 43)
-* C-u C-c C-c: Updating the table. (line 19)
-* C-u C-c C-l: Handling links. (line 86)
-* C-u C-c C-t: TODO basics. (line 22)
-* C-u C-c C-w: Refiling notes. (line 28)
-* C-u C-c C-x ,: Relative timer. (line 25)
-* C-u C-c C-x a: Internal archiving. (line 39)
-* C-u C-c C-x C-s: Moving subtrees. (line 11)
-* C-u C-c C-x C-u <1>: Capturing column view.
- (line 55)
-* C-u C-c C-x C-u <2>: Dynamic blocks. (line 22)
-* C-u C-c C-x C-u: The clock table. (line 19)
-* C-u C-u <TAB>: Visibility cycling. (line 68)
-* C-u C-u C-c *: Updating the table. (line 22)
-* C-u C-u C-c =: Editing and debugging formulas.
- (line 16)
-* C-u C-u C-c c: Using capture. (line 45)
-* C-u C-u C-c C-c: Updating the table. (line 22)
-* C-u C-u C-c C-e: The export dispatcher.
- (line 21)
-* C-u C-u C-c C-t: Multiple sets in one file.
- (line 25)
-* C-u C-u C-c C-w: Refiling notes. (line 31)
-* C-u C-u C-u <TAB>: Visibility cycling. (line 33)
-* C-u C-u C-u C-c C-t: TODO dependencies. (line 34)
-* C-up: Key bindings and useful functions.
- (line 12)
-* C-v: The date/time prompt.
- (line 76)
-* C-x C-s <1>: Editing and debugging formulas.
- (line 46)
-* C-x C-s: Agenda commands. (line 157)
-* C-x C-w <1>: Exporting Agenda Views.
- (line 12)
-* C-x C-w: Agenda commands. (line 472)
-* C-x n s: Structure editing. (line 107)
-* C-x n w: Structure editing. (line 110)
-* C-y: Structure editing. (line 70)
-* d: Agenda commands. (line 65)
-* D: Agenda commands. (line 99)
-* e: Using column view. (line 46)
-* E: Agenda commands. (line 135)
-* F: Agenda commands. (line 40)
-* f: Agenda commands. (line 81)
-* g <1>: Using column view. (line 23)
-* g: Agenda commands. (line 154)
-* G: Agenda commands. (line 143)
-* H: Agenda commands. (line 459)
-* i: Agenda commands. (line 427)
-* I: Agenda commands. (line 370)
-* J: Agenda commands. (line 96)
-* j: Agenda commands. (line 93)
-* J: Agenda commands. (line 380)
-* k: Agenda commands. (line 338)
-* k a: Inserting deadline/schedule.
- (line 25)
-* k s: Inserting deadline/schedule.
- (line 25)
-* l: Agenda commands. (line 103)
-* L: Agenda commands. (line 31)
-* m: Agenda commands. (line 388)
-* M: Agenda commands. (line 446)
-* M-<down> <1>: Built-in table editor.
- (line 90)
-* M-<down>: Editing and debugging formulas.
- (line 76)
-* M-<left> <1>: Plain lists. (line 110)
-* M-<left> <2>: Built-in table editor.
- (line 82)
-* M-<left>: Structure editing. (line 38)
-* M-<RET> <1>: Built-in table editor.
- (line 141)
-* M-<RET> <2>: Plain lists. (line 74)
-* M-<RET> <3>: Structure editing. (line 6)
-* M-<RET>: Relative timer. (line 17)
-* M-<right> <1>: Built-in table editor.
- (line 82)
-* M-<right> <2>: Structure editing. (line 41)
-* M-<right>: Plain lists. (line 110)
-* M-<TAB> <1>: Per-file keywords. (line 24)
-* M-<TAB> <2>: Property syntax. (line 45)
-* M-<TAB> <3>: Completion. (line 16)
-* M-<TAB> <4>: Setting tags. (line 6)
-* M-<TAB>: Editing and debugging formulas.
- (line 63)
-* M-<up> <1>: Built-in table editor.
- (line 90)
-* M-<up>: Editing and debugging formulas.
- (line 76)
-* M-a: Built-in table editor.
- (line 70)
-* M-down: Key bindings and useful functions.
- (line 13)
-* M-e: Built-in table editor.
- (line 74)
-* M-S-<down> <1>: Structure editing. (line 53)
-* M-S-<down> <2>: Built-in table editor.
- (line 97)
-* M-S-<down> <3>: Editing and debugging formulas.
- (line 71)
-* M-S-<down>: Plain lists. (line 104)
-* M-S-<left> <1>: Built-in table editor.
- (line 84)
-* M-S-<left> <2>: The date/time prompt.
- (line 76)
-* M-S-<left> <3>: Structure editing. (line 44)
-* M-S-<left>: Plain lists. (line 115)
-* M-S-<RET> <1>: Structure editing. (line 23)
-* M-S-<RET> <2>: Checkboxes. (line 72)
-* M-S-<RET>: Plain lists. (line 88)
-* M-S-<right> <1>: The date/time prompt.
- (line 76)
-* M-S-<right> <2>: Structure editing. (line 47)
-* M-S-<right> <3>: Built-in table editor.
- (line 87)
-* M-S-<right>: Plain lists. (line 115)
-* M-S-<up> <1>: Editing and debugging formulas.
- (line 71)
-* M-S-<up> <2>: Built-in table editor.
- (line 94)
-* M-S-<up> <3>: Plain lists. (line 104)
-* M-S-<up>: Structure editing. (line 50)
-* M-v: The date/time prompt.
- (line 76)
-* M-x org-iswitchb: Agenda files. (line 26)
-* mouse-1 <1>: Footnotes. (line 91)
-* mouse-1 <2>: Handling links. (line 122)
-* mouse-1: The date/time prompt.
- (line 76)
-* mouse-2 <1>: Agenda commands. (line 34)
-* mouse-2 <2>: Footnotes. (line 91)
-* mouse-2: Handling links. (line 122)
-* mouse-3 <1>: Handling links. (line 127)
-* mouse-3: Agenda commands. (line 28)
-* n <1>: Using column view. (line 42)
-* n: Agenda commands. (line 19)
-* o: Agenda commands. (line 64)
-* O: Agenda commands. (line 374)
-* p <1>: Using column view. (line 42)
-* p: Agenda commands. (line 20)
-* P: Agenda commands. (line 312)
-* q <1>: Using column view. (line 26)
-* q: Agenda commands. (line 485)
-* r <1>: Agenda commands. (line 147)
-* r <2>: Global TODO list. (line 23)
-* r: Using column view. (line 19)
-* R: Agenda commands. (line 125)
-* S: Agenda commands. (line 450)
-* s: Agenda commands. (line 157)
-* S-<down> <1>: Priorities. (line 29)
-* S-<down> <2>: Agenda commands. (line 320)
-* S-<down> <3>: Creating timestamps. (line 44)
-* S-<down> <4>: Plain lists. (line 97)
-* S-<down> <5>: Editing and debugging formulas.
- (line 66)
-* S-<down>: The date/time prompt.
- (line 76)
-* S-<left> <1>: Creating timestamps. (line 39)
-* S-<left> <2>: Plain lists. (line 151)
-* S-<left> <3>: The date/time prompt.
- (line 76)
-* S-<left> <4>: Using column view. (line 35)
-* S-<left> <5>: The clock table. (line 23)
-* S-<left> <6>: TODO basics. (line 28)
-* S-<left> <7>: Editing and debugging formulas.
- (line 66)
-* S-<left> <8>: Multiple sets in one file.
- (line 32)
-* S-<left> <9>: Agenda commands. (line 361)
-* S-<left>: Property syntax. (line 65)
-* S-<RET>: Built-in table editor.
- (line 159)
-* S-<right> <1>: Using column view. (line 35)
-* S-<right> <2>: Multiple sets in one file.
- (line 32)
-* S-<right> <3>: Creating timestamps. (line 39)
-* S-<right> <4>: TODO basics. (line 28)
-* S-<right> <5>: The date/time prompt.
- (line 76)
-* S-<right> <6>: Plain lists. (line 151)
-* S-<right> <7>: Editing and debugging formulas.
- (line 66)
-* S-<right> <8>: Agenda commands. (line 350)
-* S-<right> <9>: The clock table. (line 23)
-* S-<right>: Property syntax. (line 65)
-* S-<TAB> <1>: Built-in table editor.
- (line 62)
-* S-<TAB>: Visibility cycling. (line 22)
-* S-<up> <1>: Priorities. (line 29)
-* S-<up> <2>: Creating timestamps. (line 44)
-* S-<up> <3>: The date/time prompt.
- (line 76)
-* S-<up> <4>: Editing and debugging formulas.
- (line 66)
-* S-<up>: Agenda commands. (line 315)
-* S-M-<left>: Using column view. (line 75)
-* S-M-<RET>: TODO basics. (line 52)
-* S-M-<right>: Using column view. (line 72)
-* t: Agenda commands. (line 263)
-* T: Agenda commands. (line 298)
-* U: Agenda commands. (line 393)
-* u: Agenda commands. (line 390)
-* v: Using column view. (line 55)
-* v [: Agenda commands. (line 114)
-* v a: Agenda commands. (line 118)
-* v A: Agenda commands. (line 121)
-* v d: Agenda commands. (line 65)
-* v E: Agenda commands. (line 135)
-* v L: Agenda commands. (line 106)
-* v l: Agenda commands. (line 103)
-* v m: Agenda commands. (line 69)
-* v R: Agenda commands. (line 125)
-* v w: Agenda commands. (line 68)
-* v y: Agenda commands. (line 70)
-* w: Agenda commands. (line 68)
-* x: Agenda commands. (line 486)
-* X: Agenda commands. (line 377)
-* z: Agenda commands. (line 323)
-* {: Agenda commands. (line 245)
-* }: Agenda commands. (line 245)
-
-
-File: org, Node: Command and Function Index, Next: Variable Index, Prev: Key Index, Up: Top
-
-Command and function index
-**************************
-
-
-* Menu:
-
-* <1>: Agenda commands. (line 238)
-* <2>: Tag searches. (line 9)
-* : Property searches. (line 9)
-* lisp-complete-symbol: Editing and debugging formulas.
- (line 63)
-* org-aganda-day-view: Agenda commands. (line 65)
-* org-agenda-action: Agenda commands. (line 338)
-* org-agenda-add-note: Agenda commands. (line 323)
-* org-agenda-archive: Agenda commands. (line 293)
-* org-agenda-archive-default-with-confirmation: Agenda commands.
- (line 281)
-* org-agenda-archive-to-archive-sibling: Agenda commands. (line 289)
-* org-agenda-archives-mode: Agenda commands. (line 118)
-* org-agenda-archives-mode 'files: Agenda commands. (line 121)
-* org-agenda-bulk-action: Agenda commands. (line 396)
-* org-agenda-bulk-mark: Agenda commands. (line 388)
-* org-agenda-bulk-remove-all-marks: Agenda commands. (line 393)
-* org-agenda-bulk-unmark: Agenda commands. (line 390)
-* org-agenda-clock-cancel: Agenda commands. (line 377)
-* org-agenda-clock-goto: Agenda commands. (line 96)
-* org-agenda-clock-in: Agenda commands. (line 370)
-* org-agenda-clock-out: Agenda commands. (line 374)
-* org-agenda-clockreport-mode: Agenda commands. (line 125)
-* org-agenda-columns <1>: Agenda commands. (line 161)
-* org-agenda-columns: Agenda column view. (line 11)
-* org-agenda-convert-date: Agenda commands. (line 455)
-* org-agenda-date-prompt: Agenda commands. (line 365)
-* org-agenda-deadline: Agenda commands. (line 335)
-* org-agenda-diary-entry: Agenda commands. (line 427)
-* org-agenda-do-date-earlier: Agenda commands. (line 361)
-* org-agenda-do-date-later: Agenda commands. (line 350)
-* org-agenda-earlier: Agenda commands. (line 87)
-* org-agenda-entry-text-mode: Agenda commands. (line 135)
-* org-agenda-exit: Agenda commands. (line 486)
-* org-agenda-filter-by-tag: Agenda commands. (line 179)
-* org-agenda-follow-mode: Agenda commands. (line 40)
-* org-agenda-goto: Agenda commands. (line 34)
-* org-agenda-goto-calendar: Agenda commands. (line 422)
-* org-agenda-goto-date: Agenda commands. (line 93)
-* org-agenda-goto-today: Agenda commands. (line 90)
-* org-agenda-holidays: Agenda commands. (line 459)
-* org-agenda-kill: Agenda commands. (line 272)
-* org-agenda-later: Agenda commands. (line 81)
-* org-agenda-list: Weekly/daily agenda. (line 9)
-* org-agenda-list-stuck-projects: Stuck projects. (line 13)
-* org-agenda-log-mode: Agenda commands. (line 103)
-* org-agenda-manipulate-query-add: Agenda commands. (line 114)
-* org-agenda-month-view: Agenda commands. (line 69)
-* org-agenda-month-year: Agenda commands. (line 70)
-* org-agenda-next-line: Agenda commands. (line 19)
-* org-agenda-open-link: Agenda commands. (line 56)
-* org-agenda-phases-of-moon: Agenda commands. (line 446)
-* org-agenda-previous-line: Agenda commands. (line 20)
-* org-agenda-priority-down: Agenda commands. (line 320)
-* org-agenda-priority-up: Agenda commands. (line 315)
-* org-agenda-quit: Agenda commands. (line 485)
-* org-agenda-recenter: Agenda commands. (line 31)
-* org-agenda-refile: Agenda commands. (line 278)
-* org-agenda-remove-restriction-lock <1>: Agenda files. (line 60)
-* org-agenda-remove-restriction-lock: Agenda commands. (line 172)
-* org-agenda-rodo: Agenda commands. (line 154)
-* org-agenda-schedule: Agenda commands. (line 331)
-* org-agenda-set-restriction-lock: Agenda files. (line 42)
-* org-agenda-set-tags: Agenda commands. (line 303)
-* org-agenda-show-and-scroll-up: Agenda commands. (line 28)
-* org-agenda-show-priority: Agenda commands. (line 312)
-* org-agenda-show-tags: Agenda commands. (line 298)
-* org-agenda-sunrise-sunset: Agenda commands. (line 450)
-* org-agenda-switch-to: Agenda commands. (line 37)
-* org-agenda-to-front: Agenda files. (line 15)
-* org-agenda-todo: Agenda commands. (line 263)
-* org-agenda-todo-nextset: Agenda commands. (line 267)
-* org-agenda-todo-previousset: Agenda commands. (line 270)
-* org-agenda-toggle-archive-tag: Agenda commands. (line 286)
-* org-agenda-toggle-diary: Agenda commands. (line 99)
-* org-agenda-toggle-time-grid: Agenda commands. (line 143)
-* org-agenda-tree-to-indirect-buffer: Agenda commands. (line 47)
-* org-agenda-undo: Agenda commands. (line 259)
-* org-archive-subtree: Moving subtrees. (line 9)
-* org-archive-subtree-default: Archiving. (line 11)
-* org-archive-to-archive-sibling: Internal archiving. (line 49)
-* org-attach <1>: Attachments. (line 26)
-* org-attach: Agenda commands. (line 328)
-* org-attach-attach: Attachments. (line 31)
-* org-attach-delete-all: Attachments. (line 66)
-* org-attach-delete-one: Attachments. (line 63)
-* org-attach-new: Attachments. (line 41)
-* org-attach-open: Attachments. (line 48)
-* org-attach-open-in-emacs: Attachments. (line 54)
-* org-attach-reveal: Attachments. (line 57)
-* org-attach-reveal-in-emacs: Attachments. (line 60)
-* org-attach-set-directory: Attachments. (line 70)
-* org-attach-set-inherit: Attachments. (line 75)
-* org-attach-sync: Attachments. (line 44)
-* org-backward-same-level: Motion. (line 15)
-* org-beamer-select-environment: Beamer class export. (line 83)
-* org-buffer-property-keys: Using the property API.
- (line 35)
-* org-calendar-goto-agenda: Agenda commands. (line 423)
-* org-capture: Using capture. (line 6)
-* org-capture-finalize: Using capture. (line 15)
-* org-capture-kill: Using capture. (line 31)
-* org-capture-refile: Using capture. (line 22)
-* org-check-after-date: Inserting deadline/schedule.
- (line 38)
-* org-check-before-date: Inserting deadline/schedule.
- (line 35)
-* org-check-deadlines: Inserting deadline/schedule.
- (line 28)
-* org-clock-cancel: Clocking commands. (line 50)
-* org-clock-display: Clocking commands. (line 59)
-* org-clock-goto: Clocking commands. (line 54)
-* org-clock-in: Clocking commands. (line 6)
-* org-clock-modify-effort-estimate <1>: Effort estimates. (line 17)
-* org-clock-modify-effort-estimate: Clocking commands. (line 38)
-* org-clock-out: Clocking commands. (line 30)
-* org-clock-report: The clock table. (line 10)
-* org-clocktable-try-shift: The clock table. (line 23)
-* org-clone-subtree-with-time-shift: Structure editing. (line 82)
-* org-columns: Using column view. (line 9)
-* org-columns-delete: Using column view. (line 75)
-* org-columns-edit-allowed: Using column view. (line 59)
-* org-columns-edit-value: Using column view. (line 46)
-* org-columns-narrow: Using column view. (line 70)
-* org-columns-new: Using column view. (line 72)
-* org-columns-next-allowed-value: Using column view. (line 42)
-* org-columns-previous-allowed-value: Using column view. (line 42)
-* org-columns-quit: Using column view. (line 26)
-* org-columns-redo: Using column view. (line 19)
-* org-columns-set-tags-or-toggle: Using column view. (line 52)
-* org-columns-show-value: Using column view. (line 55)
-* org-columns-widen: Using column view. (line 70)
-* org-complete: Property syntax. (line 45)
-* org-compute-property-at-point: Property syntax. (line 75)
-* org-copy-subtree: Structure editing. (line 60)
-* org-cut-subtree: Structure editing. (line 56)
-* org-cycle <1>: Visibility cycling. (line 10)
-* org-cycle <2>: Structure editing. (line 32)
-* org-cycle: Plain lists. (line 91)
-* org-cycle-agenda-files: Agenda files. (line 22)
-* org-date-from-calendar: Creating timestamps. (line 26)
-* org-dblock-update <1>: The clock table. (line 15)
-* org-dblock-update <2>: Dynamic blocks. (line 21)
-* org-dblock-update: Capturing column view.
- (line 51)
-* org-deadline: Inserting deadline/schedule.
- (line 9)
-* org-delete-property: Property syntax. (line 69)
-* org-delete-property-globally: Property syntax. (line 72)
-* org-demote: Using the mapping API.
- (line 82)
-* org-demote-subtree: Structure editing. (line 47)
-* org-do-demote: Structure editing. (line 41)
-* org-do-promote: Structure editing. (line 38)
-* org-edit-special: Cooperation. (line 61)
-* org-entry-add-to-multivalued-property: Using the property API.
- (line 51)
-* org-entry-delete: Using the property API.
- (line 29)
-* org-entry-get: Using the property API.
- (line 20)
-* org-entry-get-multivalued-property: Using the property API.
- (line 47)
-* org-entry-member-in-multivalued-property: Using the property API.
- (line 61)
-* org-entry-properties: Using the property API.
- (line 10)
-* org-entry-put: Using the property API.
- (line 32)
-* org-entry-put-multivalued-property: Using the property API.
- (line 42)
-* org-entry-remove-from-multivalued-property: Using the property API.
- (line 56)
-* org-evaluate-time-range <1>: Creating timestamps. (line 56)
-* org-evaluate-time-range: Clocking commands. (line 41)
-* org-export: The export dispatcher.
- (line 21)
-* org-export-as-ascii: ASCII/Latin-1/UTF-8 export.
- (line 11)
-* org-export-as-ascii-to-buffer: ASCII/Latin-1/UTF-8 export.
- (line 18)
-* org-export-as-docbook: DocBook export commands.
- (line 6)
-* org-export-as-docbook-pdf-and-open: DocBook export commands.
- (line 13)
-* org-export-as-freemind: Freemind export. (line 8)
-* org-export-as-html: HTML Export commands.
- (line 6)
-* org-export-as-html-and-open: HTML Export commands.
- (line 13)
-* org-export-as-html-to-buffer: HTML Export commands.
- (line 16)
-* org-export-as-latex: LaTeX/PDF export commands.
- (line 6)
-* org-export-as-latex-to-buffer: LaTeX/PDF export commands.
- (line 13)
-* org-export-as-latin1: ASCII/Latin-1/UTF-8 export.
- (line 21)
-* org-export-as-latin1-to-buffer: ASCII/Latin-1/UTF-8 export.
- (line 24)
-* org-export-as-pdf: LaTeX/PDF export commands.
- (line 28)
-* org-export-as-pdf-and-open: LaTeX/PDF export commands.
- (line 31)
-* org-export-as-taskjuggler: TaskJuggler export. (line 24)
-* org-export-as-taskjuggler-and-open: TaskJuggler export. (line 27)
-* org-export-as-utf8: ASCII/Latin-1/UTF-8 export.
- (line 25)
-* org-export-as-utf8-to-buffer: ASCII/Latin-1/UTF-8 export.
- (line 28)
-* org-export-as-xoxo: XOXO export. (line 10)
-* org-export-icalendar-all-agenda-files: iCalendar export. (line 34)
-* org-export-icalendar-combine-agenda-files: iCalendar export.
- (line 39)
-* org-export-icalendar-this-file: iCalendar export. (line 32)
-* org-export-region-as-html: HTML Export commands.
- (line 19)
-* org-export-visible: The export dispatcher.
- (line 17)
-* org-feed-goto-inbox: RSS Feeds. (line 27)
-* org-feed-update-all: RSS Feeds. (line 23)
-* org-force-cycle-archived: Internal archiving. (line 46)
-* org-forward-same-level: Motion. (line 12)
-* org-global-cycle: Visibility cycling. (line 22)
-* org-goto: Motion. (line 21)
-* org-goto-calendar: Creating timestamps. (line 30)
-* org-insert-columns-dblock: Capturing column view.
- (line 49)
-* org-insert-export-options-template: Export options. (line 16)
-* org-insert-heading <1>: Structure editing. (line 6)
-* org-insert-heading <2>: Relative timer. (line 17)
-* org-insert-heading: Plain lists. (line 74)
-* org-insert-heading-respect-content: Structure editing. (line 18)
-* org-insert-link: Handling links. (line 65)
-* org-insert-property-drawer <1>: Property syntax. (line 55)
-* org-insert-property-drawer: Using the property API.
- (line 38)
-* org-insert-todo-heading <1>: Structure editing. (line 23)
-* org-insert-todo-heading <2>: Checkboxes. (line 72)
-* org-insert-todo-heading: TODO basics. (line 52)
-* org-insert-todo-heading-respect-content: Structure editing. (line 27)
-* org-map-entries: Using the mapping API.
- (line 13)
-* org-mark-entry-for-agenda-action: Inserting deadline/schedule.
- (line 22)
-* org-mark-ring-goto: Handling links. (line 144)
-* org-mark-ring-push: Handling links. (line 140)
-* org-move-subtree-down: Structure editing. (line 53)
-* org-move-subtree-up: Structure editing. (line 50)
-* org-narrow-to-subtree: Structure editing. (line 107)
-* org-next-link: Handling links. (line 150)
-* org-occur: Sparse trees. (line 17)
-* org-open-at-point <1>: Handling links. (line 101)
-* org-open-at-point: Creating timestamps. (line 35)
-* org-paste-subtree: Structure editing. (line 64)
-* org-previous-link: Handling links. (line 150)
-* org-priority <1>: Using the mapping API.
- (line 70)
-* org-priority: Priorities. (line 24)
-* org-priority-down: Priorities. (line 29)
-* org-priority-up: Priorities. (line 29)
-* org-promote: Using the mapping API.
- (line 79)
-* org-promote-subtree: Structure editing. (line 44)
-* org-property-action: Property syntax. (line 57)
-* org-property-next-allowed-value: Property syntax. (line 65)
-* org-property-previous-allowed-value: Property syntax. (line 65)
-* org-publish: Triggering publication.
- (line 8)
-* org-publish-all: Triggering publication.
- (line 16)
-* org-publish-current-file: Triggering publication.
- (line 13)
-* org-publish-current-project: Triggering publication.
- (line 10)
-* org-refile <1>: Structure editing. (line 90)
-* org-refile: Refiling notes. (line 11)
-* org-refile-cache-clear: Refiling notes. (line 40)
-* org-refile-goto-last-stored: Refiling notes. (line 31)
-* org-remove-file: Agenda files. (line 19)
-* org-reveal: Visibility cycling. (line 34)
-* org-save-all-org-buffers: Agenda commands. (line 157)
-* org-schedule: Inserting deadline/schedule.
- (line 14)
-* org-search-view: Search view. (line 9)
-* org-set-effort: Effort estimates. (line 14)
-* org-set-property: Property syntax. (line 61)
-* org-set-startup-visibility: Visibility cycling. (line 68)
-* org-set-tags-command: Setting tags. (line 18)
-* org-show-todo-key: TODO basics. (line 33)
-* org-sort-entries-or-items: Structure editing. (line 94)
-* org-sparse-tree: Sparse trees. (line 15)
-* org-speedbar-set-agenda-restriction: Agenda files. (line 56)
-* org-store-agenda-views: Exporting Agenda Views.
- (line 65)
-* org-store-link: Handling links. (line 9)
-* org-table-align: Built-in table editor.
- (line 57)
-* org-table-beginning-of-field: Built-in table editor.
- (line 70)
-* org-table-copy-down: Built-in table editor.
- (line 159)
-* org-table-copy-region: Built-in table editor.
- (line 126)
-* org-table-create-or-convert-from-region: Built-in table editor.
- (line 187)
-* org-table-create-with-table.el: Cooperation. (line 63)
-* org-table-cut-region: Built-in table editor.
- (line 130)
-* org-table-delete-column: Built-in table editor.
- (line 84)
-* org-table-edit-field: Built-in table editor.
- (line 174)
-* org-table-edit-formulas: Editing and debugging formulas.
- (line 36)
-* org-table-end-of-field: Built-in table editor.
- (line 74)
-* org-table-eval-formula <1>: Editing and debugging formulas.
- (line 13)
-* org-table-eval-formula <2>: Field formulas. (line 26)
-* org-table-eval-formula: Column formulas. (line 27)
-* org-table-export: Built-in table editor.
- (line 195)
-* org-table-fedit-abort: Editing and debugging formulas.
- (line 49)
-* org-table-fedit-finish: Editing and debugging formulas.
- (line 46)
-* org-table-fedit-line-down: Editing and debugging formulas.
- (line 71)
-* org-table-fedit-line-up: Editing and debugging formulas.
- (line 71)
-* org-table-fedit-lisp-indent: Editing and debugging formulas.
- (line 56)
-* org-table-fedit-ref-down: Editing and debugging formulas.
- (line 66)
-* org-table-fedit-ref-left: Editing and debugging formulas.
- (line 66)
-* org-table-fedit-ref-right: Editing and debugging formulas.
- (line 66)
-* org-table-fedit-ref-up: Editing and debugging formulas.
- (line 66)
-* org-table-fedit-scroll-down: Editing and debugging formulas.
- (line 76)
-* org-table-fedit-scroll-up: Editing and debugging formulas.
- (line 76)
-* org-table-fedit-toggle-ref-type: Editing and debugging formulas.
- (line 52)
-* org-table-field-info: Editing and debugging formulas.
- (line 22)
-* org-table-hline-and-move: Built-in table editor.
- (line 105)
-* org-table-insert-column: Built-in table editor.
- (line 87)
-* org-table-insert-hline: Built-in table editor.
- (line 101)
-* org-table-insert-row: Built-in table editor.
- (line 97)
-* org-table-iterate: Updating the table. (line 22)
-* org-table-iterate-buffer-tables: Updating the table. (line 33)
-* org-table-kill-row: Built-in table editor.
- (line 94)
-* org-table-move-column-left: Built-in table editor.
- (line 82)
-* org-table-move-column-right: Built-in table editor.
- (line 82)
-* org-table-move-row-down: Built-in table editor.
- (line 90)
-* org-table-move-row-up: Built-in table editor.
- (line 90)
-* org-table-next-field: Built-in table editor.
- (line 58)
-* org-table-next-row: Built-in table editor.
- (line 65)
-* org-table-paste-rectangle: Built-in table editor.
- (line 134)
-* org-table-previous-field: Built-in table editor.
- (line 62)
-* org-table-recalculate: Updating the table. (line 13)
-* org-table-recalculate-buffer-tables: Updating the table. (line 30)
-* org-table-rotate-recalc-marks: Advanced features. (line 9)
-* org-table-sort-lines: Built-in table editor.
- (line 109)
-* org-table-sum: Built-in table editor.
- (line 156)
-* org-table-toggle-coordinate-overlays: Editing and debugging formulas.
- (line 80)
-* org-table-toggle-formula-debugger: Editing and debugging formulas.
- (line 32)
-* org-table-wrap-region: Built-in table editor.
- (line 141)
-* org-tags-view <1>: Matching tags and properties.
- (line 17)
-* org-tags-view <2>: Tag searches. (line 16)
-* org-tags-view: Property searches. (line 15)
-* org-time-stamp: Creating timestamps. (line 10)
-* org-time-stamp-inactive: Creating timestamps. (line 15)
-* org-timeline: Timeline. (line 10)
-* org-timer: Relative timer. (line 10)
-* org-timer-item: Relative timer. (line 13)
-* org-timer-start: Relative timer. (line 30)
-* org-timestamp-down-day: Creating timestamps. (line 39)
-* org-timestamp-down-down: Creating timestamps. (line 44)
-* org-timestamp-up: Creating timestamps. (line 44)
-* org-timestamp-up-day: Creating timestamps. (line 39)
-* org-todo <1>: Clocking commands. (line 46)
-* org-todo <2>: TODO basics. (line 13)
-* org-todo: Using the mapping API.
- (line 66)
-* org-todo-list <1>: Global TODO list. (line 9)
-* org-todo-list: TODO basics. (line 44)
-* org-toggle-archive-tag: Internal archiving. (line 36)
-* org-toggle-checkbox: Checkboxes. (line 55)
-* org-toggle-heading: Structure editing. (line 113)
-* org-toggle-inline-images: Handling links. (line 131)
-* org-toggle-ordered-property <1>: Checkboxes. (line 75)
-* org-toggle-ordered-property: TODO dependencies. (line 29)
-* org-toggle-tag: Using the mapping API.
- (line 74)
-* org-toggle-time-stamp-overlays: Custom time format. (line 12)
-* org-tree-to-indirect-buffer: Visibility cycling. (line 47)
-* org-update-all-dblocks: Capturing column view.
- (line 55)
-* org-update-statistics-cookies: Checkboxes. (line 83)
-* org-write-agenda <1>: Agenda commands. (line 472)
-* org-write-agenda: Exporting Agenda Views.
- (line 12)
-* org-yank: Structure editing. (line 70)
-* outline-next-visible-heading: Motion. (line 8)
-* outline-previous-visible-heading: Motion. (line 9)
-* outline-up-heading: Motion. (line 18)
-* show-all: Visibility cycling. (line 33)
-* show-branches: Visibility cycling. (line 43)
-* widen: Structure editing. (line 110)
-
-
-File: org, Node: Variable Index, Prev: Command and Function Index, Up: Top
-
-Variable index
-**************
-
-This is not a complete index of variables and faces, only the ones that
-are mentioned in the manual. For a more complete list, use `M-x
-org-customize <RET>' and then click yourself through the tree.
-
-
-* Menu:
-
-* cdlatex-simplify-sub-super-scripts: CDLaTeX mode. (line 32)
-* constants-unit-system <1>: In-buffer settings. (line 139)
-* constants-unit-system: References. (line 106)
-* htmlize-output-type: Exporting Agenda Views.
- (line 21)
-* LaTeX-verbatim-environments: A LaTeX example. (line 21)
-* org-adapt-indentation: Clean view. (line 46)
-* org-agenda-add-entry-text-maxlines: Exporting Agenda Views.
- (line 21)
-* org-agenda-columns-add-appointments-to-effort-sum: Effort estimates.
- (line 41)
-* org-agenda-confirm-kill: Agenda commands. (line 275)
-* org-agenda-custom-commands <1>: Sparse trees. (line 31)
-* org-agenda-custom-commands <2>: Extracting agenda information.
- (line 6)
-* org-agenda-custom-commands <3>: Setting Options. (line 6)
-* org-agenda-custom-commands: Storing searches. (line 9)
-* org-agenda-diary-file: Agenda commands. (line 430)
-* org-agenda-dim-blocked-tasks: TODO dependencies. (line 39)
-* org-agenda-entry-text-maxlines: Agenda commands. (line 138)
-* org-agenda-exporter-settings <1>: Agenda commands. (line 473)
-* org-agenda-exporter-settings: Exporting Agenda Views.
- (line 13)
-* org-agenda-files <1>: iCalendar export. (line 37)
-* org-agenda-files <2>: Sorting of agenda items.
- (line 8)
-* org-agenda-files: Agenda files. (line 6)
-* org-agenda-filter-preset: Agenda commands. (line 180)
-* org-agenda-log-mode-items: Agenda commands. (line 106)
-* org-agenda-ndays: Weekly/daily agenda. (line 15)
-* org-agenda-overriding-header: Special agenda views.
- (line 40)
-* org-agenda-prefix-format: Presentation and sorting.
- (line 6)
-* org-agenda-restore-windows-after-quit: Agenda Views. (line 40)
-* org-agenda-show-inherited-tags: Agenda commands. (line 301)
-* org-agenda-skip-archived-trees: Internal archiving. (line 21)
-* org-agenda-skip-function <1>: Using the mapping API.
- (line 51)
-* org-agenda-skip-function: Special agenda views.
- (line 43)
-* org-agenda-skip-scheduled-if-done: Deadlines and scheduling.
- (line 30)
-* org-agenda-sorting-strategy: Sorting of agenda items.
- (line 27)
-* org-agenda-span: Weekly/daily agenda. (line 15)
-* org-agenda-start-with-clockreport-mode: Agenda commands. (line 128)
-* org-agenda-start-with-entry-text-mode: Agenda commands. (line 138)
-* org-agenda-start-with-follow-mode: Agenda commands. (line 43)
-* org-agenda-tags-todo-honor-ignore-options: Matching tags and properties.
- (line 20)
-* org-agenda-text-search-extra-files <1>: Agenda dispatcher. (line 31)
-* org-agenda-text-search-extra-files: Search view. (line 24)
-* org-agenda-time-grid <1>: Agenda commands. (line 146)
-* org-agenda-time-grid: Time-of-day specifications.
- (line 41)
-* org-agenda-todo-ignore-deadlines: Global TODO list. (line 38)
-* org-agenda-todo-ignore-scheduled: Global TODO list. (line 38)
-* org-agenda-todo-ignore-timestamp: Global TODO list. (line 38)
-* org-agenda-todo-ignore-with-date: Global TODO list. (line 38)
-* org-agenda-todo-list-sublevels <1>: Global TODO list. (line 47)
-* org-agenda-todo-list-sublevels: Breaking down tasks. (line 6)
-* org-agenda-use-time-grid <1>: Time-of-day specifications.
- (line 41)
-* org-agenda-use-time-grid: Agenda commands. (line 146)
-* org-agenda-window-setup: Agenda Views. (line 40)
-* org-archive-default-command <1>: Agenda commands. (line 284)
-* org-archive-default-command: Archiving. (line 12)
-* org-archive-location <1>: In-buffer settings. (line 16)
-* org-archive-location: Moving subtrees. (line 10)
-* org-archive-save-context-info: Moving subtrees. (line 33)
-* org-attach-directory: Attachments. (line 6)
-* org-attach-method: Attachments. (line 32)
-* org-babel-default-header-args <1>: System-wide header arguments.
- (line 6)
-* org-babel-default-header-args: Header arguments in Org-mode properties.
- (line 23)
-* org-calc-default-modes: Formula syntax for Calc.
- (line 14)
-* org-clock-idle-time: Resolving idle time. (line 11)
-* org-clock-into-drawer: Clocking commands. (line 7)
-* org-clock-modeline-total: Clocking commands. (line 16)
-* org-clocktable-defaults: The clock table. (line 37)
-* org-coderef-label-format: Literal examples. (line 57)
-* org-columns-default-format <1>: Agenda commands. (line 164)
-* org-columns-default-format <2>: Agenda column view. (line 18)
-* org-columns-default-format <3>: Effort estimates. (line 31)
-* org-columns-default-format: Using column view. (line 10)
-* org-columns-skip-archived-trees: Internal archiving. (line 31)
-* org-combined-agenda-icalendar-file: iCalendar export. (line 42)
-* org-confirm-babel-evaluate: Code evaluation security.
- (line 34)
-* org-confirm-elisp-link-function: Code evaluation security.
- (line 45)
-* org-confirm-shell-link-function: Code evaluation security.
- (line 42)
-* org-create-file-search-functions: Custom searches. (line 12)
-* org-ctrl-c-ctrl-c-hook: Context-sensitive commands.
- (line 6)
-* org-ctrl-k-protect-subtree: Headlines. (line 6)
-* org-cycle-emulate-tab: Visibility cycling. (line 16)
-* org-cycle-global-at-bob: Visibility cycling. (line 16)
-* org-cycle-include-plain-lists: Plain lists. (line 67)
-* org-cycle-open-archived-trees: Internal archiving. (line 11)
-* org-cycle-separator-lines: Headlines. (line 22)
-* org-deadline-warning-days <1>: Deadlines and scheduling.
- (line 12)
-* org-deadline-warning-days: Inserting deadline/schedule.
- (line 31)
-* org-default-notes-file <1>: Setting up capture. (line 9)
-* org-default-notes-file: Template elements. (line 48)
-* org-default-priority <1>: In-buffer settings. (line 54)
-* org-default-priority: Priorities. (line 38)
-* org-display-custom-times <1>: Custom time format. (line 6)
-* org-display-custom-times: Publishing options. (line 12)
-* org-display-internal-link-with-indirect-buffer: Handling links.
- (line 130)
-* org-disputed-keys: Conflicts. (line 34)
-* org-done (face): Faces for TODO keywords.
- (line 6)
-* org-drawers <1>: In-buffer settings. (line 45)
-* org-drawers: Drawers. (line 6)
-* org-effort-property: Effort estimates. (line 6)
-* org-empty-line-terminates-plain-lists: Plain lists. (line 29)
-* org-enable-table-editor: Built-in table editor.
- (line 30)
-* org-enforce-todo-dependencies: TODO dependencies. (line 6)
-* org-entities <1>: Special characters. (line 6)
-* org-entities: Special symbols. (line 15)
-* org-execute-file-search-functions: Custom searches. (line 12)
-* org-export-ascii-links-to-notes: ASCII/Latin-1/UTF-8 export.
- (line 50)
-* org-export-author-info: Publishing options. (line 12)
-* org-export-creator-info: Publishing options. (line 12)
-* org-export-default-language <1>: Export options. (line 19)
-* org-export-default-language: Publishing options. (line 12)
-* org-export-docbook-default-image-attributes: Images in DocBook export.
- (line 15)
-* org-export-docbook-doctype: Special characters. (line 6)
-* org-export-docbook-inline-image-extensions: Images in DocBook export.
- (line 35)
-* org-export-docbook-xsl-fo-proc-command: DocBook export commands.
- (line 19)
-* org-export-docbook-xslt-proc-command: DocBook export commands.
- (line 19)
-* org-export-docbook-xslt-stylesheet: DocBook export commands.
- (line 25)
-* org-export-email: Publishing options. (line 12)
-* org-export-exclude-tags <1>: Publishing options. (line 12)
-* org-export-exclude-tags: Selective export. (line 6)
-* org-export-headline-levels <1>: Publishing options. (line 12)
-* org-export-headline-levels: Headings and sections.
- (line 6)
-* org-export-highlight-first-table-line: Publishing options. (line 12)
-* org-export-html-auto-postamble: Publishing options. (line 12)
-* org-export-html-auto-preamble: Publishing options. (line 12)
-* org-export-html-expand: Publishing options. (line 12)
-* org-export-html-extension: Publishing options. (line 12)
-* org-export-html-extra: CSS support. (line 37)
-* org-export-html-inline-images <1>: Publishing options. (line 12)
-* org-export-html-inline-images: Images in HTML export.
- (line 6)
-* org-export-html-link-home: Publishing options. (line 12)
-* org-export-html-link-org-files-as-html: Publishing options. (line 12)
-* org-export-html-link-up: Publishing options. (line 12)
-* org-export-html-postamble: Publishing options. (line 12)
-* org-export-html-preamble: Publishing options. (line 12)
-* org-export-html-style <1>: CSS support. (line 37)
-* org-export-html-style: Publishing options. (line 12)
-* org-export-html-style-default: CSS support. (line 37)
-* org-export-html-style-extra: Publishing options. (line 12)
-* org-export-html-style-include-default <1>: Publishing options.
- (line 12)
-* org-export-html-style-include-default: CSS support. (line 37)
-* org-export-html-table-tag <1>: Publishing options. (line 12)
-* org-export-html-table-tag: Tables in HTML export.
- (line 6)
-* org-export-html-tag-class-prefix: CSS support. (line 6)
-* org-export-html-todo-kwd-class-prefix: CSS support. (line 6)
-* org-export-html-use-infojs: JavaScript support. (line 57)
-* org-export-html-with-timestamp: Publishing options. (line 12)
-* org-export-latex-classes: Header and sectioning.
- (line 8)
-* org-export-latex-default-class: Header and sectioning.
- (line 8)
-* org-export-latex-default-packages-alist: Header and sectioning.
- (line 8)
-* org-export-latex-packages-alist: Header and sectioning.
- (line 8)
-* org-export-preserve-breaks: Publishing options. (line 12)
-* org-export-publishing-directory: Publishing options. (line 12)
-* org-export-run-in-background: The export dispatcher.
- (line 24)
-* org-export-section-number-format: Publishing options. (line 12)
-* org-export-select-tags <1>: Selective export. (line 6)
-* org-export-select-tags: Publishing options. (line 12)
-* org-export-skip-text-before-1st-heading <1>: Publishing options.
- (line 12)
-* org-export-skip-text-before-1st-heading: Initial text. (line 12)
-* org-export-taskjuggler-default-reports: TaskJuggler export. (line 119)
-* org-export-taskjuggler-project-tag: TaskJuggler export. (line 34)
-* org-export-taskjuggler-resource-tag: TaskJuggler export. (line 48)
-* org-export-with-archived-trees <1>: Internal archiving. (line 27)
-* org-export-with-archived-trees: Publishing options. (line 12)
-* org-export-with-drawers: Publishing options. (line 12)
-* org-export-with-emphasize: Publishing options. (line 12)
-* org-export-with-fixed-width: Publishing options. (line 12)
-* org-export-with-footnotes: Publishing options. (line 12)
-* org-export-with-LaTeX-fragments <1>: LaTeX fragments. (line 43)
-* org-export-with-LaTeX-fragments: Publishing options. (line 12)
-* org-export-with-priority: Publishing options. (line 12)
-* org-export-with-section-numbers: Publishing options. (line 12)
-* org-export-with-special-strings: Publishing options. (line 12)
-* org-export-with-sub-superscripts <1>: Publishing options. (line 12)
-* org-export-with-sub-superscripts: Subscripts and superscripts.
- (line 15)
-* org-export-with-tables: Publishing options. (line 12)
-* org-export-with-tags: Publishing options. (line 12)
-* org-export-with-TeX-macros: Publishing options. (line 12)
-* org-export-with-timestamps: Publishing options. (line 12)
-* org-export-with-toc <1>: Publishing options. (line 12)
-* org-export-with-toc: Table of contents. (line 6)
-* org-export-with-todo-keywords: Publishing options. (line 12)
-* org-fast-tag-selection-include-todo: Fast access to TODO states.
- (line 16)
-* org-fast-tag-selection-single-key: Setting tags. (line 143)
-* org-file-apps <1>: Attachments. (line 49)
-* org-file-apps: Handling links. (line 104)
-* org-footnote-auto-adjust <1>: In-buffer settings. (line 143)
-* org-footnote-auto-adjust: Footnotes. (line 58)
-* org-footnote-auto-label <1>: Footnotes. (line 44)
-* org-footnote-auto-label: In-buffer settings. (line 143)
-* org-footnote-define-inline <1>: Footnotes. (line 58)
-* org-footnote-define-inline: In-buffer settings. (line 143)
-* org-footnote-section: Footnotes. (line 58)
-* org-format-latex-header: LaTeX fragments. (line 6)
-* org-format-latex-options <1>: Previewing LaTeX fragments.
- (line 20)
-* org-format-latex-options: LaTeX fragments. (line 39)
-* org-from-is-user-regexp: Template expansion. (line 39)
-* org-global-properties <1>: Property syntax. (line 40)
-* org-global-properties: Effort estimates. (line 31)
-* org-goto-auto-isearch: Motion. (line 26)
-* org-goto-interface: Motion. (line 37)
-* org-hide (face): Clean view. (line 66)
-* org-hide-block-startup: Blocks. (line 6)
-* org-hide-leading-stars <1>: Clean view. (line 50)
-* org-hide-leading-stars: In-buffer settings. (line 125)
-* org-hierarchical-checkbox-statistics: Checkboxes. (line 30)
-* org-hierarchical-todo-statistics: Breaking down tasks. (line 25)
-* org-highest-priority <1>: In-buffer settings. (line 54)
-* org-highest-priority: Priorities. (line 38)
-* org-icalendar-alarm-time: iCalendar export. (line 6)
-* org-icalendar-categories: iCalendar export. (line 6)
-* org-icalendar-include-body: iCalendar export. (line 46)
-* org-icalendar-include-todo: iCalendar export. (line 6)
-* org-icalendar-store-UID: iCalendar export. (line 21)
-* org-icalendar-use-deadline: iCalendar export. (line 6)
-* org-icalendar-use-scheduled: iCalendar export. (line 6)
-* org-imenu-depth: Cooperation. (line 38)
-* org-infojs-options: JavaScript support. (line 57)
-* org-insert-mode-line-in-empty-file: Activation. (line 29)
-* org-irc-link-to-logs: Handling links. (line 45)
-* org-keep-stored-link-after-insertion: Handling links. (line 66)
-* org-latex-low-levels: LaTeX/PDF export commands.
- (line 37)
-* org-link-abbrev-alist <1>: In-buffer settings. (line 49)
-* org-link-abbrev-alist: Link abbreviations. (line 12)
-* org-link-to-org-use-id: Handling links. (line 21)
-* org-list-automatic-rules <1>: Checkboxes. (line 6)
-* org-list-automatic-rules: Plain lists. (line 77)
-* org-list-demote-modify-bullet: Plain lists. (line 56)
-* org-list-end-regexp: Plain lists. (line 29)
-* org-list-ending-method: Plain lists. (line 29)
-* org-log-done <1>: Tracking TODO state changes.
- (line 26)
-* org-log-done <2>: Agenda commands. (line 106)
-* org-log-done: In-buffer settings. (line 105)
-* org-log-into-drawer <1>: Agenda commands. (line 326)
-* org-log-into-drawer: Tracking TODO state changes.
- (line 6)
-* org-log-note-clock-out <1>: Clocking commands. (line 33)
-* org-log-note-clock-out: In-buffer settings. (line 105)
-* org-log-refile: Refiling notes. (line 12)
-* org-log-repeat <1>: Repeated tasks. (line 32)
-* org-log-repeat: In-buffer settings. (line 105)
-* org-log-states-order-reversed: Tracking TODO state changes.
- (line 6)
-* org-lowest-priority <1>: In-buffer settings. (line 54)
-* org-lowest-priority: Priorities. (line 38)
-* org-M-RET-may-split-line <1>: Plain lists. (line 77)
-* org-M-RET-may-split-line: Structure editing. (line 7)
-* org-odd-levels-only <1>: Matching tags and properties.
- (line 59)
-* org-odd-levels-only <2>: Clean view. (line 74)
-* org-odd-levels-only <3>: In-buffer settings. (line 125)
-* org-odd-levels-only: Special agenda views.
- (line 43)
-* org-outline-path-complete-in-steps: Refiling notes. (line 12)
-* org-overriding-columns-format: Agenda column view. (line 18)
-* org-plain-list-ordered-item-terminator: Plain lists. (line 135)
-* org-popup-calendar-for-date-prompt: The date/time prompt.
- (line 70)
-* org-priority-faces: Priorities. (line 13)
-* org-priority-start-cycle-with-default: Priorities. (line 33)
-* org-property-allowed-value-functions: Using the property API.
- (line 65)
-* org-publish-project-alist <1>: Publishing options. (line 66)
-* org-publish-project-alist: Project alist. (line 6)
-* org-publish-use-timestamps-flag: Triggering publication.
- (line 21)
-* org-put-time-stamp-overlays: In-buffer settings. (line 135)
-* org-read-date-display-live: The date/time prompt.
- (line 84)
-* org-read-date-prefer-future: The date/time prompt.
- (line 6)
-* org-refile-allow-creating-parent-nodes: Refiling notes. (line 12)
-* org-refile-targets: Refiling notes. (line 12)
-* org-refile-use-cache: Refiling notes. (line 12)
-* org-refile-use-outline-path: Refiling notes. (line 12)
-* org-remove-highlights-with-change <1>: Sparse trees. (line 20)
-* org-remove-highlights-with-change: Clocking commands. (line 62)
-* org-replace-disputed-keys: Conflicts. (line 19)
-* org-return-follows-link: Handling links. (line 121)
-* org-reverse-note-order: Refiling notes. (line 12)
-* org-show-entry-below: Sparse trees. (line 6)
-* org-show-following-heading: Sparse trees. (line 6)
-* org-show-hierarchy-above: Sparse trees. (line 6)
-* org-show-siblings: Sparse trees. (line 6)
-* org-sort-agenda-noeffort-is-high: Agenda commands. (line 198)
-* org-sparse-tree-open-archived-trees: Internal archiving. (line 17)
-* org-special-ctrl-a/e: Headlines. (line 6)
-* org-special-ctrl-k: Headlines. (line 6)
-* org-speed-commands-user: Speed keys. (line 6)
-* org-startup-align-all-tables <1>: In-buffer settings. (line 91)
-* org-startup-align-all-tables: Column width and alignment.
- (line 33)
-* org-startup-folded <1>: Visibility cycling. (line 55)
-* org-startup-folded: In-buffer settings. (line 80)
-* org-startup-indented: In-buffer settings. (line 86)
-* org-startup-with-inline-images <1>: In-buffer settings. (line 98)
-* org-startup-with-inline-images: Handling links. (line 134)
-* org-store-link-functions: Adding hyperlink types.
- (line 65)
-* org-stuck-projects: Stuck projects. (line 17)
-* org-support-shift-select <1>: Plain lists. (line 101)
-* org-support-shift-select <2>: Conflicts. (line 6)
-* org-support-shift-select: Plain lists. (line 154)
-* org-table-auto-blank-field: Built-in table editor.
- (line 30)
-* org-table-copy-increment: Built-in table editor.
- (line 162)
-* org-table-export-default-format: Built-in table editor.
- (line 195)
-* org-table-formula: In-buffer settings. (line 35)
-* org-table-formula-constants <1>: References. (line 99)
-* org-table-formula-constants <2>: Cooperation. (line 17)
-* org-table-formula-constants: In-buffer settings. (line 35)
-* org-table-use-standard-references: Editing and debugging formulas.
- (line 6)
-* org-tag-alist <1>: Setting tags. (line 23)
-* org-tag-alist: In-buffer settings. (line 165)
-* org-tag-faces: Tags. (line 10)
-* org-tag-persistent-alist: Setting tags. (line 38)
-* org-tags-column: Setting tags. (line 11)
-* org-tags-exclude-from-inheritance: Tag inheritance. (line 22)
-* org-tags-match-list-sublevels <1>: Matching tags and properties.
- (line 20)
-* org-tags-match-list-sublevels <2>: Tag inheritance. (line 26)
-* org-tags-match-list-sublevels <3>: Tag searches. (line 19)
-* org-tags-match-list-sublevels: Property searches. (line 18)
-* org-time-stamp-custom-formats: Custom time format. (line 6)
-* org-time-stamp-overlay-formats: In-buffer settings. (line 135)
-* org-time-stamp-rounding-minutes: Creating timestamps. (line 23)
-* org-todo (face): Faces for TODO keywords.
- (line 6)
-* org-todo-keyword-faces: Faces for TODO keywords.
- (line 6)
-* org-todo-keywords <1>: Global TODO list. (line 18)
-* org-todo-keywords <2>: In-buffer settings. (line 182)
-* org-todo-keywords <3>: TODO basics. (line 36)
-* org-todo-keywords: TODO extensions. (line 6)
-* org-todo-repeat-to-state: Repeated tasks. (line 17)
-* org-todo-state-tags-triggers: TODO basics. (line 57)
-* org-track-ordered-property-with-tag <1>: Checkboxes. (line 78)
-* org-track-ordered-property-with-tag: TODO dependencies. (line 30)
-* org-treat-insert-todo-heading-as-state-change: Structure editing.
- (line 26)
-* org-treat-S-cursor-todo-selection-as-state-change: TODO basics.
- (line 29)
-* org-use-property-inheritance <1>: Property inheritance.
- (line 6)
-* org-use-property-inheritance <2>: Using the property API.
- (line 18)
-* org-use-property-inheritance: iCalendar export. (line 46)
-* org-use-speed-commands: Speed keys. (line 6)
-* org-use-tag-inheritance: Tag inheritance. (line 22)
-* org-yank-adjusted-subtrees: Structure editing. (line 73)
-* org-yank-folded-subtrees: Structure editing. (line 73)
-* parse-time-months: The date/time prompt.
- (line 57)
-* parse-time-weekdays: The date/time prompt.
- (line 57)
-* ps-landscape-mode: Exporting Agenda Views.
- (line 21)
-* ps-number-of-columns: Exporting Agenda Views.
- (line 21)
-* user-full-name <1>: Publishing options. (line 12)
-* user-full-name: Export options. (line 19)
-* user-mail-address <1>: Export options. (line 19)
-* user-mail-address: Publishing options. (line 12)
-
-
-
-Tag Table:
-Node: Top1274
-Node: Introduction21174
-Node: Summary21644
-Node: Installation24537
-Node: Activation26700
-Node: Feedback28438
-Ref: Feedback-Footnote-131016
-Node: Conventions31143
-Node: Document Structure32502
-Node: Outlines33426
-Node: Headlines34082
-Ref: Headlines-Footnote-135082
-Node: Visibility cycling35258
-Ref: Visibility cycling-Footnote-138300
-Ref: Visibility cycling-Footnote-238358
-Ref: Visibility cycling-Footnote-338408
-Node: Motion38678
-Node: Structure editing40015
-Ref: Structure editing-Footnote-146382
-Node: Sparse trees46482
-Ref: Sparse trees-Footnote-148787
-Ref: Sparse trees-Footnote-248993
-Ref: Sparse trees-Footnote-349064
-Node: Plain lists49179
-Ref: Plain lists-Footnote-156646
-Ref: Plain lists-Footnote-257004
-Ref: Plain lists-Footnote-357100
-Ref: Plain lists-Footnote-457189
-Ref: Plain lists-Footnote-557260
-Ref: Plain lists-Footnote-657318
-Ref: Plain lists-Footnote-757562
-Ref: Plain lists-Footnote-857738
-Ref: Plain lists-Footnote-957838
-Node: Drawers57916
-Ref: Drawers-Footnote-159132
-Node: Blocks59237
-Node: Footnotes59798
-Ref: Footnotes-Footnote-164371
-Ref: Footnotes-Footnote-264468
-Node: Orgstruct mode64545
-Node: Tables65654
-Node: Built-in table editor66295
-Node: Column width and alignment75458
-Ref: Column width and alignment-Footnote-178016
-Ref: Column width and alignment-Footnote-278062
-Node: Column groups78159
-Node: Orgtbl mode79671
-Node: The spreadsheet80470
-Node: References81770
-Ref: References-Footnote-187444
-Ref: References-Footnote-287585
-Ref: References-Footnote-387688
-Node: Formula syntax for Calc87978
-Ref: Formula syntax for Calc-Footnote-190891
-Node: Formula syntax for Lisp91215
-Node: Field formulas92938
-Node: Column formulas94401
-Node: Editing and debugging formulas96166
-Node: Updating the table100834
-Node: Advanced features102176
-Node: Org-Plot106613
-Node: Hyperlinks109474
-Node: Link format110231
-Node: Internal links111509
-Ref: Internal links-Footnote-1113322
-Ref: Internal links-Footnote-2113508
-Node: Radio targets113748
-Node: External links114438
-Node: Handling links117881
-Ref: Handling links-Footnote-1125671
-Ref: Handling links-Footnote-2125967
-Ref: Handling links-Footnote-3126213
-Ref: Handling links-Footnote-4126290
-Ref: Handling links-Footnote-5126364
-Node: Using links outside Org126446
-Node: Link abbreviations126931
-Node: Search options129229
-Ref: Search options-Footnote-1131110
-Node: Custom searches131191
-Node: TODO Items132201
-Ref: TODO Items-Footnote-1133309
-Node: TODO basics133423
-Node: TODO extensions136023
-Node: Workflow states137053
-Ref: Workflow states-Footnote-1138378
-Node: TODO types138471
-Ref: TODO types-Footnote-1140069
-Node: Multiple sets in one file140151
-Node: Fast access to TODO states142016
-Ref: Fast access to TODO states-Footnote-1142878
-Node: Per-file keywords143172
-Ref: Per-file keywords-Footnote-1144568
-Node: Faces for TODO keywords144769
-Node: TODO dependencies145813
-Node: Progress logging147986
-Node: Closing items148698
-Ref: Closing items-Footnote-1149747
-Ref: Closing items-Footnote-2149816
-Node: Tracking TODO state changes149889
-Ref: Tracking TODO state changes-Footnote-1152782
-Ref: Tracking TODO state changes-Footnote-2152839
-Node: Tracking your habits153127
-Node: Priorities157326
-Ref: Priorities-Footnote-1159331
-Node: Breaking down tasks159400
-Ref: Breaking down tasks-Footnote-1161392
-Node: Checkboxes161488
-Ref: Checkboxes-Footnote-1166006
-Ref: Checkboxes-Footnote-2166129
-Node: Tags166298
-Node: Tag inheritance167297
-Ref: Tag inheritance-Footnote-1168669
-Ref: Tag inheritance-Footnote-2168769
-Node: Setting tags168895
-Ref: Setting tags-Footnote-1175154
-Node: Tag searches175237
-Node: Properties and Columns176470
-Node: Property syntax177874
-Node: Special properties180862
-Node: Property searches182279
-Node: Property inheritance183711
-Node: Column view185527
-Node: Defining columns186761
-Node: Scope of column definitions187159
-Node: Column attributes188089
-Ref: Column attributes-Footnote-1192698
-Node: Using column view192831
-Node: Capturing column view195693
-Ref: Capturing column view-Footnote-1198685
-Node: Property API198821
-Node: Dates and Times199175
-Node: Timestamps200154
-Ref: Timestamps-Footnote-1202512
-Node: Creating timestamps202643
-Node: The date/time prompt205386
-Ref: The date/time prompt-Footnote-1209671
-Ref: The date/time prompt-Footnote-2209834
-Ref: The date/time prompt-Footnote-3209940
-Node: Custom time format210033
-Node: Deadlines and scheduling211757
-Ref: Deadlines and scheduling-Footnote-1214450
-Node: Inserting deadline/schedule214605
-Ref: Inserting deadline/schedule-Footnote-1216633
-Ref: Inserting deadline/schedule-Footnote-2216741
-Node: Repeated tasks216849
-Ref: Repeated tasks-Footnote-1220195
-Ref: Repeated tasks-Footnote-2220444
-Node: Clocking work time220643
-Ref: Clocking work time-Footnote-1221826
-Node: Clocking commands221964
-Ref: Clocking commands-Footnote-1225701
-Ref: Clocking commands-Footnote-2225808
-Ref: Clocking commands-Footnote-3225858
-Ref: Clocking commands-Footnote-4225916
-Node: The clock table225994
-Ref: The clock table-Footnote-1232157
-Node: Resolving idle time232282
-Ref: Resolving idle time-Footnote-1235536
-Node: Effort estimates235874
-Ref: Effort estimates-Footnote-1238643
-Ref: Effort estimates-Footnote-2238731
-Node: Relative timer238838
-Node: Countdown timer240685
-Node: Capture - Refile - Archive241176
-Node: Capture242157
-Node: Setting up capture243491
-Ref: Setting up capture-Footnote-1243916
-Node: Using capture243982
-Node: Capture templates246138
-Node: Template elements247766
-Node: Template expansion252767
-Ref: Template expansion-Footnote-1255818
-Ref: Template expansion-Footnote-2255905
-Ref: Template expansion-Footnote-3256087
-Node: Attachments256185
-Ref: Attachments-Footnote-1259567
-Node: RSS Feeds259717
-Node: Protocols261307
-Node: Refiling notes262021
-Ref: Refiling notes-Footnote-1264161
-Node: Archiving264257
-Node: Moving subtrees264956
-Ref: Moving subtrees-Footnote-1266667
-Node: Internal archiving267111
-Node: Agenda Views269741
-Node: Agenda files271932
-Ref: Agenda files-Footnote-1274745
-Ref: Agenda files-Footnote-2274894
-Node: Agenda dispatcher275087
-Ref: Agenda dispatcher-Footnote-1277302
-Ref: Agenda dispatcher-Footnote-2277396
-Node: Built-in agenda views277498
-Node: Weekly/daily agenda278147
-Ref: Weekly/daily agenda-Footnote-1283063
-Ref: Weekly/daily agenda-Footnote-2283290
-Node: Global TODO list283403
-Node: Matching tags and properties285931
-Node: Timeline292550
-Node: Search view293242
-Node: Stuck projects294535
-Ref: Stuck projects-Footnote-1296595
-Node: Presentation and sorting296625
-Node: Categories297418
-Ref: Categories-Footnote-1298219
-Node: Time-of-day specifications298656
-Node: Sorting of agenda items300628
-Node: Agenda commands302166
-Ref: Agenda commands-Footnote-1323930
-Ref: Agenda commands-Footnote-2324011
-Ref: Agenda commands-Footnote-3324422
-Node: Custom agenda views324505
-Node: Storing searches325146
-Ref: Storing searches-Footnote-1327680
-Node: Block agenda327797
-Node: Setting Options329035
-Node: Exporting Agenda Views331961
-Ref: Exporting Agenda Views-Footnote-1336862
-Ref: Exporting Agenda Views-Footnote-2336920
-Ref: Exporting Agenda Views-Footnote-3337076
-Ref: Exporting Agenda Views-Footnote-4337263
-Node: Agenda column view337345
-Node: Markup340027
-Node: Structural markup elements341000
-Node: Document title341733
-Node: Headings and sections342495
-Node: Table of contents343165
-Node: Initial text343928
-Node: Lists345042
-Node: Paragraphs345326
-Node: Footnote markup346476
-Node: Emphasis and monospace346831
-Node: Horizontal rules347231
-Node: Comment lines347506
-Node: Images and tables348040
-Node: Literal examples349521
-Ref: Literal examples-Footnote-1353158
-Ref: Literal examples-Footnote-2354136
-Ref: Literal examples-Footnote-3354315
-Ref: Literal examples-Footnote-4354552
-Node: Include files354646
-Node: Index entries355687
-Node: Macro replacement356149
-Node: Embedded LaTeX356979
-Ref: Embedded LaTeX-Footnote-1357921
-Node: Special symbols358111
-Ref: Special symbols-Footnote-1359723
-Node: Subscripts and superscripts359878
-Node: LaTeX fragments361132
-Ref: LaTeX fragments-Footnote-1363772
-Ref: LaTeX fragments-Footnote-2363945
-Ref: LaTeX fragments-Footnote-3364250
-Node: Previewing LaTeX fragments364427
-Node: CDLaTeX mode365436
-Ref: CDLaTeX mode-Footnote-1367923
-Node: Exporting368071
-Node: Selective export369847
-Node: Export options370676
-Ref: Export options-Footnote-1375199
-Node: The export dispatcher375290
-Ref: The export dispatcher-Footnote-1376596
-Node: ASCII/Latin-1/UTF-8 export376694
-Ref: ASCII/Latin-1/UTF-8 export-Footnote-1379092
-Ref: ASCII/Latin-1/UTF-8 export-Footnote-2379150
-Node: HTML export379202
-Node: HTML Export commands380152
-Ref: HTML Export commands-Footnote-1382104
-Ref: HTML Export commands-Footnote-2382162
-Node: Quoting HTML tags382214
-Node: Links in HTML export382865
-Node: Tables in HTML export384000
-Node: Images in HTML export384545
-Ref: Images in HTML export-Footnote-1385842
-Node: Math formatting in HTML export385904
-Ref: Math formatting in HTML export-Footnote-1387340
-Node: Text areas in HTML export387475
-Node: CSS support388319
-Ref: CSS support-Footnote-1391210
-Ref: CSS support-Footnote-2391396
-Node: JavaScript support391596
-Node: LaTeX and PDF export395209
-Ref: LaTeX and PDF export-Footnote-1396082
-Node: LaTeX/PDF export commands396342
-Ref: LaTeX/PDF export commands-Footnote-1398259
-Ref: LaTeX/PDF export commands-Footnote-2398317
-Node: Header and sectioning398369
-Ref: Header and sectioning-Footnote-1399445
-Node: Quoting LaTeX code399571
-Node: Tables in LaTeX export400206
-Node: Images in LaTeX export400939
-Node: Beamer class export402606
-Node: DocBook export408306
-Node: DocBook export commands409174
-Ref: DocBook export commands-Footnote-1410727
-Ref: DocBook export commands-Footnote-2410787
-Node: Quoting DocBook code410839
-Node: Recursive sections411888
-Node: Tables in DocBook export412616
-Node: Images in DocBook export413081
-Node: Special characters415015
-Node: TaskJuggler export416056
-Node: Freemind export421348
-Node: XOXO export421636
-Node: iCalendar export422108
-Ref: iCalendar export-Footnote-1424807
-Ref: iCalendar export-Footnote-2424897
-Ref: iCalendar export-Footnote-3424997
-Node: Publishing425134
-Node: Configuration426002
-Node: Project alist426778
-Node: Sources and destinations427940
-Node: Selecting files429457
-Node: Publishing action430456
-Ref: Publishing action-Footnote-1432246
-Node: Publishing options432600
-Node: Publishing links436209
-Node: Sitemap437891
-Node: Generating an index439413
-Node: Uploading files439996
-Node: Sample configuration441759
-Node: Simple example442248
-Node: Complex example442921
-Node: Triggering publication445008
-Node: Working With Source Code445994
-Node: Structure of code blocks447622
-Node: Editing source code448989
-Node: Exporting code blocks450420
-Node: Extracting source code452142
-Node: Evaluating code blocks453503
-Ref: Evaluating code blocks-Footnote-1455201
-Ref: Evaluating code blocks-Footnote-2455509
-Node: Library of Babel455637
-Node: Languages456447
-Node: Header arguments458419
-Node: Using header arguments458904
-Node: System-wide header arguments459664
-Node: Language-specific header arguments460487
-Node: Buffer-wide header arguments460890
-Node: Header arguments in Org-mode properties461665
-Node: Code block specific header arguments462689
-Node: Header arguments in function calls463823
-Node: Specific header arguments464189
-Node: var465717
-Node: results470206
-Node: file474215
-Node: dir474997
-Node: exports477914
-Node: tangle478566
-Node: comments479277
-Node: no-expand480272
-Node: session480763
-Node: noweb481208
-Node: cache482687
-Node: hlines483523
-Node: colnames485036
-Node: rownames486104
-Node: shebang486966
-Node: eval487361
-Node: Results of evaluation487904
-Node: Noweb reference syntax491103
-Node: Key bindings and useful functions492098
-Node: Batch execution493564
-Node: Miscellaneous494659
-Node: Completion495435
-Node: Easy Templates497410
-Node: Speed keys498794
-Node: Code evaluation security499620
-Node: Customization501794
-Node: In-buffer settings502385
-Ref: In-buffer settings-Footnote-1511615
-Node: The very busy C-c C-c key511663
-Node: Clean view513571
-Ref: Clean view-Footnote-1517557
-Ref: Clean view-Footnote-2517618
-Ref: Clean view-Footnote-3517802
-Ref: Clean view-Footnote-4517863
-Ref: Clean view-Footnote-5517975
-Ref: Clean view-Footnote-6518030
-Node: TTY keys518155
-Node: Interaction519921
-Node: Cooperation520297
-Node: Conflicts524093
-Node: Hacking527410
-Node: Hooks528262
-Node: Add-on packages528678
-Node: Adding hyperlink types529219
-Node: Context-sensitive commands533141
-Ref: Context-sensitive commands-Footnote-1534717
-Node: Tables in arbitrary syntax534851
-Node: Radio tables536263
-Node: A LaTeX example538805
-Ref: A LaTeX example-Footnote-1542727
-Ref: A LaTeX example-Footnote-2542875
-Node: Translator functions543310
-Ref: Translator functions-Footnote-1546533
-Node: Radio lists546621
-Node: Dynamic blocks547750
-Node: Special agenda views549848
-Ref: Special agenda views-Footnote-1553826
-Node: Extracting agenda information553961
-Node: Using the property API558033
-Node: Using the mapping API561325
-Node: MobileOrg565655
-Node: Setting up the staging area567132
-Ref: Setting up the staging area-Footnote-1568231
-Ref: Setting up the staging area-Footnote-2568532
-Node: Pushing to MobileOrg568793
-Ref: Pushing to MobileOrg-Footnote-1569784
-Ref: Pushing to MobileOrg-Footnote-2570200
-Node: Pulling from MobileOrg570257
-Ref: Pulling from MobileOrg-Footnote-1572677
-Ref: Pulling from MobileOrg-Footnote-2572737
-Node: History and Acknowledgments573114
-Node: Main Index584282
-Node: Key Index650959
-Node: Command and Function Index696062
-Node: Variable Index727252
-
-End Tag Table
diff --git a/.emacs.d/org-7.4/doc/org.pdf b/.emacs.d/org-7.4/doc/org.pdf
deleted file mode 100644
index 0257c40..0000000
--- a/.emacs.d/org-7.4/doc/org.pdf
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/doc/org.texi b/.emacs.d/org-7.4/doc/org.texi
deleted file mode 100644
index 5a67678..0000000
--- a/.emacs.d/org-7.4/doc/org.texi
+++ /dev/null
@@ -1,14774 +0,0 @@
-
-\input texinfo
-@c %**start of header
-@setfilename ../../info/org
-@settitle The Org Manual
-
-@set VERSION 7.4
-@set DATE December 2010
-
-@c Use proper quote and backtick for code sections in PDF output
-@c Cf. Texinfo manual 14.2
-@set txicodequoteundirected
-@set txicodequotebacktick
-
-@c Version and Contact Info
-@set MAINTAINERSITE @uref{http://orgmode.org,maintainers webpage}
-@set AUTHOR Carsten Dominik
-@set MAINTAINER Carsten Dominik
-@set MAINTAINEREMAIL @email{carsten at orgmode dot org}
-@set MAINTAINERCONTACT @uref{mailto:carsten at orgmode dot org,contact the maintainer}
-@c %**end of header
-@finalout
-
-
-@c -----------------------------------------------------------------------------
-
-@c Macro definitions for commands and keys
-@c =======================================
-
-@c The behavior of the key/command macros will depend on the flag cmdnames
-@c When set, commands names are shown. When clear, they are not shown.
-
-@set cmdnames
-
-@c Below we define the following macros for Org key tables:
-
-@c orgkey{key} A key item
-@c orgcmd{key,cmd} Key with command name
-@c xorgcmd{key,cmmand} Key with command name as @itemx
-@c orgcmdnki{key,cmd} Like orgcmd, but do not index the key
-@c orgcmdtkc{text,key,cmd} Like orgcmd,special text instead of key
-@c orgcmdkkc{key1,key2,cmd} Two keys with one command name, use "or"
-@c orgcmdkxkc{key1,key2,cmd} Two keys with one command name, but
-@c different functions, so format as @itemx
-@c orgcmdkskc{key1,key2,cmd} Same as orgcmdkkc, but use "or short"
-@c xorgcmdkskc{key1,key2,cmd} Same as previous, but use @itemx
-@c orgcmdkkcc{key1,key2,cmd1,cmd2} Two keys and two commands
-
-@c a key but no command
-@c Inserts: @item key
-@macro orgkey{key}
-@kindex \key\
-@item @kbd{\key\}
-@end macro
-
-@macro xorgkey{key}
-@kindex \key\
-@itemx @kbd{\key\}
-@end macro
-
-@c one key with a command
-@c Inserts: @item KEY COMMAND
-@macro orgcmd{key,command}
-@ifset cmdnames
-@kindex \key\
-@findex \command\
-@iftex
-@item @kbd{\key\} @hskip 0pt plus 1filll @code{\command\}
-@end iftex
-@ifnottex
-@item @kbd{\key\} @tie{}@tie{}@tie{}@tie{}(@code{\command\})
-@end ifnottex
-@end ifset
-@ifclear cmdnames
-@kindex \key\
-@item @kbd{\key\}
-@end ifclear
-@end macro
-
-@c One key with one command, formatted using @itemx
-@c Inserts: @itemx KEY COMMAND
-@macro xorgcmd{key,command}
-@ifset cmdnames
-@kindex \key\
-@findex \command\
-@iftex
-@itemx @kbd{\key\} @hskip 0pt plus 1filll @code{\command\}
-@end iftex
-@ifnottex
-@itemx @kbd{\key\} @tie{}@tie{}@tie{}@tie{}(@code{\command\})
-@end ifnottex
-@end ifset
-@ifclear cmdnames
-@kindex \key\
-@itemx @kbd{\key\}
-@end ifclear
-@end macro
-
-@c one key with a command, bit do not index the key
-@c Inserts: @item KEY COMMAND
-@macro orgcmdnki{key,command}
-@ifset cmdnames
-@findex \command\
-@iftex
-@item @kbd{\key\} @hskip 0pt plus 1filll @code{\command\}
-@end iftex
-@ifnottex
-@item @kbd{\key\} @tie{}@tie{}@tie{}@tie{}(@code{\command\})
-@end ifnottex
-@end ifset
-@ifclear cmdnames
-@item @kbd{\key\}
-@end ifclear
-@end macro
-
-@c one key with a command, and special text to replace key in item
-@c Inserts: @item TEXT COMMAND
-@macro orgcmdtkc{text,key,command}
-@ifset cmdnames
-@kindex \key\
-@findex \command\
-@iftex
-@item @kbd{\text\} @hskip 0pt plus 1filll @code{\command\}
-@end iftex
-@ifnottex
-@item @kbd{\text\} @tie{}@tie{}@tie{}@tie{}(@code{\command\})
-@end ifnottex
-@end ifset
-@ifclear cmdnames
-@kindex \key\
-@item @kbd{\text\}
-@end ifclear
-@end macro
-
-@c two keys with one command
-@c Inserts: @item KEY1 or KEY2 COMMAND
-@macro orgcmdkkc{key1,key2,command}
-@ifset cmdnames
-@kindex \key1\
-@kindex \key2\
-@findex \command\
-@iftex
-@item @kbd{\key1\} @ @r{or} @ @kbd{\key2\} @hskip 0pt plus 1filll @code{\command\}
-@end iftex
-@ifnottex
-@item @kbd{\key1\} @ @r{or} @ @kbd{\key2\} @tie{}@tie{}@tie{}@tie{}(@code{\command\})
-@end ifnottex
-@end ifset
-@ifclear cmdnames
-@kindex \key1\
-@kindex \key2\
-@item @kbd{\key1\} @ @r{or} @ @kbd{\key2\}
-@end ifclear
-@end macro
-
-@c Two keys with one command name, but different functions, so format as
-@c @itemx
-@c Inserts: @item KEY1
-@c @itemx KEY2 COMMAND
-@macro orgcmdkxkc{key1,key2,command}
-@ifset cmdnames
-@kindex \key1\
-@kindex \key2\
-@findex \command\
-@iftex
-@item @kbd{\key1\}
-@itemx @kbd{\key2\} @hskip 0pt plus 1filll @code{\command\}
-@end iftex
-@ifnottex
-@item @kbd{\key1\}
-@itemx @kbd{\key2\} @tie{}@tie{}@tie{}@tie{}(@code{\command\})
-@end ifnottex
-@end ifset
-@ifclear cmdnames
-@kindex \key1\
-@kindex \key2\
-@item @kbd{\key1\}
-@itemx @kbd{\key2\}
-@end ifclear
-@end macro
-
-@c Same as previous, but use "or short"
-@c Inserts: @item KEY1 or short KEY2 COMMAND
-@macro orgcmdkskc{key1,key2,command}
-@ifset cmdnames
-@kindex \key1\
-@kindex \key2\
-@findex \command\
-@iftex
-@item @kbd{\key1\} @ @r{or short} @ @kbd{\key2\} @hskip 0pt plus 1filll @code{\command\}
-@end iftex
-@ifnottex
-@item @kbd{\key1\} @ @r{or short} @ @kbd{\key2\} @tie{}@tie{}@tie{}@tie{}(@code{\command\})
-@end ifnottex
-@end ifset
-@ifclear cmdnames
-@kindex \key1\
-@kindex \key2\
-@item @kbd{\key1\} @ @r{or short} @ @kbd{\key2\}
-@end ifclear
-@end macro
-
-@c Same as previous, but use @itemx
-@c Inserts: @itemx KEY1 or short KEY2 COMMAND
-@macro xorgcmdkskc{key1,key2,command}
-@ifset cmdnames
-@kindex \key1\
-@kindex \key2\
-@findex \command\
-@iftex
-@itemx @kbd{\key1\} @ @r{or short} @ @kbd{\key2\} @hskip 0pt plus 1filll @code{\command\}
-@end iftex
-@ifnottex
-@itemx @kbd{\key1\} @ @r{or short} @ @kbd{\key2\} @tie{}@tie{}@tie{}@tie{}(@code{\command\})
-@end ifnottex
-@end ifset
-@ifclear cmdnames
-@kindex \key1\
-@kindex \key2\
-@itemx @kbd{\key1\} @ @r{or short} @ @kbd{\key2\}
-@end ifclear
-@end macro
-
-@c two keys with two commands
-@c Inserts: @item KEY1 COMMAND1
-@c @itemx KEY2 COMMAND2
-@macro orgcmdkkcc{key1,key2,command1,command2}
-@ifset cmdnames
-@kindex \key1\
-@kindex \key2\
-@findex \command1\
-@findex \command2\
-@iftex
-@item @kbd{\key1\} @hskip 0pt plus 1filll @code{\command1\}
-@itemx @kbd{\key2\} @hskip 0pt plus 1filll @code{\command2\}
-@end iftex
-@ifnottex
-@item @kbd{\key1\} @tie{}@tie{}@tie{}@tie{}(@code{\command1\})
-@itemx @kbd{\key2\} @tie{}@tie{}@tie{}@tie{}(@code{\command2\})
-@end ifnottex
-@end ifset
-@ifclear cmdnames
-@kindex \key1\
-@kindex \key2\
-@item @kbd{\key1\}
-@itemx @kbd{\key2\}
-@end ifclear
-@end macro
-@c -----------------------------------------------------------------------------
-
-@iftex
-@c @hyphenation{time-stamp time-stamps time-stamp-ing time-stamp-ed}
-@end iftex
-
-@c Subheadings inside a table.
-@macro tsubheading{text}
-@ifinfo
-@subsubheading \text\
-@end ifinfo
-@ifnotinfo
-@item @b{\text\}
-@end ifnotinfo
-@end macro
-
-@copying
-This manual is for Org version @value{VERSION}.
-
-Copyright @copyright{} 2004, 2005, 2006, 2007, 2008, 2009, 2010
-Free Software Foundation, Inc.
-
-@quotation
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.3 or
-any later version published by the Free Software Foundation; with no
-Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
-and with the Back-Cover Texts as in (a) below. A copy of the license
-is included in the section entitled ``GNU Free Documentation License.''
-
-(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
-modify this GNU manual. Buying copies from the FSF supports it in
-developing GNU and promoting software freedom.''
-
-This document is part of a collection distributed under the GNU Free
-Documentation License. If you want to distribute this document
-separately from the collection, you can do so by adding a copy of the
-license to the document, as described in section 6 of the license.
-@end quotation
-@end copying
-
-@dircategory Emacs
-@direntry
-* Org Mode: (org). Outline-based notes management and organizer
-@end direntry
-
-@titlepage
-@title The Org Manual
-
-@subtitle Release @value{VERSION}
-@author by Carsten Dominik
-with contributions by David O'Toole, Bastien Guerry, Philip Rooke, Dan Davison, Eric Schulte, and Thomas Dye
-
-@c The following two commands start the copyright page.
-@page
-@vskip 0pt plus 1filll
-@insertcopying
-@end titlepage
-
-@c Output the table of contents at the beginning.
-@contents
-
-@ifnottex
-@node Top, Introduction, (dir), (dir)
-@top Org Mode Manual
-
-@insertcopying
-@end ifnottex
-
-@menu
-* Introduction:: Getting started
-* Document Structure:: A tree works like your brain
-* Tables:: Pure magic for quick formatting
-* Hyperlinks:: Notes in context
-* TODO Items:: Every tree branch can be a TODO item
-* Tags:: Tagging headlines and matching sets of tags
-* Properties and Columns:: Storing information about an entry
-* Dates and Times:: Making items useful for planning
-* Capture - Refile - Archive:: The ins and outs for projects
-* Agenda Views:: Collecting information into views
-* Markup:: Prepare text for rich export
-* Exporting:: Sharing and publishing of notes
-* Publishing:: Create a web site of linked Org files
-* Working With Source Code:: Export, evaluate, and tangle code blocks
-* Miscellaneous:: All the rest which did not fit elsewhere
-* Hacking:: How to hack your way around
-* MobileOrg:: Viewing and capture on a mobile device
-* History and Acknowledgments:: How Org came into being
-* Main Index:: An index of Org's concepts and features
-* Key Index:: Key bindings and where they are described
-* Command and Function Index:: Command names and some internal functions
-* Variable Index:: Variables mentioned in the manual
-
-@detailmenu
- --- The Detailed Node Listing ---
-
-Introduction
-
-* Summary:: Brief summary of what Org does
-* Installation:: How to install a downloaded version of Org
-* Activation:: How to activate Org for certain buffers
-* Feedback:: Bug reports, ideas, patches etc.
-* Conventions:: Type-setting conventions in the manual
-
-Document structure
-
-* Outlines:: Org is based on Outline mode
-* Headlines:: How to typeset Org tree headlines
-* Visibility cycling:: Show and hide, much simplified
-* Motion:: Jumping to other headlines
-* Structure editing:: Changing sequence and level of headlines
-* Sparse trees:: Matches embedded in context
-* Plain lists:: Additional structure within an entry
-* Drawers:: Tucking stuff away
-* Blocks:: Folding blocks
-* Footnotes:: How footnotes are defined in Org's syntax
-* Orgstruct mode:: Structure editing outside Org
-
-Tables
-
-* Built-in table editor:: Simple tables
-* Column width and alignment:: Overrule the automatic settings
-* Column groups:: Grouping to trigger vertical lines
-* Orgtbl mode:: The table editor as minor mode
-* The spreadsheet:: The table editor has spreadsheet capabilities
-* Org-Plot:: Plotting from org tables
-
-The spreadsheet
-
-* References:: How to refer to another field or range
-* Formula syntax for Calc:: Using Calc to compute stuff
-* Formula syntax for Lisp:: Writing formulas in Emacs Lisp
-* Field formulas:: Formulas valid for a single field
-* Column formulas:: Formulas valid for an entire column
-* Editing and debugging formulas:: Fixing formulas
-* Updating the table:: Recomputing all dependent fields
-* Advanced features:: Field names, parameters and automatic recalc
-
-Hyperlinks
-
-* Link format:: How links in Org are formatted
-* Internal links:: Links to other places in the current file
-* External links:: URL-like links to the world
-* Handling links:: Creating, inserting and following
-* Using links outside Org:: Linking from my C source code?
-* Link abbreviations:: Shortcuts for writing complex links
-* Search options:: Linking to a specific location
-* Custom searches:: When the default search is not enough
-
-Internal links
-
-* Radio targets:: Make targets trigger links in plain text
-
-TODO items
-
-* TODO basics:: Marking and displaying TODO entries
-* TODO extensions:: Workflow and assignments
-* Progress logging:: Dates and notes for progress
-* Priorities:: Some things are more important than others
-* Breaking down tasks:: Splitting a task into manageable pieces
-* Checkboxes:: Tick-off lists
-
-Extended use of TODO keywords
-
-* Workflow states:: From TODO to DONE in steps
-* TODO types:: I do this, Fred does the rest
-* Multiple sets in one file:: Mixing it all, and still finding your way
-* Fast access to TODO states:: Single letter selection of a state
-* Per-file keywords:: Different files, different requirements
-* Faces for TODO keywords:: Highlighting states
-* TODO dependencies:: When one task needs to wait for others
-
-Progress logging
-
-* Closing items:: When was this entry marked DONE?
-* Tracking TODO state changes:: When did the status change?
-* Tracking your habits:: How consistent have you been?
-
-Tags
-
-* Tag inheritance:: Tags use the tree structure of the outline
-* Setting tags:: How to assign tags to a headline
-* Tag searches:: Searching for combinations of tags
-
-Properties and columns
-
-* Property syntax:: How properties are spelled out
-* Special properties:: Access to other Org-mode features
-* Property searches:: Matching property values
-* Property inheritance:: Passing values down the tree
-* Column view:: Tabular viewing and editing
-* Property API:: Properties for Lisp programmers
-
-Column view
-
-* Defining columns:: The COLUMNS format property
-* Using column view:: How to create and use column view
-* Capturing column view:: A dynamic block for column view
-
-Defining columns
-
-* Scope of column definitions:: Where defined, where valid?
-* Column attributes:: Appearance and content of a column
-
-Dates and times
-
-* Timestamps:: Assigning a time to a tree entry
-* Creating timestamps:: Commands which insert timestamps
-* Deadlines and scheduling:: Planning your work
-* Clocking work time:: Tracking how long you spend on a task
-* Effort estimates:: Planning work effort in advance
-* Relative timer:: Notes with a running timer
-* Countdown timer:: Starting a countdown timer for a task
-
-Creating timestamps
-
-* The date/time prompt:: How Org-mode helps you entering date and time
-* Custom time format:: Making dates look different
-
-Deadlines and scheduling
-
-* Inserting deadline/schedule:: Planning items
-* Repeated tasks:: Items that show up again and again
-
-Clocking work time
-
-* Clocking commands:: Starting and stopping a clock
-* The clock table:: Detailed reports
-* Resolving idle time:: Resolving time when you've been idle
-
-Capture - Refile - Archive
-
-* Capture:: Capturing new stuff
-* Attachments:: Add files to tasks
-* RSS Feeds:: Getting input from RSS feeds
-* Protocols:: External (e.g. Browser) access to Emacs and Org
-* Refiling notes:: Moving a tree from one place to another
-* Archiving:: What to do with finished projects
-
-Capture
-
-* Setting up capture:: Where notes will be stored
-* Using capture:: Commands to invoke and terminate capture
-* Capture templates:: Define the outline of different note types
-
-Capture templates
-
-* Template elements:: What is needed for a complete template entry
-* Template expansion:: Filling in information about time and context
-
-Archiving
-
-* Moving subtrees:: Moving a tree to an archive file
-* Internal archiving:: Switch off a tree but keep it in the file
-
-Agenda views
-
-* Agenda files:: Files being searched for agenda information
-* Agenda dispatcher:: Keyboard access to agenda views
-* Built-in agenda views:: What is available out of the box?
-* Presentation and sorting:: How agenda items are prepared for display
-* Agenda commands:: Remote editing of Org trees
-* Custom agenda views:: Defining special searches and views
-* Exporting Agenda Views:: Writing a view to a file
-* Agenda column view:: Using column view for collected entries
-
-The built-in agenda views
-
-* Weekly/daily agenda:: The calendar page with current tasks
-* Global TODO list:: All unfinished action items
-* Matching tags and properties:: Structured information with fine-tuned search
-* Timeline:: Time-sorted view for single file
-* Search view:: Find entries by searching for text
-* Stuck projects:: Find projects you need to review
-
-Presentation and sorting
-
-* Categories:: Not all tasks are equal
-* Time-of-day specifications:: How the agenda knows the time
-* Sorting of agenda items:: The order of things
-
-Custom agenda views
-
-* Storing searches:: Type once, use often
-* Block agenda:: All the stuff you need in a single buffer
-* Setting Options:: Changing the rules
-
-Markup for rich export
-
-* Structural markup elements:: The basic structure as seen by the exporter
-* Images and tables:: Tables and Images will be included
-* Literal examples:: Source code examples with special formatting
-* Include files:: Include additional files into a document
-* Index entries:: Making an index
-* Macro replacement:: Use macros to create complex output
-* Embedded LaTeX:: LaTeX can be freely used inside Org documents
-
-Structural markup elements
-
-* Document title:: Where the title is taken from
-* Headings and sections:: The document structure as seen by the exporter
-* Table of contents:: The if and where of the table of contents
-* Initial text:: Text before the first heading?
-* Lists:: Lists
-* Paragraphs:: Paragraphs
-* Footnote markup:: Footnotes
-* Emphasis and monospace:: Bold, italic, etc.
-* Horizontal rules:: Make a line
-* Comment lines:: What will *not* be exported
-
-Embedded @LaTeX{}
-
-* Special symbols:: Greek letters and other symbols
-* Subscripts and superscripts:: Simple syntax for raising/lowering text
-* LaTeX fragments:: Complex formulas made easy
-* Previewing LaTeX fragments:: What will this snippet look like?
-* CDLaTeX mode:: Speed up entering of formulas
-
-Exporting
-
-* Selective export:: Using tags to select and exclude trees
-* Export options:: Per-file export settings
-* The export dispatcher:: How to access exporter commands
-* ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding
-* HTML export:: Exporting to HTML
-* LaTeX and PDF export:: Exporting to @LaTeX{}, and processing to PDF
-* DocBook export:: Exporting to DocBook
-* TaskJuggler export:: Exporting to TaskJuggler
-* Freemind export:: Exporting to Freemind mind maps
-* XOXO export:: Exporting to XOXO
-* iCalendar export:: Exporting in iCalendar format
-
-HTML export
-
-* HTML Export commands:: How to invoke HTML export
-* Quoting HTML tags:: Using direct HTML in Org-mode
-* Links in HTML export:: How links will be interpreted and formatted
-* Tables in HTML export:: How to modify the formatting of tables
-* Images in HTML export:: How to insert figures into HTML output
-* Math formatting in HTML export:: Beautiful math also on the web
-* Text areas in HTML export:: An alternative way to show an example
-* CSS support:: Changing the appearance of the output
-* JavaScript support:: Info and Folding in a web browser
-
-@LaTeX{} and PDF export
-
-* LaTeX/PDF export commands:: Which key invokes which commands
-* Header and sectioning:: Setting up the export file structure
-* Quoting LaTeX code:: Incorporating literal @LaTeX{} code
-* Tables in LaTeX export:: Options for exporting tables to @LaTeX{}
-* Images in LaTeX export:: How to insert figures into @LaTeX{} output
-* Beamer class export:: Turning the file into a presentation
-
-DocBook export
-
-* DocBook export commands:: How to invoke DocBook export
-* Quoting DocBook code:: Incorporating DocBook code in Org files
-* Recursive sections:: Recursive sections in DocBook
-* Tables in DocBook export:: Tables are exported as HTML tables
-* Images in DocBook export:: How to insert figures into DocBook output
-* Special characters:: How to handle special characters
-
-Publishing
-
-* Configuration:: Defining projects
-* Uploading files:: How to get files up on the server
-* Sample configuration:: Example projects
-* Triggering publication:: Publication commands
-
-Configuration
-
-* Project alist:: The central configuration variable
-* Sources and destinations:: From here to there
-* Selecting files:: What files are part of the project?
-* Publishing action:: Setting the function doing the publishing
-* Publishing options:: Tweaking HTML export
-* Publishing links:: Which links keep working after publishing?
-* Sitemap:: Generating a list of all pages
-* Generating an index:: An index that reaches across pages
-
-Sample configuration
-
-* Simple example:: One-component publishing
-* Complex example:: A multi-component publishing example
-
-Working with source code
-
-* Structure of code blocks:: Code block syntax described
-* Editing source code:: Language major-mode editing
-* Exporting code blocks:: Export contents and/or results
-* Extracting source code:: Create pure source code files
-* Evaluating code blocks:: Place results of evaluation in the Org-mode buffer
-* Library of Babel:: Use and contribute to a library of useful code blocks
-* Languages:: List of supported code block languages
-* Header arguments:: Configure code block functionality
-* Results of evaluation:: How evaluation results are handled
-* Noweb reference syntax:: Literate programming in Org-mode
-* Key bindings and useful functions:: Work quickly with code blocks
-* Batch execution:: Call functions from the command line
-
-Header arguments
-
-* Using header arguments:: Different ways to set header arguments
-* Specific header arguments:: List of header arguments
-
-Using header arguments
-
-* System-wide header arguments:: Set global default values
-* Language-specific header arguments:: Set default values by language
-* Buffer-wide header arguments:: Set default values for a specific buffer
-* Header arguments in Org-mode properties:: Set default values for a buffer or heading
-* Code block specific header arguments:: The most common way to set values
-* Header arguments in function calls:: The most specific level
-
-Specific header arguments
-
-* var:: Pass arguments to code blocks
-* results:: Specify the type of results and how they will
- be collected and handled
-* file:: Specify a path for file output
-* dir:: Specify the default (possibly remote)
- directory for code block execution
-* exports:: Export code and/or results
-* tangle:: Toggle tangling and specify file name
-* comments:: Toggle insertion of comments in tangled
- code files
-* no-expand:: Turn off variable assignment and noweb
- expansion during tangling
-* session:: Preserve the state of code evaluation
-* noweb:: Toggle expansion of noweb references
-* cache:: Avoid re-evaluating unchanged code blocks
-* hlines:: Handle horizontal lines in tables
-* colnames:: Handle column names in tables
-* rownames:: Handle row names in tables
-* shebang:: Make tangled files executable
-* eval:: Limit evaluation of specific code blocks
-
-Miscellaneous
-
-* Completion:: M-TAB knows what you need
-* Easy Templates:: Quick insertion of structural elements
-* Speed keys:: Electric commands at the beginning of a headline
-* Code evaluation security:: Org mode files evaluate inline code
-* Customization:: Adapting Org to your taste
-* In-buffer settings:: Overview of the #+KEYWORDS
-* The very busy C-c C-c key:: When in doubt, press C-c C-c
-* Clean view:: Getting rid of leading stars in the outline
-* TTY keys:: Using Org on a tty
-* Interaction:: Other Emacs packages
-
-Interaction with other packages
-
-* Cooperation:: Packages Org cooperates with
-* Conflicts:: Packages that lead to conflicts
-
-Hacking
-
-* Hooks:: Who to reach into Org's internals
-* Add-on packages:: Available extensions
-* Adding hyperlink types:: New custom link types
-* Context-sensitive commands:: How to add functionality to such commands
-* Tables in arbitrary syntax:: Orgtbl for @LaTeX{} and other programs
-* Dynamic blocks:: Automatically filled blocks
-* Special agenda views:: Customized views
-* Extracting agenda information:: Postprocessing of agenda information
-* Using the property API:: Writing programs that use entry properties
-* Using the mapping API:: Mapping over all or selected entries
-
-Tables and lists in arbitrary syntax
-
-* Radio tables:: Sending and receiving radio tables
-* A LaTeX example:: Step by step, almost a tutorial
-* Translator functions:: Copy and modify
-* Radio lists:: Doing the same for lists
-
-MobileOrg
-
-* Setting up the staging area:: Where to interact with the mobile device
-* Pushing to MobileOrg:: Uploading Org files and agendas
-* Pulling from MobileOrg:: Integrating captured and flagged items
-
-@end detailmenu
-@end menu
-
-@node Introduction, Document Structure, Top, Top
-@chapter Introduction
-@cindex introduction
-
-@menu
-* Summary:: Brief summary of what Org does
-* Installation:: How to install a downloaded version of Org
-* Activation:: How to activate Org for certain buffers
-* Feedback:: Bug reports, ideas, patches etc.
-* Conventions:: Type-setting conventions in the manual
-@end menu
-
-@node Summary, Installation, Introduction, Introduction
-@section Summary
-@cindex summary
-
-Org is a mode for keeping notes, maintaining TODO lists, and doing
-project planning with a fast and effective plain-text system.
-
-Org develops organizational tasks around NOTES files that contain
-lists or information about projects as plain text. Org is
-implemented on top of Outline mode, which makes it possible to keep the
-content of large files well structured. Visibility cycling and
-structure editing help to work with the tree. Tables are easily created
-with a built-in table editor. Org supports TODO items, deadlines,
-timestamps, and scheduling. It dynamically compiles entries into an
-agenda that utilizes and smoothly integrates much of the Emacs calendar
-and diary. Plain text URL-like links connect to websites, emails,
-Usenet messages, BBDB entries, and any files related to the projects.
-For printing and sharing of notes, an Org file can be exported as a
-structured ASCII file, as HTML, or (TODO and agenda items only) as an
-iCalendar file. It can also serve as a publishing tool for a set of
-linked web pages.
-
-As a project planning environment, Org works by adding metadata to outline
-nodes. Based on this data, specific entries can be extracted in queries and
-create dynamic @i{agenda views}.
-
-Org mode contains the Org Babel environment which allows you to work with
-embedded source code blocks in a file, to facilitate code evaluation,
-documentation, and tangling.
-
-Org's automatic, context-sensitive table editor with spreadsheet
-capabilities can be integrated into any major mode by activating the
-minor Orgtbl mode. Using a translation step, it can be used to maintain
-tables in arbitrary file types, for example in @LaTeX{}. The structure
-editing and list creation capabilities can be used outside Org with
-the minor Orgstruct mode.
-
-Org keeps simple things simple. When first fired up, it should
-feel like a straightforward, easy to use outliner. Complexity is not
-imposed, but a large amount of functionality is available when you need
-it. Org is a toolbox and can be used in different ways and for different
-ends, for example:
-
-@example
-@r{@bullet{} an outline extension with visibility cycling and structure editing}
-@r{@bullet{} an ASCII system and table editor for taking structured notes}
-@r{@bullet{} a TODO list editor}
-@r{@bullet{} a full agenda and planner with deadlines and work scheduling}
-@pindex GTD, Getting Things Done
-@r{@bullet{} an environment in which to implement David Allen's GTD system}
-@r{@bullet{} a simple hypertext system, with HTML and @LaTeX{} export}
-@r{@bullet{} a publishing tool to create a set of interlinked webpages}
-@r{@bullet{} an environment for literate programming}
-@end example
-
-
-@cindex FAQ
-There is a website for Org which provides links to the newest
-version of Org, as well as additional information, frequently asked
-questions (FAQ), links to tutorials, etc@. This page is located at
-@uref{http://orgmode.org}.
-
-@page
-
-
-@node Installation, Activation, Summary, Introduction
-@section Installation
-@cindex installation
-@cindex XEmacs
-
-@b{Important:} @i{If you are using a version of Org that is part of the Emacs
-distribution or an XEmacs package, please skip this section and go directly
-to @ref{Activation}.}
-
-If you have downloaded Org from the Web, either as a distribution @file{.zip}
-or @file{.tar} file, or as a Git archive, you must take the following steps
-to install it: go into the unpacked Org distribution directory and edit the
-top section of the file @file{Makefile}. You must set the name of the Emacs
-binary (likely either @file{emacs} or @file{xemacs}), and the paths to the
-directories where local Lisp and Info files are kept. If you don't have
-access to the system-wide directories, you can simply run Org directly from
-the distribution directory by adding the @file{lisp} subdirectory to the
-Emacs load path. To do this, add the following line to @file{.emacs}:
-
-@example
-(setq load-path (cons "~/path/to/orgdir/lisp" load-path))
-@end example
-
-@noindent
-If you plan to use code from the @file{contrib} subdirectory, do a similar
-step for this directory:
-
-@example
-(setq load-path (cons "~/path/to/orgdir/contrib/lisp" load-path))
-@end example
-
-@noindent Now byte-compile the Lisp files with the shell command:
-
-@example
-make
-@end example
-
-@noindent If you are running Org from the distribution directory, this is
-all. If you want to install Org into the system directories, use (as
-administrator)
-
-@example
-make install
-@end example
-
-Installing Info files is system dependent, because of differences in the
-@file{install-info} program. In Debian it copies the info files into the
-correct directory and modifies the info directory file. In many other
-systems, the files need to be copied to the correct directory separately, and
-@file{install-info} then only modifies the directory file. Check your system
-documentation to find out which of the following commands you need:
-
-@example
-make install-info
-make install-info-debian
-@end example
-
-Then add the following line to @file{.emacs}. It is needed so that
-Emacs can autoload functions that are located in files not immediately loaded
-when Org-mode starts.
-@lisp
-(require 'org-install)
-@end lisp
-
-Do not forget to activate Org as described in the following section.
-@page
-
-@node Activation, Feedback, Installation, Introduction
-@section Activation
-@cindex activation
-@cindex autoload
-@cindex global key bindings
-@cindex key bindings, global
-
-Add the following lines to your @file{.emacs} file. The last three lines
-define @emph{global} keys for the commands @command{org-store-link},
-@command{org-agenda}, and @command{org-iswitchb}---please choose suitable
-keys yourself.
-
-@lisp
-;; The following lines are always needed. Choose your own keys.
-(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
-(global-set-key "\C-cl" 'org-store-link)
-(global-set-key "\C-ca" 'org-agenda)
-(global-set-key "\C-cb" 'org-iswitchb)
-@end lisp
-
-Furthermore, you must activate @code{font-lock-mode} in Org
-buffers, because significant functionality depends on font-locking being
-active. You can do this with either one of the following two lines
-(XEmacs users must use the second option):
-@lisp
-(global-font-lock-mode 1) ; for all buffers
-(add-hook 'org-mode-hook 'turn-on-font-lock) ; Org buffers only
-@end lisp
-
-@cindex Org-mode, turning on
-With this setup, all files with extension @samp{.org} will be put
-into Org-mode. As an alternative, make the first line of a file look
-like this:
-
-@example
-MY PROJECTS -*- mode: org; -*-
-@end example
-
-@vindex org-insert-mode-line-in-empty-file
-@noindent which will select Org-mode for this buffer no matter what
-the file's name is. See also the variable
-@code{org-insert-mode-line-in-empty-file}.
-
-Many commands in Org work on the region if the region is @i{active}. To make
-use of this, you need to have @code{transient-mark-mode}
-(@code{zmacs-regions} in XEmacs) turned on. In Emacs 23 this is the default,
-in Emacs 22 you need to do this yourself with
-@lisp
-(transient-mark-mode 1)
-@end lisp
-@noindent If you do not like @code{transient-mark-mode}, you can create an
-active region by using the mouse to select a region, or pressing
-@kbd{C-@key{SPC}} twice before moving the cursor.
-
-@node Feedback, Conventions, Activation, Introduction
-@section Feedback
-@cindex feedback
-@cindex bug reports
-@cindex maintainer
-@cindex author
-
-If you find problems with Org, or if you have questions, remarks, or ideas
-about it, please mail to the Org mailing list @email{emacs-orgmode@@gnu.org}.
-If you are not a member of the mailing list, your mail will be passed to the
-list after a moderator has approved it@footnote{Please consider subscribing
-to the mailing list, in order to minimize the work the mailing list
-moderators have to do.}.
-
-For bug reports, please first try to reproduce the bug with the latest
-version of Org available---if you are running an outdated version, it is
-quite possible that the bug has been fixed already. If the bug persists,
-prepare a report and provide as much information as possible, including the
-version information of Emacs (@kbd{M-x emacs-version @key{RET}}) and Org
-(@kbd{M-x org-version @key{RET}}), as well as the Org related setup in
-@file{.emacs}. The easiest way to do this is to use the command
-@example
-@kbd{M-x org-submit-bug-report}
-@end example
-@noindent which will put all this information into an Emacs mail buffer so
-that you only need to add your description. If you re not sending the Email
-from within Emacs, please copy and paste the content into your Email program.
-
-If an error occurs, a backtrace can be very useful (see below on how to
-create one). Often a small example file helps, along with clear information
-about:
-
-@enumerate
-@item What exactly did you do?
-@item What did you expect to happen?
-@item What happened instead?
-@end enumerate
-@noindent Thank you for helping to improve this program.
-
-@subsubheading How to create a useful backtrace
-
-@cindex backtrace of an error
-If working with Org produces an error with a message you don't
-understand, you may have hit a bug. The best way to report this is by
-providing, in addition to what was mentioned above, a @emph{backtrace}.
-This is information from the built-in debugger about where and how the
-error occurred. Here is how to produce a useful backtrace:
-
-@enumerate
-@item
-Reload uncompiled versions of all Org-mode Lisp files. The backtrace
-contains much more information if it is produced with uncompiled code.
-To do this, use
-@example
-C-u M-x org-reload RET
-@end example
-@noindent
-or select @code{Org -> Refresh/Reload -> Reload Org uncompiled} from the
-menu.
-@item
-Go to the @code{Options} menu and select @code{Enter Debugger on Error}
-(XEmacs has this option in the @code{Troubleshooting} sub-menu).
-@item
-Do whatever you have to do to hit the error. Don't forget to
-document the steps you take.
-@item
-When you hit the error, a @file{*Backtrace*} buffer will appear on the
-screen. Save this buffer to a file (for example using @kbd{C-x C-w}) and
-attach it to your bug report.
-@end enumerate
-
-@node Conventions, , Feedback, Introduction
-@section Typesetting conventions used in this manual
-
-Org uses three types of keywords: TODO keywords, tags, and property
-names. In this manual we use the following conventions:
-
-@table @code
-@item TODO
-@itemx WAITING
-TODO keywords are written with all capitals, even if they are
-user-defined.
-@item boss
-@itemx ARCHIVE
-User-defined tags are written in lowercase; built-in tags with special
-meaning are written with all capitals.
-@item Release
-@itemx PRIORITY
-User-defined properties are capitalized; built-in properties with
-special meaning are written with all capitals.
-@end table
-
-The manual lists both the keys and the corresponding commands for accessing
-functionality. Org mode often uses the same key for different functions,
-depending on context. The command that is bound to such keys has a generic
-name, like @code{org-metaright}. In the manual we will, wherever possible,
-give the function that is internally called by the generic command. For
-example, in the chapter on document structure, @kbd{M-@key{right}} will be
-listed to call @code{org-do-demote}, while in the chapter on tables, it will
-be listed to call org-table-move-column-right.
-
-If you prefer, you can compile the manual without the command names by
-unsetting the flag @code{cmdnames} in @file{org.texi}.
-
-@node Document Structure, Tables, Introduction, Top
-@chapter Document structure
-@cindex document structure
-@cindex structure of document
-
-Org is based on Outline mode and provides flexible commands to
-edit the structure of the document.
-
-@menu
-* Outlines:: Org is based on Outline mode
-* Headlines:: How to typeset Org tree headlines
-* Visibility cycling:: Show and hide, much simplified
-* Motion:: Jumping to other headlines
-* Structure editing:: Changing sequence and level of headlines
-* Sparse trees:: Matches embedded in context
-* Plain lists:: Additional structure within an entry
-* Drawers:: Tucking stuff away
-* Blocks:: Folding blocks
-* Footnotes:: How footnotes are defined in Org's syntax
-* Orgstruct mode:: Structure editing outside Org
-@end menu
-
-@node Outlines, Headlines, Document Structure, Document Structure
-@section Outlines
-@cindex outlines
-@cindex Outline mode
-
-Org is implemented on top of Outline mode. Outlines allow a
-document to be organized in a hierarchical structure, which (at least
-for me) is the best representation of notes and thoughts. An overview
-of this structure is achieved by folding (hiding) large parts of the
-document to show only the general document structure and the parts
-currently being worked on. Org greatly simplifies the use of
-outlines by compressing the entire show/hide functionality into a single
-command, @command{org-cycle}, which is bound to the @key{TAB} key.
-
-@node Headlines, Visibility cycling, Outlines, Document Structure
-@section Headlines
-@cindex headlines
-@cindex outline tree
-@vindex org-special-ctrl-a/e
-@vindex org-special-ctrl-k
-@vindex org-ctrl-k-protect-subtree
-
-Headlines define the structure of an outline tree. The headlines in Org
-start with one or more stars, on the left margin@footnote{See the variables
-@code{org-special-ctrl-a/e}, @code{org-special-ctrl-k}, and
-@code{org-ctrl-k-protect-subtree} to configure special behavior of @kbd{C-a},
-@kbd{C-e}, and @kbd{C-k} in headlines.}. For example:
-
-@example
-* Top level headline
-** Second level
-*** 3rd level
- some text
-*** 3rd level
- more text
-
-* Another top level headline
-@end example
-
-@noindent Some people find the many stars too noisy and would prefer an
-outline that has whitespace followed by a single star as headline
-starters. @ref{Clean view}, describes a setup to realize this.
-
-@vindex org-cycle-separator-lines
-An empty line after the end of a subtree is considered part of it and
-will be hidden when the subtree is folded. However, if you leave at
-least two empty lines, one empty line will remain visible after folding
-the subtree, in order to structure the collapsed view. See the
-variable @code{org-cycle-separator-lines} to modify this behavior.
-
-@node Visibility cycling, Motion, Headlines, Document Structure
-@section Visibility cycling
-@cindex cycling, visibility
-@cindex visibility cycling
-@cindex trees, visibility
-@cindex show hidden text
-@cindex hide text
-
-Outlines make it possible to hide parts of the text in the buffer.
-Org uses just two commands, bound to @key{TAB} and
-@kbd{S-@key{TAB}} to change the visibility in the buffer.
-
-@cindex subtree visibility states
-@cindex subtree cycling
-@cindex folded, subtree visibility state
-@cindex children, subtree visibility state
-@cindex subtree, subtree visibility state
-@table @asis
-@orgcmd{@key{TAB},org-cycle}
-@emph{Subtree cycling}: Rotate current subtree among the states
-
-@example
-,-> FOLDED -> CHILDREN -> SUBTREE --.
-'-----------------------------------'
-@end example
-
-@vindex org-cycle-emulate-tab
-@vindex org-cycle-global-at-bob
-The cursor must be on a headline for this to work@footnote{see, however,
-the option @code{org-cycle-emulate-tab}.}. When the cursor is at the
-beginning of the buffer and the first line is not a headline, then
-@key{TAB} actually runs global cycling (see below)@footnote{see the
-option @code{org-cycle-global-at-bob}.}. Also when called with a prefix
-argument (@kbd{C-u @key{TAB}}), global cycling is invoked.
-
-@cindex global visibility states
-@cindex global cycling
-@cindex overview, global visibility state
-@cindex contents, global visibility state
-@cindex show all, global visibility state
-@orgcmd{S-@key{TAB},org-global-cycle}
-@itemx C-u @key{TAB}
-@emph{Global cycling}: Rotate the entire buffer among the states
-
-@example
-,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
-'--------------------------------------'
-@end example
-
-When @kbd{S-@key{TAB}} is called with a numeric prefix argument N, the
-CONTENTS view up to headlines of level N will be shown. Note that inside
-tables, @kbd{S-@key{TAB}} jumps to the previous field.
-
-@cindex show all, command
-@orgcmd{C-u C-u C-u @key{TAB},show-all}
-Show all, including drawers.
-@orgcmd{C-c C-r,org-reveal}
-Reveal context around point, showing the current entry, the following heading
-and the hierarchy above. Useful for working near a location that has been
-exposed by a sparse tree command (@pxref{Sparse trees}) or an agenda command
-(@pxref{Agenda commands}). With a prefix argument show, on each
-level, all sibling headings. With double prefix arg, also show the entire
-subtree of the parent.
-@orgcmd{C-c C-k,show-branches}
-Expose all the headings of the subtree, CONTENT view for just one subtree.
-@orgcmd{C-c C-x b,org-tree-to-indirect-buffer}
-Show the current subtree in an indirect buffer@footnote{The indirect
-buffer
-@ifinfo
-(@pxref{Indirect Buffers,,,emacs,GNU Emacs Manual})
-@end ifinfo
-@ifnotinfo
-(see the Emacs manual for more information about indirect buffers)
-@end ifnotinfo
-will contain the entire buffer, but will be narrowed to the current
-tree. Editing the indirect buffer will also change the original buffer,
-but without affecting visibility in that buffer.}. With a numeric
-prefix argument N, go up to level N and then take that tree. If N is
-negative then go up that many levels. With a @kbd{C-u} prefix, do not remove
-the previously used indirect buffer.
-@end table
-
-@vindex org-startup-folded
-@cindex @code{overview}, STARTUP keyword
-@cindex @code{content}, STARTUP keyword
-@cindex @code{showall}, STARTUP keyword
-@cindex @code{showeverything}, STARTUP keyword
-
-When Emacs first visits an Org file, the global state is set to
-OVERVIEW, i.e. only the top level headlines are visible. This can be
-configured through the variable @code{org-startup-folded}, or on a
-per-file basis by adding one of the following lines anywhere in the
-buffer:
-
-@example
-#+STARTUP: overview
-#+STARTUP: content
-#+STARTUP: showall
-#+STARTUP: showeverything
-@end example
-
-@cindex property, VISIBILITY
-@noindent
-Furthermore, any entries with a @samp{VISIBILITY} property (@pxref{Properties
-and Columns}) will get their visibility adapted accordingly. Allowed values
-for this property are @code{folded}, @code{children}, @code{content}, and
-@code{all}.
-@table @asis
-@orgcmd{C-u C-u @key{TAB},org-set-startup-visibility}
-Switch back to the startup visibility of the buffer, i.e. whatever is
-requested by startup options and @samp{VISIBILITY} properties in individual
-entries.
-@end table
-
-@node Motion, Structure editing, Visibility cycling, Document Structure
-@section Motion
-@cindex motion, between headlines
-@cindex jumping, to headlines
-@cindex headline navigation
-The following commands jump to other headlines in the buffer.
-
-@table @asis
-@orgcmd{C-c C-n,outline-next-visible-heading}
-Next heading.
-@orgcmd{C-c C-p,outline-previous-visible-heading}
-Previous heading.
-@orgcmd{C-c C-f,org-forward-same-level}
-Next heading same level.
-@orgcmd{C-c C-b,org-backward-same-level}
-Previous heading same level.
-@orgcmd{C-c C-u,outline-up-heading}
-Backward to higher level heading.
-@orgcmd{C-c C-j,org-goto}
-Jump to a different place without changing the current outline
-visibility. Shows the document structure in a temporary buffer, where
-you can use the following keys to find your destination:
-@vindex org-goto-auto-isearch
-@example
-@key{TAB} @r{Cycle visibility.}
-@key{down} / @key{up} @r{Next/previous visible headline.}
-@key{RET} @r{Select this location.}
-@kbd{/} @r{Do a Sparse-tree search}
-@r{The following keys work if you turn off @code{org-goto-auto-isearch}}
-n / p @r{Next/previous visible headline.}
-f / b @r{Next/previous headline same level.}
-u @r{One level up.}
-0-9 @r{Digit argument.}
-q @r{Quit}
-@end example
-@vindex org-goto-interface
-@noindent
-See also the variable @code{org-goto-interface}.
-@end table
-
-@node Structure editing, Sparse trees, Motion, Document Structure
-@section Structure editing
-@cindex structure editing
-@cindex headline, promotion and demotion
-@cindex promotion, of subtrees
-@cindex demotion, of subtrees
-@cindex subtree, cut and paste
-@cindex pasting, of subtrees
-@cindex cutting, of subtrees
-@cindex copying, of subtrees
-@cindex sorting, of subtrees
-@cindex subtrees, cut and paste
-
-@table @asis
-@orgcmd{M-@key{RET},org-insert-heading}
-@vindex org-M-RET-may-split-line
-Insert new heading with same level as current. If the cursor is in a
-plain list item, a new item is created (@pxref{Plain lists}). To force
-creation of a new headline, use a prefix argument, or first press @key{RET}
-to get to the beginning of the next line. When this command is used in
-the middle of a line, the line is split and the rest of the line becomes
-the new headline@footnote{If you do not want the line to be split,
-customize the variable @code{org-M-RET-may-split-line}.}. If the
-command is used at the beginning of a headline, the new headline is
-created before the current line. If at the beginning of any other line,
-the content of that line is made the new heading. If the command is
-used at the end of a folded subtree (i.e. behind the ellipses at the end
-of a headline), then a headline like the current one will be inserted
-after the end of the subtree.
-@orgcmd{C-@key{RET},org-insert-heading-respect-content}
-Just like @kbd{M-@key{RET}}, except when adding a new heading below the
-current heading, the new heading is placed after the body instead of before
-it. This command works from anywhere in the entry.
-@orgcmd{M-S-@key{RET},org-insert-todo-heading}
-@vindex org-treat-insert-todo-heading-as-state-change
-Insert new TODO entry with same level as current heading. See also the
-variable @code{org-treat-insert-todo-heading-as-state-change}.
-@orgcmd{C-S-@key{RET},org-insert-todo-heading-respect-content}
-Insert new TODO entry with same level as current heading. Like
-@kbd{C-@key{RET}}, the new headline will be inserted after the current
-subtree.
-@orgcmd{@key{TAB},org-cycle}
-In a new entry with no text yet, the first @key{TAB} demotes the entry to
-become a child of the previous one. The next @key{TAB} makes it a parent,
-and so on, all the way to top level. Yet another @key{TAB}, and you are back
-to the initial level.
-@orgcmd{M-@key{left},org-do-promote}
-Promote current heading by one level.
-@orgcmd{M-@key{right},org-do-demote}
-Demote current heading by one level.
-@orgcmd{M-S-@key{left},org-promote-subtree}
-Promote the current subtree by one level.
-@orgcmd{M-S-@key{right},org-demote-subtree}
-Demote the current subtree by one level.
-@orgcmd{M-S-@key{up},org-move-subtree-up}
-Move subtree up (swap with previous subtree of same
-level).
-@orgcmd{M-S-@key{down},org-move-subtree-down}
-Move subtree down (swap with next subtree of same level).
-@orgcmd{C-c C-x C-w,org-cut-subtree}
-Kill subtree, i.e. remove it from buffer but save in kill ring.
-With a numeric prefix argument N, kill N sequential subtrees.
-@orgcmd{C-c C-x M-w,org-copy-subtree}
-Copy subtree to kill ring. With a numeric prefix argument N, copy the N
-sequential subtrees.
-@orgcmd{C-c C-x C-y,org-paste-subtree}
-Yank subtree from kill ring. This does modify the level of the subtree to
-make sure the tree fits in nicely at the yank position. The yank level can
-also be specified with a numeric prefix argument, or by yanking after a
-headline marker like @samp{****}.
-@orgcmd{C-y,org-yank}
-@vindex org-yank-adjusted-subtrees
-@vindex org-yank-folded-subtrees
-Depending on the variables @code{org-yank-adjusted-subtrees} and
-@code{org-yank-folded-subtrees}, Org's internal @code{yank} command will
-paste subtrees folded and in a clever way, using the same command as @kbd{C-c
-C-x C-y}. With the default settings, no level adjustment will take place,
-but the yanked tree will be folded unless doing so would swallow text
-previously visible. Any prefix argument to this command will force a normal
-@code{yank} to be executed, with the prefix passed along. A good way to
-force a normal yank is @kbd{C-u C-y}. If you use @code{yank-pop} after a
-yank, it will yank previous kill items plainly, without adjustment and
-folding.
-@orgcmd{C-c C-x c,org-clone-subtree-with-time-shift}
-Clone a subtree by making a number of sibling copies of it. You will be
-prompted for the number of copies to make, and you can also specify if any
-timestamps in the entry should be shifted. This can be useful, for example,
-to create a number of tasks related to a series of lectures to prepare. For
-more details, see the docstring of the command
-@code{org-clone-subtree-with-time-shift}.
-@orgcmd{C-c C-w,org-refile}
-Refile entry or region to a different location. @xref{Refiling notes}.
-@orgcmd{C-c ^,org-sort-entries-or-items}
-Sort same-level entries. When there is an active region, all entries in the
-region will be sorted. Otherwise the children of the current headline are
-sorted. The command prompts for the sorting method, which can be
-alphabetically, numerically, by time (first timestamp with active preferred,
-creation time, scheduled time, deadline time), by priority, by TODO keyword
-(in the sequence the keywords have been defined in the setup) or by the value
-of a property. Reverse sorting is possible as well. You can also supply
-your own function to extract the sorting key. With a @kbd{C-u} prefix,
-sorting will be case-sensitive. With two @kbd{C-u C-u} prefixes, duplicate
-entries will also be removed.
-@orgcmd{C-x n s,org-narrow-to-subtree}
-Narrow buffer to current subtree.
-@orgcmd{C-x n w,widen}
-Widen buffer to remove narrowing.
-@orgcmd{C-c *,org-toggle-heading}
-Turn a normal line or plain list item into a headline (so that it becomes a
-subheading at its location). Also turn a headline into a normal line by
-removing the stars. If there is an active region, turn all lines in the
-region into headlines. If the first line in the region was an item, turn
-only the item lines into headlines. Finally, if the first line is a
-headline, remove the stars from all headlines in the region.
-@end table
-
-@cindex region, active
-@cindex active region
-@cindex transient mark mode
-When there is an active region (Transient Mark mode), promotion and
-demotion work on all headlines in the region. To select a region of
-headlines, it is best to place both point and mark at the beginning of a
-line, mark at the beginning of the first headline, and point at the line
-just after the last headline to change. Note that when the cursor is
-inside a table (@pxref{Tables}), the Meta-Cursor keys have different
-functionality.
-
-
-@node Sparse trees, Plain lists, Structure editing, Document Structure
-@section Sparse trees
-@cindex sparse trees
-@cindex trees, sparse
-@cindex folding, sparse trees
-@cindex occur, command
-
-@vindex org-show-hierarchy-above
-@vindex org-show-following-heading
-@vindex org-show-siblings
-@vindex org-show-entry-below
-An important feature of Org-mode is the ability to construct @emph{sparse
-trees} for selected information in an outline tree, so that the entire
-document is folded as much as possible, but the selected information is made
-visible along with the headline structure above it@footnote{See also the
-variables @code{org-show-hierarchy-above}, @code{org-show-following-heading},
-@code{org-show-siblings}, and @code{org-show-entry-below} for detailed
-control on how much context is shown around each match.}. Just try it out
-and you will see immediately how it works.
-
-Org-mode contains several commands creating such trees, all these
-commands can be accessed through a dispatcher:
-
-@table @asis
-@orgcmd{C-c /,org-sparse-tree}
-This prompts for an extra key to select a sparse-tree creating command.
-@orgcmd{C-c / r,org-occur}
-@vindex org-remove-highlights-with-change
-Occur. Prompts for a regexp and shows a sparse tree with all matches. If
-the match is in a headline, the headline is made visible. If the match is in
-the body of an entry, headline and body are made visible. In order to
-provide minimal context, also the full hierarchy of headlines above the match
-is shown, as well as the headline following the match. Each match is also
-highlighted; the highlights disappear when the buffer is changed by an
-editing command@footnote{This depends on the option
-@code{org-remove-highlights-with-change}}, or by pressing @kbd{C-c C-c}.
-When called with a @kbd{C-u} prefix argument, previous highlights are kept,
-so several calls to this command can be stacked.
-@end table
-
-@noindent
-@vindex org-agenda-custom-commands
-For frequently used sparse trees of specific search strings, you can
-use the variable @code{org-agenda-custom-commands} to define fast
-keyboard access to specific sparse trees. These commands will then be
-accessible through the agenda dispatcher (@pxref{Agenda dispatcher}).
-For example:
-
-@lisp
-(setq org-agenda-custom-commands
- '(("f" occur-tree "FIXME")))
-@end lisp
-
-@noindent will define the key @kbd{C-c a f} as a shortcut for creating
-a sparse tree matching the string @samp{FIXME}.
-
-The other sparse tree commands select headings based on TODO keywords,
-tags, or properties and will be discussed later in this manual.
-
-@kindex C-c C-e v
-@cindex printing sparse trees
-@cindex visible text, printing
-To print a sparse tree, you can use the Emacs command
-@code{ps-print-buffer-with-faces} which does not print invisible parts
-of the document @footnote{This does not work under XEmacs, because
-XEmacs uses selective display for outlining, not text properties.}.
-Or you can use the command @kbd{C-c C-e v} to export only the visible
-part of the document and print the resulting file.
-
-@node Plain lists, Drawers, Sparse trees, Document Structure
-@section Plain lists
-@cindex plain lists
-@cindex lists, plain
-@cindex lists, ordered
-@cindex ordered lists
-
-Within an entry of the outline tree, hand-formatted lists can provide
-additional structure. They also provide a way to create lists of checkboxes
-(@pxref{Checkboxes}). Org supports editing such lists, and every exporter
-(@pxref{Exporting}) can parse and format them.
-
-Org knows ordered lists, unordered lists, and description lists.
-@itemize @bullet
-@item
-@emph{Unordered} list items start with @samp{-}, @samp{+}, or
-@samp{*}@footnote{When using @samp{*} as a bullet, lines must be indented or
-they will be seen as top-level headlines. Also, when you are hiding leading
-stars to get a clean outline view, plain list items starting with a star are
-visually indistinguishable from true headlines. In short: even though
-@samp{*} is supported, it may be better to not use it for plain list items.}
-as bullets.
-@item
-@vindex org-plain-list-ordered-item-terminator
-@emph{Ordered} list items start with a numeral followed by either a period or
-a right parenthesis@footnote{You can filter out any of them by configuring
-@code{org-plain-list-ordered-item-terminator}.}, such as @samp{1.} or
-@samp{1)}. If you want a list to start with a different value (e.g. 20), start
-the text of the item with @code{[@@20]}@footnote{If there's a checkbox in the
-item, the cookie must be put @emph{before} the checkbox.}. Those constructs
-can be used in any item of the list in order to enforce a particular
-numbering.
-@item
-@emph{Description} list items are unordered list items, and contain the
-separator @samp{ :: } to separate the description @emph{term} from the
-description.
-@end itemize
-
-Items belonging to the same list must have the same indentation on the first
-line. In particular, if an ordered list reaches number @samp{10.}, then the
-2--digit numbers must be written left-aligned with the other numbers in the
-list.
-
-@vindex org-list-ending-method
-@vindex org-list-end-regexp
-@vindex org-empty-line-terminates-plain-lists
-Two methods@footnote{To disable either of them, configure
-@code{org-list-ending-method}.} are provided to terminate lists. A list ends
-before the next line that is indented like the bullet/number or less, or it
-ends before two blank lines@footnote{See also
-@code{org-empty-line-terminates-plain-lists}.}. In both cases, all levels of
-the list are closed@footnote{So you cannot have a sublist, some text and then
-another sublist while still in the same top-level list item. This used to be
-possible, but it was only supported in the HTML exporter and difficult to
-manage with automatic indentation.}. For finer control, you can end lists
-with any pattern set in @code{org-list-end-regexp}. Here is an example:
-
-@example
-@group
-** Lord of the Rings
- My favorite scenes are (in this order)
- 1. The attack of the Rohirrim
- 2. Eowyn's fight with the witch king
- + this was already my favorite scene in the book
- + I really like Miranda Otto.
- 3. Peter Jackson being shot by Legolas
- He makes a really funny face when it happens.
- - on DVD only
- But in the end, no individual scenes matter but the film as a whole.
- Important actors in this film are:
- - @b{Elijah Wood} :: He plays Frodo
- - @b{Sean Austin} :: He plays Sam, Frodo's friend. I still remember
- him very well from his role as Mikey Walsh in @i{The Goonies}.
-@end group
-@end example
-
-Org supports these lists by tuning filling and wrapping commands to deal with
-them correctly@footnote{Org only changes the filling settings for Emacs. For
-XEmacs, you should use Kyle E. Jones' @file{filladapt.el}. To turn this on,
-put into @file{.emacs}: @code{(require 'filladapt)}}, and by exporting them
-properly (@pxref{Exporting}). Since indentation is what governs the
-structure of these lists, many structural constructs like @code{#+BEGIN_...}
-blocks can be indented to signal that they should be considered as a list
-item.
-
-@vindex org-list-demote-modify-bullet
-If you find that using a different bullet for a sub-list (than that used for
-the current list-level) improves readability, customize the variable
-@code{org-list-demote-modify-bullet}.
-
-@vindex org-list-automatic-rules
-The following commands act on items when the cursor is in the first line of
-an item (the line with the bullet or number). Some of them imply the
-application of automatic rules to keep list structure intact. If some of
-these actions get in your way, configure @code{org-list-automatic-rules}
-to disable them individually.
-
-@table @asis
-@orgcmd{@key{TAB},org-cycle}
-@vindex org-cycle-include-plain-lists
-Items can be folded just like headline levels. Normally this works only if
-the cursor is on a plain list item. For more details, see the variable
-@code{org-cycle-include-plain-lists}. If this variable is set to
-@code{integrate}, plain list items will be treated like low-level
-headlines. The level of an item is then given by the
-indentation of the bullet/number. Items are always subordinate to real
-headlines, however; the hierarchies remain completely separated.
-@orgcmd{M-@key{RET},org-insert-heading}
-@vindex org-M-RET-may-split-line
-@vindex org-list-automatic-rules
-Insert new item at current level. With a prefix argument, force a new
-heading (@pxref{Structure editing}). If this command is used in the middle
-of a line, the line is @emph{split} and the rest of the line becomes the new
-item@footnote{If you do not want the line to be split, customize the variable
-@code{org-M-RET-may-split-line}.}. If this command is executed @emph{before
-an item's body}, the new item is created @emph{before} the current item. If the
-command is executed in the white space before the text that is part of an
-item but does not contain the bullet, a bullet is added to the current line.
-
-As a new item cannot be inserted in a structural construct (like an example
-or source code block) within a list, Org will instead insert it right before
-the structure, or return an error.
-@kindex M-S-@key{RET}
-@item M-S-@key{RET}
-Insert a new item with a checkbox (@pxref{Checkboxes}).
-@orgcmd{@key{TAB},org-cycle}
-In a new item with no text yet, the first @key{TAB} demotes the item to
-become a child of the previous one. Subsequent @key{TAB}s move the item to
-meaningful levels in the list and eventually get it back to its initial
-position.
-@kindex S-@key{down}
-@item S-@key{up}
-@itemx S-@key{down}
-@cindex shift-selection-mode
-@vindex org-support-shift-select
-Jump to the previous/next item in the current list, but only if
-@code{org-support-shift-select} is off. If not, you can still use paragraph
-jumping commands like @kbd{C-@key{up}} and @kbd{C-@key{down}} to quite
-similar effect.
-@kindex M-S-@key{up}
-@kindex M-S-@key{down}
-@item M-S-@key{up}
-@itemx M-S-@key{down}
-Move the item including subitems up/down (swap with previous/next item
-of same indentation). If the list is ordered, renumbering is
-automatic.
-@kindex M-@key{left}
-@kindex M-@key{right}
-@item M-@key{left}
-@itemx M-@key{right}
-Decrease/increase the indentation of an item, leaving children alone.
-@kindex M-S-@key{left}
-@kindex M-S-@key{right}
-@item M-S-@key{left}
-@itemx M-S-@key{right}
-Decrease/increase the indentation of the item, including subitems.
-Initially, the item tree is selected based on current indentation. When
-these commands are executed several times in direct succession, the initially
-selected region is used, even if the new indentation would imply a different
-hierarchy. To use the new hierarchy, break the command chain with a cursor
-motion or so.
-
-As a special case, using this command on the very first item of a list will
-move the whole list. This behavior can be disabled by configuring
-@code{org-list-automatic-rules}. The global indentation of a list has no
-influence on the text @emph{after} the list.
-@kindex C-c C-c
-@item C-c C-c
-If there is a checkbox (@pxref{Checkboxes}) in the item line, toggle the
-state of the checkbox. Also, makes sure that all the
-items on this list level use the same bullet and that the numbering of list
-items (if applicable) is correct.
-@kindex C-c -
-@vindex org-plain-list-ordered-item-terminator
-@vindex org-list-automatic-rules
-@item C-c -
-Cycle the entire list level through the different itemize/enumerate bullets
-(@samp{-}, @samp{+}, @samp{*}, @samp{1.}, @samp{1)}) or a subset of them,
-depending on @code{org-plain-list-ordered-item-terminator}, the type of list,
-and its position@footnote{See @code{bullet} rule in
-@code{org-list-automatic-rules} for more information.}. With a numeric
-prefix argument N, select the Nth bullet from this list. If there is an
-active region when calling this, all lines will be converted to list items.
-If the first line already was a list item, any item markers will be removed
-from the list. Finally, even without an active region, a normal line will be
-converted into a list item.
-@kindex C-c *
-@item C-c *
-Turn a plain list item into a headline (so that it becomes a subheading at
-its location). @xref{Structure editing}, for a detailed explanation.
-@kindex S-@key{left}
-@kindex S-@key{right}
-@item S-@key{left}/@key{right}
-@vindex org-support-shift-select
-This command also cycles bullet styles when the cursor in on the bullet or
-anywhere in an item line, details depending on
-@code{org-support-shift-select}.
-@kindex C-c ^
-@item C-c ^
-Sort the plain list. You will be prompted for the sorting method:
-numerically, alphabetically, by time, or by custom function.
-@end table
-
-@node Drawers, Blocks, Plain lists, Document Structure
-@section Drawers
-@cindex drawers
-@cindex #+DRAWERS
-@cindex visibility cycling, drawers
-
-@vindex org-drawers
-Sometimes you want to keep information associated with an entry, but you
-normally don't want to see it. For this, Org-mode has @emph{drawers}.
-Drawers need to be configured with the variable
-@code{org-drawers}@footnote{You can define drawers on a per-file basis
-with a line like @code{#+DRAWERS: HIDDEN PROPERTIES STATE}}. Drawers
-look like this:
-
-@example
-** This is a headline
- Still outside the drawer
- :DRAWERNAME:
- This is inside the drawer.
- :END:
- After the drawer.
-@end example
-
-Visibility cycling (@pxref{Visibility cycling}) on the headline will hide and
-show the entry, but keep the drawer collapsed to a single line. In order to
-look inside the drawer, you need to move the cursor to the drawer line and
-press @key{TAB} there. Org-mode uses the @code{PROPERTIES} drawer for
-storing properties (@pxref{Properties and Columns}), and you can also arrange
-for state change notes (@pxref{Tracking TODO state changes}) and clock times
-(@pxref{Clocking work time}) to be stored in a drawer @code{LOGBOOK}. If you
-want to store a quick note in the LOGBOOK drawer, in a similar way to state changes, use
-
-@table @kbd
-@kindex C-c C-z
-@item C-c C-z
-Add a time-stamped note to the LOGBOOK drawer.
-@end table
-
-@node Blocks, Footnotes, Drawers, Document Structure
-@section Blocks
-
-@vindex org-hide-block-startup
-@cindex blocks, folding
-Org-mode uses begin...end blocks for various purposes from including source
-code examples (@pxref{Literal examples}) to capturing time logging
-information (@pxref{Clocking work time}). These blocks can be folded and
-unfolded by pressing TAB in the begin line. You can also get all blocks
-folded at startup by configuring the variable @code{org-hide-block-startup}
-or on a per-file basis by using
-
-@cindex @code{hideblocks}, STARTUP keyword
-@cindex @code{nohideblocks}, STARTUP keyword
-@example
-#+STARTUP: hideblocks
-#+STARTUP: nohideblocks
-@end example
-
-@node Footnotes, Orgstruct mode, Blocks, Document Structure
-@section Footnotes
-@cindex footnotes
-
-Org-mode supports the creation of footnotes. In contrast to the
-@file{footnote.el} package, Org-mode's footnotes are designed for work on a
-larger document, not only for one-off documents like emails. The basic
-syntax is similar to the one used by @file{footnote.el}, i.e. a footnote is
-defined in a paragraph that is started by a footnote marker in square
-brackets in column 0, no indentation allowed. If you need a paragraph break
-inside a footnote, use the @LaTeX{} idiom @samp{\par}. The footnote reference
-is simply the marker in square brackets, inside text. For example:
-
-@example
-The Org homepage[fn:1] now looks a lot better than it used to.
-...
-[fn:1] The link is: http://orgmode.org
-@end example
-
-Org-mode extends the number-based syntax to @emph{named} footnotes and
-optional inline definition. Using plain numbers as markers (as
-@file{footnote.el} does) is supported for backward compatibility, but not
-encouraged because of possible conflicts with @LaTeX{} snippets (@pxref{Embedded
-LaTeX}). Here are the valid references:
-
-@table @code
-@item [1]
-A plain numeric footnote marker. Compatible with @file{footnote.el}, but not
-recommended because something like @samp{[1]} could easily be part of a code
-snippet.
-@item [fn:name]
-A named footnote reference, where @code{name} is a unique label word, or, for
-simplicity of automatic creation, a number.
-@item [fn:: This is the inline definition of this footnote]
-A @LaTeX{}-like anonymous footnote where the definition is given directly at the
-reference point.
-@item [fn:name: a definition]
-An inline definition of a footnote, which also specifies a name for the note.
-Since Org allows multiple references to the same note, you can then use
-@code{[fn:name]} to create additional references.
-@end table
-
-@vindex org-footnote-auto-label
-Footnote labels can be created automatically, or you can create names yourself.
-This is handled by the variable @code{org-footnote-auto-label} and its
-corresponding @code{#+STARTUP} keywords. See the docstring of that variable
-for details.
-
-@noindent The following command handles footnotes:
-
-@table @kbd
-@kindex C-c C-x f
-@item C-c C-x f
-The footnote action command.
-
-When the cursor is on a footnote reference, jump to the definition. When it
-is at a definition, jump to the (first) reference.
-
-@vindex org-footnote-define-inline
-@vindex org-footnote-section
-@vindex org-footnote-auto-adjust
-Otherwise, create a new footnote. Depending on the variable
-@code{org-footnote-define-inline}@footnote{The corresponding in-buffer
-setting is: @code{#+STARTUP: fninline} or @code{#+STARTUP: nofninline}}, the
-definition will be placed right into the text as part of the reference, or
-separately into the location determined by the variable
-@code{org-footnote-section}.
-
-When this command is called with a prefix argument, a menu of additional
-options is offered:
-@example
-s @r{Sort the footnote definitions by reference sequence. During editing,}
- @r{Org makes no effort to sort footnote definitions into a particular}
- @r{sequence. If you want them sorted, use this command, which will}
- @r{also move entries according to @code{org-footnote-section}. Automatic}
- @r{sorting after each insertion/deletion can be configured using the}
- @r{variable @code{org-footnote-auto-adjust}.}
-r @r{Renumber the simple @code{fn:N} footnotes. Automatic renumbering}
- @r{after each insertion/deletion can be configured using the variable}
- @r{@code{org-footnote-auto-adjust}.}
-S @r{Short for first @code{r}, then @code{s} action.}
-n @r{Normalize the footnotes by collecting all definitions (including}
- @r{inline definitions) into a special section, and then numbering them}
- @r{in sequence. The references will then also be numbers. This is}
- @r{meant to be the final step before finishing a document (e.g. sending}
- @r{off an email). The exporters do this automatically, and so could}
- @r{something like @code{message-send-hook}.}
-d @r{Delete the footnote at point, and all definitions of and references}
- @r{to it.}
-@end example
-Depending on the variable @code{org-footnote-auto-adjust}@footnote{the
-corresponding in-buffer options are @code{fnadjust} and @code{nofnadjust}.},
-renumbering and sorting footnotes can be automatic after each insertion or
-deletion.
-
-@kindex C-c C-c
-@item C-c C-c
-If the cursor is on a footnote reference, jump to the definition. If it is a
-the definition, jump back to the reference. When called at a footnote
-location with a prefix argument, offer the same menu as @kbd{C-c C-x f}.
-@kindex C-c C-o
-@kindex mouse-1
-@kindex mouse-2
-@item C-c C-o @r{or} mouse-1/2
-Footnote labels are also links to the corresponding definition/reference, and
-you can use the usual commands to follow these links.
-@end table
-
-@node Orgstruct mode, , Footnotes, Document Structure
-@section The Orgstruct minor mode
-@cindex Orgstruct mode
-@cindex minor mode for structure editing
-
-If you like the intuitive way the Org-mode structure editing and list
-formatting works, you might want to use these commands in other modes like
-Text mode or Mail mode as well. The minor mode @code{orgstruct-mode} makes
-this possible. Toggle the mode with @kbd{M-x orgstruct-mode}, or
-turn it on by default, for example in Mail mode, with one of:
-
-@lisp
-(add-hook 'mail-mode-hook 'turn-on-orgstruct)
-(add-hook 'mail-mode-hook 'turn-on-orgstruct++)
-@end lisp
-
-When this mode is active and the cursor is on a line that looks to Org like a
-headline or the first line of a list item, most structure editing commands
-will work, even if the same keys normally have different functionality in the
-major mode you are using. If the cursor is not in one of those special
-lines, Orgstruct mode lurks silently in the shadows. When you use
-@code{orgstruct++-mode}, Org will also export indentation and autofill
-settings into that mode, and detect item context after the first line of an
-item.
-
-@node Tables, Hyperlinks, Document Structure, Top
-@chapter Tables
-@cindex tables
-@cindex editing tables
-
-Org comes with a fast and intuitive table editor. Spreadsheet-like
-calculations are supported using the Emacs @file{calc} package
-@ifinfo
-(@pxref{Top,Calc,,Calc,Gnu Emacs Calculator Manual}).
-@end ifinfo
-@ifnotinfo
-(see the Emacs Calculator manual for more information about the Emacs
-calculator).
-@end ifnotinfo
-
-@menu
-* Built-in table editor:: Simple tables
-* Column width and alignment:: Overrule the automatic settings
-* Column groups:: Grouping to trigger vertical lines
-* Orgtbl mode:: The table editor as minor mode
-* The spreadsheet:: The table editor has spreadsheet capabilities
-* Org-Plot:: Plotting from org tables
-@end menu
-
-@node Built-in table editor, Column width and alignment, Tables, Tables
-@section The built-in table editor
-@cindex table editor, built-in
-
-Org makes it easy to format tables in plain ASCII. Any line with
-@samp{|} as the first non-whitespace character is considered part of a
-table. @samp{|} is also the column separator. A table might look like
-this:
-
-@example
-| Name | Phone | Age |
-|-------+-------+-----|
-| Peter | 1234 | 17 |
-| Anna | 4321 | 25 |
-@end example
-
-A table is re-aligned automatically each time you press @key{TAB} or
-@key{RET} or @kbd{C-c C-c} inside the table. @key{TAB} also moves to
-the next field (@key{RET} to the next row) and creates new table rows
-at the end of the table or before horizontal lines. The indentation
-of the table is set by the first line. Any line starting with
-@samp{|-} is considered as a horizontal separator line and will be
-expanded on the next re-align to span the whole table width. So, to
-create the above table, you would only type
-
-@example
-|Name|Phone|Age|
-|-
-@end example
-
-@noindent and then press @key{TAB} to align the table and start filling in
-fields. Even faster would be to type @code{|Name|Phone|Age} followed by
-@kbd{C-c @key{RET}}.
-
-@vindex org-enable-table-editor
-@vindex org-table-auto-blank-field
-When typing text into a field, Org treats @key{DEL},
-@key{Backspace}, and all character keys in a special way, so that
-inserting and deleting avoids shifting other fields. Also, when
-typing @emph{immediately after the cursor was moved into a new field
-with @kbd{@key{TAB}}, @kbd{S-@key{TAB}} or @kbd{@key{RET}}}, the
-field is automatically made blank. If this behavior is too
-unpredictable for you, configure the variables
-@code{org-enable-table-editor} and @code{org-table-auto-blank-field}.
-
-@table @kbd
-@tsubheading{Creation and conversion}
-@orgcmd{C-c |,org-table-create-or-convert-from-region}
-Convert the active region to table. If every line contains at least one
-TAB character, the function assumes that the material is tab separated.
-If every line contains a comma, comma-separated values (CSV) are assumed.
-If not, lines are split at whitespace into fields. You can use a prefix
-argument to force a specific separator: @kbd{C-u} forces CSV, @kbd{C-u
-C-u} forces TAB, and a numeric argument N indicates that at least N
-consecutive spaces, or alternatively a TAB will be the separator.
-@*
-If there is no active region, this command creates an empty Org
-table. But it's easier just to start typing, like
-@kbd{|Name|Phone|Age @key{RET} |- @key{TAB}}.
-
-@tsubheading{Re-aligning and field motion}
-@orgcmd{C-c C-c,org-table-align}
-Re-align the table without moving the cursor.
-@c
-@orgcmd{<TAB>,org-table-next-field}
-Re-align the table, move to the next field. Creates a new row if
-necessary.
-@c
-@orgcmd{S-@key{TAB},org-table-previous-field}
-Re-align, move to previous field.
-@c
-@orgcmd{@key{RET},org-table-next-row}
-Re-align the table and move down to next row. Creates a new row if
-necessary. At the beginning or end of a line, @key{RET} still does
-NEWLINE, so it can be used to split a table.
-@c
-@orgcmd{M-a,org-table-beginning-of-field}
-Move to beginning of the current table field, or on to the previous field.
-@orgcmd{M-e,org-table-end-of-field}
-Move to end of the current table field, or on to the next field.
-
-@tsubheading{Column and row editing}
-@orgcmdkkcc{M-@key{left},M-@key{right},org-table-move-column-left,org-table-move-column-right}
-Move the current column left/right.
-@c
-@orgcmd{M-S-@key{left},org-table-delete-column}
-Kill the current column.
-@c
-@orgcmd{M-S-@key{right},org-table-insert-column}
-Insert a new column to the left of the cursor position.
-@c
-@orgcmdkkcc{M-@key{up},M-@key{down},org-table-move-row-up,org-table-move-row-down}
-Move the current row up/down.
-@c
-@orgcmd{M-S-@key{up},org-table-kill-row}
-Kill the current row or horizontal line.
-@c
-@orgcmd{M-S-@key{down},org-table-insert-row}
-Insert a new row above the current row. With a prefix argument, the line is
-created below the current one.
-@c
-@orgcmd{C-c -,org-table-insert-hline}
-Insert a horizontal line below current row. With a prefix argument, the line
-is created above the current line.
-@c
-@orgcmd{C-c @key{RET},org-table-hline-and-move}
-Insert a horizontal line below current row, and move the cursor into the row
-below that line.
-@c
-@orgcmd{C-c ^,org-table-sort-lines}
-Sort the table lines in the region. The position of point indicates the
-column to be used for sorting, and the range of lines is the range
-between the nearest horizontal separator lines, or the entire table. If
-point is before the first column, you will be prompted for the sorting
-column. If there is an active region, the mark specifies the first line
-and the sorting column, while point should be in the last line to be
-included into the sorting. The command prompts for the sorting type
-(alphabetically, numerically, or by time). When called with a prefix
-argument, alphabetic sorting will be case-sensitive.
-
-@tsubheading{Regions}
-@orgcmd{C-c C-x M-w,org-table-copy-region}
-Copy a rectangular region from a table to a special clipboard. Point and
-mark determine edge fields of the rectangle. If there is no active region,
-copy just the current field. The process ignores horizontal separator lines.
-@c
-@orgcmd{C-c C-x C-w,org-table-cut-region}
-Copy a rectangular region from a table to a special clipboard, and
-blank all fields in the rectangle. So this is the ``cut'' operation.
-@c
-@orgcmd{C-c C-x C-y,org-table-paste-rectangle}
-Paste a rectangular region into a table.
-The upper left corner ends up in the current field. All involved fields
-will be overwritten. If the rectangle does not fit into the present table,
-the table is enlarged as needed. The process ignores horizontal separator
-lines.
-@c
-@orgcmd{M-@key{RET},org-table-wrap-region}
-Split the current field at the cursor position and move the rest to the line
-below. If there is an active region, and both point and mark are in the same
-column, the text in the column is wrapped to minimum width for the given
-number of lines. A numeric prefix argument may be used to change the number
-of desired lines. If there is no region, but you specify a prefix argument,
-the current field is made blank, and the content is appended to the field
-above.
-
-@tsubheading{Calculations}
-@cindex formula, in tables
-@cindex calculations, in tables
-@cindex region, active
-@cindex active region
-@cindex transient mark mode
-@orgcmd{C-c +,org-table-sum}
-Sum the numbers in the current column, or in the rectangle defined by
-the active region. The result is shown in the echo area and can
-be inserted with @kbd{C-y}.
-@c
-@orgcmd{S-@key{RET},org-table-copy-down}
-@vindex org-table-copy-increment
-When current field is empty, copy from first non-empty field above. When not
-empty, copy current field down to next row and move cursor along with it.
-Depending on the variable @code{org-table-copy-increment}, integer field
-values will be incremented during copy. Integers that are too large will not
-be incremented. Also, a @code{0} prefix argument temporarily disables the
-increment. This key is also used by shift-selection and related modes
-(@pxref{Conflicts}).
-
-@tsubheading{Miscellaneous}
-@orgcmd{C-c `,org-table-edit-field}
-Edit the current field in a separate window. This is useful for fields that
-are not fully visible (@pxref{Column width and alignment}). When called with
-a @kbd{C-u} prefix, just make the full field visible, so that it can be
-edited in place.
-@c
-@item M-x org-table-import
-Import a file as a table. The table should be TAB or whitespace
-separated. Use, for example, to import a spreadsheet table or data
-from a database, because these programs generally can write
-TAB-separated text files. This command works by inserting the file into
-the buffer and then converting the region to a table. Any prefix
-argument is passed on to the converter, which uses it to determine the
-separator.
-@orgcmd{C-c |,org-table-create-or-convert-from-region}
-Tables can also be imported by pasting tabular text into the Org
-buffer, selecting the pasted text with @kbd{C-x C-x} and then using the
-@kbd{C-c |} command (see above under @i{Creation and conversion}).
-@c
-@item M-x org-table-export
-@findex org-table-export
-@vindex org-table-export-default-format
-Export the table, by default as a TAB-separated file. Use for data
-exchange with, for example, spreadsheet or database programs. The format
-used to export the file can be configured in the variable
-@code{org-table-export-default-format}. You may also use properties
-@code{TABLE_EXPORT_FILE} and @code{TABLE_EXPORT_FORMAT} to specify the file
-name and the format for table export in a subtree. Org supports quite
-general formats for exported tables. The exporter format is the same as the
-format used by Orgtbl radio tables, see @ref{Translator functions}, for a
-detailed description.
-@end table
-
-If you don't like the automatic table editor because it gets in your
-way on lines which you would like to start with @samp{|}, you can turn
-it off with
-
-@lisp
-(setq org-enable-table-editor nil)
-@end lisp
-
-@noindent Then the only table command that still works is
-@kbd{C-c C-c} to do a manual re-align.
-
-@node Column width and alignment, Column groups, Built-in table editor, Tables
-@section Column width and alignment
-@cindex narrow columns in tables
-@cindex alignment in tables
-
-The width of columns is automatically determined by the table editor. And
-also the alignment of a column is determined automatically from the fraction
-of number-like versus non-number fields in the column.
-
-Sometimes a single field or a few fields need to carry more text, leading to
-inconveniently wide columns. Or maybe you want to make a table with several
-columns having a fixed width, regardless of content. To set@footnote{This
-feature does not work on XEmacs.} the width of a column, one field anywhere
-in the column may contain just the string @samp{<N>} where @samp{N} is an
-integer specifying the width of the column in characters. The next re-align
-will then set the width of this column to this value.
-
-@example
-@group
-|---+------------------------------| |---+--------|
-| | | | | <6> |
-| 1 | one | | 1 | one |
-| 2 | two | ----\ | 2 | two |
-| 3 | This is a long chunk of text | ----/ | 3 | This=> |
-| 4 | four | | 4 | four |
-|---+------------------------------| |---+--------|
-@end group
-@end example
-
-@noindent
-Fields that are wider become clipped and end in the string @samp{=>}.
-Note that the full text is still in the buffer but is hidden.
-To see the full text, hold the mouse over the field---a tool-tip window
-will show the full content. To edit such a field, use the command
-@kbd{C-c `} (that is @kbd{C-c} followed by the backquote). This will
-open a new window with the full field. Edit it and finish with @kbd{C-c
-C-c}.
-
-@vindex org-startup-align-all-tables
-When visiting a file containing a table with narrowed columns, the
-necessary character hiding has not yet happened, and the table needs to
-be aligned before it looks nice. Setting the option
-@code{org-startup-align-all-tables} will realign all tables in a file
-upon visiting, but also slow down startup. You can also set this option
-on a per-file basis with:
-
-@example
-#+STARTUP: align
-#+STARTUP: noalign
-@end example
-
-If you would like to overrule the automatic alignment of number-rich columns
-to the right and of string-rich column to the left, you can use @samp{<r>},
-@samp{c}@footnote{Centering does not work inside Emacs, but it does have an
-effect when exporting to HTML.} or @samp{<l>} in a similar fashion. You may
-also combine alignment and field width like this: @samp{<l10>}.
-
-Lines which only contain these formatting cookies will be removed
-automatically when exporting the document.
-
-@node Column groups, Orgtbl mode, Column width and alignment, Tables
-@section Column groups
-@cindex grouping columns in tables
-
-When Org exports tables, it does so by default without vertical
-lines because that is visually more satisfying in general. Occasionally
-however, vertical lines can be useful to structure a table into groups
-of columns, much like horizontal lines can do for groups of rows. In
-order to specify column groups, you can use a special row where the
-first field contains only @samp{/}. The further fields can either
-contain @samp{<} to indicate that this column should start a group,
-@samp{>} to indicate the end of a column, or @samp{<>} to make a column
-a group of its own. Boundaries between column groups will upon export be
-marked with vertical lines. Here is an example:
-
-@example
-| N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
-|---+-----+-----+-----+---------+------------|
-| / | < | | > | < | > |
-| 1 | 1 | 1 | 1 | 1 | 1 |
-| 2 | 4 | 8 | 16 | 1.4142 | 1.1892 |
-| 3 | 9 | 27 | 81 | 1.7321 | 1.3161 |
-|---+-----+-----+-----+---------+------------|
-#+TBLFM: $2=$1^2::$3=$1^3::$4=$1^4::$5=sqrt($1)::$6=sqrt(sqrt(($1)))
-@end example
-
-It is also sufficient to just insert the column group starters after
-every vertical line you would like to have:
-
-@example
-| N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
-|----+-----+-----+-----+---------+------------|
-| / | < | | | < | |
-@end example
-
-@node Orgtbl mode, The spreadsheet, Column groups, Tables
-@section The Orgtbl minor mode
-@cindex Orgtbl mode
-@cindex minor mode for tables
-
-If you like the intuitive way the Org table editor works, you
-might also want to use it in other modes like Text mode or Mail mode.
-The minor mode Orgtbl mode makes this possible. You can always toggle
-the mode with @kbd{M-x orgtbl-mode}. To turn it on by default, for
-example in mail mode, use
-
-@lisp
-(add-hook 'mail-mode-hook 'turn-on-orgtbl)
-@end lisp
-
-Furthermore, with some special setup, it is possible to maintain tables
-in arbitrary syntax with Orgtbl mode. For example, it is possible to
-construct @LaTeX{} tables with the underlying ease and power of
-Orgtbl mode, including spreadsheet capabilities. For details, see
-@ref{Tables in arbitrary syntax}.
-
-@node The spreadsheet, Org-Plot, Orgtbl mode, Tables
-@section The spreadsheet
-@cindex calculations, in tables
-@cindex spreadsheet capabilities
-@cindex @file{calc} package
-
-The table editor makes use of the Emacs @file{calc} package to implement
-spreadsheet-like capabilities. It can also evaluate Emacs Lisp forms to
-derive fields from other fields. While fully featured, Org's implementation
-is not identical to other spreadsheets. For example, Org knows the concept
-of a @emph{column formula} that will be applied to all non-header fields in a
-column without having to copy the formula to each relevant field. There is
-also a formula debugger, and a formula editor with features for highlighting
-fields in the table corresponding to the references at the point in the
-formula, moving these references by arrow keys
-
-@menu
-* References:: How to refer to another field or range
-* Formula syntax for Calc:: Using Calc to compute stuff
-* Formula syntax for Lisp:: Writing formulas in Emacs Lisp
-* Field formulas:: Formulas valid for a single field
-* Column formulas:: Formulas valid for an entire column
-* Editing and debugging formulas:: Fixing formulas
-* Updating the table:: Recomputing all dependent fields
-* Advanced features:: Field names, parameters and automatic recalc
-@end menu
-
-@node References, Formula syntax for Calc, The spreadsheet, The spreadsheet
-@subsection References
-@cindex references
-
-To compute fields in the table from other fields, formulas must
-reference other fields or ranges. In Org, fields can be referenced
-by name, by absolute coordinates, and by relative coordinates. To find
-out what the coordinates of a field are, press @kbd{C-c ?} in that
-field, or press @kbd{C-c @}} to toggle the display of a grid.
-
-@subsubheading Field references
-@cindex field references
-@cindex references, to fields
-
-Formulas can reference the value of another field in two ways. Like in
-any other spreadsheet, you may reference fields with a letter/number
-combination like @code{B3}, meaning the 2nd field in the 3rd row.
-@c Such references are always fixed to that field, they don't change
-@c when you copy and paste a formula to a different field. So
-@c Org's @code{B3} behaves like @code{$B$3} in other spreadsheets.
-
-@noindent
-Org also uses another, more general operator that looks like this:
-@example
-@@@var{row}$@var{column}
-@end example
-
-@noindent
-Column references can be absolute like @samp{1}, @samp{2},...@samp{@var{N}},
-or relative to the current column like @samp{+1} or @samp{-2}.
-
-The row specification only counts data lines and ignores horizontal
-separator lines (hlines). You can use absolute row numbers
-@samp{1}...@samp{@var{N}}, and row numbers relative to the current row like
-@samp{+3} or @samp{-1}. Or specify the row relative to one of the
-hlines: @samp{I} refers to the first hline@footnote{Note that only
-hlines are counted that @emph{separate} table lines. If the table
-starts with a hline above the header, it does not count.}, @samp{II} to
-the second, etc@. @samp{-I} refers to the first such line above the
-current line, @samp{+I} to the first such line below the current line.
-You can also write @samp{III+2} which is the second data line after the
-third hline in the table.
-
-@samp{0} refers to the current row and column. Also, if you omit
-either the column or the row part of the reference, the current
-row/column is implied.
-
-Org's references with @emph{unsigned} numbers are fixed references
-in the sense that if you use the same reference in the formula for two
-different fields, the same field will be referenced each time.
-Org's references with @emph{signed} numbers are floating
-references because the same reference operator can reference different
-fields depending on the field being calculated by the formula.
-
-As a special case, references like @samp{$LR5} and @samp{$LR12} can be used
-to refer in a stable way to the 5th and 12th field in the last row of the
-table.
-
-Here are a few examples:
-
-@example
-@@2$3 @r{2nd row, 3rd column}
-C2 @r{same as previous}
-$5 @r{column 5 in the current row}
-E& @r{same as previous}
-@@2 @r{current column, row 2}
-@@-1$-3 @r{the field one row up, three columns to the left}
-@@-I$2 @r{field just under hline above current row, column 2}
-@end example
-
-@subsubheading Range references
-@cindex range references
-@cindex references, to ranges
-
-You may reference a rectangular range of fields by specifying two field
-references connected by two dots @samp{..}. If both fields are in the
-current row, you may simply use @samp{$2..$7}, but if at least one field
-is in a different row, you need to use the general @code{@@row$column}
-format at least for the first field (i.e the reference must start with
-@samp{@@} in order to be interpreted correctly). Examples:
-
-@example
-$1..$3 @r{First three fields in the current row.}
-$P..$Q @r{Range, using column names (see under Advanced)}
-@@2$1..@@4$3 @r{6 fields between these two fields.}
-A2..C4 @r{Same as above.}
-@@-1$-2..@@-1 @r{3 numbers from the column to the left, 2 up to current row}
-@end example
-
-@noindent Range references return a vector of values that can be fed
-into Calc vector functions. Empty fields in ranges are normally
-suppressed, so that the vector contains only the non-empty fields (but
-see the @samp{E} mode switch below). If there are no non-empty fields,
-@samp{[0]} is returned to avoid syntax errors in formulas.
-
-@subsubheading Field coordinates in formulas
-@cindex field coordinates
-@cindex coordinates, of field
-@cindex row, of field coordinates
-@cindex column, of field coordinates
-
-For Calc formulas and Lisp formulas @code{@@#} and @code{$#} can be used to
-get the row or column number of the field where the formula result goes.
-The traditional Lisp formula equivalents are @code{org-table-current-dline}
-and @code{org-table-current-column}. Examples:
-
-@example
-if(@@# % 2, $#, string("")) @r{column number on odd lines only}
-$3 = remote(FOO, @@@@#$2) @r{copy column 2 from table FOO into}
- @r{column 3 of the current table}
-@end example
-
-@noindent For the second example, table FOO must have at least as many rows
-as the current table. Inefficient@footnote{The computation time scales as
-O(N^2) because table FOO is parsed for each field to be copied.} for large
-number of rows.
-
-@subsubheading Named references
-@cindex named references
-@cindex references, named
-@cindex name, of column or field
-@cindex constants, in calculations
-@cindex #+CONSTANTS
-
-@vindex org-table-formula-constants
-@samp{$name} is interpreted as the name of a column, parameter or
-constant. Constants are defined globally through the variable
-@code{org-table-formula-constants}, and locally (for the file) through a
-line like
-
-@example
-#+CONSTANTS: c=299792458. pi=3.14 eps=2.4e-6
-@end example
-
-@noindent
-@vindex constants-unit-system
-@pindex constants.el
-Also properties (@pxref{Properties and Columns}) can be used as
-constants in table formulas: for a property @samp{:Xyz:} use the name
-@samp{$PROP_Xyz}, and the property will be searched in the current
-outline entry and in the hierarchy above it. If you have the
-@file{constants.el} package, it will also be used to resolve constants,
-including natural constants like @samp{$h} for Planck's constant, and
-units like @samp{$km} for kilometers@footnote{@file{constants.el} can
-supply the values of constants in two different unit systems, @code{SI}
-and @code{cgs}. Which one is used depends on the value of the variable
-@code{constants-unit-system}. You can use the @code{#+STARTUP} options
-@code{constSI} and @code{constcgs} to set this value for the current
-buffer.}. Column names and parameters can be specified in special table
-lines. These are described below, see @ref{Advanced features}. All
-names must start with a letter, and further consist of letters and
-numbers.
-
-@subsubheading Remote references
-@cindex remote references
-@cindex references, remote
-@cindex references, to a different table
-@cindex name, of column or field
-@cindex constants, in calculations
-@cindex #+TBLNAME
-
-You may also reference constants, fields and ranges from a different table,
-either in the current file or even in a different file. The syntax is
-
-@example
-remote(NAME-OR-ID,REF)
-@end example
-
-@noindent
-where NAME can be the name of a table in the current file as set by a
-@code{#+TBLNAME: NAME} line before the table. It can also be the ID of an
-entry, even in a different file, and the reference then refers to the first
-table in that entry. REF is an absolute field or range reference as
-described above for example @code{@@3$3} or @code{$somename}, valid in the
-referenced table.
-
-@node Formula syntax for Calc, Formula syntax for Lisp, References, The spreadsheet
-@subsection Formula syntax for Calc
-@cindex formula syntax, Calc
-@cindex syntax, of formulas
-
-A formula can be any algebraic expression understood by the Emacs
-@file{Calc} package. @b{Note that @file{calc} has the
-non-standard convention that @samp{/} has lower precedence than
-@samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}.} Before
-evaluation by @code{calc-eval} (@pxref{Calling Calc from
-Your Programs,calc-eval,Calling Calc from Your Lisp Programs,Calc,GNU
-Emacs Calc Manual}),
-@c FIXME: The link to the Calc manual in HTML does not work.
-variable substitution takes place according to the rules described above.
-@cindex vectors, in table calculations
-The range vectors can be directly fed into the Calc vector functions
-like @samp{vmean} and @samp{vsum}.
-
-@cindex format specifier
-@cindex mode, for @file{calc}
-@vindex org-calc-default-modes
-A formula can contain an optional mode string after a semicolon. This
-string consists of flags to influence Calc and other modes during
-execution. By default, Org uses the standard Calc modes (precision
-12, angular units degrees, fraction and symbolic modes off). The display
-format, however, has been changed to @code{(float 8)} to keep tables
-compact. The default settings can be configured using the variable
-@code{org-calc-default-modes}.
-
-@example
-p20 @r{set the internal Calc calculation precision to 20 digits}
-n3 s3 e2 f4 @r{Normal, scientific, engineering, or fixed}
- @r{format of the result of Calc passed back to Org.}
- @r{Calc formatting is unlimited in precision as}
- @r{long as the Calc calculation precision is greater.}
-D R @r{angle modes: degrees, radians}
-F S @r{fraction and symbolic modes}
-N @r{interpret all fields as numbers, use 0 for non-numbers}
-T @r{force text interpretation}
-E @r{keep empty fields in ranges}
-L @r{literal}
-@end example
-
-@noindent
-Unless you use large integer numbers or high-precision-calculation
-and -display for floating point numbers you may alternatively provide a
-@code{printf} format specifier to reformat the Calc result after it has been
-passed back to Org instead of letting Calc already do the
-formatting@footnote{The @code{printf} reformatting is limited in precision
-because the value passed to it is converted into an @code{integer} or
-@code{double}. The @code{integer} is limited in size by truncating the
-signed value to 32 bits. The @code{double} is limited in precision to 64
-bits overall which leaves approximately 16 significant decimal digits.}.
-A few examples:
-
-@example
-$1+$2 @r{Sum of first and second field}
-$1+$2;%.2f @r{Same, format result to two decimals}
-exp($2)+exp($1) @r{Math functions can be used}
-$0;%.1f @r{Reformat current cell to 1 decimal}
-($3-32)*5/9 @r{Degrees F -> C conversion}
-$c/$1/$cm @r{Hz -> cm conversion, using @file{constants.el}}
-tan($1);Dp3s1 @r{Compute in degrees, precision 3, display SCI 1}
-sin($1);Dp3%.1e @r{Same, but use printf specifier for display}
-vmean($2..$7) @r{Compute column range mean, using vector function}
-vmean($2..$7);EN @r{Same, but treat empty fields as 0}
-taylor($3,x=7,2) @r{Taylor series of $3, at x=7, second degree}
-@end example
-
-Calc also contains a complete set of logical operations. For example
-
-@example
-if($1<20,teen,string("")) @r{``teen'' if age $1 less than 20, else empty}
-@end example
-
-@node Formula syntax for Lisp, Field formulas, Formula syntax for Calc, The spreadsheet
-@subsection Emacs Lisp forms as formulas
-@cindex Lisp forms, as table formulas
-
-It is also possible to write a formula in Emacs Lisp; this can be useful for
-string manipulation and control structures, if Calc's functionality is not
-enough. If a formula starts with a single-quote followed by an opening
-parenthesis, then it is evaluated as a Lisp form. The evaluation should
-return either a string or a number. Just as with @file{calc} formulas, you
-can specify modes and a printf format after a semicolon. With Emacs Lisp
-forms, you need to be conscious about the way field references are
-interpolated into the form. By default, a reference will be interpolated as
-a Lisp string (in double-quotes) containing the field. If you provide the
-@samp{N} mode switch, all referenced elements will be numbers (non-number
-fields will be zero) and interpolated as Lisp numbers, without quotes. If
-you provide the @samp{L} flag, all fields will be interpolated literally,
-without quotes. I.e., if you want a reference to be interpreted as a string
-by the Lisp form, enclose the reference operator itself in double-quotes,
-like @code{"$3"}. Ranges are inserted as space-separated fields, so you can
-+embed them in list or vector syntax. Here are a few examples---note how the
-@samp{N} mode is used when we do computations in Lisp:
-
-@example
-@r{Swap the first two characters of the content of column 1}
- '(concat (substring $1 1 2) (substring $1 0 1) (substring $1 2))
-@r{Add columns 1 and 2, equivalent to Calc's @code{$1+$2}}
- '(+ $1 $2);N
-@r{Compute the sum of columns 1-4, like Calc's @code{vsum($1..$4)}}
- '(apply '+ '($1..$4));N
-@end example
-
-@node Field formulas, Column formulas, Formula syntax for Lisp, The spreadsheet
-@subsection Field formulas
-@cindex field formula
-@cindex formula, for individual table field
-
-To assign a formula to a particular field, type it directly into the
-field, preceded by @samp{:=}, for example @samp{:=$1+$2}. When you
-press @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in
-the field, the formula will be stored as the formula for this field,
-evaluated, and the current field replaced with the result.
-
-@cindex #+TBLFM
-Formulas are stored in a special line starting with @samp{#+TBLFM:}
-directly below the table. If you type the equation in the 4th field of
-the 3rd data line in the table, the formula will look like
-@samp{@@3$4=$1+$2}. When inserting/deleting/swapping column and rows
-with the appropriate commands, @i{absolute references} (but not relative
-ones) in stored formulas are modified in order to still reference the
-same field. Of course this is not true if you edit the table structure
-with normal editing commands---then you must fix the equations yourself.
-The left-hand side of a formula may also be a named field (@pxref{Advanced
-features}), or a last-row reference like @samp{$LR3}.
-
-Instead of typing an equation into the field, you may also use the
-following command
-
-@table @kbd
-@orgcmd{C-u C-c =,org-table-eval-formula}
-Install a new formula for the current field. The command prompts for a
-formula with default taken from the @samp{#+TBLFM:} line, applies
-it to the current field, and stores it.
-@end table
-
-@node Column formulas, Editing and debugging formulas, Field formulas, The spreadsheet
-@subsection Column formulas
-@cindex column formula
-@cindex formula, for table column
-
-Often in a table, the same formula should be used for all fields in a
-particular column. Instead of having to copy the formula to all fields
-in that column, Org allows you to assign a single formula to an entire
-column. If the table contains horizontal separator hlines, everything
-before the first such line is considered part of the table @emph{header}
-and will not be modified by column formulas.
-
-To assign a formula to a column, type it directly into any field in the
-column, preceded by an equal sign, like @samp{=$1+$2}. When you press
-@key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in the field,
-the formula will be stored as the formula for the current column, evaluated
-and the current field replaced with the result. If the field contains only
-@samp{=}, the previously stored formula for this column is used. For each
-column, Org will only remember the most recently used formula. In the
-@samp{#+TBLFM:} line, column formulas will look like @samp{$4=$1+$2}. The left-hand
-side of a column formula cannot currently be the name of column, it
-must be the numeric column reference.
-
-Instead of typing an equation into the field, you may also use the
-following command:
-
-@table @kbd
-@orgcmd{C-c =,org-table-eval-formula}
-Install a new formula for the current column and replace current field with
-the result of the formula. The command prompts for a formula, with default
-taken from the @samp{#+TBLFM} line, applies it to the current field and
-stores it. With a numeric prefix argument(e.g. @kbd{C-5 C-c =}) the command
-will apply it to that many consecutive fields in the current column.
-@end table
-
-@node Editing and debugging formulas, Updating the table, Column formulas, The spreadsheet
-@subsection Editing and debugging formulas
-@cindex formula editing
-@cindex editing, of table formulas
-
-@vindex org-table-use-standard-references
-You can edit individual formulas in the minibuffer or directly in the
-field. Org can also prepare a special buffer with all active
-formulas of a table. When offering a formula for editing, Org
-converts references to the standard format (like @code{B3} or @code{D&})
-if possible. If you prefer to only work with the internal format (like
-@code{@@3$2} or @code{$4}), configure the variable
-@code{org-table-use-standard-references}.
-
-@table @kbd
-@orgcmdkkc{C-c =,C-u C-c =,org-table-eval-formula}
-Edit the formula associated with the current column/field in the
-minibuffer. See @ref{Column formulas}, and @ref{Field formulas}.
-@orgcmd{C-u C-u C-c =,org-table-eval-formula}
-Re-insert the active formula (either a
-field formula, or a column formula) into the current field, so that you
-can edit it directly in the field. The advantage over editing in the
-minibuffer is that you can use the command @kbd{C-c ?}.
-@orgcmd{C-c ?,org-table-field-info}
-While editing a formula in a table field, highlight the field(s)
-referenced by the reference at the cursor position in the formula.
-@kindex C-c @}
-@findex org-table-toggle-coordinate-overlays
-@item C-c @}
-Toggle the display of row and column numbers for a table, using overlays
-(@command{org-table-toggle-coordinate-overlays}). These are updated each
-time the table is aligned; you can force it with @kbd{C-c C-c}.
-@kindex C-c @{
-@findex org-table-toggle-formula-debugger
-@item C-c @{
-Toggle the formula debugger on and off
-(@command{org-table-toggle-formula-debugger}). See below.
-@orgcmd{C-c ',org-table-edit-formulas}
-Edit all formulas for the current table in a special buffer, where the
-formulas will be displayed one per line. If the current field has an
-active formula, the cursor in the formula editor will mark it.
-While inside the special buffer, Org will automatically highlight
-any field or range reference at the cursor position. You may edit,
-remove and add formulas, and use the following commands:
-@table @kbd
-@orgcmdkkc{C-c C-c,C-x C-s,org-table-fedit-finish}
-Exit the formula editor and store the modified formulas. With @kbd{C-u}
-prefix, also apply the new formulas to the entire table.
-@orgcmd{C-c C-q,org-table-fedit-abort}
-Exit the formula editor without installing changes.
-@orgcmd{C-c C-r,org-table-fedit-toggle-ref-type}
-Toggle all references in the formula editor between standard (like
-@code{B3}) and internal (like @code{@@3$2}).
-@orgcmd{@key{TAB},org-table-fedit-lisp-indent}
-Pretty-print or indent Lisp formula at point. When in a line containing
-a Lisp formula, format the formula according to Emacs Lisp rules.
-Another @key{TAB} collapses the formula back again. In the open
-formula, @key{TAB} re-indents just like in Emacs Lisp mode.
-@orgcmd{M-@key{TAB},lisp-complete-symbol}
-Complete Lisp symbols, just like in Emacs Lisp mode.
-@kindex S-@key{up}
-@kindex S-@key{down}
-@kindex S-@key{left}
-@kindex S-@key{right}
-@findex org-table-fedit-ref-up
-@findex org-table-fedit-ref-down
-@findex org-table-fedit-ref-left
-@findex org-table-fedit-ref-right
-@item S-@key{up}/@key{down}/@key{left}/@key{right}
-Shift the reference at point. For example, if the reference is
-@code{B3} and you press @kbd{S-@key{right}}, it will become @code{C3}.
-This also works for relative references and for hline references.
-@orgcmdkkcc{M-S-@key{up},M-S-@key{down},org-table-fedit-line-up,org-table-fedit-line-down}
-Move the test line for column formulas in the Org buffer up and
-down.
-@orgcmdkkcc{M-@key{up},M-@key{down},org-table-fedit-scroll-down,org-table-fedit-scroll-up}
-Scroll the window displaying the table.
-@kindex C-c @}
-@findex org-table-toggle-coordinate-overlays
-@item C-c @}
-Turn the coordinate grid in the table on and off.
-@end table
-@end table
-
-Making a table field blank does not remove the formula associated with
-the field, because that is stored in a different line (the @samp{#+TBLFM}
-line)---during the next recalculation the field will be filled again.
-To remove a formula from a field, you have to give an empty reply when
-prompted for the formula, or to edit the @samp{#+TBLFM} line.
-
-@kindex C-c C-c
-You may edit the @samp{#+TBLFM} directly and re-apply the changed
-equations with @kbd{C-c C-c} in that line or with the normal
-recalculation commands in the table.
-
-@subsubheading Debugging formulas
-@cindex formula debugging
-@cindex debugging, of table formulas
-When the evaluation of a formula leads to an error, the field content
-becomes the string @samp{#ERROR}. If you would like see what is going
-on during variable substitution and calculation in order to find a bug,
-turn on formula debugging in the @code{Tbl} menu and repeat the
-calculation, for example by pressing @kbd{C-u C-u C-c = @key{RET}} in a
-field. Detailed information will be displayed.
-
-@node Updating the table, Advanced features, Editing and debugging formulas, The spreadsheet
-@subsection Updating the table
-@cindex recomputing table fields
-@cindex updating, table
-
-Recalculation of a table is normally not automatic, but needs to be
-triggered by a command. See @ref{Advanced features}, for a way to make
-recalculation at least semi-automatic.
-
-In order to recalculate a line of a table or the entire table, use the
-following commands:
-
-@table @kbd
-@orgcmd{C-c *,org-table-recalculate}
-Recalculate the current row by first applying the stored column formulas
-from left to right, and all field formulas in the current row.
-@c
-@kindex C-u C-c *
-@item C-u C-c *
-@kindex C-u C-c C-c
-@itemx C-u C-c C-c
-Recompute the entire table, line by line. Any lines before the first
-hline are left alone, assuming that these are part of the table header.
-@c
-@orgcmdkkc{C-u C-u C-c *,C-u C-u C-c C-c,org-table-iterate}
-Iterate the table by recomputing it until no further changes occur.
-This may be necessary if some computed fields use the value of other
-fields that are computed @i{later} in the calculation sequence.
-@item M-x org-table-recalculate-buffer-tables
-@findex org-table-recalculate-buffer-tables
-Recompute all tables in the current buffer.
-@item M-x org-table-iterate-buffer-tables
-@findex org-table-iterate-buffer-tables
-Iterate all tables in the current buffer, in order to converge table-to-table
-dependencies.
-@end table
-
-@node Advanced features, , Updating the table, The spreadsheet
-@subsection Advanced features
-
-If you want the recalculation of fields to happen automatically, or if
-you want to be able to assign @i{names} to fields and columns, you need
-to reserve the first column of the table for special marking characters.
-@table @kbd
-@orgcmd{C-#,org-table-rotate-recalc-marks}
-Rotate the calculation mark in first column through the states @samp{ },
-@samp{#}, @samp{*}, @samp{!}, @samp{$}. When there is an active region,
-change all marks in the region.
-@end table
-
-Here is an example of a table that collects exam results of students and
-makes use of these features:
-
-@example
-@group
-|---+---------+--------+--------+--------+-------+------|
-| | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note |
-|---+---------+--------+--------+--------+-------+------|
-| ! | | P1 | P2 | P3 | Tot | |
-| # | Maximum | 10 | 15 | 25 | 50 | 10.0 |
-| ^ | | m1 | m2 | m3 | mt | |
-|---+---------+--------+--------+--------+-------+------|
-| # | Peter | 10 | 8 | 23 | 41 | 8.2 |
-| # | Sam | 2 | 4 | 3 | 9 | 1.8 |
-|---+---------+--------+--------+--------+-------+------|
-| | Average | | | | 29.7 | |
-| ^ | | | | | at | |
-| $ | max=50 | | | | | |
-|---+---------+--------+--------+--------+-------+------|
-#+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(@@-II..@@-I);%.1f
-@end group
-@end example
-
-@noindent @b{Important}: please note that for these special tables,
-recalculating the table with @kbd{C-u C-c *} will only affect rows that
-are marked @samp{#} or @samp{*}, and fields that have a formula assigned
-to the field itself. The column formulas are not applied in rows with
-empty first field.
-
-@cindex marking characters, tables
-The marking characters have the following meaning:
-@table @samp
-@item !
-The fields in this line define names for the columns, so that you may
-refer to a column as @samp{$Tot} instead of @samp{$6}.
-@item ^
-This row defines names for the fields @emph{above} the row. With such
-a definition, any formula in the table may use @samp{$m1} to refer to
-the value @samp{10}. Also, if you assign a formula to a names field, it
-will be stored as @samp{$name=...}.
-@item _
-Similar to @samp{^}, but defines names for the fields in the row
-@emph{below}.
-@item $
-Fields in this row can define @emph{parameters} for formulas. For
-example, if a field in a @samp{$} row contains @samp{max=50}, then
-formulas in this table can refer to the value 50 using @samp{$max}.
-Parameters work exactly like constants, only that they can be defined on
-a per-table basis.
-@item #
-Fields in this row are automatically recalculated when pressing
-@key{TAB} or @key{RET} or @kbd{S-@key{TAB}} in this row. Also, this row
-is selected for a global recalculation with @kbd{C-u C-c *}. Unmarked
-lines will be left alone by this command.
-@item *
-Selects this line for global recalculation with @kbd{C-u C-c *}, but
-not for automatic recalculation. Use this when automatic
-recalculation slows down editing too much.
-@item
-Unmarked lines are exempt from recalculation with @kbd{C-u C-c *}.
-All lines that should be recalculated should be marked with @samp{#}
-or @samp{*}.
-@item /
-Do not export this line. Useful for lines that contain the narrowing
-@samp{<N>} markers or column group markers.
-@end table
-
-Finally, just to whet your appetite for what can be done with the
-fantastic @file{calc.el} package, here is a table that computes the Taylor
-series of degree @code{n} at location @code{x} for a couple of
-functions.
-
-@example
-@group
-|---+-------------+---+-----+--------------------------------------|
-| | Func | n | x | Result |
-|---+-------------+---+-----+--------------------------------------|
-| # | exp(x) | 1 | x | 1 + x |
-| # | exp(x) | 2 | x | 1 + x + x^2 / 2 |
-| # | exp(x) | 3 | x | 1 + x + x^2 / 2 + x^3 / 6 |
-| # | x^2+sqrt(x) | 2 | x=0 | x*(0.5 / 0) + x^2 (2 - 0.25 / 0) / 2 |
-| # | x^2+sqrt(x) | 2 | x=1 | 2 + 2.5 x - 2.5 + 0.875 (x - 1)^2 |
-| * | tan(x) | 3 | x | 0.0175 x + 1.77e-6 x^3 |
-|---+-------------+---+-----+--------------------------------------|
-#+TBLFM: $5=taylor($2,$4,$3);n3
-@end group
-@end example
-
-@node Org-Plot, , The spreadsheet, Tables
-@section Org-Plot
-@cindex graph, in tables
-@cindex plot tables using Gnuplot
-@cindex #+PLOT
-
-Org-Plot can produce 2D and 3D graphs of information stored in org tables
-using @file{Gnuplot} @uref{http://www.gnuplot.info/} and @file{gnuplot-mode}
-@uref{http://cars9.uchicago.edu/~ravel/software/gnuplot-mode.html}. To see
-this in action, ensure that you have both Gnuplot and Gnuplot mode installed
-on your system, then call @code{org-plot/gnuplot} on the following table.
-
-@example
-@group
-#+PLOT: title:"Citas" ind:1 deps:(3) type:2d with:histograms set:"yrange [0:]"
-| Sede | Max cites | H-index |
-|-----------+-----------+---------|
-| Chile | 257.72 | 21.39 |
-| Leeds | 165.77 | 19.68 |
-| Sao Paolo | 71.00 | 11.50 |
-| Stockholm | 134.19 | 14.33 |
-| Morelia | 257.56 | 17.67 |
-@end group
-@end example
-
-Notice that Org Plot is smart enough to apply the table's headers as labels.
-Further control over the labels, type, content, and appearance of plots can
-be exercised through the @code{#+PLOT:} lines preceding a table. See below
-for a complete list of Org-plot options. For more information and examples
-see the Org-plot tutorial at
-@uref{http://orgmode.org/worg/org-tutorials/org-plot.php}.
-
-@subsubheading Plot Options
-
-@table @code
-@item set
-Specify any @command{gnuplot} option to be set when graphing.
-
-@item title
-Specify the title of the plot.
-
-@item ind
-Specify which column of the table to use as the @code{x} axis.
-
-@item deps
-Specify the columns to graph as a Lisp style list, surrounded by parentheses
-and separated by spaces for example @code{dep:(3 4)} to graph the third and
-fourth columns (defaults to graphing all other columns aside from the @code{ind}
-column).
-
-@item type
-Specify whether the plot will be @code{2d}, @code{3d}, or @code{grid}.
-
-@item with
-Specify a @code{with} option to be inserted for every col being plotted
-(e.g. @code{lines}, @code{points}, @code{boxes}, @code{impulses}, etc...).
-Defaults to @code{lines}.
-
-@item file
-If you want to plot to a file, specify @code{"@var{path/to/desired/output-file}"}.
-
-@item labels
-List of labels to be used for the @code{deps} (defaults to the column headers
-if they exist).
-
-@item line
-Specify an entire line to be inserted in the Gnuplot script.
-
-@item map
-When plotting @code{3d} or @code{grid} types, set this to @code{t} to graph a
-flat mapping rather than a @code{3d} slope.
-
-@item timefmt
-Specify format of Org-mode timestamps as they will be parsed by Gnuplot.
-Defaults to @samp{%Y-%m-%d-%H:%M:%S}.
-
-@item script
-If you want total control, you can specify a script file (place the file name
-between double-quotes) which will be used to plot. Before plotting, every
-instance of @code{$datafile} in the specified script will be replaced with
-the path to the generated data file. Note: even if you set this option, you
-may still want to specify the plot type, as that can impact the content of
-the data file.
-@end table
-
-@node Hyperlinks, TODO Items, Tables, Top
-@chapter Hyperlinks
-@cindex hyperlinks
-
-Like HTML, Org provides links inside a file, external links to
-other files, Usenet articles, emails, and much more.
-
-@menu
-* Link format:: How links in Org are formatted
-* Internal links:: Links to other places in the current file
-* External links:: URL-like links to the world
-* Handling links:: Creating, inserting and following
-* Using links outside Org:: Linking from my C source code?
-* Link abbreviations:: Shortcuts for writing complex links
-* Search options:: Linking to a specific location
-* Custom searches:: When the default search is not enough
-@end menu
-
-@node Link format, Internal links, Hyperlinks, Hyperlinks
-@section Link format
-@cindex link format
-@cindex format, of links
-
-Org will recognize plain URL-like links and activate them as
-clickable links. The general link format, however, looks like this:
-
-@example
-[[link][description]] @r{or alternatively} [[link]]
-@end example
-
-@noindent
-Once a link in the buffer is complete (all brackets present), Org
-will change the display so that @samp{description} is displayed instead
-of @samp{[[link][description]]} and @samp{link} is displayed instead of
-@samp{[[link]]}. Links will be highlighted in the face @code{org-link},
-which by default is an underlined face. You can directly edit the
-visible part of a link. Note that this can be either the @samp{link}
-part (if there is no description) or the @samp{description} part. To
-edit also the invisible @samp{link} part, use @kbd{C-c C-l} with the
-cursor on the link.
-
-If you place the cursor at the beginning or just behind the end of the
-displayed text and press @key{BACKSPACE}, you will remove the
-(invisible) bracket at that location. This makes the link incomplete
-and the internals are again displayed as plain text. Inserting the
-missing bracket hides the link internals again. To show the
-internal structure of all links, use the menu entry
-@code{Org->Hyperlinks->Literal links}.
-
-@node Internal links, External links, Link format, Hyperlinks
-@section Internal links
-@cindex internal links
-@cindex links, internal
-@cindex targets, for links
-
-@cindex property, CUSTOM_ID
-If the link does not look like a URL, it is considered to be internal in the
-current file. The most important case is a link like
-@samp{[[#my-custom-id]]} which will link to the entry with the
-@code{CUSTOM_ID} property @samp{my-custom-id}. Such custom IDs are very good
-for HTML export (@pxref{HTML export}) where they produce pretty section
-links. You are responsible yourself to make sure these custom IDs are unique
-in a file.
-
-Links such as @samp{[[My Target]]} or @samp{[[My Target][Find my target]]}
-lead to a text search in the current file.
-
-The link can be followed with @kbd{C-c C-o} when the cursor is on the link,
-or with a mouse click (@pxref{Handling links}). Links to custom IDs will
-point to the corresponding headline. The preferred match for a text link is
-a @i{dedicated target}: the same string in double angular brackets. Targets
-may be located anywhere; sometimes it is convenient to put them into a
-comment line. For example
-
-@example
-# <<My Target>>
-@end example
-
-@noindent In HTML export (@pxref{HTML export}), such targets will become
-named anchors for direct access through @samp{http} links@footnote{Note that
-text before the first headline is usually not exported, so the first such
-target should be after the first headline, or in the line directly before the
-first headline.}.
-
-If no dedicated target exists, Org will search for a headline that is exactly
-the link text but may also include a TODO keyword and tags@footnote{To insert
-a link targeting a headline, in-buffer completion can be used. Just type a
-star followed by a few optional letters into the buffer and press
-@kbd{M-@key{TAB}}. All headlines in the current buffer will be offered as
-completions.}. In non-Org files, the search will look for the words in the
-link text. In the above example the search would be for @samp{my target}.
-
-Following a link pushes a mark onto Org's own mark ring. You can
-return to the previous position with @kbd{C-c &}. Using this command
-several times in direct succession goes back to positions recorded
-earlier.
-
-@menu
-* Radio targets:: Make targets trigger links in plain text
-@end menu
-
-@node Radio targets, , Internal links, Internal links
-@subsection Radio targets
-@cindex radio targets
-@cindex targets, radio
-@cindex links, radio targets
-
-Org can automatically turn any occurrences of certain target names
-in normal text into a link. So without explicitly creating a link, the
-text connects to the target radioing its position. Radio targets are
-enclosed by triple angular brackets. For example, a target @samp{<<<My
-Target>>>} causes each occurrence of @samp{my target} in normal text to
-become activated as a link. The Org file is scanned automatically
-for radio targets only when the file is first loaded into Emacs. To
-update the target list during editing, press @kbd{C-c C-c} with the
-cursor on or at a target.
-
-@node External links, Handling links, Internal links, Hyperlinks
-@section External links
-@cindex links, external
-@cindex external links
-@cindex links, external
-@cindex Gnus links
-@cindex BBDB links
-@cindex IRC links
-@cindex URL links
-@cindex file links
-@cindex VM links
-@cindex RMAIL links
-@cindex WANDERLUST links
-@cindex MH-E links
-@cindex USENET links
-@cindex SHELL links
-@cindex Info links
-@cindex Elisp links
-
-Org supports links to files, websites, Usenet and email messages,
-BBDB database entries and links to both IRC conversations and their
-logs. External links are URL-like locators. They start with a short
-identifying string followed by a colon. There can be no space after
-the colon. The following list shows examples for each link type.
-
-@example
-http://www.astro.uva.nl/~dominik @r{on the web}
-doi:10.1000/182 @r{DOI for an electronic resource}
-file:/home/dominik/images/jupiter.jpg @r{file, absolute path}
-/home/dominik/images/jupiter.jpg @r{same as above}
-file:papers/last.pdf @r{file, relative path}
-./papers/last.pdf @r{same as above}
-file:/myself@@some.where:papers/last.pdf @r{file, path on remote machine}
-/myself@@some.where:papers/last.pdf @r{same as above}
-file:sometextfile::NNN @r{file with line number to jump to}
-file:projects.org @r{another Org file}
-file:projects.org::some words @r{text search in Org file}
-file:projects.org::*task title @r{heading search in Org file}
-docview:papers/last.pdf::NNN @r{open file in doc-view mode at page NNN}
-id:B7423F4D-2E8A-471B-8810-C40F074717E9 @r{Link to heading by ID}
-news:comp.emacs @r{Usenet link}
-mailto:adent@@galaxy.net @r{Mail link}
-vm:folder @r{VM folder link}
-vm:folder#id @r{VM message link}
-vm://myself@@some.where.org/folder#id @r{VM on remote machine}
-wl:folder @r{WANDERLUST folder link}
-wl:folder#id @r{WANDERLUST message link}
-mhe:folder @r{MH-E folder link}
-mhe:folder#id @r{MH-E message link}
-rmail:folder @r{RMAIL folder link}
-rmail:folder#id @r{RMAIL message link}
-gnus:group @r{Gnus group link}
-gnus:group#id @r{Gnus article link}
-bbdb:R.*Stallman @r{BBDB link (with regexp)}
-irc:/irc.com/#emacs/bob @r{IRC link}
-info:org:External%20links @r{Info node link (with encoded space)}
-shell:ls *.org @r{A shell command}
-elisp:org-agenda @r{Interactive Elisp command}
-elisp:(find-file-other-frame "Elisp.org") @r{Elisp form to evaluate}
-@end example
-
-A link should be enclosed in double brackets and may contain a
-descriptive text to be displayed instead of the URL (@pxref{Link
-format}), for example:
-
-@example
-[[http://www.gnu.org/software/emacs/][GNU Emacs]]
-@end example
-
-@noindent
-If the description is a file name or URL that points to an image, HTML
-export (@pxref{HTML export}) will inline the image as a clickable
-button. If there is no description at all and the link points to an
-image,
-that image will be inlined into the exported HTML file.
-
-@cindex square brackets, around links
-@cindex plain text external links
-Org also finds external links in the normal text and activates them
-as links. If spaces must be part of the link (for example in
-@samp{bbdb:Richard Stallman}), or if you need to remove ambiguities
-about the end of the link, enclose them in square brackets.
-
-@node Handling links, Using links outside Org, External links, Hyperlinks
-@section Handling links
-@cindex links, handling
-
-Org provides methods to create a link in the correct syntax, to
-insert it into an Org file, and to follow the link.
-
-@table @kbd
-@orgcmd{C-c l,org-store-link}
-@cindex storing links
-Store a link to the current location. This is a @emph{global} command (you
-must create the key binding yourself) which can be used in any buffer to
-create a link. The link will be stored for later insertion into an Org
-buffer (see below). What kind of link will be created depends on the current
-buffer:
-
-@b{Org-mode buffers}@*
-For Org files, if there is a @samp{<<target>>} at the cursor, the link points
-to the target. Otherwise it points to the current headline, which will also
-be the description.
-
-@vindex org-link-to-org-use-id
-@cindex property, CUSTOM_ID
-@cindex property, ID
-If the headline has a @code{CUSTOM_ID} property, a link to this custom ID
-will be stored. In addition or alternatively (depending on the value of
-@code{org-link-to-org-use-id}), a globally unique @code{ID} property will be
-created and/or used to construct a link. So using this command in Org
-buffers will potentially create two links: a human-readable from the custom
-ID, and one that is globally unique and works even if the entry is moved from
-file to file. Later, when inserting the link, you need to decide which one
-to use.
-
-@b{Email/News clients: VM, Rmail, Wanderlust, MH-E, Gnus}@*
-Pretty much all Emacs mail clients are supported. The link will point to the
-current article, or, in some GNUS buffers, to the group. The description is
-constructed from the author and the subject.
-
-@b{Web browsers: W3 and W3M}@*
-Here the link will be the current URL, with the page title as description.
-
-@b{Contacts: BBDB}@*
-Links created in a BBDB buffer will point to the current entry.
-
-@b{Chat: IRC}@*
-@vindex org-irc-link-to-logs
-For IRC links, if you set the variable @code{org-irc-link-to-logs} to
-@code{t}, a @samp{file:/} style link to the relevant point in the logs for
-the current conversation is created. Otherwise an @samp{irc:/} style link to
-the user/channel/server under the point will be stored.
-
-@b{Other files}@*
-For any other files, the link will point to the file, with a search string
-(@pxref{Search options}) pointing to the contents of the current line. If
-there is an active region, the selected words will form the basis of the
-search string. If the automatically created link is not working correctly or
-accurately enough, you can write custom functions to select the search string
-and to do the search for particular file types---see @ref{Custom searches}.
-The key binding @kbd{C-c l} is only a suggestion---see @ref{Installation}.
-
-@b{Agenda view}@*
-When the cursor is in an agenda view, the created link points to the
-entry referenced by the current line.
-
-@c
-@orgcmd{C-c C-l,org-insert-link}
-@cindex link completion
-@cindex completion, of links
-@cindex inserting links
-@vindex org-keep-stored-link-after-insertion
-Insert a link@footnote{ Note that you don't have to use this command to
-insert a link. Links in Org are plain text, and you can type or paste them
-straight into the buffer. By using this command, the links are automatically
-enclosed in double brackets, and you will be asked for the optional
-descriptive text.}. This prompts for a link to be inserted into the buffer.
-You can just type a link, using text for an internal link, or one of the link
-type prefixes mentioned in the examples above. The link will be inserted
-into the buffer@footnote{After insertion of a stored link, the link will be
-removed from the list of stored links. To keep it in the list later use, use
-a triple @kbd{C-u} prefix argument to @kbd{C-c C-l}, or configure the option
-@code{org-keep-stored-link-after-insertion}.}, along with a descriptive text.
-If some text was selected when this command is called, the selected text
-becomes the default description.
-
-@b{Inserting stored links}@*
-All links stored during the
-current session are part of the history for this prompt, so you can access
-them with @key{up} and @key{down} (or @kbd{M-p/n}).
-
-@b{Completion support}@* Completion with @key{TAB} will help you to insert
-valid link prefixes like @samp{http:} or @samp{ftp:}, including the prefixes
-defined through link abbreviations (@pxref{Link abbreviations}). If you
-press @key{RET} after inserting only the @var{prefix}, Org will offer
-specific completion support for some link types@footnote{This works by
-calling a special function @code{org-PREFIX-complete-link}.} For
-example, if you type @kbd{file @key{RET}}, file name completion (alternative
-access: @kbd{C-u C-c C-l}, see below) will be offered, and after @kbd{bbdb
-@key{RET}} you can complete contact names.
-@orgkey C-u C-c C-l
-@cindex file name completion
-@cindex completion, of file names
-When @kbd{C-c C-l} is called with a @kbd{C-u} prefix argument, a link to
-a file will be inserted and you may use file name completion to select
-the name of the file. The path to the file is inserted relative to the
-directory of the current Org file, if the linked file is in the current
-directory or in a sub-directory of it, or if the path is written relative
-to the current directory using @samp{../}. Otherwise an absolute path
-is used, if possible with @samp{~/} for your home directory. You can
-force an absolute path with two @kbd{C-u} prefixes.
-@c
-@item C-c C-l @ @r{(with cursor on existing link)}
-When the cursor is on an existing link, @kbd{C-c C-l} allows you to edit the
-link and description parts of the link.
-@c
-@cindex following links
-@orgcmd{C-c C-o,org-open-at-point}
-@vindex org-file-apps
-Open link at point. This will launch a web browser for URLs (using
-@command{browse-url-at-point}), run VM/MH-E/Wanderlust/Rmail/Gnus/BBDB for
-the corresponding links, and execute the command in a shell link. When the
-cursor is on an internal link, this command runs the corresponding search.
-When the cursor is on a TAG list in a headline, it creates the corresponding
-TAGS view. If the cursor is on a timestamp, it compiles the agenda for that
-date. Furthermore, it will visit text and remote files in @samp{file:} links
-with Emacs and select a suitable application for local non-text files.
-Classification of files is based on file extension only. See option
-@code{org-file-apps}. If you want to override the default application and
-visit the file with Emacs, use a @kbd{C-u} prefix. If you want to avoid
-opening in Emacs, use a @kbd{C-u C-u} prefix.@*
-If the cursor is on a headline, but not on a link, offer all links in the
-headline and entry text.
-@orgkey @key{RET}
-@vindex org-return-follows-link
-When @code{org-return-follows-link} is set, @kbd{@key{RET}} will also follow
-the link at point.
-@c
-@kindex mouse-2
-@kindex mouse-1
-@item mouse-2
-@itemx mouse-1
-On links, @kbd{mouse-2} will open the link just as @kbd{C-c C-o}
-would. Under Emacs 22 and later, @kbd{mouse-1} will also follow a link.
-@c
-@kindex mouse-3
-@item mouse-3
-@vindex org-display-internal-link-with-indirect-buffer
-Like @kbd{mouse-2}, but force file links to be opened with Emacs, and
-internal links to be displayed in another window@footnote{See the
-variable @code{org-display-internal-link-with-indirect-buffer}}.
-@c
-@orgcmd{C-c C-x C-v,org-toggle-inline-images}
-@cindex inlining images
-@cindex images, inlining
-@vindex org-startup-with-inline-images
-@cindex @code{inlineimages}, STARTUP keyword
-@cindex @code{noinlineimages}, STARTUP keyword
-Toggle the inline display of linked images. Normally this will only inline
-images that have no description part in the link, i.e. images that will also
-be inlined during export. When called with a prefix argument, also display
-images that do have a link description. You can ask for inline images to be
-displayed at startup by configuring the variable
-@code{org-startup-with-inline-images}@footnote{with corresponding
-@code{#+STARTUP} keywords @code{inlineimages} and @code{inlineimages}}.
-@orgcmd{C-c %,org-mark-ring-push}
-@cindex mark ring
-Push the current position onto the mark ring, to be able to return
-easily. Commands following an internal link do this automatically.
-@c
-@orgcmd{C-c &,org-mark-ring-goto}
-@cindex links, returning to
-Jump back to a recorded position. A position is recorded by the
-commands following internal links, and by @kbd{C-c %}. Using this
-command several times in direct succession moves through a ring of
-previously recorded positions.
-@c
-@orgcmdkkcc{C-c C-x C-n,C-c C-x C-p,org-next-link,org-previous-link}
-@cindex links, finding next/previous
-Move forward/backward to the next link in the buffer. At the limit of
-the buffer, the search fails once, and then wraps around. The key
-bindings for this are really too long; you might want to bind this also
-to @kbd{C-n} and @kbd{C-p}
-@lisp
-(add-hook 'org-load-hook
- (lambda ()
- (define-key 'org-mode-map "\C-n" 'org-next-link)
- (define-key 'org-mode-map "\C-p" 'org-previous-link)))
-@end lisp
-@end table
-
-@node Using links outside Org, Link abbreviations, Handling links, Hyperlinks
-@section Using links outside Org
-
-You can insert and follow links that have Org syntax not only in
-Org, but in any Emacs buffer. For this, you should create two
-global commands, like this (please select suitable global keys
-yourself):
-
-@lisp
-(global-set-key "\C-c L" 'org-insert-link-global)
-(global-set-key "\C-c o" 'org-open-at-point-global)
-@end lisp
-
-@node Link abbreviations, Search options, Using links outside Org, Hyperlinks
-@section Link abbreviations
-@cindex link abbreviations
-@cindex abbreviation, links
-
-Long URLs can be cumbersome to type, and often many similar links are
-needed in a document. For this you can use link abbreviations. An
-abbreviated link looks like this
-
-@example
-[[linkword:tag][description]]
-@end example
-
-@noindent
-@vindex org-link-abbrev-alist
-where the tag is optional.
-The @i{linkword} must be a word, starting with a letter, followed by
-letters, numbers, @samp{-}, and @samp{_}. Abbreviations are resolved
-according to the information in the variable @code{org-link-abbrev-alist}
-that relates the linkwords to replacement text. Here is an example:
-
-@smalllisp
-@group
-(setq org-link-abbrev-alist
- '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=")
- ("google" . "http://www.google.com/search?q=")
- ("gmap" . "http://maps.google.com/maps?q=%s")
- ("omap" . "http://nominatim.openstreetmap.org/search?q=%s&polygon=1")
- ("ads" . "http://adsabs.harvard.edu/cgi-bin/nph-abs_connect?author=%s&db_key=AST")))
-@end group
-@end smalllisp
-
-If the replacement text contains the string @samp{%s}, it will be
-replaced with the tag. Otherwise the tag will be appended to the string
-in order to create the link. You may also specify a function that will
-be called with the tag as the only argument to create the link.
-
-With the above setting, you could link to a specific bug with
-@code{[[bugzilla:129]]}, search the web for @samp{OrgMode} with
-@code{[[google:OrgMode]]}, show the map location of the Free Software
-Foundation @code{[[gmap:51 Franklin Street, Boston]]} or of Carsten office
-@code{[[omap:Science Park 904, Amsterdam, The Netherlands]]} and find out
-what the Org author is doing besides Emacs hacking with
-@code{[[ads:Dominik,C]]}.
-
-If you need special abbreviations just for a single Org buffer, you
-can define them in the file with
-
-@cindex #+LINK
-@example
-#+LINK: bugzilla http://10.1.2.9/bugzilla/show_bug.cgi?id=
-#+LINK: google http://www.google.com/search?q=%s
-@end example
-
-@noindent
-In-buffer completion (@pxref{Completion}) can be used after @samp{[} to
-complete link abbreviations. You may also define a function
-@code{org-PREFIX-complete-link} that implements special (e.g. completion)
-support for inserting such a link with @kbd{C-c C-l}. Such a function should
-not accept any arguments, and return the full link with prefix.
-
-@node Search options, Custom searches, Link abbreviations, Hyperlinks
-@section Search options in file links
-@cindex search option in file links
-@cindex file links, searching
-
-File links can contain additional information to make Emacs jump to a
-particular location in the file when following a link. This can be a
-line number or a search option after a double@footnote{For backward
-compatibility, line numbers can also follow a single colon.} colon. For
-example, when the command @kbd{C-c l} creates a link (@pxref{Handling
-links}) to a file, it encodes the words in the current line as a search
-string that can be used to find this line back later when following the
-link with @kbd{C-c C-o}.
-
-Here is the syntax of the different ways to attach a search to a file
-link, together with an explanation:
-
-@example
-[[file:~/code/main.c::255]]
-[[file:~/xx.org::My Target]]
-[[file:~/xx.org::*My Target]]
-[[file:~/xx.org::#my-custom-id]]
-[[file:~/xx.org::/regexp/]]
-@end example
-
-@table @code
-@item 255
-Jump to line 255.
-@item My Target
-Search for a link target @samp{<<My Target>>}, or do a text search for
-@samp{my target}, similar to the search in internal links, see
-@ref{Internal links}. In HTML export (@pxref{HTML export}), such a file
-link will become an HTML reference to the corresponding named anchor in
-the linked file.
-@item *My Target
-In an Org file, restrict search to headlines.
-@item #my-custom-id
-Link to a heading with a @code{CUSTOM_ID} property
-@item /regexp/
-Do a regular expression search for @code{regexp}. This uses the Emacs
-command @code{occur} to list all matches in a separate window. If the
-target file is in Org-mode, @code{org-occur} is used to create a
-sparse tree with the matches.
-@c If the target file is a directory,
-@c @code{grep} will be used to search all files in the directory.
-@end table
-
-As a degenerate case, a file link with an empty file name can be used
-to search the current file. For example, @code{[[file:::find me]]} does
-a search for @samp{find me} in the current file, just as
-@samp{[[find me]]} would.
-
-@node Custom searches, , Search options, Hyperlinks
-@section Custom Searches
-@cindex custom search strings
-@cindex search strings, custom
-
-The default mechanism for creating search strings and for doing the
-actual search related to a file link may not work correctly in all
-cases. For example, Bib@TeX{} database files have many entries like
-@samp{year="1993"} which would not result in good search strings,
-because the only unique identification for a Bib@TeX{} entry is the
-citation key.
-
-@vindex org-create-file-search-functions
-@vindex org-execute-file-search-functions
-If you come across such a problem, you can write custom functions to set
-the right search string for a particular file type, and to do the search
-for the string in the file. Using @code{add-hook}, these functions need
-to be added to the hook variables
-@code{org-create-file-search-functions} and
-@code{org-execute-file-search-functions}. See the docstring for these
-variables for more information. Org actually uses this mechanism
-for Bib@TeX{} database files, and you can use the corresponding code as
-an implementation example. See the file @file{org-bibtex.el}.
-
-@node TODO Items, Tags, Hyperlinks, Top
-@chapter TODO items
-@cindex TODO items
-
-Org-mode does not maintain TODO lists as separate documents@footnote{Of
-course, you can make a document that contains only long lists of TODO items,
-but this is not required.}. Instead, TODO items are an integral part of the
-notes file, because TODO items usually come up while taking notes! With Org
-mode, simply mark any entry in a tree as being a TODO item. In this way,
-information is not duplicated, and the entire context from which the TODO
-item emerged is always present.
-
-Of course, this technique for managing TODO items scatters them
-throughout your notes file. Org-mode compensates for this by providing
-methods to give you an overview of all the things that you have to do.
-
-@menu
-* TODO basics:: Marking and displaying TODO entries
-* TODO extensions:: Workflow and assignments
-* Progress logging:: Dates and notes for progress
-* Priorities:: Some things are more important than others
-* Breaking down tasks:: Splitting a task into manageable pieces
-* Checkboxes:: Tick-off lists
-@end menu
-
-@node TODO basics, TODO extensions, TODO Items, TODO Items
-@section Basic TODO functionality
-
-Any headline becomes a TODO item when it starts with the word
-@samp{TODO}, for example:
-
-@example
-*** TODO Write letter to Sam Fortune
-@end example
-
-@noindent
-The most important commands to work with TODO entries are:
-
-@table @kbd
-@orgcmd{C-c C-t,org-todo}
-@cindex cycling, of TODO states
-Rotate the TODO state of the current item among
-
-@example
-,-> (unmarked) -> TODO -> DONE --.
-'--------------------------------'
-@end example
-
-The same rotation can also be done ``remotely'' from the timeline and
-agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
-
-@orgkey{C-u C-c C-t}
-Select a specific keyword using completion or (if it has been set up)
-the fast selection interface. For the latter, you need to assign keys
-to TODO states, see @ref{Per-file keywords}, and @ref{Setting tags}, for
-more information.
-
-@kindex S-@key{right}
-@kindex S-@key{left}
-@item S-@key{right} @ @r{/} @ S-@key{left}
-@vindex org-treat-S-cursor-todo-selection-as-state-change
-Select the following/preceding TODO state, similar to cycling. Useful
-mostly if more than two TODO states are possible (@pxref{TODO
-extensions}). See also @ref{Conflicts}, for a discussion of the interaction
-with @code{shift-selection-mode}. See also the variable
-@code{org-treat-S-cursor-todo-selection-as-state-change}.
-@orgcmd{C-c / t,org-show-todo-key}
-@cindex sparse tree, for TODO
-@vindex org-todo-keywords
-View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}). Folds the
-entire buffer, but shows all TODO items (with not-DONE state) and the
-headings hierarchy above them. With a prefix argument (or by using @kbd{C-c
-/ T}), search for a specific TODO. You will be prompted for the keyword, and
-you can also give a list of keywords like @code{KWD1|KWD2|...} to list
-entries that match any one of these keywords. With numeric prefix argument
-N, show the tree for the Nth keyword in the variable
-@code{org-todo-keywords}. With two prefix arguments, find all TODO states,
-both un-done and done.
-@orgcmd{C-c a t,org-todo-list}
-Show the global TODO list. Collects the TODO items (with not-DONE states)
-from all agenda files (@pxref{Agenda Views}) into a single buffer. The new
-buffer will be in @code{agenda-mode}, which provides commands to examine and
-manipulate the TODO entries from the new buffer (@pxref{Agenda commands}).
-@xref{Global TODO list}, for more information.
-@orgcmd{S-M-@key{RET},org-insert-todo-heading}
-Insert a new TODO entry below the current one.
-@end table
-
-@noindent
-@vindex org-todo-state-tags-triggers
-Changing a TODO state can also trigger tag changes. See the docstring of the
-option @code{org-todo-state-tags-triggers} for details.
-
-@node TODO extensions, Progress logging, TODO basics, TODO Items
-@section Extended use of TODO keywords
-@cindex extended TODO keywords
-
-@vindex org-todo-keywords
-By default, marked TODO entries have one of only two states: TODO and
-DONE. Org-mode allows you to classify TODO items in more complex ways
-with @emph{TODO keywords} (stored in @code{org-todo-keywords}). With
-special setup, the TODO keyword system can work differently in different
-files.
-
-Note that @i{tags} are another way to classify headlines in general and
-TODO items in particular (@pxref{Tags}).
-
-@menu
-* Workflow states:: From TODO to DONE in steps
-* TODO types:: I do this, Fred does the rest
-* Multiple sets in one file:: Mixing it all, and still finding your way
-* Fast access to TODO states:: Single letter selection of a state
-* Per-file keywords:: Different files, different requirements
-* Faces for TODO keywords:: Highlighting states
-* TODO dependencies:: When one task needs to wait for others
-@end menu
-
-@node Workflow states, TODO types, TODO extensions, TODO extensions
-@subsection TODO keywords as workflow states
-@cindex TODO workflow
-@cindex workflow states as TODO keywords
-
-You can use TODO keywords to indicate different @emph{sequential} states
-in the process of working on an item, for example@footnote{Changing
-this variable only becomes effective after restarting Org-mode in a
-buffer.}:
-
-@lisp
-(setq org-todo-keywords
- '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
-@end lisp
-
-The vertical bar separates the TODO keywords (states that @emph{need
-action}) from the DONE states (which need @emph{no further action}). If
-you don't provide the separator bar, the last state is used as the DONE
-state.
-@cindex completion, of TODO keywords
-With this setup, the command @kbd{C-c C-t} will cycle an entry from TODO
-to FEEDBACK, then to VERIFY, and finally to DONE and DELEGATED. You may
-also use a numeric prefix argument to quickly select a specific state. For
-example @kbd{C-3 C-c C-t} will change the state immediately to VERIFY.
-Or you can use @kbd{S-@key{left}} to go backward through the sequence. If you
-define many keywords, you can use in-buffer completion
-(@pxref{Completion}) or even a special one-key selection scheme
-(@pxref{Fast access to TODO states}) to insert these words into the
-buffer. Changing a TODO state can be logged with a timestamp, see
-@ref{Tracking TODO state changes}, for more information.
-
-@node TODO types, Multiple sets in one file, Workflow states, TODO extensions
-@subsection TODO keywords as types
-@cindex TODO types
-@cindex names as TODO keywords
-@cindex types as TODO keywords
-
-The second possibility is to use TODO keywords to indicate different
-@emph{types} of action items. For example, you might want to indicate
-that items are for ``work'' or ``home''. Or, when you work with several
-people on a single project, you might want to assign action items
-directly to persons, by using their names as TODO keywords. This would
-be set up like this:
-
-@lisp
-(setq org-todo-keywords '((type "Fred" "Sara" "Lucy" "|" "DONE")))
-@end lisp
-
-In this case, different keywords do not indicate a sequence, but rather
-different types. So the normal work flow would be to assign a task to a
-person, and later to mark it DONE. Org-mode supports this style by adapting
-the workings of the command @kbd{C-c C-t}@footnote{This is also true for the
-@kbd{t} command in the timeline and agenda buffers.}. When used several
-times in succession, it will still cycle through all names, in order to first
-select the right type for a task. But when you return to the item after some
-time and execute @kbd{C-c C-t} again, it will switch from any name directly
-to DONE. Use prefix arguments or completion to quickly select a specific
-name. You can also review the items of a specific TODO type in a sparse tree
-by using a numeric prefix to @kbd{C-c / t}. For example, to see all things
-Lucy has to do, you would use @kbd{C-3 C-c / t}. To collect Lucy's items
-from all agenda files into a single buffer, you would use the numeric prefix
-argument as well when creating the global TODO list: @kbd{C-3 C-c a t}.
-
-@node Multiple sets in one file, Fast access to TODO states, TODO types, TODO extensions
-@subsection Multiple keyword sets in one file
-@cindex TODO keyword sets
-
-Sometimes you may want to use different sets of TODO keywords in
-parallel. For example, you may want to have the basic
-@code{TODO}/@code{DONE}, but also a workflow for bug fixing, and a
-separate state indicating that an item has been canceled (so it is not
-DONE, but also does not require action). Your setup would then look
-like this:
-
-@lisp
-(setq org-todo-keywords
- '((sequence "TODO" "|" "DONE")
- (sequence "REPORT" "BUG" "KNOWNCAUSE" "|" "FIXED")
- (sequence "|" "CANCELED")))
-@end lisp
-
-The keywords should all be different, this helps Org-mode to keep track
-of which subsequence should be used for a given entry. In this setup,
-@kbd{C-c C-t} only operates within a subsequence, so it switches from
-@code{DONE} to (nothing) to @code{TODO}, and from @code{FIXED} to
-(nothing) to @code{REPORT}. Therefore you need a mechanism to initially
-select the correct sequence. Besides the obvious ways like typing a
-keyword or using completion, you may also apply the following commands:
-
-@table @kbd
-@kindex C-S-@key{right}
-@kindex C-S-@key{left}
-@kindex C-u C-u C-c C-t
-@item C-u C-u C-c C-t
-@itemx C-S-@key{right}
-@itemx C-S-@key{left}
-These keys jump from one TODO subset to the next. In the above example,
-@kbd{C-u C-u C-c C-t} or @kbd{C-S-@key{right}} would jump from @code{TODO} or
-@code{DONE} to @code{REPORT}, and any of the words in the second row to
-@code{CANCELED}. Note that the @kbd{C-S-} key binding conflict with
-@code{shift-selection-mode} (@pxref{Conflicts}).
-@kindex S-@key{right}
-@kindex S-@key{left}
-@item S-@key{right}
-@itemx S-@key{left}
-@kbd{S-@key{<left>}} and @kbd{S-@key{<right>}} and walk through @emph{all}
-keywords from all sets, so for example @kbd{S-@key{<right>}} would switch
-from @code{DONE} to @code{REPORT} in the example above. See also
-@ref{Conflicts}, for a discussion of the interaction with
-@code{shift-selection-mode}.
-@end table
-
-@node Fast access to TODO states, Per-file keywords, Multiple sets in one file, TODO extensions
-@subsection Fast access to TODO states
-
-If you would like to quickly change an entry to an arbitrary TODO state
-instead of cycling through the states, you can set up keys for
-single-letter access to the states. This is done by adding the section
-key after each keyword, in parentheses. For example:
-
-@lisp
-(setq org-todo-keywords
- '((sequence "TODO(t)" "|" "DONE(d)")
- (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")
- (sequence "|" "CANCELED(c)")))
-@end lisp
-
-@vindex org-fast-tag-selection-include-todo
-If you then press @code{C-c C-t} followed by the selection key, the entry
-will be switched to this state. @key{SPC} can be used to remove any TODO
-keyword from an entry.@footnote{Check also the variable
-@code{org-fast-tag-selection-include-todo}, it allows you to change the TODO
-state through the tags interface (@pxref{Setting tags}), in case you like to
-mingle the two concepts. Note that this means you need to come up with
-unique keys across both sets of keywords.}
-
-@node Per-file keywords, Faces for TODO keywords, Fast access to TODO states, TODO extensions
-@subsection Setting up keywords for individual files
-@cindex keyword options
-@cindex per-file keywords
-@cindex #+TODO
-@cindex #+TYP_TODO
-@cindex #+SEQ_TODO
-
-It can be very useful to use different aspects of the TODO mechanism in
-different files. For file-local settings, you need to add special lines
-to the file which set the keywords and interpretation for that file
-only. For example, to set one of the two examples discussed above, you
-need one of the following lines, starting in column zero anywhere in the
-file:
-
-@example
-#+TODO: TODO FEEDBACK VERIFY | DONE CANCELED
-@end example
-@noindent (you may also write @code{#+SEQ_TODO} to be explicit about the
-interpretation, but it means the same as @code{#+TODO}), or
-@example
-#+TYP_TODO: Fred Sara Lucy Mike | DONE
-@end example
-
-A setup for using several sets in parallel would be:
-
-@example
-#+TODO: TODO | DONE
-#+TODO: REPORT BUG KNOWNCAUSE | FIXED
-#+TODO: | CANCELED
-@end example
-
-@cindex completion, of option keywords
-@kindex M-@key{TAB}
-@noindent To make sure you are using the correct keyword, type
-@samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion.
-
-@cindex DONE, final TODO keyword
-Remember that the keywords after the vertical bar (or the last keyword
-if no bar is there) must always mean that the item is DONE (although you
-may use a different word). After changing one of these lines, use
-@kbd{C-c C-c} with the cursor still in the line to make the changes
-known to Org-mode@footnote{Org-mode parses these lines only when
-Org-mode is activated after visiting a file. @kbd{C-c C-c} with the
-cursor in a line starting with @samp{#+} is simply restarting Org-mode
-for the current buffer.}.
-
-@node Faces for TODO keywords, TODO dependencies, Per-file keywords, TODO extensions
-@subsection Faces for TODO keywords
-@cindex faces, for TODO keywords
-
-@vindex org-todo @r{(face)}
-@vindex org-done @r{(face)}
-@vindex org-todo-keyword-faces
-Org-mode highlights TODO keywords with special faces: @code{org-todo}
-for keywords indicating that an item still has to be acted upon, and
-@code{org-done} for keywords indicating that an item is finished. If
-you are using more than 2 different states, you might want to use
-special faces for some of them. This can be done using the variable
-@code{org-todo-keyword-faces}. For example:
-
-@lisp
-@group
-(setq org-todo-keyword-faces
- '(("TODO" . org-warning) ("STARTED" . "yellow")
- ("CANCELED" . (:foreground "blue" :weight bold))))
-@end group
-@end lisp
-
-While using a list with face properties as shown for CANCELED @emph{should}
-work, this does not aways seem to be the case. If necessary, define a
-special face and use that. A string is interpreted as a color. The variable
-@code{org-faces-easy-properties} determines if that color is interpreted as a
-foreground or a background color.
-
-@node TODO dependencies, , Faces for TODO keywords, TODO extensions
-@subsection TODO dependencies
-@cindex TODO dependencies
-@cindex dependencies, of TODO states
-
-@vindex org-enforce-todo-dependencies
-@cindex property, ORDERED
-The structure of Org files (hierarchy and lists) makes it easy to define TODO
-dependencies. Usually, a parent TODO task should not be marked DONE until
-all subtasks (defined as children tasks) are marked as DONE. And sometimes
-there is a logical sequence to a number of (sub)tasks, so that one task
-cannot be acted upon before all siblings above it are done. If you customize
-the variable @code{org-enforce-todo-dependencies}, Org will block entries
-from changing state to DONE while they have children that are not DONE.
-Furthermore, if an entry has a property @code{ORDERED}, each of its children
-will be blocked until all earlier siblings are marked DONE. Here is an
-example:
-
-@example
-* TODO Blocked until (two) is done
-** DONE one
-** TODO two
-
-* Parent
- :PROPERTIES:
- :ORDERED: t
- :END:
-** TODO a
-** TODO b, needs to wait for (a)
-** TODO c, needs to wait for (a) and (b)
-@end example
-
-@table @kbd
-@orgcmd{C-c C-x o,org-toggle-ordered-property}
-@vindex org-track-ordered-property-with-tag
-@cindex property, ORDERED
-Toggle the @code{ORDERED} property of the current entry. A property is used
-for this behavior because this should be local to the current entry, not
-inherited like a tag. However, if you would like to @i{track} the value of
-this property with a tag for better visibility, customize the variable
-@code{org-track-ordered-property-with-tag}.
-@orgkey{C-u C-u C-u C-c C-t}
-Change TODO state, circumventing any state blocking.
-@end table
-
-@vindex org-agenda-dim-blocked-tasks
-If you set the variable @code{org-agenda-dim-blocked-tasks}, TODO entries
-that cannot be closed because of such dependencies will be shown in a dimmed
-font or even made invisible in agenda views (@pxref{Agenda Views}).
-
-@cindex checkboxes and TODO dependencies
-@vindex org-enforce-todo-dependencies
-You can also block changes of TODO states by looking at checkboxes
-(@pxref{Checkboxes}). If you set the variable
-@code{org-enforce-todo-checkbox-dependencies}, an entry that has unchecked
-checkboxes will be blocked from switching to DONE.
-
-If you need more complex dependency structures, for example dependencies
-between entries in different trees or files, check out the contributed
-module @file{org-depend.el}.
-
-@page
-@node Progress logging, Priorities, TODO extensions, TODO Items
-@section Progress logging
-@cindex progress logging
-@cindex logging, of progress
-
-Org-mode can automatically record a timestamp and possibly a note when
-you mark a TODO item as DONE, or even each time you change the state of
-a TODO item. This system is highly configurable, settings can be on a
-per-keyword basis and can be localized to a file or even a subtree. For
-information on how to clock working time for a task, see @ref{Clocking
-work time}.
-
-@menu
-* Closing items:: When was this entry marked DONE?
-* Tracking TODO state changes:: When did the status change?
-* Tracking your habits:: How consistent have you been?
-@end menu
-
-@node Closing items, Tracking TODO state changes, Progress logging, Progress logging
-@subsection Closing items
-
-The most basic logging is to keep track of @emph{when} a certain TODO
-item was finished. This is achieved with@footnote{The corresponding
-in-buffer setting is: @code{#+STARTUP: logdone}}
-
-@lisp
-(setq org-log-done 'time)
-@end lisp
-
-@noindent
-Then each time you turn an entry from a TODO (not-done) state into any
-of the DONE states, a line @samp{CLOSED: [timestamp]} will be inserted
-just after the headline. If you turn the entry back into a TODO item
-through further state cycling, that line will be removed again. If you
-want to record a note along with the timestamp, use@footnote{The
-corresponding in-buffer setting is: @code{#+STARTUP: lognotedone}}
-
-@lisp
-(setq org-log-done 'note)
-@end lisp
-
-@noindent
-You will then be prompted for a note, and that note will be stored below
-the entry with a @samp{Closing Note} heading.
-
-In the timeline (@pxref{Timeline}) and in the agenda
-(@pxref{Weekly/daily agenda}), you can then use the @kbd{l} key to
-display the TODO items with a @samp{CLOSED} timestamp on each day,
-giving you an overview of what has been done.
-
-@node Tracking TODO state changes, Tracking your habits, Closing items, Progress logging
-@subsection Tracking TODO state changes
-@cindex drawer, for state change recording
-
-@vindex org-log-states-order-reversed
-@vindex org-log-into-drawer
-@cindex property, LOG_INTO_DRAWER
-When TODO keywords are used as workflow states (@pxref{Workflow states}), you
-might want to keep track of when a state change occurred and maybe take a
-note about this change. You can either record just a timestamp, or a
-time-stamped note for a change. These records will be inserted after the
-headline as an itemized list, newest first@footnote{See the variable
-@code{org-log-states-order-reversed}}. When taking a lot of notes, you might
-want to get the notes out of the way into a drawer (@pxref{Drawers}).
-Customize the variable @code{org-log-into-drawer} to get this
-behavior---the recommended drawer for this is called @code{LOGBOOK}. You can
-also overrule the setting of this variable for a subtree by setting a
-@code{LOG_INTO_DRAWER} property.
-
-Since it is normally too much to record a note for every state, Org-mode
-expects configuration on a per-keyword basis for this. This is achieved by
-adding special markers @samp{!} (for a timestamp) and @samp{@@} (for a note)
-in parentheses after each keyword. For example, with the setting
-
-@lisp
-(setq org-todo-keywords
- '((sequence "TODO(t)" "WAIT(w@@/!)" "|" "DONE(d!)" "CANCELED(c@@)")))
-@end lisp
-
-@noindent
-@vindex org-log-done
-you not only define global TODO keywords and fast access keys, but also
-request that a time is recorded when the entry is set to
-DONE@footnote{It is possible that Org-mode will record two timestamps
-when you are using both @code{org-log-done} and state change logging.
-However, it will never prompt for two notes---if you have configured
-both, the state change recording note will take precedence and cancel
-the @samp{Closing Note}.}, and that a note is recorded when switching to
-WAIT or CANCELED. The setting for WAIT is even more special: the
-@samp{!} after the slash means that in addition to the note taken when
-entering the state, a timestamp should be recorded when @i{leaving} the
-WAIT state, if and only if the @i{target} state does not configure
-logging for entering it. So it has no effect when switching from WAIT
-to DONE, because DONE is configured to record a timestamp only. But
-when switching from WAIT back to TODO, the @samp{/!} in the WAIT
-setting now triggers a timestamp even though TODO has no logging
-configured.
-
-You can use the exact same syntax for setting logging preferences local
-to a buffer:
-@example
-#+TODO: TODO(t) WAIT(w@@/!) | DONE(d!) CANCELED(c@@)
-@end example
-
-@cindex property, LOGGING
-In order to define logging settings that are local to a subtree or a
-single item, define a LOGGING property in this entry. Any non-empty
-LOGGING property resets all logging settings to nil. You may then turn
-on logging for this specific tree using STARTUP keywords like
-@code{lognotedone} or @code{logrepeat}, as well as adding state specific
-settings like @code{TODO(!)}. For example
-
-@example
-* TODO Log each state with only a time
- :PROPERTIES:
- :LOGGING: TODO(!) WAIT(!) DONE(!) CANCELED(!)
- :END:
-* TODO Only log when switching to WAIT, and when repeating
- :PROPERTIES:
- :LOGGING: WAIT(@@) logrepeat
- :END:
-* TODO No logging at all
- :PROPERTIES:
- :LOGGING: nil
- :END:
-@end example
-
-@node Tracking your habits, , Tracking TODO state changes, Progress logging
-@subsection Tracking your habits
-@cindex habits
-
-Org has the ability to track the consistency of a special category of TODOs,
-called ``habits''. A habit has the following properties:
-
-@enumerate
-@item
-You have enabled the @code{habits} module by customizing the variable
-@code{org-modules}.
-@item
-The habit is a TODO, with a TODO keyword representing an open state.
-@item
-The property @code{STYLE} is set to the value @code{habit}.
-@item
-The TODO has a scheduled date, usually with a @code{.+} style repeat
-interval. A @code{++} style may be appropriate for habits with time
-constraints, e.g., must be done on weekends, or a @code{+} style for an
-unusual habit that can have a backlog, e.g., weekly reports.
-@item
-The TODO may also have minimum and maximum ranges specified by using the
-syntax @samp{.+2d/3d}, which says that you want to do the task at least every
-three days, but at most every two days.
-@item
-You must also have state logging for the @code{DONE} state enabled, in order
-for historical data to be represented in the consistency graph. If it's not
-enabled it's not an error, but the consistency graphs will be largely
-meaningless.
-@end enumerate
-
-To give you an idea of what the above rules look like in action, here's an
-actual habit with some history:
-
-@example
-** TODO Shave
- SCHEDULED: <2009-10-17 Sat .+2d/4d>
- - State "DONE" from "TODO" [2009-10-15 Thu]
- - State "DONE" from "TODO" [2009-10-12 Mon]
- - State "DONE" from "TODO" [2009-10-10 Sat]
- - State "DONE" from "TODO" [2009-10-04 Sun]
- - State "DONE" from "TODO" [2009-10-02 Fri]
- - State "DONE" from "TODO" [2009-09-29 Tue]
- - State "DONE" from "TODO" [2009-09-25 Fri]
- - State "DONE" from "TODO" [2009-09-19 Sat]
- - State "DONE" from "TODO" [2009-09-16 Wed]
- - State "DONE" from "TODO" [2009-09-12 Sat]
- :PROPERTIES:
- :STYLE: habit
- :LAST_REPEAT: [2009-10-19 Mon 00:36]
- :END:
-@end example
-
-What this habit says is: I want to shave at most every 2 days (given by the
-@code{SCHEDULED} date and repeat interval) and at least every 4 days. If
-today is the 15th, then the habit first appears in the agenda on Oct 17,
-after the minimum of 2 days has elapsed, and will appear overdue on Oct 19,
-after four days have elapsed.
-
-What's really useful about habits is that they are displayed along with a
-consistency graph, to show how consistent you've been at getting that task
-done in the past. This graph shows every day that the task was done over the
-past three weeks, with colors for each day. The colors used are:
-
-@table @code
-@item Blue
-If the task wasn't to be done yet on that day.
-@item Green
-If the task could have been done on that day.
-@item Yellow
-If the task was going to be overdue the next day.
-@item Red
-If the task was overdue on that day.
-@end table
-
-In addition to coloring each day, the day is also marked with an asterisk if
-the task was actually done that day, and an exclamation mark to show where
-the current day falls in the graph.
-
-There are several configuration variables that can be used to change the way
-habits are displayed in the agenda.
-
-@table @code
-@item org-habit-graph-column
-The buffer column at which the consistency graph should be drawn. This will
-overwrite any text in that column, so it's a good idea to keep your habits'
-titles brief and to the point.
-@item org-habit-preceding-days
-The amount of history, in days before today, to appear in consistency graphs.
-@item org-habit-following-days
-The number of days after today that will appear in consistency graphs.
-@item org-habit-show-habits-only-for-today
-If non-nil, only show habits in today's agenda view. This is set to true by
-default.
-@end table
-
-Lastly, pressing @kbd{K} in the agenda buffer will cause habits to
-temporarily be disabled and they won't appear at all. Press @kbd{K} again to
-bring them back. They are also subject to tag filtering, if you have habits
-which should only be done in certain contexts, for example.
-
-@node Priorities, Breaking down tasks, Progress logging, TODO Items
-@section Priorities
-@cindex priorities
-
-If you use Org-mode extensively, you may end up with enough TODO items that
-it starts to make sense to prioritize them. Prioritizing can be done by
-placing a @emph{priority cookie} into the headline of a TODO item, like this
-
-@example
-*** TODO [#A] Write letter to Sam Fortune
-@end example
-
-@noindent
-@vindex org-priority-faces
-By default, Org-mode supports three priorities: @samp{A}, @samp{B}, and
-@samp{C}. @samp{A} is the highest priority. An entry without a cookie is
-treated just like priority @samp{B}. Priorities make a difference only for
-sorting in the agenda (@pxref{Weekly/daily agenda}); outside the agenda, they
-have no inherent meaning to Org-mode. The cookies can be highlighted with
-special faces by customizing the variable @code{org-priority-faces}.
-
-Priorities can be attached to any outline node; they do not need to be TODO
-items.
-
-@table @kbd
-@item @kbd{C-c ,}
-@kindex @kbd{C-c ,}
-@findex org-priority
-Set the priority of the current headline (@command{org-priority}). The
-command prompts for a priority character @samp{A}, @samp{B} or @samp{C}.
-When you press @key{SPC} instead, the priority cookie is removed from the
-headline. The priorities can also be changed ``remotely'' from the timeline
-and agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
-@c
-@orgcmdkkcc{S-@key{up},S-@key{down},org-priority-up,org-priority-down}
-@vindex org-priority-start-cycle-with-default
-Increase/decrease priority of current headline@footnote{See also the option
-@code{org-priority-start-cycle-with-default}.}. Note that these keys are
-also used to modify timestamps (@pxref{Creating timestamps}). See also
-@ref{Conflicts}, for a discussion of the interaction with
-@code{shift-selection-mode}.
-@end table
-
-@vindex org-highest-priority
-@vindex org-lowest-priority
-@vindex org-default-priority
-You can change the range of allowed priorities by setting the variables
-@code{org-highest-priority}, @code{org-lowest-priority}, and
-@code{org-default-priority}. For an individual buffer, you may set
-these values (highest, lowest, default) like this (please make sure that
-the highest priority is earlier in the alphabet than the lowest
-priority):
-
-@cindex #+PRIORITIES
-@example
-#+PRIORITIES: A C B
-@end example
-
-@node Breaking down tasks, Checkboxes, Priorities, TODO Items
-@section Breaking tasks down into subtasks
-@cindex tasks, breaking down
-@cindex statistics, for TODO items
-
-@vindex org-agenda-todo-list-sublevels
-It is often advisable to break down large tasks into smaller, manageable
-subtasks. You can do this by creating an outline tree below a TODO item,
-with detailed subtasks on the tree@footnote{To keep subtasks out of the
-global TODO list, see the @code{org-agenda-todo-list-sublevels}.}. To keep
-the overview over the fraction of subtasks that are already completed, insert
-either @samp{[/]} or @samp{[%]} anywhere in the headline. These cookies will
-be updated each time the TODO status of a child changes, or when pressing
-@kbd{C-c C-c} on the cookie. For example:
-
-@example
-* Organize Party [33%]
-** TODO Call people [1/2]
-*** TODO Peter
-*** DONE Sarah
-** TODO Buy food
-** DONE Talk to neighbor
-@end example
-
-@cindex property, COOKIE_DATA
-If a heading has both checkboxes and TODO children below it, the meaning of
-the statistics cookie become ambiguous. Set the property
-@code{COOKIE_DATA} to either @samp{checkbox} or @samp{todo} to resolve
-this issue.
-
-@vindex org-hierarchical-todo-statistics
-If you would like to have the statistics cookie count any TODO entries in the
-subtree (not just direct children), configure the variable
-@code{org-hierarchical-todo-statistics}. To do this for a single subtree,
-include the word @samp{recursive} into the value of the @code{COOKIE_DATA}
-property.
-
-@example
-* Parent capturing statistics [2/20]
- :PROPERTIES:
- :COOKIE_DATA: todo recursive
- :END:
-@end example
-
-If you would like a TODO entry to automatically change to DONE
-when all children are done, you can use the following setup:
-
-@example
-(defun org-summary-todo (n-done n-not-done)
- "Switch entry to DONE when all subentries are done, to TODO otherwise."
- (let (org-log-done org-log-states) ; turn off logging
- (org-todo (if (= n-not-done 0) "DONE" "TODO"))))
-
-(add-hook 'org-after-todo-statistics-hook 'org-summary-todo)
-@end example
-
-
-Another possibility is the use of checkboxes to identify (a hierarchy of) a
-large number of subtasks (@pxref{Checkboxes}).
-
-
-@node Checkboxes, , Breaking down tasks, TODO Items
-@section Checkboxes
-@cindex checkboxes
-
-@vindex org-list-automatic-rules
-Every item in a plain list@footnote{With the exception of description
-lists. But you can allow it by modifying @code{org-list-automatic-rules}
-accordingly.} (@pxref{Plain lists}) can be made into a checkbox by starting
-it with the string @samp{[ ]}. This feature is similar to TODO items
-(@pxref{TODO Items}), but is more lightweight. Checkboxes are not included
-into the global TODO list, so they are often great to split a task into a
-number of simple steps. Or you can use them in a shopping list. To toggle a
-checkbox, use @kbd{C-c C-c}, or use the mouse (thanks to Piotr Zielinski's
-@file{org-mouse.el}).
-
-Here is an example of a checkbox list.
-
-@example
-* TODO Organize party [2/4]
- - [-] call people [1/3]
- - [ ] Peter
- - [X] Sarah
- - [ ] Sam
- - [X] order food
- - [ ] think about what music to play
- - [X] talk to the neighbors
-@end example
-
-Checkboxes work hierarchically, so if a checkbox item has children that
-are checkboxes, toggling one of the children checkboxes will make the
-parent checkbox reflect if none, some, or all of the children are
-checked.
-
-@cindex statistics, for checkboxes
-@cindex checkbox statistics
-@cindex property, COOKIE_DATA
-@vindex org-hierarchical-checkbox-statistics
-The @samp{[2/4]} and @samp{[1/3]} in the first and second line are cookies
-indicating how many checkboxes present in this entry have been checked off,
-and the total number of checkboxes present. This can give you an idea on how
-many checkboxes remain, even without opening a folded entry. The cookies can
-be placed into a headline or into (the first line of) a plain list item.
-Each cookie covers checkboxes of direct children structurally below the
-headline/item on which the cookie appears@footnote{Set the variable
-@code{org-hierarchical-checkbox-statistics} if you want such cookies to
-represent the all checkboxes below the cookie, not just the direct
-children.}. You have to insert the cookie yourself by typing either
-@samp{[/]} or @samp{[%]}. With @samp{[/]} you get an @samp{n out of m}
-result, as in the examples above. With @samp{[%]} you get information about
-the percentage of checkboxes checked (in the above example, this would be
-@samp{[50%]} and @samp{[33%]}, respectively). In a headline, a cookie can
-count either checkboxes below the heading or TODO states of children, and it
-will display whatever was changed last. Set the property @code{COOKIE_DATA}
-to either @samp{checkbox} or @samp{todo} to resolve this issue.
-
-@cindex blocking, of checkboxes
-@cindex checkbox blocking
-@cindex property, ORDERED
-If the current outline node has an @code{ORDERED} property, checkboxes must
-be checked off in sequence, and an error will be thrown if you try to check
-off a box while there are unchecked boxes above it.
-
-@noindent The following commands work with checkboxes:
-
-@table @kbd
-@orgcmd{C-c C-c,org-toggle-checkbox}
-Toggle checkbox status or (with prefix arg) checkbox presence at point. With
-double prefix argument, set it to @samp{[-]}, which is considered to be an
-intermediate state.
-@orgcmd{C-c C-x C-b,org-toggle-checkbox}
-Toggle checkbox status or (with prefix arg) checkbox presence at point. With
-double prefix argument, set it to @samp{[-]}, which is considered to be an
-intermediate state.
-@itemize @minus
-@item
-If there is an active region, toggle the first checkbox in the region
-and set all remaining boxes to the same status as the first. With a prefix
-arg, add or remove the checkbox for all items in the region.
-@item
-If the cursor is in a headline, toggle checkboxes in the region between
-this headline and the next (so @emph{not} the entire subtree).
-@item
-If there is no active region, just toggle the checkbox at point.
-@end itemize
-@orgcmd{M-S-@key{RET},org-insert-todo-heading}
-Insert a new item with a checkbox.
-This works only if the cursor is already in a plain list item
-(@pxref{Plain lists}).
-@orgcmd{C-c C-x o,org-toggle-ordered-property}
-@vindex org-track-ordered-property-with-tag
-@cindex property, ORDERED
-Toggle the @code{ORDERED} property of the entry, to toggle if checkboxes must
-be checked off in sequence. A property is used for this behavior because
-this should be local to the current entry, not inherited like a tag.
-However, if you would like to @i{track} the value of this property with a tag
-for better visibility, customize the variable
-@code{org-track-ordered-property-with-tag}.
-@orgcmd{C-c #,org-update-statistics-cookies}
-Update the statistics cookie in the current outline entry. When called with
-a @kbd{C-u} prefix, update the entire file. Checkbox statistic cookies are
-updated automatically if you toggle checkboxes with @kbd{C-c C-c} and make
-new ones with @kbd{M-S-@key{RET}}. TODO statistics cookies update when
-changing TODO states. If you delete boxes/entries or add/change them by
-hand, use this command to get things back into sync. Or simply toggle any
-entry twice (checkboxes with @kbd{C-c C-c}).
-@end table
-
-@node Tags, Properties and Columns, TODO Items, Top
-@chapter Tags
-@cindex tags
-@cindex headline tagging
-@cindex matching, tags
-@cindex sparse tree, tag based
-
-An excellent way to implement labels and contexts for cross-correlating
-information is to assign @i{tags} to headlines. Org-mode has extensive
-support for tags.
-
-@vindex org-tag-faces
-Every headline can contain a list of tags; they occur at the end of the
-headline. Tags are normal words containing letters, numbers, @samp{_}, and
-@samp{@@}. Tags must be preceded and followed by a single colon, e.g.,
-@samp{:work:}. Several tags can be specified, as in @samp{:work:urgent:}.
-Tags will by default be in bold face with the same color as the headline.
-You may specify special faces for specific tags using the variable
-@code{org-tag-faces}, in much the same way as you can for TODO keywords
-(@pxref{Faces for TODO keywords}).
-
-@menu
-* Tag inheritance:: Tags use the tree structure of the outline
-* Setting tags:: How to assign tags to a headline
-* Tag searches:: Searching for combinations of tags
-@end menu
-
-@node Tag inheritance, Setting tags, Tags, Tags
-@section Tag inheritance
-@cindex tag inheritance
-@cindex inheritance, of tags
-@cindex sublevels, inclusion into tags match
-
-@i{Tags} make use of the hierarchical structure of outline trees. If a
-heading has a certain tag, all subheadings will inherit the tag as
-well. For example, in the list
-
-@example
-* Meeting with the French group :work:
-** Summary by Frank :boss:notes:
-*** TODO Prepare slides for him :action:
-@end example
-
-@noindent
-the final heading will have the tags @samp{:work:}, @samp{:boss:},
-@samp{:notes:}, and @samp{:action:} even though the final heading is not
-explicitly marked with those tags. You can also set tags that all entries in
-a file should inherit just as if these tags were defined in a hypothetical
-level zero that surrounds the entire file. Use a line like this@footnote{As
-with all these in-buffer settings, pressing @kbd{C-c C-c} activates any
-changes in the line.}:
-
-@cindex #+FILETAGS
-@example
-#+FILETAGS: :Peter:Boss:Secret:
-@end example
-
-@noindent
-@vindex org-use-tag-inheritance
-@vindex org-tags-exclude-from-inheritance
-To limit tag inheritance to specific tags, or to turn it off entirely, use
-the variables @code{org-use-tag-inheritance} and
-@code{org-tags-exclude-from-inheritance}.
-
-@vindex org-tags-match-list-sublevels
-When a headline matches during a tags search while tag inheritance is turned
-on, all the sublevels in the same tree will (for a simple match form) match
-as well@footnote{This is only true if the search does not involve more
-complex tests including properties (@pxref{Property searches}).}. The list
-of matches may then become very long. If you only want to see the first tags
-match in a subtree, configure the variable
-@code{org-tags-match-list-sublevels} (not recommended).
-
-@node Setting tags, Tag searches, Tag inheritance, Tags
-@section Setting tags
-@cindex setting tags
-@cindex tags, setting
-
-@kindex M-@key{TAB}
-Tags can simply be typed into the buffer at the end of a headline.
-After a colon, @kbd{M-@key{TAB}} offers completion on tags. There is
-also a special command for inserting tags:
-
-@table @kbd
-@orgcmd{C-c C-q,org-set-tags-command}
-@cindex completion, of tags
-@vindex org-tags-column
-Enter new tags for the current headline. Org-mode will either offer
-completion or a special single-key interface for setting tags, see
-below. After pressing @key{RET}, the tags will be inserted and aligned
-to @code{org-tags-column}. When called with a @kbd{C-u} prefix, all
-tags in the current buffer will be aligned to that column, just to make
-things look nice. TAGS are automatically realigned after promotion,
-demotion, and TODO state changes (@pxref{TODO basics}).
-@orgcmd{C-c C-c,org-set-tags-command}
-When the cursor is in a headline, this does the same as @kbd{C-c C-q}.
-@end table
-
-@vindex org-tag-alist
-Org will support tag insertion based on a @emph{list of tags}. By
-default this list is constructed dynamically, containing all tags
-currently used in the buffer. You may also globally specify a hard list
-of tags with the variable @code{org-tag-alist}. Finally you can set
-the default tags for a given file with lines like
-
-@cindex #+TAGS
-@example
-#+TAGS: @@work @@home @@tennisclub
-#+TAGS: laptop car pc sailboat
-@end example
-
-If you have globally defined your preferred set of tags using the
-variable @code{org-tag-alist}, but would like to use a dynamic tag list
-in a specific file, add an empty TAGS option line to that file:
-
-@example
-#+TAGS:
-@end example
-
-@vindex org-tag-persistent-alist
-If you have a preferred set of tags that you would like to use in every file,
-in addition to those defined on a per-file basis by TAGS option lines, then
-you may specify a list of tags with the variable
-@code{org-tag-persistent-alist}. You may turn this off on a per-file basis
-by adding a STARTUP option line to that file:
-
-@example
-#+STARTUP: noptag
-@end example
-
-By default Org-mode uses the standard minibuffer completion facilities for
-entering tags. However, it also implements another, quicker, tag selection
-method called @emph{fast tag selection}. This allows you to select and
-deselect tags with just a single key press. For this to work well you should
-assign unique letters to most of your commonly used tags. You can do this
-globally by configuring the variable @code{org-tag-alist} in your
-@file{.emacs} file. For example, you may find the need to tag many items in
-different files with @samp{:@@home:}. In this case you can set something
-like:
-
-@lisp
-(setq org-tag-alist '(("@@work" . ?w) ("@@home" . ?h) ("laptop" . ?l)))
-@end lisp
-
-@noindent If the tag is only relevant to the file you are working on, then you
-can instead set the TAGS option line as:
-
-@example
-#+TAGS: @@work(w) @@home(h) @@tennisclub(t) laptop(l) pc(p)
-@end example
-
-@noindent The tags interface will show the available tags in a splash
-window. If you want to start a new line after a specific tag, insert
-@samp{\n} into the tag list
-
-@example
-#+TAGS: @@work(w) @@home(h) @@tennisclub(t) \n laptop(l) pc(p)
-@end example
-
-@noindent or write them in two lines:
-
-@example
-#+TAGS: @@work(w) @@home(h) @@tennisclub(t)
-#+TAGS: laptop(l) pc(p)
-@end example
-
-@noindent
-You can also group together tags that are mutually exclusive by using
-braces, as in:
-
-@example
-#+TAGS: @{ @@work(w) @@home(h) @@tennisclub(t) @} laptop(l) pc(p)
-@end example
-
-@noindent you indicate that at most one of @samp{@@work}, @samp{@@home},
-and @samp{@@tennisclub} should be selected. Multiple such groups are allowed.
-
-@noindent Don't forget to press @kbd{C-c C-c} with the cursor in one of
-these lines to activate any changes.
-
-@noindent
-To set these mutually exclusive groups in the variable @code{org-tags-alist},
-you must use the dummy tags @code{:startgroup} and @code{:endgroup} instead
-of the braces. Similarly, you can use @code{:newline} to indicate a line
-break. The previous example would be set globally by the following
-configuration:
-
-@lisp
-(setq org-tag-alist '((:startgroup . nil)
- ("@@work" . ?w) ("@@home" . ?h)
- ("@@tennisclub" . ?t)
- (:endgroup . nil)
- ("laptop" . ?l) ("pc" . ?p)))
-@end lisp
-
-If at least one tag has a selection key then pressing @kbd{C-c C-c} will
-automatically present you with a special interface, listing inherited tags,
-the tags of the current headline, and a list of all valid tags with
-corresponding keys@footnote{Keys will automatically be assigned to tags which
-have no configured keys.}. In this interface, you can use the following
-keys:
-
-@table @kbd
-@item a-z...
-Pressing keys assigned to tags will add or remove them from the list of
-tags in the current line. Selecting a tag in a group of mutually
-exclusive tags will turn off any other tags from that group.
-@kindex @key{TAB}
-@item @key{TAB}
-Enter a tag in the minibuffer, even if the tag is not in the predefined
-list. You will be able to complete on all tags present in the buffer.
-@kindex @key{SPC}
-@item @key{SPC}
-Clear all tags for this line.
-@kindex @key{RET}
-@item @key{RET}
-Accept the modified set.
-@item C-g
-Abort without installing changes.
-@item q
-If @kbd{q} is not assigned to a tag, it aborts like @kbd{C-g}.
-@item !
-Turn off groups of mutually exclusive tags. Use this to (as an
-exception) assign several tags from such a group.
-@item C-c
-Toggle auto-exit after the next change (see below).
-If you are using expert mode, the first @kbd{C-c} will display the
-selection window.
-@end table
-
-@noindent
-This method lets you assign tags to a headline with very few keys. With
-the above setup, you could clear the current tags and set @samp{@@home},
-@samp{laptop} and @samp{pc} tags with just the following keys: @kbd{C-c
-C-c @key{SPC} h l p @key{RET}}. Switching from @samp{@@home} to
-@samp{@@work} would be done with @kbd{C-c C-c w @key{RET}} or
-alternatively with @kbd{C-c C-c C-c w}. Adding the non-predefined tag
-@samp{Sarah} could be done with @kbd{C-c C-c @key{TAB} S a r a h
-@key{RET} @key{RET}}.
-
-@vindex org-fast-tag-selection-single-key
-If you find that most of the time you need only a single key press to
-modify your list of tags, set the variable
-@code{org-fast-tag-selection-single-key}. Then you no longer have to
-press @key{RET} to exit fast tag selection---it will immediately exit
-after the first change. If you then occasionally need more keys, press
-@kbd{C-c} to turn off auto-exit for the current tag selection process
-(in effect: start selection with @kbd{C-c C-c C-c} instead of @kbd{C-c
-C-c}). If you set the variable to the value @code{expert}, the special
-window is not even shown for single-key tag selection, it comes up only
-when you press an extra @kbd{C-c}.
-
-@node Tag searches, , Setting tags, Tags
-@section Tag searches
-@cindex tag searches
-@cindex searching for tags
-
-Once a system of tags has been set up, it can be used to collect related
-information into special lists.
-
-@table @kbd
-@orgcmdkkc{C-c / m,C-c \,org-match-sparse-tree}
-Create a sparse tree with all headlines matching a tags search. With a
-@kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
-@orgcmd{C-c a m,org-tags-view}
-Create a global list of tag matches from all agenda files.
-@xref{Matching tags and properties}.
-@orgcmd{C-c a M,org-tags-view}
-@vindex org-tags-match-list-sublevels
-Create a global list of tag matches from all agenda files, but check
-only TODO items and force checking subitems (see variable
-@code{org-tags-match-list-sublevels}).
-@end table
-
-These commands all prompt for a match string which allows basic Boolean logic
-like @samp{+boss+urgent-project1}, to find entries with tags @samp{boss} and
-@samp{urgent}, but not @samp{project1}, or @samp{Kathy|Sally} to find entries
-which are tagged, like @samp{Kathy} or @samp{Sally}. The full syntax of the search
-string is rich and allows also matching against TODO keywords, entry levels
-and properties. For a complete description with many examples, see
-@ref{Matching tags and properties}.
-
-
-@node Properties and Columns, Dates and Times, Tags, Top
-@chapter Properties and columns
-@cindex properties
-
-Properties are a set of key-value pairs associated with an entry. There
-are two main applications for properties in Org-mode. First, properties
-are like tags, but with a value. Second, you can use properties to
-implement (very basic) database capabilities in an Org buffer. For
-an example of the first application, imagine maintaining a file where
-you document bugs and plan releases for a piece of software. Instead of
-using tags like @code{:release_1:}, @code{:release_2:}, one can use a
-property, say @code{:Release:}, that in different subtrees has different
-values, such as @code{1.0} or @code{2.0}. For an example of the second
-application of properties, imagine keeping track of your music CDs,
-where properties could be things such as the album, artist, date of
-release, number of tracks, and so on.
-
-Properties can be conveniently edited and viewed in column view
-(@pxref{Column view}).
-
-@menu
-* Property syntax:: How properties are spelled out
-* Special properties:: Access to other Org-mode features
-* Property searches:: Matching property values
-* Property inheritance:: Passing values down the tree
-* Column view:: Tabular viewing and editing
-* Property API:: Properties for Lisp programmers
-@end menu
-
-@node Property syntax, Special properties, Properties and Columns, Properties and Columns
-@section Property syntax
-@cindex property syntax
-@cindex drawer, for properties
-
-Properties are key-value pairs. They need to be inserted into a special
-drawer (@pxref{Drawers}) with the name @code{PROPERTIES}. Each property
-is specified on a single line, with the key (surrounded by colons)
-first, and the value after it. Here is an example:
-
-@example
-* CD collection
-** Classic
-*** Goldberg Variations
- :PROPERTIES:
- :Title: Goldberg Variations
- :Composer: J.S. Bach
- :Artist: Glen Gould
- :Publisher: Deutsche Grammophon
- :NDisks: 1
- :END:
-@end example
-
-You may define the allowed values for a particular property @samp{:Xyz:}
-by setting a property @samp{:Xyz_ALL:}. This special property is
-@emph{inherited}, so if you set it in a level 1 entry, it will apply to
-the entire tree. When allowed values are defined, setting the
-corresponding property becomes easier and is less prone to typing
-errors. For the example with the CD collection, we can predefine
-publishers and the number of disks in a box like this:
-
-@example
-* CD collection
- :PROPERTIES:
- :NDisks_ALL: 1 2 3 4
- :Publisher_ALL: "Deutsche Grammophon" Philips EMI
- :END:
-@end example
-
-If you want to set properties that can be inherited by any entry in a
-file, use a line like
-@cindex property, _ALL
-@cindex #+PROPERTY
-@example
-#+PROPERTY: NDisks_ALL 1 2 3 4
-@end example
-
-@vindex org-global-properties
-Property values set with the global variable
-@code{org-global-properties} can be inherited by all entries in all
-Org files.
-
-@noindent
-The following commands help to work with properties:
-
-@table @kbd
-@orgcmd{M-@key{TAB},org-complete}
-After an initial colon in a line, complete property keys. All keys used
-in the current file will be offered as possible completions.
-@orgcmd{C-c C-x p,org-set-property}
-Set a property. This prompts for a property name and a value. If
-necessary, the property drawer is created as well.
-@item M-x org-insert-property-drawer
-@findex org-insert-property-drawer
-Insert a property drawer into the current entry. The drawer will be
-inserted early in the entry, but after the lines with planning
-information like deadlines.
-@orgcmd{C-c C-c,org-property-action}
-With the cursor in a property drawer, this executes property commands.
-@orgcmd{C-c C-c s,org-set-property}
-Set a property in the current entry. Both the property and the value
-can be inserted using completion.
-@orgcmdkkcc{S-@key{right},S-@key{left},org-property-next-allowed-value,org-property-previous-allowed-value}
-Switch property at point to the next/previous allowed value.
-@orgcmd{C-c C-c d,org-delete-property}
-Remove a property from the current entry.
-@orgcmd{C-c C-c D,org-delete-property-globally}
-Globally remove a property, from all entries in the current file.
-@orgcmd{C-c C-c c,org-compute-property-at-point}
-Compute the property at point, using the operator and scope from the
-nearest column format definition.
-@end table
-
-@node Special properties, Property searches, Property syntax, Properties and Columns
-@section Special properties
-@cindex properties, special
-
-Special properties provide an alternative access method to Org-mode
-features, like the TODO state or the priority of an entry, discussed in the
-previous chapters. This interface exists so that you can include
-these states in a column view (@pxref{Column view}), or to use them in
-queries. The following property names are special and should not be
-used as keys in the properties drawer:
-
-@cindex property, special, TODO
-@cindex property, special, TAGS
-@cindex property, special, ALLTAGS
-@cindex property, special, CATEGORY
-@cindex property, special, PRIORITY
-@cindex property, special, DEADLINE
-@cindex property, special, SCHEDULED
-@cindex property, special, CLOSED
-@cindex property, special, TIMESTAMP
-@cindex property, special, TIMESTAMP_IA
-@cindex property, special, CLOCKSUM
-@cindex property, special, BLOCKED
-@c guessing that ITEM is needed in this area; also, should this list be sorted?
-@cindex property, special, ITEM
-@example
-TODO @r{The TODO keyword of the entry.}
-TAGS @r{The tags defined directly in the headline.}
-ALLTAGS @r{All tags, including inherited ones.}
-CATEGORY @r{The category of an entry.}
-PRIORITY @r{The priority of the entry, a string with a single letter.}
-DEADLINE @r{The deadline time string, without the angular brackets.}
-SCHEDULED @r{The scheduling timestamp, without the angular brackets.}
-CLOSED @r{When was this entry closed?}
-TIMESTAMP @r{The first keyword-less timestamp in the entry.}
-TIMESTAMP_IA @r{The first inactive timestamp in the entry.}
-CLOCKSUM @r{The sum of CLOCK intervals in the subtree. @code{org-clock-sum}}
- @r{must be run first to compute the values.}
-BLOCKED @r{"t" if task is currently blocked by children or siblings}
-ITEM @r{The content of the entry.}
-@end example
-
-@node Property searches, Property inheritance, Special properties, Properties and Columns
-@section Property searches
-@cindex properties, searching
-@cindex searching, of properties
-
-To create sparse trees and special lists with selection based on properties,
-the same commands are used as for tag searches (@pxref{Tag searches}).
-@table @kbd
-@orgcmdkkc{C-c / m,C-c \,org-match-sparse-tree}
-Create a sparse tree with all matching entries. With a
-@kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
-@orgcmd{C-c a m,org-tags-view}
-Create a global list of tag/property matches from all agenda files.
-@xref{Matching tags and properties}.
-@orgcmd{C-c a M,org-tags-view}
-@vindex org-tags-match-list-sublevels
-Create a global list of tag matches from all agenda files, but check
-only TODO items and force checking of subitems (see variable
-@code{org-tags-match-list-sublevels}).
-@end table
-
-The syntax for the search string is described in @ref{Matching tags and
-properties}.
-
-There is also a special command for creating sparse trees based on a
-single property:
-
-@table @kbd
-@orgkey{C-c / p}
-Create a sparse tree based on the value of a property. This first
-prompts for the name of a property, and then for a value. A sparse tree
-is created with all entries that define this property with the given
-value. If you enclose the value in curly braces, it is interpreted as
-a regular expression and matched against the property values.
-@end table
-
-@node Property inheritance, Column view, Property searches, Properties and Columns
-@section Property Inheritance
-@cindex properties, inheritance
-@cindex inheritance, of properties
-
-@vindex org-use-property-inheritance
-The outline structure of Org-mode documents lends itself to an
-inheritance model of properties: if the parent in a tree has a certain
-property, the children can inherit this property. Org-mode does not
-turn this on by default, because it can slow down property searches
-significantly and is often not needed. However, if you find inheritance
-useful, you can turn it on by setting the variable
-@code{org-use-property-inheritance}. It may be set to @code{t} to make
-all properties inherited from the parent, to a list of properties
-that should be inherited, or to a regular expression that matches
-inherited properties. If a property has the value @samp{nil}, this is
-interpreted as an explicit undefine of the property, so that inheritance
-search will stop at this value and return @code{nil}.
-
-Org-mode has a few properties for which inheritance is hard-coded, at
-least for the special applications for which they are used:
-
-@cindex property, COLUMNS
-@table @code
-@item COLUMNS
-The @code{:COLUMNS:} property defines the format of column view
-(@pxref{Column view}). It is inherited in the sense that the level
-where a @code{:COLUMNS:} property is defined is used as the starting
-point for a column view table, independently of the location in the
-subtree from where columns view is turned on.
-@item CATEGORY
-@cindex property, CATEGORY
-For agenda view, a category set through a @code{:CATEGORY:} property
-applies to the entire subtree.
-@item ARCHIVE
-@cindex property, ARCHIVE
-For archiving, the @code{:ARCHIVE:} property may define the archive
-location for the entire subtree (@pxref{Moving subtrees}).
-@item LOGGING
-@cindex property, LOGGING
-The LOGGING property may define logging settings for an entry or a
-subtree (@pxref{Tracking TODO state changes}).
-@end table
-
-@node Column view, Property API, Property inheritance, Properties and Columns
-@section Column view
-
-A great way to view and edit properties in an outline tree is
-@emph{column view}. In column view, each outline node is turned into a
-table row. Columns in this table provide access to properties of the
-entries. Org-mode implements columns by overlaying a tabular structure
-over the headline of each item. While the headlines have been turned
-into a table row, you can still change the visibility of the outline
-tree. For example, you get a compact table by switching to CONTENTS
-view (@kbd{S-@key{TAB} S-@key{TAB}}, or simply @kbd{c} while column view
-is active), but you can still open, read, and edit the entry below each
-headline. Or, you can switch to column view after executing a sparse
-tree command and in this way get a table only for the selected items.
-Column view also works in agenda buffers (@pxref{Agenda Views}) where
-queries have collected selected items, possibly from a number of files.
-
-@menu
-* Defining columns:: The COLUMNS format property
-* Using column view:: How to create and use column view
-* Capturing column view:: A dynamic block for column view
-@end menu
-
-@node Defining columns, Using column view, Column view, Column view
-@subsection Defining columns
-@cindex column view, for properties
-@cindex properties, column view
-
-Setting up a column view first requires defining the columns. This is
-done by defining a column format line.
-
-@menu
-* Scope of column definitions:: Where defined, where valid?
-* Column attributes:: Appearance and content of a column
-@end menu
-
-@node Scope of column definitions, Column attributes, Defining columns, Defining columns
-@subsubsection Scope of column definitions
-
-To define a column format for an entire file, use a line like
-
-@cindex #+COLUMNS
-@example
-#+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
-@end example
-
-To specify a format that only applies to a specific tree, add a
-@code{:COLUMNS:} property to the top node of that tree, for example:
-
-@example
-** Top node for columns view
- :PROPERTIES:
- :COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
- :END:
-@end example
-
-If a @code{:COLUMNS:} property is present in an entry, it defines columns
-for the entry itself, and for the entire subtree below it. Since the
-column definition is part of the hierarchical structure of the document,
-you can define columns on level 1 that are general enough for all
-sublevels, and more specific columns further down, when you edit a
-deeper part of the tree.
-
-@node Column attributes, , Scope of column definitions, Defining columns
-@subsubsection Column attributes
-A column definition sets the attributes of a column. The general
-definition looks like this:
-
-@example
- %[@var{width}]@var{property}[(@var{title})][@{@var{summary-type}@}]
-@end example
-
-@noindent
-Except for the percent sign and the property name, all items are
-optional. The individual parts have the following meaning:
-
-@example
-@var{width} @r{An integer specifying the width of the column in characters.}
- @r{If omitted, the width will be determined automatically.}
-@var{property} @r{The property that should be edited in this column.}
- @r{Special properties representing meta data are allowed here}
- @r{as well (@pxref{Special properties})}
-@var{title} @r{The header text for the column. If omitted, the property}
- @r{name is used.}
-@{@var{summary-type}@} @r{The summary type. If specified, the column values for}
- @r{parent nodes are computed from the children.}
- @r{Supported summary types are:}
- @{+@} @r{Sum numbers in this column.}
- @{+;%.1f@} @r{Like @samp{+}, but format result with @samp{%.1f}.}
- @{$@} @r{Currency, short for @samp{+;%.2f}.}
- @{:@} @r{Sum times, HH:MM, plain numbers are hours.}
- @{X@} @r{Checkbox status, @samp{[X]} if all children are @samp{[X]}.}
- @{X/@} @r{Checkbox status, @samp{[n/m]}.}
- @{X%@} @r{Checkbox status, @samp{[n%]}.}
- @{min@} @r{Smallest number in column.}
- @{max@} @r{Largest number.}
- @{mean@} @r{Arithmetic mean of numbers.}
- @{:min@} @r{Smallest time value in column.}
- @{:max@} @r{Largest time value.}
- @{:mean@} @r{Arithmetic mean of time values.}
- @{@@min@} @r{Minimum age (in days/hours/mins/seconds).}
- @{@@max@} @r{Maximum age (in days/hours/mins/seconds).}
- @{@@mean@} @r{Arithmetic mean of ages (in days/hours/mins/seconds).}
- @{est+@} @r{Add low-high estimates.}
-@end example
-
-@noindent
-Be aware that you can only have one summary type for any property you
-include. Subsequent columns referencing the same property will all display the
-same summary information.
-
-The @code{est+} summary type requires further explanation. It is used for
-combining estimates, expressed as low-high ranges. For example, instead
-of estimating a particular task will take 5 days, you might estimate it as
-5-6 days if you're fairly confident you know how much work is required, or
-1-10 days if you don't really know what needs to be done. Both ranges
-average at 5.5 days, but the first represents a more predictable delivery.
-
-When combining a set of such estimates, simply adding the lows and highs
-produces an unrealistically wide result. Instead, @code{est+} adds the
-statistical mean and variance of the sub-tasks, generating a final estimate
-from the sum. For example, suppose you had ten tasks, each of which was
-estimated at 0.5 to 2 days of work. Straight addition produces an estimate
-of 5 to 20 days, representing what to expect if everything goes either
-extremely well or extremely poorly. In contrast, @code{est+} estimates the
-full job more realistically, at 10-15 days.
-
-Here is an example for a complete columns definition, along with allowed
-values.
-
-@example
-:COLUMNS: %25ITEM %9Approved(Approved?)@{X@} %Owner %11Status \@footnote{Please note that the COLUMNS definition must be on a single line---it is wrapped here only because of formatting constraints.}
- %10Time_Estimate@{:@} %CLOCKSUM
-:Owner_ALL: Tammy Mark Karl Lisa Don
-:Status_ALL: "In progress" "Not started yet" "Finished" ""
-:Approved_ALL: "[ ]" "[X]"
-@end example
-
-@noindent
-The first column, @samp{%25ITEM}, means the first 25 characters of the
-item itself, i.e. of the headline. You probably always should start the
-column definition with the @samp{ITEM} specifier. The other specifiers
-create columns @samp{Owner} with a list of names as allowed values, for
-@samp{Status} with four different possible values, and for a checkbox
-field @samp{Approved}. When no width is given after the @samp{%}
-character, the column will be exactly as wide as it needs to be in order
-to fully display all values. The @samp{Approved} column does have a
-modified title (@samp{Approved?}, with a question mark). Summaries will
-be created for the @samp{Time_Estimate} column by adding time duration
-expressions like HH:MM, and for the @samp{Approved} column, by providing
-an @samp{[X]} status if all children have been checked. The
-@samp{CLOCKSUM} column is special, it lists the sum of CLOCK intervals
-in the subtree.
-
-@node Using column view, Capturing column view, Defining columns, Column view
-@subsection Using column view
-
-@table @kbd
-@tsubheading{Turning column view on and off}
-@orgcmd{C-c C-x C-c,org-columns}
-@vindex org-columns-default-format
-Turn on column view. If the cursor is before the first headline in the file,
-column view is turned on for the entire file, using the @code{#+COLUMNS}
-definition. If the cursor is somewhere inside the outline, this command
-searches the hierarchy, up from point, for a @code{:COLUMNS:} property that
-defines a format. When one is found, the column view table is established
-for the tree starting at the entry that contains the @code{:COLUMNS:}
-property. If no such property is found, the format is taken from the
-@code{#+COLUMNS} line or from the variable @code{org-columns-default-format},
-and column view is established for the current entry and its subtree.
-@orgcmd{r,org-columns-redo}
-Recreate the column view, to include recent changes made in the buffer.
-@orgcmd{g,org-columns-redo}
-Same as @kbd{r}.
-@orgcmd{q,org-columns-quit}
-Exit column view.
-@tsubheading{Editing values}
-@item @key{left} @key{right} @key{up} @key{down}
-Move through the column view from field to field.
-@kindex S-@key{left}
-@kindex S-@key{right}
-@item S-@key{left}/@key{right}
-Switch to the next/previous allowed value of the field. For this, you
-have to have specified allowed values for a property.
-@item 1..9,0
-Directly select the Nth allowed value, @kbd{0} selects the 10th value.
-@orgcmdkkcc{n,p,org-columns-next-allowed-value,org-columns-previous-allowed-value}
-Same as @kbd{S-@key{left}/@key{right}}
-@orgcmd{e,org-columns-edit-value}
-Edit the property at point. For the special properties, this will
-invoke the same interface that you normally use to change that
-property. For example, when editing a TAGS property, the tag completion
-or fast selection interface will pop up.
-@orgcmd{C-c C-c,org-columns-set-tags-or-toggle}
-When there is a checkbox at point, toggle it.
-@orgcmd{v,org-columns-show-value}
-View the full value of this property. This is useful if the width of
-the column is smaller than that of the value.
-@orgcmd{a,org-columns-edit-allowed}
-Edit the list of allowed values for this property. If the list is found
-in the hierarchy, the modified values is stored there. If no list is
-found, the new value is stored in the first entry that is part of the
-current column view.
-@tsubheading{Modifying the table structure}
-@orgcmdkkcc{<,>,org-columns-narrow,org-columns-widen}
-Make the column narrower/wider by one character.
-@orgcmd{S-M-@key{right},org-columns-new}
-Insert a new column, to the left of the current column.
-@orgcmd{S-M-@key{left},org-columns-delete}
-Delete the current column.
-@end table
-
-@node Capturing column view, , Using column view, Column view
-@subsection Capturing column view
-
-Since column view is just an overlay over a buffer, it cannot be
-exported or printed directly. If you want to capture a column view, use
-a @code{columnview} dynamic block (@pxref{Dynamic blocks}). The frame
-of this block looks like this:
-
-@cindex #+BEGIN, columnview
-@example
-* The column view
-#+BEGIN: columnview :hlines 1 :id "label"
-
-#+END:
-@end example
-
-@noindent This dynamic block has the following parameters:
-
-@table @code
-@item :id
-This is the most important parameter. Column view is a feature that is
-often localized to a certain (sub)tree, and the capture block might be
-at a different location in the file. To identify the tree whose view to
-capture, you can use 4 values:
-@cindex property, ID
-@example
-local @r{use the tree in which the capture block is located}
-global @r{make a global view, including all headings in the file}
-"file:@var{path-to-file}"
- @r{run column view at the top of this file}
-"@var{ID}" @r{call column view in the tree that has an @code{:ID:}}
- @r{property with the value @i{label}. You can use}
- @r{@kbd{M-x org-id-copy} to create a globally unique ID for}
- @r{the current entry and copy it to the kill-ring.}
-@end example
-@item :hlines
-When @code{t}, insert an hline after every line. When a number @var{N}, insert
-an hline before each headline with level @code{<= @var{N}}.
-@item :vlines
-When set to @code{t}, force column groups to get vertical lines.
-@item :maxlevel
-When set to a number, don't capture entries below this level.
-@item :skip-empty-rows
-When set to @code{t}, skip rows where the only non-empty specifier of the
-column view is @code{ITEM}.
-
-@end table
-
-@noindent
-The following commands insert or update the dynamic block:
-
-@table @kbd
-@orgcmd{C-c C-x i,org-insert-columns-dblock}
-Insert a dynamic block capturing a column view. You will be prompted
-for the scope or ID of the view.
-@orgcmdkkc{C-c C-c,C-c C-x C-u,org-dblock-update}
-Update dynamic block at point. The cursor needs to be in the
-@code{#+BEGIN} line of the dynamic block.
-@orgcmd{C-u C-c C-x C-u,org-update-all-dblocks}
-Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
-you have several clock table blocks, column-capturing blocks or other dynamic
-blocks in a buffer.
-@end table
-
-You can add formulas to the column view table and you may add plotting
-instructions in front of the table---these will survive an update of the
-block. If there is a @code{#+TBLFM:} after the table, the table will
-actually be recalculated automatically after an update.
-
-An alternative way to capture and process property values into a table is
-provided by Eric Schulte's @file{org-collector.el} which is a contributed
-package@footnote{Contributed packages are not part of Emacs, but are
-distributed with the main distribution of Org (visit
-@uref{http://orgmode.org}).}. It provides a general API to collect
-properties from entries in a certain scope, and arbitrary Lisp expressions to
-process these values before inserting them into a table or a dynamic block.
-
-@node Property API, , Column view, Properties and Columns
-@section The Property API
-@cindex properties, API
-@cindex API, for properties
-
-There is a full API for accessing and changing properties. This API can
-be used by Emacs Lisp programs to work with properties and to implement
-features based on them. For more information see @ref{Using the
-property API}.
-
-@node Dates and Times, Capture - Refile - Archive, Properties and Columns, Top
-@chapter Dates and times
-@cindex dates
-@cindex times
-@cindex timestamp
-@cindex date stamp
-
-To assist project planning, TODO items can be labeled with a date and/or
-a time. The specially formatted string carrying the date and time
-information is called a @emph{timestamp} in Org-mode. This may be a
-little confusing because timestamp is often used as indicating when
-something was created or last changed. However, in Org-mode this term
-is used in a much wider sense.
-
-@menu
-* Timestamps:: Assigning a time to a tree entry
-* Creating timestamps:: Commands which insert timestamps
-* Deadlines and scheduling:: Planning your work
-* Clocking work time:: Tracking how long you spend on a task
-* Effort estimates:: Planning work effort in advance
-* Relative timer:: Notes with a running timer
-* Countdown timer:: Starting a countdown timer for a task
-@end menu
-
-
-@node Timestamps, Creating timestamps, Dates and Times, Dates and Times
-@section Timestamps, deadlines, and scheduling
-@cindex timestamps
-@cindex ranges, time
-@cindex date stamps
-@cindex deadlines
-@cindex scheduling
-
-A timestamp is a specification of a date (possibly with a time or a range of
-times) in a special format, either @samp{<2003-09-16 Tue>} or
-@samp{<2003-09-16 Tue 09:39>} or @samp{<2003-09-16 Tue
-12:00-12:30>}@footnote{This is inspired by the standard ISO 8601 date/time
-format. To use an alternative format, see @ref{Custom time format}.}. A
-timestamp can appear anywhere in the headline or body of an Org tree entry.
-Its presence causes entries to be shown on specific dates in the agenda
-(@pxref{Weekly/daily agenda}). We distinguish:
-
-@table @var
-@item Plain timestamp; Event; Appointment
-@cindex timestamp
-A simple timestamp just assigns a date/time to an item. This is just
-like writing down an appointment or event in a paper agenda. In the
-timeline and agenda displays, the headline of an entry associated with a
-plain timestamp will be shown exactly on that date.
-
-@example
-* Meet Peter at the movies <2006-11-01 Wed 19:15>
-* Discussion on climate change <2006-11-02 Thu 20:00-22:00>
-@end example
-
-@item Timestamp with repeater interval
-@cindex timestamp, with repeater interval
-A timestamp may contain a @emph{repeater interval}, indicating that it
-applies not only on the given date, but again and again after a certain
-interval of N days (d), weeks (w), months (m), or years (y). The
-following will show up in the agenda every Wednesday:
-
-@example
-* Pick up Sam at school <2007-05-16 Wed 12:30 +1w>
-@end example
-
-@item Diary-style sexp entries
-For more complex date specifications, Org-mode supports using the
-special sexp diary entries implemented in the Emacs calendar/diary
-package. For example
-
-@example
-* The nerd meeting on every 2nd Thursday of the month
- <%%(diary-float t 4 2)>
-@end example
-
-@item Time/Date range
-@cindex timerange
-@cindex date range
-Two timestamps connected by @samp{--} denote a range. The headline
-will be shown on the first and last day of the range, and on any dates
-that are displayed and fall in the range. Here is an example:
-
-@example
-** Meeting in Amsterdam
- <2004-08-23 Mon>--<2004-08-26 Thu>
-@end example
-
-@item Inactive timestamp
-@cindex timestamp, inactive
-@cindex inactive timestamp
-Just like a plain timestamp, but with square brackets instead of
-angular ones. These timestamps are inactive in the sense that they do
-@emph{not} trigger an entry to show up in the agenda.
-
-@example
-* Gillian comes late for the fifth time [2006-11-01 Wed]
-@end example
-
-@end table
-
-@node Creating timestamps, Deadlines and scheduling, Timestamps, Dates and Times
-@section Creating timestamps
-@cindex creating timestamps
-@cindex timestamps, creating
-
-For Org-mode to recognize timestamps, they need to be in the specific
-format. All commands listed below produce timestamps in the correct
-format.
-
-@table @kbd
-@orgcmd{C-c .,org-time-stamp}
-Prompt for a date and insert a corresponding timestamp. When the cursor is
-at an existing timestamp in the buffer, the command is used to modify this
-timestamp instead of inserting a new one. When this command is used twice in
-succession, a time range is inserted.
-@c
-@orgcmd{C-c !,org-time-stamp-inactive}
-Like @kbd{C-c .}, but insert an inactive timestamp that will not cause
-an agenda entry.
-@c
-@kindex C-u C-c .
-@kindex C-u C-c !
-@item C-u C-c .
-@itemx C-u C-c !
-@vindex org-time-stamp-rounding-minutes
-Like @kbd{C-c .} and @kbd{C-c !}, but use the alternative format which
-contains date and time. The default time can be rounded to multiples of 5
-minutes, see the option @code{org-time-stamp-rounding-minutes}.
-@c
-@orgcmd{C-c <,org-date-from-calendar}
-Insert a timestamp corresponding to the cursor date in the Calendar.
-@c
-@orgcmd{C-c >,org-goto-calendar}
-Access the Emacs calendar for the current date. If there is a
-timestamp in the current line, go to the corresponding date
-instead.
-@c
-@orgcmd{C-c C-o,org-open-at-point}
-Access the agenda for the date given by the timestamp or -range at
-point (@pxref{Weekly/daily agenda}).
-@c
-@orgcmdkkcc{S-@key{left},S-@key{right},org-timestamp-down-day,org-timestamp-up-day}
-Change date at cursor by one day. These key bindings conflict with
-shift-selection and related modes (@pxref{Conflicts}).
-@c
-@orgcmdkkcc{S-@key{up},S-@key{down},org-timestamp-up,org-timestamp-down-down}
-Change the item under the cursor in a timestamp. The cursor can be on a
-year, month, day, hour or minute. When the timestamp contains a time range
-like @samp{15:30-16:30}, modifying the first time will also shift the second,
-shifting the time block with constant length. To change the length, modify
-the second time. Note that if the cursor is in a headline and not at a
-timestamp, these same keys modify the priority of an item.
-(@pxref{Priorities}). The key bindings also conflict with shift-selection and
-related modes (@pxref{Conflicts}).
-@c
-@orgcmd{C-c C-y,org-evaluate-time-range}
-@cindex evaluate time range
-Evaluate a time range by computing the difference between start and end.
-With a prefix argument, insert result after the time range (in a table: into
-the following column).
-@end table
-
-
-@menu
-* The date/time prompt:: How Org-mode helps you entering date and time
-* Custom time format:: Making dates look different
-@end menu
-
-@node The date/time prompt, Custom time format, Creating timestamps, Creating timestamps
-@subsection The date/time prompt
-@cindex date, reading in minibuffer
-@cindex time, reading in minibuffer
-
-@vindex org-read-date-prefer-future
-When Org-mode prompts for a date/time, the default is shown in default
-date/time format, and the prompt therefore seems to ask for a specific
-format. But it will in fact accept any string containing some date and/or
-time information, and it is really smart about interpreting your input. You
-can, for example, use @kbd{C-y} to paste a (possibly multi-line) string
-copied from an email message. Org-mode will find whatever information is in
-there and derive anything you have not specified from the @emph{default date
-and time}. The default is usually the current date and time, but when
-modifying an existing timestamp, or when entering the second stamp of a
-range, it is taken from the stamp in the buffer. When filling in
-information, Org-mode assumes that most of the time you will want to enter a
-date in the future: if you omit the month/year and the given day/month is
-@i{before} today, it will assume that you mean a future date@footnote{See the
-variable @code{org-read-date-prefer-future}. You may set that variable to
-the symbol @code{time} to even make a time before now shift the date to
-tomorrow.}. If the date has been automatically shifted into the future, the
-time prompt will show this with @samp{(=>F).}
-
-For example, let's assume that today is @b{June 13, 2006}. Here is how
-various inputs will be interpreted, the items filled in by Org-mode are
-in @b{bold}.
-
-@example
-3-2-5 --> 2003-02-05
-2/5/3 --> 2003-02-05
-14 --> @b{2006}-@b{06}-14
-12 --> @b{2006}-@b{07}-12
-2/5 --> @b{2007}-02-05
-Fri --> nearest Friday (default date or later)
-sep 15 --> @b{2006}-09-15
-feb 15 --> @b{2007}-02-15
-sep 12 9 --> 2009-09-12
-12:45 --> @b{2006}-@b{06}-@b{13} 12:45
-22 sept 0:34 --> @b{2006}-09-22 0:34
-w4 --> ISO week for of the current year @b{2006}
-2012 w4 fri --> Friday of ISO week 4 in 2012
-2012-w04-5 --> Same as above
-@end example
-
-Furthermore you can specify a relative date by giving, as the
-@emph{first} thing in the input: a plus/minus sign, a number and a
-letter ([dwmy]) to indicate change in days, weeks, months, or years. With a
-single plus or minus, the date is always relative to today. With a
-double plus or minus, it is relative to the default date. If instead of
-a single letter, you use the abbreviation of day name, the date will be
-the Nth such day. E.g.
-
-@example
-+0 --> today
-. --> today
-+4d --> four days from today
-+4 --> same as above
-+2w --> two weeks from today
-++5 --> five days from default date
-+2tue --> second Tuesday from now.
-@end example
-
-@vindex parse-time-months
-@vindex parse-time-weekdays
-The function understands English month and weekday abbreviations. If
-you want to use unabbreviated names and/or other languages, configure
-the variables @code{parse-time-months} and @code{parse-time-weekdays}.
-
-You can specify a time range by giving start and end times or by giving a
-start time and a duration (in HH:MM format). Use `-' or `-@{@}-' as the separator
-in the former case and use '+' as the separator in the latter case. E.g.
-
-@example
-11am-1:15pm --> 11:00-13:15
-11am--1:15pm --> same as above
-11am+2:15 --> same as above
-@end example
-
-@cindex calendar, for selecting date
-@vindex org-popup-calendar-for-date-prompt
-Parallel to the minibuffer prompt, a calendar is popped up@footnote{If
-you don't need/want the calendar, configure the variable
-@code{org-popup-calendar-for-date-prompt}.}. When you exit the date
-prompt, either by clicking on a date in the calendar, or by pressing
-@key{RET}, the date selected in the calendar will be combined with the
-information entered at the prompt. You can control the calendar fully
-from the minibuffer:
-
-@kindex <
-@kindex >
-@kindex M-v
-@kindex C-v
-@kindex mouse-1
-@kindex S-@key{right}
-@kindex S-@key{left}
-@kindex S-@key{down}
-@kindex S-@key{up}
-@kindex M-S-@key{right}
-@kindex M-S-@key{left}
-@kindex @key{RET}
-@example
-@key{RET} @r{Choose date at cursor in calendar.}
-mouse-1 @r{Select date by clicking on it.}
-S-@key{right}/@key{left} @r{One day forward/backward.}
-S-@key{down}/@key{up} @r{One week forward/backward.}
-M-S-@key{right}/@key{left} @r{One month forward/backward.}
-> / < @r{Scroll calendar forward/backward by one month.}
-M-v / C-v @r{Scroll calendar forward/backward by 3 months.}
-@end example
-
-@vindex org-read-date-display-live
-The actions of the date/time prompt may seem complex, but I assure you they
-will grow on you, and you will start getting annoyed by pretty much any other
-way of entering a date/time out there. To help you understand what is going
-on, the current interpretation of your input will be displayed live in the
-minibuffer@footnote{If you find this distracting, turn the display of with
-@code{org-read-date-display-live}.}.
-
-@node Custom time format, , The date/time prompt, Creating timestamps
-@subsection Custom time format
-@cindex custom date/time format
-@cindex time format, custom
-@cindex date format, custom
-
-@vindex org-display-custom-times
-@vindex org-time-stamp-custom-formats
-Org-mode uses the standard ISO notation for dates and times as it is
-defined in ISO 8601. If you cannot get used to this and require another
-representation of date and time to keep you happy, you can get it by
-customizing the variables @code{org-display-custom-times} and
-@code{org-time-stamp-custom-formats}.
-
-@table @kbd
-@orgcmd{C-c C-x C-t,org-toggle-time-stamp-overlays}
-Toggle the display of custom formats for dates and times.
-@end table
-
-@noindent
-Org-mode needs the default format for scanning, so the custom date/time
-format does not @emph{replace} the default format---instead it is put
-@emph{over} the default format using text properties. This has the
-following consequences:
-@itemize @bullet
-@item
-You cannot place the cursor onto a timestamp anymore, only before or
-after.
-@item
-The @kbd{S-@key{up}/@key{down}} keys can no longer be used to adjust
-each component of a timestamp. If the cursor is at the beginning of
-the stamp, @kbd{S-@key{up}/@key{down}} will change the stamp by one day,
-just like @kbd{S-@key{left}/@key{right}}. At the end of the stamp, the
-time will be changed by one minute.
-@item
-If the timestamp contains a range of clock times or a repeater, these
-will not be overlaid, but remain in the buffer as they were.
-@item
-When you delete a timestamp character-by-character, it will only
-disappear from the buffer after @emph{all} (invisible) characters
-belonging to the ISO timestamp have been removed.
-@item
-If the custom timestamp format is longer than the default and you are
-using dates in tables, table alignment will be messed up. If the custom
-format is shorter, things do work as expected.
-@end itemize
-
-
-@node Deadlines and scheduling, Clocking work time, Creating timestamps, Dates and Times
-@section Deadlines and scheduling
-
-A timestamp may be preceded by special keywords to facilitate planning:
-
-@table @var
-@item DEADLINE
-@cindex DEADLINE keyword
-
-Meaning: the task (most likely a TODO item, though not necessarily) is supposed
-to be finished on that date.
-
-@vindex org-deadline-warning-days
-On the deadline date, the task will be listed in the agenda. In
-addition, the agenda for @emph{today} will carry a warning about the
-approaching or missed deadline, starting
-@code{org-deadline-warning-days} before the due date, and continuing
-until the entry is marked DONE. An example:
-
-@example
-*** TODO write article about the Earth for the Guide
- The editor in charge is [[bbdb:Ford Prefect]]
- DEADLINE: <2004-02-29 Sun>
-@end example
-
-You can specify a different lead time for warnings for a specific
-deadlines using the following syntax. Here is an example with a warning
-period of 5 days @code{DEADLINE: <2004-02-29 Sun -5d>}.
-
-@item SCHEDULED
-@cindex SCHEDULED keyword
-
-Meaning: you are planning to start working on that task on the given
-date.
-
-@vindex org-agenda-skip-scheduled-if-done
-The headline will be listed under the given date@footnote{It will still
-be listed on that date after it has been marked DONE. If you don't like
-this, set the variable @code{org-agenda-skip-scheduled-if-done}.}. In
-addition, a reminder that the scheduled date has passed will be present
-in the compilation for @emph{today}, until the entry is marked DONE, i.e.
-the task will automatically be forwarded until completed.
-
-@example
-*** TODO Call Trillian for a date on New Years Eve.
- SCHEDULED: <2004-12-25 Sat>
-@end example
-
-@noindent
-@b{Important:} Scheduling an item in Org-mode should @i{not} be
-understood in the same way that we understand @i{scheduling a meeting}.
-Setting a date for a meeting is just a simple appointment, you should
-mark this entry with a simple plain timestamp, to get this item shown
-on the date where it applies. This is a frequent misunderstanding by
-Org users. In Org-mode, @i{scheduling} means setting a date when you
-want to start working on an action item.
-@end table
-
-You may use timestamps with repeaters in scheduling and deadline
-entries. Org-mode will issue early and late warnings based on the
-assumption that the timestamp represents the @i{nearest instance} of
-the repeater. However, the use of diary sexp entries like
-@c
-@code{<%%(diary-float t 42)>}
-@c
-in scheduling and deadline timestamps is limited. Org-mode does not
-know enough about the internals of each sexp function to issue early and
-late warnings. However, it will show the item on each day where the
-sexp entry matches.
-
-@menu
-* Inserting deadline/schedule:: Planning items
-* Repeated tasks:: Items that show up again and again
-@end menu
-
-@node Inserting deadline/schedule, Repeated tasks, Deadlines and scheduling, Deadlines and scheduling
-@subsection Inserting deadlines or schedules
-
-The following commands allow you to quickly insert a deadline or to schedule
-an item:
-
-@table @kbd
-@c
-@orgcmd{C-c C-d,org-deadline}
-Insert @samp{DEADLINE} keyword along with a stamp. The insertion will happen
-in the line directly following the headline. When called with a prefix arg,
-an existing deadline will be removed from the entry. Depending on the
-variable @code{org-log-redeadline}@footnote{with corresponding
-@code{#+STARTUP} keywords @code{logredeadline}, @code{lognoteredeadline},
-and @code{nologredeadline}}, a note will be taken when changing an existing
-deadline.
-@c FIXME Any CLOSED timestamp will be removed.????????
-@c
-@orgcmd{C-c C-s,org-schedule}
-Insert @samp{SCHEDULED} keyword along with a stamp. The insertion will
-happen in the line directly following the headline. Any CLOSED timestamp
-will be removed. When called with a prefix argument, remove the scheduling
-date from the entry. Depending on the variable
-@code{org-log-reschedule}@footnote{with corresponding @code{#+STARTUP}
-keywords @code{logredeadline}, @code{lognoteredeadline}, and
-@code{nologredeadline}}, a note will be taken when changing an existing
-scheduling time.
-@c
-@orgcmd{C-c C-x C-k,org-mark-entry-for-agenda-action}
-@kindex k a
-@kindex k s
-Mark the current entry for agenda action. After you have marked the entry
-like this, you can open the agenda or the calendar to find an appropriate
-date. With the cursor on the selected date, press @kbd{k s} or @kbd{k d} to
-schedule the marked item.
-@c
-@orgcmd{C-c / d,org-check-deadlines}
-@cindex sparse tree, for deadlines
-@vindex org-deadline-warning-days
-Create a sparse tree with all deadlines that are either past-due, or
-which will become due within @code{org-deadline-warning-days}.
-With @kbd{C-u} prefix, show all deadlines in the file. With a numeric
-prefix, check that many days. For example, @kbd{C-1 C-c / d} shows
-all deadlines due tomorrow.
-@c
-@orgcmd{C-c / b,org-check-before-date}
-Sparse tree for deadlines and scheduled items before a given date.
-@c
-@orgcmd{C-c / a,org-check-after-date}
-Sparse tree for deadlines and scheduled items after a given date.
-@end table
-
-@node Repeated tasks, , Inserting deadline/schedule, Deadlines and scheduling
-@subsection Repeated tasks
-@cindex tasks, repeated
-@cindex repeated tasks
-
-Some tasks need to be repeated again and again. Org-mode helps to
-organize such tasks using a so-called repeater in a DEADLINE, SCHEDULED,
-or plain timestamp. In the following example
-@example
-** TODO Pay the rent
- DEADLINE: <2005-10-01 Sat +1m>
-@end example
-@noindent
-the @code{+1m} is a repeater; the intended interpretation is that the task
-has a deadline on <2005-10-01> and repeats itself every (one) month starting
-from that time. If you need both a repeater and a special warning period in
-a deadline entry, the repeater should come first and the warning period last:
-@code{DEADLINE: <2005-10-01 Sat +1m -3d>}.
-
-@vindex org-todo-repeat-to-state
-Deadlines and scheduled items produce entries in the agenda when they are
-over-due, so it is important to be able to mark such an entry as completed
-once you have done so. When you mark a DEADLINE or a SCHEDULE with the TODO
-keyword DONE, it will no longer produce entries in the agenda. The problem
-with this is, however, that then also the @emph{next} instance of the
-repeated entry will not be active. Org-mode deals with this in the following
-way: When you try to mark such an entry DONE (using @kbd{C-c C-t}), it will
-shift the base date of the repeating timestamp by the repeater interval, and
-immediately set the entry state back to TODO@footnote{In fact, the target
-state is taken from, in this sequence, the @code{REPEAT_TO_STATE} property or
-the variable @code{org-todo-repeat-to-state}. If neither of these is
-specified, the target state defaults to the first state of the TODO state
-sequence.}. In the example above, setting the state to DONE would actually
-switch the date like this:
-
-@example
-** TODO Pay the rent
- DEADLINE: <2005-11-01 Tue +1m>
-@end example
-
-@vindex org-log-repeat
-A timestamp@footnote{You can change this using the option
-@code{org-log-repeat}, or the @code{#+STARTUP} options @code{logrepeat},
-@code{lognoterepeat}, and @code{nologrepeat}. With @code{lognoterepeat}, you
-will also be prompted for a note.} will be added under the deadline, to keep
-a record that you actually acted on the previous instance of this deadline.
-
-As a consequence of shifting the base date, this entry will no longer be
-visible in the agenda when checking past dates, but all future instances
-will be visible.
-
-With the @samp{+1m} cookie, the date shift will always be exactly one
-month. So if you have not paid the rent for three months, marking this
-entry DONE will still keep it as an overdue deadline. Depending on the
-task, this may not be the best way to handle it. For example, if you
-forgot to call your father for 3 weeks, it does not make sense to call
-him 3 times in a single day to make up for it. Finally, there are tasks
-like changing batteries which should always repeat a certain time
-@i{after} the last time you did it. For these tasks, Org-mode has
-special repeaters @samp{++} and @samp{.+}. For example:
-
-@example
-** TODO Call Father
- DEADLINE: <2008-02-10 Sun ++1w>
- Marking this DONE will shift the date by at least one week,
- but also by as many weeks as it takes to get this date into
- the future. However, it stays on a Sunday, even if you called
- and marked it done on Saturday.
-** TODO Check the batteries in the smoke detectors
- DEADLINE: <2005-11-01 Tue .+1m>
- Marking this DONE will shift the date to one month after
- today.
-@end example
-
-You may have both scheduling and deadline information for a specific
-task---just make sure that the repeater intervals on both are the same.
-
-An alternative to using a repeater is to create a number of copies of a task
-subtree, with dates shifted in each copy. The command @kbd{C-c C-x c} was
-created for this purpose, it is described in @ref{Structure editing}.
-
-
-@node Clocking work time, Effort estimates, Deadlines and scheduling, Dates and Times
-@section Clocking work time
-@cindex clocking time
-@cindex time clocking
-
-Org-mode allows you to clock the time you spend on specific tasks in a
-project. When you start working on an item, you can start the clock.
-When you stop working on that task, or when you mark the task done, the
-clock is stopped and the corresponding time interval is recorded. It
-also computes the total time spent on each subtree of a project. And it
-remembers a history or tasks recently clocked, to that you can jump quickly
-between a number of tasks absorbing your time.
-
-To save the clock history across Emacs sessions, use
-@lisp
-(setq org-clock-persist 'history)
-(org-clock-persistence-insinuate)
-@end lisp
-When you clock into a new task after resuming Emacs, the incomplete
-clock@footnote{To resume the clock under the assumption that you have worked
-on this task while outside Emacs, use @code{(setq org-clock-persist t)}.}
-will be found (@pxref{Resolving idle time}) and you will be prompted about
-what to do with it.
-
-@menu
-* Clocking commands:: Starting and stopping a clock
-* The clock table:: Detailed reports
-* Resolving idle time:: Resolving time when you've been idle
-@end menu
-
-@node Clocking commands, The clock table, Clocking work time, Clocking work time
-@subsection Clocking commands
-
-@table @kbd
-@orgcmd{C-c C-x C-i,org-clock-in}
-@vindex org-clock-into-drawer
-Start the clock on the current item (clock-in). This inserts the CLOCK
-keyword together with a timestamp. If this is not the first clocking of
-this item, the multiple CLOCK lines will be wrapped into a
-@code{:LOGBOOK:} drawer (see also the variable
-@code{org-clock-into-drawer}). When called with a @kbd{C-u} prefix argument,
-select the task from a list of recently clocked tasks. With two @kbd{C-u
-C-u} prefixes, clock into the task at point and mark it as the default task.
-The default task will always be available when selecting a clocking task,
-with letter @kbd{d}.@*
-@cindex property: CLOCK_MODELINE_TOTAL
-@cindex property: LAST_REPEAT
-@vindex org-clock-modeline-total
-While the clock is running, the current clocking time is shown in the mode
-line, along with the title of the task. The clock time shown will be all
-time ever clocked for this task and its children. If the task has an effort
-estimate (@pxref{Effort estimates}), the mode line displays the current
-clocking time against it@footnote{To add an effort estimate ``on the fly'',
-hook a function doing this to @code{org-clock-in-prepare-hook}.} If the task
-is a repeating one (@pxref{Repeated tasks}), only the time since the last
-reset of the task @footnote{as recorded by the @code{LAST_REPEAT} property}
-will be shown. More control over what time is shown can be exercised with
-the @code{CLOCK_MODELINE_TOTAL} property. It may have the values
-@code{current} to show only the current clocking instance, @code{today} to
-show all time clocked on this tasks today (see also the variable
-@code{org-extend-today-until}), @code{all} to include all time, or
-@code{auto} which is the default@footnote{See also the variable
-@code{org-clock-modeline-total}.}.@* Clicking with @kbd{mouse-1} onto the
-mode line entry will pop up a menu with clocking options.
-@c
-@orgcmd{C-c C-x C-o,org-clock-out}
-@vindex org-log-note-clock-out
-Stop the clock (clock-out). This inserts another timestamp at the same
-location where the clock was last started. It also directly computes
-the resulting time in inserts it after the time range as @samp{=>
-HH:MM}. See the variable @code{org-log-note-clock-out} for the
-possibility to record an additional note together with the clock-out
-timestamp@footnote{The corresponding in-buffer setting is:
-@code{#+STARTUP: lognoteclock-out}}.
-@orgcmd{C-c C-x C-e,org-clock-modify-effort-estimate}
-Update the effort estimate for the current clock task.
-@kindex C-c C-y
-@kindex C-c C-c
-@orgcmdkkc{C-c C-c,C-c C-y,org-evaluate-time-range}
-Recompute the time interval after changing one of the timestamps. This
-is only necessary if you edit the timestamps directly. If you change
-them with @kbd{S-@key{cursor}} keys, the update is automatic.
-@orgcmd{C-c C-t,org-todo}
-Changing the TODO state of an item to DONE automatically stops the clock
-if it is running in this same item.
-@orgcmd{C-c C-x C-x,org-clock-cancel}
-Cancel the current clock. This is useful if a clock was started by
-mistake, or if you ended up working on something else.
-@orgcmd{C-c C-x C-j,org-clock-goto}
-Jump to the headline of the currently clocked in task. With a @kbd{C-u}
-prefix arg, select the target task from a list of recently clocked tasks.
-@orgcmd{C-c C-x C-d,org-clock-display}
-@vindex org-remove-highlights-with-change
-Display time summaries for each subtree in the current buffer. This
-puts overlays at the end of each headline, showing the total time
-recorded under that heading, including the time of any subheadings. You
-can use visibility cycling to study the tree, but the overlays disappear
-when you change the buffer (see variable
-@code{org-remove-highlights-with-change}) or press @kbd{C-c C-c}.
-@end table
-
-The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
-the agenda (@pxref{Weekly/daily agenda}) to show which tasks have been
-worked on or closed during a day.
-
-@node The clock table, Resolving idle time, Clocking commands, Clocking work time
-@subsection The clock table
-@cindex clocktable, dynamic block
-@cindex report, of clocked time
-
-Org mode can produce quite complex reports based on the time clocking
-information. Such a report is called a @emph{clock table}, because it is
-formatted as one or several Org tables.
-
-@table @kbd
-@orgcmd{C-c C-x C-r,org-clock-report}
-Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock
-report as an Org-mode table into the current file. When the cursor is
-at an existing clock table, just update it. When called with a prefix
-argument, jump to the first clock report in the current document and
-update it.
-@orgcmdkkc{C-c C-c,C-c C-x C-u,org-dblock-update}
-Update dynamic block at point. The cursor needs to be in the
-@code{#+BEGIN} line of the dynamic block.
-@orgkey{C-u C-c C-x C-u}
-Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
-you have several clock table blocks in a buffer.
-@orgcmdkxkc{S-@key{left},S-@key{right},org-clocktable-try-shift}
-Shift the current @code{:block} interval and update the table. The cursor
-needs to be in the @code{#+BEGIN: clocktable} line for this command. If
-@code{:block} is @code{today}, it will be shifted to @code{today-1} etc.
-@end table
-
-
-Here is an example of the frame for a clock table as it is inserted into the
-buffer with the @kbd{C-c C-x C-r} command:
-
-@cindex #+BEGIN, clocktable
-@example
-#+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file
-#+END: clocktable
-@end example
-@noindent
-@vindex org-clocktable-defaults
-The @samp{BEGIN} line and specify a number of options to define the scope,
-structure, and formatting of the report. Defaults for all these options can
-be configured in the variable @code{org-clocktable-defaults}.
-
-@noindent First there are options that determine which clock entries are to
-be selected:
-@example
-:maxlevel @r{Maximum level depth to which times are listed in the table.}
- @r{Clocks at deeper levels will be summed into the upper level.}
-:scope @r{The scope to consider. This can be any of the following:}
- nil @r{the current buffer or narrowed region}
- file @r{the full current buffer}
- subtree @r{the subtree where the clocktable is located}
- tree@var{N} @r{the surrounding level @var{N} tree, for example @code{tree3}}
- tree @r{the surrounding level 1 tree}
- agenda @r{all agenda files}
- ("file"..) @r{scan these files}
- file-with-archives @r{current file and its archives}
- agenda-with-archives @r{all agenda files, including archives}
-:block @r{The time block to consider. This block is specified either}
- @r{absolute, or relative to the current time and may be any of}
- @r{these formats:}
- 2007-12-31 @r{New year eve 2007}
- 2007-12 @r{December 2007}
- 2007-W50 @r{ISO-week 50 in 2007}
- 2007-Q2 @r{2nd quarter in 2007}
- 2007 @r{the year 2007}
- today, yesterday, today-@var{N} @r{a relative day}
- thisweek, lastweek, thisweek-@var{N} @r{a relative week}
- thismonth, lastmonth, thismonth-@var{N} @r{a relative month}
- thisyear, lastyear, thisyear-@var{N} @r{a relative year}
- @r{Use @kbd{S-@key{left}/@key{right}} keys to shift the time interval.}
-:tstart @r{A time string specifying when to start considering times.}
-:tend @r{A time string specifying when to stop considering times.}
-:step @r{@code{week} or @code{day}, to split the table into chunks.}
- @r{To use this, @code{:block} or @code{:tstart}, @code{:tend} are needed.}
-:stepskip0 @r{Do not show steps that have zero time.}
-:fileskip0 @r{Do not show table sections from files which did not contribute.}
-:tags @r{A tags match to select entries that should contribute}.
-@end example
-
-Then there are options which determine the formatting of the table. There
-options are interpreted by the function @code{org-clocktable-write-default},
-but you can specify your own function using the @code{:formatter} parameter.
-@example
-:emphasize @r{When @code{t}, emphasize level one and level two items.}
-:link @r{Link the item headlines in the table to their origins.}
-:narrow @r{An integer to limit the width of the headline column in}
- @r{the org table. If you write it like @samp{50!}, then the}
- @r{headline will also be shortened in export.}
-:indent @r{Indent each headline field according to its level.}
-:tcolumns @r{Number of columns to be used for times. If this is smaller}
- @r{than @code{:maxlevel}, lower levels will be lumped into one column.}
-:level @r{Should a level number column be included?}
-:compact @r{Abbreviation for @code{:level nil :indent t :narrow 40! :tcolumns 1}}
- @r{All are overwritten except if there is an explicit @code{:narrow}}
-:timestamp @r{A timestamp for the entry, when available. Look for SCHEDULED,}
- @r{DEADLINE, TIMESTAMP and TIMESTAMP_IA, in this order.}
-:formula @r{Content of a @code{#+TBLFM} line to be added and evaluated.}
- @r{As a special case, @samp{:formula %} adds a column with % time.}
- @r{If you do not specify a formula here, any existing formula}
- @r{below the clock table will survive updates and be evaluated.}
-:formatter @r{A function to format clock data and insert it into the buffer.}
-@end example
-To get a clock summary of the current level 1 tree, for the current
-day, you could write
-@example
-#+BEGIN: clocktable :maxlevel 2 :block today :scope tree1 :link t
-#+END: clocktable
-@end example
-@noindent
-and to use a specific time range you could write@footnote{Note that all
-parameters must be specified in a single line---the line is broken here
-only to fit it into the manual.}
-@example
-#+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>"
- :tend "<2006-08-10 Thu 12:00>"
-#+END: clocktable
-@end example
-A summary of the current subtree with % times would be
-@example
-#+BEGIN: clocktable :scope subtree :link t :formula %
-#+END: clocktable
-@end example
-A horizontally compact representation of everything clocked during last week
-would be
-@example
-#+BEGIN: clocktable :scope agenda :block lastweek :compact t
-#+END: clocktable
-@end example
-
-@node Resolving idle time, , The clock table, Clocking work time
-@subsection Resolving idle time
-@cindex resolve idle time
-
-@cindex idle, resolve, dangling
-If you clock in on a work item, and then walk away from your
-computer---perhaps to take a phone call---you often need to ``resolve'' the
-time you were away by either subtracting it from the current clock, or
-applying it to another one.
-
-@vindex org-clock-idle-time
-By customizing the variable @code{org-clock-idle-time} to some integer, such
-as 10 or 15, Emacs can alert you when you get back to your computer after
-being idle for that many minutes@footnote{On computers using Mac OS X,
-idleness is based on actual user idleness, not just Emacs' idle time. For
-X11, you can install a utility program @file{x11idle.c}, available in the
-UTILITIES directory of the Org git distribution, to get the same general
-treatment of idleness. On other systems, idle time refers to Emacs idle time
-only.}, and ask what you want to do with the idle time. There will be a
-question waiting for you when you get back, indicating how much idle time has
-passed (constantly updated with the current amount), as well as a set of
-choices to correct the discrepancy:
-
-@table @kbd
-@item k
-To keep some or all of the minutes and stay clocked in, press @kbd{k}. Org
-will ask how many of the minutes to keep. Press @key{RET} to keep them all,
-effectively changing nothing, or enter a number to keep that many minutes.
-@item K
-If you use the shift key and press @kbd{K}, it will keep however many minutes
-you request and then immediately clock out of that task. If you keep all of
-the minutes, this is the same as just clocking out of the current task.
-@item s
-To keep none of the minutes, use @kbd{s} to subtract all the away time from
-the clock, and then check back in from the moment you returned.
-@item S
-To keep none of the minutes and just clock out at the start of the away time,
-use the shift key and press @kbd{S}. Remember that using shift will always
-leave you clocked out, no matter which option you choose.
-@item C
-To cancel the clock altogether, use @kbd{C}. Note that if instead of
-canceling you subtract the away time, and the resulting clock amount is less
-than a minute, the clock will still be canceled rather than clutter up the
-log with an empty entry.
-@end table
-
-What if you subtracted those away minutes from the current clock, and now
-want to apply them to a new clock? Simply clock in to any task immediately
-after the subtraction. Org will notice that you have subtracted time ``on
-the books'', so to speak, and will ask if you want to apply those minutes to
-the next task you clock in on.
-
-There is one other instance when this clock resolution magic occurs. Say you
-were clocked in and hacking away, and suddenly your cat chased a mouse who
-scared a hamster that crashed into your UPS's power button! You suddenly
-lose all your buffers, but thanks to auto-save you still have your recent Org
-mode changes, including your last clock in.
-
-If you restart Emacs and clock into any task, Org will notice that you have a
-dangling clock which was never clocked out from your last session. Using
-that clock's starting time as the beginning of the unaccounted-for period,
-Org will ask how you want to resolve that time. The logic and behavior is
-identical to dealing with away time due to idleness; it's just happening due
-to a recovery event rather than a set amount of idle time.
-
-You can also check all the files visited by your Org agenda for dangling
-clocks at any time using @kbd{M-x org-resolve-clocks}.
-
-@node Effort estimates, Relative timer, Clocking work time, Dates and Times
-@section Effort estimates
-@cindex effort estimates
-
-@cindex property, Effort
-@vindex org-effort-property
-If you want to plan your work in a very detailed way, or if you need to
-produce offers with quotations of the estimated work effort, you may want to
-assign effort estimates to entries. If you are also clocking your work, you
-may later want to compare the planned effort with the actual working time, a
-great way to improve planning estimates. Effort estimates are stored in a
-special property @samp{Effort}@footnote{You may change the property being
-used with the variable @code{org-effort-property}.}. You can set the effort
-for an entry with the following commands:
-
-@table @kbd
-@orgcmd{C-c C-x e,org-set-effort}
-Set the effort estimate for the current entry. With a numeric prefix
-argument, set it to the Nth allowed value (see below). This command is also
-accessible from the agenda with the @kbd{e} key.
-@orgcmd{C-c C-x C-e,org-clock-modify-effort-estimate}
-Modify the effort estimate of the item currently being clocked.
-@end table
-
-Clearly the best way to work with effort estimates is through column view
-(@pxref{Column view}). You should start by setting up discrete values for
-effort estimates, and a @code{COLUMNS} format that displays these values
-together with clock sums (if you want to clock your time). For a specific
-buffer you can use
-
-@example
-#+PROPERTY: Effort_ALL 0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00 8:00
-#+COLUMNS: %40ITEM(Task) %17Effort(Estimated Effort)@{:@} %CLOCKSUM
-@end example
-
-@noindent
-@vindex org-global-properties
-@vindex org-columns-default-format
-or, even better, you can set up these values globally by customizing the
-variables @code{org-global-properties} and @code{org-columns-default-format}.
-In particular if you want to use this setup also in the agenda, a global
-setup may be advised.
-
-The way to assign estimates to individual items is then to switch to column
-mode, and to use @kbd{S-@key{right}} and @kbd{S-@key{left}} to change the
-value. The values you enter will immediately be summed up in the hierarchy.
-In the column next to it, any clocked time will be displayed.
-
-@vindex org-agenda-columns-add-appointments-to-effort-sum
-If you switch to column view in the daily/weekly agenda, the effort column
-will summarize the estimated work effort for each day@footnote{Please note
-the pitfalls of summing hierarchical data in a flat list (@pxref{Agenda
-column view}).}, and you can use this to find space in your schedule. To get
-an overview of the entire part of the day that is committed, you can set the
-option @code{org-agenda-columns-add-appointments-to-effort-sum}. The
-appointments on a day that take place over a specified time interval will
-then also be added to the load estimate of the day.
-
-Effort estimates can be used in secondary agenda filtering that is triggered
-with the @kbd{/} key in the agenda (@pxref{Agenda commands}). If you have
-these estimates defined consistently, two or three key presses will narrow
-down the list to stuff that fits into an available time slot.
-
-@node Relative timer, Countdown timer, Effort estimates, Dates and Times
-@section Taking notes with a relative timer
-@cindex relative timer
-
-When taking notes during, for example, a meeting or a video viewing, it can
-be useful to have access to times relative to a starting time. Org provides
-such a relative timer and make it easy to create timed notes.
-
-@table @kbd
-@orgcmd{C-c C-x .,org-timer}
-Insert a relative time into the buffer. The first time you use this, the
-timer will be started. When called with a prefix argument, the timer is
-restarted.
-@orgcmd{C-c C-x -,org-timer-item}
-Insert a description list item with the current relative time. With a prefix
-argument, first reset the timer to 0.
-@orgcmd{M-@key{RET},org-insert-heading}
-Once the timer list is started, you can also use @kbd{M-@key{RET}} to insert
-new timer items.
-@c for key sequences with a comma, command name macros fail :(
-@kindex C-c C-x ,
-@item C-c C-x ,
-Pause the timer, or continue it if it is already paused
-(@command{org-timer-pause-or-continue}).
-@c removed the sentence because it is redundant to the following item
-@kindex C-u C-c C-x ,
-@item C-u C-c C-x ,
-Stop the timer. After this, you can only start a new timer, not continue the
-old one. This command also removes the timer from the mode line.
-@orgcmd{C-c C-x 0,org-timer-start}
-Reset the timer without inserting anything into the buffer. By default, the
-timer is reset to 0. When called with a @kbd{C-u} prefix, reset the timer to
-specific starting offset. The user is prompted for the offset, with a
-default taken from a timer string at point, if any, So this can be used to
-restart taking notes after a break in the process. When called with a double
-prefix argument @kbd{C-u C-u}, change all timer strings in the active region
-by a certain amount. This can be used to fix timer strings if the timer was
-not started at exactly the right moment.
-@end table
-
-@node Countdown timer, , Relative timer, Dates and Times
-@section Countdown timer
-@cindex Countdown timer
-@kindex C-c C-x ;
-@kindex ;
-
-Calling @code{org-timer-set-timer} from an Org-mode buffer runs a countdown
-timer. Use @key{;} from agenda buffers, @key{C-c C-x ;} everwhere else.
-
-@code{org-timer-set-timer} prompts the user for a duration and displays a
-countdown timer in the modeline. @code{org-timer-default-timer} sets the
-default countdown value. Giving a prefix numeric argument overrides this
-default value.
-
-@node Capture - Refile - Archive, Agenda Views, Dates and Times, Top
-@chapter Capture - Refile - Archive
-@cindex capture
-
-An important part of any organization system is the ability to quickly
-capture new ideas and tasks, and to associate reference material with them.
-Org does this using a process called @i{capture}. It also can store files
-related to a task (@i{attachments}) in a special directory. Once in the
-system, tasks and projects need to be moved around. Moving completed project
-trees to an archive file keeps the system compact and fast.
-
-@menu
-* Capture:: Capturing new stuff
-* Attachments:: Add files to tasks
-* RSS Feeds:: Getting input from RSS feeds
-* Protocols:: External (e.g. Browser) access to Emacs and Org
-* Refiling notes:: Moving a tree from one place to another
-* Archiving:: What to do with finished projects
-@end menu
-
-@node Capture, Attachments, Capture - Refile - Archive, Capture - Refile - Archive
-@section Capture
-@cindex capture
-
-Org's method for capturing new items is heavily inspired by John Wiegley
-excellent remember package. Up to version 6.36 Org used a special setup
-for @file{remember.el}. @file{org-remember.el} is still part of Org-mode for
-backward compatibility with existing setups. You can find the documentation
-for org-remember at @url{http://orgmode.org/org-remember.pdf}.
-
-The new capturing setup described here is preferred and should be used by new
-users. To convert your @code{org-remember-templates}, run the command
-@example
-@kbd{M-x org-capture-import-remember-templates @key{RET}}
-@end example
-@noindent and then customize the new variable with @kbd{M-x
-customize-variable org-capture-templates}, check the result, and save the
-customization. You can then use both remember and capture until
-you are familiar with the new mechanism.
-
-Capture lets you quickly store notes with little interruption of your work
-flow. The basic process of capturing is very similar to remember, but Org
-does enhance it with templates and more.
-
-@menu
-* Setting up capture:: Where notes will be stored
-* Using capture:: Commands to invoke and terminate capture
-* Capture templates:: Define the outline of different note types
-@end menu
-
-@node Setting up capture, Using capture, Capture, Capture
-@subsection Setting up capture
-
-The following customization sets a default target file for notes, and defines
-a global key@footnote{Please select your own key, @kbd{C-c c} is only a
-suggestion.} for capturing new material.
-
-@vindex org-default-notes-file
-@example
-(setq org-default-notes-file (concat org-directory "/notes.org"))
-(define-key global-map "\C-cc" 'org-capture)
-@end example
-
-@node Using capture, Capture templates, Setting up capture, Capture
-@subsection Using capture
-
-@table @kbd
-@orgcmd{C-c c,org-capture}
-Call the command @code{org-capture}. Note that this keybinding is global and
-not active by default - you need to install it. If you have templates
-defined @pxref{Capture templates}, it will offer these templates for
-selection or use a new Org outline node as the default template. It will
-insert the template into the target file and switch to an indirect buffer
-narrowed to this new node. You may then insert the information you want.
-
-@orgcmd{C-c C-c,org-capture-finalize}
-Once you have finished entering information into the capture buffer, @kbd{C-c
-C-c} will return you to the window configuration before the capture process,
-so that you can resume your work without further distraction. When called
-with a prefix arg, finalize and then jump to the captured item.
-
-@orgcmd{C-c C-w,org-capture-refile}
-Finalize the capture process by refiling (@pxref{Refiling notes}) the note to
-a different place. Please realize that this is a normal refiling command
-that will be executed---so the cursor position at the moment you run this
-command is important. If you have inserted a tree with a parent and
-children, first move the cursor back to the parent. Any prefix argument
-given to this command will be passed on to the @code{org-refile} command.
-
-@orgcmd{C-c C-k,org-capture-kill}
-Abort the capture process and return to the previous state.
-
-@end table
-
-You can also call @code{org-capture} in a special way from the agenda, using
-the @kbd{k c} key combination. With this access, any timestamps inserted by
-the selected capture template will default to the cursor date in the agenda,
-rather than to the current date.
-
-To find the locations of the last stored capture, use @code{org-capture} with
-prefix commands:
-
-@table @kbd
-@orgkey{C-u C-c c}
-Visit the target location of a cpature template. You get to select the
-template in the usual way.
-@orgkey{C-u C-u C-c c}
-Visit the last stored capture item in its buffer.
-@end table
-
-@node Capture templates, , Using capture, Capture
-@subsection Capture templates
-@cindex templates, for Capture
-
-You can use templates for different types of capture items, and
-for different target locations. The easiest way to create such templates is
-through the customize interface.
-
-@table @kbd
-@orgkey{C-c c C}
-Customize the variable @code{org-capture-templates}.
-@end table
-
-Before we give the formal description of template definitions, let's look at
-an example. Say you would like to use one template to create general TODO
-entries, and you want to put these entries under the heading @samp{Tasks} in
-your file @file{~/org/gtd.org}. Also, a date tree in the file
-@file{journal.org} should capture journal entries. A possible configuration
-would look like:
-
-@example
-(setq org-capture-templates
- '(("t" "Todo" entry (file+headline "~/org/gtd.org" "Tasks")
- "* TODO %?\n %i\n %a")
- ("j" "Journal" entry (file+datetree "~/org/journal.org")
- "* %?\nEntered on %U\n %i\n %a")))
-@end example
-
-@noindent If you then press @kbd{C-c c t}, Org will prepare the template
-for you like this:
-@example
-* TODO
- [[file:@var{link to where you initiated capture}]]
-@end example
-
-@noindent
-During expansion of the template, @code{%a} has been replaced by a link to
-the location from where you called the capture command. This can be
-extremely useful for deriving tasks from emails, for example. You fill in
-the task definition, press @code{C-c C-c} and Org returns you to the same
-place where you started the capture process.
-
-
-@menu
-* Template elements:: What is needed for a complete template entry
-* Template expansion:: Filling in information about time and context
-@end menu
-
-@node Template elements, Template expansion, Capture templates, Capture templates
-@subsubsection Template elements
-
-Now lets look at the elements of a template definition. Each entry in
-@code{org-capture-templates} is a list with the following items:
-
-@table @var
-@item keys
-The keys that will select the template, as a string, characters
-only, for example @code{"a"} for a template to be selected with a
-single key, or @code{"bt"} for selection with two keys. When using
-several keys, keys using the same prefix key must be sequential
-in the list and preceded by a 2-element entry explaining the
-prefix key, for example
-@example
- ("b" "Templates for marking stuff to buy")
-@end example
-@noindent If you do not define a template for the @kbd{C} key, this key will
-be used to open the customize buffer for this complex variable.
-
-@item description
-A short string describing the template, which will be shown during
-selection.
-
-@item type
-The type of entry, a symbol. Valid values are:
-@table @code
-@item entry
-An Org-mode node, with a headline. Will be filed as the child of the
-target entry or as a top-level entry. The target file should be an Org-mode
-file.
-@item item
-A plain list item, placed in the first plain list at the target
-location. Again the target file should be an Org file.
-@item checkitem
-A checkbox item. This only differs from the plain list item by the
-default template.
-@item table-line
-a new line in the first table at the target location. Where exactly the
-line will be inserted depends on the properties @code{:prepend} and
-@code{:table-line-pos} (see below).
-@item plain
-Text to be inserted as it is.
-@end table
-
-@item target
-@vindex org-default-notes-file
-Specification of where the captured item should be placed. In Org-mode
-files, targets usually define a node. Entries will become children of this
-node. Other types will be added to the table or list in the body of this
-node. Most target specifications contain a file name. If that file name is
-the empty string, it defaults to @code{org-default-notes-file}.
-
-Valid values are:
-@table @code
-@item (file "path/to/file")
-Text will be placed at the beginning or end of that file.
-
-@item (id "id of existing org entry")
-Filing as child of this entry, or in the body of the entry.
-
-@item (file+headline "path/to/file" "node headline")
-Fast configuration if the target heading is unique in the file.
-
-@item (file+olp "path/to/file" "Level 1 heading" "Level 2" ...)
-For non-unique headings, the full path is safer.
-
-@item (file+regexp "path/to/file" "regexp to find location")
-Use a regular expression to position the cursor.
-
-@item (file+datetree "path/to/file")
-Will create a heading in a date tree for today's date.
-
-@item (file+datetree+prompt "path/to/file")
-Will create a heading in a date tree, but will prompt for the date.
-
-@item (file+function "path/to/file" function-finding-location)
-A function to find the right location in the file.
-
-@item (clock)
-File to the entry that is currently being clocked.
-
-@item (function function-finding-location)
-Most general way, write your own function to find both
-file and location.
-@end table
-
-@item template
-The template for creating the capture item. If you leave this empty, an
-appropriate default template will be used. Otherwise this is a string with
-escape codes, which will be replaced depending on time and context of the
-capture call. The string with escapes may be loaded from a template file,
-using the special syntax @code{(file "path/to/template")}. See below for
-more details.
-
-@item properties
-The rest of the entry is a property list of additional options.
-Recognized properties are:
-@table @code
-@item :prepend
-Normally new captured information will be appended at
-the target location (last child, last table line, last list item...).
-Setting this property will change that.
-
-@item :immediate-finish
-When set, do not offer to edit the information, just
-file it away immediately. This makes sense if the template only needs
-information that can be added automatically.
-
-@item :empty-lines
-Set this to the number of lines to insert
-before and after the new item. Default 0, only common other value is 1.
-
-@item :clock-in
-Start the clock in this item.
-
-@item :clock-resume
-If starting the capture interrupted a clock, restart that clock when finished
-with the capture.
-
-@item :unnarrowed
-Do not narrow the target buffer, simply show the full buffer. Default is to
-narrow it so that you only see the new material.
-
-@item :kill-buffer
-If the target file was not yet visited when capture was invoked, kill the
-buffer again after capture is completed.
-@end table
-@end table
-
-@node Template expansion, , Template elements, Capture templates
-@subsubsection Template expansion
-
-In the template itself, special @kbd{%}-escapes@footnote{If you need one of
-these sequences literally, escape the @kbd{%} with a backslash.} allow
-dynamic insertion of content:
-
-@comment SJE: should these sentences terminate in period?
-@smallexample
-%^@{@var{prompt}@} @r{prompt the user for a string and replace this sequence with it.}
- @r{You may specify a default value and a completion table with}
- @r{%^@{prompt|default|completion2|completion3...@}}
- @r{The arrow keys access a prompt-specific history.}
-%a @r{annotation, normally the link created with @code{org-store-link}}
-%A @r{like @code{%a}, but prompt for the description part}
-%i @r{initial content, the region when capture is called while the}
- @r{region is active.}
- @r{The entire text will be indented like @code{%i} itself.}
-%t @r{timestamp, date only}
-%T @r{timestamp with date and time}
-%u, %U @r{like the above, but inactive timestamps}
-%^t @r{like @code{%t}, but prompt for date. Similarly @code{%^T}, @code{%^u}, @code{%^U}}
- @r{You may define a prompt like @code{%^@{Birthday@}t}}
-%n @r{user name (taken from @code{user-full-name})}
-%c @r{Current kill ring head.}
-%x @r{Content of the X clipboard.}
-%^C @r{Interactive selection of which kill or clip to use.}
-%^L @r{Like @code{%^C}, but insert as link.}
-%k @r{title of the currently clocked task}
-%K @r{link to the currently clocked task}
-%^g @r{prompt for tags, with completion on tags in target file.}
-%^G @r{prompt for tags, with completion all tags in all agenda files.}
-%^@{@var{prop}@}p @r{Prompt the user for a value for property @var{prop}}
-%:keyword @r{specific information for certain link types, see below}
-%[@var{file}] @r{insert the contents of the file given by @var{file}}
-%(@var{sexp}) @r{evaluate Elisp @var{sexp} and replace with the result}
-@end smallexample
-
-@noindent
-For specific link types, the following keywords will be
-defined@footnote{If you define your own link types (@pxref{Adding
-hyperlink types}), any property you store with
-@code{org-store-link-props} can be accessed in capture templates in a
-similar way.}:
-
-@vindex org-from-is-user-regexp
-@smallexample
-Link type | Available keywords
--------------------+----------------------------------------------
-bbdb | %:name %:company
-irc | %:server %:port %:nick
-vm, wl, mh, mew, rmail | %:type %:subject %:message-id
- | %:from %:fromname %:fromaddress
- | %:to %:toname %:toaddress
- | %:date @r{(message date header field)}
- | %:date-timestamp @r{(date as active timestamp)}
- | %:date-timestamp-inactive @r{(date as inactive timestamp)}
- | %:fromto @r{(either "to NAME" or "from NAME")@footnote{This will always be the other, not the user. See the variable @code{org-from-is-user-regexp}.}}
-gnus | %:group, @r{for messages also all email fields}
-w3, w3m | %:url
-info | %:file %:node
-calendar | %:date
-@end smallexample
-
-@noindent
-To place the cursor after template expansion use:
-
-@smallexample
-%? @r{After completing the template, position cursor here.}
-@end smallexample
-
-
-@node Attachments, RSS Feeds, Capture, Capture - Refile - Archive
-@section Attachments
-@cindex attachments
-
-@vindex org-attach-directory
-It is often useful to associate reference material with an outline node/task.
-Small chunks of plain text can simply be stored in the subtree of a project.
-Hyperlinks (@pxref{Hyperlinks}) can establish associations with
-files that live elsewhere on your computer or in the cloud, like emails or
-source code files belonging to a project. Another method is @i{attachments},
-which are files located in a directory belonging to an outline node. Org
-uses directories named by the unique ID of each entry. These directories are
-located in the @file{data} directory which lives in the same directory where
-your Org file lives@footnote{If you move entries or Org files from one
-directory to another, you may want to configure @code{org-attach-directory}
-to contain an absolute path.}. If you initialize this directory with
-@code{git init}, Org will automatically commit changes when it sees them.
-The attachment system has been contributed to Org by John Wiegley.
-
-In cases where it seems better to do so, you can also attach a directory of your
-choice to an entry. You can also make children inherit the attachment
-directory from a parent, so that an entire subtree uses the same attached
-directory.
-
-@noindent The following commands deal with attachments:
-
-@table @kbd
-
-@orgcmd{C-c C-a,org-attach}
-The dispatcher for commands related to the attachment system. After these
-keys, a list of commands is displayed and you must press an additional key
-to select a command:
-
-@table @kbd
-@orgcmdtkc{a,C-c C-a a,org-attach-attach}
-@vindex org-attach-method
-Select a file and move it into the task's attachment directory. The file
-will be copied, moved, or linked, depending on @code{org-attach-method}.
-Note that hard links are not supported on all systems.
-
-@kindex C-c C-a c
-@kindex C-c C-a m
-@kindex C-c C-a l
-@item c/m/l
-Attach a file using the copy/move/link method.
-Note that hard links are not supported on all systems.
-
-@orgcmdtkc{n,C-c C-a n,org-attach-new}
-Create a new attachment as an Emacs buffer.
-
-@orgcmdtkc{z,C-c C-a z,org-attach-sync}
-Synchronize the current task with its attachment directory, in case you added
-attachments yourself.
-
-@orgcmdtkc{p,C-c C-a o,org-attach-open}
-@vindex org-file-apps
-Open current task's attachment. If there is more than one, prompt for a
-file name first. Opening will follow the rules set by @code{org-file-apps}.
-For more details, see the information on following hyperlinks
-(@pxref{Handling links}).
-
-@orgcmdtkc{O,C-c C-a O,org-attach-open-in-emacs}
-Also open the attachment, but force opening the file in Emacs.
-
-@orgcmdtkc{f,C-c C-a f,org-attach-reveal}
-Open the current task's attachment directory.
-
-@orgcmdtkc{F,C-c C-a F,org-attach-reveal-in-emacs}
-Also open the directory, but force using @command{dired} in Emacs.
-
-@orgcmdtkc{d,C-c C-a d,org-attach-delete-one}
-Select and delete a single attachment.
-
-@orgcmdtkc{D,C-c C-a D,org-attach-delete-all}
-Delete all of a task's attachments. A safer way is to open the directory in
-@command{dired} and delete from there.
-
-@orgcmdtkc{s,C-c C-a s,org-attach-set-directory}
-@cindex property, ATTACH_DIR
-Set a specific directory as the entry's attachment directory. This works by
-putting the directory path into the @code{ATTACH_DIR} property.
-
-@orgcmdtkc{i,C-c C-a i,org-attach-set-inherit}
-@cindex property, ATTACH_DIR_INHERIT
-Set the @code{ATTACH_DIR_INHERIT} property, so that children will use the
-same directory for attachments as the parent does.
-@end table
-@end table
-
-@node RSS Feeds, Protocols, Attachments, Capture - Refile - Archive
-@section RSS feeds
-@cindex RSS feeds
-@cindex Atom feeds
-
-Org can add and change entries based on information found in RSS feeds and
-Atom feeds. You could use this to make a task out of each new podcast in a
-podcast feed. Or you could use a phone-based note-creating service on the
-web to import tasks into Org. To access feeds, configure the variable
-@code{org-feed-alist}. The docstring of this variable has detailed
-information. Here is just an example:
-
-@example
-(setq org-feed-alist
- '(("Slashdot"
- "http://rss.slashdot.org/Slashdot/slashdot"
- "~/txt/org/feeds.org" "Slashdot Entries")))
-@end example
-
-@noindent
-will configure that new items from the feed provided by
-@code{rss.slashdot.org} will result in new entries in the file
-@file{~/org/feeds.org} under the heading @samp{Slashdot Entries}, whenever
-the following command is used:
-
-@table @kbd
-@orgcmd{C-c C-x g,org-feed-update-all}
-@item C-c C-x g
-Collect items from the feeds configured in @code{org-feed-alist} and act upon
-them.
-@orgcmd{C-c C-x G,org-feed-goto-inbox}
-Prompt for a feed name and go to the inbox configured for this feed.
-@end table
-
-Under the same headline, Org will create a drawer @samp{FEEDSTATUS} in which
-it will store information about the status of items in the feed, to avoid
-adding the same item several times. You should add @samp{FEEDSTATUS} to the
-list of drawers in that file:
-
-@example
-#+DRAWERS: LOGBOOK PROPERTIES FEEDSTATUS
-@end example
-
-For more information, including how to read atom feeds, see
-@file{org-feed.el} and the docstring of @code{org-feed-alist}.
-
-@node Protocols, Refiling notes, RSS Feeds, Capture - Refile - Archive
-@section Protocols for external access
-@cindex protocols, for external access
-@cindex emacsserver
-
-You can set up Org for handling protocol calls from outside applications that
-are passed to Emacs through the @file{emacsserver}. For example, you can
-configure bookmarks in your web browser to send a link to the current page to
-Org and create a note from it using capture (@pxref{Capture}). Or you
-could create a bookmark that will tell Emacs to open the local source file of
-a remote website you are looking at with the browser. See
-@uref{http://orgmode.org/worg/org-contrib/org-protocol.php} for detailed
-documentation and setup instructions.
-
-@node Refiling notes, Archiving, Protocols, Capture - Refile - Archive
-@section Refiling notes
-@cindex refiling notes
-
-When reviewing the captured data, you may want to refile some of the entries
-into a different list, for example into a project. Cutting, finding the
-right location, and then pasting the note is cumbersome. To simplify this
-process, you can use the following special command:
-
-@table @kbd
-@orgcmd{C-c C-w,org-refile}
-@vindex org-reverse-note-order
-@vindex org-refile-targets
-@vindex org-refile-use-outline-path
-@vindex org-outline-path-complete-in-steps
-@vindex org-refile-allow-creating-parent-nodes
-@vindex org-log-refile
-@vindex org-refile-use-cache
-Refile the entry or region at point. This command offers possible locations
-for refiling the entry and lets you select one with completion. The item (or
-all items in the region) is filed below the target heading as a subitem.
-Depending on @code{org-reverse-note-order}, it will be either the first or
-last subitem.@*
-By default, all level 1 headlines in the current buffer are considered to be
-targets, but you can have more complex definitions across a number of files.
-See the variable @code{org-refile-targets} for details. If you would like to
-select a location via a file-path-like completion along the outline path, see
-the variables @code{org-refile-use-outline-path} and
-@code{org-outline-path-complete-in-steps}. If you would like to be able to
-create new nodes as new parents for refiling on the fly, check the
-variable @code{org-refile-allow-creating-parent-nodes}.
-When the variable @code{org-log-refile}@footnote{with corresponding
-@code{#+STARTUP} keywords @code{logrefile}, @code{lognoterefile},
-and @code{nologrefile}} is set, a time stamp or a note will be
-recorded when an entry has been refiled.
-@orgkey{C-u C-c C-w}
-Use the refile interface to jump to a heading.
-@orgcmd{C-u C-u C-c C-w,org-refile-goto-last-stored}
-Jump to the location where @code{org-refile} last moved a tree to.
-@item C-2 C-c C-w
-Refile as the child of the item currently being clocked.
-@item C-0 C-c C-w @ @r{or} @ C-u C-u C-u C-c C-w
-
-@orgcmdtkc{C-0 C-c C-w @ @r{or} @ C-u C-u C-u C-c C-w,C-0 C-c C-w,org-refile-cache-clear}
-
-Clear the target cache. Caching of refile targets can be turned on by
-setting @code{org-refile-use-cache}. To make the command see new possible
-targets, you have to clear the cache with this command.
-@end table
-
-@node Archiving, , Refiling notes, Capture - Refile - Archive
-@section Archiving
-@cindex archiving
-
-When a project represented by a (sub)tree is finished, you may want
-to move the tree out of the way and to stop it from contributing to the
-agenda. Archiving is important to keep your working files compact and global
-searches like the construction of agenda views fast.
-
-@table @kbd
-@orgcmd{C-c C-x C-a,org-archive-subtree-default}
-@vindex org-archive-default-command
-Archive the current entry using the command specified in the variable
-@code{org-archive-default-command}.
-@end table
-
-@menu
-* Moving subtrees:: Moving a tree to an archive file
-* Internal archiving:: Switch off a tree but keep it in the file
-@end menu
-
-@node Moving subtrees, Internal archiving, Archiving, Archiving
-@subsection Moving a tree to the archive file
-@cindex external archiving
-
-The most common archiving action is to move a project tree to another file,
-the archive file.
-
-@table @kbd
-@orgcmdkskc{C-c C-x C-s,C-c $,org-archive-subtree}
-@vindex org-archive-location
-Archive the subtree starting at the cursor position to the location
-given by @code{org-archive-location}.
-@orgkey{C-u C-c C-x C-s}
-Check if any direct children of the current headline could be moved to
-the archive. To do this, each subtree is checked for open TODO entries.
-If none are found, the command offers to move it to the archive
-location. If the cursor is @emph{not} on a headline when this command
-is invoked, the level 1 trees will be checked.
-@end table
-
-@cindex archive locations
-The default archive location is a file in the same directory as the
-current file, with the name derived by appending @file{_archive} to the
-current file name. For information and examples on how to change this,
-see the documentation string of the variable
-@code{org-archive-location}. There is also an in-buffer option for
-setting this variable, for example@footnote{For backward compatibility,
-the following also works: If there are several such lines in a file,
-each specifies the archive location for the text below it. The first
-such line also applies to any text before its definition. However,
-using this method is @emph{strongly} deprecated as it is incompatible
-with the outline structure of the document. The correct method for
-setting multiple archive locations in a buffer is using properties.}:
-
-@cindex #+ARCHIVE
-@example
-#+ARCHIVE: %s_done::
-@end example
-
-@cindex property, ARCHIVE
-@noindent
-If you would like to have a special ARCHIVE location for a single entry
-or a (sub)tree, give the entry an @code{:ARCHIVE:} property with the
-location as the value (@pxref{Properties and Columns}).
-
-@vindex org-archive-save-context-info
-When a subtree is moved, it receives a number of special properties that
-record context information like the file from where the entry came, its
-outline path the archiving time etc. Configure the variable
-@code{org-archive-save-context-info} to adjust the amount of information
-added.
-
-
-@node Internal archiving, , Moving subtrees, Archiving
-@subsection Internal archiving
-
-If you want to just switch off (for agenda views) certain subtrees without
-moving them to a different file, you can use the @code{ARCHIVE tag}.
-
-A headline that is marked with the ARCHIVE tag (@pxref{Tags}) stays at
-its location in the outline tree, but behaves in the following way:
-@itemize @minus
-@item
-@vindex org-cycle-open-archived-trees
-It does not open when you attempt to do so with a visibility cycling
-command (@pxref{Visibility cycling}). You can force cycling archived
-subtrees with @kbd{C-@key{TAB}}, or by setting the option
-@code{org-cycle-open-archived-trees}. Also normal outline commands like
-@code{show-all} will open archived subtrees.
-@item
-@vindex org-sparse-tree-open-archived-trees
-During sparse tree construction (@pxref{Sparse trees}), matches in
-archived subtrees are not exposed, unless you configure the option
-@code{org-sparse-tree-open-archived-trees}.
-@item
-@vindex org-agenda-skip-archived-trees
-During agenda view construction (@pxref{Agenda Views}), the content of
-archived trees is ignored unless you configure the option
-@code{org-agenda-skip-archived-trees}, in which case these trees will always
-be included. In the agenda you can press @kbd{v a} to get archives
-temporarily included.
-@item
-@vindex org-export-with-archived-trees
-Archived trees are not exported (@pxref{Exporting}), only the headline
-is. Configure the details using the variable
-@code{org-export-with-archived-trees}.
-@item
-@vindex org-columns-skip-archived-trees
-Archived trees are excluded from column view unless the variable
-@code{org-columns-skip-archived-trees} is configured to @code{nil}.
-@end itemize
-
-The following commands help manage the ARCHIVE tag:
-
-@table @kbd
-@orgcmd{C-c C-x a,org-toggle-archive-tag}
-Toggle the ARCHIVE tag for the current headline. When the tag is set,
-the headline changes to a shadowed face, and the subtree below it is
-hidden.
-@orgkey{C-u C-c C-x a}
-Check if any direct children of the current headline should be archived.
-To do this, each subtree is checked for open TODO entries. If none are
-found, the command offers to set the ARCHIVE tag for the child. If the
-cursor is @emph{not} on a headline when this command is invoked, the
-level 1 trees will be checked.
-@orgcmd{C-@kbd{TAB},org-force-cycle-archived}
-Cycle a tree even if it is tagged with ARCHIVE.
-@orgcmd{C-c C-x A,org-archive-to-archive-sibling}
-Move the current entry to the @emph{Archive Sibling}. This is a sibling of
-the entry with the heading @samp{Archive} and the tag @samp{ARCHIVE}. The
-entry becomes a child of that sibling and in this way retains a lot of its
-original context, including inherited tags and approximate position in the
-outline.
-@end table
-
-
-@node Agenda Views, Markup, Capture - Refile - Archive, Top
-@chapter Agenda views
-@cindex agenda views
-
-Due to the way Org works, TODO items, time-stamped items, and
-tagged headlines can be scattered throughout a file or even a number of
-files. To get an overview of open action items, or of events that are
-important for a particular date, this information must be collected,
-sorted and displayed in an organized way.
-
-Org can select items based on various criteria and display them
-in a separate buffer. Seven different view types are provided:
-
-@itemize @bullet
-@item
-an @emph{agenda} that is like a calendar and shows information
-for specific dates,
-@item
-a @emph{TODO list} that covers all unfinished
-action items,
-@item
-a @emph{match view}, showings headlines based on the tags, properties, and
-TODO state associated with them,
-@item
-a @emph{timeline view} that shows all events in a single Org file,
-in time-sorted view,
-@item
-a @emph{text search view} that shows all entries from multiple files
-that contain specified keywords,
-@item
-a @emph{stuck projects view} showing projects that currently don't move
-along, and
-@item
-@emph{custom views} that are special searches and combinations of different
-views.
-@end itemize
-
-@noindent
-The extracted information is displayed in a special @emph{agenda
-buffer}. This buffer is read-only, but provides commands to visit the
-corresponding locations in the original Org files, and even to
-edit these files remotely.
-
-@vindex org-agenda-window-setup
-@vindex org-agenda-restore-windows-after-quit
-Two variables control how the agenda buffer is displayed and whether the
-window configuration is restored when the agenda exits:
-@code{org-agenda-window-setup} and
-@code{org-agenda-restore-windows-after-quit}.
-
-@menu
-* Agenda files:: Files being searched for agenda information
-* Agenda dispatcher:: Keyboard access to agenda views
-* Built-in agenda views:: What is available out of the box?
-* Presentation and sorting:: How agenda items are prepared for display
-* Agenda commands:: Remote editing of Org trees
-* Custom agenda views:: Defining special searches and views
-* Exporting Agenda Views:: Writing a view to a file
-* Agenda column view:: Using column view for collected entries
-@end menu
-
-@node Agenda files, Agenda dispatcher, Agenda Views, Agenda Views
-@section Agenda files
-@cindex agenda files
-@cindex files for agenda
-
-@vindex org-agenda-files
-The information to be shown is normally collected from all @emph{agenda
-files}, the files listed in the variable
-@code{org-agenda-files}@footnote{If the value of that variable is not a
-list, but a single file name, then the list of agenda files will be
-maintained in that external file.}. If a directory is part of this list,
-all files with the extension @file{.org} in this directory will be part
-of the list.
-
-Thus, even if you only work with a single Org file, that file should
-be put into the list@footnote{When using the dispatcher, pressing
-@kbd{<} before selecting a command will actually limit the command to
-the current file, and ignore @code{org-agenda-files} until the next
-dispatcher command.}. You can customize @code{org-agenda-files}, but
-the easiest way to maintain it is through the following commands
-
-@cindex files, adding to agenda list
-@table @kbd
-@orgcmd{C-c [,org-agenda-to-front}
-Add current file to the list of agenda files. The file is added to
-the front of the list. If it was already in the list, it is moved to
-the front. With a prefix argument, file is added/moved to the end.
-@orgcmd{C-c ],org-remove-file}
-Remove current file from the list of agenda files.
-@kindex C-,
-@orgcmd{C-',org-cycle-agenda-files}
-@itemx C-,
-Cycle through agenda file list, visiting one file after the other.
-@kindex M-x org-iswitchb
-@item M-x org-iswitchb
-Command to use an @code{iswitchb}-like interface to switch to and between Org
-buffers.
-@end table
-
-@noindent
-The Org menu contains the current list of files and can be used
-to visit any of them.
-
-If you would like to focus the agenda temporarily on a file not in
-this list, or on just one file in the list, or even on only a subtree in a
-file, then this can be done in different ways. For a single agenda command,
-you may press @kbd{<} once or several times in the dispatcher
-(@pxref{Agenda dispatcher}). To restrict the agenda scope for an
-extended period, use the following commands:
-
-@table @kbd
-@orgcmd{C-c C-x <,org-agenda-set-restriction-lock}
-Permanently restrict the agenda to the current subtree. When with a
-prefix argument, or with the cursor before the first headline in a file,
-the agenda scope is set to the entire file. This restriction remains in
-effect until removed with @kbd{C-c C-x >}, or by typing either @kbd{<}
-or @kbd{>} in the agenda dispatcher. If there is a window displaying an
-agenda view, the new restriction takes effect immediately.
-@orgcmd{C-c C-x >,org-agenda-remove-restriction-lock}
-Remove the permanent restriction created by @kbd{C-c C-x <}.
-@end table
-
-@noindent
-When working with @file{speedbar.el}, you can use the following commands in
-the Speedbar frame:
-@table @kbd
-@orgcmdtkc{< @r{in the speedbar frame},<,org-speedbar-set-agenda-restriction}
-Permanently restrict the agenda to the item---either an Org file or a subtree
-in such a file---at the cursor in the Speedbar frame.
-If there is a window displaying an agenda view, the new restriction takes
-effect immediately.
-@orgcmdtkc{> @r{in the speedbar frame},>,org-agenda-remove-restriction-lock}
-Lift the restriction.
-@end table
-
-@node Agenda dispatcher, Built-in agenda views, Agenda files, Agenda Views
-@section The agenda dispatcher
-@cindex agenda dispatcher
-@cindex dispatching agenda commands
-The views are created through a dispatcher, which should be bound to a
-global key---for example @kbd{C-c a} (@pxref{Installation}). In the
-following we will assume that @kbd{C-c a} is indeed how the dispatcher
-is accessed and list keyboard access to commands accordingly. After
-pressing @kbd{C-c a}, an additional letter is required to execute a
-command. The dispatcher offers the following default commands:
-@table @kbd
-@item a
-Create the calendar-like agenda (@pxref{Weekly/daily agenda}).
-@item t @r{/} T
-Create a list of all TODO items (@pxref{Global TODO list}).
-@item m @r{/} M
-Create a list of headlines matching a TAGS expression (@pxref{Matching
-tags and properties}).
-@item L
-Create the timeline view for the current buffer (@pxref{Timeline}).
-@item s
-Create a list of entries selected by a boolean expression of keywords
-and/or regular expressions that must or must not occur in the entry.
-@item /
-@vindex org-agenda-text-search-extra-files
-Search for a regular expression in all agenda files and additionally in
-the files listed in @code{org-agenda-text-search-extra-files}. This
-uses the Emacs command @code{multi-occur}. A prefix argument can be
-used to specify the number of context lines for each match, default is
-1.
-@item # @r{/} !
-Create a list of stuck projects (@pxref{Stuck projects}).
-@item <
-Restrict an agenda command to the current buffer@footnote{For backward
-compatibility, you can also press @kbd{1} to restrict to the current
-buffer.}. After pressing @kbd{<}, you still need to press the character
-selecting the command.
-@item < <
-If there is an active region, restrict the following agenda command to
-the region. Otherwise, restrict it to the current subtree@footnote{For
-backward compatibility, you can also press @kbd{0} to restrict to the
-current region/subtree.}. After pressing @kbd{< <}, you still need to press the
-character selecting the command.
-@end table
-
-You can also define custom commands that will be accessible through the
-dispatcher, just like the default commands. This includes the
-possibility to create extended agenda buffers that contain several
-blocks together, for example the weekly agenda, the global TODO list and
-a number of special tags matches. @xref{Custom agenda views}.
-
-@node Built-in agenda views, Presentation and sorting, Agenda dispatcher, Agenda Views
-@section The built-in agenda views
-
-In this section we describe the built-in views.
-
-@menu
-* Weekly/daily agenda:: The calendar page with current tasks
-* Global TODO list:: All unfinished action items
-* Matching tags and properties:: Structured information with fine-tuned search
-* Timeline:: Time-sorted view for single file
-* Search view:: Find entries by searching for text
-* Stuck projects:: Find projects you need to review
-@end menu
-
-@node Weekly/daily agenda, Global TODO list, Built-in agenda views, Built-in agenda views
-@subsection The weekly/daily agenda
-@cindex agenda
-@cindex weekly agenda
-@cindex daily agenda
-
-The purpose of the weekly/daily @emph{agenda} is to act like a page of a
-paper agenda, showing all the tasks for the current week or day.
-
-@table @kbd
-@cindex org-agenda, command
-@orgcmd{C-c a a,org-agenda-list}
-Compile an agenda for the current week from a list of Org files. The agenda
-shows the entries for each day. With a numeric prefix@footnote{For backward
-compatibility, the universal prefix @kbd{C-u} causes all TODO entries to be
-listed before the agenda. This feature is deprecated, use the dedicated TODO
-list, or a block agenda instead (@pxref{Block agenda}).} (like @kbd{C-u 2 1
-C-c a a}) you may set the number of days to be displayed.
-@end table
-
-@vindex org-agenda-span
-@vindex org-agenda-ndays
-The default number of days displayed in the agenda is set by the variable
-@code{org-agenda-span} (or the obsolete @code{org-agenda-ndays}). This
-variable can be set to any number of days you want to see by default in the
-agenda, or to a span name, such a @code{day}, @code{week}, @code{month} or
-@code{year}.
-
-Remote editing from the agenda buffer means, for example, that you can
-change the dates of deadlines and appointments from the agenda buffer.
-The commands available in the Agenda buffer are listed in @ref{Agenda
-commands}.
-
-@subsubheading Calendar/Diary integration
-@cindex calendar integration
-@cindex diary integration
-
-Emacs contains the calendar and diary by Edward M. Reingold. The
-calendar displays a three-month calendar with holidays from different
-countries and cultures. The diary allows you to keep track of
-anniversaries, lunar phases, sunrise/set, recurrent appointments
-(weekly, monthly) and more. In this way, it is quite complementary to
-Org. It can be very useful to combine output from Org with
-the diary.
-
-In order to include entries from the Emacs diary into Org-mode's
-agenda, you only need to customize the variable
-
-@lisp
-(setq org-agenda-include-diary t)
-@end lisp
-
-@noindent After that, everything will happen automatically. All diary
-entries including holidays, anniversaries, etc., will be included in the
-agenda buffer created by Org-mode. @key{SPC}, @key{TAB}, and
-@key{RET} can be used from the agenda buffer to jump to the diary
-file in order to edit existing diary entries. The @kbd{i} command to
-insert new entries for the current date works in the agenda buffer, as
-well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to display
-Sunrise/Sunset times, show lunar phases and to convert to other
-calendars, respectively. @kbd{c} can be used to switch back and forth
-between calendar and agenda.
-
-If you are using the diary only for sexp entries and holidays, it is
-faster to not use the above setting, but instead to copy or even move
-the entries into an Org file. Org-mode evaluates diary-style sexp
-entries, and does it faster because there is no overhead for first
-creating the diary display. Note that the sexp entries must start at
-the left margin, no whitespace is allowed before them. For example,
-the following segment of an Org file will be processed and entries
-will be made in the agenda:
-
-@example
-* Birthdays and similar stuff
-#+CATEGORY: Holiday
-%%(org-calendar-holiday) ; special function for holiday names
-#+CATEGORY: Ann
-%%(diary-anniversary 5 14 1956)@footnote{Note that the order of the arguments (month, day, year) depends on the setting of @code{calendar-date-style}.} Arthur Dent is %d years old
-%%(diary-anniversary 10 2 1869) Mahatma Gandhi would be %d years old
-@end example
-
-@subsubheading Anniversaries from BBDB
-@cindex BBDB, anniversaries
-@cindex anniversaries, from BBDB
-
-If you are using the Big Brothers Database to store your contacts, you will
-very likely prefer to store anniversaries in BBDB rather than in a
-separate Org or diary file. Org supports this and will show BBDB
-anniversaries as part of the agenda. All you need to do is to add the
-following to one your your agenda files:
-
-@example
-* Anniversaries
- :PROPERTIES:
- :CATEGORY: Anniv
- :END:
-%%(org-bbdb-anniversaries)
-@end example
-
-You can then go ahead and define anniversaries for a BBDB record. Basically,
-you need to press @kbd{C-o anniversary @key{RET}} with the cursor in a BBDB
-record and then add the date in the format @code{YYYY-MM-DD}, followed by a
-space and the class of the anniversary (@samp{birthday} or @samp{wedding}, or
-a format string). If you omit the class, it will default to @samp{birthday}.
-Here are a few examples, the header for the file @file{org-bbdb.el} contains
-more detailed information.
-
-@example
-1973-06-22
-1955-08-02 wedding
-2008-04-14 %s released version 6.01 of org-mode, %d years ago
-@end example
-
-After a change to BBDB, or for the first agenda display during an Emacs
-session, the agenda display will suffer a short delay as Org updates its
-hash with anniversaries. However, from then on things will be very fast---much
-faster in fact than a long list of @samp{%%(diary-anniversary)} entries
-in an Org or Diary file.
-
-@subsubheading Appointment reminders
-@cindex @file{appt.el}
-@cindex appointment reminders
-
-Org can interact with Emacs appointments notification facility. To add all
-the appointments of your agenda files, use the command
-@code{org-agenda-to-appt}. This command also lets you filter through the
-list of your appointments and add only those belonging to a specific category
-or matching a regular expression. See the docstring for details.
-
-@node Global TODO list, Matching tags and properties, Weekly/daily agenda, Built-in agenda views
-@subsection The global TODO list
-@cindex global TODO list
-@cindex TODO list, global
-
-The global TODO list contains all unfinished TODO items formatted and
-collected into a single place.
-
-@table @kbd
-@orgcmd{C-c a t,org-todo-list}
-Show the global TODO list. This collects the TODO items from all agenda
-files (@pxref{Agenda Views}) into a single buffer. By default, this lists
-items with a state the is not a DONE state. The buffer is in
-@code{agenda-mode}, so there are commands to examine and manipulate the TODO
-entries directly from that buffer (@pxref{Agenda commands}).
-@orgcmd{C-c a T,org-todo-list}
-@cindex TODO keyword matching
-@vindex org-todo-keywords
-Like the above, but allows selection of a specific TODO keyword. You can
-also do this by specifying a prefix argument to @kbd{C-c a t}. You are
-prompted for a keyword, and you may also specify several keywords by
-separating them with @samp{|} as the boolean OR operator. With a numeric
-prefix, the Nth keyword in @code{org-todo-keywords} is selected.
-@kindex r
-The @kbd{r} key in the agenda buffer regenerates it, and you can give
-a prefix argument to this command to change the selected TODO keyword,
-for example @kbd{3 r}. If you often need a search for a specific
-keyword, define a custom command for it (@pxref{Agenda dispatcher}).@*
-Matching specific TODO keywords can also be done as part of a tags
-search (@pxref{Tag searches}).
-@end table
-
-Remote editing of TODO items means that you can change the state of a
-TODO entry with a single key press. The commands available in the
-TODO list are described in @ref{Agenda commands}.
-
-@cindex sublevels, inclusion into TODO list
-Normally the global TODO list simply shows all headlines with TODO
-keywords. This list can become very long. There are two ways to keep
-it more compact:
-@itemize @minus
-@item
-@vindex org-agenda-todo-ignore-scheduled
-@vindex org-agenda-todo-ignore-deadlines
-@vindex org-agenda-todo-ignore-timestamp
-@vindex org-agenda-todo-ignore-with-date
-Some people view a TODO item that has been @emph{scheduled} for execution or
-have a @emph{deadline} (@pxref{Timestamps}) as no longer @emph{open}.
-Configure the variables @code{org-agenda-todo-ignore-scheduled},
-@code{org-agenda-todo-ignore-deadlines},
-@code{org-agenda-todo-ignore-timestamp} and/or
-@code{org-agenda-todo-ignore-with-date} to exclude such items from the global
-TODO list.
-@item
-@vindex org-agenda-todo-list-sublevels
-TODO items may have sublevels to break up the task into subtasks. In
-such cases it may be enough to list only the highest level TODO headline
-and omit the sublevels from the global list. Configure the variable
-@code{org-agenda-todo-list-sublevels} to get this behavior.
-@end itemize
-
-@node Matching tags and properties, Timeline, Global TODO list, Built-in agenda views
-@subsection Matching tags and properties
-@cindex matching, of tags
-@cindex matching, of properties
-@cindex tags view
-@cindex match view
-
-If headlines in the agenda files are marked with @emph{tags} (@pxref{Tags}),
-or have properties (@pxref{Properties and Columns}), you can select headlines
-based on this metadata and collect them into an agenda buffer. The match
-syntax described here also applies when creating sparse trees with @kbd{C-c /
-m}.
-
-@table @kbd
-@orgcmd{C-c a m,org-tags-view}
-Produce a list of all headlines that match a given set of tags. The
-command prompts for a selection criterion, which is a boolean logic
-expression with tags, like @samp{+work+urgent-withboss} or
-@samp{work|home} (@pxref{Tags}). If you often need a specific search,
-define a custom command for it (@pxref{Agenda dispatcher}).
-@orgcmd{C-c a M,org-tags-view}
-@vindex org-tags-match-list-sublevels
-@vindex org-agenda-tags-todo-honor-ignore-options
-Like @kbd{C-c a m}, but only select headlines that are also TODO items in a
-not-DONE state and force checking subitems (see variable
-@code{org-tags-match-list-sublevels}). To exclude scheduled/deadline items,
-see the variable @code{org-agenda-tags-todo-honor-ignore-options}. Matching
-specific TODO keywords together with a tags match is also possible, see
-@ref{Tag searches}.
-@end table
-
-The commands available in the tags list are described in @ref{Agenda
-commands}.
-
-@subsubheading Match syntax
-
-@cindex Boolean logic, for tag/property searches
-A search string can use Boolean operators @samp{&} for AND and @samp{|} for
-OR. @samp{&} binds more strongly than @samp{|}. Parentheses are currently
-not implemented. Each element in the search is either a tag, a regular
-expression matching tags, or an expression like @code{PROPERTY OPERATOR
-VALUE} with a comparison operator, accessing a property value. Each element
-may be preceded by @samp{-}, to select against it, and @samp{+} is syntactic
-sugar for positive selection. The AND operator @samp{&} is optional when
-@samp{+} or @samp{-} is present. Here are some examples, using only tags.
-
-@table @samp
-@item +work-boss
-Select headlines tagged @samp{:work:}, but discard those also tagged
-@samp{:boss:}.
-@item work|laptop
-Selects lines tagged @samp{:work:} or @samp{:laptop:}.
-@item work|laptop+night
-Like before, but require the @samp{:laptop:} lines to be tagged also
-@samp{:night:}.
-@end table
-
-@cindex regular expressions, with tags search
-Instead of a tag, you may also specify a regular expression enclosed in curly
-braces. For example,
-@samp{work+@{^boss.*@}} matches headlines that contain the tag
-@samp{:work:} and any tag @i{starting} with @samp{boss}.
-
-@cindex TODO keyword matching, with tags search
-@cindex level, require for tags/property match
-@cindex category, require for tags/property match
-@vindex org-odd-levels-only
-You may also test for properties (@pxref{Properties and Columns}) at the same
-time as matching tags. The properties may be real properties, or special
-properties that represent other metadata (@pxref{Special properties}). For
-example, the ``property'' @code{TODO} represents the TODO keyword of the
-entry. Or, the ``property'' @code{LEVEL} represents the level of an entry.
-So a search @samp{+LEVEL=3+boss-TODO="DONE"} lists all level three headlines
-that have the tag @samp{boss} and are @emph{not} marked with the TODO keyword
-DONE. In buffers with @code{org-odd-levels-only} set, @samp{LEVEL} does not
-count the number of stars, but @samp{LEVEL=2} will correspond to 3 stars etc.
-
-Here are more examples:
-@table @samp
-@item work+TODO="WAITING"
-Select @samp{:work:}-tagged TODO lines with the specific TODO
-keyword @samp{WAITING}.
-@item work+TODO="WAITING"|home+TODO="WAITING"
-Waiting tasks both at work and at home.
-@end table
-
-When matching properties, a number of different operators can be used to test
-the value of a property. Here is a complex example:
-
-@example
-+work-boss+PRIORITY="A"+Coffee="unlimited"+Effort<2 \
- +With=@{Sarah\|Denny@}+SCHEDULED>="<2008-10-11>"
-@end example
-
-@noindent
-The type of comparison will depend on how the comparison value is written:
-@itemize @minus
-@item
-If the comparison value is a plain number, a numerical comparison is done,
-and the allowed operators are @samp{<}, @samp{=}, @samp{>}, @samp{<=},
-@samp{>=}, and @samp{<>}.
-@item
-If the comparison value is enclosed in double-quotes,
-a string comparison is done, and the same operators are allowed.
-@item
-If the comparison value is enclosed in double-quotes @emph{and} angular
-brackets (like @samp{DEADLINE<="<2008-12-24 18:30>"}), both values are
-assumed to be date/time specifications in the standard Org way, and the
-comparison will be done accordingly. Special values that will be recognized
-are @code{"<now>"} for now (including time), and @code{"<today>"}, and
-@code{"<tomorrow>"} for these days at 0:00 hours, i.e. without a time
-specification. Also strings like @code{"<+5d>"} or @code{"<-2m>"} with units
-@code{d}, @code{w}, @code{m}, and @code{y} for day, week, month, and year,
-respectively, can be used.
-@item
-If the comparison value is enclosed
-in curly braces, a regexp match is performed, with @samp{=} meaning that the
-regexp matches the property value, and @samp{<>} meaning that it does not
-match.
-@end itemize
-
-So the search string in the example finds entries tagged @samp{:work:} but
-not @samp{:boss:}, which also have a priority value @samp{A}, a
-@samp{:Coffee:} property with the value @samp{unlimited}, an @samp{Effort}
-property that is numerically smaller than 2, a @samp{:With:} property that is
-matched by the regular expression @samp{Sarah\|Denny}, and that are scheduled
-on or after October 11, 2008.
-
-Accessing TODO, LEVEL, and CATEGORY during a search is fast. Accessing any
-other properties will slow down the search. However, once you have paid the
-price by accessing one property, testing additional properties is cheap
-again.
-
-You can configure Org-mode to use property inheritance during a search, but
-beware that this can slow down searches considerably. See @ref{Property
-inheritance}, for details.
-
-For backward compatibility, and also for typing speed, there is also a
-different way to test TODO states in a search. For this, terminate the
-tags/property part of the search string (which may include several terms
-connected with @samp{|}) with a @samp{/} and then specify a Boolean
-expression just for TODO keywords. The syntax is then similar to that for
-tags, but should be applied with care: for example, a positive selection on
-several TODO keywords cannot meaningfully be combined with boolean AND.
-However, @emph{negative selection} combined with AND can be meaningful. To
-make sure that only lines are checked that actually have any TODO keyword
-(resulting in a speed-up), use @kbd{C-c a M}, or equivalently start the TODO
-part after the slash with @samp{!}. Using @kbd{C-c a M} or @samp{/!} will
-not match TODO keywords in a DONE state. Examples:
-
-@table @samp
-@item work/WAITING
-Same as @samp{work+TODO="WAITING"}
-@item work/!-WAITING-NEXT
-Select @samp{:work:}-tagged TODO lines that are neither @samp{WAITING}
-nor @samp{NEXT}
-@item work/!+WAITING|+NEXT
-Select @samp{:work:}-tagged TODO lines that are either @samp{WAITING} or
-@samp{NEXT}.
-@end table
-
-@node Timeline, Search view, Matching tags and properties, Built-in agenda views
-@subsection Timeline for a single file
-@cindex timeline, single file
-@cindex time-sorted view
-
-The timeline summarizes all time-stamped items from a single Org-mode
-file in a @emph{time-sorted view}. The main purpose of this command is
-to give an overview over events in a project.
-
-@table @kbd
-@orgcmd{C-c a L,org-timeline}
-Show a time-sorted view of the Org file, with all time-stamped items.
-When called with a @kbd{C-u} prefix, all unfinished TODO entries
-(scheduled or not) are also listed under the current date.
-@end table
-
-@noindent
-The commands available in the timeline buffer are listed in
-@ref{Agenda commands}.
-
-@node Search view, Stuck projects, Timeline, Built-in agenda views
-@subsection Search view
-@cindex search view
-@cindex text search
-@cindex searching, for text
-
-This agenda view is a general text search facility for Org-mode entries.
-It is particularly useful to find notes.
-
-@table @kbd
-@orgcmd{C-c a s,org-search-view}
-This is a special search that lets you select entries by matching a substring
-or specific words using a boolean logic.
-@end table
-For example, the search string @samp{computer equipment} will find entries
-that contain @samp{computer equipment} as a substring. If the two words are
-separated by more space or a line break, the search will still match.
-Search view can also search for specific keywords in the entry, using Boolean
-logic. The search string @samp{+computer +wifi -ethernet -@{8\.11[bg]@}}
-will search for note entries that contain the keywords @code{computer}
-and @code{wifi}, but not the keyword @code{ethernet}, and which are also
-not matched by the regular expression @code{8\.11[bg]}, meaning to
-exclude both 8.11b and 8.11g. The first @samp{+} is necessary to turn on
-word search, other @samp{+} characters are optional. For more details, see
-the docstring of the command @code{org-search-view}.
-
-@vindex org-agenda-text-search-extra-files
-Note that in addition to the agenda files, this command will also search
-the files listed in @code{org-agenda-text-search-extra-files}.
-
-@node Stuck projects, , Search view, Built-in agenda views
-@subsection Stuck projects
-
-If you are following a system like David Allen's GTD to organize your
-work, one of the ``duties'' you have is a regular review to make sure
-that all projects move along. A @emph{stuck} project is a project that
-has no defined next actions, so it will never show up in the TODO lists
-Org-mode produces. During the review, you need to identify such
-projects and define next actions for them.
-
-@table @kbd
-@orgcmd{C-c a #,org-agenda-list-stuck-projects}
-List projects that are stuck.
-@kindex C-c a !
-@item C-c a !
-@vindex org-stuck-projects
-Customize the variable @code{org-stuck-projects} to define what a stuck
-project is and how to find it.
-@end table
-
-You almost certainly will have to configure this view before it will
-work for you. The built-in default assumes that all your projects are
-level-2 headlines, and that a project is not stuck if it has at least
-one entry marked with a TODO keyword TODO or NEXT or NEXTACTION.
-
-Let's assume that you, in your own way of using Org-mode, identify
-projects with a tag PROJECT, and that you use a TODO keyword MAYBE to
-indicate a project that should not be considered yet. Let's further
-assume that the TODO keyword DONE marks finished projects, and that NEXT
-and TODO indicate next actions. The tag @@SHOP indicates shopping and
-is a next action even without the NEXT tag. Finally, if the project
-contains the special word IGNORE anywhere, it should not be listed
-either. In this case you would start by identifying eligible projects
-with a tags/todo match@footnote{@xref{Tag searches}.}
-@samp{+PROJECT/-MAYBE-DONE}, and then check for TODO, NEXT, @@SHOP, and
-IGNORE in the subtree to identify projects that are not stuck. The
-correct customization for this is
-
-@lisp
-(setq org-stuck-projects
- '("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@@SHOP")
- "\\<IGNORE\\>"))
-@end lisp
-
-Note that if a project is identified as non-stuck, the subtree of this entry
-will still be searched for stuck projects.
-
-@node Presentation and sorting, Agenda commands, Built-in agenda views, Agenda Views
-@section Presentation and sorting
-@cindex presentation, of agenda items
-
-@vindex org-agenda-prefix-format
-Before displaying items in an agenda view, Org-mode visually prepares
-the items and sorts them. Each item occupies a single line. The line
-starts with a @emph{prefix} that contains the @emph{category}
-(@pxref{Categories}) of the item and other important information. You can
-customize the prefix using the option @code{org-agenda-prefix-format}.
-The prefix is followed by a cleaned-up version of the outline headline
-associated with the item.
-
-@menu
-* Categories:: Not all tasks are equal
-* Time-of-day specifications:: How the agenda knows the time
-* Sorting of agenda items:: The order of things
-@end menu
-
-@node Categories, Time-of-day specifications, Presentation and sorting, Presentation and sorting
-@subsection Categories
-
-@cindex category
-@cindex #+CATEGORY
-The category is a broad label assigned to each agenda item. By default,
-the category is simply derived from the file name, but you can also
-specify it with a special line in the buffer, like this@footnote{For
-backward compatibility, the following also works: if there are several
-such lines in a file, each specifies the category for the text below it.
-The first category also applies to any text before the first CATEGORY
-line. However, using this method is @emph{strongly} deprecated as it is
-incompatible with the outline structure of the document. The correct
-method for setting multiple categories in a buffer is using a
-property.}:
-
-@example
-#+CATEGORY: Thesis
-@end example
-
-@noindent
-@cindex property, CATEGORY
-If you would like to have a special CATEGORY for a single entry or a
-(sub)tree, give the entry a @code{:CATEGORY:} property with the
-special category you want to apply as the value.
-
-@noindent
-The display in the agenda buffer looks best if the category is not
-longer than 10 characters.
-
-@noindent
-You can set up icons for category by customizing the
-@code{org-agenda-category-icon-alist} variable.
-
-@node Time-of-day specifications, Sorting of agenda items, Categories, Presentation and sorting
-@subsection Time-of-day specifications
-@cindex time-of-day specification
-
-Org-mode checks each agenda item for a time-of-day specification. The
-time can be part of the timestamp that triggered inclusion into the
-agenda, for example as in @w{@samp{<2005-05-10 Tue 19:00>}}. Time
-ranges can be specified with two timestamps, like
-@c
-@w{@samp{<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>}}.
-
-In the headline of the entry itself, a time(range) may also appear as
-plain text (like @samp{12:45} or a @samp{8:30-1pm}). If the agenda
-integrates the Emacs diary (@pxref{Weekly/daily agenda}), time
-specifications in diary entries are recognized as well.
-
-For agenda display, Org-mode extracts the time and displays it in a
-standard 24 hour format as part of the prefix. The example times in
-the previous paragraphs would end up in the agenda like this:
-
-@example
- 8:30-13:00 Arthur Dent lies in front of the bulldozer
- 12:45...... Ford Prefect arrives and takes Arthur to the pub
- 19:00...... The Vogon reads his poem
- 20:30-22:15 Marvin escorts the Hitchhikers to the bridge
-@end example
-
-@cindex time grid
-If the agenda is in single-day mode, or for the display of today, the
-timed entries are embedded in a time grid, like
-
-@example
- 8:00...... ------------------
- 8:30-13:00 Arthur Dent lies in front of the bulldozer
- 10:00...... ------------------
- 12:00...... ------------------
- 12:45...... Ford Prefect arrives and takes Arthur to the pub
- 14:00...... ------------------
- 16:00...... ------------------
- 18:00...... ------------------
- 19:00...... The Vogon reads his poem
- 20:00...... ------------------
- 20:30-22:15 Marvin escorts the Hitchhikers to the bridge
-@end example
-
-@vindex org-agenda-use-time-grid
-@vindex org-agenda-time-grid
-The time grid can be turned on and off with the variable
-@code{org-agenda-use-time-grid}, and can be configured with
-@code{org-agenda-time-grid}.
-
-@node Sorting of agenda items, , Time-of-day specifications, Presentation and sorting
-@subsection Sorting of agenda items
-@cindex sorting, of agenda items
-@cindex priorities, of agenda items
-Before being inserted into a view, the items are sorted. How this is
-done depends on the type of view.
-@itemize @bullet
-@item
-@vindex org-agenda-files
-For the daily/weekly agenda, the items for each day are sorted. The
-default order is to first collect all items containing an explicit
-time-of-day specification. These entries will be shown at the beginning
-of the list, as a @emph{schedule} for the day. After that, items remain
-grouped in categories, in the sequence given by @code{org-agenda-files}.
-Within each category, items are sorted by priority (@pxref{Priorities}),
-which is composed of the base priority (2000 for priority @samp{A}, 1000
-for @samp{B}, and 0 for @samp{C}), plus additional increments for
-overdue scheduled or deadline items.
-@item
-For the TODO list, items remain in the order of categories, but within
-each category, sorting takes place according to priority
-(@pxref{Priorities}). The priority used for sorting derives from the
-priority cookie, with additions depending on how close an item is to its due
-or scheduled date.
-@item
-For tags matches, items are not sorted at all, but just appear in the
-sequence in which they are found in the agenda files.
-@end itemize
-
-@vindex org-agenda-sorting-strategy
-Sorting can be customized using the variable
-@code{org-agenda-sorting-strategy}, and may also include criteria based on
-the estimated effort of an entry (@pxref{Effort estimates}).
-
-@node Agenda commands, Custom agenda views, Presentation and sorting, Agenda Views
-@section Commands in the agenda buffer
-@cindex commands, in agenda buffer
-
-Entries in the agenda buffer are linked back to the Org file or diary
-file where they originate. You are not allowed to edit the agenda
-buffer itself, but commands are provided to show and jump to the
-original entry location, and to edit the Org files ``remotely'' from
-the agenda buffer. In this way, all information is stored only once,
-removing the risk that your agenda and note files may diverge.
-
-Some commands can be executed with mouse clicks on agenda lines. For
-the other commands, the cursor needs to be in the desired line.
-
-@table @kbd
-@tsubheading{Motion}
-@cindex motion commands in agenda
-@orgcmd{n,org-agenda-next-line}
-Next line (same as @key{up} and @kbd{C-p}).
-@orgcmd{p,org-agenda-previous-line}
-Previous line (same as @key{down} and @kbd{C-n}).
-@tsubheading{View/Go to Org file}
-@orgcmdkkc{@key{SPC},mouse-3,org-agenda-show-and-scroll-up}
-Display the original location of the item in another window.
-With prefix arg, make sure that the entire entry is made visible in the
-outline, not only the heading.
-@c
-@orgcmd{L,org-agenda-recenter}
-Display original location and recenter that window.
-@c
-@orgcmdkkc{@key{TAB},mouse-2,org-agenda-goto}
-Go to the original location of the item in another window.
-@c
-@orgcmd{@key{RET},org-agenda-switch-to}
-Go to the original location of the item and delete other windows.
-@c
-@orgcmd{F,org-agenda-follow-mode}
-@vindex org-agenda-start-with-follow-mode
-Toggle Follow mode. In Follow mode, as you move the cursor through
-the agenda buffer, the other window always shows the corresponding
-location in the Org file. The initial setting for this mode in new
-agenda buffers can be set with the variable
-@code{org-agenda-start-with-follow-mode}.
-@c
-@orgcmd{C-c C-x b,org-agenda-tree-to-indirect-buffer}
-Display the entire subtree of the current item in an indirect buffer. With a
-numeric prefix argument N, go up to level N and then take that tree. If N is
-negative, go up that many levels. With a @kbd{C-u} prefix, do not remove the
-previously used indirect buffer.
-
-@orgcmd{C-c C-o,org-agenda-open-link}
-Follow a link in the entry. This will offer a selection of any links in the
-text belonging to the referenced Org node. If there is only one link, it
-will be followed without a selection prompt.
-
-@tsubheading{Change display}
-@cindex display changing, in agenda
-@kindex o
-@item o
-Delete other windows.
-@c
-@c @kindex v d
-@c @kindex d
-@c @kindex v w
-@c @kindex w
-@c @kindex v m
-@c @kindex v y
-@c @item v d @ @r{or short} @ d
-@c @itemx v w @ @r{or short} @ w
-@c @itemx v m
-@c @itemx v y
-@orgcmdkskc{v d,d,org-aganda-day-view}
-@xorgcmdkskc{v w,w,org-aganda-day-view}
-@xorgcmd{v m,org-agenda-month-view}
-@xorgcmd{v y,org-agenda-month-year}
-Switch to day/week/month/year view. When switching to day or week view,
-this setting becomes the default for subsequent agenda commands. Since
-month and year views are slow to create, they do not become the default.
-A numeric prefix argument may be used to jump directly to a specific day
-of the year, ISO week, month, or year, respectively. For example,
-@kbd{32 d} jumps to February 1st, @kbd{9 w} to ISO week number 9. When
-setting day, week, or month view, a year may be encoded in the prefix
-argument as well. For example, @kbd{200712 w} will jump to week 12 in
-2007. If such a year specification has only one or two digits, it will
-be mapped to the interval 1938-2037.
-@c
-@orgcmd{f,org-agenda-later}
-Go forward in time to display the following @code{org-agenda-current-span} days.
-For example, if the display covers a week, switch to the following week.
-With prefix arg, go forward that many times @code{org-agenda-current-span} days.
-@c
-@orgcmd{b,org-agenda-earlier}
-Go backward in time to display earlier dates.
-@c
-@orgcmd{.,org-agenda-goto-today}
-Go to today.
-@c
-@orgcmd{j,org-agenda-goto-date}
-Prompt for a date and go there.
-@c
-@orgcmd{J,org-agenda-clock-goto}
-Go to the currently clocked-in task @i{in the agenda buffer}.
-@c
-@orgcmd{D,org-agenda-toggle-diary}
-Toggle the inclusion of diary entries. See @ref{Weekly/daily agenda}.
-@c
-@orgcmdkskc{v l,l,org-agenda-log-mode}
-@kindex v L
-@vindex org-log-done
-@vindex org-agenda-log-mode-items
-Toggle Logbook mode. In Logbook mode, entries that were marked DONE while
-logging was on (variable @code{org-log-done}) are shown in the agenda, as are
-entries that have been clocked on that day. You can configure the entry
-types that should be included in log mode using the variable
-@code{org-agenda-log-mode-items}. When called with a @kbd{C-u} prefix, show
-all possible logbook entries, including state changes. When called with two
-prefix args @kbd{C-u C-u}, show only logging information, nothing else.
-@kbd{v L} is equivalent to @kbd{C-u v l}.
-@c
-@orgcmdkskc{v [,[,org-agenda-manipulate-query-add}
-Include inactive timestamps into the current view. Only for weekly/daily
-agenda and timeline views.
-@c
-@orgcmd{v a,org-agenda-archives-mode}
-@xorgcmd{v A,org-agenda-archives-mode 'files}
-Toggle Archives mode. In Archives mode, trees that are marked
-@code{ARCHIVED} are also scanned when producing the agenda. When you use the
-capital @kbd{A}, even all archive files are included. To exit archives mode,
-press @kbd{v a} again.
-@c
-@orgcmdkskc{v R,R,org-agenda-clockreport-mode}
-@vindex org-agenda-start-with-clockreport-mode
-Toggle Clockreport mode. In Clockreport mode, the daily/weekly agenda will
-always show a table with the clocked times for the timespan and file scope
-covered by the current agenda view. The initial setting for this mode in new
-agenda buffers can be set with the variable
-@code{org-agenda-start-with-clockreport-mode}. By using a prefix argument
-when toggling this mode (i.e. @kbd{C-u R}), the clock table will not show
-contributions from entries that are hidden by agenda filtering@footnote{Only
-tags filtering will be respected here, effort filtering is ignored.}.
-@c
-@orgcmdkskc{v E,E,org-agenda-entry-text-mode}
-@vindex org-agenda-start-with-entry-text-mode
-@vindex org-agenda-entry-text-maxlines
-Toggle entry text mode. In entry text mode, a number of lines from the Org
-outline node referenced by an agenda line will be displayed below the line.
-The maximum number of lines is given by the variable
-@code{org-agenda-entry-text-maxlines}. Calling this command with a numeric
-prefix argument will temporarily modify that number to the prefix value.
-@c
-@orgcmd{G,org-agenda-toggle-time-grid}
-@vindex org-agenda-use-time-grid
-@vindex org-agenda-time-grid
-Toggle the time grid on and off. See also the variables
-@code{org-agenda-use-time-grid} and @code{org-agenda-time-grid}.
-@c
-@orgcmd{r,org-agenda-rodo}
-Recreate the agenda buffer, for example to reflect the changes after
-modification of the timestamps of items with @kbd{S-@key{left}} and
-@kbd{S-@key{right}}. When the buffer is the global TODO list, a prefix
-argument is interpreted to create a selective list for a specific TODO
-keyword.
-@orgcmd{g,org-agenda-rodo}
-Same as @kbd{r}.
-@c
-@orgcmdkskc{C-x C-s,s,org-save-all-org-buffers}
-Save all Org buffers in the current Emacs session, and also the locations of
-IDs.
-@c
-@orgcmd{C-c C-x C-c,org-agenda-columns}
-@vindex org-columns-default-format
-Invoke column view (@pxref{Column view}) in the agenda buffer. The column
-view format is taken from the entry at point, or (if there is no entry at
-point), from the first entry in the agenda view. So whatever the format for
-that entry would be in the original buffer (taken from a property, from a
-@code{#+COLUMNS} line, or from the default variable
-@code{org-columns-default-format}), will be used in the agenda.
-
-@orgcmd{C-c C-x >,org-agenda-remove-restriction-lock}
-Remove the restriction lock on the agenda, if it is currently restricted to a
-file or subtree (@pxref{Agenda files}).
-
-@tsubheading{Secondary filtering and query editing}
-@cindex filtering, by tag and effort, in agenda
-@cindex tag filtering, in agenda
-@cindex effort filtering, in agenda
-@cindex query editing, in agenda
-
-@orgcmd{/,org-agenda-filter-by-tag}
-@vindex org-agenda-filter-preset
-Filter the current agenda view with respect to a tag and/or effort estimates.
-The difference between this and a custom agenda command is that filtering is
-very fast, so that you can switch quickly between different filters without
-having to recreate the agenda.@footnote{Custom commands can preset a filter by
-binding the variable @code{org-agenda-filter-preset} as an option. This
-filter will then be applied to the view and persist as a basic filter through
-refreshes and more secondary filtering. The filter is a global property of
-the entire agenda view---in a block agenda, you should only set this in the
-global options section, not in the section of an individual block.}
-
-You will be prompted for a tag selection letter; @key{SPC} will mean any tag at
-all. Pressing @key{TAB} at that prompt will offer use completion to select a
-tag (including any tags that do not have a selection character). The command
-then hides all entries that do not contain or inherit this tag. When called
-with prefix arg, remove the entries that @emph{do} have the tag. A second
-@kbd{/} at the prompt will turn off the filter and unhide any hidden entries.
-If the first key you press is either @kbd{+} or @kbd{-}, the previous filter
-will be narrowed by requiring or forbidding the selected additional tag.
-Instead of pressing @kbd{+} or @kbd{-} after @kbd{/}, you can also
-immediately use the @kbd{\} command.
-
-@vindex org-sort-agenda-noeffort-is-high
-In order to filter for effort estimates, you should set up allowed
-efforts globally, for example
-@lisp
-(setq org-global-properties
- '(("Effort_ALL". "0 0:10 0:30 1:00 2:00 3:00 4:00")))
-@end lisp
-You can then filter for an effort by first typing an operator, one of
-@kbd{<}, @kbd{>}, and @kbd{=}, and then the one-digit index of an effort
-estimate in your array of allowed values, where @kbd{0} means the 10th value.
-The filter will then restrict to entries with effort smaller-or-equal, equal,
-or larger-or-equal than the selected value. If the digits 0-9 are not used
-as fast access keys to tags, you can also simply press the index digit
-directly without an operator. In this case, @kbd{<} will be assumed. For
-application of the operator, entries without a defined effort will be treated
-according to the value of @code{org-sort-agenda-noeffort-is-high}. To filter
-for tasks without effort definition, press @kbd{?} as the operator.
-
-Org also supports automatic, context-aware tag filtering. If the variable
-@code{org-agenda-auto-exclude-function} is set to a user-defined function,
-that function can decide which tags should be excluded from the agenda
-automatically. Once this is set, the @kbd{/} command then accepts @kbd{RET}
-as a sub-option key and runs the auto exclusion logic. For example, let's
-say you use a @code{Net} tag to identify tasks which need network access, an
-@code{Errand} tag for errands in town, and a @code{Call} tag for making phone
-calls. You could auto-exclude these tags based on the availability of the
-Internet, and outside of business hours, with something like this:
-
-@lisp
-@group
-(defun org-my-auto-exclude-function (tag)
- (and (cond
- ((string= tag "Net")
- (/= 0 (call-process "/sbin/ping" nil nil nil
- "-c1" "-q" "-t1" "mail.gnu.org")))
- ((or (string= tag "Errand") (string= tag "Call"))
- (let ((hour (nth 2 (decode-time))))
- (or (< hour 8) (> hour 21)))))
- (concat "-" tag)))
-
-(setq org-agenda-auto-exclude-function 'org-my-auto-exclude-function)
-@end group
-@end lisp
-
-@orgcmd{\,org-agenda-filter-by-tag-refine}
-Narrow the current agenda filter by an additional condition. When called with
-prefix arg, remove the entries that @emph{do} have the tag, or that do match
-the effort criterion. You can achieve the same effect by pressing @kbd{+} or
-@kbd{-} as the first key after the @kbd{/} command.
-
-@c
-@kindex [
-@kindex ]
-@kindex @{
-@kindex @}
-@item [ ] @{ @}
-@table @i
-@item @r{in} search view
-add new search words (@kbd{[} and @kbd{]}) or new regular expressions
-(@kbd{@{} and @kbd{@}}) to the query string. The opening bracket/brace will
-add a positive search term prefixed by @samp{+}, indicating that this search
-term @i{must} occur/match in the entry. The closing bracket/brace will add a
-negative search term which @i{must not} occur/match in the entry for it to be
-selected.
-@end table
-
-@tsubheading{Remote editing}
-@cindex remote editing, from agenda
-
-@item 0-9
-Digit argument.
-@c
-@cindex undoing remote-editing events
-@cindex remote editing, undo
-@orgcmd{C-_,org-agenda-undo}
-Undo a change due to a remote editing command. The change is undone
-both in the agenda buffer and in the remote buffer.
-@c
-@orgcmd{t,org-agenda-todo}
-Change the TODO state of the item, both in the agenda and in the
-original org file.
-@c
-@orgcmd{C-S-@key{right},org-agenda-todo-nextset}
-@orgcmd{C-S-@key{left},org-agenda-todo-previousset}
-Switch to the next/previous set of TODO keywords.
-@c
-@orgcmd{C-k,org-agenda-kill}
-@vindex org-agenda-confirm-kill
-Delete the current agenda item along with the entire subtree belonging
-to it in the original Org file. If the text to be deleted remotely
-is longer than one line, the kill needs to be confirmed by the user. See
-variable @code{org-agenda-confirm-kill}.
-@c
-@orgcmd{C-c C-w,org-agenda-refile}
-Refile the entry at point.
-@c
-@orgcmdkskc{C-c C-x C-a,a,org-agenda-archive-default-with-confirmation}
-@vindex org-archive-default-command
-Archive the subtree corresponding to the entry at point using the default
-archiving command set in @code{org-archive-default-command}. When using the
-@code{a} key, confirmation will be required.
-@c
-@orgcmd{C-c C-x a,org-agenda-toggle-archive-tag}
-Toggle the ARCHIVE tag for the current headline.
-@c
-@orgcmd{C-c C-x A,org-agenda-archive-to-archive-sibling}
-Move the subtree corresponding to the current entry to its @emph{archive
-sibling}.
-@c
-@orgcmdkskc{C-c C-x C-s,$,org-agenda-archive}
-Archive the subtree corresponding to the current headline. This means the
-entry will be moved to the configured archive location, most likely a
-different file.
-@c
-@orgcmd{T,org-agenda-show-tags}
-@vindex org-agenda-show-inherited-tags
-Show all tags associated with the current item. This is useful if you have
-turned off @code{org-agenda-show-inherited-tags}, but still want to see all
-tags of a headline occasionally.
-@c
-@orgcmd{:,org-agenda-set-tags}
-Set tags for the current headline. If there is an active region in the
-agenda, change a tag for all headings in the region.
-@c
-@kindex ,
-@item ,
-Set the priority for the current item (@command{org-agenda-priority}).
-Org-mode prompts for the priority character. If you reply with @key{SPC}, the
-priority cookie is removed from the entry.
-@c
-@orgcmd{P,org-agenda-show-priority}
-Display weighted priority of current item.
-@c
-@orgcmdkkc{+,S-@key{up},org-agenda-priority-up}
-Increase the priority of the current item. The priority is changed in
-the original buffer, but the agenda is not resorted. Use the @kbd{r}
-key for this.
-@c
-@orgcmdkkc{-,S-@key{down},org-agenda-priority-down}
-Decrease the priority of the current item.
-@c
-@orgcmdkkc{z,C-c C-z,org-agenda-add-note}
-@vindex org-log-into-drawer
-Add a note to the entry. This note will be recorded, and then filed to the
-same location where state change notes are put. Depending on
-@code{org-log-into-drawer}, this may be inside a drawer.
-@c
-@orgcmd{C-c C-a,org-attach}
-Dispatcher for all command related to attachments.
-@c
-@orgcmd{C-c C-s,org-agenda-schedule}
-Schedule this item. With prefix arg remove the scheduling timestamp
-@c
-@orgcmd{C-c C-d,org-agenda-deadline}
-Set a deadline for this item. With prefix arg remove the deadline.
-@c
-@orgcmd{k,org-agenda-action}
-Agenda actions, to set dates for selected items to the cursor date.
-This command also works in the calendar! The command prompts for an
-additional key:
-@example
-m @r{Mark the entry at point for action. You can also make entries}
- @r{in Org files with @kbd{C-c C-x C-k}.}
-d @r{Set the deadline of the marked entry to the date at point.}
-s @r{Schedule the marked entry at the date at point.}
-r @r{Call @code{org-capture} with the cursor date as default date.}
-@end example
-@noindent
-Press @kbd{r} afterward to refresh the agenda and see the effect of the
-command.
-@c
-@orgcmd{S-@key{right},org-agenda-do-date-later}
-Change the timestamp associated with the current line by one day into the
-future. With a numeric prefix argument, change it by that many days. For
-example, @kbd{3 6 5 S-@key{right}} will change it by a year. With a
-@kbd{C-u} prefix, change the time by one hour. If you immediately repeat the
-command, it will continue to change hours even without the prefix arg. With
-a double @kbd{C-u C-u} prefix, do the same for changing minutes. The stamp
-is changed in the original Org file, but the change is not directly reflected
-in the agenda buffer. Use @kbd{r} or @kbd{g} to update the buffer.
-@c
-@orgcmd{S-@key{left},org-agenda-do-date-earlier}
-Change the timestamp associated with the current line by one day
-into the past.
-@c
-@orgcmd{>,org-agenda-date-prompt}
-Change the timestamp associated with the current line. The key @kbd{>} has
-been chosen, because it is the same as @kbd{S-.} on my keyboard.
-@c
-@orgcmd{I,org-agenda-clock-in}
-Start the clock on the current item. If a clock is running already, it
-is stopped first.
-@c
-@orgcmd{O,org-agenda-clock-out}
-Stop the previously started clock.
-@c
-@orgcmd{X,org-agenda-clock-cancel}
-Cancel the currently running clock.
-@c
-@orgcmd{J,org-agenda-clock-goto}
-Jump to the running clock in another window.
-
-@tsubheading{Bulk remote editing selected entries}
-@cindex remote editing, bulk, from agenda
-
-@orgcmd{m,org-agenda-bulk-mark}
-Mark the entry at point for bulk action. With prefix arg, mark that many
-successive entries.
-@c
-@orgcmd{u,org-agenda-bulk-unmark}
-Unmark entry for bulk action.
-@c
-@orgcmd{U,org-agenda-bulk-remove-all-marks}
-Unmark all marked entries for bulk action.
-@c
-@orgcmd{B,org-agenda-bulk-action}
-Bulk action: act on all marked entries in the agenda. This will prompt for
-another key to select the action to be applied. The prefix arg to @kbd{B}
-will be passed through to the @kbd{s} and @kbd{d} commands, to bulk-remove
-these special timestamps.
-@example
-r @r{Prompt for a single refile target and move all entries. The entries}
- @r{will no longer be in the agenda; refresh (@kbd{g}) to bring them back.}
-$ @r{Archive all selected entries.}
-A @r{Archive entries by moving them to their respective archive siblings.}
-t @r{Change TODO state. This prompts for a single TODO keyword and}
- @r{changes the state of all selected entries, bypassing blocking and}
- @r{suppressing logging notes (but not time stamps).}
-+ @r{Add a tag to all selected entries.}
-- @r{Remove a tag from all selected entries.}
-s @r{Schedule all items to a new date. To shift existing schedule dates}
- @r{by a fixed number of days, use something starting with double plus}
- @r{at the prompt, for example @samp{++8d} or @samp{++2w}.}
-S @r{Reschedule randomly by N days. N will be prompted for. With prefix}
- @r{arg (@kbd{C-u B S}), scatter only accross weekdays.}
-d @r{Set deadline to a specific date.}
-@end example
-
-
-@tsubheading{Calendar commands}
-@cindex calendar commands, from agenda
-
-@orgcmd{c,org-agenda-goto-calendar}
-Open the Emacs calendar and move to the date at the agenda cursor.
-@c
-@orgcmd{c,org-calendar-goto-agenda}
-When in the calendar, compute and show the Org-mode agenda for the
-date at the cursor.
-@c
-@cindex diary entries, creating from agenda
-@orgcmd{i,org-agenda-diary-entry}
-@vindex org-agenda-diary-file
-Insert a new entry into the diary, using the date at the cursor and (for
-block entries) the date at the mark. This will add to the Emacs diary
-file@footnote{This file is parsed for the agenda when
-@code{org-agenda-include-diary} is set.}, in a way similar to the @kbd{i}
-command in the calendar. The diary file will pop up in another window, where
-you can add the entry.
-
-If you configure @code{org-agenda-diary-file} to point to an Org-mode file,
-Org will create entries (in org-mode syntax) in that file instead. Most
-entries will be stored in a date-based outline tree that will later make it
-easy to archive appointments from previous months/years. The tree will be
-built under an entry with a @code{DATE_TREE} property, or else with years as
-top-level entries. Emacs will prompt you for the entry text---if you specify
-it, the entry will be created in @code{org-agenda-diary-file} without further
-interaction. If you directly press @key{RET} at the prompt without typing
-text, the target file will be shown in another window for you to finish the
-entry there. See also the @kbd{k r} command.
-@c
-@orgcmd{M,org-agenda-phases-of-moon}
-Show the phases of the moon for the three months around current date.
-@c
-@orgcmd{S,org-agenda-sunrise-sunset}
-Show sunrise and sunset times. The geographical location must be set
-with calendar variables, see the documentation for the Emacs calendar.
-@c
-@orgcmd{C,org-agenda-convert-date}
-Convert the date at cursor into many other cultural and historic
-calendars.
-@c
-@orgcmd{H,org-agenda-holidays}
-Show holidays for three months around the cursor date.
-
-@item M-x org-export-icalendar-combine-agenda-files
-Export a single iCalendar file containing entries from all agenda files.
-This is a globally available command, and also available in the agenda menu.
-
-@tsubheading{Exporting to a file}
-@orgcmd{C-x C-w,org-write-agenda}
-@cindex exporting agenda views
-@cindex agenda views, exporting
-@vindex org-agenda-exporter-settings
-Write the agenda view to a file. Depending on the extension of the selected
-file name, the view will be exported as HTML (extension @file{.html} or
-@file{.htm}), Postscript (extension @file{.ps}), PDF (extension @file{.pdf}),
-and plain text (any other extension). When called with a @kbd{C-u} prefix
-argument, immediately open the newly created file. Use the variable
-@code{org-agenda-exporter-settings} to set options for @file{ps-print} and
-for @file{htmlize} to be used during export.
-
-@tsubheading{Quit and Exit}
-@orgcmd{q,org-agenda-quit}
-Quit agenda, remove the agenda buffer.
-@c
-@cindex agenda files, removing buffers
-@orgcmd{x,org-agenda-exit}
-Exit agenda, remove the agenda buffer and all buffers loaded by Emacs
-for the compilation of the agenda. Buffers created by the user to
-visit Org files will not be removed.
-@end table
-
-
-@node Custom agenda views, Exporting Agenda Views, Agenda commands, Agenda Views
-@section Custom agenda views
-@cindex custom agenda views
-@cindex agenda views, custom
-
-Custom agenda commands serve two purposes: to store and quickly access
-frequently used TODO and tags searches, and to create special composite
-agenda buffers. Custom agenda commands will be accessible through the
-dispatcher (@pxref{Agenda dispatcher}), just like the default commands.
-
-@menu
-* Storing searches:: Type once, use often
-* Block agenda:: All the stuff you need in a single buffer
-* Setting Options:: Changing the rules
-@end menu
-
-@node Storing searches, Block agenda, Custom agenda views, Custom agenda views
-@subsection Storing searches
-
-The first application of custom searches is the definition of keyboard
-shortcuts for frequently used searches, either creating an agenda
-buffer, or a sparse tree (the latter covering of course only the current
-buffer).
-@kindex C-c a C
-@vindex org-agenda-custom-commands
-Custom commands are configured in the variable
-@code{org-agenda-custom-commands}. You can customize this variable, for
-example by pressing @kbd{C-c a C}. You can also directly set it with
-Emacs Lisp in @file{.emacs}. The following example contains all valid
-search types:
-
-@lisp
-@group
-(setq org-agenda-custom-commands
- '(("w" todo "WAITING")
- ("W" todo-tree "WAITING")
- ("u" tags "+boss-urgent")
- ("v" tags-todo "+boss-urgent")
- ("U" tags-tree "+boss-urgent")
- ("f" occur-tree "\\<FIXME\\>")
- ("h" . "HOME+Name tags searches") ; description for "h" prefix
- ("hl" tags "+home+Lisa")
- ("hp" tags "+home+Peter")
- ("hk" tags "+home+Kim")))
-@end group
-@end lisp
-
-@noindent
-The initial string in each entry defines the keys you have to press
-after the dispatcher command @kbd{C-c a} in order to access the command.
-Usually this will be just a single character, but if you have many
-similar commands, you can also define two-letter combinations where the
-first character is the same in several combinations and serves as a
-prefix key@footnote{You can provide a description for a prefix key by
-inserting a cons cell with the prefix and the description.}. The second
-parameter is the search type, followed by the string or regular
-expression to be used for the matching. The example above will
-therefore define:
-
-@table @kbd
-@item C-c a w
-as a global search for TODO entries with @samp{WAITING} as the TODO
-keyword
-@item C-c a W
-as the same search, but only in the current buffer and displaying the
-results as a sparse tree
-@item C-c a u
-as a global tags search for headlines marked @samp{:boss:} but not
-@samp{:urgent:}
-@item C-c a v
-as the same search as @kbd{C-c a u}, but limiting the search to
-headlines that are also TODO items
-@item C-c a U
-as the same search as @kbd{C-c a u}, but only in the current buffer and
-displaying the result as a sparse tree
-@item C-c a f
-to create a sparse tree (again: current buffer only) with all entries
-containing the word @samp{FIXME}
-@item C-c a h
-as a prefix command for a HOME tags search where you have to press an
-additional key (@kbd{l}, @kbd{p} or @kbd{k}) to select a name (Lisa,
-Peter, or Kim) as additional tag to match.
-@end table
-
-@node Block agenda, Setting Options, Storing searches, Custom agenda views
-@subsection Block agenda
-@cindex block agenda
-@cindex agenda, with block views
-
-Another possibility is the construction of agenda views that comprise
-the results of @emph{several} commands, each of which creates a block in
-the agenda buffer. The available commands include @code{agenda} for the
-daily or weekly agenda (as created with @kbd{C-c a a}), @code{alltodo}
-for the global TODO list (as constructed with @kbd{C-c a t}), and the
-matching commands discussed above: @code{todo}, @code{tags}, and
-@code{tags-todo}. Here are two examples:
-
-@lisp
-@group
-(setq org-agenda-custom-commands
- '(("h" "Agenda and Home-related tasks"
- ((agenda "")
- (tags-todo "home")
- (tags "garden")))
- ("o" "Agenda and Office-related tasks"
- ((agenda "")
- (tags-todo "work")
- (tags "office")))))
-@end group
-@end lisp
-
-@noindent
-This will define @kbd{C-c a h} to create a multi-block view for stuff
-you need to attend to at home. The resulting agenda buffer will contain
-your agenda for the current week, all TODO items that carry the tag
-@samp{home}, and also all lines tagged with @samp{garden}. Finally the
-command @kbd{C-c a o} provides a similar view for office tasks.
-
-@node Setting Options, , Block agenda, Custom agenda views
-@subsection Setting options for custom commands
-@cindex options, for custom agenda views
-
-@vindex org-agenda-custom-commands
-Org-mode contains a number of variables regulating agenda construction
-and display. The global variables define the behavior for all agenda
-commands, including the custom commands. However, if you want to change
-some settings just for a single custom view, you can do so. Setting
-options requires inserting a list of variable names and values at the
-right spot in @code{org-agenda-custom-commands}. For example:
-
-@lisp
-@group
-(setq org-agenda-custom-commands
- '(("w" todo "WAITING"
- ((org-agenda-sorting-strategy '(priority-down))
- (org-agenda-prefix-format " Mixed: ")))
- ("U" tags-tree "+boss-urgent"
- ((org-show-following-heading nil)
- (org-show-hierarchy-above nil)))
- ("N" search ""
- ((org-agenda-files '("~org/notes.org"))
- (org-agenda-text-search-extra-files nil)))))
-@end group
-@end lisp
-
-@noindent
-Now the @kbd{C-c a w} command will sort the collected entries only by
-priority, and the prefix format is modified to just say @samp{ Mixed: }
-instead of giving the category of the entry. The sparse tags tree of
-@kbd{C-c a U} will now turn out ultra-compact, because neither the
-headline hierarchy above the match, nor the headline following the match
-will be shown. The command @kbd{C-c a N} will do a text search limited
-to only a single file.
-
-@vindex org-agenda-custom-commands
-For command sets creating a block agenda,
-@code{org-agenda-custom-commands} has two separate spots for setting
-options. You can add options that should be valid for just a single
-command in the set, and options that should be valid for all commands in
-the set. The former are just added to the command entry; the latter
-must come after the list of command entries. Going back to the block
-agenda example (@pxref{Block agenda}), let's change the sorting strategy
-for the @kbd{C-c a h} commands to @code{priority-down}, but let's sort
-the results for GARDEN tags query in the opposite order,
-@code{priority-up}. This would look like this:
-
-@lisp
-@group
-(setq org-agenda-custom-commands
- '(("h" "Agenda and Home-related tasks"
- ((agenda)
- (tags-todo "home")
- (tags "garden"
- ((org-agenda-sorting-strategy '(priority-up)))))
- ((org-agenda-sorting-strategy '(priority-down))))
- ("o" "Agenda and Office-related tasks"
- ((agenda)
- (tags-todo "work")
- (tags "office")))))
-@end group
-@end lisp
-
-As you see, the values and parentheses setting is a little complex.
-When in doubt, use the customize interface to set this variable---it
-fully supports its structure. Just one caveat: when setting options in
-this interface, the @emph{values} are just Lisp expressions. So if the
-value is a string, you need to add the double-quotes around the value
-yourself.
-
-
-@node Exporting Agenda Views, Agenda column view, Custom agenda views, Agenda Views
-@section Exporting Agenda Views
-@cindex agenda views, exporting
-
-If you are away from your computer, it can be very useful to have a printed
-version of some agenda views to carry around. Org-mode can export custom
-agenda views as plain text, HTML@footnote{You need to install Hrvoje Niksic's
-@file{htmlize.el}.}, Postscript, PDF@footnote{To create PDF output, the
-ghostscript @file{ps2pdf} utility must be installed on the system. Selecting
-a PDF file with also create the postscript file.}, and iCalendar files. If
-you want to do this only occasionally, use the command
-
-@table @kbd
-@orgcmd{C-x C-w,org-write-agenda}
-@cindex exporting agenda views
-@cindex agenda views, exporting
-@vindex org-agenda-exporter-settings
-Write the agenda view to a file. Depending on the extension of the selected
-file name, the view will be exported as HTML (extension @file{.html} or
-@file{.htm}), Postscript (extension @file{.ps}), iCalendar (extension
-@file{.ics}), or plain text (any other extension). Use the variable
-@code{org-agenda-exporter-settings} to set options for @file{ps-print} and
-for @file{htmlize} to be used during export, for example
-
-@vindex org-agenda-add-entry-text-maxlines
-@vindex htmlize-output-type
-@vindex ps-number-of-columns
-@vindex ps-landscape-mode
-@lisp
-(setq org-agenda-exporter-settings
- '((ps-number-of-columns 2)
- (ps-landscape-mode t)
- (org-agenda-add-entry-text-maxlines 5)
- (htmlize-output-type 'css)))
-@end lisp
-@end table
-
-If you need to export certain agenda views frequently, you can associate
-any custom agenda command with a list of output file names
-@footnote{If you want to store standard views like the weekly agenda
-or the global TODO list as well, you need to define custom commands for
-them in order to be able to specify file names.}. Here is an example
-that first defines custom commands for the agenda and the global
-TODO list, together with a number of files to which to export them.
-Then we define two block agenda commands and specify file names for them
-as well. File names can be relative to the current working directory,
-or absolute.
-
-@lisp
-@group
-(setq org-agenda-custom-commands
- '(("X" agenda "" nil ("agenda.html" "agenda.ps"))
- ("Y" alltodo "" nil ("todo.html" "todo.txt" "todo.ps"))
- ("h" "Agenda and Home-related tasks"
- ((agenda "")
- (tags-todo "home")
- (tags "garden"))
- nil
- ("~/views/home.html"))
- ("o" "Agenda and Office-related tasks"
- ((agenda)
- (tags-todo "work")
- (tags "office"))
- nil
- ("~/views/office.ps" "~/calendars/office.ics"))))
-@end group
-@end lisp
-
-The extension of the file name determines the type of export. If it is
-@file{.html}, Org-mode will use the @file{htmlize.el} package to convert
-the buffer to HTML and save it to this file name. If the extension is
-@file{.ps}, @code{ps-print-buffer-with-faces} is used to produce
-Postscript output. If the extension is @file{.ics}, iCalendar export is
-run export over all files that were used to construct the agenda, and
-limit the export to entries listed in the agenda. Any other
-extension produces a plain ASCII file.
-
-The export files are @emph{not} created when you use one of those
-commands interactively because this might use too much overhead.
-Instead, there is a special command to produce @emph{all} specified
-files in one step:
-
-@table @kbd
-@orgcmd{C-c a e,org-store-agenda-views}
-Export all agenda views that have export file names associated with
-them.
-@end table
-
-You can use the options section of the custom agenda commands to also
-set options for the export commands. For example:
-
-@lisp
-(setq org-agenda-custom-commands
- '(("X" agenda ""
- ((ps-number-of-columns 2)
- (ps-landscape-mode t)
- (org-agenda-prefix-format " [ ] ")
- (org-agenda-with-colors nil)
- (org-agenda-remove-tags t))
- ("theagenda.ps"))))
-@end lisp
-
-@noindent
-This command sets two options for the Postscript exporter, to make it
-print in two columns in landscape format---the resulting page can be cut
-in two and then used in a paper agenda. The remaining settings modify
-the agenda prefix to omit category and scheduling information, and
-instead include a checkbox to check off items. We also remove the tags
-to make the lines compact, and we don't want to use colors for the
-black-and-white printer. Settings specified in
-@code{org-agenda-exporter-settings} will also apply, but the settings
-in @code{org-agenda-custom-commands} take precedence.
-
-@noindent
-From the command line you may also use
-@example
-emacs -f org-batch-store-agenda-views -kill
-@end example
-@noindent
-or, if you need to modify some parameters@footnote{Quoting depends on the
-system you use, please check the FAQ for examples.}
-@example
-emacs -eval '(org-batch-store-agenda-views \
- org-agenda-span month \
- org-agenda-start-day "2007-11-01" \
- org-agenda-include-diary nil \
- org-agenda-files (quote ("~/org/project.org")))' \
- -kill
-@end example
-@noindent
-which will create the agenda views restricted to the file
-@file{~/org/project.org}, without diary entries and with a 30-day
-extent.
-
-You can also extract agenda information in a way that allows further
-processing by other programs. See @ref{Extracting agenda information}, for
-more information.
-
-
-@node Agenda column view, , Exporting Agenda Views, Agenda Views
-@section Using column view in the agenda
-@cindex column view, in agenda
-@cindex agenda, column view
-
-Column view (@pxref{Column view}) is normally used to view and edit
-properties embedded in the hierarchical structure of an Org file. It can be
-quite useful to use column view also from the agenda, where entries are
-collected by certain criteria.
-
-@table @kbd
-@orgcmd{C-c C-x C-c,org-agenda-columns}
-Turn on column view in the agenda.
-@end table
-
-To understand how to use this properly, it is important to realize that the
-entries in the agenda are no longer in their proper outline environment.
-This causes the following issues:
-
-@enumerate
-@item
-@vindex org-columns-default-format
-@vindex org-overriding-columns-format
-Org needs to make a decision which @code{COLUMNS} format to use. Since the
-entries in the agenda are collected from different files, and different files
-may have different @code{COLUMNS} formats, this is a non-trivial problem.
-Org first checks if the variable @code{org-overriding-columns-format} is
-currently set, and if so, takes the format from there. Otherwise it takes
-the format associated with the first item in the agenda, or, if that item
-does not have a specific format (defined in a property, or in its file), it
-uses @code{org-columns-default-format}.
-@item
-@cindex property, special, CLOCKSUM
-If any of the columns has a summary type defined (@pxref{Column attributes}),
-turning on column view in the agenda will visit all relevant agenda files and
-make sure that the computations of this property are up to date. This is
-also true for the special @code{CLOCKSUM} property. Org will then sum the
-values displayed in the agenda. In the daily/weekly agenda, the sums will
-cover a single day; in all other views they cover the entire block. It is
-vital to realize that the agenda may show the same entry @emph{twice} (for
-example as scheduled and as a deadline), and it may show two entries from the
-same hierarchy (for example a @emph{parent} and its @emph{child}). In these
-cases, the summation in the agenda will lead to incorrect results because
-some values will count double.
-@item
-When the column view in the agenda shows the @code{CLOCKSUM}, that is always
-the entire clocked time for this item. So even in the daily/weekly agenda,
-the clocksum listed in column view may originate from times outside the
-current view. This has the advantage that you can compare these values with
-a column listing the planned total effort for a task---one of the major
-applications for column view in the agenda. If you want information about
-clocked time in the displayed period use clock table mode (press @kbd{R} in
-the agenda).
-@end enumerate
-
-
-@node Markup, Exporting, Agenda Views, Top
-@chapter Markup for rich export
-
-When exporting Org-mode documents, the exporter tries to reflect the
-structure of the document as accurately as possible in the backend. Since
-export targets like HTML, @LaTeX{}, or DocBook allow much richer formatting,
-Org-mode has rules on how to prepare text for rich export. This section
-summarizes the markup rules used in an Org-mode buffer.
-
-@menu
-* Structural markup elements:: The basic structure as seen by the exporter
-* Images and tables:: Tables and Images will be included
-* Literal examples:: Source code examples with special formatting
-* Include files:: Include additional files into a document
-* Index entries:: Making an index
-* Macro replacement:: Use macros to create complex output
-* Embedded LaTeX:: LaTeX can be freely used inside Org documents
-@end menu
-
-@node Structural markup elements, Images and tables, Markup, Markup
-@section Structural markup elements
-
-@menu
-* Document title:: Where the title is taken from
-* Headings and sections:: The document structure as seen by the exporter
-* Table of contents:: The if and where of the table of contents
-* Initial text:: Text before the first heading?
-* Lists:: Lists
-* Paragraphs:: Paragraphs
-* Footnote markup:: Footnotes
-* Emphasis and monospace:: Bold, italic, etc.
-* Horizontal rules:: Make a line
-* Comment lines:: What will *not* be exported
-@end menu
-
-@node Document title, Headings and sections, Structural markup elements, Structural markup elements
-@subheading Document title
-@cindex document title, markup rules
-
-@noindent
-The title of the exported document is taken from the special line
-
-@cindex #+TITLE
-@example
-#+TITLE: This is the title of the document
-@end example
-
-@noindent
-If this line does not exist, the title is derived from the first non-empty,
-non-comment line in the buffer. If no such line exists, or if you have
-turned off exporting of the text before the first headline (see below), the
-title will be the file name without extension.
-
-@cindex property, EXPORT_TITLE
-If you are exporting only a subtree by marking is as the region, the heading
-of the subtree will become the title of the document. If the subtree has a
-property @code{EXPORT_TITLE}, that will take precedence.
-
-@node Headings and sections, Table of contents, Document title, Structural markup elements
-@subheading Headings and sections
-@cindex headings and sections, markup rules
-
-@vindex org-export-headline-levels
-The outline structure of the document as described in @ref{Document
-Structure}, forms the basis for defining sections of the exported document.
-However, since the outline structure is also used for (for example) lists of
-tasks, only the first three outline levels will be used as headings. Deeper
-levels will become itemized lists. You can change the location of this
-switch globally by setting the variable @code{org-export-headline-levels}, or on a
-per-file basis with a line
-
-@cindex #+OPTIONS
-@example
-#+OPTIONS: H:4
-@end example
-
-@node Table of contents, Initial text, Headings and sections, Structural markup elements
-@subheading Table of contents
-@cindex table of contents, markup rules
-
-@vindex org-export-with-toc
-The table of contents is normally inserted directly before the first headline
-of the file. If you would like to get it to a different location, insert the
-string @code{[TABLE-OF-CONTENTS]} on a line by itself at the desired
-location. The depth of the table of contents is by default the same as the
-number of headline levels, but you can choose a smaller number, or turn off
-the table of contents entirely, by configuring the variable
-@code{org-export-with-toc}, or on a per-file basis with a line like
-
-@example
-#+OPTIONS: toc:2 (only to two levels in TOC)
-#+OPTIONS: toc:nil (no TOC at all)
-@end example
-
-@node Initial text, Lists, Table of contents, Structural markup elements
-@subheading Text before the first headline
-@cindex text before first headline, markup rules
-@cindex #+TEXT
-
-Org-mode normally exports the text before the first headline, and even uses
-the first line as the document title. The text will be fully marked up. If
-you need to include literal HTML, @LaTeX{}, or DocBook code, use the special
-constructs described below in the sections for the individual exporters.
-
-@vindex org-export-skip-text-before-1st-heading
-Some people like to use the space before the first headline for setup and
-internal links and therefore would like to control the exported text before
-the first headline in a different way. You can do so by setting the variable
-@code{org-export-skip-text-before-1st-heading} to @code{t}. On a per-file
-basis, you can get the same effect with @samp{#+OPTIONS: skip:t}.
-
-@noindent
-If you still want to have some text before the first headline, use the
-@code{#+TEXT} construct:
-
-@example
-#+OPTIONS: skip:t
-#+TEXT: This text will go before the *first* headline.
-#+TEXT: [TABLE-OF-CONTENTS]
-#+TEXT: This goes between the table of contents and the first headline
-@end example
-
-@node Lists, Paragraphs, Initial text, Structural markup elements
-@subheading Lists
-@cindex lists, markup rules
-
-Plain lists as described in @ref{Plain lists}, are translated to the backend's
-syntax for such lists. Most backends support unordered, ordered, and
-description lists.
-
-@node Paragraphs, Footnote markup, Lists, Structural markup elements
-@subheading Paragraphs, line breaks, and quoting
-@cindex paragraphs, markup rules
-
-Paragraphs are separated by at least one empty line. If you need to enforce
-a line break within a paragraph, use @samp{\\} at the end of a line.
-
-To keep the line breaks in a region, but otherwise use normal formatting, you
-can use this construct, which can also be used to format poetry.
-
-@cindex #+BEGIN_VERSE
-@example
-#+BEGIN_VERSE
- Great clouds overhead
- Tiny black birds rise and fall
- Snow covers Emacs
-
- -- AlexSchroeder
-#+END_VERSE
-@end example
-
-When quoting a passage from another document, it is customary to format this
-as a paragraph that is indented on both the left and the right margin. You
-can include quotations in Org-mode documents like this:
-
-@cindex #+BEGIN_QUOTE
-@example
-#+BEGIN_QUOTE
-Everything should be made as simple as possible,
-but not any simpler -- Albert Einstein
-#+END_QUOTE
-@end example
-
-If you would like to center some text, do it like this:
-@cindex #+BEGIN_CENTER
-@example
-#+BEGIN_CENTER
-Everything should be made as simple as possible, \\
-but not any simpler
-#+END_CENTER
-@end example
-
-
-@node Footnote markup, Emphasis and monospace, Paragraphs, Structural markup elements
-@subheading Footnote markup
-@cindex footnotes, markup rules
-@cindex @file{footnote.el}
-
-Footnotes defined in the way described in @ref{Footnotes}, will be exported by
-all backends. Org allows multiple references to the same note, and
-different backends support this to varying degrees.
-
-@node Emphasis and monospace, Horizontal rules, Footnote markup, Structural markup elements
-@subheading Emphasis and monospace
-
-@cindex underlined text, markup rules
-@cindex bold text, markup rules
-@cindex italic text, markup rules
-@cindex verbatim text, markup rules
-@cindex code text, markup rules
-@cindex strike-through text, markup rules
-You can make words @b{*bold*}, @i{/italic/}, _underlined_, @code{=code=}
-and @code{~verbatim~}, and, if you must, @samp{+strike-through+}. Text
-in the code and verbatim string is not processed for Org-mode specific
-syntax; it is exported verbatim.
-
-@node Horizontal rules, Comment lines, Emphasis and monospace, Structural markup elements
-@subheading Horizontal rules
-@cindex horizontal rules, markup rules
-A line consisting of only dashes, and at least 5 of them, will be
-exported as a horizontal line (@samp{<hr/>} in HTML).
-
-@node Comment lines, , Horizontal rules, Structural markup elements
-@subheading Comment lines
-@cindex comment lines
-@cindex exporting, not
-@cindex #+BEGIN_COMMENT
-
-Lines starting with @samp{#} in column zero are treated as comments and will
-never be exported. If you want an indented line to be treated as a comment,
-start it with @samp{#+ }. Also entire subtrees starting with the word
-@samp{COMMENT} will never be exported. Finally, regions surrounded by
-@samp{#+BEGIN_COMMENT} ... @samp{#+END_COMMENT} will not be exported.
-
-@table @kbd
-@kindex C-c ;
-@item C-c ;
-Toggle the COMMENT keyword at the beginning of an entry.
-@end table
-
-
-@node Images and tables, Literal examples, Structural markup elements, Markup
-@section Images and Tables
-
-@cindex tables, markup rules
-@cindex #+CAPTION
-@cindex #+LABEL
-Both the native Org-mode tables (@pxref{Tables}) and tables formatted with
-the @file{table.el} package will be exported properly. For Org-mode tables,
-the lines before the first horizontal separator line will become table header
-lines. You can use the following lines somewhere before the table to assign
-a caption and a label for cross references, and in the text you can refer to
-the object with @code{\ref@{tab:basic-data@}}:
-
-@example
-#+CAPTION: This is the caption for the next table (or link)
-#+LABEL: tbl:basic-data
- | ... | ...|
- |-----|----|
-@end example
-
-@cindex inlined images, markup rules
-Some backends (HTML, @LaTeX{}, and DocBook) allow you to directly include
-images into the exported document. Org does this, if a link to an image
-files does not have a description part, for example @code{[[./img/a.jpg]]}.
-If you wish to define a caption for the image and maybe a label for internal
-cross references, make sure that the link is on a line by itself and precede
-it with @code{#+CAPTION} and @code{#+LABEL} as follows:
-
-@example
-#+CAPTION: This is the caption for the next figure link (or table)
-#+LABEL: fig:SED-HR4049
-[[./img/a.jpg]]
-@end example
-
-You may also define additional attributes for the figure. As this is
-backend-specific, see the sections about the individual backends for more
-information.
-
-@xref{Handling links,the discussion of image links}.
-
-@node Literal examples, Include files, Images and tables, Markup
-@section Literal examples
-@cindex literal examples, markup rules
-@cindex code line references, markup rules
-
-You can include literal examples that should not be subjected to
-markup. Such examples will be typeset in monospace, so this is well suited
-for source code and similar examples.
-@cindex #+BEGIN_EXAMPLE
-
-@example
-#+BEGIN_EXAMPLE
-Some example from a text file.
-#+END_EXAMPLE
-@end example
-
-Note that such blocks may be @i{indented} in order to align nicely with
-indented text and in particular with plain list structure (@pxref{Plain
-lists}). For simplicity when using small examples, you can also start the
-example lines with a colon followed by a space. There may also be additional
-whitespace before the colon:
-
-@example
-Here is an example
- : Some example from a text file.
-@end example
-
-@cindex formatting source code, markup rules
-If the example is source code from a programming language, or any other text
-that can be marked up by font-lock in Emacs, you can ask for the example to
-look like the fontified Emacs buffer@footnote{This works automatically for
-the HTML backend (it requires version 1.34 of the @file{htmlize.el} package,
-which is distributed with Org). Fontified code chunks in LaTeX can be
-achieved using either the listings or the
-@url{http://code.google.com/p/minted, minted,} package. To use listings, turn
-on the variable @code{org-export-latex-listings} and ensure that the listings
-package is included by the LaTeX header (e.g. by configuring
-@code{org-export-latex-packages-alist}). See the listings documentation for
-configuration options, including obtaining colored output. For minted it is
-necessary to install the program @url{http://pygments.org, pygments}, in
-addition to setting @code{org-export-latex-minted}, ensuring that the minted
-package is included by the LaTeX header, and ensuring that the
-@code{-shell-escape} option is passed to @file{pdflatex} (see
-@code{org-latex-to-pdf-process}). See the documentation of the variables
-@code{org-export-latex-listings} and @code{org-export-latex-minted} for
-further details.}. This is done with the @samp{src} block, where you also
-need to specify the name of the major mode that should be used to fontify the
-example:
-@cindex #+BEGIN_SRC
-
-@example
-#+BEGIN_SRC emacs-lisp
- (defun org-xor (a b)
- "Exclusive or."
- (if a (not b) b))
-#+END_SRC
-@end example
-
-Both in @code{example} and in @code{src} snippets, you can add a @code{-n}
-switch to the end of the @code{BEGIN} line, to get the lines of the example
-numbered. If you use a @code{+n} switch, the numbering from the previous
-numbered snippet will be continued in the current one. In literal examples,
-Org will interpret strings like @samp{(ref:name)} as labels, and use them as
-targets for special hyperlinks like @code{[[(name)]]} (i.e. the reference name
-enclosed in single parenthesis). In HTML, hovering the mouse over such a
-link will remote-highlight the corresponding code line, which is kind of
-cool.
-
-You can also add a @code{-r} switch which @i{removes} the labels from the
-source code@footnote{Adding @code{-k} to @code{-n -r} will @i{keep} the
-labels in the source code while using line numbers for the links, which might
-be useful to explain those in an org-mode example code.}. With the @code{-n}
-switch, links to these references will be labeled by the line numbers from
-the code listing, otherwise links will use the labels with no parentheses.
-Here is an example:
-
-@example
-#+BEGIN_SRC emacs-lisp -n -r
-(save-excursion (ref:sc)
- (goto-char (point-min)) (ref:jump)
-#+END_SRC
-In line [[(sc)]] we remember the current position. [[(jump)][Line (jump)]]
-jumps to point-min.
-@end example
-
-@vindex org-coderef-label-format
-If the syntax for the label format conflicts with the language syntax, use a
-@code{-l} switch to change the format, for example @samp{#+BEGIN_SRC pascal
--n -r -l "((%s))"}. See also the variable @code{org-coderef-label-format}.
-
-HTML export also allows examples to be published as text areas, @xref{Text
-areas in HTML export}.
-
-@table @kbd
-@kindex C-c '
-@item C-c '
-Edit the source code example at point in its native mode. This works by
-switching to a temporary buffer with the source code. You need to exit by
-pressing @kbd{C-c '} again@footnote{Upon exit, lines starting with @samp{*}
-or @samp{#} will get a comma prepended, to keep them from being interpreted
-by Org as outline nodes or special comments. These commas will be stripped
-for editing with @kbd{C-c '}, and also for export.}. The edited version will
-then replace the old version in the Org buffer. Fixed-width regions
-(where each line starts with a colon followed by a space) will be edited
-using @code{artist-mode}@footnote{You may select a different-mode with the
-variable @code{org-edit-fixed-width-region-mode}.} to allow creating ASCII
-drawings easily. Using this command in an empty line will create a new
-fixed-width region.
-@kindex C-c l
-@item C-c l
-Calling @code{org-store-link} while editing a source code example in a
-temporary buffer created with @kbd{C-c '} will prompt for a label. Make sure
-that it is unique in the current buffer, and insert it with the proper
-formatting like @samp{(ref:label)} at the end of the current line. Then the
-label is stored as a link @samp{(label)}, for retrieval with @kbd{C-c C-l}.
-@end table
-
-
-@node Include files, Index entries, Literal examples, Markup
-@section Include files
-@cindex include files, markup rules
-
-During export, you can include the content of another file. For example, to
-include your @file{.emacs} file, you could use:
-@cindex #+INCLUDE
-
-@example
-#+INCLUDE: "~/.emacs" src emacs-lisp
-@end example
-@noindent
-The optional second and third parameter are the markup (e.g. @samp{quote},
-@samp{example}, or @samp{src}), and, if the markup is @samp{src}, the
-language for formatting the contents. The markup is optional; if it is not
-given, the text will be assumed to be in Org-mode format and will be
-processed normally. The include line will also allow additional keyword
-parameters @code{:prefix1} and @code{:prefix} to specify prefixes for the
-first line and for each following line, @code{:minlevel} in order to get
-org-mode content demoted to a specified level, as well as any options
-accepted by the selected markup. For example, to include a file as an item,
-use
-
-@example
-#+INCLUDE: "~/snippets/xx" :prefix1 " + " :prefix " "
-@end example
-
-@table @kbd
-@kindex C-c '
-@item C-c '
-Visit the include file at point.
-@end table
-
-@node Index entries, Macro replacement, Include files, Markup
-@section Index entries
-@cindex index entries, for publishing
-
-You can specify entries that will be used for generating an index during
-publishing. This is done by lines starting with @code{#+INDEX}. An entry
-the contains an exclamation mark will create a sub item. See @ref{Generating
-an index} for more information.
-
-@example
-* Curriculum Vitae
-#+INDEX: CV
-#+INDEX: Application!CV
-@end example
-
-
-
-
-@node Macro replacement, Embedded LaTeX, Index entries, Markup
-@section Macro replacement
-@cindex macro replacement, during export
-@cindex #+MACRO
-
-You can define text snippets with
-
-@example
-#+MACRO: name replacement text $1, $2 are arguments
-@end example
-
-@noindent which can be referenced anywhere in the document (even in
-code examples) with @code{@{@{@{name(arg1,arg2)@}@}@}}. In addition to
-defined macros, @code{@{@{@{title@}@}@}}, @code{@{@{@{author@}@}@}}, etc.,
-will reference information set by the @code{#+TITLE:}, @code{#+AUTHOR:}, and
-similar lines. Also, @code{@{@{@{date(@var{FORMAT})@}@}@}} and
-@code{@{@{@{modification-time(@var{FORMAT})@}@}@}} refer to current date time
-and to the modification time of the file being exported, respectively.
-@var{FORMAT} should be a format string understood by
-@code{format-time-string}.
-
-Macro expansion takes place during export, and some people use it to
-construct complex HTML code.
-
-
-@node Embedded LaTeX, , Macro replacement, Markup
-@section Embedded @LaTeX{}
-@cindex @TeX{} interpretation
-@cindex @LaTeX{} interpretation
-
-Plain ASCII is normally sufficient for almost all note taking. Exceptions
-include scientific notes, which often require mathematical symbols and the
-occasional formula. @LaTeX{}@footnote{@LaTeX{} is a macro system based on
-Donald E. Knuth's @TeX{} system. Many of the features described here as
-``@LaTeX{}'' are really from @TeX{}, but for simplicity I am blurring this
-distinction.} is widely used to typeset scientific documents. Org-mode
-supports embedding @LaTeX{} code into its files, because many academics are
-used to writing and reading @LaTeX{} source code, and because it can be
-readily processed to produce pretty output for a number of export backends.
-
-@menu
-* Special symbols:: Greek letters and other symbols
-* Subscripts and superscripts:: Simple syntax for raising/lowering text
-* LaTeX fragments:: Complex formulas made easy
-* Previewing LaTeX fragments:: What will this snippet look like?
-* CDLaTeX mode:: Speed up entering of formulas
-@end menu
-
-@node Special symbols, Subscripts and superscripts, Embedded LaTeX, Embedded LaTeX
-@subsection Special symbols
-@cindex math symbols
-@cindex special symbols
-@cindex @TeX{} macros
-@cindex @LaTeX{} fragments, markup rules
-@cindex HTML entities
-@cindex @LaTeX{} entities
-
-You can use @LaTeX{} macros to insert special symbols like @samp{\alpha} to
-indicate the Greek letter, or @samp{\to} to indicate an arrow. Completion
-for these macros is available, just type @samp{\} and maybe a few letters,
-and press @kbd{M-@key{TAB}} to see possible completions. Unlike @LaTeX{}
-code, Org-mode allows these macros to be present without surrounding math
-delimiters, for example:
-
-@example
-Angles are written as Greek letters \alpha, \beta and \gamma.
-@end example
-
-@vindex org-entities
-During export, these symbols will be transformed into the native format of
-the exporter backend. Strings like @code{\alpha} will be exported as
-@code{&alpha;} in the HTML output, and as @code{$\alpha$} in the @LaTeX{}
-output. Similarly, @code{\nbsp} will become @code{&nbsp;} in HTML and
-@code{~} in @LaTeX{}. If you need such a symbol inside a word, terminate it
-like this: @samp{\Aacute@{@}stor}.
-
-A large number of entities is provided, with names taken from both HTML and
-@LaTeX{}; see the variable @code{org-entities} for the complete list.
-@samp{\-} is treated as a shy hyphen, and @samp{--}, @samp{---}, and
-@samp{...} are all converted into special commands creating hyphens of
-different lengths or a compact set of dots.
-
-If you would like to see entities displayed as UTF8 characters, use the
-following command@footnote{You can turn this on by default by setting the
-variable @code{org-pretty-entities}, or on a per-file base with the
-@code{#+STARTUP} option @code{entitiespretty}.}:
-
-@table @kbd
-@kindex C-c C-x \
-@item C-c C-x \
-Toggle display of entities as UTF-8 characters. This does not change the
-buffer content which remains plain ASCII, but it overlays the UTF-8 character
-for display purposes only.
-@end table
-
-@node Subscripts and superscripts, LaTeX fragments, Special symbols, Embedded LaTeX
-@subsection Subscripts and superscripts
-@cindex subscript
-@cindex superscript
-
-Just like in @LaTeX{}, @samp{^} and @samp{_} are used to indicate super-
-and subscripts. Again, these can be used without embedding them in
-math-mode delimiters. To increase the readability of ASCII text, it is
-not necessary (but OK) to surround multi-character sub- and superscripts
-with curly braces. For example
-
-@example
-The mass of the sun is M_sun = 1.989 x 10^30 kg. The radius of
-the sun is R_@{sun@} = 6.96 x 10^8 m.
-@end example
-
-@vindex org-export-with-sub-superscripts
-To avoid interpretation as raised or lowered text, you can quote @samp{^} and
-@samp{_} with a backslash: @samp{\^} and @samp{\_}. If you write a text
-where the underscore is often used in a different context, Org's convention
-to always interpret these as subscripts can get in your way. Configure the
-variable @code{org-export-with-sub-superscripts} to globally change this
-convention, or use, on a per-file basis:
-
-@example
-#+OPTIONS: ^:@{@}
-@end example
-
-@noindent With this setting, @samp{a_b} will not be interpreted as a
-subscript, but @samp{a_@{b@}} will.
-
-@table @kbd
-@kindex C-c C-x \
-@item C-c C-x \
-In addition to showing entities as UTF-8 characters, this command will also
-format sub- and superscripts in a WYSIWYM way.
-@end table
-
-@node LaTeX fragments, Previewing LaTeX fragments, Subscripts and superscripts, Embedded LaTeX
-@subsection @LaTeX{} fragments
-@cindex @LaTeX{} fragments
-
-@vindex org-format-latex-header
-Going beyond symbols and sub- and superscripts, a full formula language is
-needed. Org-mode can contain @LaTeX{} math fragments, and it supports ways
-to process these for several export backends. When exporting to @LaTeX{},
-the code is obviously left as it is. When exporting to HTML, Org invokes the
-@uref{http://www.mathjax.org, MathJax library} (@pxref{Math formatting in
-HTML export}) to process and display the math@footnote{If you plan to use
-this regularly or on pages with significant page views, you should install
-@file{MathJax} on your own
-server in order to limit the load of our server.}. Finally, it can also
-process the mathematical expressions into images@footnote{For this to work
-you need to be on a system with a working @LaTeX{} installation. You also
-need the @file{dvipng} program, available at
-@url{http://sourceforge.net/projects/dvipng/}. The @LaTeX{} header that will
-be used when processing a fragment can be configured with the variable
-@code{org-format-latex-header}.} that can be displayed in a browser or in
-DocBook documents.
-
-@LaTeX{} fragments don't need any special marking at all. The following
-snippets will be identified as @LaTeX{} source code:
-@itemize @bullet
-@item
-Environments of any kind@footnote{When @file{MathJax} is used, only the
-environment recognized by @file{MathJax} will be processed. When
-@file{dvipng} is used to create images, any @LaTeX{} environments will be
-handled.}. The only requirement is that the @code{\begin} statement appears
-on a new line, preceded by only whitespace.
-@item
-Text within the usual @LaTeX{} math delimiters. To avoid conflicts with
-currency specifications, single @samp{$} characters are only recognized as
-math delimiters if the enclosed text contains at most two line breaks, is
-directly attached to the @samp{$} characters with no whitespace in between,
-and if the closing @samp{$} is followed by whitespace, punctuation or a dash.
-For the other delimiters, there is no such restriction, so when in doubt, use
-@samp{\(...\)} as inline math delimiters.
-@end itemize
-
-@noindent For example:
-
-@example
-\begin@{equation@} % arbitrary environments,
-x=\sqrt@{b@} % even tables, figures
-\end@{equation@} % etc
-
-If $a^2=b$ and \( b=2 \), then the solution must be
-either $$ a=+\sqrt@{2@} $$ or \[ a=-\sqrt@{2@} \].
-@end example
-
-@noindent
-@vindex org-format-latex-options
-If you need any of the delimiter ASCII sequences for other purposes, you
-can configure the option @code{org-format-latex-options} to deselect the
-ones you do not wish to have interpreted by the @LaTeX{} converter.
-
-@vindex org-export-with-LaTeX-fragments
-LaTeX processing can be configured with the variable
-@code{org-export-with-LaTeX-fragments}. The default setting is @code{t}
-which means @file{MathJax} for HTML, and no processing for DocBook, ASCII and
-LaTeX backends. You can also set this variable on a per-file basis using one
-of these lines:
-
-@example
-#+OPTIONS: LaTeX:t @r{Do the right thing automatically (MathJax)}
-#+OPTIONS: LaTeX:dvipng @r{Force using dvipng images}
-#+OPTIONS: LaTeX:nil @r{Do not process @LaTeX{} fragments at all}
-#+OPTIONS: LaTeX:verbatim @r{Verbatim export, for jsMath or so}
-@end example
-
-@node Previewing LaTeX fragments, CDLaTeX mode, LaTeX fragments, Embedded LaTeX
-@subsection Previewing LaTeX fragments
-@cindex LaTeX fragments, preview
-
-If you have @file{dvipng} installed, @LaTeX{} fragments can be processed to
-produce preview images of the typeset expressions:
-
-@table @kbd
-@kindex C-c C-x C-l
-@item C-c C-x C-l
-Produce a preview image of the @LaTeX{} fragment at point and overlay it
-over the source code. If there is no fragment at point, process all
-fragments in the current entry (between two headlines). When called
-with a prefix argument, process the entire subtree. When called with
-two prefix arguments, or when the cursor is before the first headline,
-process the entire buffer.
-@kindex C-c C-c
-@item C-c C-c
-Remove the overlay preview images.
-@end table
-
-@vindex org-format-latex-options
-You can customize the variable @code{org-format-latex-options} to influence
-some aspects of the preview. In particular, the @code{:scale} (and for HTML
-export, @code{:html-scale}) property can be used to adjust the size of the
-preview images.
-
-@node CDLaTeX mode, , Previewing LaTeX fragments, Embedded LaTeX
-@subsection Using CDLa@TeX{} to enter math
-@cindex CDLa@TeX{}
-
-CDLa@TeX{} mode is a minor mode that is normally used in combination with a
-major @LaTeX{} mode like AUC@TeX{} in order to speed-up insertion of
-environments and math templates. Inside Org-mode, you can make use of
-some of the features of CDLa@TeX{} mode. You need to install
-@file{cdlatex.el} and @file{texmathp.el} (the latter comes also with
-AUC@TeX{}) from @url{http://www.astro.uva.nl/~dominik/Tools/cdlatex}.
-Don't use CDLa@TeX{} mode itself under Org-mode, but use the light
-version @code{org-cdlatex-mode} that comes as part of Org-mode. Turn it
-on for the current buffer with @code{M-x org-cdlatex-mode}, or for all
-Org files with
-
-@lisp
-(add-hook 'org-mode-hook 'turn-on-org-cdlatex)
-@end lisp
-
-When this mode is enabled, the following features are present (for more
-details see the documentation of CDLa@TeX{} mode):
-@itemize @bullet
-@kindex C-c @{
-@item
-Environment templates can be inserted with @kbd{C-c @{}.
-@item
-@kindex @key{TAB}
-The @key{TAB} key will do template expansion if the cursor is inside a
-@LaTeX{} fragment@footnote{Org-mode has a method to test if the cursor is
-inside such a fragment, see the documentation of the function
-@code{org-inside-LaTeX-fragment-p}.}. For example, @key{TAB} will
-expand @code{fr} to @code{\frac@{@}@{@}} and position the cursor
-correctly inside the first brace. Another @key{TAB} will get you into
-the second brace. Even outside fragments, @key{TAB} will expand
-environment abbreviations at the beginning of a line. For example, if
-you write @samp{equ} at the beginning of a line and press @key{TAB},
-this abbreviation will be expanded to an @code{equation} environment.
-To get a list of all abbreviations, type @kbd{M-x cdlatex-command-help}.
-@item
-@kindex _
-@kindex ^
-@vindex cdlatex-simplify-sub-super-scripts
-Pressing @kbd{_} and @kbd{^} inside a @LaTeX{} fragment will insert these
-characters together with a pair of braces. If you use @key{TAB} to move
-out of the braces, and if the braces surround only a single character or
-macro, they are removed again (depending on the variable
-@code{cdlatex-simplify-sub-super-scripts}).
-@item
-@kindex `
-Pressing the backquote @kbd{`} followed by a character inserts math
-macros, also outside @LaTeX{} fragments. If you wait more than 1.5 seconds
-after the backquote, a help window will pop up.
-@item
-@kindex '
-Pressing the single-quote @kbd{'} followed by another character modifies
-the symbol before point with an accent or a font. If you wait more than
-1.5 seconds after the single-quote, a help window will pop up. Character
-modification will work only inside @LaTeX{} fragments; outside the quote
-is normal.
-@end itemize
-
-@node Exporting, Publishing, Markup, Top
-@chapter Exporting
-@cindex exporting
-
-Org-mode documents can be exported into a variety of other formats. For
-printing and sharing of notes, ASCII export produces a readable and simple
-version of an Org file. HTML export allows you to publish a notes file on
-the web, while the XOXO format provides a solid base for exchange with a
-broad range of other applications. @LaTeX{} export lets you use Org-mode and
-its structured editing functions to easily create @LaTeX{} files. DocBook
-export makes it possible to convert Org files to many other formats using
-DocBook tools. For project management you can create gantt and resource
-charts by using TaskJuggler export. To incorporate entries with associated
-times like deadlines or appointments into a desktop calendar program like
-iCal, Org-mode can also produce extracts in the iCalendar format. Currently
-Org-mode only supports export, not import of these different formats.
-
-Org supports export of selected regions when @code{transient-mark-mode} is
-enabled (default in Emacs 23).
-
-@menu
-* Selective export:: Using tags to select and exclude trees
-* Export options:: Per-file export settings
-* The export dispatcher:: How to access exporter commands
-* ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding
-* HTML export:: Exporting to HTML
-* LaTeX and PDF export:: Exporting to @LaTeX{}, and processing to PDF
-* DocBook export:: Exporting to DocBook
-* TaskJuggler export:: Exporting to TaskJuggler
-* Freemind export:: Exporting to Freemind mind maps
-* XOXO export:: Exporting to XOXO
-* iCalendar export:: Exporting in iCalendar format
-@end menu
-
-@node Selective export, Export options, Exporting, Exporting
-@section Selective export
-@cindex export, selective by tags
-
-@vindex org-export-select-tags
-@vindex org-export-exclude-tags
-You may use tags to select the parts of a document that should be exported,
-or to exclude parts from export. This behavior is governed by two variables:
-@code{org-export-select-tags} and @code{org-export-exclude-tags}.
-
-Org first checks if any of the @emph{select} tags is present in the buffer.
-If yes, all trees that do not carry one of these tags will be excluded. If a
-selected tree is a subtree, the heading hierarchy above it will also be
-selected for export, but not the text below those headings.
-
-@noindent
-If none of the select tags is found, the whole buffer will be selected for
-export.
-
-@noindent
-Finally, all subtrees that are marked by any of the @emph{exclude} tags will
-be removed from the export buffer.
-
-@node Export options, The export dispatcher, Selective export, Exporting
-@section Export options
-@cindex options, for export
-
-@cindex completion, of option keywords
-The exporter recognizes special lines in the buffer which provide
-additional information. These lines may be put anywhere in the file.
-The whole set of lines can be inserted into the buffer with @kbd{C-c
-C-e t}. For individual lines, a good way to make sure the keyword is
-correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion
-(@pxref{Completion}). For a summary of other in-buffer settings not
-specifically related to export, see @ref{In-buffer settings}.
-In particular, note that you can place commonly-used (export) options in
-a separate file which can be included using @code{#+SETUPFILE}.
-
-@table @kbd
-@orgcmd{C-c C-e t,org-insert-export-options-template}
-Insert template with export options, see example below.
-@end table
-
-@cindex #+TITLE
-@cindex #+AUTHOR
-@cindex #+DATE
-@cindex #+EMAIL
-@cindex #+DESCRIPTION
-@cindex #+KEYWORDS
-@cindex #+LANGUAGE
-@cindex #+TEXT
-@cindex #+OPTIONS
-@cindex #+BIND
-@cindex #+LINK_UP
-@cindex #+LINK_HOME
-@cindex #+EXPORT_SELECT_TAGS
-@cindex #+EXPORT_EXCLUDE_TAGS
-@cindex #+XSLT
-@cindex #+LATEX_HEADER
-@vindex user-full-name
-@vindex user-mail-address
-@vindex org-export-default-language
-@example
-#+TITLE: the title to be shown (default is the buffer name)
-#+AUTHOR: the author (default taken from @code{user-full-name})
-#+DATE: a date, fixed, or a format string for @code{format-time-string}
-#+EMAIL: his/her email address (default from @code{user-mail-address})
-#+DESCRIPTION: the page description, e.g. for the XHTML meta tag
-#+KEYWORDS: the page keywords, e.g. for the XHTML meta tag
-#+LANGUAGE: language for HTML, e.g. @samp{en} (@code{org-export-default-language})
-#+TEXT: Some descriptive text to be inserted at the beginning.
-#+TEXT: Several lines may be given.
-#+OPTIONS: H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t f:t TeX:t ...
-#+BIND: lisp-var lisp-val, e.g.: org-export-latex-low-levels itemize
- @r{You need to confirm using these, or configure @code{org-export-allow-BIND}}
-#+LINK_UP: the ``up'' link of an exported page
-#+LINK_HOME: the ``home'' link of an exported page
-#+LATEX_HEADER: extra line(s) for the LaTeX header, like \usepackage@{xyz@}
-#+EXPORT_SELECT_TAGS: Tags that select a tree for export
-#+EXPORT_EXCLUDE_TAGS: Tags that exclude a tree from export
-#+XSLT: the XSLT stylesheet used by DocBook exporter to generate FO file
-@end example
-
-@noindent
-The OPTIONS line is a compact@footnote{If you want to configure many options
-this way, you can use several OPTIONS lines.} form to specify export
-settings. Here you can:
-@cindex headline levels
-@cindex section-numbers
-@cindex table of contents
-@cindex line-break preservation
-@cindex quoted HTML tags
-@cindex fixed-width sections
-@cindex tables
-@cindex @TeX{}-like syntax for sub- and superscripts
-@cindex footnotes
-@cindex special strings
-@cindex emphasized text
-@cindex @TeX{} macros
-@cindex @LaTeX{} fragments
-@cindex author info, in export
-@cindex time info, in export
-@example
-H: @r{set the number of headline levels for export}
-num: @r{turn on/off section-numbers}
-toc: @r{turn on/off table of contents, or set level limit (integer)}
-\n: @r{turn on/off line-break-preservation (DOES NOT WORK)}
-@@: @r{turn on/off quoted HTML tags}
-:: @r{turn on/off fixed-width sections}
-|: @r{turn on/off tables}
-^: @r{turn on/off @TeX{}-like syntax for sub- and superscripts. If}
- @r{you write "^:@{@}", @code{a_@{b@}} will be interpreted, but}
- @r{the simple @code{a_b} will be left as it is.}
--: @r{turn on/off conversion of special strings.}
-f: @r{turn on/off footnotes like this[1].}
-todo: @r{turn on/off inclusion of TODO keywords into exported text}
-pri: @r{turn on/off priority cookies}
-tags: @r{turn on/off inclusion of tags, may also be @code{not-in-toc}}
-<: @r{turn on/off inclusion of any time/date stamps like DEADLINES}
-*: @r{turn on/off emphasized text (bold, italic, underlined)}
-TeX: @r{turn on/off simple @TeX{} macros in plain text}
-LaTeX: @r{configure export of @LaTeX{} fragments. Default @code{auto}}
-skip: @r{turn on/off skipping the text before the first heading}
-author: @r{turn on/off inclusion of author name/email into exported file}
-email: @r{turn on/off inclusion of author email into exported file}
-creator: @r{turn on/off inclusion of creator info into exported file}
-timestamp: @r{turn on/off inclusion creation time into exported file}
-d: @r{turn on/off inclusion of drawers}
-@end example
-@noindent
-These options take effect in both the HTML and @LaTeX{} export, except for
-@code{TeX} and @code{LaTeX}, which are respectively @code{t} and @code{nil}
-for the @LaTeX{} export. The default values for these and many other options
-are given by a set of variables. For a list of such variables, the
-corresponding OPTIONS keys and also the publishing keys (@pxref{Project
-alist}), see the constant @code{org-export-plist-vars}.
-
-When exporting only a single subtree by selecting it with @kbd{C-c @@} before
-calling an export command, the subtree can overrule some of the file's export
-settings with properties @code{EXPORT_FILE_NAME}, @code{EXPORT_TITLE},
-@code{EXPORT_TEXT}, @code{EXPORT_AUTHOR}, @code{EXPORT_DATE}, and
-@code{EXPORT_OPTIONS}.
-
-@node The export dispatcher, ASCII/Latin-1/UTF-8 export, Export options, Exporting
-@section The export dispatcher
-@cindex dispatcher, for export commands
-
-All export commands can be reached using the export dispatcher, which is a
-prefix key that prompts for an additional key specifying the command.
-Normally the entire file is exported, but if there is an active region that
-contains one outline tree, the first heading is used as document title and
-the subtrees are exported.
-
-@table @kbd
-@orgcmd{C-c C-e,org-export}
-@vindex org-export-run-in-background
-Dispatcher for export and publishing commands. Displays a help-window
-listing the additional key(s) needed to launch an export or publishing
-command. The prefix arg is passed through to the exporter. A double prefix
-@kbd{C-u C-u} causes most commands to be executed in the background, in a
-separate Emacs process@footnote{To make this behavior the default, customize
-the variable @code{org-export-run-in-background}.}.
-@orgcmd{C-c C-e v,org-export-visible}
-Like @kbd{C-c C-e}, but only export the text that is currently visible
-(i.e. not hidden by outline visibility).
-@orgcmd{C-u C-u C-c C-e,org-export}
-@vindex org-export-run-in-background
-Call the exporter, but reverse the setting of
-@code{org-export-run-in-background}, i.e. request background processing if
-not set, or force processing in the current Emacs process if set.
-@end table
-
-@node ASCII/Latin-1/UTF-8 export, HTML export, The export dispatcher, Exporting
-@section ASCII/Latin-1/UTF-8 export
-@cindex ASCII export
-@cindex Latin-1 export
-@cindex UTF-8 export
-
-ASCII export produces a simple and very readable version of an Org-mode
-file, containing only plain ASCII. Latin-1 and UTF-8 export augment the file
-with special characters and symbols available in these encodings.
-
-@cindex region, active
-@cindex active region
-@cindex transient-mark-mode
-@table @kbd
-@orgcmd{C-c C-e a,org-export-as-ascii}
-@cindex property, EXPORT_FILE_NAME
-Export as ASCII file. For an Org file, @file{myfile.org}, the ASCII file
-will be @file{myfile.txt}. The file will be overwritten without
-warning. If there is an active region@footnote{This requires
-@code{transient-mark-mode} be turned on.}, only the region will be
-exported. If the selected region is a single tree@footnote{To select the
-current subtree, use @kbd{C-c @@}.}, the tree head will
-become the document title. If the tree head entry has or inherits an
-@code{EXPORT_FILE_NAME} property, that name will be used for the
-export.
-@orgcmd{C-c C-e A,org-export-as-ascii-to-buffer}
-Export to a temporary buffer. Do not create a file.
-@orgcmd{C-c C-e n,org-export-as-latin1}
-@xorgcmd{C-c C-e N,org-export-as-latin1-to-buffer}
-Like the above commands, but use Latin-1 encoding.
-@orgcmd{C-c C-e u,org-export-as-utf8}
-@xorgcmd{C-c C-e U,org-export-as-utf8-to-buffer}
-Like the above commands, but use UTF-8 encoding.
-@item C-c C-e v a/n/u
-Export only the visible part of the document.
-@end table
-
-@cindex headline levels, for exporting
-In the exported version, the first 3 outline levels will become
-headlines, defining a general document structure. Additional levels
-will be exported as itemized lists. If you want that transition to occur
-at a different level, specify it with a prefix argument. For example,
-
-@example
-@kbd{C-1 C-c C-e a}
-@end example
-
-@noindent
-creates only top level headlines and does the rest as items. When
-headlines are converted to items, the indentation of the text following
-the headline is changed to fit nicely under the item. This is done with
-the assumption that the first body line indicates the base indentation of
-the body text. Any indentation larger than this is adjusted to preserve
-the layout relative to the first line. Should there be lines with less
-indentation than the first, these are left alone.
-
-@vindex org-export-ascii-links-to-notes
-Links will be exported in a footnote-like style, with the descriptive part in
-the text and the link in a note before the next heading. See the variable
-@code{org-export-ascii-links-to-notes} for details and other options.
-
-@node HTML export, LaTeX and PDF export, ASCII/Latin-1/UTF-8 export, Exporting
-@section HTML export
-@cindex HTML export
-
-Org-mode contains an HTML (XHTML 1.0 strict) exporter with extensive
-HTML formatting, in ways similar to John Gruber's @emph{markdown}
-language, but with additional support for tables.
-
-@menu
-* HTML Export commands:: How to invoke HTML export
-* Quoting HTML tags:: Using direct HTML in Org-mode
-* Links in HTML export:: How links will be interpreted and formatted
-* Tables in HTML export:: How to modify the formatting of tables
-* Images in HTML export:: How to insert figures into HTML output
-* Math formatting in HTML export:: Beautiful math also on the web
-* Text areas in HTML export:: An alternative way to show an example
-* CSS support:: Changing the appearance of the output
-* JavaScript support:: Info and Folding in a web browser
-@end menu
-
-@node HTML Export commands, Quoting HTML tags, HTML export, HTML export
-@subsection HTML export commands
-
-@cindex region, active
-@cindex active region
-@cindex transient-mark-mode
-@table @kbd
-@orgcmd{C-c C-e h,org-export-as-html}
-@cindex property, EXPORT_FILE_NAME
-Export as HTML file @file{myfile.html}. For an Org file @file{myfile.org},
-the ASCII file will be @file{myfile.html}. The file will be overwritten
-without warning. If there is an active region@footnote{This requires
-@code{transient-mark-mode} be turned on.}, only the region will be
-exported. If the selected region is a single tree@footnote{To select the
-current subtree, use @kbd{C-c @@}.}, the tree head will become the document
-title. If the tree head entry has, or inherits, an @code{EXPORT_FILE_NAME}
-property, that name will be used for the export.
-@orgcmd{C-c C-e b,org-export-as-html-and-open}
-Export as HTML file and immediately open it with a browser.
-@orgcmd{C-c C-e H,org-export-as-html-to-buffer}
-Export to a temporary buffer. Do not create a file.
-@orgcmd{C-c C-e R,org-export-region-as-html}
-Export the active region to a temporary buffer. With a prefix argument, do
-not produce the file header and footer, but just the plain HTML section for
-the region. This is good for cut-and-paste operations.
-@item C-c C-e v h/b/H/R
-Export only the visible part of the document.
-@item M-x org-export-region-as-html
-Convert the region to HTML under the assumption that it was Org-mode
-syntax before. This is a global command that can be invoked in any
-buffer.
-@item M-x org-replace-region-by-HTML
-Replace the active region (assumed to be in Org-mode syntax) by HTML
-code.
-@end table
-
-@cindex headline levels, for exporting
-In the exported version, the first 3 outline levels will become headlines,
-defining a general document structure. Additional levels will be exported as
-itemized lists. If you want that transition to occur at a different level,
-specify it with a numeric prefix argument. For example,
-
-@example
-@kbd{C-2 C-c C-e b}
-@end example
-
-@noindent
-creates two levels of headings and does the rest as items.
-
-@node Quoting HTML tags, Links in HTML export, HTML Export commands, HTML export
-@subsection Quoting HTML tags
-
-Plain @samp{<} and @samp{>} are always transformed to @samp{&lt;} and
-@samp{&gt;} in HTML export. If you want to include simple HTML tags
-which should be interpreted as such, mark them with @samp{@@} as in
-@samp{@@<b>bold text@@</b>}. Note that this really works only for
-simple tags. For more extensive HTML that should be copied verbatim to
-the exported file use either
-
-@cindex #+HTML
-@cindex #+BEGIN_HTML
-@example
-#+HTML: Literal HTML code for export
-@end example
-
-@noindent or
-@cindex #+BEGIN_HTML
-
-@example
-#+BEGIN_HTML
-All lines between these markers are exported literally
-#+END_HTML
-@end example
-
-
-@node Links in HTML export, Tables in HTML export, Quoting HTML tags, HTML export
-@subsection Links in HTML export
-
-@cindex links, in HTML export
-@cindex internal links, in HTML export
-@cindex external links, in HTML export
-Internal links (@pxref{Internal links}) will continue to work in HTML. This
-includes automatic links created by radio targets (@pxref{Radio
-targets}). Links to external files will still work if the target file is on
-the same @i{relative} path as the published Org file. Links to other
-@file{.org} files will be translated into HTML links under the assumption
-that an HTML version also exists of the linked file, at the same relative
-path. @samp{id:} links can then be used to jump to specific entries across
-files. For information related to linking files while publishing them to a
-publishing directory see @ref{Publishing links}.
-
-If you want to specify attributes for links, you can do so using a special
-@code{#+ATTR_HTML} line to define attributes that will be added to the
-@code{<a>} or @code{<img>} tags. Here is an example that sets @code{title}
-and @code{style} attributes for a link:
-
-@cindex #+ATTR_HTML
-@example
-#+ATTR_HTML: title="The Org-mode homepage" style="color:red;"
-[[http://orgmode.org]]
-@end example
-
-@node Tables in HTML export, Images in HTML export, Links in HTML export, HTML export
-@subsection Tables
-@cindex tables, in HTML
-@vindex org-export-html-table-tag
-
-Org-mode tables are exported to HTML using the table tag defined in
-@code{org-export-html-table-tag}. The default setting makes tables without
-cell borders and frame. If you would like to change this for individual
-tables, place something like the following before the table:
-
-@cindex #+CAPTION
-@cindex #+ATTR_HTML
-@example
-#+CAPTION: This is a table with lines around and between cells
-#+ATTR_HTML: border="2" rules="all" frame="all"
-@end example
-
-@node Images in HTML export, Math formatting in HTML export, Tables in HTML export, HTML export
-@subsection Images in HTML export
-
-@cindex images, inline in HTML
-@cindex inlining images in HTML
-@vindex org-export-html-inline-images
-HTML export can inline images given as links in the Org file, and
-it can make an image the clickable part of a link. By
-default@footnote{But see the variable
-@code{org-export-html-inline-images}.}, images are inlined if a link does
-not have a description. So @samp{[[file:myimg.jpg]]} will be inlined,
-while @samp{[[file:myimg.jpg][the image]]} will just produce a link
-@samp{the image} that points to the image. If the description part
-itself is a @code{file:} link or a @code{http:} URL pointing to an
-image, this image will be inlined and activated so that clicking on the
-image will activate the link. For example, to include a thumbnail that
-will link to a high resolution version of the image, you could use:
-
-@example
-[[file:highres.jpg][file:thumb.jpg]]
-@end example
-
-If you need to add attributes to an inlined image, use a @code{#+ATTR_HTML}.
-In the example below we specify the @code{alt} and @code{title} attributes to
-support text viewers and accessibility, and align it to the right.
-
-@cindex #+CAPTION
-@cindex #+ATTR_HTML
-@example
-#+CAPTION: A black cat stalking a spider
-#+ATTR_HTML: alt="cat/spider image" title="Action!" align="right"
-[[./img/a.jpg]]
-@end example
-
-@noindent
-and you could use @code{http} addresses just as well.
-
-@node Math formatting in HTML export, Text areas in HTML export, Images in HTML export, HTML export
-@subsection Math formatting in HTML export
-@cindex MathJax
-@cindex dvipng
-
-@LaTeX{} math snippets (@pxref{LaTeX fragments}) can be displayed in two
-different ways on HTML pages. The default is to use the
-@uref{http://www.mathjax.org, MathJax system} which should work out of the
-box with Org mode installation because @code{http://orgmode.org} serves
-@file{MathJax} for Org-mode users for small applications and for testing
-purposes. @b{If you plan to use this regularly or on pages with significant
-page views, you should install@footnote{Installation instructions can be
-found on the MathJax website, see
-@uref{http://www.mathjax.org/resources/docs/?installation.html}.} MathJax on
-your own server in order to limit the load of our server.} To configure
-@file{MathJax}, use the variable @code{org-export-html-mathjax-options} or
-insert something like the following into the buffer:
-
-@example
-#+MATHJAX: align:"left" mathml:t path:"/MathJax/MathJax.js"
-@end example
-
-@noindent See the docstring of the variable
-@code{org-export-html-mathjax-options} for the meaning of the parameters in
-this line.
-
-If you prefer, you can also request that @LaTeX{} fragments are processed
-into small images that will be inserted into the browser page. Before the
-availability of MathJax, this was the default method for Org files. This
-method requires that the @file{dvipng} program is available on your system.
-You can still get this processing with
-
-@example
-#+OPTIONS: LaTeX:dvipng
-@end example
-
-@node Text areas in HTML export, CSS support, Math formatting in HTML export, HTML export
-@subsection Text areas in HTML export
-
-@cindex text areas, in HTML
-An alternative way to publish literal code examples in HTML is to use text
-areas, where the example can even be edited before pasting it into an
-application. It is triggered by a @code{-t} switch at an @code{example} or
-@code{src} block. Using this switch disables any options for syntax and
-label highlighting, and line numbering, which may be present. You may also
-use @code{-h} and @code{-w} switches to specify the height and width of the
-text area, which default to the number of lines in the example, and 80,
-respectively. For example
-
-@example
-#+BEGIN_EXAMPLE -t -w 40
- (defun org-xor (a b)
- "Exclusive or."
- (if a (not b) b))
-#+END_EXAMPLE
-@end example
-
-
-@node CSS support, JavaScript support, Text areas in HTML export, HTML export
-@subsection CSS support
-@cindex CSS, for HTML export
-@cindex HTML export, CSS
-
-@vindex org-export-html-todo-kwd-class-prefix
-@vindex org-export-html-tag-class-prefix
-You can also give style information for the exported file. The HTML exporter
-assigns the following special CSS classes@footnote{If the classes on TODO
-keywords and tags lead to conflicts, use the variables
-@code{org-export-html-todo-kwd-class-prefix} and
-@code{org-export-html-tag-class-prefix} to make them unique.} to appropriate
-parts of the document---your style specifications may change these, in
-addition to any of the standard classes like for headlines, tables, etc.
-@example
-p.author @r{author information, including email}
-p.date @r{publishing date}
-p.creator @r{creator info, about org-mode version}
-.title @r{document title}
-.todo @r{TODO keywords, all not-done states}
-.done @r{the DONE keywords, all stated the count as done}
-.WAITING @r{each TODO keyword also uses a class named after itself}
-.timestamp @r{timestamp}
-.timestamp-kwd @r{keyword associated with a timestamp, like SCHEDULED}
-.timestamp-wrapper @r{span around keyword plus timestamp}
-.tag @r{tag in a headline}
-._HOME @r{each tag uses itself as a class, "@@" replaced by "_"}
-.target @r{target for links}
-.linenr @r{the line number in a code example}
-.code-highlighted @r{for highlighting referenced code lines}
-div.outline-N @r{div for outline level N (headline plus text))}
-div.outline-text-N @r{extra div for text at outline level N}
-.section-number-N @r{section number in headlines, different for each level}
-div.figure @r{how to format an inlined image}
-pre.src @r{formatted source code}
-pre.example @r{normal example}
-p.verse @r{verse paragraph}
-div.footnotes @r{footnote section headline}
-p.footnote @r{footnote definition paragraph, containing a footnote}
-.footref @r{a footnote reference number (always a <sup>)}
-.footnum @r{footnote number in footnote definition (always <sup>)}
-@end example
-
-@vindex org-export-html-style-default
-@vindex org-export-html-style-include-default
-@vindex org-export-html-style
-@vindex org-export-html-extra
-@vindex org-export-html-style-default
-Each exported file contains a compact default style that defines these
-classes in a basic way@footnote{This style is defined in the constant
-@code{org-export-html-style-default}, which you should not modify. To turn
-inclusion of these defaults off, customize
-@code{org-export-html-style-include-default}}. You may overwrite these
-settings, or add to them by using the variables @code{org-export-html-style}
-(for Org-wide settings) and @code{org-export-html-style-extra} (for more
-fine-grained settings, like file-local settings). To set the latter variable
-individually for each file, you can use
-
-@cindex #+STYLE
-@example
-#+STYLE: <link rel="stylesheet" type="text/css" href="stylesheet.css" />
-@end example
-
-@noindent
-For longer style definitions, you can use several such lines. You could also
-directly write a @code{<style>} @code{</style>} section in this way, without
-referring to an external file.
-
-In order to add styles to a subtree, use the @code{:HTML_CONTAINER_CLASS:}
-property to assign a class to the tree. In order to specify CSS styles for a
-particular headline, you can use the id specified in a @code{:CUSTOM_ID:}
-property.
-
-@c FIXME: More about header and footer styles
-@c FIXME: Talk about links and targets.
-
-@node JavaScript support, , CSS support, HTML export
-@subsection JavaScript supported display of web pages
-
-@cindex Rose, Sebastian
-Sebastian Rose has written a JavaScript program especially designed to
-enhance the web viewing experience of HTML files created with Org. This
-program allows you to view large files in two different ways. The first one
-is an @emph{Info}-like mode where each section is displayed separately and
-navigation can be done with the @kbd{n} and @kbd{p} keys (and some other keys
-as well, press @kbd{?} for an overview of the available keys). The second
-view type is a @emph{folding} view much like Org provides inside Emacs. The
-script is available at @url{http://orgmode.org/org-info.js} and you can find
-the documentation for it at @url{http://orgmode.org/worg/code/org-info-js/}.
-We host the script at our site, but if you use it a lot, you might
-not want to be dependent on @url{orgmode.org} and prefer to install a local
-copy on your own web server.
-
-To use the script, you need to make sure that the @file{org-jsinfo.el} module
-gets loaded. It should be loaded by default, but you can try @kbd{M-x
-customize-variable @key{RET} org-modules @key{RET}} to convince yourself that
-this is indeed the case. All it then takes to make use of the program is
-adding a single line to the Org file:
-
-@cindex #+INFOJS_OPT
-@example
-#+INFOJS_OPT: view:info toc:nil
-@end example
-
-@noindent
-If this line is found, the HTML header will automatically contain the code
-needed to invoke the script. Using the line above, you can set the following
-viewing options:
-
-@example
-path: @r{The path to the script. The default is to grab the script from}
- @r{@url{http://orgmode.org/org-info.js}, but you might want to have}
- @r{a local copy and use a path like @samp{../scripts/org-info.js}.}
-view: @r{Initial view when website is first shown. Possible values are:}
- info @r{Info-like interface with one section per page.}
- overview @r{Folding interface, initially showing only top-level.}
- content @r{Folding interface, starting with all headlines visible.}
- showall @r{Folding interface, all headlines and text visible.}
-sdepth: @r{Maximum headline level that will still become an independent}
- @r{section for info and folding modes. The default is taken from}
- @r{@code{org-export-headline-levels} (= the @code{H} switch in @code{#+OPTIONS}).}
- @r{If this is smaller than in @code{org-export-headline-levels}, each}
- @r{info/folding section can still contain child headlines.}
-toc: @r{Should the table of contents @emph{initially} be visible?}
- @r{Even when @code{nil}, you can always get to the "toc" with @kbd{i}.}
-tdepth: @r{The depth of the table of contents. The defaults are taken from}
- @r{the variables @code{org-export-headline-levels} and @code{org-export-with-toc}.}
-ftoc: @r{Does the CSS of the page specify a fixed position for the "toc"?}
- @r{If yes, the toc will never be displayed as a section.}
-ltoc: @r{Should there be short contents (children) in each section?}
- @r{Make this @code{above} if the section should be above initial text.}
-mouse: @r{Headings are highlighted when the mouse is over them. Should be}
- @r{@samp{underline} (default) or a background color like @samp{#cccccc}.}
-buttons: @r{Should view-toggle buttons be everywhere? When @code{nil} (the}
- @r{default), only one such button will be present.}
-@end example
-@noindent
-@vindex org-infojs-options
-@vindex org-export-html-use-infojs
-You can choose default values for these options by customizing the variable
-@code{org-infojs-options}. If you always want to apply the script to your
-pages, configure the variable @code{org-export-html-use-infojs}.
-
-@node LaTeX and PDF export, DocBook export, HTML export, Exporting
-@section @LaTeX{} and PDF export
-@cindex @LaTeX{} export
-@cindex PDF export
-@cindex Guerry, Bastien
-
-Org-mode contains a @LaTeX{} exporter written by Bastien Guerry. With
-further processing@footnote{The default LaTeX output is designed for
-processing with pdftex or latex. It includes packages that are not
-compatible with xetex and possibly luatex. See the variables
-@code{org-export-latex-default-packages-alist} and
-@code{org-export-latex-packages-alist}.}, this backend is also used to
-produce PDF output. Since the @LaTeX{} output uses @file{hyperref} to
-implement links and cross references, the PDF output file will be fully
-linked.
-
-@menu
-* LaTeX/PDF export commands:: Which key invokes which commands
-* Header and sectioning:: Setting up the export file structure
-* Quoting LaTeX code:: Incorporating literal @LaTeX{} code
-* Tables in LaTeX export:: Options for exporting tables to @LaTeX{}
-* Images in LaTeX export:: How to insert figures into @LaTeX{} output
-* Beamer class export:: Turning the file into a presentation
-@end menu
-
-@node LaTeX/PDF export commands, Header and sectioning, LaTeX and PDF export, LaTeX and PDF export
-@subsection @LaTeX{} export commands
-
-@cindex region, active
-@cindex active region
-@cindex transient-mark-mode
-@table @kbd
-@orgcmd{C-c C-e l,org-export-as-latex}
-@cindex property EXPORT_FILE_NAME
-Export as @LaTeX{} file @file{myfile.tex}. For an Org file
-@file{myfile.org}, the ASCII file will be @file{myfile.tex}. The file will
-be overwritten without warning. If there is an active region@footnote{This
-requires @code{transient-mark-mode} be turned on.}, only the region will be
-exported. If the selected region is a single tree@footnote{To select the
-current subtree, use @kbd{C-c @@}.}, the tree head will become the document
-title. If the tree head entry has or inherits an @code{EXPORT_FILE_NAME}
-property, that name will be used for the export.
-@orgcmd{C-c C-e L,org-export-as-latex-to-buffer}
-Export to a temporary buffer. Do not create a file.
-@item C-c C-e v l/L
-Export only the visible part of the document.
-@item M-x org-export-region-as-latex
-Convert the region to @LaTeX{} under the assumption that it was Org-mode
-syntax before. This is a global command that can be invoked in any
-buffer.
-@item M-x org-replace-region-by-latex
-Replace the active region (assumed to be in Org-mode syntax) by @LaTeX{}
-code.
-@orgcmd{C-c C-e p,org-export-as-pdf}
-Export as @LaTeX{} and then process to PDF.
-@orgcmd{C-c C-e d,org-export-as-pdf-and-open}
-Export as @LaTeX{} and then process to PDF, then open the resulting PDF file.
-@end table
-
-@cindex headline levels, for exporting
-@vindex org-latex-low-levels
-In the exported version, the first 3 outline levels will become
-headlines, defining a general document structure. Additional levels
-will be exported as description lists. The exporter can ignore them or
-convert them to a custom string depending on
-@code{org-latex-low-levels}.
-
-If you want that transition to occur at a different level, specify it
-with a numeric prefix argument. For example,
-
-@example
-@kbd{C-2 C-c C-e l}
-@end example
-
-@noindent
-creates two levels of headings and does the rest as items.
-
-@node Header and sectioning, Quoting LaTeX code, LaTeX/PDF export commands, LaTeX and PDF export
-@subsection Header and sectioning structure
-@cindex @LaTeX{} class
-@cindex @LaTeX{} sectioning structure
-@cindex @LaTeX{} header
-@cindex header, for LaTeX files
-@cindex sectioning structure, for LaTeX export
-
-By default, the @LaTeX{} output uses the class @code{article}.
-
-@vindex org-export-latex-default-class
-@vindex org-export-latex-classes
-@vindex org-export-latex-default-packages-alist
-@vindex org-export-latex-packages-alist
-@cindex #+LATEX_HEADER
-@cindex #+LATEX_CLASS
-@cindex #+LATEX_CLASS_OPTIONS
-@cindex property, LATEX_CLASS
-@cindex property, LATEX_CLASS_OPTIONS
-You can change this globally by setting a different value for
-@code{org-export-latex-default-class} or locally by adding an option like
-@code{#+LaTeX_CLASS: myclass} in your file, or with a @code{:LaTeX_CLASS:}
-property that applies when exporting a region containing only this (sub)tree.
-The class must be listed in @code{org-export-latex-classes}. This variable
-defines a header template for each class@footnote{Into which the values of
-@code{org-export-latex-default-packages-alist} and
-@code{org-export-latex-packages-alist} are spliced.}, and allows you to
-define the sectioning structure for each class. You can also define your own
-classes there. @code{#+LaTeX_CLASS_OPTIONS} or a @code{LaTeX_CLASS_OPTIONS}
-property can specify the options for the @code{\documentclass} macro. You
-can also use @code{#+LATEX_HEADER: \usepackage@{xyz@}} to add lines to the
-header. See the docstring of @code{org-export-latex-classes} for more
-information.
-
-@node Quoting LaTeX code, Tables in LaTeX export, Header and sectioning, LaTeX and PDF export
-@subsection Quoting @LaTeX{} code
-
-Embedded @LaTeX{} as described in @ref{Embedded LaTeX}, will be correctly
-inserted into the @LaTeX{} file. This includes simple macros like
-@samp{\ref@{LABEL@}} to create a cross reference to a figure. Furthermore,
-you can add special code that should only be present in @LaTeX{} export with
-the following constructs:
-
-@cindex #+LaTeX
-@cindex #+BEGIN_LaTeX
-@example
-#+LaTeX: Literal LaTeX code for export
-@end example
-
-@noindent or
-@cindex #+BEGIN_LaTeX
-
-@example
-#+BEGIN_LaTeX
-All lines between these markers are exported literally
-#+END_LaTeX
-@end example
-
-
-@node Tables in LaTeX export, Images in LaTeX export, Quoting LaTeX code, LaTeX and PDF export
-@subsection Tables in @LaTeX{} export
-@cindex tables, in @LaTeX{} export
-
-For @LaTeX{} export of a table, you can specify a label and a caption
-(@pxref{Images and tables}). You can also use the @code{ATTR_LaTeX} line to
-request a @code{longtable} environment for the table, so that it may span
-several pages, or provide the @code{multicolumn} keyword that will make the
-table span the page in a multicolumn environment (@code{table*} environment).
-Finally, you can set the alignment string:
-
-@cindex #+CAPTION
-@cindex #+LABEL
-@cindex #+ATTR_LaTeX
-@example
-#+CAPTION: A long table
-#+LABEL: tbl:long
-#+ATTR_LaTeX: longtable align=l|lp@{3cm@}r|l
-| ..... | ..... |
-| ..... | ..... |
-@end example
-
-
-@node Images in LaTeX export, Beamer class export, Tables in LaTeX export, LaTeX and PDF export
-@subsection Images in @LaTeX{} export
-@cindex images, inline in @LaTeX{}
-@cindex inlining images in @LaTeX{}
-
-Images that are linked to without a description part in the link, like
-@samp{[[file:img.jpg]]} or @samp{[[./img.jpg]]} will be inserted into the PDF
-output file resulting from @LaTeX{} processing. Org will use an
-@code{\includegraphics} macro to insert the image. If you have specified a
-caption and/or a label as described in @ref{Images and tables}, the figure
-will be wrapped into a @code{figure} environment and thus become a floating
-element. You can use an @code{#+ATTR_LaTeX:} line to specify the various
-options that can be used in the optional argument of the
-@code{\includegraphics} macro. To modify the placement option of the
-@code{figure} environment, add something like @samp{placement=[h!]} to the
-Attributes.
-
-If you would like to let text flow around the image, add the word @samp{wrap}
-to the @code{#+ATTR_LaTeX:} line, which will make the figure occupy the left
-half of the page. To fine-tune, the @code{placement} field will be the set
-of additional arguments needed by the @code{wrapfigure} environment. Note
-that if you change the size of the image, you need to use compatible settings
-for @code{\includegraphics} and @code{wrapfigure}.
-
-@cindex #+CAPTION
-@cindex #+LABEL
-@cindex #+ATTR_LaTeX
-@example
-#+CAPTION: The black-body emission of the disk around HR 4049
-#+LABEL: fig:SED-HR4049
-#+ATTR_LaTeX: width=5cm,angle=90
-[[./img/sed-hr4049.pdf]]
-
-#+ATTR_LaTeX: width=0.38\textwidth wrap placement=@{r@}@{0.4\textwidth@}
-[[./img/hst.png]]
-@end example
-
-If you need references to a label created in this way, write
-@samp{\ref@{fig:SED-HR4049@}} just like in @LaTeX{}.
-
-@node Beamer class export, , Images in LaTeX export, LaTeX and PDF export
-@subsection Beamer class export
-
-The LaTeX class @file{beamer} allows production of high quality presentations
-using LaTeX and pdf processing. Org-mode has special support for turning an
-Org-mode file or tree into a @file{beamer} presentation.
-
-When the LaTeX class for the current buffer (as set with @code{#+LaTeX_CLASS:
-beamer}) or subtree (set with a @code{LaTeX_CLASS} property) is
-@code{beamer}, a special export mode will turn the file or tree into a beamer
-presentation. Any tree with not-too-deep level nesting should in principle be
-exportable as a beamer presentation. By default, the top-level entries (or
-the first level below the selected subtree heading) will be turned into
-frames, and the outline structure below this level will become itemize lists.
-You can also configure the variable @code{org-beamer-frame-level} to a
-different level---then the hierarchy above frames will produce the sectioning
-structure of the presentation.
-
-A template for useful in-buffer settings or properties can be inserted into
-the buffer with @kbd{M-x org-insert-beamer-options-template}. Among other
-things, this will install a column view format which is very handy for
-editing special properties used by beamer.
-
-You can influence the structure of the presentation using the following
-properties:
-
-@table @code
-@item BEAMER_env
-The environment that should be used to format this entry. Valid environments
-are defined in the constant @code{org-beamer-environments-default}, and you
-can define more in @code{org-beamer-environments-extra}. If this property is
-set, the entry will also get a @code{:B_environment:} tag to make this
-visible. This tag has no semantic meaning, it is only a visual aid.
-@item BEAMER_envargs
-The beamer-special arguments that should be used for the environment, like
-@code{[t]} or @code{[<+->]} of @code{<2-3>}. If the @code{BEAMER_col}
-property is also set, something like @code{C[t]} can be added here as well to
-set an options argument for the implied @code{columns} environment.
-@code{c[t]} or @code{c<2->} will set an options for the implied @code{column}
-environment.
-@item BEAMER_col
-The width of a column that should start with this entry. If this property is
-set, the entry will also get a @code{:BMCOL:} property to make this visible.
-Also this tag is only a visual aid. When this is a plain number, it will be
-interpreted as a fraction of @code{\textwidth}. Otherwise it will be assumed
-that you have specified the units, like @samp{3cm}. The first such property
-in a frame will start a @code{columns} environment to surround the columns.
-This environment is closed when an entry has a @code{BEAMER_col} property
-with value 0 or 1, or automatically at the end of the frame.
-@item BEAMER_extra
-Additional commands that should be inserted after the environment has been
-opened. For example, when creating a frame, this can be used to specify
-transitions.
-@end table
-
-Frames will automatically receive a @code{fragile} option if they contain
-source code that uses the verbatim environment. Special @file{beamer}
-specific code can be inserted using @code{#+BEAMER:} and
-@code{#+BEGIN_beamer...#+end_beamer} constructs, similar to other export
-backends, but with the difference that @code{#+LaTeX:} stuff will be included
-in the presentation as well.
-
-Outline nodes with @code{BEAMER_env} property value @samp{note} or
-@samp{noteNH} will be formatted as beamer notes, i,e, they will be wrapped
-into @code{\note@{...@}}. The former will include the heading as part of the
-note text, the latter will ignore the heading of that node. To simplify note
-generation, it is actually enough to mark the note with a @emph{tag} (either
-@code{:B_note:} or @code{:B_noteNH:}) instead of creating the
-@code{BEAMER_env} property.
-
-You can turn on a special minor mode @code{org-beamer-mode} for editing
-support with
-
-@example
-#+STARTUP: beamer
-@end example
-
-@table @kbd
-@orgcmd{C-c C-b,org-beamer-select-environment}
-In @code{org-beamer-mode}, this key offers fast selection of a beamer
-environment or the @code{BEAMER_col} property.
-@end table
-
-Column view provides a great way to set the environment of a node and other
-important parameters. Make sure you are using a COLUMN format that is geared
-toward this special purpose. The command @kbd{M-x
-org-insert-beamer-options-template} defines such a format.
-
-Here is a simple example Org document that is intended for beamer export.
-
-@smallexample
-#+LaTeX_CLASS: beamer
-#+TITLE: Example Presentation
-#+AUTHOR: Carsten Dominik
-#+LaTeX_CLASS_OPTIONS: [presentation]
-#+BEAMER_FRAME_LEVEL: 2
-#+BEAMER_HEADER_EXTRA: \usetheme@{Madrid@}\usecolortheme@{default@}
-#+COLUMNS: %35ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Args) %4BEAMER_col(Col) %8BEAMER_extra(Ex)
-
-* This is the first structural section
-
-** Frame 1 \\ with a subtitle
-*** Thanks to Eric Fraga :BMCOL:B_block:
- :PROPERTIES:
- :BEAMER_env: block
- :BEAMER_envargs: C[t]
- :BEAMER_col: 0.5
- :END:
- for the first viable beamer setup in Org
-*** Thanks to everyone else :BMCOL:B_block:
- :PROPERTIES:
- :BEAMER_col: 0.5
- :BEAMER_env: block
- :BEAMER_envargs: <2->
- :END:
- for contributing to the discussion
-**** This will be formatted as a beamer note :B_note:
-** Frame 2 \\ where we will not use columns
-*** Request :B_block:
- Please test this stuff!
- :PROPERTIES:
- :BEAMER_env: block
- :END:
-@end smallexample
-
-For more information, see the documentation on Worg.
-
-@node DocBook export, TaskJuggler export, LaTeX and PDF export, Exporting
-@section DocBook export
-@cindex DocBook export
-@cindex PDF export
-@cindex Cui, Baoqiu
-
-Org contains a DocBook exporter written by Baoqiu Cui. Once an Org file is
-exported to DocBook format, it can be further processed to produce other
-formats, including PDF, HTML, man pages, etc., using many available DocBook
-tools and stylesheets.
-
-Currently DocBook exporter only supports DocBook V5.0.
-
-@menu
-* DocBook export commands:: How to invoke DocBook export
-* Quoting DocBook code:: Incorporating DocBook code in Org files
-* Recursive sections:: Recursive sections in DocBook
-* Tables in DocBook export:: Tables are exported as HTML tables
-* Images in DocBook export:: How to insert figures into DocBook output
-* Special characters:: How to handle special characters
-@end menu
-
-@node DocBook export commands, Quoting DocBook code, DocBook export, DocBook export
-@subsection DocBook export commands
-
-@cindex region, active
-@cindex active region
-@cindex transient-mark-mode
-@table @kbd
-@orgcmd{C-c C-e D,org-export-as-docbook}
-@cindex property EXPORT_FILE_NAME
-Export as DocBook file. For an Org file, @file{myfile.org}, the DocBook XML
-file will be @file{myfile.xml}. The file will be overwritten without
-warning. If there is an active region@footnote{This requires
-@code{transient-mark-mode} to be turned on}, only the region will be
-exported. If the selected region is a single tree@footnote{To select the
-current subtree, use @kbd{C-c @@}.}, the tree head will become the document
-title. If the tree head entry has, or inherits, an @code{EXPORT_FILE_NAME}
-property, that name will be used for the export.
-@orgcmd{C-c C-e V,org-export-as-docbook-pdf-and-open}
-Export as DocBook file, process to PDF, then open the resulting PDF file.
-
-@vindex org-export-docbook-xslt-proc-command
-@vindex org-export-docbook-xsl-fo-proc-command
-Note that, in order to produce PDF output based on exported DocBook file, you
-need to have XSLT processor and XSL-FO processor software installed on your
-system. Check variables @code{org-export-docbook-xslt-proc-command} and
-@code{org-export-docbook-xsl-fo-proc-command}.
-
-@vindex org-export-docbook-xslt-stylesheet
-The stylesheet argument @code{%s} in variable
-@code{org-export-docbook-xslt-proc-command} is replaced by the value of
-variable @code{org-export-docbook-xslt-stylesheet}, which needs to be set by
-the user. You can also overrule this global setting on a per-file basis by
-adding an in-buffer setting @code{#+XSLT:} to the Org file.
-
-@orgkey{C-c C-e v D}
-Export only the visible part of the document.
-@end table
-
-@node Quoting DocBook code, Recursive sections, DocBook export commands, DocBook export
-@subsection Quoting DocBook code
-
-You can quote DocBook code in Org files and copy it verbatim into exported
-DocBook file with the following constructs:
-
-@cindex #+DOCBOOK
-@cindex #+BEGIN_DOCBOOK
-@example
-#+DOCBOOK: Literal DocBook code for export
-@end example
-
-@noindent or
-@cindex #+BEGIN_DOCBOOK
-
-@example
-#+BEGIN_DOCBOOK
-All lines between these markers are exported by DocBook exporter
-literally.
-#+END_DOCBOOK
-@end example
-
-For example, you can use the following lines to include a DocBook warning
-admonition. As to what this warning says, you should pay attention to the
-document context when quoting DocBook code in Org files. You may make
-exported DocBook XML files invalid by not quoting DocBook code correctly.
-
-@example
-#+BEGIN_DOCBOOK
-<warning>
- <para>You should know what you are doing when quoting DocBook XML code
- in your Org file. Invalid DocBook XML may be generated by
- DocBook exporter if you are not careful!</para>
-</warning>
-#+END_DOCBOOK
-@end example
-
-@node Recursive sections, Tables in DocBook export, Quoting DocBook code, DocBook export
-@subsection Recursive sections
-@cindex DocBook recursive sections
-
-DocBook exporter exports Org files as articles using the @code{article}
-element in DocBook. Recursive sections, i.e. @code{section} elements, are
-used in exported articles. Top level headlines in Org files are exported as
-top level sections, and lower level headlines are exported as nested
-sections. The entire structure of Org files will be exported completely, no
-matter how many nested levels of headlines there are.
-
-Using recursive sections makes it easy to port and reuse exported DocBook
-code in other DocBook document types like @code{book} or @code{set}.
-
-@node Tables in DocBook export, Images in DocBook export, Recursive sections, DocBook export
-@subsection Tables in DocBook export
-@cindex tables, in DocBook export
-
-Tables in Org files are exported as HTML tables, which have been supported since
-DocBook V4.3.
-
-If a table does not have a caption, an informal table is generated using the
-@code{informaltable} element; otherwise, a formal table will be generated
-using the @code{table} element.
-
-@node Images in DocBook export, Special characters, Tables in DocBook export, DocBook export
-@subsection Images in DocBook export
-@cindex images, inline in DocBook
-@cindex inlining images in DocBook
-
-Images that are linked to without a description part in the link, like
-@samp{[[file:img.jpg]]} or @samp{[[./img.jpg]]}, will be exported to DocBook
-using @code{mediaobject} elements. Each @code{mediaobject} element contains
-an @code{imageobject} that wraps an @code{imagedata} element. If you have
-specified a caption for an image as described in @ref{Images and tables}, a
-@code{caption} element will be added in @code{mediaobject}. If a label is
-also specified, it will be exported as an @code{xml:id} attribute of the
-@code{mediaobject} element.
-
-@vindex org-export-docbook-default-image-attributes
-Image attributes supported by the @code{imagedata} element, like @code{align}
-or @code{width}, can be specified in two ways: you can either customize
-variable @code{org-export-docbook-default-image-attributes} or use the
-@code{#+ATTR_DOCBOOK:} line. Attributes specified in variable
-@code{org-export-docbook-default-image-attributes} are applied to all inline
-images in the Org file to be exported (unless they are overridden by image
-attributes specified in @code{#+ATTR_DOCBOOK:} lines).
-
-The @code{#+ATTR_DOCBOOK:} line can be used to specify additional image
-attributes or override default image attributes for individual images. If
-the same attribute appears in both the @code{#+ATTR_DOCBOOK:} line and
-variable @code{org-export-docbook-default-image-attributes}, the former
-takes precedence. Here is an example about how image attributes can be
-set:
-
-@cindex #+CAPTION
-@cindex #+LABEL
-@cindex #+ATTR_DOCBOOK
-@example
-#+CAPTION: The logo of Org-mode
-#+LABEL: unicorn-svg
-#+ATTR_DOCBOOK: scalefit="1" width="100%" depth="100%"
-[[./img/org-mode-unicorn.svg]]
-@end example
-
-@vindex org-export-docbook-inline-image-extensions
-By default, DocBook exporter recognizes the following image file types:
-@file{jpeg}, @file{jpg}, @file{png}, @file{gif}, and @file{svg}. You can
-customize variable @code{org-export-docbook-inline-image-extensions} to add
-more types to this list as long as DocBook supports them.
-
-@node Special characters, , Images in DocBook export, DocBook export
-@subsection Special characters in DocBook export
-@cindex Special characters in DocBook export
-
-@vindex org-export-docbook-doctype
-@vindex org-entities
-Special characters that are written in @TeX{}-like syntax, such as @code{\alpha},
-@code{\Gamma}, and @code{\Zeta}, are supported by DocBook exporter. These
-characters are rewritten to XML entities, like @code{&alpha;},
-@code{&Gamma;}, and @code{&Zeta;}, based on the list saved in variable
-@code{org-entities}. As long as the generated DocBook file includes the
-corresponding entities, these special characters are recognized.
-
-You can customize variable @code{org-export-docbook-doctype} to include the
-entities you need. For example, you can set variable
-@code{org-export-docbook-doctype} to the following value to recognize all
-special characters included in XHTML entities:
-
-@example
-"<!DOCTYPE article [
-<!ENTITY % xhtml1-symbol PUBLIC
-\"-//W3C//ENTITIES Symbol for HTML//EN//XML\"
-\"http://www.w3.org/2003/entities/2007/xhtml1-symbol.ent\"
->
-%xhtml1-symbol;
-]>
-"
-@end example
-
-@node TaskJuggler export, Freemind export, DocBook export, Exporting
-@section TaskJuggler export
-@cindex TaskJuggler export
-@cindex Project management
-
-@uref{http://www.taskjuggler.org/, TaskJuggler} is a project management tool.
-It provides an optimizing scheduler that computes your project time lines and
-resource assignments based on the project outline and the constraints that
-you have provided.
-
-The TaskJuggler exporter is a bit different from other exporters, such as the
-HTML and LaTeX exporters for example, in that it does not export all the
-nodes of a document or strictly follow the order of the nodes in the
-document.
-
-Instead the TaskJuggler exporter looks for a tree that defines the tasks and
-a optionally tree that defines the resources for this project. It then
-creates a TaskJuggler file based on these trees and the attributes defined in
-all the nodes.
-
-@subsection TaskJuggler export commands
-
-@table @kbd
-@orgcmd{C-c C-e j,org-export-as-taskjuggler}
-Export as TaskJuggler file.
-
-@orgcmd{C-c C-e J,org-export-as-taskjuggler-and-open}
-Export as TaskJuggler file and then open the file with TaskJugglerUI.
-@end table
-
-@subsection Tasks
-
-@vindex org-export-taskjuggler-project-tag
-Create your tasks as you usually do with Org-mode. Assign efforts to each
-task using properties (it's easiest to do this in the column view). You
-should end up with something similar to the example by Peter Jones in
-@url{http://www.contextualdevelopment.com/static/artifacts/articles/2008/project-planning/project-planning.org}.
-Now mark the top node of your tasks with a tag named
-@code{:taskjuggler_project:} (or whatever you customized
-@code{org-export-taskjuggler-project-tag} to). You are now ready to export
-the project plan with @kbd{C-c C-e J} which will export the project plan and
-open a gantt chart in TaskJugglerUI.
-
-@subsection Resources
-
-@vindex org-export-taskjuggler-resource-tag
-Next you can define resources and assign those to work on specific tasks. You
-can group your resources hierarchically. Tag the top node of the resources
-with @code{:taskjuggler_resource:} (or whatever you customized
-@code{org-export-taskjuggler-resource-tag} to). You can optionally assign an
-identifier (named @samp{resource_id}) to the resources (using the standard
-Org properties commands, @pxref{Property syntax}) or you can let the exporter
-generate identifiers automatically (the exporter picks the first word of the
-headline as the identifier as long as it is unique---see the documentation of
-@code{org-taskjuggler-get-unique-id}). Using that identifier you can then
-allocate resources to tasks. This is again done with the @samp{allocate}
-property on the tasks. Do this in column view or when on the task type
-@kbd{C-c C-x p allocate @key{RET} <resource_id> @key{RET}}.
-
-Once the allocations are done you can again export to TaskJuggler and check
-in the Resource Allocation Graph which person is working on what task at what
-time.
-
-@subsection Export of properties
-
-The exporter also takes TODO state information into consideration, i.e. if a
-task is marked as done it will have the corresponding attribute in
-TaskJuggler (@samp{complete 100}). Also it will export any property on a task
-resource or resource node which is known to TaskJuggler, such as
-@samp{limits}, @samp{vacation}, @samp{shift}, @samp{booking},
-@samp{efficiency}, @samp{journalentry}, @samp{rate} for resources or
-@samp{account}, @samp{start}, @samp{note}, @samp{duration}, @samp{end},
-@samp{journalentry}, @samp{milestone}, @samp{reference}, @samp{responsible},
-@samp{scheduling}, etc for tasks.
-
-@subsection Dependencies
-
-The exporter will handle dependencies that are defined in the tasks either
-with the @samp{ORDERED} attribute (@pxref{TODO dependencies}), with the
-@samp{BLOCKER} attribute (see @file{org-depend.el}) or alternatively with a
-@samp{depends} attribute. Both the @samp{BLOCKER} and the @samp{depends}
-attribute can be either @samp{previous-sibling} or a reference to an
-identifier (named @samp{task_id}) which is defined for another task in the
-project. @samp{BLOCKER} and the @samp{depends} attribute can define multiple
-dependencies separated by either space or comma. You can also specify
-optional attributes on the dependency by simply appending it. The following
-examples should illustrate this:
-
-@example
-* Preparation
- :PROPERTIES:
- :task_id: preparation
- :ORDERED: t
- :END:
-* Training material
- :PROPERTIES:
- :task_id: training_material
- :ORDERED: t
- :END:
-** Markup Guidelines
- :PROPERTIES:
- :Effort: 2.0
- :END:
-** Workflow Guidelines
- :PROPERTIES:
- :Effort: 2.0
- :END:
-* Presentation
- :PROPERTIES:
- :Effort: 2.0
- :BLOCKER: training_material @{ gapduration 1d @} preparation
- :END:
-@end example
-
-@subsection Reports
-
-@vindex org-export-taskjuggler-default-reports
-TaskJuggler can produce many kinds of reports (e.g. gantt chart, resource
-allocation, etc). The user defines what kind of reports should be generated
-for a project in the TaskJuggler file. The exporter will automatically insert
-some default reports in the file. These defaults are defined in
-@code{org-export-taskjuggler-default-reports}. They can be modified using
-customize along with a number of other options. For a more complete list, see
-@kbd{M-x customize-group @key{RET} org-export-taskjuggler @key{RET}}.
-
-For more information and examples see the Org-taskjuggler tutorial at
-@uref{http://orgmode.org/worg/org-tutorials/org-taskjuggler.php}.
-
-@node Freemind export, XOXO export, TaskJuggler export, Exporting
-@section Freemind export
-@cindex Freemind export
-@cindex mind map
-
-The Freemind exporter was written by Lennart Borgman.
-
-@table @kbd
-@orgcmd{C-c C-e m,org-export-as-freemind}
-Export as Freemind mind map @file{myfile.mm}.
-@end table
-
-@node XOXO export, iCalendar export, Freemind export, Exporting
-@section XOXO export
-@cindex XOXO export
-
-Org-mode contains an exporter that produces XOXO-style output.
-Currently, this exporter only handles the general outline structure and
-does not interpret any additional Org-mode features.
-
-@table @kbd
-@orgcmd{C-c C-e x,org-export-as-xoxo}
-Export as XOXO file @file{myfile.html}.
-@orgkey{C-c C-e v x}
-Export only the visible part of the document.
-@end table
-
-@node iCalendar export, , XOXO export, Exporting
-@section iCalendar export
-@cindex iCalendar export
-
-@vindex org-icalendar-include-todo
-@vindex org-icalendar-use-deadline
-@vindex org-icalendar-use-scheduled
-@vindex org-icalendar-categories
-@vindex org-icalendar-alarm-time
-Some people use Org-mode for keeping track of projects, but still prefer a
-standard calendar application for anniversaries and appointments. In this
-case it can be useful to show deadlines and other time-stamped items in Org
-files in the calendar application. Org-mode can export calendar information
-in the standard iCalendar format. If you also want to have TODO entries
-included in the export, configure the variable
-@code{org-icalendar-include-todo}. Plain timestamps are exported as VEVENT,
-and TODO items as VTODO. It will also create events from deadlines that are
-in non-TODO items. Deadlines and scheduling dates in TODO items will be used
-to set the start and due dates for the TODO entry@footnote{See the variables
-@code{org-icalendar-use-deadline} and @code{org-icalendar-use-scheduled}.}.
-As categories, it will use the tags locally defined in the heading, and the
-file/tree category@footnote{To add inherited tags or the TODO state,
-configure the variable @code{org-icalendar-categories}.}. See the variable
-@code{org-icalendar-alarm-time} for a way to assign alarms to entries with a
-time.
-
-@vindex org-icalendar-store-UID
-@cindex property, ID
-The iCalendar standard requires each entry to have a globally unique
-identifier (UID). Org creates these identifiers during export. If you set
-the variable @code{org-icalendar-store-UID}, the UID will be stored in the
-@code{:ID:} property of the entry and re-used next time you report this
-entry. Since a single entry can give rise to multiple iCalendar entries (as
-a timestamp, a deadline, a scheduled item, and as a TODO item), Org adds
-prefixes to the UID, depending on what triggered the inclusion of the entry.
-In this way the UID remains unique, but a synchronization program can still
-figure out from which entry all the different instances originate.
-
-@table @kbd
-@orgcmd{C-c C-e i,org-export-icalendar-this-file}
-Create iCalendar entries for the current file and store them in the same
-directory, using a file extension @file{.ics}.
-@orgcmd{C-c C-e I, org-export-icalendar-all-agenda-files}
-@vindex org-agenda-files
-Like @kbd{C-c C-e i}, but do this for all files in
-@code{org-agenda-files}. For each of these files, a separate iCalendar
-file will be written.
-@orgcmd{C-c C-e c,org-export-icalendar-combine-agenda-files}
-@vindex org-combined-agenda-icalendar-file
-Create a single large iCalendar file from all files in
-@code{org-agenda-files} and write it to the file given by
-@code{org-combined-agenda-icalendar-file}.
-@end table
-
-@vindex org-use-property-inheritance
-@vindex org-icalendar-include-body
-@cindex property, SUMMARY
-@cindex property, DESCRIPTION
-@cindex property, LOCATION
-The export will honor SUMMARY, DESCRIPTION and LOCATION@footnote{The LOCATION
-property can be inherited from higher in the hierarchy if you configure
-@code{org-use-property-inheritance} accordingly.} properties if the selected
-entries have them. If not, the summary will be derived from the headline,
-and the description from the body (limited to
-@code{org-icalendar-include-body} characters).
-
-How this calendar is best read and updated, depends on the application
-you are using. The FAQ covers this issue.
-
-@node Publishing, Working With Source Code, Exporting, Top
-@chapter Publishing
-@cindex publishing
-
-Org includes a publishing management system that allows you to configure
-automatic HTML conversion of @emph{projects} composed of interlinked org
-files. You can also configure Org to automatically upload your exported HTML
-pages and related attachments, such as images and source code files, to a web
-server.
-
-You can also use Org to convert files into PDF, or even combine HTML and PDF
-conversion so that files are available in both formats on the server.
-
-Publishing has been contributed to Org by David O'Toole.
-
-@menu
-* Configuration:: Defining projects
-* Uploading files:: How to get files up on the server
-* Sample configuration:: Example projects
-* Triggering publication:: Publication commands
-@end menu
-
-@node Configuration, Uploading files, Publishing, Publishing
-@section Configuration
-
-Publishing needs significant configuration to specify files, destination
-and many other properties of a project.
-
-@menu
-* Project alist:: The central configuration variable
-* Sources and destinations:: From here to there
-* Selecting files:: What files are part of the project?
-* Publishing action:: Setting the function doing the publishing
-* Publishing options:: Tweaking HTML export
-* Publishing links:: Which links keep working after publishing?
-* Sitemap:: Generating a list of all pages
-* Generating an index:: An index that reaches across pages
-@end menu
-
-@node Project alist, Sources and destinations, Configuration, Configuration
-@subsection The variable @code{org-publish-project-alist}
-@cindex org-publish-project-alist
-@cindex projects, for publishing
-
-@vindex org-publish-project-alist
-Publishing is configured almost entirely through setting the value of one
-variable, called @code{org-publish-project-alist}. Each element of the list
-configures one project, and may be in one of the two following forms:
-
-@lisp
- ("project-name" :property value :property value ...)
- @r{i.e. a well-formed property list with alternating keys and values}
-@r{or}
- ("project-name" :components ("project-name" "project-name" ...))
-
-@end lisp
-
-In both cases, projects are configured by specifying property values. A
-project defines the set of files that will be published, as well as the
-publishing configuration to use when publishing those files. When a project
-takes the second form listed above, the individual members of the
-@code{:components} property are taken to be sub-projects, which group
-together files requiring different publishing options. When you publish such
-a ``meta-project'', all the components will also be published, in the
-sequence given.
-
-@node Sources and destinations, Selecting files, Project alist, Configuration
-@subsection Sources and destinations for files
-@cindex directories, for publishing
-
-Most properties are optional, but some should always be set. In
-particular, Org needs to know where to look for source files,
-and where to put published files.
-
-@multitable @columnfractions 0.3 0.7
-@item @code{:base-directory}
-@tab Directory containing publishing source files
-@item @code{:publishing-directory}
-@tab Directory where output files will be published. You can directly
-publish to a webserver using a file name syntax appropriate for
-the Emacs @file{tramp} package. Or you can publish to a local directory and
-use external tools to upload your website (@pxref{Uploading files}).
-@item @code{:preparation-function}
-@tab Function or list of functions to be called before starting the
-publishing process, for example, to run @code{make} for updating files to be
-published. The project property list is scoped into this call as the
-variable @code{project-plist}.
-@item @code{:completion-function}
-@tab Function or list of functions called after finishing the publishing
-process, for example, to change permissions of the resulting files. The
-project property list is scoped into this call as the variable
-@code{project-plist}.
-@end multitable
-@noindent
-
-@node Selecting files, Publishing action, Sources and destinations, Configuration
-@subsection Selecting files
-@cindex files, selecting for publishing
-
-By default, all files with extension @file{.org} in the base directory
-are considered part of the project. This can be modified by setting the
-properties
-@multitable @columnfractions 0.25 0.75
-@item @code{:base-extension}
-@tab Extension (without the dot!) of source files. This actually is a
-regular expression. Set this to the symbol @code{any} if you want to get all
-files in @code{:base-directory}, even without extension.
-
-@item @code{:exclude}
-@tab Regular expression to match file names that should not be
-published, even though they have been selected on the basis of their
-extension.
-
-@item @code{:include}
-@tab List of files to be included regardless of @code{:base-extension}
-and @code{:exclude}.
-
-@item @code{:recursive}
-@tab Non-nil means, check base-directory recursively for files to publish.
-@end multitable
-
-@node Publishing action, Publishing options, Selecting files, Configuration
-@subsection Publishing action
-@cindex action, for publishing
-
-Publishing means that a file is copied to the destination directory and
-possibly transformed in the process. The default transformation is to export
-Org files as HTML files, and this is done by the function
-@code{org-publish-org-to-html} which calls the HTML exporter (@pxref{HTML
-export}). But you also can publish your content as PDF files using
-@code{org-publish-org-to-pdf}, or as @code{ascii}, @code{latin1} or
-@code{utf8} encoded files using the corresponding functions. If you want to
-publish the Org file itself, but with @i{archived}, @i{commented}, and
-@i{tag-excluded} trees removed, use @code{org-publish-org-to-org} and set the
-parameters @code{:plain-source} and/or @code{:htmlized-source}. This will
-produce @file{file.org} and @file{file.org.html} in the publishing
-directory@footnote{@file{file-source.org} and @file{file-source.org.html} if
-source and publishing directories are equal. Note that with this kind of
-setup, you need to add @code{:exclude "-source\\.org"} to the project
-definition in @code{org-publish-project-alist} to prevent the published
-source files from being considered as new org files the next time the project
-is published.}. Other files like images only need to be copied to the
-publishing destination; for this you may use @code{org-publish-attachment}.
-For non-Org files, you always need to specify the publishing function:
-
-@multitable @columnfractions 0.3 0.7
-@item @code{:publishing-function}
-@tab Function executing the publication of a file. This may also be a
-list of functions, which will all be called in turn.
-@item @code{:plain-source}
-@tab Non-nil means, publish plain source.
-@item @code{:htmlized-source}
-@tab Non-nil means, publish htmlized source.
-@end multitable
-
-The function must accept three arguments: a property list containing at least
-a @code{:publishing-directory} property, the name of the file to be
-published, and the path to the publishing directory of the output file. It
-should take the specified file, make the necessary transformation (if any)
-and place the result into the destination folder.
-
-@node Publishing options, Publishing links, Publishing action, Configuration
-@subsection Options for the HTML/@LaTeX{} exporters
-@cindex options, for publishing
-
-The property list can be used to set many export options for the HTML
-and @LaTeX{} exporters. In most cases, these properties correspond to user
-variables in Org. The table below lists these properties along
-with the variable they belong to. See the documentation string for the
-respective variable for details.
-
-@vindex org-export-html-link-up
-@vindex org-export-html-link-home
-@vindex org-export-default-language
-@vindex org-display-custom-times
-@vindex org-export-headline-levels
-@vindex org-export-with-section-numbers
-@vindex org-export-section-number-format
-@vindex org-export-with-toc
-@vindex org-export-preserve-breaks
-@vindex org-export-with-archived-trees
-@vindex org-export-with-emphasize
-@vindex org-export-with-sub-superscripts
-@vindex org-export-with-special-strings
-@vindex org-export-with-footnotes
-@vindex org-export-with-drawers
-@vindex org-export-with-tags
-@vindex org-export-with-todo-keywords
-@vindex org-export-with-priority
-@vindex org-export-with-TeX-macros
-@vindex org-export-with-LaTeX-fragments
-@vindex org-export-skip-text-before-1st-heading
-@vindex org-export-with-fixed-width
-@vindex org-export-with-timestamps
-@vindex org-export-author-info
-@vindex org-export-email
-@vindex org-export-creator-info
-@vindex org-export-with-tables
-@vindex org-export-highlight-first-table-line
-@vindex org-export-html-style-include-default
-@vindex org-export-html-style
-@vindex org-export-html-style-extra
-@vindex org-export-html-link-org-files-as-html
-@vindex org-export-html-inline-images
-@vindex org-export-html-extension
-@vindex org-export-html-table-tag
-@vindex org-export-html-expand
-@vindex org-export-html-with-timestamp
-@vindex org-export-publishing-directory
-@vindex org-export-html-preamble
-@vindex org-export-html-postamble
-@vindex org-export-html-auto-preamble
-@vindex org-export-html-auto-postamble
-@vindex user-full-name
-@vindex user-mail-address
-@vindex org-export-select-tags
-@vindex org-export-exclude-tags
-
-@multitable @columnfractions 0.32 0.68
-@item @code{:link-up} @tab @code{org-export-html-link-up}
-@item @code{:link-home} @tab @code{org-export-html-link-home}
-@item @code{:language} @tab @code{org-export-default-language}
-@item @code{:customtime} @tab @code{org-display-custom-times}
-@item @code{:headline-levels} @tab @code{org-export-headline-levels}
-@item @code{:section-numbers} @tab @code{org-export-with-section-numbers}
-@item @code{:section-number-format} @tab @code{org-export-section-number-format}
-@item @code{:table-of-contents} @tab @code{org-export-with-toc}
-@item @code{:preserve-breaks} @tab @code{org-export-preserve-breaks}
-@item @code{:archived-trees} @tab @code{org-export-with-archived-trees}
-@item @code{:emphasize} @tab @code{org-export-with-emphasize}
-@item @code{:sub-superscript} @tab @code{org-export-with-sub-superscripts}
-@item @code{:special-strings} @tab @code{org-export-with-special-strings}
-@item @code{:footnotes} @tab @code{org-export-with-footnotes}
-@item @code{:drawers} @tab @code{org-export-with-drawers}
-@item @code{:tags} @tab @code{org-export-with-tags}
-@item @code{:todo-keywords} @tab @code{org-export-with-todo-keywords}
-@item @code{:priority} @tab @code{org-export-with-priority}
-@item @code{:TeX-macros} @tab @code{org-export-with-TeX-macros}
-@item @code{:LaTeX-fragments} @tab @code{org-export-with-LaTeX-fragments}
-@item @code{:latex-listings} @tab @code{org-export-latex-listings}
-@item @code{:skip-before-1st-heading} @tab @code{org-export-skip-text-before-1st-heading}
-@item @code{:fixed-width} @tab @code{org-export-with-fixed-width}
-@item @code{:timestamps} @tab @code{org-export-with-timestamps}
-@item @code{:author-info} @tab @code{org-export-author-info}
-@item @code{:email-info} @tab @code{org-export-email-info}
-@item @code{:creator-info} @tab @code{org-export-creator-info}
-@item @code{:tables} @tab @code{org-export-with-tables}
-@item @code{:table-auto-headline} @tab @code{org-export-highlight-first-table-line}
-@item @code{:style-include-default} @tab @code{org-export-html-style-include-default}
-@item @code{:style} @tab @code{org-export-html-style}
-@item @code{:style-extra} @tab @code{org-export-html-style-extra}
-@item @code{:convert-org-links} @tab @code{org-export-html-link-org-files-as-html}
-@item @code{:inline-images} @tab @code{org-export-html-inline-images}
-@item @code{:html-extension} @tab @code{org-export-html-extension}
-@item @code{:xml-declaration} @tab @code{org-export-html-xml-declaration}
-@item @code{:html-table-tag} @tab @code{org-export-html-table-tag}
-@item @code{:expand-quoted-html} @tab @code{org-export-html-expand}
-@item @code{:timestamp} @tab @code{org-export-html-with-timestamp}
-@item @code{:publishing-directory} @tab @code{org-export-publishing-directory}
-@item @code{:preamble} @tab @code{org-export-html-preamble}
-@item @code{:postamble} @tab @code{org-export-html-postamble}
-@item @code{:auto-preamble} @tab @code{org-export-html-auto-preamble}
-@item @code{:auto-postamble} @tab @code{org-export-html-auto-postamble}
-@item @code{:author} @tab @code{user-full-name}
-@item @code{:email} @tab @code{user-mail-address} : @code{addr;addr;..}
-@item @code{:select-tags} @tab @code{org-export-select-tags}
-@item @code{:exclude-tags} @tab @code{org-export-exclude-tags}
-@item @code{:latex-image-options} @tab @code{org-export-latex-image-default-option}
-@end multitable
-
-Most of the @code{org-export-with-*} variables have the same effect in
-both HTML and @LaTeX{} exporters, except for @code{:TeX-macros} and
-@code{:LaTeX-fragments}, respectively @code{nil} and @code{t} in the
-@LaTeX{} export.
-
-@vindex org-publish-project-alist
-When a property is given a value in @code{org-publish-project-alist},
-its setting overrides the value of the corresponding user variable (if
-any) during publishing. Options set within a file (@pxref{Export
-options}), however, override everything.
-
-@node Publishing links, Sitemap, Publishing options, Configuration
-@subsection Links between published files
-@cindex links, publishing
-
-To create a link from one Org file to another, you would use
-something like @samp{[[file:foo.org][The foo]]} or simply
-@samp{file:foo.org.} (@pxref{Hyperlinks}). When published, this link
-becomes a link to @file{foo.html}. In this way, you can interlink the
-pages of your "org web" project and the links will work as expected when
-you publish them to HTML. If you also publish the Org source file and want
-to link to that, use an @code{http:} link instead of a @code{file:} link,
-because @code{file:} links are converted to link to the corresponding
-@file{html} file.
-
-You may also link to related files, such as images. Provided you are careful
-with relative file names, and provided you have also configured Org to upload
-the related files, these links will work too. See @ref{Complex example}, for
-an example of this usage.
-
-Sometimes an Org file to be published may contain links that are
-only valid in your production environment, but not in the publishing
-location. In this case, use the property
-
-@multitable @columnfractions 0.4 0.6
-@item @code{:link-validation-function}
-@tab Function to validate links
-@end multitable
-
-@noindent
-to define a function for checking link validity. This function must
-accept two arguments, the file name and a directory relative to which
-the file name is interpreted in the production environment. If this
-function returns @code{nil}, then the HTML generator will only insert a
-description into the HTML file, but no link. One option for this
-function is @code{org-publish-validate-link} which checks if the given
-file is part of any project in @code{org-publish-project-alist}.
-
-@node Sitemap, Generating an index, Publishing links, Configuration
-@subsection Generating a sitemap
-@cindex sitemap, of published pages
-
-The following properties may be used to control publishing of
-a map of files for a given project.
-
-@multitable @columnfractions 0.35 0.65
-@item @code{:auto-sitemap}
-@tab When non-nil, publish a sitemap during @code{org-publish-current-project}
-or @code{org-publish-all}.
-
-@item @code{:sitemap-filename}
-@tab Filename for output of sitemap. Defaults to @file{sitemap.org} (which
-becomes @file{sitemap.html}).
-
-@item @code{:sitemap-title}
-@tab Title of sitemap page. Defaults to name of file.
-
-@item @code{:sitemap-function}
-@tab Plug-in function to use for generation of the sitemap.
-Defaults to @code{org-publish-org-sitemap}, which generates a plain list
-of links to all files in the project.
-
-@item @code{:sitemap-sort-folders}
-@tab Where folders should appear in the sitemap. Set this to @code{first}
-(default) or @code{last} to display folders first or last,
-respectively. Any other value will mix files and folders.
-
-@item @code{:sitemap-alphabetically}
-@tab The site map is normally sorted alphabetically. Set this explicitly to
-@code{nil} to turn off sorting.
-
-@item @code{:sitemap-ignore-case}
-@tab Should sorting be case-sensitive? Default @code{nil}.
-
-@end multitable
-
-@node Generating an index, , Sitemap, Configuration
-@subsection Generating an index
-@cindex index, in a publishing project
-
-Org-mode can generate an index across the files of a publishing project.
-
-@multitable @columnfractions 0.25 0.75
-@item @code{:makeindex}
-@tab When non-nil, generate in index in the file @file{theindex.org} and
-publish it as @file{theindex.html}.
-@end multitable
-
-The file will be create when first publishing a project with the
-@code{:makeindex} set. The file only contains a statement @code{#+include:
-"theindex.inc"}. You can then built around this include statement by adding
-a title, style information etc.
-
-@node Uploading files, Sample configuration, Configuration, Publishing
-@section Uploading files
-@cindex rsync
-@cindex unison
-
-For those people already utilizing third party sync tools such as
-@command{rsync} or @command{unison}, it might be preferable not to use the built in
-@i{remote} publishing facilities of Org-mode which rely heavily on
-Tramp. Tramp, while very useful and powerful, tends not to be
-so efficient for multiple file transfer and has been known to cause problems
-under heavy usage.
-
-Specialized synchronization utilities offer several advantages. In addition
-to timestamp comparison, they also do content and permissions/attribute
-checks. For this reason you might prefer to publish your web to a local
-directory (possibly even @i{in place} with your Org files) and then use
-@file{unison} or @file{rsync} to do the synchronization with the remote host.
-
-Since Unison (for example) can be configured as to which files to transfer to
-a certain remote destination, it can greatly simplify the project publishing
-definition. Simply keep all files in the correct location, process your Org
-files with @code{org-publish} and let the synchronization tool do the rest.
-You do not need, in this scenario, to include attachments such as @file{jpg},
-@file{css} or @file{gif} files in the project definition since the 3rd party
-tool syncs them.
-
-Publishing to a local directory is also much faster than to a remote one, so
-that you can afford more easily to republish entire projects. If you set
-@code{org-publish-use-timestamps-flag} to @code{nil}, you gain the main
-benefit of re-including any changed external files such as source example
-files you might include with @code{#+INCLUDE}. The timestamp mechanism in
-Org is not smart enough to detect if included files have been modified.
-
-@node Sample configuration, Triggering publication, Uploading files, Publishing
-@section Sample configuration
-
-Below we provide two example configurations. The first one is a simple
-project publishing only a set of Org files. The second example is
-more complex, with a multi-component project.
-
-@menu
-* Simple example:: One-component publishing
-* Complex example:: A multi-component publishing example
-@end menu
-
-@node Simple example, Complex example, Sample configuration, Sample configuration
-@subsection Example: simple publishing configuration
-
-This example publishes a set of Org files to the @file{public_html}
-directory on the local machine.
-
-@lisp
-(setq org-publish-project-alist
- '(("org"
- :base-directory "~/org/"
- :publishing-directory "~/public_html"
- :section-numbers nil
- :table-of-contents nil
- :style "<link rel=\"stylesheet\"
- href=\"../other/mystyle.css\"
- type=\"text/css\"/>")))
-@end lisp
-
-@node Complex example, , Simple example, Sample configuration
-@subsection Example: complex publishing configuration
-
-This more complicated example publishes an entire website, including
-Org files converted to HTML, image files, Emacs Lisp source code, and
-style sheets. The publishing directory is remote and private files are
-excluded.
-
-To ensure that links are preserved, care should be taken to replicate
-your directory structure on the web server, and to use relative file
-paths. For example, if your Org files are kept in @file{~/org} and your
-publishable images in @file{~/images}, you would link to an image with
-@c
-@example
-file:../images/myimage.png
-@end example
-@c
-On the web server, the relative path to the image should be the
-same. You can accomplish this by setting up an "images" folder in the
-right place on the web server, and publishing images to it.
-
-@lisp
-(setq org-publish-project-alist
- '(("orgfiles"
- :base-directory "~/org/"
- :base-extension "org"
- :publishing-directory "/ssh:user@@host:~/html/notebook/"
- :publishing-function org-publish-org-to-html
- :exclude "PrivatePage.org" ;; regexp
- :headline-levels 3
- :section-numbers nil
- :table-of-contents nil
- :style "<link rel=\"stylesheet\"
- href=\"../other/mystyle.css\" type=\"text/css\"/>"
- :auto-preamble t
- :auto-postamble nil)
-
- ("images"
- :base-directory "~/images/"
- :base-extension "jpg\\|gif\\|png"
- :publishing-directory "/ssh:user@@host:~/html/images/"
- :publishing-function org-publish-attachment)
-
- ("other"
- :base-directory "~/other/"
- :base-extension "css\\|el"
- :publishing-directory "/ssh:user@@host:~/html/other/"
- :publishing-function org-publish-attachment)
- ("website" :components ("orgfiles" "images" "other"))))
-@end lisp
-
-@node Triggering publication, , Sample configuration, Publishing
-@section Triggering publication
-
-Once properly configured, Org can publish with the following commands:
-
-@table @kbd
-@orgcmd{C-c C-e X,org-publish}
-Prompt for a specific project and publish all files that belong to it.
-@orgcmd{C-c C-e P,org-publish-current-project}
-Publish the project containing the current file.
-@orgcmd{C-c C-e F,org-publish-current-file}
-Publish only the current file.
-@orgcmd{C-c C-e E,org-publish-all}
-Publish every project.
-@end table
-
-@vindex org-publish-use-timestamps-flag
-Org uses timestamps to track when a file has changed. The above functions
-normally only publish changed files. You can override this and force
-publishing of all files by giving a prefix argument to any of the commands
-above, or by customizing the variable @code{org-publish-use-timestamps-flag}.
-This may be necessary in particular if files include other files via
-@code{#+SETUPFILE:} or @code{#+INCLUDE:}.
-
-@comment node-name, next, previous, up
-@comment Working With Source Code, Miscellaneous, Publishing, Top
-
-@node Working With Source Code, Miscellaneous, Publishing, Top
-@chapter Working with source code
-@cindex Schulte, Eric
-@cindex Davison, Dan
-@cindex source code, working with
-
-Source code can be included in Org-mode documents using a @samp{src} block,
-e.g.
-
-@example
-#+BEGIN_SRC emacs-lisp
- (defun org-xor (a b)
- "Exclusive or."
- (if a (not b) b))
-#+END_SRC
-@end example
-
-Org-mode provides a number of features for working with live source code,
-including editing of code blocks in their native major-mode, evaluation of
-code blocks, tangling of code blocks, and exporting code blocks and their
-results in several formats. This functionality was contributed by Eric
-Schulte and Dan Davison, and was originally named Org-babel.
-
-The following sections describe Org-mode's code block handling facilities.
-
-@menu
-* Structure of code blocks:: Code block syntax described
-* Editing source code:: Language major-mode editing
-* Exporting code blocks:: Export contents and/or results
-* Extracting source code:: Create pure source code files
-* Evaluating code blocks:: Place results of evaluation in the Org-mode buffer
-* Library of Babel:: Use and contribute to a library of useful code blocks
-* Languages:: List of supported code block languages
-* Header arguments:: Configure code block functionality
-* Results of evaluation:: How evaluation results are handled
-* Noweb reference syntax:: Literate programming in Org-mode
-* Key bindings and useful functions:: Work quickly with code blocks
-* Batch execution:: Call functions from the command line
-@end menu
-
-@comment node-name, next, previous, up
-@comment Structure of code blocks, Editing source code, Working With Source Code, Working With Source Code
-
-@node Structure of code blocks, Editing source code, Working With Source Code, Working With Source Code
-@section Structure of code blocks
-@cindex code block, structure
-@cindex source code, block structure
-
-The structure of code blocks is as follows:
-
-@example
-#+srcname: <name>
-#+begin_src <language> <switches> <header arguments>
- <body>
-#+end_src
-@end example
-
-code blocks can also be embedded in text as so called inline code blocks as
-
-@example
-src_<language>@{<body>@}
-@end example
-
-or
-
-@example
-src_<language>[<header arguments>]@{<body>@}
-@end example
-
-@table @code
-@item <name>
-This name is associated with the code block. This is similar to the
-@samp{#+tblname} lines that can be used to name tables in Org-mode files.
-Referencing the name of a code block makes it possible to evaluate the
-block from other places in the file, other files, or from Org-mode table
-formulas (see @ref{The spreadsheet}).
-@item <language>
-The language of the code in the block.
-@item <switches>
-Switches controlling exportation of the code block (see switches discussion in
-@ref{Literal examples})
-@item <header arguments>
-Optional header arguments control many aspects of evaluation, export and
-tangling of code blocks. See the @ref{Header arguments}
-section. Header arguments can also be set on a per-buffer or per-subtree
-basis using properties.
-@item <body>
-The source code.
-@end table
-
-@comment node-name, next, previous, up
-@comment Editing source code, Exporting code blocks, Structure of code blocks, Working With Source Code
-
-@node Editing source code, Exporting code blocks, Structure of code blocks, Working With Source Code
-@section Editing source code
-@cindex code block, editing
-@cindex source code, editing
-
-@kindex C-c '
-Use @kbd{C-c '} to edit the current code block. This brings up
-a language major-mode edit buffer containing the body of the code
-block. Saving this buffer will write the new contents back to the Org
-buffer. Use @kbd{C-c '} again to exit.
-
-The @code{org-src-mode} minor mode will be active in the edit buffer. The
-following variables can be used to configure the behavior of the edit
-buffer. See also the customization group @code{org-edit-structure} for
-further configuration options.
-
-@table @code
-@item org-src-lang-modes
-If an Emacs major-mode named @code{<lang>-mode} exists, where
-@code{<lang>} is the language named in the header line of the code block,
-then the edit buffer will be placed in that major-mode. This variable
-can be used to map arbitrary language names to existing major modes.
-@item org-src-window-setup
-Controls the way Emacs windows are rearranged when the edit buffer is created.
-@item org-src-preserve-indentation
-This variable is especially useful for tangling languages such as
-Python, in which whitespace indentation in the output is critical.
-@item org-src-ask-before-returning-to-edit-buffer
-By default, Org will ask before returning to an open edit buffer. Set
-this variable to nil to switch without asking.
-@end table
-
-@comment node-name, next, previous, up
-@comment Exporting code blocks, Extracting source code, Editing source code, Working With Source Code
-
-@node Exporting code blocks, Extracting source code, Editing source code, Working With Source Code
-@section Exporting code blocks
-@cindex code block, exporting
-@cindex source code, exporting
-
-It is possible to export the @emph{contents} of code blocks, the
-@emph{results} of code block evaluation, @emph{neither}, or @emph{both}. For
-most languages, the default exports the contents of code blocks. However, for
-some languages (e.g. @code{ditaa}) the default exports the results of code
-block evaluation. For information on exporting code block bodies, see
-@ref{Literal examples}.
-
-The @code{:exports} header argument can be used to specify export
-behavior:
-
-@subsubheading Header arguments:
-@table @code
-@item :exports code
-The default in most languages. The body of the code block is exported, as
-described in @ref{Literal examples}.
-@item :exports results
-The code block will be evaluated and the results will be placed in the
-Org-mode buffer for export, either updating previous results of the code
-block located anywhere in the buffer or, if no previous results exist,
-placing the results immediately after the code block. The body of the code
-block will not be exported.
-@item :exports both
-Both the code block and its results will be exported.
-@item :exports none
-Neither the code block nor its results will be exported.
-@end table
-
-It is possible to inhibit the evaluation of code blocks during export.
-Setting the @code{org-export-babel-evaluate} variable to @code{nil} will
-ensure that no code blocks are evaluated as part of the export process. This
-can be useful in situations where potentially untrusted Org-mode files are
-exported in an automated fashion, for example when Org-mode is used as the
-markup language for a wiki.
-
-@comment node-name, next, previous, up
-@comment Extracting source code, Evaluating code blocks, Exporting code blocks, Working With Source Code
-@node Extracting source code, Evaluating code blocks, Exporting code blocks, Working With Source Code
-@section Extracting source code
-@cindex source code, extracting
-@cindex code block, extracting source code
-
-Creating pure source code files by extracting code from source blocks is
-referred to as ``tangling''---a term adopted from the literate programming
-community. During ``tangling'' of code blocks their bodies are expanded
-using @code{org-babel-expand-src-block} which can expand both variable and
-``noweb'' style references (see @ref{Noweb reference syntax}).
-
-@subsubheading Header arguments
-@table @code
-@item :tangle no
-The default. The code block is not included in the tangled output.
-@item :tangle yes
-Include the code block in the tangled output. The output file name is the
-name of the org file with the extension @samp{.org} replaced by the extension
-for the block language.
-@item :tangle filename
-Include the code block in the tangled output to file @samp{filename}.
-@end table
-
-@kindex C-c C-v t
-@subsubheading Functions
-@table @code
-@item org-babel-tangle
-Tangle the current file. Bound to @kbd{C-c C-v t}.
-@item org-babel-tangle-file
-Choose a file to tangle. Bound to @kbd{C-c C-v f}.
-@end table
-
-@subsubheading Hooks
-@table @code
-@item org-babel-post-tangle-hook
-This hook is run from within code files tangled by @code{org-babel-tangle}.
-Example applications could include post-processing, compilation or evaluation
-of tangled code files.
-@end table
-
-@node Evaluating code blocks, Library of Babel, Extracting source code, Working With Source Code
-@section Evaluating code blocks
-@cindex code block, evaluating
-@cindex source code, evaluating
-
-Code blocks can be evaluated@footnote{Whenever code is evaluated there is a
-potential for that code to do harm. Org-mode provides a number of safeguards
-to ensure that it only evaluates code with explicit confirmation from the
-user. For information on these safeguards (and on how to disable them) see
-@ref{Code evaluation security}.} and the results placed in the Org-mode
-buffer. By default, evaluation is only turned on for @code{emacs-lisp} code
-blocks, however support exists for evaluating blocks in many languages. See
-@ref{Languages} for a list of supported languages. See @ref{Structure of
-code blocks} for information on the syntax used to define a code block.
-
-@kindex C-c C-c
-There are a number of ways to evaluate code blocks. The simplest is to press
-@kbd{C-c C-c} or @kbd{C-c C-v e} with the point on a code block@footnote{The
-@code{org-babel-no-eval-on-ctrl-c-ctrl-c} variable can be used to remove code
-evaluation from the @kbd{C-c C-c} key binding.}. This will call the
-@code{org-babel-execute-src-block} function to evaluate the block and insert
-its results into the Org-mode buffer.
-
-It is also possible to evaluate named code blocks from anywhere in an
-Org-mode buffer or an Org-mode table. @code{#+call} (or synonymously
-@code{#+function} or @code{#+lob}) lines can be used to remotely execute code
-blocks located in the current Org-mode buffer or in the ``Library of Babel''
-(see @ref{Library of Babel}). These lines use the following syntax.
-
-@example
-#+call: <name>(<arguments>) <header arguments>
-#+function: <name>(<arguments>) <header arguments>
-#+lob: <name>(<arguments>) <header arguments>
-@end example
-
-@table @code
-@item <name>
-The name of the code block to be evaluated.
-@item <arguments>
-Arguments specified in this section will be passed to the code block.
-@item <header arguments>
-Header arguments can be placed after the function invocation. See
-@ref{Header arguments} for more information on header arguments.
-@end table
-
-
-@node Library of Babel, Languages, Evaluating code blocks, Working With Source Code
-@section Library of Babel
-@cindex babel, library of
-@cindex source code, library
-@cindex code block, library
-
-The ``Library of Babel'' is a library of code blocks
-that can be called from any Org-mode file. The library is housed in an
-Org-mode file located in the @samp{contrib} directory of Org-mode.
-Org-mode users can deposit functions they believe to be generally
-useful in the library.
-
-Code blocks defined in the ``Library of Babel'' can be called remotely as if
-they were in the current Org-mode buffer (see @ref{Evaluating code blocks}
-for information on the syntax of remote code block evaluation).
-
-@kindex C-c C-v i
-Code blocks located in any Org-mode file can be loaded into the ``Library of
-Babel'' with the @code{org-babel-lob-ingest} function, bound to @kbd{C-c C-v
-i}.
-
-@node Languages, Header arguments, Library of Babel, Working With Source Code
-@section Languages
-@cindex babel, languages
-@cindex source code, languages
-@cindex code block, languages
-
-Code blocks in the following languages are supported.
-
-@multitable @columnfractions 0.28 0.3 0.22 0.2
-@item @b{Language} @tab @b{Identifier} @tab @b{Language} @tab @b{Identifier}
-@item Asymptote @tab asymptote @tab C @tab C
-@item C++ @tab C++ @tab Clojure @tab clojure
-@item CSS @tab css @tab ditaa @tab ditaa
-@item Graphviz @tab dot @tab Emacs Lisp @tab emacs-lisp
-@item gnuplot @tab gnuplot @tab Haskell @tab haskell
-@item LaTeX @tab latex @tab MATLAB @tab matlab
-@item Mscgen @tab mscgen @tab Objective Caml @tab ocaml
-@item Octave @tab octave @tab Oz @tab oz
-@item Perl @tab perl @tab Python @tab python
-@item R @tab R @tab Ruby @tab ruby
-@item Sass @tab sass @tab GNU Screen @tab screen
-@item shell @tab sh @tab SQL @tab sql
-@item SQLite @tab sqlite
-@end multitable
-
-Language-specific documentation is available for some languages. If
-available, it can be found at
-@uref{http://orgmode.org/worg/org-contrib/babel/languages}.
-
-The @code{org-babel-load-languages} controls which languages are enabled for
-evaluation (by default only @code{emacs-lisp} is enabled). This variable can
-be set using the customization interface or by adding code like the following
-to your emacs configuration.
-
-@quotation
-The following disables @code{emacs-lisp} evaluation and enables evaluation of
-@code{R} code blocks.
-@end quotation
-
-@lisp
-(org-babel-do-load-languages
- 'org-babel-load-languages
- '((emacs-lisp . nil)
- (R . t)))
-@end lisp
-
-It is also possible to enable support for a language by loading the related
-elisp file with @code{require}.
-
-@quotation
-The following adds support for evaluating @code{clojure} code blocks.
-@end quotation
-
-@lisp
-(require 'ob-clojure)
-@end lisp
-
-@node Header arguments, Results of evaluation, Languages, Working With Source Code
-@section Header arguments
-@cindex code block, header arguments
-@cindex source code, block header arguments
-
-Code block functionality can be configured with header arguments. This
-section provides an overview of the use of header arguments, and then
-describes each header argument in detail.
-
-@menu
-* Using header arguments:: Different ways to set header arguments
-* Specific header arguments:: List of header arguments
-@end menu
-
-@node Using header arguments, Specific header arguments, Header arguments, Header arguments
-@subsection Using header arguments
-
-The values of header arguments can be set in six different ways, each more
-specific (and having higher priority) than the last.
-@menu
-* System-wide header arguments:: Set global default values
-* Language-specific header arguments:: Set default values by language
-* Buffer-wide header arguments:: Set default values for a specific buffer
-* Header arguments in Org-mode properties:: Set default values for a buffer or heading
-* Code block specific header arguments:: The most common way to set values
-* Header arguments in function calls:: The most specific level
-@end menu
-
-
-@node System-wide header arguments, Language-specific header arguments, Using header arguments, Using header arguments
-@subsubheading System-wide header arguments
-@vindex org-babel-default-header-args
-System-wide values of header arguments can be specified by customizing the
-@code{org-babel-default-header-args} variable:
-
-@example
-:session => "none"
-:results => "replace"
-:exports => "code"
-:cache => "no"
-:noweb => "no"
-@end example
-
-@c @example
-@c org-babel-default-header-args is a variable defined in `org-babel.el'.
-@c Its value is
-@c ((:session . "none")
-@c (:results . "replace")
-@c (:exports . "code")
-@c (:cache . "no")
-@c (:noweb . "no"))
-
-
-@c Documentation:
-@c Default arguments to use when evaluating a code block.
-@c @end example
-
-For example, the following example could be used to set the default value of
-@code{:noweb} header arguments to @code{yes}. This would have the effect of
-expanding @code{:noweb} references by default when evaluating source code
-blocks.
-
-@lisp
-(setq org-babel-default-header-args
-(cons '(:noweb . "yes")
-(assq-delete-all :noweb org-babel-default-header-args)))
-@end lisp
-
-@node Language-specific header arguments, Buffer-wide header arguments, System-wide header arguments, Using header arguments
-@subsubheading Language-specific header arguments
-Each language can define its own set of default header arguments. See the
-language-specific documentation available online at
-@uref{http://orgmode.org/worg/org-contrib/babel}.
-
-@node Buffer-wide header arguments, Header arguments in Org-mode properties, Language-specific header arguments, Using header arguments
-@subsubheading Buffer-wide header arguments
-Buffer-wide header arguments may be specified through the use of a special
-line placed anywhere in an Org-mode file. The line consists of the
-@code{#+BABEL:} keyword followed by a series of header arguments which may be
-specified using the standard header argument syntax.
-
-For example the following would set @code{session} to @code{*R*}, and
-@code{results} to @code{silent} for every code block in the buffer, ensuring
-that all execution took place in the same session, and no results would be
-inserted into the buffer.
-
-@example
-#+BABEL: :session *R* :results silent
-@end example
-
-@node Header arguments in Org-mode properties, Code block specific header arguments, Buffer-wide header arguments, Using header arguments
-@subsubheading Header arguments in Org-mode properties
-
-Header arguments are also read from Org-mode properties (see @ref{Property
-syntax}), which can be set on a buffer-wide or per-heading basis. An example
-of setting a header argument for all code blocks in a buffer is
-
-@example
-#+property: tangle yes
-@end example
-
-When properties are used to set default header arguments, they are looked up
-with inheritance, so the value of the @code{:cache} header argument will default
-to @code{yes} in all code blocks in the subtree rooted at the following
-heading:
-
-@example
-* outline header
-:PROPERTIES:
-:cache: yes
-:END:
-@end example
-
-@kindex C-c C-x p
-@vindex org-babel-default-header-args
-Properties defined in this way override the properties set in
-@code{org-babel-default-header-args}. It is convenient to use the
-@code{org-set-property} function bound to @kbd{C-c C-x p} to set properties
-in Org-mode documents.
-
-@node Code block specific header arguments, Header arguments in function calls, Header arguments in Org-mode properties, Using header arguments
-@subsubheading Code block specific header arguments
-
-The most common way to assign values to header arguments is at the
-code block level. This can be done by listing a sequence of header
-arguments and their values as part of the @code{#+begin_src} line.
-Properties set in this way override both the values of
-@code{org-babel-default-header-args} and header arguments specified as
-properties. In the following example, the @code{:results} header argument
-is set to @code{silent}, meaning the results of execution will not be
-inserted in the buffer, and the @code{:exports} header argument is set to
-@code{code}, meaning only the body of the code block will be
-preserved on export to HTML or LaTeX.
-
-@example
-#+source: factorial
-#+begin_src haskell :results silent :exports code :var n=0
-fac 0 = 1
-fac n = n * fac (n-1)
-#+end_src
-@end example
-Similarly, it is possible to set header arguments for inline code blocks:
-
-@example
-src_haskell[:exports both]@{fac 5@}
-@end example
-
-@node Header arguments in function calls, , Code block specific header arguments, Using header arguments
-@comment node-name, next, previous, up
-@subsubheading Header arguments in function calls
-
-At the most specific level, header arguments for ``Library of Babel'' or
-function call lines can be set as shown below:
-
-@example
-#+call: factorial(n=5) :exports results
-@end example
-
-@node Specific header arguments, , Using header arguments, Header arguments
-@subsection Specific header arguments
-The following header arguments are defined:
-
-@menu
-* var:: Pass arguments to code blocks
-* results:: Specify the type of results and how they will
- be collected and handled
-* file:: Specify a path for file output
-* dir:: Specify the default (possibly remote)
- directory for code block execution
-* exports:: Export code and/or results
-* tangle:: Toggle tangling and specify file name
-* comments:: Toggle insertion of comments in tangled
- code files
-* no-expand:: Turn off variable assignment and noweb
- expansion during tangling
-* session:: Preserve the state of code evaluation
-* noweb:: Toggle expansion of noweb references
-* cache:: Avoid re-evaluating unchanged code blocks
-* hlines:: Handle horizontal lines in tables
-* colnames:: Handle column names in tables
-* rownames:: Handle row names in tables
-* shebang:: Make tangled files executable
-* eval:: Limit evaluation of specific code blocks
-@end menu
-
-@node var, results, Specific header arguments, Specific header arguments
-@subsubsection @code{:var}
-The @code{:var} header argument is used to pass arguments to code blocks.
-The specifics of how arguments are included in a code block vary by language;
-these are addressed in the language-specific documentation. However, the
-syntax used to specify arguments is the same across all languages. The
-values passed to arguments can be literal values, values from org-mode tables
-and literal example blocks, or the results of other code blocks.
-
-These values can be indexed in a manner similar to arrays---see the
-``indexable variable values'' heading below.
-
-The following syntax is used to pass arguments to code blocks using the
-@code{:var} header argument.
-
-@example
-:var name=assign
-@end example
-
-where @code{assign} can take one of the following forms
-
-@itemize @bullet
-@item literal value
-either a string @code{"string"} or a number @code{9}.
-@item reference
-a table name:
-
-@example
-#+tblname: example-table
-| 1 |
-| 2 |
-| 3 |
-| 4 |
-
-#+source: table-length
-#+begin_src emacs-lisp :var table=example-table
-(length table)
-#+end_src
-
-#+results: table-length
-: 4
-@end example
-
-a code block name, as assigned by @code{#+srcname:}, followed by
-parentheses:
-
-@example
-#+begin_src emacs-lisp :var length=table-length()
-(* 2 length)
-#+end_src
-
-#+results:
-: 8
-@end example
-
-In addition, an argument can be passed to the code block referenced
-by @code{:var}. The argument is passed within the parentheses following the
-code block name:
-
-@example
-#+source: double
-#+begin_src emacs-lisp :var input=8
-(* 2 input)
-#+end_src
-
-#+results: double
-: 16
-
-#+source: squared
-#+begin_src emacs-lisp :var input=double(input=1)
-(* input input)
-#+end_src
-
-#+results: squared
-: 4
-@end example
-@end itemize
-
-@subsubheading Alternate argument syntax
-It is also possible to specify arguments in a potentially more natural way
-using the @code{#+source:} line of a code block. As in the following
-example arguments can be packed inside of parenthesis, separated by commas,
-following the source name.
-
-@example
-#+source: double(input=0, x=2)
-#+begin_src emacs-lisp
-(* 2 (+ input x))
-#+end_src
-@end example
-
-@subsubheading Indexable variable values
-It is possible to reference portions of variable values by ``indexing'' into
-the variables. Indexes are 0 based with negative values counting back from
-the end. If an index is separated by @code{,}s then each subsequent section
-will index into the next deepest nesting or dimension of the value. The
-following example assigns the last cell of the first row the table
-@code{example-table} to the variable @code{data}:
-
-@example
-#+results: example-table
-| 1 | a |
-| 2 | b |
-| 3 | c |
-| 4 | d |
-
-#+begin_src emacs-lisp :var data=example-table[0,-1]
- data
-#+end_src
-
-#+results:
-: a
-@end example
-
-Ranges of variable values can be referenced using two integers separated by a
-@code{:}, in which case the entire inclusive range is referenced. For
-example the following assigns the middle three rows of @code{example-table}
-to @code{data}.
-
-@example
-#+results: example-table
-| 1 | a |
-| 2 | b |
-| 3 | c |
-| 4 | d |
-| 5 | 3 |
-
-#+begin_src emacs-lisp :var data=example-table[1:3]
- data
-#+end_src
-
-#+results:
-| 2 | b |
-| 3 | c |
-| 4 | d |
-@end example
-
-Additionally, an empty index, or the single character @code{*}, are both
-interpreted to mean the entire range and as such are equivalent to
-@code{0:-1}, as shown in the following example in which the entire first
-column is referenced.
-
-@example
-#+results: example-table
-| 1 | a |
-| 2 | b |
-| 3 | c |
-| 4 | d |
-
-#+begin_src emacs-lisp :var data=example-table[,0]
- data
-#+end_src
-
-#+results:
-| 1 | 2 | 3 | 4 |
-@end example
-
-It is possible to index into the results of code blocks as well as tables.
-Any number of dimensions can be indexed. Dimensions are separated from one
-another by commas, as shown in the following example.
-
-@example
-#+source: 3D
-#+begin_src emacs-lisp
- '(((1 2 3) (4 5 6) (7 8 9))
- ((10 11 12) (13 14 15) (16 17 18))
- ((19 20 21) (22 23 24) (25 26 27)))
-#+end_src
-
-#+begin_src emacs-lisp :var data=3D[1,,1]
- data
-#+end_src
-
-#+results:
-| 11 | 14 | 17 |
-@end example
-
-@node results, file, var, Specific header arguments
-@subsubsection @code{:results}
-
-There are three classes of @code{:results} header argument. Only one option
-per class may be supplied per code block.
-
-@itemize @bullet
-@item
-@b{collection} header arguments specify how the results should be collected
-from the code block
-@item
-@b{type} header arguments specify what type of result the code block will
-return---which has implications for how they will be inserted into the
-Org-mode buffer
-@item
-@b{handling} header arguments specify how the results of evaluating the code
-block should be handled.
-@end itemize
-
-@subsubheading Collection
-The following options are mutually exclusive, and specify how the results
-should be collected from the code block.
-
-@itemize @bullet
-@item @code{value}
-This is the default. The result is the value of the last statement in the
-code block. This header argument places the evaluation in functional
-mode. Note that in some languages, e.g., Python, use of this result type
-requires that a @code{return} statement be included in the body of the source
-code block. E.g., @code{:results value}.
-@item @code{output}
-The result is the collection of everything printed to STDOUT during the
-execution of the code block. This header argument places the
-evaluation in scripting mode. E.g., @code{:results output}.
-@end itemize
-
-@subsubheading Type
-
-The following options are mutually exclusive and specify what type of results
-the code block will return. By default, results are inserted as either a
-table or scalar depending on their value.
-
-@itemize @bullet
-@item @code{table}, @code{vector}
-The results should be interpreted as an Org-mode table. If a single value is
-returned, it will be converted into a table with one row and one column.
-E.g., @code{:results value table}.
-@item @code{list}
-The results should be interpreted as an Org-mode list. If a single scalar
-value is returned it will be converted into a list with only one element.
-@item @code{scalar}, @code{verbatim}
-The results should be interpreted literally---they will not be
-converted into a table. The results will be inserted into the Org-mode
-buffer as quoted text. E.g., @code{:results value verbatim}.
-@item @code{file}
-The results will be interpreted as the path to a file, and will be inserted
-into the Org-mode buffer as a file link. E.g., @code{:results value file}.
-@item @code{raw}, @code{org}
-The results are interpreted as raw Org-mode code and are inserted directly
-into the buffer. If the results look like a table they will be aligned as
-such by Org-mode. E.g., @code{:results value raw}.
-@item @code{html}
-Results are assumed to be HTML and will be enclosed in a @code{begin_html}
-block. E.g., @code{:results value html}.
-@item @code{latex}
-Results assumed to be LaTeX and are enclosed in a @code{begin_latex} block.
-E.g., @code{:results value latex}.
-@item @code{code}
-Result are assumed to be parseable code and are enclosed in a code block.
-E.g., @code{:results value code}.
-@item @code{pp}
-The result is converted to pretty-printed code and is enclosed in a code
-block. This option currently supports Emacs Lisp, Python, and Ruby. E.g.,
-@code{:results value pp}.
-@end itemize
-
-@subsubheading Handling
-The following results options indicate what happens with the
-results once they are collected.
-
-@itemize @bullet
-@item @code{silent}
-The results will be echoed in the minibuffer but will not be inserted into
-the Org-mode buffer. E.g., @code{:results output silent}.
-@item @code{replace}
-The default value. Any existing results will be removed, and the new results
-will be inserted into the Org-mode buffer in their place. E.g.,
-@code{:results output replace}.
-@item @code{append}
-If there are pre-existing results of the code block then the new results will
-be appended to the existing results. Otherwise the new results will be
-inserted as with @code{replace}.
-@item @code{prepend}
-If there are pre-existing results of the code block then the new results will
-be prepended to the existing results. Otherwise the new results will be
-inserted as with @code{replace}.
-@end itemize
-
-@node file, dir, results, Specific header arguments
-@subsubsection @code{:file}
-
-The header argument @code{:file} is used to specify a path for file output.
-An Org-mode style @code{file:} link is inserted into the buffer as the result
-(see @ref{Link format}). Common examples are graphical output from R,
-gnuplot, ditaa and LaTeX code blocks.
-
-Note that for some languages, including R, gnuplot, LaTeX and ditaa,
-graphical output is sent to the specified file without the file being
-referenced explicitly in the code block. See the documentation for the
-individual languages for details. In contrast, general purpose languages such
-as Python and Ruby require that the code explicitly create output
-corresponding to the path indicated by @code{:file}.
-
-
-@node dir, exports, file, Specific header arguments
-@subsubsection @code{:dir} and remote execution
-
-While the @code{:file} header argument can be used to specify the path to the
-output file, @code{:dir} specifies the default directory during code block
-execution. If it is absent, then the directory associated with the current
-buffer is used. In other words, supplying @code{:dir path} temporarily has
-the same effect as changing the current directory with @kbd{M-x cd path}, and
-then not supplying @code{:dir}. Under the surface, @code{:dir} simply sets
-the value of the Emacs variable @code{default-directory}.
-
-When using @code{:dir}, you should supply a relative path for file output
-(e.g. @code{:file myfile.jpg} or @code{:file results/myfile.jpg}) in which
-case that path will be interpreted relative to the default directory.
-
-In other words, if you want your plot to go into a folder called @file{Work}
-in your home directory, you could use
-
-@example
-#+begin_src R :file myplot.png :dir ~/Work
-matplot(matrix(rnorm(100), 10), type="l")
-#+end_src
-@end example
-
-@subsubheading Remote execution
-A directory on a remote machine can be specified using tramp file syntax, in
-which case the code will be evaluated on the remote machine. An example is
-
-@example
-#+begin_src R :file plot.png :dir /dand@@yakuba.princeton.edu:
-plot(1:10, main=system("hostname", intern=TRUE))
-#+end_src
-@end example
-
-Text results will be returned to the local Org-mode buffer as usual, and file
-output will be created on the remote machine with relative paths interpreted
-relative to the remote directory. An Org-mode link to the remote file will be
-created.
-
-So, in the above example a plot will be created on the remote machine,
-and a link of the following form will be inserted in the org buffer:
-
-@example
-[[file:/scp:dand@@yakuba.princeton.edu:/home/dand/plot.png][plot.png]]
-@end example
-
-Most of this functionality follows immediately from the fact that @code{:dir}
-sets the value of the Emacs variable @code{default-directory}, thanks to
-tramp. Those using XEmacs, or GNU Emacs prior to version 23 may need to
-install tramp separately in order for these features to work correctly.
-
-@subsubheading Further points
-
-@itemize @bullet
-@item
-If @code{:dir} is used in conjunction with @code{:session}, although it will
-determine the starting directory for a new session as expected, no attempt is
-currently made to alter the directory associated with an existing session.
-@item
-@code{:dir} should typically not be used to create files during export with
-@code{:exports results} or @code{:exports both}. The reason is that, in order
-to retain portability of exported material between machines, during export
-links inserted into the buffer will *not* be expanded against @code{default
-directory}. Therefore, if @code{default-directory} is altered using
-@code{:dir}, it is probable that the file will be created in a location to
-which the link does not point.
-@end itemize
-
-@node exports, tangle, dir, Specific header arguments
-@subsubsection @code{:exports}
-
-The @code{:exports} header argument specifies what should be included in HTML
-or LaTeX exports of the Org-mode file.
-
-@itemize @bullet
-@item @code{code}
-The default. The body of code is included into the exported file. E.g.,
-@code{:exports code}.
-@item @code{results}
-The result of evaluating the code is included in the exported file. E.g.,
-@code{:exports results}.
-@item @code{both}
-Both the code and results are included in the exported file. E.g.,
-@code{:exports both}.
-@item @code{none}
-Nothing is included in the exported file. E.g., @code{:exports none}.
-@end itemize
-
-@node tangle, comments, exports, Specific header arguments
-@subsubsection @code{:tangle}
-
-The @code{:tangle} header argument specifies whether or not the code
-block should be included in tangled extraction of source code files.
-
-@itemize @bullet
-@item @code{tangle}
-The code block is exported to a source code file named after the
-basename (name w/o extension) of the Org-mode file. E.g., @code{:tangle
-yes}.
-@item @code{no}
-The default. The code block is not exported to a source code file.
-E.g., @code{:tangle no}.
-@item other
-Any other string passed to the @code{:tangle} header argument is interpreted
-as a file basename to which the block will be exported. E.g., @code{:tangle
-basename}.
-@end itemize
-
-@node comments, no-expand, tangle, Specific header arguments
-@subsubsection @code{:comments}
-By default code blocks are tangled to source-code files without any insertion
-of comments beyond those which may already exist in the body of the code
-block. The @code{:comments} header argument can be set as follows to control
-the insertion of extra comments into the tangled code file.
-
-@itemize @bullet
-@item @code{no}
-The default. No extra comments are inserted during tangling.
-@item @code{link}
-The code block is wrapped in comments which contain pointers back to the
-original Org file from which the code was tangled.
-@item @code{yes}
-A synonym for ``link'' to maintain backwards compatibility.
-@item @code{org}
-Include text from the org-mode file as a comment.
-
-The text is picked from the leading context of the tangled code and is
-limited by the nearest headline or source block as the case may be.
-@item @code{both}
-Turns on both the ``link'' and ``org'' comment options.
-@end itemize
-
-@node no-expand, session, comments, Specific header arguments
-@subsubsection @code{:no-expand}
-
-By default, code blocks are expanded with @code{org-babel-expand-src-block}
-during tangling. This has the effect of assigning values to variables
-specified with @code{:var} (see @ref{var}), and of replacing ``noweb''
-references (see @ref{Noweb reference syntax}) with their targets. The
-@code{:no-expand} header argument can be used to turn off this behavior.
-
-@node session, noweb, no-expand, Specific header arguments
-@subsubsection @code{:session}
-
-The @code{:session} header argument starts a session for an interpreted
-language where state is preserved.
-
-By default, a session is not started.
-
-A string passed to the @code{:session} header argument will give the session
-a name. This makes it possible to run concurrent sessions for each
-interpreted language.
-
-@node noweb, cache, session, Specific header arguments
-@subsubsection @code{:noweb}
-
-The @code{:noweb} header argument controls expansion of ``noweb'' style (see
-@ref{Noweb reference syntax}) references in a code block. This header
-argument can have one of three values: @code{yes} @code{no} or @code{tangle}.
-
-@itemize @bullet
-@item @code{yes}
-All ``noweb'' syntax references in the body of the code block will be
-expanded before the block is evaluated, tangled or exported.
-@item @code{no}
-The default. No ``noweb'' syntax specific action is taken on evaluating
-code blocks, However, noweb references will still be expanded during
-tangling.
-@item @code{tangle}
-All ``noweb'' syntax references in the body of the code block will be
-expanded before the block is tangled, however ``noweb'' references will not
-be expanded when the block is evaluated or exported.
-@end itemize
-
-@subsubheading Noweb prefix lines
-Noweb insertions are now placed behind the line prefix of the
-@code{<<reference>>}.
-This behavior is illustrated in the following example. Because the
-@code{<<example>>} noweb reference appears behind the SQL comment syntax,
-each line of the expanded noweb reference will be commented.
-
-This code block:
-
-@example
--- <<example>>
-@end example
-
-
-expands to:
-
-@example
--- this is the
--- multi-line body of example
-@end example
-
-Note that noweb replacement text that does not contain any newlines will not
-be affected by this change, so it is still possible to use inline noweb
-references.
-
-@node cache, hlines, noweb, Specific header arguments
-@subsubsection @code{:cache}
-
-The @code{:cache} header argument controls the use of in-buffer caching of
-the results of evaluating code blocks. It can be used to avoid re-evaluating
-unchanged code blocks. This header argument can have one of two
-values: @code{yes} or @code{no}.
-
-@itemize @bullet
-@item @code{no}
-The default. No caching takes place, and the code block will be evaluated
-every time it is called.
-@item @code{yes}
-Every time the code block is run a SHA1 hash of the code and arguments
-passed to the block will be generated. This hash is packed into the
-@code{#+results:} line and will be checked on subsequent
-executions of the code block. If the code block has not
-changed since the last time it was evaluated, it will not be re-evaluated.
-@end itemize
-
-@node hlines, colnames, cache, Specific header arguments
-@subsubsection @code{:hlines}
-
-Tables are frequently represented with one or more horizontal lines, or
-hlines. The @code{:hlines} argument to a code block accepts the
-values @code{yes} or @code{no}, with a default value of @code{no}.
-
-@itemize @bullet
-@item @code{no}
-Strips horizontal lines from the input table. In most languages this is the
-desired effect because an @code{hline} symbol is interpreted as an unbound
-variable and raises an error. Setting @code{:hlines no} or relying on the
-default value yields the following results.
-
-@example
-#+tblname: many-cols
-| a | b | c |
-|---+---+---|
-| d | e | f |
-|---+---+---|
-| g | h | i |
-
-#+source: echo-table
-#+begin_src python :var tab=many-cols
- return tab
-#+end_src
-
-#+results: echo-table
-| a | b | c |
-| d | e | f |
-| g | h | i |
-@end example
-
-@item @code{yes}
-Leaves hlines in the table. Setting @code{:hlines yes} has this effect.
-
-@example
-#+tblname: many-cols
-| a | b | c |
-|---+---+---|
-| d | e | f |
-|---+---+---|
-| g | h | i |
-
-#+source: echo-table
-#+begin_src python :var tab=many-cols :hlines yes
- return tab
-#+end_src
-
-#+results: echo-table
-| a | b | c |
-|---+---+---|
-| d | e | f |
-|---+---+---|
-| g | h | i |
-@end example
-@end itemize
-
-@node colnames, rownames, hlines, Specific header arguments
-@subsubsection @code{:colnames}
-
-The @code{:colnames} header argument accepts the values @code{yes},
-@code{no}, or @code{nil} for unassigned. The default value is @code{nil}.
-
-@itemize @bullet
-@item @code{nil}
-If an input table looks like it has column names
-(because its second row is an hline), then the column
-names will be removed from the table before
-processing, then reapplied to the results.
-
-@example
-#+tblname: less-cols
-| a |
-|---|
-| b |
-| c |
-
-#+srcname: echo-table-again
-#+begin_src python :var tab=less-cols
- return [[val + '*' for val in row] for row in tab]
-#+end_src
-
-#+results: echo-table-again
-| a |
-|----|
-| b* |
-| c* |
-@end example
-
-@item @code{no}
-No column name pre-processing takes place
-
-@item @code{yes}
-Column names are removed and reapplied as with @code{nil} even if the table
-does not ``look like'' it has column names (i.e. the second row is not an
-hline)
-@end itemize
-
-@node rownames, shebang, colnames, Specific header arguments
-@subsubsection @code{:rownames}
-
-The @code{:rownames} header argument can take on the values @code{yes}
-or @code{no}, with a default value of @code{no}.
-
-@itemize @bullet
-@item @code{no}
-No row name pre-processing will take place.
-
-@item @code{yes}
-The first column of the table is removed from the table before processing,
-and is then reapplied to the results.
-
-@example
-#+tblname: with-rownames
-| one | 1 | 2 | 3 | 4 | 5 |
-| two | 6 | 7 | 8 | 9 | 10 |
-
-#+srcname: echo-table-once-again
-#+begin_src python :var tab=with-rownames :rownames yes
- return [[val + 10 for val in row] for row in tab]
-#+end_src
-
-#+results: echo-table-once-again
-| one | 11 | 12 | 13 | 14 | 15 |
-| two | 16 | 17 | 18 | 19 | 20 |
-@end example
-@end itemize
-
-@node shebang, eval, rownames, Specific header arguments
-@subsubsection @code{:shebang}
-
-Setting the @code{:shebang} header argument to a string value
-(e.g. @code{:shebang "#!/bin/bash"}) causes the string to be inserted as the
-first line of any tangled file holding the code block, and the file
-permissions of the tangled file are set to make it executable.
-
-@node eval, , shebang, Specific header arguments
-@subsubsection @code{:eval}
-The @code{:eval} header argument can be used to limit the evaluation of
-specific code blocks. @code{:eval} accepts two arguments ``never'' and
-``query''. @code{:eval never} will ensure that a code block is never
-evaluated, this can be useful for protecting against the evaluation of
-dangerous code blocks. @code{:eval query} will require a query for every
-execution of a code block regardless of the value of the
-@code{org-confirm-babel-evaluate} variable.
-
-@node Results of evaluation, Noweb reference syntax, Header arguments, Working With Source Code
-@section Results of evaluation
-@cindex code block, results of evaluation
-@cindex source code, results of evaluation
-
-The way in which results are handled depends on whether a session is invoked,
-as well as on whether @code{:results value} or @code{:results output} is
-used. The following table shows the possibilities:
-
-@multitable @columnfractions 0.26 0.33 0.41
-@item @tab @b{Non-session} @tab @b{Session}
-@item @code{:results value} @tab value of last expression @tab value of last expression
-@item @code{:results output} @tab contents of STDOUT @tab concatenation of interpreter output
-@end multitable
-
-Note: With @code{:results value}, the result in both @code{:session} and
-non-session is returned to Org-mode as a table (a one- or two-dimensional
-vector of strings or numbers) when appropriate.
-
-@subsection Non-session
-@subsubsection @code{:results value}
-This is the default. Internally, the value is obtained by wrapping the code
-in a function definition in the external language, and evaluating that
-function. Therefore, code should be written as if it were the body of such a
-function. In particular, note that Python does not automatically return a
-value from a function unless a @code{return} statement is present, and so a
-@samp{return} statement will usually be required in Python.
-
-This is the only one of the four evaluation contexts in which the code is
-automatically wrapped in a function definition.
-
-@subsubsection @code{:results output}
-The code is passed to the interpreter as an external process, and the
-contents of the standard output stream are returned as text. (In certain
-languages this also contains the error output stream; this is an area for
-future work.)
-
-@subsection Session
-@subsubsection @code{:results value}
-The code is passed to the interpreter running as an interactive Emacs
-inferior process. The result returned is the result of the last evaluation
-performed by the interpreter. (This is obtained in a language-specific
-manner: the value of the variable @code{_} in Python and Ruby, and the value
-of @code{.Last.value} in R).
-
-@subsubsection @code{:results output}
-The code is passed to the interpreter running as an interactive Emacs
-inferior process. The result returned is the concatenation of the sequence of
-(text) output from the interactive interpreter. Notice that this is not
-necessarily the same as what would be sent to @code{STDOUT} if the same code
-were passed to a non-interactive interpreter running as an external
-process. For example, compare the following two blocks:
-
-@example
-#+begin_src python :results output
- print "hello"
- 2
- print "bye"
-#+end_src
-
-#+resname:
-: hello
-: bye
-@end example
-
-In non-session mode, the `2' is not printed and does not appear.
-@example
-#+begin_src python :results output :session
- print "hello"
- 2
- print "bye"
-#+end_src
-
-#+resname:
-: hello
-: 2
-: bye
-@end example
-
-But in @code{:session} mode, the interactive interpreter receives input `2'
-and prints out its value, `2'. (Indeed, the other print statements are
-unnecessary here).
-
-@node Noweb reference syntax, Key bindings and useful functions, Results of evaluation, Working With Source Code
-@section Noweb reference syntax
-@cindex code block, noweb reference
-@cindex syntax, noweb
-@cindex source code, noweb reference
-
-The ``noweb'' (see @uref{http://www.cs.tufts.edu/~nr/noweb/}) Literate
-Programming system allows named blocks of code to be referenced by using the
-familiar Noweb syntax:
-
-@example
-<<code-block-name>>
-@end example
-
-When a code block is tangled or evaluated, whether or not ``noweb''
-references are expanded depends upon the value of the @code{:noweb} header
-argument. If @code{:noweb yes}, then a Noweb reference is expanded before
-evaluation. If @code{:noweb no}, the default, then the reference is not
-expanded before evaluation.
-
-Note: the default value, @code{:noweb no}, was chosen to ensure that
-correct code is not broken in a language, such as Ruby, where
-@code{<<arg>>} is a syntactically valid construct. If @code{<<arg>>} is not
-syntactically valid in languages that you use, then please consider setting
-the default value.
-
-@node Key bindings and useful functions, Batch execution, Noweb reference syntax, Working With Source Code
-@section Key bindings and useful functions
-@cindex code block, key bindings
-
-Many common Org-mode key sequences are re-bound depending on
-the context.
-
-Within a code block, the following key bindings
-are active:
-
-@multitable @columnfractions 0.25 0.75
-@kindex C-c C-c
-@item @kbd{C-c C-c} @tab org-babel-execute-src-block
-@kindex C-c C-o
-@item @kbd{C-c C-o} @tab org-babel-open-src-block-result
-@kindex C-up
-@item @kbd{C-@key{up}} @tab org-babel-load-in-session
-@kindex M-down
-@item @kbd{M-@key{down}} @tab org-babel-pop-to-session
-@end multitable
-
-In an Org-mode buffer, the following key bindings are active:
-
-@multitable @columnfractions 0.45 0.55
-@kindex C-c C-v a
-@kindex C-c C-v C-a
-@item @kbd{C-c C-v a} @ @ @r{or} @ @ @kbd{C-c C-v C-a} @tab org-babel-sha1-hash
-@kindex C-c C-v b
-@kindex C-c C-v C-b
-@item @kbd{C-c C-v b} @ @ @r{or} @ @ @kbd{C-c C-v C-b} @tab org-babel-execute-buffer
-@kindex C-c C-v f
-@kindex C-c C-v C-f
-@item @kbd{C-c C-v f} @ @ @r{or} @ @ @kbd{C-c C-v C-f} @tab org-babel-tangle-file
-@kindex C-c C-v g
-@item @kbd{C-c C-v g} @tab org-babel-goto-named-source-block
-@kindex C-c C-v h
-@item @kbd{C-c C-v h} @tab org-babel-describe-bindings
-@kindex C-c C-v l
-@kindex C-c C-v C-l
-@item @kbd{C-c C-v l} @ @ @r{or} @ @ @kbd{C-c C-v C-l} @tab org-babel-lob-ingest
-@kindex C-c C-v p
-@kindex C-c C-v C-p
-@item @kbd{C-c C-v p} @ @ @r{or} @ @ @kbd{C-c C-v C-p} @tab org-babel-expand-src-block
-@kindex C-c C-v s
-@kindex C-c C-v C-s
-@item @kbd{C-c C-v s} @ @ @r{or} @ @ @kbd{C-c C-v C-s} @tab org-babel-execute-subtree
-@kindex C-c C-v t
-@kindex C-c C-v C-t
-@item @kbd{C-c C-v t} @ @ @r{or} @ @ @kbd{C-c C-v C-t} @tab org-babel-tangle
-@kindex C-c C-v z
-@kindex C-c C-v C-z
-@item @kbd{C-c C-v z} @ @ @r{or} @ @ @kbd{C-c C-v C-z} @tab org-babel-switch-to-session
-@end multitable
-
-@c When possible these keybindings were extended to work when the control key is
-@c kept pressed, resulting in the following additional keybindings.
-
-@c @multitable @columnfractions 0.25 0.75
-@c @item @kbd{C-c C-v C-a} @tab org-babel-sha1-hash
-@c @item @kbd{C-c C-v C-b} @tab org-babel-execute-buffer
-@c @item @kbd{C-c C-v C-f} @tab org-babel-tangle-file
-@c @item @kbd{C-c C-v C-l} @tab org-babel-lob-ingest
-@c @item @kbd{C-c C-v C-p} @tab org-babel-expand-src-block
-@c @item @kbd{C-c C-v C-s} @tab org-babel-execute-subtree
-@c @item @kbd{C-c C-v C-t} @tab org-babel-tangle
-@c @item @kbd{C-c C-v C-z} @tab org-babel-switch-to-session
-@c @end multitable
-
-@node Batch execution, , Key bindings and useful functions, Working With Source Code
-@section Batch execution
-@cindex code block, batch execution
-@cindex source code, batch execution
-
-It is possible to call functions from the command line. This shell
-script calls @code{org-babel-tangle} on every one of its arguments.
-
-Be sure to adjust the paths to fit your system.
-
-@example
-#!/bin/sh
-# -*- mode: shell-script -*-
-#
-# tangle files with org-mode
-#
-DIR=`pwd`
-FILES=""
-ORGINSTALL="~/src/org/lisp/org-install.el"
-
-# wrap each argument in the code required to call tangle on it
-for i in $@@; do
- FILES="$FILES \"$i\""
-done
-
-emacs -Q --batch -l $ORGINSTALL \
---eval "(progn
-(add-to-list 'load-path (expand-file-name \"~/src/org/lisp/\"))
-(add-to-list 'load-path (expand-file-name \"~/src/org/contrib/lisp/\"))
-(require 'org)(require 'org-exp)(require 'ob)(require 'ob-tangle)
-(mapc (lambda (file)
- (find-file (expand-file-name file \"$DIR\"))
- (org-babel-tangle)
- (kill-buffer)) '($FILES)))" 2>&1 |grep tangled
-@end example
-
-@node Miscellaneous, Hacking, Working With Source Code, Top
-@chapter Miscellaneous
-
-@menu
-* Completion:: M-TAB knows what you need
-* Easy Templates:: Quick insertion of structural elements
-* Speed keys:: Electric commands at the beginning of a headline
-* Code evaluation security:: Org mode files evaluate inline code
-* Customization:: Adapting Org to your taste
-* In-buffer settings:: Overview of the #+KEYWORDS
-* The very busy C-c C-c key:: When in doubt, press C-c C-c
-* Clean view:: Getting rid of leading stars in the outline
-* TTY keys:: Using Org on a tty
-* Interaction:: Other Emacs packages
-@end menu
-
-
-@node Completion, Easy Templates, Miscellaneous, Miscellaneous
-@section Completion
-@cindex completion, of @TeX{} symbols
-@cindex completion, of TODO keywords
-@cindex completion, of dictionary words
-@cindex completion, of option keywords
-@cindex completion, of tags
-@cindex completion, of property keys
-@cindex completion, of link abbreviations
-@cindex @TeX{} symbol completion
-@cindex TODO keywords completion
-@cindex dictionary word completion
-@cindex option keyword completion
-@cindex tag completion
-@cindex link abbreviations, completion of
-
-Emacs would not be Emacs without completion, and Org-mode uses it whenever it
-makes sense. If you prefer an @i{iswitchb}- or @i{ido}-like interface for
-some of the completion prompts, you can specify your preference by setting at
-most one of the variables @code{org-completion-use-iswitchb}
-@code{org-completion-use-ido}.
-
-Org supports in-buffer completion. This type of completion does
-not make use of the minibuffer. You simply type a few letters into
-the buffer and use the key to complete text right there.
-
-@table @kbd
-@kindex M-@key{TAB}
-@item M-@key{TAB}
-Complete word at point
-@itemize @bullet
-@item
-At the beginning of a headline, complete TODO keywords.
-@item
-After @samp{\}, complete @TeX{} symbols supported by the exporter.
-@item
-After @samp{*}, complete headlines in the current buffer so that they
-can be used in search links like @samp{[[*find this headline]]}.
-@item
-After @samp{:} in a headline, complete tags. The list of tags is taken
-from the variable @code{org-tag-alist} (possibly set through the
-@samp{#+TAGS} in-buffer option, @pxref{Setting tags}), or it is created
-dynamically from all tags used in the current buffer.
-@item
-After @samp{:} and not in a headline, complete property keys. The list
-of keys is constructed dynamically from all keys used in the current
-buffer.
-@item
-After @samp{[}, complete link abbreviations (@pxref{Link abbreviations}).
-@item
-After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or
-@samp{OPTIONS} which set file-specific options for Org-mode. When the
-option keyword is already complete, pressing @kbd{M-@key{TAB}} again
-will insert example settings for this keyword.
-@item
-In the line after @samp{#+STARTUP: }, complete startup keywords,
-i.e. valid keys for this line.
-@item
-Elsewhere, complete dictionary words using Ispell.
-@end itemize
-@end table
-
-@node Easy Templates, Speed keys, Completion, Miscellaneous
-@section Easy Templates
-@cindex template insertion
-@cindex insertion, of templates
-
-Org-mode supports insertion of empty structural elements (like
-@code{#+BEGIN_SRC} and @code{#+END_SRC} pairs) with just a few key
-strokes. This is achieved through a native template expansion mechanism.
-Note that Emacs has several other template mechanisms which could be used in
-a similar way, for example @file{yasnippet}.
-
-To insert a structural element, type a @samp{<}, followed by a template
-selector and @kbd{@key{TAB}}. Completion takes effect only when the above
-keystrokes are typed on a line by itself.
-
-The following template selectors are currently supported.
-
-@multitable @columnfractions 0.1 0.9
-@item @kbd{s} @tab @code{#+begin_src ... #+end_src}
-@item @kbd{e} @tab @code{#+begin_example ... #+end_example}
-@item @kbd{q} @tab @code{#+begin_quote ... #+end_quote}
-@item @kbd{v} @tab @code{#+begin_verse ... #+end_verse}
-@item @kbd{c} @tab @code{#+begin_center ... #+end_center}
-@item @kbd{l} @tab @code{#+begin_latex ... #+end_latex}
-@item @kbd{L} @tab @code{#+latex:}
-@item @kbd{h} @tab @code{#+begin_html ... #+end_html}
-@item @kbd{H} @tab @code{#+html:}
-@item @kbd{a} @tab @code{#+begin_ascii ... #+end_ascii}
-@item @kbd{A} @tab @code{#+ascii:}
-@item @kbd{i} @tab @code{#+include:} line
-@end multitable
-
-For example, on an empty line, typing "<e" and then pressing TAB, will expand
-into a complete EXAMPLE template.
-
-You can install additional templates by customizing the variable
-@code{org-structure-template-alist}. See the docstring of the variable for
-additional details.
-
-@node Speed keys, Code evaluation security, Easy Templates, Miscellaneous
-@section Speed keys
-@cindex speed keys
-@vindex org-use-speed-commands
-@vindex org-speed-commands-user
-
-Single keys can be made to execute commands when the cursor is at the
-beginning of a headline, i.e. before the first star. Configure the variable
-@code{org-use-speed-commands} to activate this feature. There is a
-pre-defined list of commands, and you can add more such commands using the
-variable @code{org-speed-commands-user}. Speed keys do not only speed up
-navigation and other commands, but they also provide an alternative way to
-execute commands bound to keys that are not or not easily available on a TTY,
-or on a small mobile device with a limited keyboard.
-
-To see which commands are available, activate the feature and press @kbd{?}
-with the cursor at the beginning of a headline.
-
-@node Code evaluation security, Customization, Speed keys, Miscellaneous
-@section Code evaluation and security issues
-
-Org provides tools to work with the code snippets, including evaluating them.
-
-Running code on your machine always comes with a security risk. Badly
-written or malicious code can be executed on purpose or by accident. Org has
-default settings which will only evaluate such code if you give explicit
-permission to do so, and as a casual user of these features you should leave
-these precautions intact.
-
-For people who regularly work with such code, the confirmation prompts can
-become annoying, and you might want to turn them off. This can be done, but
-you must be aware of the risks that are involved.
-
-Code evaluation can happen under the following circumstances:
-
-@table @i
-@item Source code blocks
-Source code blocks can be evaluated during export, or when pressing @kbd{C-c
-C-c} in the block. The most important thing to realize here is that Org mode
-files which contain code snippets are, in a certain sense, like executable
-files. So you should accept them and load them into Emacs only from trusted
-sources---just like you would do with a program you install on your computer.
-
-Make sure you know what you are doing before customizing the variables
-which take off the default security brakes.
-
-@defopt org-confirm-babel-evaluate
-When set to t user is queried before code block evaluation
-@end defopt
-
-@item Following @code{shell} and @code{elisp} links
-Org has two link types that can directly evaluate code (@pxref{External
-links}). These links can be problematic because the code to be evaluated is
-not visible.
-
-@defopt org-confirm-shell-link-function
-Function to queries user about shell link execution.
-@end defopt
-@defopt org-confirm-elisp-link-function
-Functions to query user for Emacs Lisp link execution.
-@end defopt
-
-@item Formulas in tables
-Formulas in tables (@pxref{The spreadsheet}) are code that is evaluated
-either by the @i{calc} interpreter, or by the @i{Emacs Lisp} interpreter.
-@end table
-
-@node Customization, In-buffer settings, Code evaluation security, Miscellaneous
-@section Customization
-@cindex customization
-@cindex options, for customization
-@cindex variables, for customization
-
-There are more than 180 variables that can be used to customize
-Org. For the sake of compactness of the manual, I am not
-describing the variables here. A structured overview of customization
-variables is available with @kbd{M-x org-customize}. Or select
-@code{Browse Org Group} from the @code{Org->Customization} menu. Many
-settings can also be activated on a per-file basis, by putting special
-lines into the buffer (@pxref{In-buffer settings}).
-
-@node In-buffer settings, The very busy C-c C-c key, Customization, Miscellaneous
-@section Summary of in-buffer settings
-@cindex in-buffer settings
-@cindex special keywords
-
-Org-mode uses special lines in the buffer to define settings on a
-per-file basis. These lines start with a @samp{#+} followed by a
-keyword, a colon, and then individual words defining a setting. Several
-setting words can be in the same line, but you can also have multiple
-lines for the keyword. While these settings are described throughout
-the manual, here is a summary. After changing any of those lines in the
-buffer, press @kbd{C-c C-c} with the cursor still in the line to
-activate the changes immediately. Otherwise they become effective only
-when the file is visited again in a new Emacs session.
-
-@vindex org-archive-location
-@table @kbd
-@item #+ARCHIVE: %s_done::
-This line sets the archive location for the agenda file. It applies for
-all subsequent lines until the next @samp{#+ARCHIVE} line, or the end
-of the file. The first such line also applies to any entries before it.
-The corresponding variable is @code{org-archive-location}.
-@item #+CATEGORY:
-This line sets the category for the agenda file. The category applies
-for all subsequent lines until the next @samp{#+CATEGORY} line, or the
-end of the file. The first such line also applies to any entries before it.
-@item #+COLUMNS: %25ITEM .....
-@cindex property, COLUMNS
-Set the default format for columns view. This format applies when
-columns view is invoked in locations where no @code{COLUMNS} property
-applies.
-@item #+CONSTANTS: name1=value1 ...
-@vindex org-table-formula-constants
-@vindex org-table-formula
-Set file-local values for constants to be used in table formulas. This
-line sets the local variable @code{org-table-formula-constants-local}.
-The global version of this variable is
-@code{org-table-formula-constants}.
-@item #+FILETAGS: :tag1:tag2:tag3:
-Set tags that can be inherited by any entry in the file, including the
-top-level entries.
-@item #+DRAWERS: NAME1 .....
-@vindex org-drawers
-Set the file-local set of drawers. The corresponding global variable is
-@code{org-drawers}.
-@item #+LINK: linkword replace
-@vindex org-link-abbrev-alist
-These lines (several are allowed) specify link abbreviations.
-@xref{Link abbreviations}. The corresponding variable is
-@code{org-link-abbrev-alist}.
-@item #+PRIORITIES: highest lowest default
-@vindex org-highest-priority
-@vindex org-lowest-priority
-@vindex org-default-priority
-This line sets the limits and the default for the priorities. All three
-must be either letters A-Z or numbers 0-9. The highest priority must
-have a lower ASCII number than the lowest priority.
-@item #+PROPERTY: Property_Name Value
-This line sets a default inheritance value for entries in the current
-buffer, most useful for specifying the allowed values of a property.
-@cindex #+SETUPFILE
-@item #+SETUPFILE: file
-This line defines a file that holds more in-buffer setup. Normally this is
-entirely ignored. Only when the buffer is parsed for option-setting lines
-(i.e. when starting Org-mode for a file, when pressing @kbd{C-c C-c} in a
-settings line, or when exporting), then the contents of this file are parsed
-as if they had been included in the buffer. In particular, the file can be
-any other Org-mode file with internal setup. You can visit the file the
-cursor is in the line with @kbd{C-c '}.
-@item #+STARTUP:
-@cindex #+STARTUP:
-This line sets options to be used at startup of Org-mode, when an
-Org file is being visited.
-
-The first set of options deals with the initial visibility of the outline
-tree. The corresponding variable for global default settings is
-@code{org-startup-folded}, with a default value @code{t}, which means
-@code{overview}.
-@vindex org-startup-folded
-@cindex @code{overview}, STARTUP keyword
-@cindex @code{content}, STARTUP keyword
-@cindex @code{showall}, STARTUP keyword
-@cindex @code{showeverything}, STARTUP keyword
-@example
-overview @r{top-level headlines only}
-content @r{all headlines}
-showall @r{no folding of any entries}
-showeverything @r{show even drawer contents}
-@end example
-
-@vindex org-startup-indented
-@cindex @code{indent}, STARTUP keyword
-@cindex @code{noindent}, STARTUP keyword
-Dynamic virtual indentation is controlled by the variable
-@code{org-startup-indented}@footnote{Emacs 23 and Org-mode 6.29 are required}
-@example
-indent @r{start with @code{org-indent-mode} turned on}
-noindent @r{start with @code{org-indent-mode} turned off}
-@end example
-
-@vindex org-startup-align-all-tables
-Then there are options for aligning tables upon visiting a file. This
-is useful in files containing narrowed table columns. The corresponding
-variable is @code{org-startup-align-all-tables}, with a default value
-@code{nil}.
-@cindex @code{align}, STARTUP keyword
-@cindex @code{noalign}, STARTUP keyword
-@example
-align @r{align all tables}
-noalign @r{don't align tables on startup}
-@end example
-
-@vindex org-startup-with-inline-images
-When visiting a file, inline images can be automatically displayed. The
-corresponding variable is @code{org-startup-with-inline-images}, with a
-default value @code{nil} to avoid delays when visiting a file.
-@cindex @code{inlineimages}, STARTUP keyword
-@cindex @code{noinlineimages}, STARTUP keyword
-@example
-inlineimages @r{show inline images}
-noinlineimages @r{don't show inline images on startup}
-@end example
-
-@vindex org-log-done
-@vindex org-log-note-clock-out
-@vindex org-log-repeat
-Logging the closing and reopening of TODO items and clock intervals can be
-configured using these options (see variables @code{org-log-done},
-@code{org-log-note-clock-out} and @code{org-log-repeat})
-@cindex @code{logdone}, STARTUP keyword
-@cindex @code{lognotedone}, STARTUP keyword
-@cindex @code{nologdone}, STARTUP keyword
-@cindex @code{lognoteclock-out}, STARTUP keyword
-@cindex @code{nolognoteclock-out}, STARTUP keyword
-@cindex @code{logrepeat}, STARTUP keyword
-@cindex @code{lognoterepeat}, STARTUP keyword
-@cindex @code{nologrepeat}, STARTUP keyword
-@cindex @code{logreschedule}, STARTUP keyword
-@cindex @code{lognotereschedule}, STARTUP keyword
-@cindex @code{nologreschedule}, STARTUP keyword
-@cindex @code{logredeadline}, STARTUP keyword
-@cindex @code{lognoteredeadline}, STARTUP keyword
-@cindex @code{nologredeadline}, STARTUP keyword
-@cindex @code{logrefile}, STARTUP keyword
-@cindex @code{lognoterefile}, STARTUP keyword
-@cindex @code{nologrefile}, STARTUP keyword
-@example
-logdone @r{record a timestamp when an item is marked DONE}
-lognotedone @r{record timestamp and a note when DONE}
-nologdone @r{don't record when items are marked DONE}
-logrepeat @r{record a time when reinstating a repeating item}
-lognoterepeat @r{record a note when reinstating a repeating item}
-nologrepeat @r{do not record when reinstating repeating item}
-lognoteclock-out @r{record a note when clocking out}
-nolognoteclock-out @r{don't record a note when clocking out}
-logreschedule @r{record a timestamp when scheduling time changes}
-lognotereschedule @r{record a note when scheduling time changes}
-nologreschedule @r{do not record when a scheduling date changes}
-logredeadline @r{record a timestamp when deadline changes}
-lognoteredeadline @r{record a note when deadline changes}
-nologredeadline @r{do not record when a deadline date changes}
-logrefile @r{record a timestamp when refiling}
-lognoterefile @r{record a note when refiling}
-nologrefile @r{do not record when refiling}
-@end example
-@vindex org-hide-leading-stars
-@vindex org-odd-levels-only
-Here are the options for hiding leading stars in outline headings, and for
-indenting outlines. The corresponding variables are
-@code{org-hide-leading-stars} and @code{org-odd-levels-only}, both with a
-default setting @code{nil} (meaning @code{showstars} and @code{oddeven}).
-@cindex @code{hidestars}, STARTUP keyword
-@cindex @code{showstars}, STARTUP keyword
-@cindex @code{odd}, STARTUP keyword
-@cindex @code{even}, STARTUP keyword
-@example
-hidestars @r{make all but one of the stars starting a headline invisible.}
-showstars @r{show all stars starting a headline}
-indent @r{virtual indentation according to outline level}
-noindent @r{no virtual indentation according to outline level}
-odd @r{allow only odd outline levels (1,3,...)}
-oddeven @r{allow all outline levels}
-@end example
-@vindex org-put-time-stamp-overlays
-@vindex org-time-stamp-overlay-formats
-To turn on custom format overlays over timestamps (variables
-@code{org-put-time-stamp-overlays} and
-@code{org-time-stamp-overlay-formats}), use
-@cindex @code{customtime}, STARTUP keyword
-@example
-customtime @r{overlay custom time format}
-@end example
-@vindex constants-unit-system
-The following options influence the table spreadsheet (variable
-@code{constants-unit-system}).
-@cindex @code{constcgs}, STARTUP keyword
-@cindex @code{constSI}, STARTUP keyword
-@example
-constcgs @r{@file{constants.el} should use the c-g-s unit system}
-constSI @r{@file{constants.el} should use the SI unit system}
-@end example
-@vindex org-footnote-define-inline
-@vindex org-footnote-auto-label
-@vindex org-footnote-auto-adjust
-To influence footnote settings, use the following keywords. The
-corresponding variables are @code{org-footnote-define-inline},
-@code{org-footnote-auto-label}, and @code{org-footnote-auto-adjust}.
-@cindex @code{fninline}, STARTUP keyword
-@cindex @code{nofninline}, STARTUP keyword
-@cindex @code{fnlocal}, STARTUP keyword
-@cindex @code{fnprompt}, STARTUP keyword
-@cindex @code{fnauto}, STARTUP keyword
-@cindex @code{fnconfirm}, STARTUP keyword
-@cindex @code{fnplain}, STARTUP keyword
-@cindex @code{fnadjust}, STARTUP keyword
-@cindex @code{nofnadjust}, STARTUP keyword
-@example
-fninline @r{define footnotes inline}
-fnnoinline @r{define footnotes in separate section}
-fnlocal @r{define footnotes near first reference, but not inline}
-fnprompt @r{prompt for footnote labels}
-fnauto @r{create [fn:1]-like labels automatically (default)}
-fnconfirm @r{offer automatic label for editing or confirmation}
-fnplain @r{create [1]-like labels automatically}
-fnadjust @r{automatically renumber and sort footnotes}
-nofnadjust @r{do not renumber and sort automatically}
-@end example
-@cindex org-hide-block-startup
-To hide blocks on startup, use these keywords. The corresponding variable is
-@code{org-hide-block-startup}.
-@cindex @code{hideblocks}, STARTUP keyword
-@cindex @code{nohideblocks}, STARTUP keyword
-@example
-hideblocks @r{Hide all begin/end blocks on startup}
-nohideblocks @r{Do not hide blocks on startup}
-@end example
-@cindex org-pretty-entities
-The display of entities as UTF-8 characters is governed by the variable
-@code{org-pretty-entities} and the keywords
-@cindex @code{entitiespretty}, STARTUP keyword
-@cindex @code{entitiesplain}, STARTUP keyword
-@example
-entitiespretty @r{Show entities as UTF-8 characters where possible}
-entitiesplain @r{Leave entities plain}
-@end example
-@item #+TAGS: TAG1(c1) TAG2(c2)
-@vindex org-tag-alist
-These lines (several such lines are allowed) specify the valid tags in
-this file, and (potentially) the corresponding @emph{fast tag selection}
-keys. The corresponding variable is @code{org-tag-alist}.
-@item #+TBLFM:
-This line contains the formulas for the table directly above the line.
-@item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+DATE:,
-@itemx #+OPTIONS:, #+BIND:, #+XSLT:,
-@itemx #+DESCRIPTION:, #+KEYWORDS:,
-@itemx #+LATEX_HEADER:, #+STYLE:, #+LINK_UP:, #+LINK_HOME:,
-@itemx #+EXPORT_SELECT_TAGS:, #+EXPORT_EXCLUDE_TAGS:
-These lines provide settings for exporting files. For more details see
-@ref{Export options}.
-@item #+TODO: #+SEQ_TODO: #+TYP_TODO:
-@vindex org-todo-keywords
-These lines set the TODO keywords and their interpretation in the
-current file. The corresponding variable is @code{org-todo-keywords}.
-@end table
-
-@node The very busy C-c C-c key, Clean view, In-buffer settings, Miscellaneous
-@section The very busy C-c C-c key
-@kindex C-c C-c
-@cindex C-c C-c, overview
-
-The key @kbd{C-c C-c} has many purposes in Org, which are all
-mentioned scattered throughout this manual. One specific function of
-this key is to add @emph{tags} to a headline (@pxref{Tags}). In many
-other circumstances it means something like @emph{``Hey Org, look
-here and update according to what you see here''}. Here is a summary of
-what this means in different contexts.
-
-@itemize @minus
-@item
-If there are highlights in the buffer from the creation of a sparse
-tree, or from clock display, remove these highlights.
-@item
-If the cursor is in one of the special @code{#+KEYWORD} lines, this
-triggers scanning the buffer for these lines and updating the
-information.
-@item
-If the cursor is inside a table, realign the table. This command
-works even if the automatic table editor has been turned off.
-@item
-If the cursor is on a @code{#+TBLFM} line, re-apply the formulas to
-the entire table.
-@item
-If the current buffer is a capture buffer, close the note and file it.
-With a prefix argument, file it, without further interaction, to the
-default location.
-@item
-If the cursor is on a @code{<<<target>>>}, update radio targets and
-corresponding links in this buffer.
-@item
-If the cursor is in a property line or at the start or end of a property
-drawer, offer property commands.
-@item
-If the cursor is at a footnote reference, go to the corresponding
-definition, and vice versa.
-@item
-If the cursor is on a statistics cookie, update it.
-@item
-If the cursor is in a plain list item with a checkbox, toggle the status
-of the checkbox.
-@item
-If the cursor is on a numbered item in a plain list, renumber the
-ordered list.
-@item
-If the cursor is on the @code{#+BEGIN} line of a dynamic block, the
-block is updated.
-@end itemize
-
-@node Clean view, TTY keys, The very busy C-c C-c key, Miscellaneous
-@section A cleaner outline view
-@cindex hiding leading stars
-@cindex dynamic indentation
-@cindex odd-levels-only outlines
-@cindex clean outline view
-
-Some people find it noisy and distracting that the Org headlines start with a
-potentially large number of stars, and that text below the headlines is not
-indented. While this is no problem when writing a @emph{book-like} document
-where the outline headings are really section headings, in a more
-@emph{list-oriented} outline, indented structure is a lot cleaner:
-
-@example
-@group
-* Top level headline | * Top level headline
-** Second level | * Second level
-*** 3rd level | * 3rd level
-some text | some text
-*** 3rd level | * 3rd level
-more text | more text
-* Another top level headline | * Another top level headline
-@end group
-@end example
-
-@noindent
-
-If you are using at least Emacs 23.2@footnote{Emacs 23.1 can actually crash
-with @code{org-indent-mode}} and version 6.29 of Org, this kind of view can
-be achieved dynamically at display time using @code{org-indent-mode}. In
-this minor mode, all lines are prefixed for display with the necessary amount
-of space@footnote{@code{org-indent-mode} also sets the @code{wrap-prefix}
-property, such that @code{visual-line-mode} (or purely setting
-@code{word-wrap}) wraps long lines (including headlines) correctly indented.
-}. Also headlines are prefixed with additional stars, so that the amount of
-indentation shifts by two@footnote{See the variable
-@code{org-indent-indentation-per-level}.} spaces per level. All headline
-stars but the last one are made invisible using the @code{org-hide}
-face@footnote{Turning on @code{org-indent-mode} sets
-@code{org-hide-leading-stars} to @code{t} and @code{org-adapt-indentation} to
-@code{nil}.} - see below under @samp{2.} for more information on how this
-works. You can turn on @code{org-indent-mode} for all files by customizing
-the variable @code{org-startup-indented}, or you can turn it on for
-individual files using
-
-@example
-#+STARTUP: indent
-@end example
-
-If you want a similar effect in an earlier version of Emacs and/or Org, or if
-you want the indentation to be hard space characters so that the plain text
-file looks as similar as possible to the Emacs display, Org supports you in
-the following way:
-
-@enumerate
-@item
-@emph{Indentation of text below headlines}@*
-You may indent text below each headline to make the left boundary line up
-with the headline, like
-
-@example
-*** 3rd level
- more text, now indented
-@end example
-
-@vindex org-adapt-indentation
-Org supports this with paragraph filling, line wrapping, and structure
-editing@footnote{See also the variable @code{org-adapt-indentation}.},
-preserving or adapting the indentation as appropriate.
-
-@item
-@vindex org-hide-leading-stars
-@emph{Hiding leading stars}@* You can modify the display in such a way that
-all leading stars become invisible. To do this in a global way, configure
-the variable @code{org-hide-leading-stars} or change this on a per-file basis
-with
-
-@example
-#+STARTUP: hidestars
-#+STARTUP: showstars
-@end example
-
-With hidden stars, the tree becomes:
-
-@example
-@group
-* Top level headline
- * Second level
- * 3rd level
- ...
-@end group
-@end example
-
-@noindent
-@vindex org-hide @r{(face)}
-The leading stars are not truly replaced by whitespace, they are only
-fontified with the face @code{org-hide} that uses the background color as
-font color. If you are not using either white or black background, you may
-have to customize this face to get the wanted effect. Another possibility is
-to set this font such that the extra stars are @i{almost} invisible, for
-example using the color @code{grey90} on a white background.
-
-@item
-@vindex org-odd-levels-only
-Things become cleaner still if you skip all the even levels and use only odd
-levels 1, 3, 5..., effectively adding two stars to go from one outline level
-to the next@footnote{When you need to specify a level for a property search
-or refile targets, @samp{LEVEL=2} will correspond to 3 stars, etc@.}. In this
-way we get the outline view shown at the beginning of this section. In order
-to make the structure editing and export commands handle this convention
-correctly, configure the variable @code{org-odd-levels-only}, or set this on
-a per-file basis with one of the following lines:
-
-@example
-#+STARTUP: odd
-#+STARTUP: oddeven
-@end example
-
-You can convert an Org file from single-star-per-level to the
-double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels
-RET} in that file. The reverse operation is @kbd{M-x
-org-convert-to-oddeven-levels}.
-@end enumerate
-
-@node TTY keys, Interaction, Clean view, Miscellaneous
-@section Using Org on a tty
-@cindex tty key bindings
-
-Because Org contains a large number of commands, by default many of
-Org's core commands are bound to keys that are generally not
-accessible on a tty, such as the cursor keys (@key{left}, @key{right},
-@key{up}, @key{down}), @key{TAB} and @key{RET}, in particular when used
-together with modifiers like @key{Meta} and/or @key{Shift}. To access
-these commands on a tty when special keys are unavailable, the following
-alternative bindings can be used. The tty bindings below will likely be
-more cumbersome; you may find for some of the bindings below that a
-customized workaround suits you better. For example, changing a timestamp
-is really only fun with @kbd{S-@key{cursor}} keys, whereas on a
-tty you would rather use @kbd{C-c .} to re-insert the timestamp.
-
-@multitable @columnfractions 0.15 0.2 0.1 0.2
-@item @b{Default} @tab @b{Alternative 1} @tab @b{Speed key} @tab @b{Alternative 2}
-@item @kbd{S-@key{TAB}} @tab @kbd{C-u @key{TAB}} @tab @kbd{C} @tab
-@item @kbd{M-@key{left}} @tab @kbd{C-c C-x l} @tab @kbd{l} @tab @kbd{@key{Esc} @key{left}}
-@item @kbd{M-S-@key{left}} @tab @kbd{C-c C-x L} @tab @kbd{L} @tab
-@item @kbd{M-@key{right}} @tab @kbd{C-c C-x r} @tab @kbd{r} @tab @kbd{@key{Esc} @key{right}}
-@item @kbd{M-S-@key{right}} @tab @kbd{C-c C-x R} @tab @kbd{R} @tab
-@item @kbd{M-@key{up}} @tab @kbd{C-c C-x u} @tab @kbd{ } @tab @kbd{@key{Esc} @key{up}}
-@item @kbd{M-S-@key{up}} @tab @kbd{C-c C-x U} @tab @kbd{U} @tab
-@item @kbd{M-@key{down}} @tab @kbd{C-c C-x d} @tab @kbd{ } @tab @kbd{@key{Esc} @key{down}}
-@item @kbd{M-S-@key{down}} @tab @kbd{C-c C-x D} @tab @kbd{D} @tab
-@item @kbd{S-@key{RET}} @tab @kbd{C-c C-x c} @tab @kbd{ } @tab
-@item @kbd{M-@key{RET}} @tab @kbd{C-c C-x m} @tab @kbd{ } @tab @kbd{@key{Esc} @key{RET}}
-@item @kbd{M-S-@key{RET}} @tab @kbd{C-c C-x M} @tab @kbd{ } @tab
-@item @kbd{S-@key{left}} @tab @kbd{C-c @key{left}} @tab @kbd{ } @tab
-@item @kbd{S-@key{right}} @tab @kbd{C-c @key{right}} @tab @kbd{ } @tab
-@item @kbd{S-@key{up}} @tab @kbd{C-c @key{up}} @tab @kbd{ } @tab
-@item @kbd{S-@key{down}} @tab @kbd{C-c @key{down}} @tab @kbd{ } @tab
-@item @kbd{C-S-@key{left}} @tab @kbd{C-c C-x @key{left}} @tab @kbd{ } @tab
-@item @kbd{C-S-@key{right}} @tab @kbd{C-c C-x @key{right}} @tab @kbd{ } @tab
-@end multitable
-
-
-@node Interaction, , TTY keys, Miscellaneous
-@section Interaction with other packages
-@cindex packages, interaction with other
-Org lives in the world of GNU Emacs and interacts in various ways
-with other code out there.
-
-@menu
-* Cooperation:: Packages Org cooperates with
-* Conflicts:: Packages that lead to conflicts
-@end menu
-
-@node Cooperation, Conflicts, Interaction, Interaction
-@subsection Packages that Org cooperates with
-
-@table @asis
-@cindex @file{calc.el}
-@cindex Gillespie, Dave
-@item @file{calc.el} by Dave Gillespie
-Org uses the Calc package for implementing spreadsheet
-functionality in its tables (@pxref{The spreadsheet}). Org
-checks for the availability of Calc by looking for the function
-@code{calc-eval} which will have been autoloaded during setup if Calc has
-been installed properly. As of Emacs 22, Calc is part of the Emacs
-distribution. Another possibility for interaction between the two
-packages is using Calc for embedded calculations. @xref{Embedded Mode,
-, Embedded Mode, Calc, GNU Emacs Calc Manual}.
-@item @file{constants.el} by Carsten Dominik
-@cindex @file{constants.el}
-@cindex Dominik, Carsten
-@vindex org-table-formula-constants
-In a table formula (@pxref{The spreadsheet}), it is possible to use
-names for natural constants or units. Instead of defining your own
-constants in the variable @code{org-table-formula-constants}, install
-the @file{constants} package which defines a large number of constants
-and units, and lets you use unit prefixes like @samp{M} for
-@samp{Mega}, etc@. You will need version 2.0 of this package, available
-at @url{http://www.astro.uva.nl/~dominik/Tools}. Org checks for
-the function @code{constants-get}, which has to be autoloaded in your
-setup. See the installation instructions in the file
-@file{constants.el}.
-@item @file{cdlatex.el} by Carsten Dominik
-@cindex @file{cdlatex.el}
-@cindex Dominik, Carsten
-Org-mode can make use of the CDLa@TeX{} package to efficiently enter
-@LaTeX{} fragments into Org files. See @ref{CDLaTeX mode}.
-@item @file{imenu.el} by Ake Stenhoff and Lars Lindberg
-@cindex @file{imenu.el}
-Imenu allows menu access to an index of items in a file. Org-mode
-supports Imenu---all you need to do to get the index is the following:
-@lisp
-(add-hook 'org-mode-hook
- (lambda () (imenu-add-to-menubar "Imenu")))
-@end lisp
-@vindex org-imenu-depth
-By default the index is two levels deep---you can modify the depth using
-the option @code{org-imenu-depth}.
-@item @file{remember.el} by John Wiegley
-@cindex @file{remember.el}
-@cindex Wiegley, John
-Org used to use this package for capture, but no longer does.
-@item @file{speedbar.el} by Eric M. Ludlam
-@cindex @file{speedbar.el}
-@cindex Ludlam, Eric M.
-Speedbar is a package that creates a special frame displaying files and
-index items in files. Org-mode supports Speedbar and allows you to
-drill into Org files directly from the Speedbar. It also allows you to
-restrict the scope of agenda commands to a file or a subtree by using
-the command @kbd{<} in the Speedbar frame.
-@cindex @file{table.el}
-@item @file{table.el} by Takaaki Ota
-@kindex C-c C-c
-@cindex table editor, @file{table.el}
-@cindex @file{table.el}
-@cindex Ota, Takaaki
-
-Complex ASCII tables with automatic line wrapping, column- and row-spanning,
-and alignment can be created using the Emacs table package by Takaaki Ota
-(@uref{http://sourceforge.net/projects/table}, and also part of Emacs 22).
-Org-mode will recognize these tables and export them properly. Because of
-interference with other Org-mode functionality, you unfortunately cannot edit
-these tables directly in the buffer. Instead, you need to use the command
-@kbd{C-c '} to edit them, similar to source code snippets.
-
-@table @kbd
-@orgcmd{C-c ',org-edit-special}
-Edit a @file{table.el} table. Works when the cursor is in a table.el table.
-@c
-@orgcmd{C-c ~,org-table-create-with-table.el}
-Insert a @file{table.el} table. If there is already a table at point, this
-command converts it between the @file{table.el} format and the Org-mode
-format. See the documentation string of the command
-@code{org-convert-table} for the restrictions under which this is
-possible.
-@end table
-@file{table.el} is part of Emacs since Emacs 22.
-@item @file{footnote.el} by Steven L. Baur
-@cindex @file{footnote.el}
-@cindex Baur, Steven L.
-Org-mode recognizes numerical footnotes as provided by this package.
-However, Org-mode also has its own footnote support (@pxref{Footnotes}),
-which makes using @file{footnote.el} unnecessary.
-@end table
-
-@node Conflicts, , Cooperation, Interaction
-@subsection Packages that lead to conflicts with Org-mode
-
-@table @asis
-
-@cindex @code{shift-selection-mode}
-@vindex org-support-shift-select
-In Emacs 23, @code{shift-selection-mode} is on by default, meaning that
-cursor motions combined with the shift key should start or enlarge regions.
-This conflicts with the use of @kbd{S-@key{cursor}} commands in Org to change
-timestamps, TODO keywords, priorities, and item bullet types if the cursor is
-at such a location. By default, @kbd{S-@key{cursor}} commands outside
-special contexts don't do anything, but you can customize the variable
-@code{org-support-shift-select}. Org-mode then tries to accommodate shift
-selection by (i) using it outside of the special contexts where special
-commands apply, and by (ii) extending an existing active region even if the
-cursor moves across a special context.
-
-@item @file{CUA.el} by Kim. F. Storm
-@cindex @file{CUA.el}
-@cindex Storm, Kim. F.
-@vindex org-replace-disputed-keys
-Key bindings in Org conflict with the @kbd{S-<cursor>} keys used by CUA mode
-(as well as @code{pc-select-mode} and @code{s-region-mode}) to select and extend the
-region. In fact, Emacs 23 has this built-in in the form of
-@code{shift-selection-mode}, see previous paragraph. If you are using Emacs
-23, you probably don't want to use another package for this purpose. However,
-if you prefer to leave these keys to a different package while working in
-Org-mode, configure the variable @code{org-replace-disputed-keys}. When set,
-Org will move the following key bindings in Org files, and in the agenda
-buffer (but not during date selection).
-
-@example
-S-UP -> M-p S-DOWN -> M-n
-S-LEFT -> M-- S-RIGHT -> M-+
-C-S-LEFT -> M-S-- C-S-RIGHT -> M-S-+
-@end example
-
-@vindex org-disputed-keys
-Yes, these are unfortunately more difficult to remember. If you want
-to have other replacement keys, look at the variable
-@code{org-disputed-keys}.
-
-@item @file{yasnippet.el}
-@cindex @file{yasnippet.el}
-The way Org-mode binds the TAB key (binding to @code{[tab]} instead of
-@code{"\t"}) overrules YASnippet's access to this key. The following code
-fixed this problem:
-
-@lisp
-(add-hook 'org-mode-hook
- (lambda ()
- (org-set-local 'yas/trigger-key [tab])
- (define-key yas/keymap [tab] 'yas/next-field-group)))
-@end lisp
-
-@item @file{windmove.el} by Hovav Shacham
-@cindex @file{windmove.el}
-This package also uses the @kbd{S-<cursor>} keys, so everything written
-in the paragraph above about CUA mode also applies here. If you want make
-the windmove function active in locations where Org-mode does not have
-special functionality on @kbd{S-@key{cursor}}, add this to your
-configuration:
-
-@lisp
-;; Make windmove work in org-mode:
-(add-hook 'org-shiftup-final-hook 'windmove-up)
-(add-hook 'org-shiftleft-final-hook 'windmove-left)
-(add-hook 'org-shiftdown-final-hook 'windmove-down)
-(add-hook 'org-shiftright-final-hook 'windmove-right)
-@end lisp
-
-@item @file{viper.el} by Michael Kifer
-@cindex @file{viper.el}
-@kindex C-c /
-Viper uses @kbd{C-c /} and therefore makes this key not access the
-corresponding Org-mode command @code{org-sparse-tree}. You need to find
-another key for this command, or override the key in
-@code{viper-vi-global-user-map} with
-
-@lisp
-(define-key viper-vi-global-user-map "C-c /" 'org-sparse-tree)
-@end lisp
-
-@end table
-
-
-@node Hacking, MobileOrg, Miscellaneous, Top
-@appendix Hacking
-@cindex hacking
-
-This appendix covers some aspects where users can extend the functionality of
-Org.
-
-@menu
-* Hooks:: Who to reach into Org's internals
-* Add-on packages:: Available extensions
-* Adding hyperlink types:: New custom link types
-* Context-sensitive commands:: How to add functionality to such commands
-* Tables in arbitrary syntax:: Orgtbl for @LaTeX{} and other programs
-* Dynamic blocks:: Automatically filled blocks
-* Special agenda views:: Customized views
-* Extracting agenda information:: Postprocessing of agenda information
-* Using the property API:: Writing programs that use entry properties
-* Using the mapping API:: Mapping over all or selected entries
-@end menu
-
-@node Hooks, Add-on packages, Hacking, Hacking
-@section Hooks
-@cindex hooks
-
-Org has a large number of hook variables that can be used to add
-functionality. This appendix about hacking is going to illustrate the
-use of some of them. A complete list of all hooks with documentation is
-maintained by the Worg project and can be found at
-@uref{http://orgmode.org/worg/org-configs/org-hooks.php}.
-
-@node Add-on packages, Adding hyperlink types, Hooks, Hacking
-@section Add-on packages
-@cindex add-on packages
-
-A large number of add-on packages have been written by various authors.
-These packages are not part of Emacs, but they are distributed as contributed
-packages with the separate release available at the Org-mode home page at
-@uref{http://orgmode.org}. The list of contributed packages, along with
-documentation about each package, is maintained by the Worg project at
-@uref{http://orgmode.org/worg/org-contrib/}.
-
-
-
-@node Adding hyperlink types, Context-sensitive commands, Add-on packages, Hacking
-@section Adding hyperlink types
-@cindex hyperlinks, adding new types
-
-Org has a large number of hyperlink types built-in
-(@pxref{Hyperlinks}). If you would like to add new link types, Org
-provides an interface for doing so. Let's look at an example file,
-@file{org-man.el}, that will add support for creating links like
-@samp{[[man:printf][The printf manpage]]} to show Unix manual pages inside
-Emacs:
-
-@lisp
-;;; org-man.el - Support for links to manpages in Org
-
-(require 'org)
-
-(org-add-link-type "man" 'org-man-open)
-(add-hook 'org-store-link-functions 'org-man-store-link)
-
-(defcustom org-man-command 'man
- "The Emacs command to be used to display a man page."
- :group 'org-link
- :type '(choice (const man) (const woman)))
-
-(defun org-man-open (path)
- "Visit the manpage on PATH.
-PATH should be a topic that can be thrown at the man command."
- (funcall org-man-command path))
-
-(defun org-man-store-link ()
- "Store a link to a manpage."
- (when (memq major-mode '(Man-mode woman-mode))
- ;; This is a man page, we do make this link
- (let* ((page (org-man-get-page-name))
- (link (concat "man:" page))
- (description (format "Manpage for %s" page)))
- (org-store-link-props
- :type "man"
- :link link
- :description description))))
-
-(defun org-man-get-page-name ()
- "Extract the page name from the buffer name."
- ;; This works for both `Man-mode' and `woman-mode'.
- (if (string-match " \\(\\S-+\\)\\*" (buffer-name))
- (match-string 1 (buffer-name))
- (error "Cannot create link to this man page")))
-
-(provide 'org-man)
-
-;;; org-man.el ends here
-@end lisp
-
-@noindent
-You would activate this new link type in @file{.emacs} with
-
-@lisp
-(require 'org-man)
-@end lisp
-
-@noindent
-Let's go through the file and see what it does.
-@enumerate
-@item
-It does @code{(require 'org)} to make sure that @file{org.el} has been
-loaded.
-@item
-The next line calls @code{org-add-link-type} to define a new link type
-with prefix @samp{man}. The call also contains the name of a function
-that will be called to follow such a link.
-@item
-@vindex org-store-link-functions
-The next line adds a function to @code{org-store-link-functions}, in
-order to allow the command @kbd{C-c l} to record a useful link in a
-buffer displaying a man page.
-@end enumerate
-
-The rest of the file defines the necessary variables and functions.
-First there is a customization variable that determines which Emacs
-command should be used to display man pages. There are two options,
-@code{man} and @code{woman}. Then the function to follow a link is
-defined. It gets the link path as an argument---in this case the link
-path is just a topic for the manual command. The function calls the
-value of @code{org-man-command} to display the man page.
-
-Finally the function @code{org-man-store-link} is defined. When you try
-to store a link with @kbd{C-c l}, this function will be called to
-try to make a link. The function must first decide if it is supposed to
-create the link for this buffer type; we do this by checking the value
-of the variable @code{major-mode}. If not, the function must exit and
-return the value @code{nil}. If yes, the link is created by getting the
-manual topic from the buffer name and prefixing it with the string
-@samp{man:}. Then it must call the command @code{org-store-link-props}
-and set the @code{:type} and @code{:link} properties. Optionally you
-can also set the @code{:description} property to provide a default for
-the link description when the link is later inserted into an Org
-buffer with @kbd{C-c C-l}.
-
-When it makes sense for your new link type, you may also define a function
-@code{org-PREFIX-complete-link} that implements special (e.g. completion)
-support for inserting such a link with @kbd{C-c C-l}. Such a function should
-not accept any arguments, and return the full link with prefix.
-
-@node Context-sensitive commands, Tables in arbitrary syntax, Adding hyperlink types, Hacking
-@section Context-sensitive commands
-@cindex context-sensitive commands, hooks
-@cindex add-ons, context-sensitive commands
-@vindex org-ctrl-c-ctrl-c-hook
-
-Org has several commands that act differently depending on context. The most
-important example it the @kbd{C-c C-c} (@pxref{The very busy C-c C-c key}).
-Also the @kbd{M-cursor} and @kbd{M-S-cursor} keys have this property.
-
-Add-ons can tap into this functionality by providing a function that detects
-special context for that add-on and executes functionality appropriate for
-the context. Here is an example from Dan Davison's @file{org-R.el} which
-allows you to evaluate commands based on the @file{R} programming language
-@footnote{@file{org-R.el} has been replaced by the org-mode functionality
-described in @ref{Working With Source Code} and is now obsolete.}. For this
-package, special contexts are lines that start with @code{#+R:} or
-@code{#+RR:}.
-
-@lisp
-(defun org-R-apply-maybe ()
- "Detect if this is context for org-R and execute R commands."
- (if (save-excursion
- (beginning-of-line 1)
- (looking-at "#\\+RR?:"))
- (progn (call-interactively 'org-R-apply)
- t) ;; to signal that we took action
- nil)) ;; to signal that we did not
-
-(add-hook 'org-ctrl-c-ctrl-c-hook 'org-R-apply-maybe)
-@end lisp
-
-The function first checks if the cursor is in such a line. If that is the
-case, @code{org-R-apply} is called and the function returns @code{t} to
-signal that action was taken, and @kbd{C-c C-c} will stop looking for other
-contexts. If the function finds it should do nothing locally, it returns @code{nil} so that other, similar functions can have a try.
-
-
-@node Tables in arbitrary syntax, Dynamic blocks, Context-sensitive commands, Hacking
-@section Tables and lists in arbitrary syntax
-@cindex tables, in other modes
-@cindex lists, in other modes
-@cindex Orgtbl mode
-
-Since Orgtbl mode can be used as a minor mode in arbitrary buffers, a
-frequent feature request has been to make it work with native tables in
-specific languages, for example @LaTeX{}. However, this is extremely
-hard to do in a general way, would lead to a customization nightmare,
-and would take away much of the simplicity of the Orgtbl-mode table
-editor.
-
-This appendix describes a different approach. We keep the Orgtbl mode
-table in its native format (the @i{source table}), and use a custom
-function to @i{translate} the table to the correct syntax, and to
-@i{install} it in the right location (the @i{target table}). This puts
-the burden of writing conversion functions on the user, but it allows
-for a very flexible system.
-
-Bastien added the ability to do the same with lists, in Orgstruct mode. You
-can use Org's facilities to edit and structure lists by turning
-@code{orgstruct-mode} on, then locally exporting such lists in another format
-(HTML, @LaTeX{} or Texinfo.)
-
-
-@menu
-* Radio tables:: Sending and receiving radio tables
-* A LaTeX example:: Step by step, almost a tutorial
-* Translator functions:: Copy and modify
-* Radio lists:: Doing the same for lists
-@end menu
-
-@node Radio tables, A LaTeX example, Tables in arbitrary syntax, Tables in arbitrary syntax
-@subsection Radio tables
-@cindex radio tables
-
-To define the location of the target table, you first need to create two
-lines that are comments in the current mode, but contain magic words for
-Orgtbl mode to find. Orgtbl mode will insert the translated table
-between these lines, replacing whatever was there before. For example:
-
-@example
-/* BEGIN RECEIVE ORGTBL table_name */
-/* END RECEIVE ORGTBL table_name */
-@end example
-
-@noindent
-Just above the source table, we put a special line that tells
-Orgtbl mode how to translate this table and where to install it. For
-example:
-@cindex #+ORGTBL
-@example
-#+ORGTBL: SEND table_name translation_function arguments....
-@end example
-
-@noindent
-@code{table_name} is the reference name for the table that is also used
-in the receiver lines. @code{translation_function} is the Lisp function
-that does the translation. Furthermore, the line can contain a list of
-arguments (alternating key and value) at the end. The arguments will be
-passed as a property list to the translation function for
-interpretation. A few standard parameters are already recognized and
-acted upon before the translation function is called:
-
-@table @code
-@item :skip N
-Skip the first N lines of the table. Hlines do count as separate lines for
-this parameter!
-
-@item :skipcols (n1 n2 ...)
-List of columns that should be skipped. If the table has a column with
-calculation marks, that column is automatically discarded as well.
-Please note that the translator function sees the table @emph{after} the
-removal of these columns, the function never knows that there have been
-additional columns.
-@end table
-
-@noindent
-The one problem remaining is how to keep the source table in the buffer
-without disturbing the normal workings of the file, for example during
-compilation of a C file or processing of a @LaTeX{} file. There are a
-number of different solutions:
-
-@itemize @bullet
-@item
-The table could be placed in a block comment if that is supported by the
-language. For example, in C mode you could wrap the table between
-@samp{/*} and @samp{*/} lines.
-@item
-Sometimes it is possible to put the table after some kind of @i{END}
-statement, for example @samp{\bye} in @TeX{} and @samp{\end@{document@}}
-in @LaTeX{}.
-@item
-You can just comment the table line-by-line whenever you want to process
-the file, and uncomment it whenever you need to edit the table. This
-only sounds tedious---the command @kbd{M-x orgtbl-toggle-comment}
-makes this comment-toggling very easy, in particular if you bind it to a
-key.
-@end itemize
-
-@node A LaTeX example, Translator functions, Radio tables, Tables in arbitrary syntax
-@subsection A @LaTeX{} example of radio tables
-@cindex @LaTeX{}, and Orgtbl mode
-
-The best way to wrap the source table in @LaTeX{} is to use the
-@code{comment} environment provided by @file{comment.sty}. It has to be
-activated by placing @code{\usepackage@{comment@}} into the document
-header. Orgtbl mode can insert a radio table skeleton@footnote{By
-default this works only for @LaTeX{}, HTML, and Texinfo. Configure the
-variable @code{orgtbl-radio-tables} to install templates for other
-modes.} with the command @kbd{M-x orgtbl-insert-radio-table}. You will
-be prompted for a table name, let's say we use @samp{salesfigures}. You
-will then get the following template:
-
-@cindex #+ORGTBL, SEND
-@example
-% BEGIN RECEIVE ORGTBL salesfigures
-% END RECEIVE ORGTBL salesfigures
-\begin@{comment@}
-#+ORGTBL: SEND salesfigures orgtbl-to-latex
-| | |
-\end@{comment@}
-@end example
-
-@noindent
-@vindex @LaTeX{}-verbatim-environments
-The @code{#+ORGTBL: SEND} line tells Orgtbl mode to use the function
-@code{orgtbl-to-latex} to convert the table into @LaTeX{} and to put it
-into the receiver location with name @code{salesfigures}. You may now
-fill in the table---feel free to use the spreadsheet features@footnote{If
-the @samp{#+TBLFM} line contains an odd number of dollar characters,
-this may cause problems with font-lock in @LaTeX{} mode. As shown in the
-example you can fix this by adding an extra line inside the
-@code{comment} environment that is used to balance the dollar
-expressions. If you are using AUC@TeX{} with the font-latex library, a
-much better solution is to add the @code{comment} environment to the
-variable @code{LaTeX-verbatim-environments}.}:
-
-@example
-% BEGIN RECEIVE ORGTBL salesfigures
-% END RECEIVE ORGTBL salesfigures
-\begin@{comment@}
-#+ORGTBL: SEND salesfigures orgtbl-to-latex
-| Month | Days | Nr sold | per day |
-|-------+------+---------+---------|
-| Jan | 23 | 55 | 2.4 |
-| Feb | 21 | 16 | 0.8 |
-| March | 22 | 278 | 12.6 |
-#+TBLFM: $4=$3/$2;%.1f
-% $ (optional extra dollar to keep font-lock happy, see footnote)
-\end@{comment@}
-@end example
-
-@noindent
-When you are done, press @kbd{C-c C-c} in the table to get the converted
-table inserted between the two marker lines.
-
-Now let's assume you want to make the table header by hand, because you
-want to control how columns are aligned, etc@. In this case we make sure
-that the table translator skips the first 2 lines of the source
-table, and tell the command to work as a @i{splice}, i.e. to not produce
-header and footer commands of the target table:
-
-@example
-\begin@{tabular@}@{lrrr@}
-Month & \multicolumn@{1@}@{c@}@{Days@} & Nr.\ sold & per day\\
-% BEGIN RECEIVE ORGTBL salesfigures
-% END RECEIVE ORGTBL salesfigures
-\end@{tabular@}
-%
-\begin@{comment@}
-#+ORGTBL: SEND salesfigures orgtbl-to-latex :splice t :skip 2
-| Month | Days | Nr sold | per day |
-|-------+------+---------+---------|
-| Jan | 23 | 55 | 2.4 |
-| Feb | 21 | 16 | 0.8 |
-| March | 22 | 278 | 12.6 |
-#+TBLFM: $4=$3/$2;%.1f
-\end@{comment@}
-@end example
-
-The @LaTeX{} translator function @code{orgtbl-to-latex} is already part of
-Orgtbl mode. It uses a @code{tabular} environment to typeset the table
-and marks horizontal lines with @code{\hline}. Furthermore, it
-interprets the following parameters (see also @pxref{Translator functions}):
-
-@table @code
-@item :splice nil/t
-When set to t, return only table body lines, don't wrap them into a
-tabular environment. Default is nil.
-
-@item :fmt fmt
-A format to be used to wrap each field, it should contain @code{%s} for the
-original field value. For example, to wrap each field value in dollars,
-you could use @code{:fmt "$%s$"}. This may also be a property list with
-column numbers and formats. for example @code{:fmt (2 "$%s$" 4 "%s\\%%")}.
-A function of one argument can be used in place of the strings; the
-function must return a formatted string.
-
-@item :efmt efmt
-Use this format to print numbers with exponentials. The format should
-have @code{%s} twice for inserting mantissa and exponent, for example
-@code{"%s\\times10^@{%s@}"}. The default is @code{"%s\\,(%s)"}. This
-may also be a property list with column numbers and formats, for example
-@code{:efmt (2 "$%s\\times10^@{%s@}$" 4 "$%s\\cdot10^@{%s@}$")}. After
-@code{efmt} has been applied to a value, @code{fmt} will also be
-applied. Similar to @code{fmt}, functions of two arguments can be
-supplied instead of strings.
-@end table
-
-@node Translator functions, Radio lists, A LaTeX example, Tables in arbitrary syntax
-@subsection Translator functions
-@cindex HTML, and Orgtbl mode
-@cindex translator function
-
-Orgtbl mode has several translator functions built-in: @code{orgtbl-to-csv}
-(comma-separated values), @code{orgtbl-to-tsv} (TAB-separated values)
-@code{orgtbl-to-latex}, @code{orgtbl-to-html}, and @code{orgtbl-to-texinfo}.
-Except for @code{orgtbl-to-html}@footnote{The HTML translator uses the same
-code that produces tables during HTML export.}, these all use a generic
-translator, @code{orgtbl-to-generic}. For example, @code{orgtbl-to-latex}
-itself is a very short function that computes the column definitions for the
-@code{tabular} environment, defines a few field and line separators and then
-hands processing over to the generic translator. Here is the entire code:
-
-@lisp
-@group
-(defun orgtbl-to-latex (table params)
- "Convert the Orgtbl mode TABLE to LaTeX."
- (let* ((alignment (mapconcat (lambda (x) (if x "r" "l"))
- org-table-last-alignment ""))
- (params2
- (list
- :tstart (concat "\\begin@{tabular@}@{" alignment "@}")
- :tend "\\end@{tabular@}"
- :lstart "" :lend " \\\\" :sep " & "
- :efmt "%s\\,(%s)" :hline "\\hline")))
- (orgtbl-to-generic table (org-combine-plists params2 params))))
-@end group
-@end lisp
-
-As you can see, the properties passed into the function (variable
-@var{PARAMS}) are combined with the ones newly defined in the function
-(variable @var{PARAMS2}). The ones passed into the function (i.e. the
-ones set by the @samp{ORGTBL SEND} line) take precedence. So if you
-would like to use the @LaTeX{} translator, but wanted the line endings to
-be @samp{\\[2mm]} instead of the default @samp{\\}, you could just
-overrule the default with
-
-@example
-#+ORGTBL: SEND test orgtbl-to-latex :lend " \\\\[2mm]"
-@end example
-
-For a new language, you can either write your own converter function in
-analogy with the @LaTeX{} translator, or you can use the generic function
-directly. For example, if you have a language where a table is started
-with @samp{!BTBL!}, ended with @samp{!ETBL!}, and where table lines are
-started with @samp{!BL!}, ended with @samp{!EL!}, and where the field
-separator is a TAB, you could call the generic translator like this (on
-a single line!):
-
-@example
-#+ORGTBL: SEND test orgtbl-to-generic :tstart "!BTBL!" :tend "!ETBL!"
- :lstart "!BL! " :lend " !EL!" :sep "\t"
-@end example
-
-@noindent
-Please check the documentation string of the function
-@code{orgtbl-to-generic} for a full list of parameters understood by
-that function, and remember that you can pass each of them into
-@code{orgtbl-to-latex}, @code{orgtbl-to-texinfo}, and any other function
-using the generic function.
-
-Of course you can also write a completely new function doing complicated
-things the generic translator cannot do. A translator function takes
-two arguments. The first argument is the table, a list of lines, each
-line either the symbol @code{hline} or a list of fields. The second
-argument is the property list containing all parameters specified in the
-@samp{#+ORGTBL: SEND} line. The function must return a single string
-containing the formatted table. If you write a generally useful
-translator, please post it on @email{emacs-orgmode@@gnu.org} so that
-others can benefit from your work.
-
-@node Radio lists, , Translator functions, Tables in arbitrary syntax
-@subsection Radio lists
-@cindex radio lists
-@cindex org-list-insert-radio-list
-
-Sending and receiving radio lists works exactly the same way as sending and
-receiving radio tables (@pxref{Radio tables}). As for radio tables, you can
-insert radio list templates in HTML, @LaTeX{} and Texinfo modes by calling
-@code{org-list-insert-radio-list}.
-
-Here are the differences with radio tables:
-
-@itemize @minus
-@item
-Orgstruct mode must be active.
-@item
-Use the @code{ORGLST} keyword instead of @code{ORGTBL}.
-@item
-The available translation functions for radio lists don't take
-parameters.
-@item
-@kbd{C-c C-c} will work when pressed on the first item of the list.
-@end itemize
-
-Here is a @LaTeX{} example. Let's say that you have this in your
-@LaTeX{} file:
-
-@cindex #+ORGLST
-@example
-% BEGIN RECEIVE ORGLST to-buy
-% END RECEIVE ORGLST to-buy
-\begin@{comment@}
-#+ORGLST: SEND to-buy org-list-to-latex
-- a new house
-- a new computer
- + a new keyboard
- + a new mouse
-- a new life
-\end@{comment@}
-@end example
-
-Pressing `C-c C-c' on @code{a new house} and will insert the converted
-@LaTeX{} list between the two marker lines.
-
-@node Dynamic blocks, Special agenda views, Tables in arbitrary syntax, Hacking
-@section Dynamic blocks
-@cindex dynamic blocks
-
-Org documents can contain @emph{dynamic blocks}. These are
-specially marked regions that are updated by some user-written function.
-A good example for such a block is the clock table inserted by the
-command @kbd{C-c C-x C-r} (@pxref{Clocking work time}).
-
-Dynamic blocks are enclosed by a BEGIN-END structure that assigns a name
-to the block and can also specify parameters for the function producing
-the content of the block.
-
-@cindex #+BEGIN:dynamic block
-@example
-#+BEGIN: myblock :parameter1 value1 :parameter2 value2 ...
-
-#+END:
-@end example
-
-Dynamic blocks are updated with the following commands
-
-@table @kbd
-@orgcmd{C-c C-x C-u,org-dblock-update}
-Update dynamic block at point.
-@orgkey{C-u C-c C-x C-u}
-Update all dynamic blocks in the current file.
-@end table
-
-Updating a dynamic block means to remove all the text between BEGIN and
-END, parse the BEGIN line for parameters and then call the specific
-writer function for this block to insert the new content. If you want
-to use the original content in the writer function, you can use the
-extra parameter @code{:content}.
-
-For a block with name @code{myblock}, the writer function is
-@code{org-dblock-write:myblock} with as only parameter a property list
-with the parameters given in the begin line. Here is a trivial example
-of a block that keeps track of when the block update function was last
-run:
-
-@example
-#+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
-
-#+END:
-@end example
-
-@noindent
-The corresponding block writer function could look like this:
-
-@lisp
-(defun org-dblock-write:block-update-time (params)
- (let ((fmt (or (plist-get params :format) "%d. %m. %Y")))
- (insert "Last block update at: "
- (format-time-string fmt (current-time)))))
-@end lisp
-
-If you want to make sure that all dynamic blocks are always up-to-date,
-you could add the function @code{org-update-all-dblocks} to a hook, for
-example @code{before-save-hook}. @code{org-update-all-dblocks} is
-written in a way such that it does nothing in buffers that are not in
-@code{org-mode}.
-
-@node Special agenda views, Extracting agenda information, Dynamic blocks, Hacking
-@section Special agenda views
-@cindex agenda views, user-defined
-
-Org provides a special hook that can be used to narrow down the selection
-made by these agenda views: @code{todo}, @code{alltodo}, @code{tags}, @code{tags-todo},
-@code{tags-tree}. You may specify a function that is used at each match to verify
-if the match should indeed be part of the agenda view, and if not, how
-much should be skipped.
-
-Let's say you want to produce a list of projects that contain a WAITING
-tag anywhere in the project tree. Let's further assume that you have
-marked all tree headings that define a project with the TODO keyword
-PROJECT. In this case you would run a TODO search for the keyword
-PROJECT, but skip the match unless there is a WAITING tag anywhere in
-the subtree belonging to the project line.
-
-To achieve this, you must write a function that searches the subtree for
-the tag. If the tag is found, the function must return @code{nil} to
-indicate that this match should not be skipped. If there is no such
-tag, return the location of the end of the subtree, to indicate that
-search should continue from there.
-
-@lisp
-(defun my-skip-unless-waiting ()
- "Skip trees that are not waiting"
- (let ((subtree-end (save-excursion (org-end-of-subtree t))))
- (if (re-search-forward ":waiting:" subtree-end t)
- nil ; tag found, do not skip
- subtree-end))) ; tag not found, continue after end of subtree
-@end lisp
-
-Now you may use this function in an agenda custom command, for example
-like this:
-
-@lisp
-(org-add-agenda-custom-command
- '("b" todo "PROJECT"
- ((org-agenda-skip-function 'my-skip-unless-waiting)
- (org-agenda-overriding-header "Projects waiting for something: "))))
-@end lisp
-
-@vindex org-agenda-overriding-header
-Note that this also binds @code{org-agenda-overriding-header} to get a
-meaningful header in the agenda view.
-
-@vindex org-odd-levels-only
-@vindex org-agenda-skip-function
-A general way to create custom searches is to base them on a search for
-entries with a certain level limit. If you want to study all entries with
-your custom search function, simply do a search for
-@samp{LEVEL>0}@footnote{Note that, when using @code{org-odd-levels-only}, a
-level number corresponds to order in the hierarchy, not to the number of
-stars.}, and then use @code{org-agenda-skip-function} to select the entries
-you really want to have.
-
-You may also put a Lisp form into @code{org-agenda-skip-function}. In
-particular, you may use the functions @code{org-agenda-skip-entry-if}
-and @code{org-agenda-skip-subtree-if} in this form, for example:
-
-@table @code
-@item '(org-agenda-skip-entry-if 'scheduled)
-Skip current entry if it has been scheduled.
-@item '(org-agenda-skip-entry-if 'notscheduled)
-Skip current entry if it has not been scheduled.
-@item '(org-agenda-skip-entry-if 'deadline)
-Skip current entry if it has a deadline.
-@item '(org-agenda-skip-entry-if 'scheduled 'deadline)
-Skip current entry if it has a deadline, or if it is scheduled.
-@item '(org-agenda-skip-entry-if 'todo '("TODO" "WAITING"))
-Skip current entry if the TODO keyword is TODO or WAITING.
-@item '(org-agenda-skip-entry-if 'todo 'done)
-Skip current entry if the TODO keyword marks a DONE state.
-@item '(org-agenda-skip-entry-if 'timestamp)
-Skip current entry if it has any timestamp, may also be deadline or scheduled.
-@item '(org-agenda-skip-entry 'regexp "regular expression")
-Skip current entry if the regular expression matches in the entry.
-@item '(org-agenda-skip-entry 'notregexp "regular expression")
-Skip current entry unless the regular expression matches.
-@item '(org-agenda-skip-subtree-if 'regexp "regular expression")
-Same as above, but check and skip the entire subtree.
-@end table
-
-Therefore we could also have written the search for WAITING projects
-like this, even without defining a special function:
-
-@lisp
-(org-add-agenda-custom-command
- '("b" todo "PROJECT"
- ((org-agenda-skip-function '(org-agenda-skip-subtree-if
- 'regexp ":waiting:"))
- (org-agenda-overriding-header "Projects waiting for something: "))))
-@end lisp
-
-@node Extracting agenda information, Using the property API, Special agenda views, Hacking
-@section Extracting agenda information
-@cindex agenda, pipe
-@cindex Scripts, for agenda processing
-
-@vindex org-agenda-custom-commands
-Org provides commands to access agenda information for the command
-line in Emacs batch mode. This extracted information can be sent
-directly to a printer, or it can be read by a program that does further
-processing of the data. The first of these commands is the function
-@code{org-batch-agenda}, that produces an agenda view and sends it as
-ASCII text to STDOUT. The command takes a single string as parameter.
-If the string has length 1, it is used as a key to one of the commands
-you have configured in @code{org-agenda-custom-commands}, basically any
-key you can use after @kbd{C-c a}. For example, to directly print the
-current TODO list, you could use
-
-@example
-emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr
-@end example
-
-If the parameter is a string with 2 or more characters, it is used as a
-tags/TODO match string. For example, to print your local shopping list
-(all items with the tag @samp{shop}, but excluding the tag
-@samp{NewYork}), you could use
-
-@example
-emacs -batch -l ~/.emacs \
- -eval '(org-batch-agenda "+shop-NewYork")' | lpr
-@end example
-
-@noindent
-You may also modify parameters on the fly like this:
-
-@example
-emacs -batch -l ~/.emacs \
- -eval '(org-batch-agenda "a" \
- org-agenda-span month \
- org-agenda-include-diary nil \
- org-agenda-files (quote ("~/org/project.org")))' \
- | lpr
-@end example
-
-@noindent
-which will produce a 30-day agenda, fully restricted to the Org file
-@file{~/org/projects.org}, not even including the diary.
-
-If you want to process the agenda data in more sophisticated ways, you
-can use the command @code{org-batch-agenda-csv} to get a comma-separated
-list of values for each agenda item. Each line in the output will
-contain a number of fields separated by commas. The fields in a line
-are:
-
-@example
-category @r{The category of the item}
-head @r{The headline, without TODO keyword, TAGS and PRIORITY}
-type @r{The type of the agenda entry, can be}
- todo @r{selected in TODO match}
- tagsmatch @r{selected in tags match}
- diary @r{imported from diary}
- deadline @r{a deadline}
- scheduled @r{scheduled}
- timestamp @r{appointment, selected by timestamp}
- closed @r{entry was closed on date}
- upcoming-deadline @r{warning about nearing deadline}
- past-scheduled @r{forwarded scheduled item}
- block @r{entry has date block including date}
-todo @r{The TODO keyword, if any}
-tags @r{All tags including inherited ones, separated by colons}
-date @r{The relevant date, like 2007-2-14}
-time @r{The time, like 15:00-16:50}
-extra @r{String with extra planning info}
-priority-l @r{The priority letter if any was given}
-priority-n @r{The computed numerical priority}
-@end example
-
-@noindent
-Time and date will only be given if a timestamp (or deadline/scheduled)
-led to the selection of the item.
-
-A CSV list like this is very easy to use in a post-processing script.
-For example, here is a Perl program that gets the TODO list from
-Emacs/Org and prints all the items, preceded by a checkbox:
-
-@example
-#!/usr/bin/perl
-
-# define the Emacs command to run
-$cmd = "emacs -batch -l ~/.emacs -eval '(org-batch-agenda-csv \"t\")'";
-
-# run it and capture the output
-$agenda = qx@{$cmd 2>/dev/null@};
-
-# loop over all lines
-foreach $line (split(/\n/,$agenda)) @{
- # get the individual values
- ($category,$head,$type,$todo,$tags,$date,$time,$extra,
- $priority_l,$priority_n) = split(/,/,$line);
- # process and print
- print "[ ] $head\n";
-@}
-@end example
-
-@node Using the property API, Using the mapping API, Extracting agenda information, Hacking
-@section Using the property API
-@cindex API, for properties
-@cindex properties, API
-
-Here is a description of the functions that can be used to work with
-properties.
-
-@defun org-entry-properties &optional pom which
-Get all properties of the entry at point-or-marker POM.@*
-This includes the TODO keyword, the tags, time strings for deadline,
-scheduled, and clocking, and any additional properties defined in the
-entry. The return value is an alist. Keys may occur multiple times
-if the property key was used several times.@*
-POM may also be nil, in which case the current entry is used.
-If WHICH is nil or `all', get all properties. If WHICH is
-`special' or `standard', only get that subclass.
-@end defun
-@vindex org-use-property-inheritance
-@defun org-entry-get pom property &optional inherit
-Get value of PROPERTY for entry at point-or-marker POM. By default,
-this only looks at properties defined locally in the entry. If INHERIT
-is non-nil and the entry does not have the property, then also check
-higher levels of the hierarchy. If INHERIT is the symbol
-@code{selective}, use inheritance if and only if the setting of
-@code{org-use-property-inheritance} selects PROPERTY for inheritance.
-@end defun
-
-@defun org-entry-delete pom property
-Delete the property PROPERTY from entry at point-or-marker POM.
-@end defun
-
-@defun org-entry-put pom property value
-Set PROPERTY to VALUE for entry at point-or-marker POM.
-@end defun
-
-@defun org-buffer-property-keys &optional include-specials
-Get all property keys in the current buffer.
-@end defun
-
-@defun org-insert-property-drawer
-Insert a property drawer at point.
-@end defun
-
-@defun org-entry-put-multivalued-property pom property &rest values
-Set PROPERTY at point-or-marker POM to VALUES. VALUES should be a list of
-strings. They will be concatenated, with spaces as separators.
-@end defun
-
-@defun org-entry-get-multivalued-property pom property
-Treat the value of the property PROPERTY as a whitespace-separated list of
-values and return the values as a list of strings.
-@end defun
-
-@defun org-entry-add-to-multivalued-property pom property value
-Treat the value of the property PROPERTY as a whitespace-separated list of
-values and make sure that VALUE is in this list.
-@end defun
-
-@defun org-entry-remove-from-multivalued-property pom property value
-Treat the value of the property PROPERTY as a whitespace-separated list of
-values and make sure that VALUE is @emph{not} in this list.
-@end defun
-
-@defun org-entry-member-in-multivalued-property pom property value
-Treat the value of the property PROPERTY as a whitespace-separated list of
-values and check if VALUE is in this list.
-@end defun
-
-@defopt org-property-allowed-value-functions
-Hook for functions supplying allowed values for a specific property.
-The functions must take a single argument, the name of the property, and
-return a flat list of allowed values. If @samp{:ETC} is one of
-the values, use the values as completion help, but allow also other values
-to be entered. The functions must return @code{nil} if they are not
-responsible for this property.
-@end defopt
-
-@node Using the mapping API, , Using the property API, Hacking
-@section Using the mapping API
-@cindex API, for mapping
-@cindex mapping entries, API
-
-Org has sophisticated mapping capabilities to find all entries satisfying
-certain criteria. Internally, this functionality is used to produce agenda
-views, but there is also an API that can be used to execute arbitrary
-functions for each or selected entries. The main entry point for this API
-is:
-
-@defun org-map-entries func &optional match scope &rest skip
-Call FUNC at each headline selected by MATCH in SCOPE.
-
-FUNC is a function or a Lisp form. The function will be called without
-arguments, with the cursor positioned at the beginning of the headline.
-The return values of all calls to the function will be collected and
-returned as a list.
-
-The call to FUNC will be wrapped into a save-excursion form, so FUNC
-does not need to preserve point. After evaluation, the cursor will be
-moved to the end of the line (presumably of the headline of the
-processed entry) and search continues from there. Under some
-circumstances, this may not produce the wanted results. For example,
-if you have removed (e.g. archived) the current (sub)tree it could
-mean that the next entry will be skipped entirely. In such cases, you
-can specify the position from where search should continue by making
-FUNC set the variable `org-map-continue-from' to the desired buffer
-position.
-
-MATCH is a tags/property/todo match as it is used in the agenda match view.
-Only headlines that are matched by this query will be considered during
-the iteration. When MATCH is nil or t, all headlines will be
-visited by the iteration.
-
-SCOPE determines the scope of this command. It can be any of:
-
-@example
-nil @r{the current buffer, respecting the restriction if any}
-tree @r{the subtree started with the entry at point}
-file @r{the current buffer, without restriction}
-file-with-archives
- @r{the current buffer, and any archives associated with it}
-agenda @r{all agenda files}
-agenda-with-archives
- @r{all agenda files with any archive files associated with them}
-(file1 file2 ...)
- @r{if this is a list, all files in the list will be scanned}
-@end example
-@noindent
-The remaining args are treated as settings for the skipping facilities of
-the scanner. The following items can be given here:
-
-@vindex org-agenda-skip-function
-@example
-archive @r{skip trees with the archive tag}
-comment @r{skip trees with the COMMENT keyword}
-function or Lisp form
- @r{will be used as value for @code{org-agenda-skip-function},}
- @r{so whenever the function returns t, FUNC}
- @r{will not be called for that entry and search will}
- @r{continue from the point where the function leaves it}
-@end example
-@end defun
-
-The function given to that mapping routine can really do anything you like.
-It can use the property API (@pxref{Using the property API}) to gather more
-information about the entry, or in order to change metadata in the entry.
-Here are a couple of functions that might be handy:
-
-@defun org-todo &optional arg
-Change the TODO state of the entry. See the docstring of the functions for
-the many possible values for the argument ARG.
-@end defun
-
-@defun org-priority &optional action
-Change the priority of the entry. See the docstring of this function for the
-possible values for ACTION.
-@end defun
-
-@defun org-toggle-tag tag &optional onoff
-Toggle the tag TAG in the current entry. Setting ONOFF to either @code{on}
-or @code{off} will not toggle tag, but ensure that it is either on or off.
-@end defun
-
-@defun org-promote
-Promote the current entry.
-@end defun
-
-@defun org-demote
-Demote the current entry.
-@end defun
-
-Here is a simple example that will turn all entries in the current file with
-a tag @code{TOMORROW} into TODO entries with the keyword @code{UPCOMING}.
-Entries in comment trees and in archive trees will be ignored.
-
-@lisp
-(org-map-entries
- '(org-todo "UPCOMING")
- "+TOMORROW" 'file 'archive 'comment)
-@end lisp
-
-The following example counts the number of entries with TODO keyword
-@code{WAITING}, in all agenda files.
-
-@lisp
-(length (org-map-entries t "/+WAITING" 'agenda))
-@end lisp
-
-@node MobileOrg, History and Acknowledgments, Hacking, Top
-@appendix MobileOrg
-@cindex iPhone
-@cindex MobileOrg
-
-@uref{http://mobileorg.ncogni.to/, MobileOrg} is an application for the
-@i{iPhone/iPod Touch} series of devices, developed by Richard Moreland.
-@i{MobileOrg} offers offline viewing and capture support for an Org-mode
-system rooted on a ``real'' computer. It does also allow you to record
-changes to existing entries. Android users should check out
-@uref{http://wiki.github.com/matburt/mobileorg-android/, MobileOrg Android}
-by Matt Jones.
-
-This appendix describes the support Org has for creating agenda views in a
-format that can be displayed by @i{MobileOrg}, and for integrating notes
-captured and changes made by @i{MobileOrg} into the main system.
-
-For changing tags and TODO states in MobileOrg, you should have set up the
-customization variables @code{org-todo-keywords} and @code{org-tags-alist} to
-cover all important tags and TODO keywords, even if individual files use only
-part of these. MobileOrg will also offer you states and tags set up with
-in-buffer settings, but it will understand the logistics of TODO state
-@i{sets} (@pxref{Per-file keywords}) and @i{mutually exclusive} tags
-(@pxref{Setting tags}) only for those set in these variables.
-
-@menu
-* Setting up the staging area:: Where to interact with the mobile device
-* Pushing to MobileOrg:: Uploading Org files and agendas
-* Pulling from MobileOrg:: Integrating captured and flagged items
-@end menu
-
-@node Setting up the staging area, Pushing to MobileOrg, MobileOrg, MobileOrg
-@section Setting up the staging area
-
-MobileOrg needs to interact with Emacs through a directory on a server. If you
-are using a public server, you should consider to encrypt the files that are
-uploaded to the server. This can be done with Org-mode 7.02 and with
-@i{MobileOrg 1.5} (iPhone version), and you need an @file{openssl}
-installation on your system. To turn on encryption, set a password in
-@i{MobileOrg} and, on the Emacs side, configure the variable
-@code{org-mobile-use-encryption}@footnote{If you can safely store the
-password in your Emacs setup, you might also want to configure
-@code{org-mobile-encryption-password}. Please read the docstring of that
-variable. Note that encryption will apply only to the contents of the
-@file{.org} files. The file names themselves will remain visible.}.
-
-The easiest way to create that directory is to use a free
-@uref{http://dropbox.com,Dropbox.com} account@footnote{If you cannot use
-Dropbox, or if your version of MobileOrg does not support it, you can use a
-webdav server. For more information, check out the documentation of MobileOrg and also this
-@uref{http://orgmode.org/worg/org-faq.php#mobileorg_webdav, FAQ entry}.}.
-When MobileOrg first connects to your Dropbox, it will create a directory
-@i{MobileOrg} inside the Dropbox. After the directory has been created, tell
-Emacs about it:
-
-@lisp
-(setq org-mobile-directory "~/Dropbox/MobileOrg")
-@end lisp
-
-Org-mode has commands to put files for @i{MobileOrg} into that directory,
-and to read captured notes from there.
-
-@node Pushing to MobileOrg, Pulling from MobileOrg, Setting up the staging area, MobileOrg
-@section Pushing to MobileOrg
-
-This operation copies all files currently listed in @code{org-mobile-files}
-to the directory @code{org-mobile-directory}. By default this list contains
-all agenda files (as listed in @code{org-agenda-files}), but additional files
-can be included by customizing @code{org-mobiles-files}. File names will be
-staged with paths relative to @code{org-directory}, so all files should be
-inside this directory. The push operation also creates a special Org file
-@file{agendas.org} with all custom agenda view defined by the
-user@footnote{While creating the agendas, Org-mode will force ID properties
-on all referenced entries, so that these entries can be uniquely identified
-if @i{MobileOrg} flags them for further action. If you do not want to get
-these properties in so many entries, you can set the variable
-@code{org-mobile-force-id-on-agenda-items} to @code{nil}. Org mode will then
-rely on outline paths, in the hope that these will be unique enough.}.
-Finally, Org writes the file @file{index.org}, containing links to all other
-files. @i{MobileOrg} first reads this file from the server, and then
-downloads all agendas and Org files listed in it. To speed up the download,
-MobileOrg will only read files whose checksums@footnote{stored automatically
-in the file @file{checksums.dat}} have changed.
-
-@node Pulling from MobileOrg, , Pushing to MobileOrg, MobileOrg
-@section Pulling from MobileOrg
-
-When @i{MobileOrg} synchronizes with the server, it not only pulls the Org
-files for viewing. It also appends captured entries and pointers to flagged
-and changed entries to the file @file{mobileorg.org} on the server. Org has
-a @emph{pull} operation that integrates this information into an inbox file
-and operates on the pointers to flagged entries. Here is how it works:
-
-@enumerate
-@item
-Org moves all entries found in
-@file{mobileorg.org}@footnote{@file{mobileorg.org} will be empty after this
-operation.} and appends them to the file pointed to by the variable
-@code{org-mobile-inbox-for-pull}. Each captured entry and each editing event
-will be a top-level entry in the inbox file.
-@item
-After moving the entries, Org will attempt to implement the changes made in
-@i{MobileOrg}. Some changes are applied directly and without user
-interaction. Examples are all changes to tags, TODO state, headline and body
-text that can be cleanly applied. Entries that have been flagged for further
-action will receive a tag @code{:FLAGGED:}, so that they can be easily found
-again. When there is a problem finding an entry or applying the change, the
-pointer entry will remain in the inbox and will be marked with an error
-message. You need to later resolve these issues by hand.
-@item
-Org will then generate an agenda view with all flagged entries. The user
-should then go through these entries and do whatever actions are necessary.
-If a note has been stored while flagging an entry in @i{MobileOrg}, that note
-will be displayed in the echo area when the cursor is on the corresponding
-agenda line.
-@table @kbd
-@kindex ?
-@item ?
-Pressing @kbd{?} in that special agenda will display the full flagging note in
-another window and also push it onto the kill ring. So you could use @kbd{?
-z C-y C-c C-c} to store that flagging note as a normal note in the entry.
-Pressing @kbd{?} twice in succession will offer to remove the
-@code{:FLAGGED:} tag along with the recorded flagging note (which is stored
-in a property). In this way you indicate that the intended processing for
-this flagged entry is finished.
-@end table
-@end enumerate
-
-@kindex C-c a ?
-If you are not able to process all flagged entries directly, you can always
-return to this agenda view@footnote{Note, however, that there is a subtle
-difference. The view created automatically by @kbd{M-x org-mobile-pull
-@key{RET}} is guaranteed to search all files that have been addressed by the
-last pull. This might include a file that is not currently in your list of
-agenda files. If you later use @kbd{C-c a ?} to regenerate the view, only
-the current agenda files will be searched.} using @kbd{C-c a ?}.
-
-@node History and Acknowledgments, Main Index, MobileOrg, Top
-@appendix History and acknowledgments
-@cindex acknowledgments
-@cindex history
-@cindex thanks
-
-Org was born in 2003, out of frustration over the user interface of the Emacs
-Outline mode. I was trying to organize my notes and projects, and using
-Emacs seemed to be the natural way to go. However, having to remember eleven
-different commands with two or three keys per command, only to hide and show
-parts of the outline tree, that seemed entirely unacceptable to me. Also,
-when using outlines to take notes, I constantly wanted to restructure the
-tree, organizing it parallel to my thoughts and plans. @emph{Visibility
-cycling} and @emph{structure editing} were originally implemented in the
-package @file{outline-magic.el}, but quickly moved to the more general
-@file{org.el}. As this environment became comfortable for project planning,
-the next step was adding @emph{TODO entries}, basic @emph{timestamps}, and
-@emph{table support}. These areas highlighted the two main goals that Org
-still has today: to be a new, outline-based, plain text mode with innovative
-and intuitive editing features, and to incorporate project planning
-functionality directly into a notes file.
-
-Since the first release, literally thousands of emails to me or to
-@email{emacs-orgmode@@gnu.org} have provided a constant stream of bug
-reports, feedback, new ideas, and sometimes patches and add-on code.
-Many thanks to everyone who has helped to improve this package. I am
-trying to keep here a list of the people who had significant influence
-in shaping one or more aspects of Org. The list may not be
-complete, if I have forgotten someone, please accept my apologies and
-let me know.
-
-Before I get to this list, a few special mentions are in order:
-
-@table @i
-@item Bastien Guerry
-Bastien has written a large number of extensions to Org (most of them
-integrated into the core by now), including the LaTeX exporter and the plain
-list parser. His support during the early days, when he basically acted as
-co-maintainer, was central to the success of this project. Bastien also
-invented Worg, helped establishing the Web presence of Org, and sponsors
-hosting costs for the orgmode.org website.
-@item Eric Schulte and Dan Davison
-Eric and Dan are jointly responsible for the Org-babel system, which turns
-Org into a multi-language environment for evaluating code and doing literate
-programming and reproducible research.
-@item John Wiegley
-John has contributed a number of great ideas and patches directly to Org,
-including the attachment system (@file{org-attach.el}), integration with
-Apple Mail (@file{org-mac-message.el}), hierarchical dependencies of TODO
-items, habit tracking (@file{org-habits.el}), and encryption
-(@file{org-crypt.el}). Also, the capture system is really an extended copy
-of his great @file{remember.el}.
-@item Sebastian Rose
-Without Sebastian, the HTML/XHTML publishing of Org would be the pitiful work
-of an ignorant amateur. Sebastian has pushed this part of Org onto a much
-higher level. He also wrote @file{org-info.js}, a Java script for displaying
-webpages derived from Org using an Info-like or a folding interface with
-single-key navigation.
-@end table
-
-@noindent OK, now to the full list of contributions! Again, please let me
-know what I am missing here!
-
-@itemize @bullet
-
-@item
-@i{Russel Adams} came up with the idea for drawers.
-@item
-@i{Thomas Baumann} wrote @file{org-bbdb.el} and @file{org-mhe.el}.
-@item
-@i{Christophe Bataillon} created the great unicorn logo that we use on the
-Org-mode website.
-@item
-@i{Alex Bochannek} provided a patch for rounding timestamps.
-@item
-@i{Jan Böcker} wrote @file{org-docview.el}.
-@item
-@i{Brad Bozarth} showed how to pull RSS feed data into Org-mode files.
-@item
-@i{Tom Breton} wrote @file{org-choose.el}.
-@item
-@i{Charles Cave}'s suggestion sparked the implementation of templates
-for Remember, which are now templates for capture.
-@item
-@i{Pavel Chalmoviansky} influenced the agenda treatment of items with
-specified time.
-@item
-@i{Gregory Chernov} patched support for Lisp forms into table
-calculations and improved XEmacs compatibility, in particular by porting
-@file{nouline.el} to XEmacs.
-@item
-@i{Sacha Chua} suggested copying some linking code from Planner.
-@item
-@i{Baoqiu Cui} contributed the DocBook exporter.
-@item
-@i{Eddward DeVilla} proposed and tested checkbox statistics. He also
-came up with the idea of properties, and that there should be an API for
-them.
-@item
-@i{Nick Dokos} tracked down several nasty bugs.
-@item
-@i{Kees Dullemond} used to edit projects lists directly in HTML and so
-inspired some of the early development, including HTML export. He also
-asked for a way to narrow wide table columns.
-@item
-@i{Thomas S. Dye} contributed documentation on Worg and helped integrating
-the Org-Babel documentation into the manual.
-@item
-@i{Christian Egli} converted the documentation into Texinfo format, inspired
-the agenda, patched CSS formatting into the HTML exporter, and wrote
-@file{org-taskjuggler.el}.
-@item
-@i{David Emery} provided a patch for custom CSS support in exported
-HTML agendas.
-@item
-@i{Nic Ferrier} contributed mailcap and XOXO support.
-@item
-@i{Miguel A. Figueroa-Villanueva} implemented hierarchical checkboxes.
-@item
-@i{John Foerch} figured out how to make incremental search show context
-around a match in a hidden outline tree.
-@item
-@i{Raimar Finken} wrote @file{org-git-line.el}.
-@item
-@i{Mikael Fornius} works as a mailing list moderator.
-@item
-@i{Austin Frank} works as a mailing list moderator.
-@item
-@i{Eric Fraga} drove the development of BEAMER export with ideas and
-testing.
-@item
-@i{Barry Gidden} did proofreading the manual in preparation for the book
-publication through Network Theory Ltd.
-@item
-@i{Niels Giesen} had the idea to automatically archive DONE trees.
-@item
-@i{Nicolas Goaziou} rewrote much of the plain list code.
-@item
-@i{Kai Grossjohann} pointed out key-binding conflicts with other packages.
-@item
-@i{Brian Gough} of Network Theory Ltd publishes the Org mode manual as a
-book.
-@item
-@i{Bernt Hansen} has driven much of the support for auto-repeating tasks,
-task state change logging, and the clocktable. His clear explanations have
-been critical when we started to adopt the Git version control system.
-@item
-@i{Manuel Hermenegildo} has contributed various ideas, small fixes and
-patches.
-@item
-@i{Phil Jackson} wrote @file{org-irc.el}.
-@item
-@i{Scott Jaderholm} proposed footnotes, control over whitespace between
-folded entries, and column view for properties.
-@item
-@i{Matt Jones} wrote @i{MobileOrg Android}.
-@item
-@i{Tokuya Kameshima} wrote @file{org-wl.el} and @file{org-mew.el}.
-@item
-@i{Shidai Liu} ("Leo") asked for embedded @LaTeX{} and tested it. He also
-provided frequent feedback and some patches.
-@item
-@i{Matt Lundin} has proposed last-row references for table formulas and named
-invisible anchors. He has also worked a lot on the FAQ.
-@item
-@i{David Maus} wrote @file{org-atom.el}, maintains the issues file for Org,
-and is a prolific contributor on the mailing list with competent replies,
-small fixes and patches.
-@item
-@i{Jason F. McBrayer} suggested agenda export to CSV format.
-@item
-@i{Max Mikhanosha} came up with the idea of refiling.
-@item
-@i{Dmitri Minaev} sent a patch to set priority limits on a per-file
-basis.
-@item
-@i{Stefan Monnier} provided a patch to keep the Emacs-Lisp compiler
-happy.
-@item
-@i{Richard Moreland} wrote @i{MobileOrg} for the iPhone.
-@item
-@i{Rick Moynihan} proposed allowing multiple TODO sequences in a file
-and being able to quickly restrict the agenda to a subtree.
-@item
-@i{Todd Neal} provided patches for links to Info files and Elisp forms.
-@item
-@i{Greg Newman} refreshed the unicorn logo into its current form.
-@item
-@i{Tim O'Callaghan} suggested in-file links, search options for general
-file links, and TAGS.
-@item
-@i{Osamu Okano} wrote @file{orgcard2ref.pl}, a Perl program to create a text
-version of the reference card.
-@item
-@i{Takeshi Okano} translated the manual and David O'Toole's tutorial
-into Japanese.
-@item
-@i{Oliver Oppitz} suggested multi-state TODO items.
-@item
-@i{Scott Otterson} sparked the introduction of descriptive text for
-links, among other things.
-@item
-@i{Pete Phillips} helped during the development of the TAGS feature, and
-provided frequent feedback.
-@item
-@i{Martin Pohlack} provided the code snippet to bundle character insertion
-into bundles of 20 for undo.
-@item
-@i{T.V. Raman} reported bugs and suggested improvements.
-@item
-@i{Matthias Rempe} (Oelde) provided ideas, Windows support, and quality
-control.
-@item
-@i{Paul Rivier} provided the basic implementation of named footnotes. He
-also acted as mailing list moderator for some time.
-@item
-@i{Kevin Rogers} contributed code to access VM files on remote hosts.
-@item
-@i{Frank Ruell} solved the mystery of the @code{keymapp nil} bug, a
-conflict with @file{allout.el}.
-@item
-@i{Jason Riedy} generalized the send-receive mechanism for Orgtbl tables with
-extensive patches.
-@item
-@i{Philip Rooke} created the Org reference card, provided lots
-of feedback, developed and applied standards to the Org documentation.
-@item
-@i{Christian Schlauer} proposed angular brackets around links, among
-other things.
-@item
-@i{Paul Sexton} wrote @file{org-ctags.el}.
-@item
-Linking to VM/BBDB/Gnus was first inspired by @i{Tom Shannon}'s
-@file{organizer-mode.el}.
-@item
-@i{Ilya Shlyakhter} proposed the Archive Sibling, line numbering in literal
-examples, and remote highlighting for referenced code lines.
-@item
-@i{Stathis Sideris} wrote the @file{ditaa.jar} ASCII to PNG converter that is
-now packaged into Org's @file{contrib} directory.
-@item
-@i{Daniel Sinder} came up with the idea of internal archiving by locking
-subtrees.
-@item
-@i{Dale Smith} proposed link abbreviations.
-@item
-@i{James TD Smith} has contributed a large number of patches for useful
-tweaks and features.
-@item
-@i{Adam Spiers} asked for global linking commands, inspired the link
-extension system, added support for mairix, and proposed the mapping API.
-@item
-@i{Ulf Stegemann} created the table to translate special symbols to HTML,
-LaTeX, UTF-8, Latin-1 and ASCII.
-@item
-@i{Andy Stewart} contributed code to @file{org-w3m.el}, to copy HTML content
-with links transformation to Org syntax.
-@item
-@i{David O'Toole} wrote @file{org-publish.el} and drafted the manual
-chapter about publishing.
-@item
-@i{Sebastien Vauban} reported many issues with LaTeX and BEAMER export and
-enabled source code highlighling in Gnus.
-@item
-@i{Stefan Vollmar} organized a video-recorded talk at the
-Max-Planck-Institute for Neurology. He also inspired the creation of a
-concept index for HTML export.
-@item
-@i{J@"urgen Vollmer} contributed code generating the table of contents
-in HTML output.
-@item
-@i{Samuel Wales} has provided important feedback and bug reports.
-@item
-@i{Chris Wallace} provided a patch implementing the @samp{QUOTE}
-keyword.
-@item
-@i{David Wainberg} suggested archiving, and improvements to the linking
-system.
-@item
-@i{Carsten Wimmer} suggested some changes and helped fix a bug in
-linking to Gnus.
-@item
-@i{Roland Winkler} requested additional key bindings to make Org
-work on a tty.
-@item
-@i{Piotr Zielinski} wrote @file{org-mouse.el}, proposed agenda blocks
-and contributed various ideas and code snippets.
-@end itemize
-
-
-@node Main Index, Key Index, History and Acknowledgments, Top
-@unnumbered Concept index
-
-@printindex cp
-
-@node Key Index, Command and Function Index, Main Index, Top
-@unnumbered Key index
-
-@printindex ky
-
-@node Command and Function Index, Variable Index, Key Index, Top
-@unnumbered Command and function index
-
-@printindex fn
-
-@node Variable Index, , Command and Function Index, Top
-@unnumbered Variable index
-
-This is not a complete index of variables and faces, only the ones that are
-mentioned in the manual. For a more complete list, use @kbd{M-x
-org-customize @key{RET}} and then click yourself through the tree.
-
-@printindex vr
-
-@bye
-
-@ignore
- arch-tag: 7893d1Fe-cc57-4d13-b5e5-f494a1CBC7ac
-@end ignore
-
-@c Local variables:
-@c fill-column: 77
-@c indent-tabs-mode: nil
-@c paragraph-start: "\\|^@[a-zA-Z]*[ \n]\\|^@x?org\\(key\\|cmd\\)\\|\f\\|[ ]*$"
-@c paragraph-separate: "\\|^@[a-zA-Z]*[ \n]\\|^@x?org\\(key\\|cmd\\)\\|[ \f]*$"
-@c End:
-
-
-@c LocalWords: webdavhost pre
diff --git a/.emacs.d/org-7.4/doc/orgcard.pdf b/.emacs.d/org-7.4/doc/orgcard.pdf
deleted file mode 100644
index c23afff..0000000
--- a/.emacs.d/org-7.4/doc/orgcard.pdf
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/doc/orgcard.tex b/.emacs.d/org-7.4/doc/orgcard.tex
deleted file mode 100644
index c55c55d..0000000
--- a/.emacs.d/org-7.4/doc/orgcard.tex
+++ /dev/null
@@ -1,686 +0,0 @@
-% Reference Card for Org Mode
-\def\orgversionnumber{7.4}
-\def\versionyear{2010} % latest update
-\def\year{2010} % latest copyright year
-
-%**start of header
-\newcount\columnsperpage
-\newcount\letterpaper
-
-% This file can be printed with 1, 2, or 3 columns per page (see below).
-% Specify how many you want here.
-\columnsperpage=3
-
-% PDF output layout. 0 for A4, 1 for letter (US), a `l' is added for
-% a landscape layout.
-\input pdflayout.sty
-\pdflayout=(0l)
-
-% Nothing else needs to be changed below this line.
-% Copyright (C) 1987, 1993, 1996, 1997, 2001, 2002, 2003, 2004, 2005,
-% 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
-
-% This file is part of GNU Emacs.
-
-% GNU Emacs is free software: you can redistribute it and/or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
-
-% GNU Emacs is distributed in the hope that it will be useful,
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-% GNU General Public License for more details.
-
-% You should have received a copy of the GNU General Public License
-% along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-% This file is intended to be processed by plain TeX (TeX82).
-%
-% The final reference card has six columns, three on each side.
-% This file can be used to produce it in any of three ways:
-% 1 column per page
-% produces six separate pages, each of which needs to be reduced to 80%.
-% This gives the best resolution.
-% 2 columns per page
-% produces three already-reduced pages.
-% You will still need to cut and paste.
-% 3 columns per page
-% produces two pages which must be printed sideways to make a
-% ready-to-use 8.5 x 11 inch reference card.
-% For this you need a dvi device driver that can print sideways.
-% Which mode to use is controlled by setting \columnsperpage above.
-%
-% To compile and print this document:
-% tex refcard.tex
-% dvips -t landscape refcard.dvi
-%
-% Author:
-% Stephen Gildea
-% Internet: gildea@stop.mail-abuse.org
-%
-% Thanks to Paul Rubin, Bob Chassell, Len Tower, and Richard Mlynarik
-% for their many good ideas.
-
-\def\shortcopyrightnotice{\vskip 1ex plus 2 fill
- \centerline{\small \copyright\ \year\ Free Software Foundation, Inc.
- Permissions on back. v\orgversionnumber}}
-
-\def\copyrightnotice{
-\vskip 1ex plus 100 fill\begingroup\small
-\centerline{Copyright \copyright\ \year\ Free Software Foundation, Inc.}
-\centerline{v\orgversionnumber{} for Org-Mode \orgversionnumber{}, \versionyear}
-\centerline{Author: Philip Rooke}
-\centerline{based on refcard design and format by Stephen Gildea}
-
-Permission is granted to make and distribute copies of
-this card provided the copyright notice and this permission notice
-are preserved on all copies.
-
-\endgroup}
-
-% make \bye not \outer so that the \def\bye in the \else clause below
-% can be scanned without complaint.
-\def\bye{\par\vfill\supereject\end}
-
-\newdimen\intercolumnskip %horizontal space between columns
-\newbox\columna %boxes to hold columns already built
-\newbox\columnb
-
-\def\ncolumns{\the\columnsperpage}
-
-\message{[\ncolumns\space
- column\if 1\ncolumns\else s\fi\space per page]}
-
-\def\scaledmag#1{ scaled \magstep #1}
-
-% This multi-way format was designed by Stephen Gildea October 1986.
-% Note that the 1-column format is fontfamily-independent.
-\if 1\ncolumns %one-column format uses normal size
- \hsize 4in
- \vsize 10in
- \voffset -.7in
- \font\titlefont=\fontname\tenbf \scaledmag3
- \font\headingfont=\fontname\tenbf \scaledmag2
- \font\smallfont=\fontname\sevenrm
- \font\smallsy=\fontname\sevensy
-
- \footline{\hss\folio}
- \def\makefootline{\baselineskip10pt\hsize6.5in\line{\the\footline}}
-\else %2 or 3 columns uses prereduced size
- \if 1\the\letterpaper
- \hsize 3.2in
- \vsize 7.95in
- \hoffset -.75in
- \voffset -.745in
- \else
- \hsize 3.2in
- \vsize 7.65in
- \hoffset -.25in
- \voffset -.745in
- \fi
- \font\titlefont=cmbx10 \scaledmag2
- \font\headingfont=cmbx10 \scaledmag1
- \font\smallfont=cmr6
- \font\smallsy=cmsy6
- \font\eightrm=cmr8
- \font\eightbf=cmbx8
- \font\eightit=cmti8
- \font\eighttt=cmtt8
- \font\eightmi=cmmi8
- \font\eightsy=cmsy8
- \textfont0=\eightrm
- \textfont1=\eightmi
- \textfont2=\eightsy
- \def\rm{\eightrm}
- \def\bf{\eightbf}
- \def\it{\eightit}
- \def\tt{\eighttt}
- \if 1\the\letterpaper
- \normalbaselineskip=.8\normalbaselineskip
- \else
- \normalbaselineskip=.7\normalbaselineskip
- \fi
- \normallineskip=.8\normallineskip
- \normallineskiplimit=.8\normallineskiplimit
- \normalbaselines\rm %make definitions take effect
-
- \if 2\ncolumns
- \let\maxcolumn=b
- \footline{\hss\rm\folio\hss}
- \def\makefootline{\vskip 2in \hsize=6.86in\line{\the\footline}}
- \else \if 3\ncolumns
- \let\maxcolumn=c
- \nopagenumbers
- \else
- \errhelp{You must set \columnsperpage equal to 1, 2, or 3.}
- \errmessage{Illegal number of columns per page}
- \fi\fi
-
- \intercolumnskip=.46in
- \def\abc{a}
- \output={% %see The TeXbook page 257
- % This next line is useful when designing the layout.
- %\immediate\write16{Column \folio\abc\space starts with \firstmark}
- \if \maxcolumn\abc \multicolumnformat \global\def\abc{a}
- \else\if a\abc
- \global\setbox\columna\columnbox \global\def\abc{b}
- %% in case we never use \columnb (two-column mode)
- \global\setbox\columnb\hbox to -\intercolumnskip{}
- \else
- \global\setbox\columnb\columnbox \global\def\abc{c}\fi\fi}
- \def\multicolumnformat{\shipout\vbox{\makeheadline
- \hbox{\box\columna\hskip\intercolumnskip
- \box\columnb\hskip\intercolumnskip\columnbox}
- \makefootline}\advancepageno}
- \def\columnbox{\leftline{\pagebody}}
-
- \def\bye{\par\vfill\supereject
- \if a\abc \else\null\vfill\eject\fi
- \if a\abc \else\null\vfill\eject\fi
- \end}
-\fi
-
-% we won't be using math mode much, so redefine some of the characters
-% we might want to talk about
-%\catcode`\^=12
-\catcode`\_=12
-
-% we also need the tilde, for file names.
-\catcode`\~=12
-
-\chardef\\=`\\
-\chardef\{=`\{
-\chardef\}=`\}
-
-\hyphenation{mini-buf-fer}
-
-\parindent 0pt
-\parskip 1ex plus .5ex minus .5ex
-
-\def\small{\smallfont\textfont2=\smallsy\baselineskip=.8\baselineskip}
-
-% newcolumn - force a new column. Use sparingly, probably only for
-% the first column of a page, which should have a title anyway.
-\outer\def\newcolumn{\vfill\eject}
-
-% title - page title. Argument is title text.
-\outer\def\title#1{{\titlefont\centerline{#1}}\vskip 1ex plus .5ex}
-
-% section - new major section. Argument is section name.
-\outer\def\section#1{\par\filbreak
- \vskip 3ex plus 2ex minus 2ex {\headingfont #1}\mark{#1}%
- \vskip 2ex plus 1ex minus 1.5ex}
-
-\newdimen\keyindent
-
-% beginindentedkeys...endindentedkeys - key definitions will be
-% indented, but running text, typically used as headings to group
-% definitions, will not.
-\def\beginindentedkeys{\keyindent=1em}
-\def\endindentedkeys{\keyindent=0em}
-\endindentedkeys
-
-% paralign - begin paragraph containing an alignment.
-% If an \halign is entered while in vertical mode, a parskip is never
-% inserted. Using \paralign instead of \halign solves this problem.
-\def\paralign{\vskip\parskip\halign}
-
-% \<...> - surrounds a variable name in a code example
-\def\<#1>{{\it #1\/}}
-
-% kbd - argument is characters typed literally. Like the Texinfo command.
-\def\kbd#1{{\tt#1}\null} %\null so not an abbrev even if period follows
-
-% beginexample...endexample - surrounds literal text, such a code example.
-% typeset in a typewriter font with line breaks preserved
-\def\beginexample{\par\leavevmode\begingroup
- \obeylines\obeyspaces\parskip0pt\tt}
-{\obeyspaces\global\let =\ }
-\def\endexample{\endgroup}
-
-% key - definition of a key.
-% \key{description of key}{key-name}
-% prints the description left-justified, and the key-name in a \kbd
-% form near the right margin.
-\def\key#1#2{\leavevmode\hbox to \hsize{\vtop
- {\hsize=.75\hsize\rightskip=1em
- \hskip\keyindent\relax#1}\kbd{#2}\hfil}}
-
-\newbox\metaxbox
-\setbox\metaxbox\hbox{\kbd{M-x }}
-\newdimen\metaxwidth
-\metaxwidth=\wd\metaxbox
-
-% metax - definition of a M-x command.
-% \metax{description of command}{M-x command-name}
-% Tries to justify the beginning of the command name at the same place
-% as \key starts the key name. (The "M-x " sticks out to the left.)
-\def\metax#1#2{\leavevmode\hbox to \hsize{\hbox to .75\hsize
- {\hskip\keyindent\relax#1\hfil}%
- \hskip -\metaxwidth minus 1fil
- \kbd{#2}\hfil}}
-
-% threecol - like "key" but with two key names.
-% for example, one for doing the action backward, and one for forward.
-\def\threecol#1#2#3{\hskip\keyindent\relax#1\hfil&\kbd{#2}\hfil\quad
- &\kbd{#3}\hfil\quad\cr}
-
-\def\noteone{{\small \hfill [1]}}
-\def\notetwo{{\small \hfill [2]}}
-
-
-%**end of header
-
-
-\title{Org-Mode Reference Card (1/2)}
-
-\centerline{(for version \orgversionnumber)}
-
-\section{Getting Started}
-\metax{To read the on-line documentation try}{M-x org-info}
-
-\section{Visibility Cycling}
-
-\key{rotate current subtree between states}{TAB}
-\key{rotate entire buffer between states}{S-TAB}
-\key{restore property-dependent startup visibility}{C-u C-u TAB}
-\metax{show the whole file, including drawers}{C-u C-u C-u TAB}
-\key{reveal context around point}{C-c C-r}
-
-\section{Motion}
-
-\key{next/previous heading}{C-c C-n/p}
-\key{next/previous heading, same level}{C-c C-f/b}
-\key{backward to higher level heading}{C-c C-u}
-\key{jump to another place in document}{C-c C-j}
-\key{previous/next plain list item}{S-UP/DOWN\notetwo}
-
-\section{Structure Editing}
-
-\key{insert new heading/item at current level}{M-RET}
-\key{insert new heading after subtree}{C-RET}
-\key{insert new TODO entry/checkbox item}{M-S-RET}
-\key{insert TODO entry/ckbx after subtree}{C-S-RET}
-\key{turn (head)line into item, cycle item type}{C-c -}
-\key{turn item/line into headline}{C-c *}
-\key{promote/demote heading}{M-LEFT/RIGHT}
-\metax{promote/demote current subtree}{M-S-LEFT/RIGHT}
-\metax{move subtree/list item up/down}{M-S-UP/DOWN}
-\metax{sort subtree/region/plain-list}{C-c \^{}}
-\metax{clone a subtree}{C-c C-x c}
-\metax{kill/copy subtree}{C-c C-x C-w/M-w}
-\metax{yank subtree}{C-c C-x C-y or C-y}
-\metax{narrow buffer to subtree / widen}{C-x n s/w}
-
-\section{Capture - Refile - Archiving}
-\key{capture a new item (C-u C-u = goto last)}{C-c c \noteone}
-\key{refile subtree (C-u C-u = goto last)}{C-c C-w}
-\key{archive subtree using the default command}{C-c C-x C-a}
-\key{move subtree to archive file}{C-c C-x C-s}
-\key{toggle ARCHIVE tag / to ARCHIVE sibling}{C-c C-x a/A}
-\key{force cycling of an ARCHIVEd tree}{C-TAB}
-
-\section{Filtering and Sparse Trees}
-
-\key{construct a sparse tree by various criteria}{C-c /}
-\key{view TODO's in sparse tree}{C-c / t/T}
-\key{global TODO list in agenda mode}{C-c a t \noteone}
-\key{time sorted view of current org file}{C-c a L}
-
-\section{Tables}
-
-{\bf Creating a table}
-
-%\metax{insert a new Org-mode table}{M-x org-table-create}
-\metax{just start typing, e.g.}{|Name|Phone|Age RET |- TAB}
-\key{convert region to table}{C-c |}
-\key{... separator at least 3 spaces}{C-3 C-c |}
-
-{\bf Commands available inside tables}
-
-The following commands work when the cursor is {\it inside a table}.
-Outside of tables, the same keys may have other functionality.
-
-{\bf Re-aligning and field motion}
-
-\key{re-align the table without moving the cursor}{C-c C-c}
-\key{re-align the table, move to next field}{TAB}
-\key{move to previous field}{S-TAB}
-\key{re-align the table, move to next row}{RET}
-\key{move to beginning/end of field}{M-a/e}
-
-{\bf Row and column editing}
-
-\key{move the current column left}{M-LEFT/RIGHT}
-\key{kill the current column}{M-S-LEFT}
-\key{insert new column to left of cursor position}{M-S-RIGHT}
-
-\key{move the current row up/down}{M-UP/DOWN}
-\key{kill the current row or horizontal line}{M-S-UP}
-\key{insert new row above the current row}{M-S-DOWN}
-\key{insert hline below (\kbd{C-u} : above) current row}{C-c -}
-\key{insert hline and move to line below it}{C-c RET}
-\key{sort lines in region}{C-c \^{}}
-
-{\bf Regions}
-
-\metax{cut/copy/paste rectangular region}{C-c C-x C-w/M-w/C-y}
-%\key{copy rectangular region}{C-c C-x M-w}
-%\key{paste rectangular region}{C-c C-x C-y}
-\key{fill paragraph across selected cells}{C-c C-q}
-
-{\bf Miscellaneous}
-
-\key{to limit column width to \kbd{N} characters, use}{...| <N> |...}
-\key{edit the current field in a separate window}{C-c `}
-\key{make current field fully visible}{C-u TAB}
-\metax{export as tab-separated file}{M-x org-table-export}
-\metax{import tab-separated file}{M-x org-table-import}
-\key{sum numbers in current column/rectangle}{C-c +}
-
-{\bf Tables created with the \kbd{table.el} package}
-
-\key{insert a new \kbd{table.el} table}{C-c ~}
-\key{recognize existing table.el table}{C-c C-c}
-\key{convert table (Org-mode $\leftrightarrow$ table.el)}{C-c ~}
-
-{\bf Spreadsheet}
-
-Formulas typed in field are executed by \kbd{TAB},
-\kbd{RET} and \kbd{C-c C-c}. \kbd{=} introduces a column
-formula, \kbd{:=} a field formula.
-
-\key{Example: Add Col1 and Col2}{|=\$1+\$2 |}
-\key{... with printf format specification}{|=\$1+\$2;\%.2f|}
-\key{... with constants from constants.el}{|=\$1/\$c/\$cm |}
-\metax{sum from 2nd to 3rd hline}{|:=vsum(@II..@III)|}
-\key{apply current column formula}{| = |}
-
-\key{set and eval column formula}{C-c =}
-\key{set and eval field formula}{C-u C-c =}
-\key{re-apply all stored equations to current line}{C-c *}
-\key{re-apply all stored equations to entire table}{C-u C-c *}
-\key{iterate table to stability}{C-u C-u C-c *}
-\key{rotate calculation mark through \# * ! \^ \_ \$}{C-\#}
-\key{show line, column, formula reference}{C-c ?}
-\key{toggle grid / debugger}{C-c \}/\{}
-
-\newcolumn
-{\it Formula Editor}
-
-\key{edit formulas in separate buffer}{C-c '}
-\key{exit and install new formulas}{C-c C-c}
-\key{exit, install, and apply new formulas}{C-u C-c C-c}
-\key{abort}{C-c C-q}
-\key{toggle reference style}{C-c C-r}
-\key{pretty-print Lisp formula}{TAB}
-\key{complete Lisp symbol}{M-TAB}
-\key{shift reference point}{S-cursor}
-\key{shift test line for column references}{M-up/down}
-\key{scroll the window showing the table}{M-S-up/down}
-\key{toggle table coordinate grid}{C-c \}}
-
-\section{Links}
-
-\key{globally store link to the current location}{C-c l \noteone}
-\key{insert a link (TAB completes stored links)}{C-c C-l}
-\key{insert file link with file name completion}{C-u C-c C-l}
-\key{edit (also hidden part of) link at point}{C-c C-l}
-
-\key{open file links in emacs}{C-c C-o}
-\key{...force open in emacs/other window}{C-u C-c C-o}
-\key{open link at point}{mouse-1/2}
-\key{...force open in emacs/other window}{mouse-3}
-\key{record a position in mark ring}{C-c \%}
-\key{jump back to last followed link(s)}{C-c \&}
-\key{find next link}{C-c C-x C-n}
-\key{find previous link}{C-c C-x C-p}
-\key{edit code snippet of file at point}{C-c '}
-\key{toggle inline display of linked images}{C-c C-x C-v}
-
-\section{Working with Code (Babel)}
-
-\key{execute code block at point}{C-c C-c}
-\key{open results of code block at point}{C-c C-o}
-\key{view expanded body of code block at point}{C-c C-v v}
-\key{go to named code block}{C-c C-v g}
-\key{go to named result}{C-c C-v r}
-\key{go to the head of the current code block}{C-c C-v u}
-\key{go to the next code block}{C-c C-v n}
-\key{go to the previous code block}{C-c C-v p}
-\key{demarcate a code block}{C-c C-v d}
-\key{execute the next key sequence in the code edit buffer}{C-c C-v x}
-\key{execute all code blocks in current buffer}{C-c C-v b}
-\key{execute all code blocks in current subtree}{C-c C-v s}
-\key{tangle code blocks in current file}{C-c C-v t}
-\key{tangle code blocks in supplied file}{C-c C-v f}
-\key{ingest all code blocks in supplied file into the Library of Babel}{C-c C-v i}
-\key{switch to the session of the current code block}{C-c C-v z}
-\key{load expanded body of the current code block into a session}{C-c C-v l}
-\key{view sha1 hash of the current code block}{C-c C-v a}
-
-\section{Completion}
-
-In-buffer completion completes TODO keywords at headline start, TeX
-macros after ``{\tt \\}'', option keywords after ``{\tt \#-}'', TAGS
-after ``{\tt :}'', and dictionary words elsewhere.
-
-\key{complete word at point}{M-TAB}
-
-
-\newcolumn
-\title{Org-Mode Reference Card (2/2)}
-
-\centerline{(for version \orgversionnumber)}
-
-\section{TODO Items and Checkboxes}
-
-\key{rotate the state of the current item}{C-c C-t}
-\metax{select next/previous state}{S-LEFT/RIGHT}
-\metax{select next/previous set}{C-S-LEFT/RIGHT}
-\key{toggle ORDERED property}{C-c C-x o}
-\key{view TODO items in a sparse tree}{C-c C-v}
-\key{view 3rd TODO keyword's sparse tree}{C-3 C-c C-v}
-
-\key{set the priority of the current item}{C-c , [ABC]}
-\key{remove priority cookie from current item}{C-c , SPC}
-\key{raise/lower priority of current item}{S-UP/DOWN\notetwo}
-
-\key{insert new checkbox item in plain list}{M-S-RET}
-\key{toggle checkbox(es) in region/entry/at point}{C-c C-x C-b}
-\key{toggle checkbox at point}{C-c C-c}
-%\metax{checkbox statistics cookies: insert {\tt [/]} or {\tt [\%]}}{}
-\key{update checkbox statistics (\kbd{C-u} : whole file)}{C-c \#}
-
-\section{Tags}
-
-\key{set tags for current heading}{C-c C-q}
-\key{realign tags in all headings}{C-u C-c C-q}
-\key{create sparse tree with matching tags}{C-c \\}
-\key{globally (agenda) match tags at cursor}{C-c C-o}
-
-\section{Properties and Column View}
-
-\key{set property/effort}{C-c C-x p/e}
-\key{special commands in property lines}{C-c C-c}
-\key{next/previous allowed value}{S-left/right}
-\key{turn on column view}{C-c C-x C-c}
-\key{capture columns view in dynamic block}{C-c C-x i}
-
-\key{quit column view}{q}
-\key{show full value}{v}
-\key{edit value}{e}
-\metax{next/previous allowed value}{n/p or S-left/right}
-\key{edit allowed values list}{a}
-\key{make column wider/narrower}{> / <}
-\key{move column left/right}{M-left/right}
-\key{add new column}{M-S-right}
-\key{Delete current column}{M-S-left}
-
-
-\section{Timestamps}
-
-\key{prompt for date and insert timestamp}{C-c .}
-\key{like \kbd{C-c} . but insert date and time format}{C-u C-c .}
-\key{like \kbd{C-c .} but make stamp inactive}{C-c !} % FIXME
-\key{insert DEADLINE timestamp}{C-c C-d}
-\key{insert SCHEDULED timestamp}{C-c C-s}
-\key{create sparse tree with all deadlines due}{C-c / d}
-\key{the time between 2 dates in a time range}{C-c C-y}
-\metax{change timestamp at cursor $\pm 1$ day}{S-RIGHT/LEFT\notetwo}
-\key{change year/month/day at cursor by $\pm 1$}{S-UP/DOWN\notetwo}
-\key{access the calendar for the current date}{C-c >}
-\key{insert timestamp matching date in calendar}{C-c <}
-\key{access agenda for current date}{C-c C-o}
-\key{select date while prompted}{mouse-1/RET}
-%\key{... select date in calendar}{mouse-1/RET}
-%\key{... scroll calendar back/forward one month}{< / >}
-%\key{... forward/backward one day}{S-LEFT/RIGHT}
-%\key{... forward/backward one week}{S-UP/DOWN}
-%\key{... forward/backward one month}{M-S-LEFT/RIGHT}
-\key{toggle custom format display for dates/times}{C-c C-x C-t}
-
-\newcolumn
-
-{\bf Clocking time}
-
-\key{start clock on current item}{C-c C-x C-i}
-\key{stop/cancel clock on current item}{C-c C-x C-o/x}
-\key{display total subtree times}{C-c C-x C-d}
-\key{remove displayed times}{C-c C-c}
-\key{insert/update table with clock report}{C-c C-x C-r}
-
-\section{Agenda Views}
-
-\key{add/move current file to front of agenda}{C-c [}
-\key{remove current file from your agenda}{C-c ]}
-\key{cycle through agenda file list}{C-'}
-\key{set/remove restriction lock}{C-c C-x </>}
-
-\key{compile agenda for the current week}{C-c a a \noteone}
-\key{compile global TODO list}{C-c a t \noteone}
-\key{compile TODO list for specific keyword}{C-c a T \noteone}
-\key{match tags, TODO kwds, properties}{C-c a m \noteone}
-\key{match only in TODO entries}{C-c a M \noteone}
-\key{find stuck projects}{C-c a \# \noteone}
-\key{show timeline of current org file}{C-c a L \noteone}
-\key{configure custom commands}{C-c a C \noteone}
-%\key{configure stuck projects}{C-c a ! \noteone}
-\key{agenda for date at cursor}{C-c C-o}
-
-{\bf Commands available in an agenda buffer}
-
-{\bf View Org file}
-
-\key{show original location of item}{SPC/mouse-3}
-%\key{... also available with}{mouse-3}
-\key{show and recenter window}{L}
-\key{goto original location in other window}{TAB/mouse-2}
-%\key{... also available with}{mouse-2}
-\key{goto original location, delete other windows}{RET}
-\key{show subtree in indirect buffer, ded.\ frame}{C-c C-x b}
-\key{toggle follow-mode}{F}
-
-{\bf Change display}
-
-\key{delete other windows}{o}
-\key{view mode dispatcher}{v}
-\key{switch to day/week/month/year view}{d w vm vy}
-\key{toggle diary entries / time grid / habits}{D / G / K}
-\key{toggle entry text / clock report}{E / R}
-\key{toggle display of logbook entries}{l / v l/L}
-\key{toggle inclusion of archived trees/files}{v a/A}
-\key{refresh agenda buffer with any changes}{r / g}
-\key{filter with respect to a tag}{/}
-\key{save all org-mode buffers}{s}
-\key{display next/previous day,week,...}{f / b}
-\key{goto today / some date (prompt)}{. / j}
-
-{\bf Remote editing}
-
-\key{digit argument}{0-9}
-\key{change state of current TODO item}{t}
-\key{kill item and source}{C-k}
-\key{archive default}{\$ / a}
-\key{refile the subtree}{C-c C-w}
-\key{set/show tags of current headline}{: / T}
-\key{set effort property (prefix=nth)}{e}
-\key{set / compute priority of current item}{, / P}
-\key{raise/lower priority of current item}{S-UP/DOWN\notetwo}
-\key{run an attachment command}{C-c C-a}
-\key{schedule/set deadline for this item}{C-c C-s/d}
-\metax{change timestamp one day earlier/later}{S-LEFT/RIGHT\notetwo}
-\key{change timestamp to today}{>}
-\key{insert new entry into diary}{i}
-\newcolumn
-\key{start/stop/cancel the clock on current item}{I / O / X}
-\key{jump to running clock entry}{J}
-\key{mark / unmark / execute bulk action}{m / u / B}
-
-{\bf Misc}
-
-\key{follow one or offer all links in current entry}{C-c C-o}
-
-{\bf Calendar commands}
-
-\key{find agenda cursor date in calendar}{c}
-\key{compute agenda for calendar cursor date}{c}
-\key{show phases of the moon}{M}
-\key{show sunrise/sunset times}{S}
-\key{show holidays}{H}
-\key{convert date to other calendars}{C}
-
-{\bf Quit and Exit}
-
-\key{quit agenda, remove agenda buffer}{q}
-\key{exit agenda, remove all agenda buffers}{x}
-
-\section{LaTeX and cdlatex-mode}
-
-\key{preview LaTeX fragment}{C-c C-x C-l}
-\key{expand abbreviation (cdlatex-mode)}{TAB}
-\key{insert/modify math symbol (cdlatex-mode)}{` / '}
-\key{insert citation using RefTeX}{C-c C-x [}
-
-\section{Exporting and Publishing}
-
-Exporting creates files with extensions {\it .txt\/} and {\it .html\/}
-in the current directory. Publishing puts the resulting file into
-some other place.
-
-\key{export/publish dispatcher}{C-c C-e}
-
-\key{export visible part only}{C-c C-e v}
-\key{insert template of export options}{C-c C-e t}
-\key{toggle fixed width for entry or region}{C-c :}
-\key{toggle pretty display of scripts, entities}{C-c C-x {\tt\char`\\}}
-
-{\bf Comments: Text not being exported}
-
-Lines starting with \kbd{\#} and subtrees starting with COMMENT are
-never exported.
-
-\key{toggle COMMENT keyword on entry}{C-c ;}
-
-\section{Dynamic Blocks}
-
-\key{update dynamic block at point}{C-c C-x C-u}
-\metax{update all dynamic blocks}{C-u C-c C-x C-u}
-
-\section{Notes}
-[1] This is only a suggestion for a binding of this command. Choose
-your own key as shown under INSTALLATION.
-
-[2] Keybinding affected by {\tt org-support-shift-select} and also
- {\tt org-replace-disputed-keys}.
-
-\copyrightnotice
-
-\bye
-
-% Local variables:
-% compile-command: "tex refcard"
-% End:
-
-% arch-tag: 139f6750-5cfc-49ca-92b5-237fe5795290
diff --git a/.emacs.d/org-7.4/doc/orgcard_letter.pdf b/.emacs.d/org-7.4/doc/orgcard_letter.pdf
deleted file mode 100644
index 91182ac..0000000
--- a/.emacs.d/org-7.4/doc/orgcard_letter.pdf
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/doc/orgguide.pdf b/.emacs.d/org-7.4/doc/orgguide.pdf
deleted file mode 100644
index 2b3a0dc..0000000
--- a/.emacs.d/org-7.4/doc/orgguide.pdf
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/doc/orgguide.texi b/.emacs.d/org-7.4/doc/orgguide.texi
deleted file mode 100644
index 992ba80..0000000
--- a/.emacs.d/org-7.4/doc/orgguide.texi
+++ /dev/null
@@ -1,2699 +0,0 @@
-\input texinfo
-@c %**start of header
-@setfilename ../../info/orgguide
-@settitle The compact Org-mode Guide
-
-@set VERSION 7.4
-@set DATE December 2010
-
-@c Use proper quote and backtick for code sections in PDF output
-@c Cf. Texinfo manual 14.2
-@set txicodequoteundirected
-@set txicodequotebacktick
-
-@c Version and Contact Info
-@set MAINTAINERSITE @uref{http://orgmode.org,maintainers webpage}
-@set AUTHOR Carsten Dominik
-@set MAINTAINER Carsten Dominik
-@set MAINTAINEREMAIL @email{carsten at orgmode dot org}
-@set MAINTAINERCONTACT @uref{mailto:carsten at orgmode dot org,contact the maintainer}
-@c %**end of header
-@finalout
-
-@c Macro definitions
-@iftex
-@c @hyphenation{time-stamp time-stamps time-stamp-ing time-stamp-ed}
-@end iftex
-@macro Ie {}
-I.e.,
-@end macro
-@macro ie {}
-i.e.,
-@end macro
-@macro Eg {}
-E.g.,
-@end macro
-@macro eg {}
-e.g.,
-@end macro
-
-@c Subheadings inside a table.
-@macro tsubheading{text}
-@ifinfo
-@subsubheading \text\
-@end ifinfo
-@ifnotinfo
-@item @b{\text\}
-@end ifnotinfo
-@end macro
-
-@macro seealso{text}
-@noindent @b{Further reading}@*@noindent \text\
-@end macro
-@copying
-
-Copyright @copyright{} 2010 Free Software Foundation
-
-@quotation
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.3 or
-any later version published by the Free Software Foundation; with no
-Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
-and with the Back-Cover Texts as in (a) below. A copy of the license
-is included in the section entitled ``GNU Free Documentation License.''
-
-(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
-modify this GNU manual. Buying copies from the FSF supports it in
-developing GNU and promoting software freedom.''
-
-This document is part of a collection distributed under the GNU Free
-Documentation License. If you want to distribute this document
-separately from the collection, you can do so by adding a copy of the
-license to the document, as described in section 6 of the license.
-@end quotation
-@end copying
-
-@dircategory Emacs
-@direntry
-* Org Mode Guide: (orgguide). Abbreviated Org-mode Manual
-@end direntry
-
-@titlepage
-@title The compact Org-mode Guide
-
-@subtitle Release @value{VERSION}
-@author by Carsten Dominik
-
-@c The following two commands start the copyright page.
-@page
-@vskip 0pt plus 1filll
-@insertcopying
-@end titlepage
-
-@c Output the table of contents at the beginning.
-@shortcontents
-
-@ifnottex
-@node Top, Introduction, (dir), (dir)
-@top Org Mode Guide
-
-@insertcopying
-@end ifnottex
-
-@menu
-* Introduction:: Getting started
-* Document Structure:: A tree works like your brain
-* Tables:: Pure magic for quick formatting
-* Hyperlinks:: Notes in context
-* TODO Items:: Every tree branch can be a TODO item
-* Tags:: Tagging headlines and matching sets of tags
-* Properties:: Properties
-* Dates and Times:: Making items useful for planning
-* Capture - Refile - Archive:: The ins and outs for projects
-* Agenda Views:: Collecting information into views
-* Markup:: Prepare text for rich export
-* Exporting:: Sharing and publishing of notes
-* Publishing:: Create a web site of linked Org files
-* Working With Source Code:: Source code snippets embedded in Org
-* Miscellaneous:: All the rest which did not fit elsewhere
-
-@detailmenu
- --- The Detailed Node Listing ---
-
-Introduction
-
-* Preface:: Welcome
-* Installation:: How to install a downloaded version of Org
-* Activation:: How to activate Org for certain buffers
-* Feedback:: Bug reports, ideas, patches etc.
-
-Document Structure
-
-* Outlines:: Org is based on Outline mode
-* Headlines:: How to typeset Org tree headlines
-* Visibility cycling:: Show and hide, much simplified
-* Motion:: Jumping to other headlines
-* Structure editing:: Changing sequence and level of headlines
-* Sparse trees:: Matches embedded in context
-* Plain lists:: Additional structure within an entry
-* Footnotes:: How footnotes are defined in Org's syntax
-
-Hyperlinks
-
-* Link format:: How links in Org are formatted
-* Internal links:: Links to other places in the current file
-* External links:: URL-like links to the world
-* Handling links:: Creating, inserting and following
-* Targeted links:: Point at a location in a file
-
-TODO Items
-
-* Using TODO states:: Setting and switching states
-* Multi-state workflows:: More than just on/off
-* Progress logging:: Dates and notes for progress
-* Priorities:: Some things are more important than others
-* Breaking down tasks:: Splitting a task into manageable pieces
-* Checkboxes:: Tick-off lists
-
-Progress logging
-
-* Closing items:: When was this entry marked DONE?
-* Tracking TODO state changes:: When did the status change?
-
-Tags
-
-* Tag inheritance:: Tags use the tree structure of the outline
-* Setting tags:: How to assign tags to a headline
-* Tag searches:: Searching for combinations of tags
-
-Dates and Times
-
-* Timestamps:: Assigning a time to a tree entry
-* Creating timestamps:: Commands which insert timestamps
-* Deadlines and scheduling:: Planning your work
-* Clocking work time:: Tracking how long you spend on a task
-
-Capture - Refile - Archive
-
-* Capture::
-* Refiling notes:: Moving a tree from one place to another
-* Archiving:: What to do with finished projects
-
-Capture
-
-* Setting up a capture location:: Where notes will be stored
-* Using capture:: Commands to invoke and terminate capture
-* Capture templates:: Define the outline of different note types
-
-Agenda Views
-
-* Agenda files:: Files being searched for agenda information
-* Agenda dispatcher:: Keyboard access to agenda views
-* Built-in agenda views:: What is available out of the box?
-* Agenda commands:: Remote editing of Org trees
-* Custom agenda views:: Defining special searches and views
-
-The built-in agenda views
-
-* Weekly/daily agenda:: The calendar page with current tasks
-* Global TODO list:: All unfinished action items
-* Matching tags and properties:: Structured information with fine-tuned search
-* Timeline:: Time-sorted view for single file
-* Search view:: Find entries by searching for text
-
-Markup for rich export
-
-* Structural markup elements:: The basic structure as seen by the exporter
-* Images and tables:: Tables and Images will be included
-* Literal examples:: Source code examples with special formatting
-* Include files:: Include additional files into a document
-* Embedded LaTeX:: LaTeX can be freely used inside Org documents
-
-Structural markup elements
-
-* Document title:: Where the title is taken from
-* Headings and sections:: The document structure as seen by the exporter
-* Table of contents:: The if and where of the table of contents
-* Paragraphs:: Paragraphs
-* Emphasis and monospace:: Bold, italic, etc.
-* Comment lines:: What will *not* be exported
-
-Exporting
-
-* Export options:: Per-file export settings
-* The export dispatcher:: How to access exporter commands
-* ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding
-* HTML export:: Exporting to HTML
-* LaTeX and PDF export:: Exporting to La@TeX{}, and processing to PDF
-* DocBook export:: Exporting to DocBook
-* iCalendar export::
-
-Miscellaneous
-
-* Completion:: M-TAB knows what you need
-* Clean view:: Getting rid of leading stars in the outline
-* MobileOrg:: Org-mode on the iPhone
-
-@end detailmenu
-@end menu
-
-@node Introduction, Document Structure, Top, Top
-@chapter Introduction
-
-@menu
-* Preface:: Welcome
-* Installation:: How to install a downloaded version of Org
-* Activation:: How to activate Org for certain buffers
-* Feedback:: Bug reports, ideas, patches etc.
-@end menu
-
-@node Preface, Installation, Introduction, Introduction
-@section Preface
-
-Org is a mode for keeping notes, maintaining TODO lists, and doing project
-planning with a fast and effective plain-text system. It is also an
-authoring and publishing system.
-
-@i{This document is a much compressed derivative of the
-@uref{http://orgmode.org/index.html#sec-4_1, comprehensive Org-mode manual}.
-It contains all basic features and commands, along with important hints for
-customization. It is intended for beginners who would shy back from a 200
-page manual because of sheer size.}
-
-@node Installation, Activation, Preface, Introduction
-@section Installation
-
-@b{Important:} @i{If you are using a version of Org that is part of the Emacs
-distribution or an XEmacs package, please skip this section and go directly
-to @ref{Activation}.}
-
-If you have downloaded Org from the Web, either as a distribution @file{.zip}
-or @file{.tar} file, or as a Git archive, it is best to run it directly from
-the distribution directory. You need to add the @file{lisp} subdirectories
-to the Emacs load path. To do this, add the following line to @file{.emacs}:
-
-@smallexample
-(setq load-path (cons "~/path/to/orgdir/lisp" load-path))
-(setq load-path (cons "~/path/to/orgdir/contrib/lisp" load-path))
-@end smallexample
-
-@noindent For speed you should byte-compile the Lisp files with the shell
-command:
-
-@smallexample
-make
-@end smallexample
-
-Then add the following line to @file{.emacs}. It is needed so that
-Emacs can autoload functions that are located in files not immediately loaded
-when Org-mode starts.
-@smalllisp
-(require 'org-install)
-@end smalllisp
-
-@node Activation, Feedback, Installation, Introduction
-@section Activation
-
-Add the following lines to your @file{.emacs} file. The last three lines
-define @emph{global} keys for some commands --- please choose suitable keys
-yourself.
-
-@smalllisp
-;; The following lines are always needed. Choose your own keys.
-(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
-(add-hook 'org-mode-hook 'turn-on-font-lock) ; not needed when global-font-lock-mode is on
-(global-set-key "\C-cl" 'org-store-link)
-(global-set-key "\C-ca" 'org-agenda)
-(global-set-key "\C-cb" 'org-iswitchb)
-@end smalllisp
-
-With this setup, all files with extension @samp{.org} will be put
-into Org mode.
-
-@node Feedback, , Activation, Introduction
-@section Feedback
-
-If you find problems with Org, or if you have questions, remarks, or ideas
-about it, please mail to the Org mailing list @email{emacs-orgmode@@gnu.org}.
-For information on how to submit bug reports, see the main manual.
-
-@node Document Structure, Tables, Introduction, Top
-@chapter Document Structure
-
-Org is based on Outline mode and provides flexible commands to
-edit the structure of the document.
-
-@menu
-* Outlines:: Org is based on Outline mode
-* Headlines:: How to typeset Org tree headlines
-* Visibility cycling:: Show and hide, much simplified
-* Motion:: Jumping to other headlines
-* Structure editing:: Changing sequence and level of headlines
-* Sparse trees:: Matches embedded in context
-* Plain lists:: Additional structure within an entry
-* Footnotes:: How footnotes are defined in Org's syntax
-@end menu
-
-@node Outlines, Headlines, Document Structure, Document Structure
-@section Outlines
-
-Org is implemented on top of Outline mode. Outlines allow a
-document to be organized in a hierarchical structure, which (at least
-for me) is the best representation of notes and thoughts. An overview
-of this structure is achieved by folding (hiding) large parts of the
-document to show only the general document structure and the parts
-currently being worked on. Org greatly simplifies the use of
-outlines by compressing the entire show/hide functionality into a single
-command, @command{org-cycle}, which is bound to the @key{TAB} key.
-
-@node Headlines, Visibility cycling, Outlines, Document Structure
-@section Headlines
-
-Headlines define the structure of an outline tree. The headlines in
-Org start with one or more stars, on the left margin@footnote{See
-the variable @code{org-special-ctrl-a/e} to configure special behavior
-of @kbd{C-a} and @kbd{C-e} in headlines.}. For example:
-
-@smallexample
-* Top level headline
-** Second level
-*** 3rd level
- some text
-*** 3rd level
- more text
-
-* Another top level headline
-@end smallexample
-
-@noindent Some people find the many stars too noisy and would prefer an
-outline that has whitespace followed by a single star as headline
-starters. @ref{Clean view}, describes a setup to realize this.
-
-@node Visibility cycling, Motion, Headlines, Document Structure
-@section Visibility cycling
-
-Outlines make it possible to hide parts of the text in the buffer.
-Org uses just two commands, bound to @key{TAB} and
-@kbd{S-@key{TAB}} to change the visibility in the buffer.
-
-@table @kbd
-@item @key{TAB}
-@emph{Subtree cycling}: Rotate current subtree among the states
-
-@smallexample
-,-> FOLDED -> CHILDREN -> SUBTREE --.
-'-----------------------------------'
-@end smallexample
-
-When called with a prefix argument (@kbd{C-u @key{TAB}}) or with the shift
-key, global cycling is invoked.
-
-@item S-@key{TAB} @r{and} C-u @key{TAB}
-@emph{Global cycling}: Rotate the entire buffer among the states
-
-@smallexample
-,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
-'--------------------------------------'
-@end smallexample
-
-@item C-u C-u C-u @key{TAB}
-Show all, including drawers.
-@end table
-
-When Emacs first visits an Org file, the global state is set to
-OVERVIEW, i.e. only the top level headlines are visible. This can be
-configured through the variable @code{org-startup-folded}, or on a
-per-file basis by adding a startup keyword @code{overview}, @code{content},
-@code{showall}, like this:
-
-@smallexample
-#+STARTUP: content
-@end smallexample
-
-
-@node Motion, Structure editing, Visibility cycling, Document Structure
-@section Motion
-The following commands jump to other headlines in the buffer.
-
-@table @kbd
-@item C-c C-n
-Next heading.
-@item C-c C-p
-Previous heading.
-@item C-c C-f
-Next heading same level.
-@item C-c C-b
-Previous heading same level.
-@item C-c C-u
-Backward to higher level heading.
-@end table
-
-@node Structure editing, Sparse trees, Motion, Document Structure
-@section Structure editing
-
-@table @kbd
-@item M-@key{RET}
-Insert new heading with same level as current. If the cursor is in a plain
-list item, a new item is created (@pxref{Plain lists}). When this command is
-used in the middle of a line, the line is split and the rest of the line
-becomes the new headline@footnote{If you do not want the line to be split,
-customize the variable @code{org-M-RET-may-split-line}.}.
-@item M-S-@key{RET}
-Insert new TODO entry with same level as current heading.
-@item @key{TAB} @r{in new, empty entry}
-In a new entry with no text yet, @key{TAB} will cycle through reasonable
-levels.
-@item M-@key{left}@r{/}@key{right}
-Promote/demote current heading by one level.
-@item M-S-@key{left}@r{/}@key{right}
-Promote/demote the current subtree by one level.
-@item M-S-@key{up}@r{/}@key{down}
-Move subtree up/down (swap with previous/next subtree of same
-level).
-@item C-c C-w
-Refile entry or region to a different location. @xref{Refiling notes}.
-@item C-x n s/w
-Narrow buffer to current subtree / widen it again
-@end table
-
-When there is an active region (Transient Mark mode), promotion and
-demotion work on all headlines in the region.
-
-@node Sparse trees, Plain lists, Structure editing, Document Structure
-@section Sparse trees
-
-An important feature of Org mode is the ability to construct @emph{sparse
-trees} for selected information in an outline tree, so that the entire
-document is folded as much as possible, but the selected information is made
-visible along with the headline structure above it@footnote{See also the
-variables @code{org-show-hierarchy-above}, @code{org-show-following-heading},
-@code{org-show-siblings}, and @code{org-show-entry-below} for detailed
-control on how much context is shown around each match.}. Just try it out
-and you will see immediately how it works.
-
-Org mode contains several commands creating such trees, all these
-commands can be accessed through a dispatcher:
-
-@table @kbd
-@item C-c /
-This prompts for an extra key to select a sparse-tree creating command.
-@item C-c / r
-Occur. Prompts for a regexp and shows a sparse tree with all matches. Each
-match is also highlighted; the highlights disappear by pressing @kbd{C-c C-c}.
-@end table
-
-The other sparse tree commands select headings based on TODO keywords,
-tags, or properties and will be discussed later in this manual.
-
-@node Plain lists, Footnotes, Sparse trees, Document Structure
-@section Plain lists
-
-Within an entry of the outline tree, hand-formatted lists can provide
-additional structure. They also provide a way to create lists of
-checkboxes (@pxref{Checkboxes}). Org supports editing such lists,
-and the HTML exporter (@pxref{Exporting}) parses and formats them.
-
-Org knows ordered lists, unordered lists, and description lists.
-@itemize @bullet
-@item
-@emph{Unordered} list items start with @samp{-}, @samp{+}, or
-@samp{*} as bullets.
-@item
-@emph{Ordered} list items start with @samp{1.} or @samp{1)}.
-@item
-@emph{Description} list use @samp{ :: } to separate the @emph{term} from the
-description.
-@end itemize
-
-Items belonging to the same list must have the same indentation on the first
-line. A list ends before the next line that is indented like the
-bullet/number, or less. It also ends before two blank lines. An example:
-
-@smallexample
-@group
-** Lord of the Rings
- My favorite scenes are (in this order)
- 1. The attack of the Rohirrim
- 2. Eowyn's fight with the witch king
- + this was already my favorite scene in the book
- + I really like Miranda Otto.
- Important actors in this film are:
- - @b{Elijah Wood} :: He plays Frodo
- - @b{Sean Austin} :: He plays Sam, Frodo's friend.
-@end group
-@end smallexample
-
-The following commands act on items when the cursor is in the first line of
-an item (the line with the bullet or number).
-
-@table @kbd
-@item @key{TAB}
-Items can be folded just like headline levels.
-@item M-@key{RET}
-Insert new item at current level. With a prefix argument, force a new
-heading (@pxref{Structure editing}).
-@item M-S-@key{RET}
-Insert a new item with a checkbox (@pxref{Checkboxes}).
-@item M-S-@key{up}@r{/}@key{down}
-Move the item including subitems up/down (swap with previous/next item
-of same indentation). If the list is ordered, renumbering is
-automatic.
-@item M-@key{left}@r{/}M-@key{right}
-Decrease/increase the indentation of an item, leaving children alone.
-@item M-S-@key{left}@r{/}@key{right}
-Decrease/increase the indentation of the item, including subitems.
-@item C-c C-c
-If there is a checkbox (@pxref{Checkboxes}) in the item line, toggle the
-state of the checkbox. Also make sure all items have the same bullet type
-and renumber ordered lists.
-@item C-c -
-Cycle the entire list level through the different itemize/enumerate bullets
-(@samp{-}, @samp{+}, @samp{*}, @samp{1.}, @samp{1)}).
-@end table
-
-@node Footnotes, , Plain lists, Document Structure
-@section Footnotes
-
-A footnote is defined in a paragraph that is started by a footnote marker in
-square brackets in column 0, no indentation allowed. The footnote reference
-is simply the marker in square brackets, inside text. For example:
-
-@smallexample
-The Org homepage[fn:1] now looks a lot better than it used to.
-...
-[fn:1] The link is: http://orgmode.org
-@end smallexample
-
-@noindent The following commands handle footnotes:
-
-@table @kbd
-@item C-c C-x f
-The footnote action command. When the cursor is on a footnote reference,
-jump to the definition. When it is at a definition, jump to the (first)
-reference. Otherwise, create a new footnote. When this command is called
-with a prefix argument, a menu of additional options including renumbering is
-offered.
-
-@item C-c C-c
-Jump between definition and reference.
-@end table
-
-@seealso{
-@uref{http://orgmode.org/manual/Document-Structure.html#Document-Structure,
-Chapter 2 of the manual}@*
-@uref{http://sachachua.com/wp/2008/01/outlining-your-notes-with-org/,
-Sacha Chua's tutorial}}
-
-
-@node Tables, Hyperlinks, Document Structure, Top
-@chapter Tables
-
-Org comes with a fast and intuitive table editor. Spreadsheet-like
-calculations are supported in connection with the Emacs @file{calc}
-package
-@ifinfo
-(@pxref{Top,Calc,,Calc,Gnu Emacs Calculator Manual}).
-@end ifinfo
-@ifnotinfo
-(see the Emacs Calculator manual for more information about the Emacs
-calculator).
-@end ifnotinfo
-
-Org makes it easy to format tables in plain ASCII. Any line with
-@samp{|} as the first non-whitespace character is considered part of a
-table. @samp{|} is also the column separator. A table might look like
-this:
-
-@smallexample
-| Name | Phone | Age |
-|-------+-------+-----|
-| Peter | 1234 | 17 |
-| Anna | 4321 | 25 |
-@end smallexample
-
-A table is re-aligned automatically each time you press @key{TAB} or
-@key{RET} or @kbd{C-c C-c} inside the table. @key{TAB} also moves to
-the next field (@key{RET} to the next row) and creates new table rows
-at the end of the table or before horizontal lines. The indentation
-of the table is set by the first line. Any line starting with
-@samp{|-} is considered as a horizontal separator line and will be
-expanded on the next re-align to span the whole table width. So, to
-create the above table, you would only type
-
-@smallexample
-|Name|Phone|Age|
-|-
-@end smallexample
-
-@noindent and then press @key{TAB} to align the table and start filling in
-fields. Even faster would be to type @code{|Name|Phone|Age} followed by
-@kbd{C-c @key{RET}}.
-
-When typing text into a field, Org treats @key{DEL},
-@key{Backspace}, and all character keys in a special way, so that
-inserting and deleting avoids shifting other fields. Also, when
-typing @emph{immediately after the cursor was moved into a new field
-with @kbd{@key{TAB}}, @kbd{S-@key{TAB}} or @kbd{@key{RET}}}, the
-field is automatically made blank.
-
-@table @kbd
-@tsubheading{Creation and conversion}
-@item C-c |
-Convert the active region to table. If every line contains at least one
-TAB character, the function assumes that the material is tab separated.
-If every line contains a comma, comma-separated values (CSV) are assumed.
-If not, lines are split at whitespace into fields.
-@*
-If there is no active region, this command creates an empty Org
-table. But it's easier just to start typing, like
-@kbd{|Name|Phone|Age C-c @key{RET}}.
-
-@tsubheading{Re-aligning and field motion}
-@item C-c C-c
-Re-align the table without moving the cursor.
-@c
-@item @key{TAB}
-Re-align the table, move to the next field. Creates a new row if
-necessary.
-@c
-@item S-@key{TAB}
-Re-align, move to previous field.
-@c
-@item @key{RET}
-Re-align the table and move down to next row. Creates a new row if
-necessary.
-
-@tsubheading{Column and row editing}
-@item M-@key{left}
-@itemx M-@key{right}
-Move the current column left/right.
-@c
-@item M-S-@key{left}
-Kill the current column.
-@c
-@item M-S-@key{right}
-Insert a new column to the left of the cursor position.
-@c
-@item M-@key{up}
-@itemx M-@key{down}
-Move the current row up/down.
-@c
-@item M-S-@key{up}
-Kill the current row or horizontal line.
-@c
-@item M-S-@key{down}
-Insert a new row above the current row. With a prefix argument, the line is
-created below the current one.
-@c
-@item C-c -
-Insert a horizontal line below current row. With a prefix argument, the line
-is created above the current line.
-@c
-@item C-c @key{RET}
-Insert a horizontal line below current row, and move the cursor into the row
-below that line.
-@c
-@item C-c ^
-Sort the table lines in the region. The position of point indicates the
-column to be used for sorting, and the range of lines is the range
-between the nearest horizontal separator lines, or the entire table.
-
-@end table
-
-@seealso{
-@uref{http://orgmode.org/manual/Tables.html#Tables, Chapter 3 of the
-manual}@*
-@uref{http://orgmode.org/worg/org-tutorials/tables.php, Bastien's
-table tutorial}@*
-@uref{http://orgmode.org/worg/org-tutorials/org-spreadsheet-intro.php,
-Bastien's spreadsheet tutorial}@*
-@uref{http://orgmode.org/worg/org-tutorials/org-plot.php, Eric's plotting tutorial}}
-
-@node Hyperlinks, TODO Items, Tables, Top
-@chapter Hyperlinks
-
-Like HTML, Org provides links inside a file, external links to
-other files, Usenet articles, emails, and much more.
-
-@menu
-* Link format:: How links in Org are formatted
-* Internal links:: Links to other places in the current file
-* External links:: URL-like links to the world
-* Handling links:: Creating, inserting and following
-* Targeted links:: Point at a location in a file
-@end menu
-
-@node Link format, Internal links, Hyperlinks, Hyperlinks
-@section Link format
-
-Org will recognize plain URL-like links and activate them as
-clickable links. The general link format, however, looks like this:
-
-@smallexample
-[[link][description]] @r{or alternatively} [[link]]
-@end smallexample
-
-@noindent
-Once a link in the buffer is complete (all brackets present), Org will change
-the display so that @samp{description} is displayed instead of
-@samp{[[link][description]]} and @samp{link} is displayed instead of
-@samp{[[link]]}. To edit the invisible @samp{link} part, use @kbd{C-c
-C-l} with the cursor on the link.
-
-@node Internal links, External links, Link format, Hyperlinks
-@section Internal links
-
-If the link does not look like a URL, it is considered to be internal in the
-current file. The most important case is a link like
-@samp{[[#my-custom-id]]} which will link to the entry with the
-@code{CUSTOM_ID} property @samp{my-custom-id}.
-
-Links such as @samp{[[My Target]]} or @samp{[[My Target][Find my target]]}
-lead to a text search in the current file for the corresponding target which
-looks like @samp{<<My Target>>}.
-
-@node External links, Handling links, Internal links, Hyperlinks
-@section External links
-
-Org supports links to files, websites, Usenet and email messages,
-BBDB database entries and links to both IRC conversations and their
-logs. External links are URL-like locators. They start with a short
-identifying string followed by a colon. There can be no space after
-the colon. Here are some examples:
-
-@smallexample
-http://www.astro.uva.nl/~dominik @r{on the web}
-file:/home/dominik/images/jupiter.jpg @r{file, absolute path}
-/home/dominik/images/jupiter.jpg @r{same as above}
-file:papers/last.pdf @r{file, relative path}
-file:projects.org @r{another Org file}
-docview:papers/last.pdf::NNN @r{open file in doc-view mode at page NNN}
-id:B7423F4D-2E8A-471B-8810-C40F074717E9 @r{Link to heading by ID}
-news:comp.emacs @r{Usenet link}
-mailto:adent@@galaxy.net @r{Mail link}
-vm:folder @r{VM folder link}
-vm:folder#id @r{VM message link}
-wl:folder#id @r{WANDERLUST message link}
-mhe:folder#id @r{MH-E message link}
-rmail:folder#id @r{RMAIL message link}
-gnus:group#id @r{Gnus article link}
-bbdb:R.*Stallman @r{BBDB link (with regexp)}
-irc:/irc.com/#emacs/bob @r{IRC link}
-info:org:External%20links @r{Info node link (with encoded space)}
-@end smallexample
-
-A link should be enclosed in double brackets and may contain a
-descriptive text to be displayed instead of the URL (@pxref{Link
-format}), for example:
-
-@smallexample
-[[http://www.gnu.org/software/emacs/][GNU Emacs]]
-@end smallexample
-
-@noindent
-If the description is a file name or URL that points to an image, HTML export
-(@pxref{HTML export}) will inline the image as a clickable button. If there
-is no description at all and the link points to an image, that image will be
-inlined into the exported HTML file.
-
-@node Handling links, Targeted links, External links, Hyperlinks
-@section Handling links
-
-Org provides methods to create a link in the correct syntax, to
-insert it into an Org file, and to follow the link.
-
-@table @kbd
-@item C-c l
-Store a link to the current location. This is a @emph{global} command (you
-must create the key binding yourself) which can be used in any buffer to
-create a link. The link will be stored for later insertion into an Org
-buffer (see below).
-@c
-@item C-c C-l
-Insert a link. This prompts for a link to be inserted into the buffer. You
-can just type a link, or use history keys @key{up} and @key{down} to access
-stored links. You will be prompted for the description part of the link.
-When called with a @kbd{C-u} prefix argument, file name completion is used to
-link to a file.
-@c
-@item C-c C-l @r{(with cursor on existing link)}
-When the cursor is on an existing link, @kbd{C-c C-l} allows you to edit the
-link and description parts of the link.
-@c
-@item C-c C-o @r{or} mouse-1 @r{or} mouse-2
-Open link at point.
-@item C-c &
-Jump back to a recorded position. A position is recorded by the
-commands following internal links, and by @kbd{C-c %}. Using this
-command several times in direct succession moves through a ring of
-previously recorded positions.
-@c
-@end table
-
-@node Targeted links, , Handling links, Hyperlinks
-@section Targeted links
-
-File links can contain additional information to make Emacs jump to a
-particular location in the file when following a link. This can be a
-line number or a search option after a double colon.
-
-Here is the syntax of the different ways to attach a search to a file
-link, together with an explanation:
-
-@smallexample
-[[file:~/code/main.c::255]] @r{Find line 255}
-[[file:~/xx.org::My Target]] @r{Find @samp{<<My Target>>}}
-[[file:~/xx.org::#my-custom-id]] @r{Find entry with custom id}
-@end smallexample
-
-@seealso{
-@uref{http://orgmode.org/manual/Hyperlinks.html#Hyperlinks, Chapter 4 of the
-manual}}
-
-@node TODO Items, Tags, Hyperlinks, Top
-@chapter TODO Items
-
-Org mode does not maintain TODO lists as separate documents@footnote{Of
-course, you can make a document that contains only long lists of TODO items,
-but this is not required.}. Instead, TODO items are an integral part of the
-notes file, because TODO items usually come up while taking notes! With Org
-mode, simply mark any entry in a tree as being a TODO item. In this way,
-information is not duplicated, and the entire context from which the TODO
-item emerged is always present.
-
-Of course, this technique for managing TODO items scatters them
-throughout your notes file. Org mode compensates for this by providing
-methods to give you an overview of all the things that you have to do.
-
-@menu
-* Using TODO states:: Setting and switching states
-* Multi-state workflows:: More than just on/off
-* Progress logging:: Dates and notes for progress
-* Priorities:: Some things are more important than others
-* Breaking down tasks:: Splitting a task into manageable pieces
-* Checkboxes:: Tick-off lists
-@end menu
-
-@node Using TODO states, Multi-state workflows, TODO Items, TODO Items
-@section Using TODO states
-
-Any headline becomes a TODO item when it starts with the word
-@samp{TODO}, for example:
-
-@smallexample
-*** TODO Write letter to Sam Fortune
-@end smallexample
-
-@noindent
-The most important commands to work with TODO entries are:
-
-@table @kbd
-@item C-c C-t
-Rotate the TODO state of the current item among
-
-@smallexample
-,-> (unmarked) -> TODO -> DONE --.
-'--------------------------------'
-@end smallexample
-
-The same rotation can also be done ``remotely'' from the timeline and
-agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
-
-@item S-@key{right}@r{/}@key{left}
-Select the following/preceding TODO state, similar to cycling.
-@item C-c / t
-View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}). Folds the
-buffer, but shows all TODO items and the headings hierarchy above
-them.
-@item C-c a t
-Show the global TODO list. Collects the TODO items from all agenda files
-(@pxref{Agenda Views}) into a single buffer. @xref{Global TODO list}, for
-more information.
-@item S-M-@key{RET}
-Insert a new TODO entry below the current one.
-@end table
-
-@noindent
-Changing a TODO state can also trigger tag changes. See the docstring of the
-option @code{org-todo-state-tags-triggers} for details.
-
-@node Multi-state workflows, Progress logging, Using TODO states, TODO Items
-@section Multi-state workflows
-
-You can use TODO keywords to indicate different @emph{sequential} states
-in the process of working on an item, for example:
-
-@smalllisp
-(setq org-todo-keywords
- '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
-@end smalllisp
-
-The vertical bar separates the TODO keywords (states that @emph{need
-action}) from the DONE states (which need @emph{no further action}). If
-you don't provide the separator bar, the last state is used as the DONE
-state.
-With this setup, the command @kbd{C-c C-t} will cycle an entry from TODO
-to FEEDBACK, then to VERIFY, and finally to DONE and DELEGATED.
-
-Sometimes you may want to use different sets of TODO keywords in
-parallel. For example, you may want to have the basic
-@code{TODO}/@code{DONE}, but also a workflow for bug fixing, and a
-separate state indicating that an item has been canceled (so it is not
-DONE, but also does not require action). Your setup would then look
-like this:
-
-@smalllisp
-(setq org-todo-keywords
- '((sequence "TODO(t)" "|" "DONE(d)")
- (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")
- (sequence "|" "CANCELED(c)")))
-@end smalllisp
-
-The keywords should all be different, this helps Org mode to keep track of
-which subsequence should be used for a given entry. The example also shows
-how to define keys for fast access of a particular state, by adding a letter
-in parenthesis after each keyword - you will be prompted for the key after
-@kbd{C-c C-t}.
-
-To define TODO keywords that are valid only in a single file, use the
-following text anywhere in the file.
-
-@smallexample
-#+TODO: TODO(t) | DONE(d)
-#+TODO: REPORT(r) BUG(b) KNOWNCAUSE(k) | FIXED(f)
-#+TODO: | CANCELED(c)
-@end smallexample
-
-After changing one of these lines, use @kbd{C-c C-c} with the cursor still in
-the line to make the changes known to Org mode.
-
-@node Progress logging, Priorities, Multi-state workflows, TODO Items
-@section Progress logging
-
-Org mode can automatically record a timestamp and possibly a note when
-you mark a TODO item as DONE, or even each time you change the state of
-a TODO item. This system is highly configurable, settings can be on a
-per-keyword basis and can be localized to a file or even a subtree. For
-information on how to clock working time for a task, see @ref{Clocking
-work time}.
-
-@menu
-* Closing items:: When was this entry marked DONE?
-* Tracking TODO state changes:: When did the status change?
-@end menu
-
-@node Closing items, Tracking TODO state changes, Progress logging, Progress logging
-@unnumberedsubsec Closing items
-
-The most basic logging is to keep track of @emph{when} a certain TODO
-item was finished. This is achieved with@footnote{The corresponding
-in-buffer setting is: @code{#+STARTUP: logdone}}.
-
-@smalllisp
-(setq org-log-done 'time)
-@end smalllisp
-
-@noindent
-Then each time you turn an entry from a TODO (not-done) state into any of the
-DONE states, a line @samp{CLOSED: [timestamp]} will be inserted just after
-the headline. If you want to record a note along with the timestamp,
-use@footnote{The corresponding in-buffer setting is: @code{#+STARTUP:
-lognotedone}}
-
-@smalllisp
-(setq org-log-done 'note)
-@end smalllisp
-
-@noindent
-You will then be prompted for a note, and that note will be stored below
-the entry with a @samp{Closing Note} heading.
-
-@node Tracking TODO state changes, , Closing items, Progress logging
-@unnumberedsubsec Tracking TODO state changes
-
-You might want to keep track of TODO state changes. You can either record
-just a timestamp, or a time-stamped note for a change. These records will be
-inserted after the headline as an itemized list. When taking a lot of notes,
-you might want to get the notes out of the way into a drawer. Customize the
-variable @code{org-log-into-drawer} to get this behavior.
-
-For state logging, Org mode expects configuration on a per-keyword basis.
-This is achieved by adding special markers @samp{!} (for a timestamp) and
-@samp{@@} (for a note) in parentheses after each keyword. For example:
-@smallexample
-#+TODO: TODO(t) WAIT(w@@/!) | DONE(d!) CANCELED(c@@)
-@end smallexample
-@noindent
-will define TODO keywords and fast access keys, and also request that a time
-is recorded when the entry is set to DONE, and that a note is recorded when
-switching to WAIT or CANCELED. The same syntax works also when setting
-@code{org-todo-keywords}.
-
-@node Priorities, Breaking down tasks, Progress logging, TODO Items
-@section Priorities
-
-If you use Org mode extensively, you may end up with enough TODO items that
-it starts to make sense to prioritize them. Prioritizing can be done by
-placing a @emph{priority cookie} into the headline of a TODO item, like this
-
-@smallexample
-*** TODO [#A] Write letter to Sam Fortune
-@end smallexample
-
-@noindent
-Org mode supports three priorities: @samp{A}, @samp{B}, and @samp{C}.
-@samp{A} is the highest, @samp{B} the default if none is given. Priorities
-make a difference only in the agenda.
-
-@table @kbd
-@item @kbd{C-c ,}
-Set the priority of the current headline. Press @samp{A}, @samp{B} or
-@samp{C} to select a priority, or @key{SPC} to remove the cookie.
-@c
-@item S-@key{up}
-@itemx S-@key{down}
-Increase/decrease priority of current headline
-@end table
-
-@node Breaking down tasks, Checkboxes, Priorities, TODO Items
-@section Breaking tasks down into subtasks
-
-It is often advisable to break down large tasks into smaller, manageable
-subtasks. You can do this by creating an outline tree below a TODO item,
-with detailed subtasks on the tree. To keep the overview over the fraction
-of subtasks that are already completed, insert either @samp{[/]} or
-@samp{[%]} anywhere in the headline. These cookies will be updated each time
-the TODO status of a child changes, or when pressing @kbd{C-c C-c} on the
-cookie. For example:
-
-@smallexample
-* Organize Party [33%]
-** TODO Call people [1/2]
-*** TODO Peter
-*** DONE Sarah
-** TODO Buy food
-** DONE Talk to neighbor
-@end smallexample
-
-@node Checkboxes, , Breaking down tasks, TODO Items
-@section Checkboxes
-
-Every item in a plain list (@pxref{Plain lists}) can be made into a checkbox
-by starting it with the string @samp{[ ]}. Checkboxes are not included into
-the global TODO list, so they are often great to split a task into a number
-of simple steps.
-Here is an example of a checkbox list.
-
-@smallexample
-* TODO Organize party [1/3]
- - [-] call people [1/2]
- - [ ] Peter
- - [X] Sarah
- - [X] order food
- - [ ] think about what music to play
-@end smallexample
-
-Checkboxes work hierarchically, so if a checkbox item has children that
-are checkboxes, toggling one of the children checkboxes will make the
-parent checkbox reflect if none, some, or all of the children are
-checked.
-
-@noindent The following commands work with checkboxes:
-
-@table @kbd
-@item C-c C-c
-Toggle checkbox status or (with prefix arg) checkbox presence at point.
-@item M-S-@key{RET}
-Insert a new item with a checkbox.
-This works only if the cursor is already in a plain list item
-(@pxref{Plain lists}).
-@end table
-
-@seealso{
-@uref{http://orgmode.org/manual/TODO-Items.html#TODO-Items, Chapter 5 of the manual}@*
-@uref{http://orgmode.org/worg/org-tutorials/orgtutorial_dto.php, David
-O'Toole's introductory tutorial}@*
-@uref{http://members.optusnet.com.au/~charles57/GTD/gtd_workflow.html,
-Charles Cave's GTD setup}}
-
-@node Tags, Properties, TODO Items, Top
-@chapter Tags
-
-An excellent way to implement labels and contexts for cross-correlating
-information is to assign @i{tags} to headlines. Org mode has extensive
-support for tags.
-
-Every headline can contain a list of tags; they occur at the end of the
-headline. Tags are normal words containing letters, numbers, @samp{_}, and
-@samp{@@}. Tags must be preceded and followed by a single colon, e.g.,
-@samp{:work:}. Several tags can be specified, as in @samp{:work:urgent:}.
-Tags will by default be in bold face with the same color as the headline.
-
-@menu
-* Tag inheritance:: Tags use the tree structure of the outline
-* Setting tags:: How to assign tags to a headline
-* Tag searches:: Searching for combinations of tags
-@end menu
-
-@node Tag inheritance, Setting tags, Tags, Tags
-@section Tag inheritance
-
-@i{Tags} make use of the hierarchical structure of outline trees. If a
-heading has a certain tag, all subheadings will inherit the tag as
-well. For example, in the list
-
-@smallexample
-* Meeting with the French group :work:
-** Summary by Frank :boss:notes:
-*** TODO Prepare slides for him :action:
-@end smallexample
-
-@noindent
-the final heading will have the tags @samp{:work:}, @samp{:boss:},
-@samp{:notes:}, and @samp{:action:} even though the final heading is not
-explicitly marked with those tags. You can also set tags that all entries in
-a file should inherit just as if these tags were defined in a hypothetical
-level zero that surrounds the entire file. Use a line like this@footnote{As
-with all these in-buffer settings, pressing @kbd{C-c C-c} activates any
-changes in the line.}:
-
-@smallexample
-#+FILETAGS: :Peter:Boss:Secret:
-@end smallexample
-
-@node Setting tags, Tag searches, Tag inheritance, Tags
-@section Setting tags
-
-Tags can simply be typed into the buffer at the end of a headline.
-After a colon, @kbd{M-@key{TAB}} offers completion on tags. There is
-also a special command for inserting tags:
-
-@table @kbd
-@item C-c C-q
-Enter new tags for the current headline. Org mode will either offer
-completion or a special single-key interface for setting tags, see
-below. After pressing @key{RET}, the tags will be inserted and aligned
-to @code{org-tags-column}. When called with a @kbd{C-u} prefix, all
-tags in the current buffer will be aligned to that column, just to make
-things look nice.
-@item C-c C-c
-When the cursor is in a headline, this does the same as @kbd{C-c C-q}.
-@end table
-
-Org will support tag insertion based on a @emph{list of tags}. By
-default this list is constructed dynamically, containing all tags
-currently used in the buffer. You may also globally specify a hard list
-of tags with the variable @code{org-tag-alist}. Finally you can set
-the default tags for a given file with lines like
-
-@smallexample
-#+TAGS: @@work @@home @@tennisclub
-#+TAGS: laptop car pc sailboat
-@end smallexample
-
-By default Org mode uses the standard minibuffer completion facilities for
-entering tags. However, it also implements another, quicker, tag selection
-method called @emph{fast tag selection}. This allows you to select and
-deselect tags with just a single key press. For this to work well you should
-assign unique letters to most of your commonly used tags. You can do this
-globally by configuring the variable @code{org-tag-alist} in your
-@file{.emacs} file. For example, you may find the need to tag many items in
-different files with @samp{:@@home:}. In this case you can set something
-like:
-
-@smalllisp
-(setq org-tag-alist '(("@@work" . ?w) ("@@home" . ?h) ("laptop" . ?l)))
-@end smalllisp
-
-@noindent If the tag is only relevant to the file you are working on, then you
-can instead set the TAGS option line as:
-
-@smallexample
-#+TAGS: @@work(w) @@home(h) @@tennisclub(t) laptop(l) pc(p)
-@end smallexample
-
-@node Tag searches, , Setting tags, Tags
-@section Tag searches
-
-Once a system of tags has been set up, it can be used to collect related
-information into special lists.
-
-@table @kbd
-@item C-c \
-@itemx C-c / m
-Create a sparse tree with all headlines matching a tags search. With a
-@kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
-@item C-c a m
-Create a global list of tag matches from all agenda files.
-@xref{Matching tags and properties}.
-@item C-c a M
-Create a global list of tag matches from all agenda files, but check
-only TODO items and force checking subitems (see variable
-@code{org-tags-match-list-sublevels}).
-@end table
-
-These commands all prompt for a match string which allows basic Boolean logic
-like @samp{+boss+urgent-project1}, to find entries with tags @samp{boss} and
-@samp{urgent}, but not @samp{project1}, or @samp{Kathy|Sally} to find entries
-which are tagged, like @samp{Kathy} or @samp{Sally}. The full syntax of the
-search string is rich and allows also matching against TODO keywords, entry
-levels and properties. For a complete description with many examples, see
-@ref{Matching tags and properties}.
-
-@seealso{
-@uref{http://orgmode.org/manual/Tags.html#Tags, Chapter 6 of the manual}@*
-@uref{http://sachachua.com/wp/2008/01/tagging-in-org-plus-bonus-code-for-timeclocks-and-tags/,
-Sacha Chua's article about tagging in Org-mode}}
-
-@node Properties, Dates and Times, Tags, Top
-@chapter Properties
-
-Properties are key-value pairs associates with and entry. They live in a
-special drawer with the name @code{PROPERTIES}. Each
-property is specified on a single line, with the key (surrounded by colons)
-first, and the value after it:
-
-@smallexample
-* CD collection
-** Classic
-*** Goldberg Variations
- :PROPERTIES:
- :Title: Goldberg Variations
- :Composer: J.S. Bach
- :Publisher: Deutsche Grammophon
- :NDisks: 1
- :END:
-@end smallexample
-
-You may define the allowed values for a particular property @samp{:Xyz:}
-by setting a property @samp{:Xyz_ALL:}. This special property is
-@emph{inherited}, so if you set it in a level 1 entry, it will apply to
-the entire tree. When allowed values are defined, setting the
-corresponding property becomes easier and is less prone to typing
-errors. For the example with the CD collection, we can predefine
-publishers and the number of disks in a box like this:
-
-@smallexample
-* CD collection
- :PROPERTIES:
- :NDisks_ALL: 1 2 3 4
- :Publisher_ALL: "Deutsche Grammophon" Philips EMI
- :END:
-@end smallexample
-or globally using @code{org-global-properties}, or file-wide like this:
-@smallexample
-#+PROPERTY: NDisks_ALL 1 2 3 4
-@end smallexample
-
-@table @kbd
-@item C-c C-x p
-Set a property. This prompts for a property name and a value.
-@item C-c C-c d
-Remove a property from the current entry.
-@end table
-
-To create sparse trees and special lists with selection based on properties,
-the same commands are used as for tag searches (@pxref{Tag searches}). The
-syntax for the search string is described in @ref{Matching tags and
-properties}.
-
-@table @kbd
-@end table
-
-@seealso{
-@uref{http://orgmode.org/manual/Properties-and-Columns.html#Properties-and-Columns,
-Chapter 7 of the manual}@*
-@uref{http://orgmode.org/worg/org-tutorials/org-column-view-tutorial.php,Bastien
-Guerry's column view tutorial}}
-
-@node Dates and Times, Capture - Refile - Archive, Properties, Top
-@chapter Dates and Times
-
-To assist project planning, TODO items can be labeled with a date and/or
-a time. The specially formatted string carrying the date and time
-information is called a @emph{timestamp} in Org mode.
-
-@menu
-* Timestamps:: Assigning a time to a tree entry
-* Creating timestamps:: Commands which insert timestamps
-* Deadlines and scheduling:: Planning your work
-* Clocking work time:: Tracking how long you spend on a task
-@end menu
-
-
-@node Timestamps, Creating timestamps, Dates and Times, Dates and Times
-@section Timestamps
-
-A timestamp is a specification of a date (possibly with a time or a range of
-times) in a special format, either @samp{<2003-09-16 Tue>} or
-@samp{<2003-09-16 Tue 09:39>} or @samp{<2003-09-16 Tue 12:00-12:30>}. A
-timestamp can appear anywhere in the headline or body of an Org tree entry.
-Its presence causes entries to be shown on specific dates in the agenda
-(@pxref{Weekly/daily agenda}). We distinguish:
-
-@noindent @b{Plain timestamp; Event; Appointment}@*
-A simple timestamp just assigns a date/time to an item. This is just
-like writing down an appointment or event in a paper agenda.
-
-@smallexample
-* Meet Peter at the movies <2006-11-01 Wed 19:15>
-* Discussion on climate change <2006-11-02 Thu 20:00-22:00>
-@end smallexample
-
-@noindent @b{Timestamp with repeater interval}@*
-A timestamp may contain a @emph{repeater interval}, indicating that it
-applies not only on the given date, but again and again after a certain
-interval of N days (d), weeks (w), months (m), or years (y). The
-following will show up in the agenda every Wednesday:
-@smallexample
-* Pick up Sam at school <2007-05-16 Wed 12:30 +1w>
-@end smallexample
-
-@noindent @b{Diary-style sexp entries}@*
-For more complex date specifications, Org mode supports using the
-special sexp diary entries implemented in the Emacs calendar/diary
-package. For example
-@smallexample
-* The nerd meeting on every 2nd Thursday of the month
- <%%(diary-float t 4 2)>
-@end smallexample
-
-@noindent @b{Time/Date range}@*
-Two timestamps connected by @samp{--} denote a range.
-@smallexample
-** Meeting in Amsterdam
- <2004-08-23 Mon>--<2004-08-26 Thu>
-@end smallexample
-
-@noindent @b{Inactive timestamp}@*
-Just like a plain timestamp, but with square brackets instead of
-angular ones. These timestamps are inactive in the sense that they do
-@emph{not} trigger an entry to show up in the agenda.
-
-@smallexample
-* Gillian comes late for the fifth time [2006-11-01 Wed]
-@end smallexample
-
-
-@node Creating timestamps, Deadlines and scheduling, Timestamps, Dates and Times
-@section Creating timestamps
-
-For Org mode to recognize timestamps, they need to be in the specific
-format. All commands listed below produce timestamps in the correct
-format.
-
-@table @kbd
-@item C-c .
-Prompt for a date and insert a corresponding timestamp. When the cursor is
-at an existing timestamp in the buffer, the command is used to modify this
-timestamp instead of inserting a new one. When this command is used twice in
-succession, a time range is inserted. With a prefix, also add the current
-time.
-@c
-@item C-c !
-Like @kbd{C-c .}, but insert an inactive timestamp that will not cause
-an agenda entry.
-@c
-@item S-@key{left}@r{/}@key{right}
-Change date at cursor by one day.
-@c
-@item S-@key{up}@r{/}@key{down}
-Change the item under the cursor in a timestamp. The cursor can be on a
-year, month, day, hour or minute. When the timestamp contains a time range
-like @samp{15:30-16:30}, modifying the first time will also shift the second,
-shifting the time block with constant length. To change the length, modify
-the second time.
-@end table
-
-When Org mode prompts for a date/time, it will accept any string containing
-some date and/or time information, and intelligently interpret the string,
-deriving defaults for unspecified information from the current date and time.
-You can also select a date in the pop-up calendar. See the manual for more
-information on how exactly the date/time prompt works.
-
-@node Deadlines and scheduling, Clocking work time, Creating timestamps, Dates and Times
-@section Deadlines and scheduling
-
-A timestamp may be preceded by special keywords to facilitate planning:
-
-@noindent @b{DEADLINE}@*
-Meaning: the task (most likely a TODO item, though not necessarily) is supposed
-to be finished on that date.
-@table @kbd
-@item C-c C-d
-Insert @samp{DEADLINE} keyword along with a stamp, in the line following the
-headline.
-@end table
-
-On the deadline date, the task will be listed in the agenda. In
-addition, the agenda for @emph{today} will carry a warning about the
-approaching or missed deadline, starting
-@code{org-deadline-warning-days} before the due date, and continuing
-until the entry is marked DONE. An example:
-
-@smallexample
-*** TODO write article about the Earth for the Guide
- The editor in charge is [[bbdb:Ford Prefect]]
- DEADLINE: <2004-02-29 Sun>
-@end smallexample
-
-
-@noindent @b{SCHEDULED}@*
-Meaning: you are @i{planning to start working} on that task on the given
-date@footnote{This is quite different from what is normally understood by
-@i{scheduling a meeting}, which is done in Org-mode by just inserting a time
-stamp without keyword.}.
-
-@table @kbd
-@item C-c C-s
-Insert @samp{SCHEDULED} keyword along with a stamp, in the line following the
-headline.
-@end table
-
-The headline will be listed under the given date@footnote{It will still
-be listed on that date after it has been marked DONE. If you don't like
-this, set the variable @code{org-agenda-skip-scheduled-if-done}.}. In
-addition, a reminder that the scheduled date has passed will be present
-in the compilation for @emph{today}, until the entry is marked DONE.
-I.e. the task will automatically be forwarded until completed.
-
-@smallexample
-*** TODO Call Trillian for a date on New Years Eve.
- SCHEDULED: <2004-12-25 Sat>
-@end smallexample
-
-Some tasks need to be repeated again and again. Org mode helps to
-organize such tasks using a so-called repeater in a DEADLINE, SCHEDULED,
-or plain timestamp. In the following example
-@smallexample
-** TODO Pay the rent
- DEADLINE: <2005-10-01 Sat +1m>
-@end smallexample
-@noindent
-the @code{+1m} is a repeater; the intended interpretation is that the task
-has a deadline on <2005-10-01> and repeats itself every (one) month starting
-from that time.
-
-@node Clocking work time, , Deadlines and scheduling, Dates and Times
-@section Clocking work time
-
-Org mode allows you to clock the time you spend on specific tasks in a
-project.
-
-@table @kbd
-@item C-c C-x C-i
-Start the clock on the current item (clock-in). This inserts the CLOCK
-keyword together with a timestamp. When called with a @kbd{C-u} prefix
-argument, select the task from a list of recently clocked tasks.
-@c
-@item C-c C-x C-o
-Stop the clock (clock-out). This inserts another timestamp at the same
-location where the clock was last started. It also directly computes
-the resulting time in inserts it after the time range as @samp{=>
-HH:MM}.
-@item C-c C-x C-e
-Update the effort estimate for the current clock task.
-@item C-c C-x C-x
-Cancel the current clock. This is useful if a clock was started by
-mistake, or if you ended up working on something else.
-@item C-c C-x C-j
-Jump to the entry that contains the currently running clock. With a
-@kbd{C-u} prefix arg, select the target task from a list of recently clocked
-tasks.
-@item C-c C-x C-r
-Insert a dynamic block containing a clock
-report as an Org-mode table into the current file. When the cursor is
-at an existing clock table, just update it.
-@smallexample
-#+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file
-#+END: clocktable
-@end smallexample
-@noindent
-For details about how to customize this view, see @uref{http://orgmode.org/manual/Clocking-work-time.html#Clocking-work-time,the manual}.
-@item C-c C-c
-Update dynamic block at point. The cursor needs to be in the
-@code{#+BEGIN} line of the dynamic block.
-@end table
-
-The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
-the agenda (@pxref{Weekly/daily agenda}) to show which tasks have been
-worked on or closed during a day.
-
-@seealso{
-@uref{http://orgmode.org/manual/Dates-and-Times.html#Dates-and-Times,
-Chapter 8 of the manual}@*
-@uref{http://members.optusnet.com.au/~charles57/GTD/org_dates/, Charles
-Cave's Date and Time tutorial}@*
-@uref{http://doc.norang.ca/org-mode.html#Clocking, Bernt Hansen's clocking workflow}}
-
-@node Capture - Refile - Archive, Agenda Views, Dates and Times, Top
-@chapter Capture - Refile - Archive
-
-An important part of any organization system is the ability to quickly
-capture new ideas and tasks, and to associate reference material with them.
-Org defines a capture process to create tasks. It stores files related to a
-task (@i{attachments}) in a special directory. Once in the system, tasks and
-projects need to be moved around. Moving completed project trees to an
-archive file keeps the system compact and fast.
-
-@menu
-* Capture::
-* Refiling notes:: Moving a tree from one place to another
-* Archiving:: What to do with finished projects
-@end menu
-
-@node Capture, Refiling notes, Capture - Refile - Archive, Capture - Refile - Archive
-@section Capture
-
-Org's method for capturing new items is heavily inspired by John Wiegley
-excellent remember package. It lets you store quick notes with little
-interruption of your work flow. Org lets you define templates for new
-entries and associate them with different targets for storing notes.
-
-@menu
-* Setting up a capture location:: Where notes will be stored
-* Using capture:: Commands to invoke and terminate capture
-* Capture templates:: Define the outline of different note types
-@end menu
-
-@node Setting up a capture location, Using capture, Capture, Capture
-@unnumberedsubsec Setting up a capture location
-
-The following customization sets a default target@footnote{Using capture
-templates, you can define more fine-grained capture locations, see
-@ref{Capture templates}.} file for notes, and defines a global
-key@footnote{Please select your own key, @kbd{C-c c} is only a suggestion.}
-for capturing new stuff.
-
-@example
-(setq org-default-notes-file (concat org-directory "/notes.org"))
-(define-key global-map "\C-cc" 'org-capture)
-@end example
-
-@node Using capture, Capture templates, Setting up a capture location, Capture
-@unnumberedsubsec Using capture
-
-@table @kbd
-@item C-c c
-Start a capture process. You will be placed into a narrowed indirect buffer
-to edit the item.
-@item C-c C-c
-Once you are done entering information into the capture buffer,
-@kbd{C-c C-c} will return you to the window configuration before the capture
-process, so that you can resume your work without further distraction.
-@item C-c C-w
-Finalize by moving the entry to a refile location (@pxref{Refiling notes}).
-@item C-c C-k
-Abort the capture process and return to the previous state.
-@end table
-
-@node Capture templates, , Using capture, Capture
-@unnumberedsubsec Capture templates
-
-You can use templates to generate different types of capture notes, and to
-store them in different places. For example, if you would like
-to store new tasks under a heading @samp{Tasks} in file @file{TODO.org}, and
-journal entries in a date tree in @file{journal.org} you could
-use:
-
-@smallexample
-(setq org-capture-templates
- '(("t" "Todo" entry (file+headline "~/org/gtd.org" "Tasks")
- "* TODO %?\n %i\n %a")
- ("j" "Journal" entry (file+datetree "~/org/journal.org")
- "* %?\nEntered on %U\n %i\n %a")))
-@end smallexample
-
-@noindent In these entries, the first string is the key to reach the
-template, the second is a short description. Then follows the type of the
-entry and a definition of the target location for storing the note. Finally,
-the template itself, a string with %-escapes to fill in information based on
-time and context.
-
-When you call @kbd{M-x org-capture}, Org will prompt for a key to select the
-template (if you have more than one template) and then prepare the buffer like
-@smallexample
-* TODO
- [[file:@var{link to where you were when initiating capture}]]
-@end smallexample
-
-@noindent
-During expansion of the template, special @kbd{%}-escapes@footnote{If you
-need one of these sequences literally, escape the @kbd{%} with a backslash.}
-allow dynamic insertion of content. Here is a small selection of the
-possibilities, consult the manual for more.
-@smallexample
-%a @r{annotation, normally the link created with @code{org-store-link}}
-%i @r{initial content, the region when remember is called with C-u.}
-%t @r{timestamp, date only}
-%T @r{timestamp with date and time}
-%u, %U @r{like the above, but inactive timestamps}
-@end smallexample
-
-@node Refiling notes, Archiving, Capture, Capture - Refile - Archive
-@section Refiling notes
-
-When reviewing the captured data, you may want to refile some of the entries
-into a different list, for example into a project. Cutting, finding the
-right location, and then pasting the note is cumbersome. To simplify this
-process, you can use the following special command:
-
-@table @kbd
-@item C-c C-w
-Refile the entry or region at point. This command offers possible locations
-for refiling the entry and lets you select one with completion. The item (or
-all items in the region) is filed below the target heading as a subitem.@*
-By default, all level 1 headlines in the current buffer are considered to be
-targets, but you can have more complex definitions across a number of files.
-See the variable @code{org-refile-targets} for details.
-@item C-u C-c C-w
-Use the refile interface to jump to a heading.
-@item C-u C-u C-c C-w
-Jump to the location where @code{org-refile} last moved a tree to.
-@end table
-
-@node Archiving, , Refiling notes, Capture - Refile - Archive
-@section Archiving
-
-When a project represented by a (sub)tree is finished, you may want
-to move the tree out of the way and to stop it from contributing to the
-agenda. Archiving is important to keep your working files compact and global
-searches like the construction of agenda views fast.
-The most common archiving action is to move a project tree to another file,
-the archive file.
-
-@table @kbd
-@item C-c C-x C-a
-Archive the current entry using the command specified in the variable
-@code{org-archive-default-command}.
-@item C-c C-x C-s@ @r{or short} @ C-c $
-Archive the subtree starting at the cursor position to the location
-given by @code{org-archive-location}.
-@end table
-
-The default archive location is a file in the same directory as the
-current file, with the name derived by appending @file{_archive} to the
-current file name. For information and examples on how to change this,
-see the documentation string of the variable
-@code{org-archive-location}. There is also an in-buffer option for
-setting this variable, for example
-
-@smallexample
-#+ARCHIVE: %s_done::
-@end smallexample
-
-@seealso{
-@uref{http://orgmode.org/manual/Capture-_002d-Refile-_002d-Archive.html#Capture-_002d-Refile-_002d-Archive,
-Chapter 9 of the manual}@*
-@uref{http://members.optusnet.com.au/~charles57/GTD/remember.html, Charles
-Cave's remember tutorial}@*
-@uref{http://orgmode.org/worg/org-tutorials/org-protocol-custom-handler.php,
-Sebastian Rose's tutorial for capturing from a web browser}}@uref{}@*
-
-@node Agenda Views, Markup, Capture - Refile - Archive, Top
-@chapter Agenda Views
-
-Due to the way Org works, TODO items, time-stamped items, and tagged
-headlines can be scattered throughout a file or even a number of files. To
-get an overview of open action items, or of events that are important for a
-particular date, this information must be collected, sorted and displayed in
-an organized way. There are several different views, see below.
-
-The extracted information is displayed in a special @emph{agenda buffer}.
-This buffer is read-only, but provides commands to visit the corresponding
-locations in the original Org files, and even to edit these files remotely.
-Remote editing from the agenda buffer means, for example, that you can
-change the dates of deadlines and appointments from the agenda buffer.
-The commands available in the Agenda buffer are listed in @ref{Agenda
-commands}.
-
-@menu
-* Agenda files:: Files being searched for agenda information
-* Agenda dispatcher:: Keyboard access to agenda views
-* Built-in agenda views:: What is available out of the box?
-* Agenda commands:: Remote editing of Org trees
-* Custom agenda views:: Defining special searches and views
-@end menu
-
-@node Agenda files, Agenda dispatcher, Agenda Views, Agenda Views
-@section Agenda files
-
-The information to be shown is normally collected from all @emph{agenda
-files}, the files listed in the variable
-@code{org-agenda-files}.
-
-@table @kbd
-@item C-c [
-Add current file to the list of agenda files. The file is added to
-the front of the list. If it was already in the list, it is moved to
-the front. With a prefix argument, file is added/moved to the end.
-@item C-c ]
-Remove current file from the list of agenda files.
-@item C-,
-Cycle through agenda file list, visiting one file after the other.
-@end table
-
-@node Agenda dispatcher, Built-in agenda views, Agenda files, Agenda Views
-@section The agenda dispatcher
-The views are created through a dispatcher, which should be bound to a
-global key---for example @kbd{C-c a} (@pxref{Installation}). After
-pressing @kbd{C-c a}, an additional letter is required to execute a
-command:
-@table @kbd
-@item a
-The calendar-like agenda (@pxref{Weekly/daily agenda}).
-@item t @r{/} T
-A list of all TODO items (@pxref{Global TODO list}).
-@item m @r{/} M
-A list of headlines matching a TAGS expression (@pxref{Matching
-tags and properties}).
-@item L
-The timeline view for the current buffer (@pxref{Timeline}).
-@item s
-A list of entries selected by a boolean expression of keywords
-and/or regular expressions that must or must not occur in the entry.
-@end table
-
-@node Built-in agenda views, Agenda commands, Agenda dispatcher, Agenda Views
-@section The built-in agenda views
-
-@menu
-* Weekly/daily agenda:: The calendar page with current tasks
-* Global TODO list:: All unfinished action items
-* Matching tags and properties:: Structured information with fine-tuned search
-* Timeline:: Time-sorted view for single file
-* Search view:: Find entries by searching for text
-@end menu
-
-@node Weekly/daily agenda, Global TODO list, Built-in agenda views, Built-in agenda views
-@subsection The weekly/daily agenda
-
-The purpose of the weekly/daily @emph{agenda} is to act like a page of a
-paper agenda, showing all the tasks for the current week or day.
-
-@table @kbd
-@item C-c a a
-Compile an agenda for the current week from a list of Org files. The agenda
-shows the entries for each day.
-@end table
-
-Emacs contains the calendar and diary by Edward M. Reingold. Org-mode
-understands the syntax of the diary and allows you to use diary sexp entries
-directly in Org files:
-
-@smallexample
-* Birthdays and similar stuff
-#+CATEGORY: Holiday
-%%(org-calendar-holiday) ; special function for holiday names
-#+CATEGORY: Ann
-%%(diary-anniversary 5 14 1956)@footnote{Note that the order of the arguments (month, day, year) depends on the setting of @code{calendar-date-style}.} Arthur Dent is %d years old
-%%(diary-anniversary 10 2 1869) Mahatma Gandhi would be %d years old
-@end smallexample
-
-Org can interact with Emacs appointments notification facility. To add all
-the appointments of your agenda files, use the command
-@code{org-agenda-to-appt}. See the docstring for details.
-
-@node Global TODO list, Matching tags and properties, Weekly/daily agenda, Built-in agenda views
-@subsection The global TODO list
-
-The global TODO list contains all unfinished TODO items formatted and
-collected into a single place. Remote editing of TODO items lets you
-can change the state of a TODO entry with a single key press. The commands
-available in the TODO list are described in @ref{Agenda commands}.
-
-@table @kbd
-@item C-c a t
-Show the global TODO list. This collects the TODO items from all
-agenda files (@pxref{Agenda Views}) into a single buffer.
-@item C-c a T
-Like the above, but allows selection of a specific TODO keyword.
-@end table
-
-@node Matching tags and properties, Timeline, Global TODO list, Built-in agenda views
-@subsection Matching tags and properties
-
-If headlines in the agenda files are marked with @emph{tags} (@pxref{Tags}),
-or have properties (@pxref{Properties}), you can select headlines
-based on this metadata and collect them into an agenda buffer. The match
-syntax described here also applies when creating sparse trees with @kbd{C-c /
-m}. The commands available in the tags list are described in @ref{Agenda
-commands}.
-
-@table @kbd
-@item C-c a m
-Produce a list of all headlines that match a given set of tags. The
-command prompts for a selection criterion, which is a boolean logic
-expression with tags, like @samp{+work+urgent-withboss} or
-@samp{work|home} (@pxref{Tags}). If you often need a specific search,
-define a custom command for it (@pxref{Agenda dispatcher}).
-@item C-c a M
-Like @kbd{C-c a m}, but only select headlines that are also TODO items.
-@end table
-
-@subsubheading Match syntax
-
-A search string can use Boolean operators @samp{&} for AND and @samp{|} for
-OR. @samp{&} binds more strongly than @samp{|}. Parentheses are currently
-not implemented. Each element in the search is either a tag, a regular
-expression matching tags, or an expression like @code{PROPERTY OPERATOR
-VALUE} with a comparison operator, accessing a property value. Each element
-may be preceded by @samp{-}, to select against it, and @samp{+} is syntactic
-sugar for positive selection. The AND operator @samp{&} is optional when
-@samp{+} or @samp{-} is present. Here are some examples, using only tags.
-
-@table @samp
-@item +work-boss
-Select headlines tagged @samp{:work:}, but discard those also tagged
-@samp{:boss:}.
-@item work|laptop
-Selects lines tagged @samp{:work:} or @samp{:laptop:}.
-@item work|laptop+night
-Like before, but require the @samp{:laptop:} lines to be tagged also
-@samp{:night:}.
-@end table
-
-You may also test for properties at the same
-time as matching tags, see the manual for more information.
-
-@node Timeline, Search view, Matching tags and properties, Built-in agenda views
-@subsection Timeline for a single file
-
-The timeline summarizes all time-stamped items from a single Org mode
-file in a @emph{time-sorted view}. The main purpose of this command is
-to give an overview over events in a project.
-
-@table @kbd
-@item C-c a L
-Show a time-sorted view of the Org file, with all time-stamped items.
-When called with a @kbd{C-u} prefix, all unfinished TODO entries
-(scheduled or not) are also listed under the current date.
-@end table
-
-@node Search view, , Timeline, Built-in agenda views
-@subsection Search view
-
-This agenda view is a general text search facility for Org mode entries.
-It is particularly useful to find notes.
-
-@table @kbd
-@item C-c a s
-This is a special search that lets you select entries by matching a substring
-or specific words using a boolean logic.
-@end table
-For example, the search string @samp{computer equipment} will find entries
-that contain @samp{computer equipment} as a substring.
-Search view can also search for specific keywords in the entry, using Boolean
-logic. The search string @samp{+computer +wifi -ethernet -@{8\.11[bg]@}}
-will search for note entries that contain the keywords @code{computer}
-and @code{wifi}, but not the keyword @code{ethernet}, and which are also
-not matched by the regular expression @code{8\.11[bg]}, meaning to
-exclude both 8.11b and 8.11g.
-
-Note that in addition to the agenda files, this command will also search
-the files listed in @code{org-agenda-text-search-extra-files}.
-
-@node Agenda commands, Custom agenda views, Built-in agenda views, Agenda Views
-@section Commands in the agenda buffer
-
-Entries in the agenda buffer are linked back to the Org file or diary
-file where they originate. Commands are provided to show and jump to the
-original entry location, and to edit the Org files ``remotely'' from
-the agenda buffer. This is just a selection of the many commands, explore
-the @code{Agenda} menu and the manual for a complete list.
-
-@table @kbd
-@tsubheading{Motion}
-@item n
-Next line (same as @key{up} and @kbd{C-p}).
-@item p
-Previous line (same as @key{down} and @kbd{C-n}).
-@tsubheading{View/Go to Org file}
-@item mouse-3
-@itemx @key{SPC}
-Display the original location of the item in another window.
-With prefix arg, make sure that the entire entry is made visible in the
-outline, not only the heading.
-@c
-@itemx @key{TAB}
-Go to the original location of the item in another window. Under Emacs
-22, @kbd{mouse-1} will also works for this.
-@c
-@itemx @key{RET}
-Go to the original location of the item and delete other windows.
-@c
-
-@tsubheading{Change display}
-@item o
-Delete other windows.
-@c
-@item d @r{/} w
-Switch to day/week view.
-@c
-@item f @r{and} b
-Go forward/backward in time to display the following
-@code{org-agenda-current-span} days. For example, if the display covers a
-week, switch to the following/previous week.
-@c
-@item .
-Go to today.
-@c
-@item j
-Prompt for a date and go there.
-@c
-@item v l @ @r{or short} @ l
-Toggle Logbook mode. In Logbook mode, entries that were marked DONE while
-logging was on (variable @code{org-log-done}) are shown in the agenda, as are
-entries that have been clocked on that day. When called with a @kbd{C-u}
-prefix, show all possible logbook entries, including state changes.
-@c
-@item r @r{or} g
-Recreate the agenda buffer, to reflect the changes.
-@item s
-Save all Org buffers in the current Emacs session, and also the locations of
-IDs.
-
-@tsubheading{Secondary filtering and query editing}
-
-@item /
-Filter the current agenda view with respect to a tag. You are prompted for a
-letter to select a tag. Press @samp{-} first to select against the tag.
-
-@item \
-Narrow the current agenda filter by an additional condition.
-
-@tsubheading{Remote editing (see the manual for many more commands)}
-
-@item 0-9
-Digit argument.
-@c
-@item t
-Change the TODO state of the item, in the agenda and in the
-org file.
-@c
-@item C-k
-Delete the current agenda item along with the entire subtree belonging
-to it in the original Org file.
-@c
-@item C-c C-w
-Refile the entry at point.
-@c
-@item C-c C-x C-a @ @r{or short} @ a
-Archive the subtree corresponding to the entry at point using the default
-archiving command set in @code{org-archive-default-command}.
-@c
-@item C-c C-x C-s @ @r{or short} @ $
-Archive the subtree corresponding to the current headline.
-@c
-@item C-c C-s
-Schedule this item, with prefix arg remove the scheduling timestamp
-@c
-@item C-c C-d
-Set a deadline for this item, with prefix arg remove the deadline.
-@c
-@item S-@key{right} @r{and} S-@key{left}
-Change the timestamp associated with the current line by one day.
-@c
-@item I
-Start the clock on the current item.
-@c
-@item O / X
-Stop/cancel the previously started clock.
-
-@item J
-Jump to the running clock in another window.
-@end table
-
-@node Custom agenda views, , Agenda commands, Agenda Views
-@section Custom agenda views
-
-The main application of custom searches is the definition of keyboard
-shortcuts for frequently used searches, either creating an agenda
-buffer, or a sparse tree (the latter covering of course only the current
-buffer).
-Custom commands are configured in the variable
-@code{org-agenda-custom-commands}. You can customize this variable, for
-example by pressing @kbd{C-c a C}. You can also directly set it with
-Emacs Lisp in @file{.emacs}. The following example contains all valid
-search types:
-
-@smalllisp
-@group
-(setq org-agenda-custom-commands
- '(("w" todo "WAITING")
- ("u" tags "+boss-urgent")
- ("v" tags-todo "+boss-urgent")))
-@end group
-@end smalllisp
-
-@noindent
-The initial string in each entry defines the keys you have to press after the
-dispatcher command @kbd{C-c a} in order to access the command. Usually this
-will be just a single character. The second parameter is the search type,
-followed by the string or regular expression to be used for the matching.
-The example above will therefore define:
-
-@table @kbd
-@item C-c a w
-as a global search for TODO entries with @samp{WAITING} as the TODO
-keyword
-@item C-c a u
-as a global tags search for headlines marked @samp{:boss:} but not
-@samp{:urgent:}
-@item C-c a v
-as the same search as @kbd{C-c a u}, but limiting the search to
-headlines that are also TODO items
-@end table
-
-@seealso{
-@uref{http://orgmode.org/manual/Agenda-Views.html#Agenda-Views, Chapter 10 of
-the manual}@*
-@uref{http://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.php,
-Mat Lundin's tutorial about custom agenda commands}@*
-@uref{http://www.newartisans.com/2007/08/using-org-mode-as-a-day-planner.html,
-John Wiegley's setup}}
-
-@node Markup, Exporting, Agenda Views, Top
-@chapter Markup for rich export
-
-When exporting Org-mode documents, the exporter tries to reflect the
-structure of the document as accurately as possible in the backend. Since
-export targets like HTML, La@TeX{}, or DocBook allow much richer formatting,
-Org mode has rules on how to prepare text for rich export. This section
-summarizes the markup rules used in an Org-mode buffer.
-
-@menu
-* Structural markup elements:: The basic structure as seen by the exporter
-* Images and tables:: Tables and Images will be included
-* Literal examples:: Source code examples with special formatting
-* Include files:: Include additional files into a document
-* Embedded LaTeX:: LaTeX can be freely used inside Org documents
-@end menu
-
-@node Structural markup elements, Images and tables, Markup, Markup
-@section Structural markup elements
-
-@menu
-* Document title:: Where the title is taken from
-* Headings and sections:: The document structure as seen by the exporter
-* Table of contents:: The if and where of the table of contents
-* Paragraphs:: Paragraphs
-* Emphasis and monospace:: Bold, italic, etc.
-* Comment lines:: What will *not* be exported
-@end menu
-
-@node Document title, Headings and sections, Structural markup elements, Structural markup elements
-@subheading Document title
-
-@noindent
-The title of the exported document is taken from the special line
-
-@smallexample
-#+TITLE: This is the title of the document
-@end smallexample
-
-@node Headings and sections, Table of contents, Document title, Structural markup elements
-@subheading Headings and sections
-
-The outline structure of the document as described in @ref{Document
-Structure}, forms the basis for defining sections of the exported document.
-However, since the outline structure is also used for (for example) lists of
-tasks, only the first three outline levels will be used as headings. Deeper
-levels will become itemized lists. You can change the location of this
-switch globally by setting the variable @code{org-export-headline-levels}, or on a
-per-file basis with a line
-
-@smallexample
-#+OPTIONS: H:4
-@end smallexample
-
-@node Table of contents, Paragraphs, Headings and sections, Structural markup elements
-@subheading Table of contents
-
-The table of contents is normally inserted directly before the first headline
-of the file.
-
-@smallexample
-#+OPTIONS: toc:2 (only to two levels in TOC)
-#+OPTIONS: toc:nil (no TOC at all)
-@end smallexample
-
-@node Paragraphs, Emphasis and monospace, Table of contents, Structural markup elements
-@subheading Paragraphs, line breaks, and quoting
-
-Paragraphs are separated by at least one empty line. If you need to enforce
-a line break within a paragraph, use @samp{\\} at the end of a line.
-
-To keep the line breaks in a region, but otherwise use normal formatting, you
-can use this construct, which can also be used to format poetry.
-
-@smallexample
-#+BEGIN_VERSE
- Great clouds overhead
- Tiny black birds rise and fall
- Snow covers Emacs
-
- -- AlexSchroeder
-#+END_VERSE
-@end smallexample
-
-When quoting a passage from another document, it is customary to format this
-as a paragraph that is indented on both the left and the right margin. You
-can include quotations in Org-mode documents like this:
-
-@smallexample
-#+BEGIN_QUOTE
-Everything should be made as simple as possible,
-but not any simpler -- Albert Einstein
-#+END_QUOTE
-@end smallexample
-
-If you would like to center some text, do it like this:
-@smallexample
-#+BEGIN_CENTER
-Everything should be made as simple as possible, \\
-but not any simpler
-#+END_CENTER
-@end smallexample
-
-@node Emphasis and monospace, Comment lines, Paragraphs, Structural markup elements
-@subheading Emphasis and monospace
-
-You can make words @b{*bold*}, @i{/italic/}, _underlined_, @code{=code=}
-and @code{~verbatim~}, and, if you must, @samp{+strike-through+}. Text
-in the code and verbatim string is not processed for Org-mode specific
-syntax, it is exported verbatim. To insert a horizontal rules, use a line
-consisting of only dashes, and at least 5 of them.
-
-@node Comment lines, , Emphasis and monospace, Structural markup elements
-@subheading Comment lines
-
-Lines starting with @samp{#} in column zero are treated as comments and will
-never be exported. If you want an indented line to be treated as a comment,
-start it with @samp{#+ }. Also entire subtrees starting with the word
-@samp{COMMENT} will never be exported. Finally, regions surrounded by
-@samp{#+BEGIN_COMMENT} ... @samp{#+END_COMMENT} will not be exported.
-
-@table @kbd
-@item C-c ;
-Toggle the COMMENT keyword at the beginning of an entry.
-@end table
-
-@node Images and tables, Literal examples, Structural markup elements, Markup
-@section Images and Tables
-
-For Org mode tables, the lines before the first horizontal separator line
-will become table header lines. You can use the following lines somewhere
-before the table to assign a caption and a label for cross references, and in
-the text you can refer to the object with @code{\ref@{tab:basic-data@}}:
-
-@smallexample
-#+CAPTION: This is the caption for the next table (or link)
-#+LABEL: tbl:basic-data
- | ... | ...|
- |-----|----|
-@end smallexample
-
-Some backends (HTML, La@TeX{}, and DocBook) allow you to directly include
-images into the exported document. Org does this, if a link to an image
-files does not have a description part, for example @code{[[./img/a.jpg]]}.
-If you wish to define a caption for the image and maybe a label for internal
-cross references, you sure that the link is on a line by itself precede it
-with:
-
-@smallexample
-#+CAPTION: This is the caption for the next figure link (or table)
-#+LABEL: fig:SED-HR4049
-[[./img/a.jpg]]
-@end smallexample
-
-You may also define additional attributes for the figure. As this is
-backend-specific, see the sections about the individual backends for more
-information.
-
-
-@node Literal examples, Include files, Images and tables, Markup
-@section Literal examples
-
-You can include literal examples that should not be subjected to
-markup. Such examples will be typeset in monospace, so this is well suited
-for source code and similar examples.
-
-@smallexample
-#+BEGIN_EXAMPLE
-Some example from a text file.
-#+END_EXAMPLE
-@end smallexample
-
-For simplicity when using small examples, you can also start the example
-lines with a colon followed by a space. There may also be additional
-whitespace before the colon:
-
-@smallexample
-Here is an example
- : Some example from a text file.
-@end smallexample
-
-For source code from a programming language, or any other text
-that can be marked up by font-lock in Emacs, you can ask for it to
-look like the fontified Emacs buffer
-
-@smallexample
-#+BEGIN_SRC emacs-lisp
-(defun org-xor (a b)
- "Exclusive or."
- (if a (not b) b))
-#+END_SRC
-@end smallexample
-
-To edit the example in a special buffer supporting this language, use
-@kbd{C-c '} to both enter and leave the editing buffer.
-
-@node Include files, Embedded LaTeX, Literal examples, Markup
-@section Include files
-
-During export, you can include the content of another file. For example, to
-include your @file{.emacs} file, you could use:
-
-@smallexample
-#+INCLUDE: "~/.emacs" src emacs-lisp
-@end smallexample
-@noindent
-The optional second and third parameter are the markup (e.g. @samp{quote},
-@samp{example}, or @samp{src}), and, if the markup is @samp{src}, the
-language for formatting the contents. The markup is optional, if it is not
-given, the text will be assumed to be in Org mode format and will be
-processed normally. @kbd{C-c '} will visit the included file.
-
-@node Embedded LaTeX, , Include files, Markup
-@section Embedded La@TeX{}
-
-For scientific notes which need to be able to contain mathematical symbols
-and the occasional formula, Org-mode supports embedding La@TeX{} code into
-its files. You can directly use TeX-like macros for special symbols, enter
-formulas and entire LaTeX environments.
-
-@smallexample
-Angles are written as Greek letters \alpha, \beta and \gamma. The mass if
-the sun is M_sun = 1.989 x 10^30 kg. The radius of the sun is R_@{sun@} =
-6.96 x 10^8 m. If $a^2=b$ and $b=2$, then the solution must be either
-$a=+\sqrt@{2@}$ or $a=-\sqrt@{2@}$.
-
-\begin@{equation@}
-x=\sqrt@{b@}
-\end@{equation@}
-@end smallexample
-@noindent With
-@uref{http://orgmode.org/manual/LaTeX-fragments.html#LaTeX-fragments,special
-setup}, LaTeX snippets will be included as images when exporting to HTML.
-
-@seealso{
-@uref{http://orgmode.org/manual/Markup.html#Markup, Chapter 11 of the manual}}
-
-@node Exporting, Publishing, Markup, Top
-@chapter Exporting
-
-Org-mode documents can be exported into a variety of other formats: ASCII
-export for inclusion into emails, HTML to publish on the web, La@TeX{}/PDF
-for beautiful printed documents and DocBook to enter the world of many other
-formats using DocBook tools. There is also export to iCalendar format so
-that planning information can be incorporated into desktop calendars.
-
-@menu
-* Export options:: Per-file export settings
-* The export dispatcher:: How to access exporter commands
-* ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding
-* HTML export:: Exporting to HTML
-* LaTeX and PDF export:: Exporting to La@TeX{}, and processing to PDF
-* DocBook export:: Exporting to DocBook
-* iCalendar export::
-@end menu
-
-@node Export options, The export dispatcher, Exporting, Exporting
-@section Export options
-
-The exporter recognizes special lines in the buffer which provide
-additional information. These lines may be put anywhere in the file.
-The whole set of lines can be inserted into the buffer with @kbd{C-c
-C-e t}.
-
-@table @kbd
-@item C-c C-e t
-Insert template with export options, see example below.
-@end table
-
-@smallexample
-#+TITLE: the title to be shown (default is the buffer name)
-#+AUTHOR: the author (default taken from @code{user-full-name})
-#+DATE: a date, fixed, of a format string for @code{format-time-string}
-#+EMAIL: his/her email address (default from @code{user-mail-address})
-#+DESCRIPTION: the page description, e.g. for the XHTML meta tag
-#+KEYWORDS: the page keywords, e.g. for the XHTML meta tag
-#+LANGUAGE: language for HTML, e.g. @samp{en} (@code{org-export-default-language})
-#+TEXT: Some descriptive text to be inserted at the beginning.
-#+TEXT: Several lines may be given.
-#+OPTIONS: H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t f:t TeX:t ...
-#+LINK_UP: the ``up'' link of an exported page
-#+LINK_HOME: the ``home'' link of an exported page
-#+LATEX_HEADER: extra line(s) for the LaTeX header, like \usepackage@{xyz@}
-@end smallexample
-
-@node The export dispatcher, ASCII/Latin-1/UTF-8 export, Export options, Exporting
-@section The export dispatcher
-
-All export commands can be reached using the export dispatcher, which is a
-prefix key that prompts for an additional key specifying the command.
-Normally the entire file is exported, but if there is an active region that
-contains one outline tree, the first heading is used as document title and
-the subtrees are exported.
-
-@table @kbd
-@item C-c C-e
-Dispatcher for export and publishing commands.
-@end table
-
-@node ASCII/Latin-1/UTF-8 export, HTML export, The export dispatcher, Exporting
-@section ASCII/Latin-1/UTF-8 export
-
-ASCII export produces a simple and very readable version of an Org-mode
-file, containing only plain ASCII. Latin-1 and UTF-8 export augment the file
-with special characters and symbols available in these encodings.
-
-@table @kbd
-@item C-c C-e a
-Export as ASCII file.
-@item C-c C-e n @ @ @r{and} @ @ C-c C-e N
-Like the above commands, but use Latin-1 encoding.
-@item C-c C-e u @ @ @r{and} @ @ C-c C-e U
-Like the above commands, but use UTF-8 encoding.
-@end table
-
-@node HTML export, LaTeX and PDF export, ASCII/Latin-1/UTF-8 export, Exporting
-@section HTML export
-
-@table @kbd
-@item C-c C-e h
-Export as HTML file @file{myfile.html}.
-@item C-c C-e b
-Export as HTML file and immediately open it with a browser.
-@end table
-
-To insert HTML that should be copied verbatim to
-the exported file use either
-
-@smallexample
-#+HTML: Literal HTML code for export
-@end smallexample
-@noindent or
-@smallexample
-#+BEGIN_HTML
-All lines between these markers are exported literally
-#+END_HTML
-@end smallexample
-
-@node LaTeX and PDF export, DocBook export, HTML export, Exporting
-@section La@TeX{} and PDF export
-
-@table @kbd
-@item C-c C-e l
-Export as La@TeX{} file @file{myfile.tex}.
-@item C-c C-e p
-Export as La@TeX{} and then process to PDF.
-@item C-c C-e d
-Export as La@TeX{} and then process to PDF, then open the resulting PDF file.
-@end table
-
-By default, the La@TeX{} output uses the class @code{article}. You can
-change this by adding an option like @code{#+LaTeX_CLASS: myclass} in your
-file. The class must be listed in @code{org-export-latex-classes}.
-
-Embedded La@TeX{} as described in @ref{Embedded LaTeX}, will be correctly
-inserted into the La@TeX{} file. Similarly to the HTML exporter, you can use
-@code{#+LaTeX:} and @code{#+BEGIN_LaTeX ... #+END_LaTeX} construct to add
-verbatim LaTeX code.
-
-@node DocBook export, iCalendar export, LaTeX and PDF export, Exporting
-@section DocBook export
-
-@table @kbd
-@item C-c C-e D
-Export as DocBook file.
-@end table
-
-Similarly to the HTML exporter, you can use @code{#+DocBook:} and
-@code{#+BEGIN_DocBook ... #+END_DocBook} construct to add verbatim LaTeX
-code.
-
-@node iCalendar export, , DocBook export, Exporting
-@section iCalendar export
-
-@table @kbd
-@item C-c C-e i
-Create iCalendar entries for the current file in a @file{.ics} file.
-@item C-c C-e c
-Create a single large iCalendar file from all files in
-@code{org-agenda-files} and write it to the file given by
-@code{org-combined-agenda-icalendar-file}.
-@end table
-
-@seealso{
-@uref{http://orgmode.org/manual/Exporting.html#Exporting, Chapter 12 of the manual}@*
-@uref{http://orgmode.org/worg/org-tutorials/images-and-xhtml-export.php,
-Sebastian Rose's image handling tutorial}@*
-@uref{http://orgmode.org/worg/org-tutorials/org-latex-export.php, Thomas
-Dye's LaTeX export tutorial}
-@uref{http://orgmode.org/worg/org-tutorials/org-beamer/tutorial.php, Eric
-Fraga's BEAMER presentation tutorial}}
-
-@node Publishing, Working With Source Code, Exporting, Top
-@chapter Publishing
-
-Org includes a publishing management system that allows you to configure
-automatic HTML conversion of @emph{projects} composed of interlinked org
-files. You can also configure Org to automatically upload your exported HTML
-pages and related attachments, such as images and source code files, to a web
-server. For detailed instructions about setup, see the manual.
-
-Here is an example:
-
-@smalllisp
-(setq org-publish-project-alist
- '(("org"
- :base-directory "~/org/"
- :publishing-directory "~/public_html"
- :section-numbers nil
- :table-of-contents nil
- :style "<link rel=\"stylesheet\"
- href=\"../other/mystyle.css\"
- type=\"text/css\"/>")))
-@end smalllisp
-
-@table @kbd
-@item C-c C-e C
-Prompt for a specific project and publish all files that belong to it.
-@item C-c C-e P
-Publish the project containing the current file.
-@item C-c C-e F
-Publish only the current file.
-@item C-c C-e E
-Publish every project.
-@end table
-
-Org uses timestamps to track when a file has changed. The above functions
-normally only publish changed files. You can override this and force
-publishing of all files by giving a prefix argument to any of the commands
-above.
-
-@seealso{
-@uref{http://orgmode.org/manual/Publishing.html#Publishing, Chapter 13 of the
-manual}@*
-@uref{http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.php,
-Sebastian Rose's publishing tutorial}@*
-@uref{http://orgmode.org/worg/org-tutorials/org-jekyll.php, Ian Barton's
-Jekyll/blogging setup}}
-
-@node Working With Source Code, Miscellaneous, Publishing, Top
-@chapter Working with source code
-Org-mode provides a number of features for working with source code,
-including editing of code blocks in their native major-mode, evaluation of
-code blocks, tangling of code blocks, and exporting code blocks and their
-results in several formats.
-
-@subheading Structure of Code Blocks
-The structure of code blocks is as follows:
-
-@example
-#+srcname: <name>
-#+begin_src <language> <switches> <header arguments>
- <body>
-#+end_src
-@end example
-
-Where @code{<name>} is a string used to name the code block,
-@code{<language>} specifies the language of the code block
-(e.g. @code{emacs-lisp}, @code{shell}, @code{R}, @code{python}, etc...),
-@code{<switches>} can be used to control export of the code block,
-@code{<header arguments>} can be used to control many aspects of code block
-behavior as demonstrated below, and @code{<body>} contains the actual source
-code.
-
-@subheading Editing source code
-Use @kbd{C-c '} to edit the current code block. This brings up a language
-major-mode edit buffer containing the body of the code block. Saving this
-buffer will write the new contents back to the Org buffer. Use @kbd{C-c '}
-again to exit the edit buffer.
-
-@subheading Evaluating code blocks
-Use @kbd{C-c C-c} to evaluate the current code block and insert its results
-in the Org-mode buffer. By default, evaluation is only turned on for
-@code{emacs-lisp} code blocks, however support exists for evaluating blocks
-in many languages. For a complete list of supported languages see the
-manual. The following shows a code block and its results.
-
-@example
-#+begin_src emacs-lisp
- (+ 1 2 3 4)
-#+end_src
-
-#+results:
-: 10
-@end example
-
-@subheading Extracting source code
-Use @kbd{C-c C-v t} to create pure source code files by extracting code from
-source blocks in the current buffer. This is referred to as ``tangling''---a
-term adopted from the literate programming community. During ``tangling'' of
-code blocks their bodies are expanded using @code{org-babel-expand-src-block}
-which can expand both variable and ``noweb'' style references. In order to
-tangle a code block it must have a @code{:tangle} header argument, see the
-manual for details.
-
-@subheading Library of Babel
-Use @kbd{C-c C-v l} to load the code blocks from an Org-mode files into the
-``Library of Babel'', these blocks can then be evaluated from any Org-mode
-buffer. A collection of generally useful code blocks is distributed with
-Org-mode in @code{contrib/library-of-babel.org}.
-
-@subheading Header Arguments
-Many aspects of the evaluation and export of code blocks are controlled
-through header arguments. These can be specified globally, at the file
-level, at the outline subtree level, and at the individual code block level.
-The following describes some of the header arguments.
-@table @code
-@item :var
-The @code{:var} header argument is used to pass arguments to code blocks.
-The values passed to arguments can be literal values, values from org-mode
-tables and literal example blocks, or the results of other named code blocks.
-@item :results
-The @code{:results} header argument controls the @emph{collection},
-@emph{type}, and @emph{handling} of code block results. Values of
-@code{output} or @code{value} (the default) specify how results are collected
-from a code block's evaluation. Values of @code{vector}, @code{scalar}
-@code{file} @code{raw} @code{html} @code{latex} and @code{code} specify the
-type of the results of the code block which dictates how they will be
-incorporated into the Org-mode buffer. Values of @code{silent},
-@code{replace}, @code{prepend}, and @code{append} specify handling of code
-block results, specifically if and how the results should be inserted into
-the Org-mode buffer.
-@item :session
-A header argument of @code{:session} will cause the code block to be
-evaluated in a persistent interactive inferior process in Emacs. This allows
-for persisting state between code block evaluations, and for manual
-inspection of the results of evaluation.
-@item :exports
-Any combination of the @emph{code} or the @emph{results} of a block can be
-retained on export, this is specified by setting the @code{:results} header
-argument to @code{code} @code{results} @code{none} or @code{both}.
-@item :tangle
-A header argument of @code{:tangle yes} will cause a code block's contents to
-be tangled to a file named after the filename of the Org-mode buffer. An
-alternate file name can be specified with @code{:tangle filename}.
-@item :cache
-A header argument of @code{:cache yes} will cause associate a hash of the
-expanded code block with the results, ensuring that code blocks are only
-re-run when their inputs have changed.
-@item :noweb
-A header argument of @code{:noweb yes} will expand ``noweb'' style references
-on evaluation and tangling.
-@item :file
-Code blocks which output results to files (e.g. graphs, diagrams and figures)
-can accept a @code{:file filename} header argument in which case the results
-are saved to the named file, and a link to the file is inserted into the
-Org-mode buffer.
-@end table
-
-@seealso{
-@uref{http://orgmode.org/manual/Literal-examples.html#Literal-examples,
-Chapter 11.3 of the manual}@*
-@uref{http://orgmode.org/worg/org-contrib/babel/index.php,
-The Babel site on Worg}}
-
-@node Miscellaneous, , Working With Source Code, Top
-@chapter Miscellaneous
-
-@menu
-* Completion:: M-TAB knows what you need
-* Clean view:: Getting rid of leading stars in the outline
-* MobileOrg:: Org-mode on the iPhone
-@end menu
-
-@node Completion, Clean view, Miscellaneous, Miscellaneous
-@section Completion
-
-Org supports in-buffer completion with @kbd{M-@key{TAB}}. This type of
-completion does not make use of the minibuffer. You simply type a few
-letters into the buffer and use the key to complete text right there. For
-example, this command will complete @TeX{} symbols after @samp{\}, TODO
-keywords at the beginning of a headline, and tags after @samp{:} in a
-headline.
-
-@node Clean view, MobileOrg, Completion, Miscellaneous
-@section A cleaner outline view
-
-Some people find it noisy and distracting that the Org headlines start with a
-potentially large number of stars, and that text below the headlines is not
-indented. While this is no problem when writing a @emph{book-like} document
-where the outline headings are really section headings, in a more
-@emph{list-oriented} outline, indented structure is a lot cleaner:
-
-@smallexample
-@group
-* Top level headline | * Top level headline
-** Second level | * Second level
-*** 3rd level | * 3rd level
-some text | some text
-*** 3rd level | * 3rd level
-more text | more text
-* Another top level headline | * Another top level headline
-@end group
-@end smallexample
-
-@noindent
-If you are using at least Emacs 23.1.50.3 and version 6.29 of Org, this kind
-of view can be achieved dynamically at display time using
-@code{org-indent-mode}, which will prepend intangible space to each line.
-You can turn on @code{org-indent-mode} for all files by customizing the
-variable @code{org-startup-indented}, or you can turn it on for individual
-files using
-
-@smallexample
-#+STARTUP: indent
-@end smallexample
-
-If you want a similar effect in earlier version of Emacs and/or Org, or if
-you want the indentation to be hard space characters so that the plain text
-file looks as similar as possible to the Emacs display, Org supports you by
-helping to indent (with @key{TAB}) text below each headline, by hiding
-leading stars, and by only using levels 1, 3, etc to get two characters
-indentation for each level. To get this support in a file, use
-
-@smallexample
-#+STARTUP: hidestars odd
-@end smallexample
-
-@node MobileOrg, , Clean view, Miscellaneous
-@section MobileOrg
-
-@i{MobileOrg} is an application for the @i{iPhone/iPod Touch} series of
-devices, developed by Richard Moreland. For details, see the Org-mode
-manual.
-
-@seealso{
-@uref{http://orgmode.org/manual/Miscellaneous.html#Miscellaneous, Chapter 15
-of the manual}@*
-@uref{http://orgmode.org/manual/MobileOrg.html#MobileOrg, Appendix B of the
-manual}@*
-@uref{http://orgmode.org/orgcard.pdf,Key reference card}}
-
-@bye
-
-@ignore
- arch-tag: 8f0a8557-0acc-4436-b2b2-0197699e1452
-@end ignore
-
-@c Local variables:
-@c fill-column: 77
-@c End:
-
-
-@c LocalWords: webdavhost pre
diff --git a/.emacs.d/org-7.4/doc/pdflayout.sty b/.emacs.d/org-7.4/doc/pdflayout.sty
deleted file mode 100644
index 114f9aa..0000000
--- a/.emacs.d/org-7.4/doc/pdflayout.sty
+++ /dev/null
@@ -1,47 +0,0 @@
-% Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
-
-% This file is part of GNU Emacs.
-
-% GNU Emacs is free software: you can redistribute it and/or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
-
-% GNU Emacs is distributed in the hope that it will be useful,
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-% GNU General Public License for more details.
-
-% You should have received a copy of the GNU General Public License
-% along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-% This file defines `\pdflayout':
-% - \pdflayout=(0) is A4 portrait,
-% - \pdflayout=(1) is letter (US) portrait,
-% - \pdflayout=(0l) is A4 landscape.
-% - \pdflayout=(1l) is letter (US) landscape,
-
-\input ifpdf.sty
-
-\ifpdf
- \def\pdflayout=(#1#2){
- \if0#1 % A4
- \pdfpagewidth=21cm
- \pdfpageheight=29.7cm
- \else\if1#1 % Letter
- \pdfpagewidth=8.5in
- \pdfpageheight=11in
- \fi\fi
- \if l#2 % Landscape
- \edef\oldwidth{\the\pdfpagewidth}
- \pdfpagewidth=\pdfpageheight
- \pdfpageheight=\oldwidth
- \fi
- }
-\else
- \def\pdflayout=(#1#2){}
-\fi
-
-% archtag: 63c938a5-cc78-4964-962d-603c90d34afc
-
-% arch-tag: 3464d27c-1439-473a-bc47-a7c501e8c156
diff --git a/.emacs.d/org-7.4/lisp/ob-C.el b/.emacs.d/org-7.4/lisp/ob-C.el
deleted file mode 100644
index da0e768..0000000
--- a/.emacs.d/org-7.4/lisp/ob-C.el
+++ /dev/null
@@ -1,194 +0,0 @@
-;;; ob-C.el --- org-babel functions for C and similar languages
-
-;; Copyright (C) 2010 Free Software Foundation, Inc.
-
-;; Author: Eric Schulte
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Org-Babel support for evaluating C code.
-;;
-;; very limited implementation:
-;; - currently only support :results output
-;; - not much in the way of error feedback
-
-;;; Code:
-(require 'ob)
-(require 'ob-eval)
-(require 'cc-mode)
-
-(declare-function org-entry-get "org"
- (pom property &optional inherit literal-nil))
-
-(add-to-list 'org-babel-tangle-lang-exts '("c++" . "cpp"))
-
-(defvar org-babel-default-header-args:C '())
-
-(defvar org-babel-C-compiler "gcc"
- "Command used to compile a C source code file into an
- executable.")
-
-(defvar org-babel-c++-compiler "g++"
- "Command used to compile a c++ source code file into an
- executable.")
-
-(defvar org-babel-c-variant nil
- "Internal variable used to hold which type of C (e.g. C or C++)
-is currently being evaluated.")
-
-(defun org-babel-execute:cpp (body params)
- "Execute BODY according to PARAMS. This function calls
-`org-babel-execute:C'."
- (org-babel-execute:C body params))
-
-(defun org-babel-execute:c++ (body params)
- "Execute a block of C++ code with org-babel. This function is
-called by `org-babel-execute-src-block'."
- (let ((org-babel-c-variant 'cpp)) (org-babel-C-execute body params)))
-
-(defun org-babel-expand-body:c++ (body params)
- "Expand a block of C++ code with org-babel according to it's
-header arguments (calls `org-babel-C-expand')."
- (let ((org-babel-c-variant 'cpp)) (org-babel-C-expand body params)))
-
-(defun org-babel-execute:C (body params)
- "Execute a block of C code with org-babel. This function is
-called by `org-babel-execute-src-block'."
- (let ((org-babel-c-variant 'c)) (org-babel-C-execute body params)))
-
-(defun org-babel-expand-body:c (body params)
- "Expand a block of C code with org-babel according to it's
-header arguments (calls `org-babel-C-expand')."
- (let ((org-babel-c-variant 'c)) (org-babel-C-expand body params)))
-
-(defun org-babel-C-execute (body params)
- "This function should only be called by `org-babel-execute:C'
-or `org-babel-execute:c++'."
- (let* ((tmp-src-file (org-babel-temp-file
- "C-src-"
- (cond
- ((equal org-babel-c-variant 'c) ".c")
- ((equal org-babel-c-variant 'cpp) ".cpp"))))
- (tmp-bin-file (org-babel-temp-file "C-bin-"))
- (cmdline (cdr (assoc :cmdline params)))
- (flags (cdr (assoc :flags params)))
- (full-body (org-babel-C-expand body params))
- (compile
- (progn
- (with-temp-file tmp-src-file (insert full-body))
- (org-babel-eval
- (format "%s -o %s %s %s"
- (cond
- ((equal org-babel-c-variant 'c) org-babel-C-compiler)
- ((equal org-babel-c-variant 'cpp) org-babel-c++-compiler))
- (org-babel-process-file-name tmp-bin-file)
- (mapconcat 'identity
- (if (listp flags) flags (list flags)) " ")
- (org-babel-process-file-name tmp-src-file)) ""))))
- ((lambda (results)
- (org-babel-reassemble-table
- (if (member "vector" (cdr (assoc :result-params params)))
- (let ((tmp-file (org-babel-temp-file "c-")))
- (with-temp-file tmp-file (insert results))
- (org-babel-import-elisp-from-file tmp-file))
- (org-babel-read results))
- (org-babel-pick-name
- (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
- (org-babel-pick-name
- (cdr (assoc :rowname-names params)) (cdr (assoc :rownames params)))))
- (org-babel-trim
- (org-babel-eval
- (concat tmp-bin-file (if cmdline (concat " " cmdline) "")) "")))))
-
-(defun org-babel-C-expand (body params)
- "Expand a block of C or C++ code with org-babel according to
-it's header arguments."
- (let ((vars (mapcar #'cdr (org-babel-get-header params :var)))
- (main-p (not (string= (cdr (assoc :main params)) "no")))
- (includes (or (cdr (assoc :includes params))
- (org-babel-read (org-entry-get nil "includes" t))))
- (defines (org-babel-read
- (or (cdr (assoc :defines params))
- (org-babel-read (org-entry-get nil "defines" t))))))
- (mapconcat 'identity
- (list
- ;; includes
- (mapconcat
- (lambda (inc) (format "#include %s" inc))
- (if (listp includes) includes (list includes)) "\n")
- ;; defines
- (mapconcat
- (lambda (inc) (format "#define %s" inc))
- (if (listp defines) defines (list defines)) "\n")
- ;; variables
- (mapconcat 'org-babel-C-var-to-C vars "\n")
- ;; body
- (if main-p
- (org-babel-C-ensure-main-wrap body)
- body) "\n") "\n")))
-
-(defun org-babel-C-ensure-main-wrap (body)
- "Wrap body in a \"main\" function call if none exists."
- (if (string-match "^[ \t]*[intvod]+[ \t\n\r]*main[ \t]*(.*)" body)
- body
- (format "int main() {\n%s\n}\n" body)))
-
-(defun org-babel-prep-session:C (session params)
- "This function does nothing as C is a compiled language with no
-support for sessions"
- (error "C is a compiled languages -- no support for sessions"))
-
-(defun org-babel-load-session:C (session body params)
- "This function does nothing as C is a compiled language with no
-support for sessions"
- (error "C is a compiled languages -- no support for sessions"))
-
-;; helper functions
-
-(defun org-babel-C-var-to-C (pair)
- "Convert an elisp val into a string of C code specifying a var
-of the same value."
- ;; TODO list support
- (let ((var (car pair))
- (val (cdr pair)))
- (when (symbolp val)
- (setq val (symbol-name val))
- (when (= (length val) 1)
- (setq val (string-to-char val))))
- (cond
- ((integerp val)
- (format "int %S = %S;" var val))
- ((floatp val)
- (format "double %S = %S;" var val))
- ((or (characterp val))
- (format "char %S = '%S';" var val))
- ((stringp val)
- (format "char %S[%d] = \"%s\";"
- var (+ 1 (length val)) val))
- (t
- (format "u32 %S = %S;" var val)))))
-
-
-(provide 'ob-C)
-
-;; arch-tag: 8f49e462-54e3-417b-9a8d-423864893b37
-
-;;; ob-C.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-C.elc b/.emacs.d/org-7.4/lisp/ob-C.elc
deleted file mode 100644
index e6dd9ff..0000000
--- a/.emacs.d/org-7.4/lisp/ob-C.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-R.el b/.emacs.d/org-7.4/lisp/ob-R.el
deleted file mode 100644
index 1f4fd87..0000000
--- a/.emacs.d/org-7.4/lisp/ob-R.el
+++ /dev/null
@@ -1,303 +0,0 @@
-;;; ob-R.el --- org-babel functions for R code evaluation
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Eric Schulte, Dan Davison
-;; Keywords: literate programming, reproducible research, R, statistics
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Org-Babel support for evaluating R code
-
-;;; Code:
-(require 'ob)
-(require 'ob-ref)
-(require 'ob-comint)
-(require 'ob-eval)
-(eval-when-compile (require 'cl))
-
-(declare-function orgtbl-to-tsv "org-table" (table params))
-(declare-function R "ext:essd-r" (&optional start-args))
-(declare-function inferior-ess-send-input "ext:ess-inf" ())
-(declare-function ess-make-buffer-current "ext:ess-inf" ())
-(declare-function ess-eval-buffer "ext:ess-inf" (vis))
-(declare-function org-number-sequence "org-compat" (from &optional to inc))
-
-(defconst org-babel-header-arg-names:R
- '(width height bg units pointsize antialias quality compression
- res type family title fonts version paper encoding
- pagecentre colormodel useDingbats horizontal)
- "R-specific header arguments.")
-
-(defvar org-babel-default-header-args:R '())
-
-(defvar org-babel-R-command "R --slave --no-save"
- "Name of command to use for executing R code.")
-
-(defun org-babel-expand-body:R (body params)
- "Expand BODY according to PARAMS, return the expanded body."
- (let ((out-file (cdr (assoc :file params))))
- (mapconcat
- #'identity
- ((lambda (inside)
- (if out-file
- (append
- (list (org-babel-R-construct-graphics-device-call out-file params))
- inside
- (list "dev.off()"))
- inside))
- (append (org-babel-variable-assignments:R params)
- (list body))) "\n")))
-
-(defun org-babel-execute:R (body params)
- "Execute a block of R code.
-This function is called by `org-babel-execute-src-block'."
- (save-excursion
- (let* ((result-type (cdr (assoc :result-type params)))
- (session (org-babel-R-initiate-session
- (cdr (assoc :session params)) params))
- (colnames-p (cdr (assoc :colnames params)))
- (rownames-p (cdr (assoc :rownames params)))
- (out-file (cdr (assoc :file params)))
- (full-body (org-babel-expand-body:R body params))
- (result
- (org-babel-R-evaluate
- session full-body result-type
- (or (equal "yes" colnames-p)
- (org-babel-pick-name
- (cdr (assoc :colname-names params)) colnames-p))
- (or (equal "yes" rownames-p)
- (org-babel-pick-name
- (cdr (assoc :rowname-names params)) rownames-p)))))
- (message "result is %S" result)
- (or out-file result))))
-
-(defun org-babel-prep-session:R (session params)
- "Prepare SESSION according to the header arguments specified in PARAMS."
- (let* ((session (org-babel-R-initiate-session session params))
- (var-lines (org-babel-variable-assignments:R params)))
- (org-babel-comint-in-buffer session
- (mapc (lambda (var)
- (end-of-line 1) (insert var) (comint-send-input nil t)
- (org-babel-comint-wait-for-output session)) var-lines))
- session))
-
-(defun org-babel-load-session:R (session body params)
- "Load BODY into SESSION."
- (save-window-excursion
- (let ((buffer (org-babel-prep-session:R session params)))
- (with-current-buffer buffer
- (goto-char (process-mark (get-buffer-process (current-buffer))))
- (insert (org-babel-chomp body)))
- buffer)))
-
-;; helper functions
-
-(defun org-babel-variable-assignments:R (params)
- "Return list of R statements assigning the block's variables"
- (let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
- (mapcar
- (lambda (pair)
- (org-babel-R-assign-elisp
- (car pair) (cdr pair)
- (equal "yes" (cdr (assoc :colnames params)))
- (equal "yes" (cdr (assoc :rownames params)))))
- (mapcar
- (lambda (i)
- (cons (car (nth i vars))
- (org-babel-reassemble-table
- (cdr (nth i vars))
- (cdr (nth i (cdr (assoc :colname-names params))))
- (cdr (nth i (cdr (assoc :rowname-names params)))))))
- (org-number-sequence 0 (1- (length vars)))))))
-
-(defun org-babel-R-quote-tsv-field (s)
- "Quote field S for export to R."
- (if (stringp s)
- (concat "\"" (mapconcat 'identity (split-string s "\"") "\"\"") "\"")
- (format "%S" s)))
-
-(defun org-babel-R-assign-elisp (name value colnames-p rownames-p)
- "Construct R code assigning the elisp VALUE to a variable named NAME."
- (if (listp value)
- (let ((transition-file (org-babel-temp-file "R-import-")))
- ;; ensure VALUE has an orgtbl structure (depth of at least 2)
- (unless (listp (car value)) (setq value (list value)))
- (with-temp-file transition-file
- (insert (orgtbl-to-tsv value '(:fmt org-babel-R-quote-tsv-field)))
- (insert "\n"))
- (format "%s <- read.table(\"%s\", header=%s, row.names=%s, sep=\"\\t\", as.is=TRUE)"
- name (org-babel-process-file-name transition-file 'noquote)
- (if (or (eq (nth 1 value) 'hline) colnames-p) "TRUE" "FALSE")
- (if rownames-p "1" "NULL")))
- (format "%s <- %s" name (org-babel-R-quote-tsv-field value))))
-
-(defvar ess-ask-for-ess-directory nil)
-(defun org-babel-R-initiate-session (session params)
- "If there is not a current R process then create one."
- (unless (string= session "none")
- (let ((session (or session "*R*"))
- (ess-ask-for-ess-directory
- (and ess-ask-for-ess-directory (not (cdr (assoc :dir params))))))
- (if (org-babel-comint-buffer-livep session)
- session
- (save-window-excursion
- (require 'ess) (R)
- (rename-buffer
- (if (bufferp session)
- (buffer-name session)
- (if (stringp session)
- session
- (buffer-name))))
- (current-buffer))))))
-
-(defvar ess-local-process-name nil)
-(defun org-babel-R-associate-session (session)
- "Associate R code buffer with an R session.
-Make SESSION be the inferior ESS process associated with the
-current code buffer."
- (setq ess-local-process-name
- (process-name (get-buffer-process session)))
- (ess-make-buffer-current))
-
-(defun org-babel-R-construct-graphics-device-call (out-file params)
- "Construct the call to the graphics device."
- (let ((devices
- '((:bmp . "bmp")
- (:jpg . "jpeg")
- (:jpeg . "jpeg")
- (:tiff . "tiff")
- (:png . "png")
- (:svg . "svg")
- (:pdf . "pdf")
- (:ps . "postscript")
- (:postscript . "postscript")))
- (allowed-args '(:width :height :bg :units :pointsize
- :antialias :quality :compression :res
- :type :family :title :fonts :version
- :paper :encoding :pagecentre :colormodel
- :useDingbats :horizontal))
- (device (and (string-match ".+\\.\\([^.]+\\)" out-file)
- (match-string 1 out-file)))
- (extra-args (cdr (assq :R-dev-args params))) filearg args)
- (setq device (or (and device (cdr (assq (intern (concat ":" device))
- devices))) "png"))
- (setq filearg
- (if (member device '("pdf" "postscript" "svg")) "file" "filename"))
- (setq args (mapconcat
- (lambda (pair)
- (if (member (car pair) allowed-args)
- (format ",%s=%s"
- (substring (symbol-name (car pair)) 1)
- (cdr pair)) ""))
- params ""))
- (format "%s(%s=\"%s\"%s%s%s)"
- device filearg out-file args
- (if extra-args "," "") (or extra-args ""))))
-
-(defvar org-babel-R-eoe-indicator "'org_babel_R_eoe'")
-(defvar org-babel-R-eoe-output "[1] \"org_babel_R_eoe\"")
-(defvar org-babel-R-write-object-command "{function(object, transfer.file) {invisible(if(inherits(try(write.table(object, file=transfer.file, sep=\"\\t\", na=\"nil\",row.names=%s, col.names=%s, quote=FALSE), silent=TRUE),\"try-error\")) {if(!file.exists(transfer.file)) file.create(transfer.file)})}}(object=%s, transfer.file=\"%s\")")
-
-(defun org-babel-R-evaluate
- (session body result-type column-names-p row-names-p)
- "Evaluate R code in BODY."
- (if session
- (org-babel-R-evaluate-session
- session body result-type column-names-p row-names-p)
- (org-babel-R-evaluate-external-process
- body result-type column-names-p row-names-p)))
-
-(defun org-babel-R-evaluate-external-process
- (body result-type column-names-p row-names-p)
- "Evaluate BODY in external R process.
-If RESULT-TYPE equals 'output then return standard output as a
-string. If RESULT-TYPE equals 'value then return the value of the
-last statement in BODY, as elisp."
- (case result-type
- (value
- (let ((tmp-file (org-babel-temp-file "R-")))
- (org-babel-eval org-babel-R-command
- (format org-babel-R-write-object-command
- (if row-names-p "TRUE" "FALSE")
- (if column-names-p
- (if row-names-p "NA" "TRUE")
- "FALSE")
- (format "{function ()\n{\n%s\n}}()" body)
- (org-babel-process-file-name tmp-file 'noquote)))
- (org-babel-R-process-value-result
- (org-babel-import-elisp-from-file tmp-file '(16)) column-names-p)))
- (output (org-babel-eval org-babel-R-command body))))
-
-(defun org-babel-R-evaluate-session
- (session body result-type column-names-p row-names-p)
- "Evaluate BODY in SESSION.
-If RESULT-TYPE equals 'output then return standard output as a
-string. If RESULT-TYPE equals 'value then return the value of the
-last statement in BODY, as elisp."
- (case result-type
- (value
- (with-temp-buffer
- (insert (org-babel-chomp body))
- (let ((ess-local-process-name
- (process-name (get-buffer-process session))))
- (ess-eval-buffer nil)))
- (let ((tmp-file (org-babel-temp-file "R-")))
- (org-babel-comint-eval-invisibly-and-wait-for-file
- session tmp-file
- (format org-babel-R-write-object-command
- (if row-names-p "TRUE" "FALSE")
- (if column-names-p
- (if row-names-p "NA" "TRUE")
- "FALSE")
- ".Last.value" (org-babel-process-file-name tmp-file 'noquote)))
- (org-babel-R-process-value-result
- (org-babel-import-elisp-from-file tmp-file '(16)) column-names-p)))
- (output
- (mapconcat
- #'org-babel-chomp
- (butlast
- (delq nil
- (mapcar
- (lambda (line) (when (> (length line) 0) line))
- (mapcar
- (lambda (line) ;; cleanup extra prompts left in output
- (if (string-match
- "^\\([ ]*[>+][ ]?\\)+\\([[0-9]+\\|[ ]\\)" line)
- (substring line (match-end 1))
- line))
- (org-babel-comint-with-output (session org-babel-R-eoe-output)
- (insert (mapconcat #'org-babel-chomp
- (list body org-babel-R-eoe-indicator)
- "\n"))
- (inferior-ess-send-input)))))) "\n"))))
-
-(defun org-babel-R-process-value-result (result column-names-p)
- "R-specific processing of return value.
-Insert hline if column names in output have been requested."
- (if column-names-p
- (cons (car result) (cons 'hline (cdr result)))
- result))
-
-(provide 'ob-R)
-
-;; arch-tag: cd4c7298-503b-450f-a3c2-f3e74b630237
-
-;;; ob-R.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-R.elc b/.emacs.d/org-7.4/lisp/ob-R.elc
deleted file mode 100644
index 26ea781..0000000
--- a/.emacs.d/org-7.4/lisp/ob-R.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-asymptote.el b/.emacs.d/org-7.4/lisp/ob-asymptote.el
deleted file mode 100644
index ab2abda..0000000
--- a/.emacs.d/org-7.4/lisp/ob-asymptote.el
+++ /dev/null
@@ -1,164 +0,0 @@
-;;; ob-asymptote.el --- org-babel functions for asymptote evaluation
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Eric Schulte
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Org-Babel support for evaluating asymptote source code.
-;;
-;; This differs from most standard languages in that
-;;
-;; 1) there is no such thing as a "session" in asymptote
-;;
-;; 2) we are generally only going to return results of type "file"
-;;
-;; 3) we are adding the "file" and "cmdline" header arguments, if file
-;; is omitted then the -V option is passed to the asy command for
-;; interactive viewing
-
-;;; Requirements:
-
-;; - The asymptote program :: http://asymptote.sourceforge.net/
-;;
-;; - asy-mode :: Major mode for editing asymptote files
-
-;;; Code:
-(require 'ob)
-(eval-when-compile (require 'cl))
-
-(declare-function orgtbl-to-generic "org-table" (table params))
-(declare-function org-combine-plists "org" (&rest plists))
-
-(add-to-list 'org-babel-tangle-lang-exts '("asymptote" . "asy"))
-
-(defvar org-babel-default-header-args:asymptote
- '((:results . "file") (:exports . "results"))
- "Default arguments when evaluating an Asymptote source block.")
-
-(defun org-babel-execute:asymptote (body params)
- "Execute a block of Asymptote code.
-This function is called by `org-babel-execute-src-block'."
- (let* ((result-params (split-string (or (cdr (assoc :results params)) "")))
- (out-file (cdr (assoc :file params)))
- (format (or (and out-file
- (string-match ".+\\.\\(.+\\)" out-file)
- (match-string 1 out-file))
- "pdf"))
- (cmdline (cdr (assoc :cmdline params)))
- (in-file (org-babel-temp-file "asymptote-"))
- (cmd
- (concat "asy "
- (if out-file
- (concat
- "-globalwrite -f " format
- " -o " (org-babel-process-file-name out-file))
- "-V")
- " " cmdline
- " " (org-babel-process-file-name in-file))))
- (with-temp-file in-file
- (insert (org-babel-expand-body:generic
- body params
- (org-babel-variable-assignments:asymptote params))))
- (message cmd) (shell-command cmd)
- out-file))
-
-(defun org-babel-prep-session:asymptote (session params)
- "Return an error if the :session header argument is set.
-Asymptote does not support sessions"
- (error "Asymptote does not support sessions"))
-
-(defun org-babel-variable-assignments:asymptote (params)
- "Return list of asymptote statements assigning the block's variables"
- (mapcar #'org-babel-asymptote-var-to-asymptote
- (mapcar #'cdr (org-babel-get-header params :var))))
-
-(defun org-babel-asymptote-var-to-asymptote (pair)
- "Convert an elisp value into an Asymptote variable.
-The elisp value PAIR is converted into Asymptote code specifying
-a variable of the same value."
- (let ((var (car pair))
- (val (if (symbolp (cdr pair))
- (symbol-name (cdr pair))
- (cdr pair))))
- (cond
- ((integerp val)
- (format "int %S=%S;" var val))
- ((floatp val)
- (format "real %S=%S;" var val))
- ((stringp val)
- (format "string %S=\"%s\";" var val))
- ((listp val)
- (let* ((dimension-2-p (not (null (cdr val))))
- (dim (if dimension-2-p "[][]" "[]"))
- (type (org-babel-asymptote-define-type val))
- (array (org-babel-asymptote-table-to-array
- val
- (if dimension-2-p '(:lstart "{" :lend "}," :llend "}")))))
- (format "%S%s %S=%s;" type dim var array))))))
-
-(defun org-babel-asymptote-table-to-array (table params)
- "Convert values of an elisp table into a string of an asymptote array.
-Empty cells are ignored."
- (labels ((atom-to-string (table)
- (cond
- ((null table) '())
- ((not (listp (car table)))
- (cons (if (and (stringp (car table))
- (not (string= (car table) "")))
- (format "\"%s\"" (car table))
- (format "%s" (car table)))
- (atom-to-string (cdr table))))
- (t
- (cons (atom-to-string (car table))
- (atom-to-string (cdr table))))))
- ;; Remove any empty row
- (fix-empty-lines (table)
- (delq nil (mapcar (lambda (l) (delq "" l)) table))))
- (orgtbl-to-generic
- (fix-empty-lines (atom-to-string table))
- (org-combine-plists '(:hline nil :sep "," :tstart "{" :tend "}") params))))
-
-(defun org-babel-asymptote-define-type (data)
- "Determine type of DATA.
-DATA is a list. Type symbol is returned as 'symbol. The type is
-usually the type of the first atom encountered, except for arrays
-of int, where every cell must be of int type."
- (labels ((anything-but-int (el)
- (cond
- ((null el) nil)
- ((not (listp (car el)))
- (cond
- ((floatp (car el)) 'real)
- ((stringp (car el)) 'string)
- (t
- (anything-but-int (cdr el)))))
- (t
- (or (anything-but-int (car el))
- (anything-but-int (cdr el)))))))
- (or (anything-but-int data) 'int)))
-
-(provide 'ob-asymptote)
-
-;; arch-tag: f2f5bd0d-78e8-412b-8e6c-6dadc94cc06b
-
-;;; ob-asymptote.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-asymptote.elc b/.emacs.d/org-7.4/lisp/ob-asymptote.elc
deleted file mode 100644
index 530f6c4..0000000
--- a/.emacs.d/org-7.4/lisp/ob-asymptote.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-calc.el b/.emacs.d/org-7.4/lisp/ob-calc.el
deleted file mode 100644
index 287bad3..0000000
--- a/.emacs.d/org-7.4/lisp/ob-calc.el
+++ /dev/null
@@ -1,97 +0,0 @@
-;;; ob-calc.el --- org-babel functions for calc code evaluation
-
-;; Copyright (C) 2010 Free Software Foundation, Inc
-
-;; Author: Eric Schulte
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Org-Babel support for evaluating calc code
-
-;;; Code:
-(require 'ob)
-(require 'calc)
-(require 'calc-trail)
-(eval-when-compile (require 'ob-comint))
-
-(defvar org-babel-default-header-args:calc nil
- "Default arguments for evaluating an calc source block.")
-
-(defun org-babel-expand-body:calc (body params)
- "Expand BODY according to PARAMS, return the expanded body." body)
-
-(defun org-babel-execute:calc (body params)
- "Execute a block of calc code with Babel."
- (unless (get-buffer "*Calculator*")
- (save-window-excursion (calc) (calc-quit)))
- (let* ((vars (mapcar #'cdr (org-babel-get-header params :var)))
- (var-syms (mapcar #'car vars))
- (var-names (mapcar #'symbol-name var-syms)))
- (mapc
- (lambda (pair)
- (calc-push-list (list (cdr pair)))
- (calc-store-into (car pair)))
- vars)
- (mapc
- (lambda (line)
- (when (> (length line) 0)
- (cond
- ;; simple variable name
- ((member line var-names) (calc-recall (intern line)))
- ;; stack operation
- ((string= "'" (substring line 0 1))
- (funcall (lookup-key calc-mode-map (substring line 1)) nil))
- ;; complex expression
- (t
- (calc-push-list
- (list ((lambda (res)
- (cond
- ((numberp res) res)
- ((math-read-number res) (math-read-number res))
- ((listp res) (error "calc error \"%s\" on input \"%s\""
- (cadr res) line))
- (t (calc-eval
- (math-evaluate-expr
- ;; resolve user variables, calc built in
- ;; variables are handled automatically
- ;; upstream by calc
- (mapcar (lambda (el)
- (if (and (consp el) (equal 'var (car el))
- (member (cadr el) var-syms))
- (progn
- (calc-recall (cadr el))
- (prog1 (calc-top 1)
- (calc-pop 1)))
- el))
- ;; parse line into calc objects
- (car (math-read-exprs line))))))))
- (calc-eval line))))))))
- (mapcar #'org-babel-trim
- (split-string (org-babel-expand-body:calc body params) "[\n\r]"))))
- (save-excursion
- (with-current-buffer (get-buffer "*Calculator*")
- (calc-eval (calc-top 1)))))
-
-(provide 'ob-calc)
-
-;; arch-tag: 5c57a3b7-5818-4c6c-acda-7a94831a6449
-
-;;; ob-calc.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-calc.elc b/.emacs.d/org-7.4/lisp/ob-calc.elc
deleted file mode 100644
index 0a006b2..0000000
--- a/.emacs.d/org-7.4/lisp/ob-calc.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-clojure.el b/.emacs.d/org-7.4/lisp/ob-clojure.el
deleted file mode 100644
index d88c54b..0000000
--- a/.emacs.d/org-7.4/lisp/ob-clojure.el
+++ /dev/null
@@ -1,88 +0,0 @@
-;;; ob-clojure.el --- org-babel functions for clojure evaluation
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Joel Boehland, Eric Schulte
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;;; support for evaluating clojure code, relies on slime for all eval
-
-;;; Requirements:
-
-;;; - clojure (at least 1.2.0)
-;;; - clojure-mode
-;;; - slime
-;;; - swank-clojure
-
-;;; By far, the best way to install these components is by following
-;;; the directions as set out by Phil Hagelberg (Technomancy) on the
-;;; web page: http://technomancy.us/126
-
-;;; Code:
-(require 'ob)
-
-(declare-function slime-eval "ext:slime" (sexp &optional package))
-
-(add-to-list 'org-babel-tangle-lang-exts '("clojure" . "clj"))
-
-(defvar org-babel-default-header-args:clojure '())
-(defvar org-babel-header-arg-names:clojure '(package))
-
-(defun org-babel-expand-body:clojure (body params)
- "Expand BODY according to PARAMS, return the expanded body."
- (let* ((vars (mapcar #'cdr (org-babel-get-header params :var)))
- (result-params (cdr (assoc :result-params params)))
- (print-level nil) (print-length nil)
- (body (org-babel-trim
- (if (> (length vars) 0)
- (concat "(let ["
- (mapconcat
- (lambda (var)
- (format "%S (quote %S)" (car var) (cdr var)))
- vars "\n ")
- "]\n" body ")")
- body))))
- (if (or (member "code" result-params)
- (member "pp" result-params))
- (format (concat "(let [org-mode-print-catcher (java.io.StringWriter.)]"
- "(clojure.pprint/with-pprint-dispatch %s-dispatch"
- "(clojure.pprint/pprint %s org-mode-print-catcher)"
- "(str org-mode-print-catcher)))")
- (if (member "code" result-params) "code" "simple") body)
- body)))
-
-(defun org-babel-execute:clojure (body params)
- "Execute a block of Clojure code with Babel."
- (require 'slime) (require 'swank-clojure)
- (with-temp-buffer
- (insert (org-babel-expand-body:clojure body params))
- (read
- (slime-eval
- `(swank:interactive-eval-region
- ,(buffer-substring-no-properties (point-min) (point-max)))
- (cdr (assoc :package params))))))
-
-(provide 'ob-clojure)
-
-;; arch-tag: a43b33f2-653e-46b1-ac56-2805cf05b7d1
-
-;;; ob-clojure.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-clojure.elc b/.emacs.d/org-7.4/lisp/ob-clojure.elc
deleted file mode 100644
index b71f04a..0000000
--- a/.emacs.d/org-7.4/lisp/ob-clojure.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-comint.el b/.emacs.d/org-7.4/lisp/ob-comint.el
deleted file mode 100644
index 064aad5..0000000
--- a/.emacs.d/org-7.4/lisp/ob-comint.el
+++ /dev/null
@@ -1,163 +0,0 @@
-;;; ob-comint.el --- org-babel functions for interaction with comint buffers
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Eric Schulte
-;; Keywords: literate programming, reproducible research, comint
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; These functions build on comint to ease the sending and receiving
-;; of commands and results from comint buffers.
-
-;; Note that the buffers in this file are analogous to sessions in
-;; org-babel at large.
-
-;;; Code:
-(require 'ob)
-(require 'comint)
-(eval-when-compile (require 'cl))
-(declare-function with-parsed-tramp-file-name "tramp" (filename var &rest body))
-(declare-function tramp-flush-directory-property "tramp" (vec directory))
-
-(defun org-babel-comint-buffer-livep (buffer)
- "Check if BUFFER is a comint buffer with a live process."
- (let ((buffer (if buffer (get-buffer buffer))))
- (and buffer (buffer-live-p buffer) (get-buffer-process buffer) buffer)))
-
-(defmacro org-babel-comint-in-buffer (buffer &rest body)
- "Check BUFFER and execute BODY.
-BUFFER is checked with `org-babel-comint-buffer-livep'. BODY is
-executed inside the protection of `save-excursion' and
-`save-match-data'."
- (declare (indent 1))
- `(save-excursion
- (save-match-data
- (unless (org-babel-comint-buffer-livep ,buffer)
- (error "buffer %s doesn't exist or has no process" ,buffer))
- (set-buffer ,buffer)
- ,@body)))
-
-(defmacro org-babel-comint-with-output (meta &rest body)
- "Evaluate BODY in BUFFER and return process output.
-Will wait until EOE-INDICATOR appears in the output, then return
-all process output. If REMOVE-ECHO and FULL-BODY are present and
-non-nil, then strip echo'd body from the returned output. META
-should be a list containing the following where the last two
-elements are optional.
-
- (BUFFER EOE-INDICATOR REMOVE-ECHO FULL-BODY)
-
-This macro ensures that the filter is removed in case of an error
-or user `keyboard-quit' during execution of body."
- (declare (indent 1))
- (let ((buffer (car meta))
- (eoe-indicator (cadr meta))
- (remove-echo (cadr (cdr meta)))
- (full-body (cadr (cdr (cdr meta)))))
- `(org-babel-comint-in-buffer ,buffer
- (let ((string-buffer "") dangling-text raw)
- (flet ((my-filt (text)
- (setq string-buffer (concat string-buffer text))))
- ;; setup filter
- (add-hook 'comint-output-filter-functions 'my-filt)
- (unwind-protect
- (progn
- ;; got located, and save dangling text
- (goto-char (process-mark (get-buffer-process (current-buffer))))
- (let ((start (point))
- (end (point-max)))
- (setq dangling-text (buffer-substring start end))
- (delete-region start end))
- ;; pass FULL-BODY to process
- ,@body
- ;; wait for end-of-evaluation indicator
- (while (progn
- (goto-char comint-last-input-end)
- (not (save-excursion
- (and (re-search-forward
- comint-prompt-regexp nil t)
- (re-search-forward
- (regexp-quote ,eoe-indicator) nil t)))))
- (accept-process-output (get-buffer-process (current-buffer)))
- ;; thought the following this would allow async
- ;; background running, but I was wrong...
- ;; (run-with-timer .5 .5 'accept-process-output
- ;; (get-buffer-process (current-buffer)))
- )
- ;; replace cut dangling text
- (goto-char (process-mark (get-buffer-process (current-buffer))))
- (insert dangling-text))
- ;; remove filter
- (remove-hook 'comint-output-filter-functions 'my-filt)))
- ;; remove echo'd FULL-BODY from input
- (if (and ,remove-echo ,full-body
- (string-match
- (replace-regexp-in-string
- "\n" "[\r\n]+" (regexp-quote (or ,full-body "")))
- string-buffer))
- (setq raw (substring string-buffer (match-end 0))))
- (split-string string-buffer comint-prompt-regexp)))))
-
-(defun org-babel-comint-input-command (buffer cmd)
- "Pass CMD to BUFFER.
-The input will not be echoed."
- (org-babel-comint-in-buffer buffer
- (goto-char (process-mark (get-buffer-process buffer)))
- (insert cmd)
- (comint-send-input)
- (org-babel-comint-wait-for-output buffer)))
-
-(defun org-babel-comint-wait-for-output (buffer)
- "Wait until output arrives from BUFFER.
-Note: this is only safe when waiting for the result of a single
-statement (not large blocks of code)."
- (org-babel-comint-in-buffer buffer
- (while (progn
- (goto-char comint-last-input-end)
- (not (and (re-search-forward comint-prompt-regexp nil t)
- (goto-char (match-beginning 0))
- (string= (face-name (face-at-point))
- "comint-highlight-prompt"))))
- (accept-process-output (get-buffer-process buffer)))))
-
-(defun org-babel-comint-eval-invisibly-and-wait-for-file
- (buffer file string &optional period)
- "Evaluate STRING in BUFFER invisibly.
-Don't return until FILE exists. Code in STRING must ensure that
-FILE exists at end of evaluation."
- (unless (org-babel-comint-buffer-livep buffer)
- (error "buffer %s doesn't exist or has no process" buffer))
- (if (file-exists-p file) (delete-file file))
- (process-send-string
- (get-buffer-process buffer)
- (if (string-match "\n$" string) string (concat string "\n")))
- ;; From Tramp 2.1.19 the following cache flush is not necessary
- (if (file-remote-p default-directory)
- (let (v)
- (with-parsed-tramp-file-name default-directory nil
- (tramp-flush-directory-property v ""))))
- (while (not (file-exists-p file)) (sit-for (or period 0.25))))
-
-(provide 'ob-comint)
-
-;; arch-tag: 9adddce6-0864-4be3-b0b5-6c5157dc7889
-
-;;; ob-comint.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-comint.elc b/.emacs.d/org-7.4/lisp/ob-comint.elc
deleted file mode 100644
index fa239de..0000000
--- a/.emacs.d/org-7.4/lisp/ob-comint.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-css.el b/.emacs.d/org-7.4/lisp/ob-css.el
deleted file mode 100644
index 48ea9e3..0000000
--- a/.emacs.d/org-7.4/lisp/ob-css.el
+++ /dev/null
@@ -1,49 +0,0 @@
-;;; ob-css.el --- org-babel functions for css evaluation
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Eric Schulte
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Since CSS can't be executed, this file exists solely for tangling
-;; CSS from org-mode files.
-
-;;; Code:
-(require 'ob)
-
-(defvar org-babel-default-header-args:css '())
-
-(defun org-babel-execute:css (body params)
- "Execute a block of CSS code.
-This function is called by `org-babel-execute-src-block'."
- body)
-
-(defun org-babel-prep-session:css (session params)
- "Return an error if the :session header argument is set.
-CSS does not support sessions."
- (error "CSS sessions are nonsensical"))
-
-(provide 'ob-css)
-
-;; arch-tag: f4447e8c-50ab-41f9-b322-b7b9574d9fbe
-
-;;; ob-css.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-css.elc b/.emacs.d/org-7.4/lisp/ob-css.elc
deleted file mode 100644
index 6cc9da2..0000000
--- a/.emacs.d/org-7.4/lisp/ob-css.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-ditaa.el b/.emacs.d/org-7.4/lisp/ob-ditaa.el
deleted file mode 100644
index 097f938..0000000
--- a/.emacs.d/org-7.4/lisp/ob-ditaa.el
+++ /dev/null
@@ -1,74 +0,0 @@
-;;; ob-ditaa.el --- org-babel functions for ditaa evaluation
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Eric Schulte
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Org-Babel support for evaluating ditaa source code.
-;;
-;; This differs from most standard languages in that
-;;
-;; 1) there is no such thing as a "session" in ditaa
-;;
-;; 2) we are generally only going to return results of type "file"
-;;
-;; 3) we are adding the "file" and "cmdline" header arguments
-;;
-;; 4) there are no variables (at least for now)
-
-;;; Code:
-(require 'ob)
-
-(defvar org-babel-default-header-args:ditaa
- '((:results . "file") (:exports . "results"))
- "Default arguments for evaluating a ditaa source block.")
-
-(defvar org-ditaa-jar-path)
-(defun org-babel-execute:ditaa (body params)
- "Execute a block of Ditaa code with org-babel.
-This function is called by `org-babel-execute-src-block'."
- (let* ((result-params (split-string (or (cdr (assoc :results params)) "")))
- (out-file (cdr (assoc :file params)))
- (cmdline (cdr (assoc :cmdline params)))
- (in-file (org-babel-temp-file "ditaa-"))
- (cmd (concat "java -jar "
- (shell-quote-argument
- (expand-file-name org-ditaa-jar-path))
- " " cmdline
- " " (org-babel-process-file-name in-file)
- " " (org-babel-process-file-name out-file))))
- (unless (file-exists-p org-ditaa-jar-path)
- (error "Could not find ditaa.jar at %s" org-ditaa-jar-path))
- (with-temp-file in-file (insert body))
- (message cmd) (shell-command cmd)
- out-file))
-
-(defun org-babel-prep-session:ditaa (session params)
- "Return an error because ditaa does not support sessions."
- (error "Ditaa does not support sessions"))
-
-(provide 'ob-ditaa)
-
-;; arch-tag: 492cd006-07d9-4fac-bef6-5bb60b48842e
-
-;;; ob-ditaa.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-ditaa.elc b/.emacs.d/org-7.4/lisp/ob-ditaa.elc
deleted file mode 100644
index dee1f5c..0000000
--- a/.emacs.d/org-7.4/lisp/ob-ditaa.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-dot.el b/.emacs.d/org-7.4/lisp/ob-dot.el
deleted file mode 100644
index 36baddb..0000000
--- a/.emacs.d/org-7.4/lisp/ob-dot.el
+++ /dev/null
@@ -1,90 +0,0 @@
-;;; ob-dot.el --- org-babel functions for dot evaluation
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Eric Schulte
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Org-Babel support for evaluating dot source code.
-;;
-;; For information on dot see http://www.graphviz.org/
-;;
-;; This differs from most standard languages in that
-;;
-;; 1) there is no such thing as a "session" in dot
-;;
-;; 2) we are generally only going to return results of type "file"
-;;
-;; 3) we are adding the "file" and "cmdline" header arguments
-;;
-;; 4) there are no variables (at least for now)
-
-;;; Code:
-(require 'ob)
-(require 'ob-eval)
-
-(defvar org-babel-default-header-args:dot
- '((:results . "file") (:exports . "results"))
- "Default arguments to use when evaluating a dot source block.")
-
-(defun org-babel-expand-body:dot (body params)
- "Expand BODY according to PARAMS, return the expanded body."
- (let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
- (mapc
- (lambda (pair)
- (let ((name (symbol-name (car pair)))
- (value (cdr pair)))
- (setq body
- (replace-regexp-in-string
- (concat "\$" (regexp-quote name))
- (if (stringp value) value (format "%S" value))
- body))))
- vars)
- body))
-
-(defun org-babel-execute:dot (body params)
- "Execute a block of Dot code with org-babel.
-This function is called by `org-babel-execute-src-block'."
- (let* ((result-params (cdr (assoc :result-params params)))
- (out-file (cdr (assoc :file params)))
- (cmdline (or (cdr (assoc :cmdline params))
- (format "-T%s" (file-name-extension out-file))))
- (cmd (or (cdr (assoc :cmd params)) "dot"))
- (in-file (org-babel-temp-file "dot-")))
- (with-temp-file in-file
- (insert (org-babel-expand-body:dot body params)))
- (org-babel-eval
- (concat cmd
- " " (org-babel-process-file-name in-file)
- " " cmdline
- " -o " (org-babel-process-file-name out-file)) "")
- out-file))
-
-(defun org-babel-prep-session:dot (session params)
- "Return an error because Dot does not support sessions."
- (error "Dot does not support sessions"))
-
-(provide 'ob-dot)
-
-;; arch-tag: 817d0516-7b47-4f77-a8b2-2aadd8e4d0e2
-
-;;; ob-dot.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-dot.elc b/.emacs.d/org-7.4/lisp/ob-dot.elc
deleted file mode 100644
index 96c5588..0000000
--- a/.emacs.d/org-7.4/lisp/ob-dot.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-emacs-lisp.el b/.emacs.d/org-7.4/lisp/ob-emacs-lisp.el
deleted file mode 100644
index df6f505..0000000
--- a/.emacs.d/org-7.4/lisp/ob-emacs-lisp.el
+++ /dev/null
@@ -1,71 +0,0 @@
-;;; ob-emacs-lisp.el --- org-babel functions for emacs-lisp code evaluation
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc
-
-;; Author: Eric Schulte
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Org-Babel support for evaluating emacs-lisp code
-
-;;; Code:
-(require 'ob)
-(eval-when-compile (require 'ob-comint))
-
-(defvar org-babel-default-header-args:emacs-lisp
- '((:hlines . "yes") (:colnames . "no"))
- "Default arguments for evaluating an emacs-lisp source block.")
-
-(declare-function orgtbl-to-generic "org-table" (table params))
-
-(defun org-babel-expand-body:emacs-lisp (body params)
- "Expand BODY according to PARAMS, return the expanded body."
- (let* ((vars (mapcar #'cdr (org-babel-get-header params :var)))
- (result-params (cdr (assoc :result-params params)))
- (print-level nil) (print-length nil)
- (body (if (> (length vars) 0)
- (concat "(let ("
- (mapconcat
- (lambda (var)
- (format "%S" (print `(,(car var) ',(cdr var)))))
- vars "\n ")
- ")\n" body ")")
- body)))
- (if (or (member "code" result-params)
- (member "pp" result-params))
- (concat "(pp " body ")") body)))
-
-(defun org-babel-execute:emacs-lisp (body params)
- "Execute a block of emacs-lisp code with Babel."
- (save-window-excursion
- (org-babel-reassemble-table
- (eval (read (format "(progn %s)"
- (org-babel-expand-body:emacs-lisp body params))))
- (org-babel-pick-name (cdr (assoc :colname-names params))
- (cdr (assoc :colnames params)))
- (org-babel-pick-name (cdr (assoc :rowname-names params))
- (cdr (assoc :rownames params))))))
-
-(provide 'ob-emacs-lisp)
-
-;; arch-tag: e9a3acca-dc84-472a-9f5a-23c35befbcd6
-
-;;; ob-emacs-lisp.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-emacs-lisp.elc b/.emacs.d/org-7.4/lisp/ob-emacs-lisp.elc
deleted file mode 100644
index 09b4298..0000000
--- a/.emacs.d/org-7.4/lisp/ob-emacs-lisp.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-eval.el b/.emacs.d/org-7.4/lisp/ob-eval.el
deleted file mode 100644
index a71cb0d..0000000
--- a/.emacs.d/org-7.4/lisp/ob-eval.el
+++ /dev/null
@@ -1,262 +0,0 @@
-;;; ob-eval.el --- org-babel functions for external code evaluation
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Eric Schulte
-;; Keywords: literate programming, reproducible research, comint
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; These functions build existing Emacs support for executing external
-;; shell commands.
-
-;;; Code:
-(eval-when-compile (require 'cl))
-
-(defvar org-babel-error-buffer-name "*Org-Babel Error Output*")
-
-(defun org-babel-eval-error-notify (exit-code stderr)
- "Open a buffer to display STDERR and a message with the value of EXIT-CODE."
- (let ((buf (get-buffer-create org-babel-error-buffer-name)))
- (with-current-buffer buf
- (goto-char (point-max))
- (save-excursion (insert stderr)))
- (display-buffer buf))
- (message "Babel evaluation exited with code %S" exit-code))
-
-(defun org-babel-eval (cmd body)
- "Run CMD on BODY.
-If CMD succeeds then return its results, otherwise display
-STDERR with `org-babel-eval-error-notify'."
- (let ((err-buff (get-buffer-create " *Org-Babel Error*")) exit-code)
- (with-current-buffer err-buff (erase-buffer))
- (with-temp-buffer
- (insert body)
- (setq exit-code
- (org-babel-shell-command-on-region
- (point-min) (point-max) cmd t 'replace err-buff))
- (if (or (not (numberp exit-code)) (> exit-code 0))
- (progn
- (with-current-buffer err-buff
- (org-babel-eval-error-notify exit-code (buffer-string)))
- nil)
- (buffer-string)))))
-
-(defun org-babel-eval-read-file (file)
- "Return the contents of FILE as a string."
- (with-temp-buffer (insert-file-contents file)
- (buffer-string)))
-
-(defun org-babel-shell-command-on-region (start end command
- &optional output-buffer replace
- error-buffer display-error-buffer)
- "Execute COMMAND in an inferior shell with region as input.
-
-Fixes bugs in the emacs 23.1.1 version of `shell-command-on-region'
-
-Normally display output (if any) in temp buffer `*Shell Command Output*';
-Prefix arg means replace the region with it. Return the exit code of
-COMMAND.
-
-To specify a coding system for converting non-ASCII characters in
-the input and output to the shell command, use
-\\[universal-coding-system-argument] before this command. By
-default, the input (from the current buffer) is encoded in the
-same coding system that will be used to save the file,
-`buffer-file-coding-system'. If the output is going to replace
-the region, then it is decoded from that same coding system.
-
-The noninteractive arguments are START, END, COMMAND,
-OUTPUT-BUFFER, REPLACE, ERROR-BUFFER, and DISPLAY-ERROR-BUFFER.
-Noninteractive callers can specify coding systems by binding
-`coding-system-for-read' and `coding-system-for-write'.
-
-If the command generates output, the output may be displayed
-in the echo area or in a buffer.
-If the output is short enough to display in the echo area
-\(determined by the variable `max-mini-window-height' if
-`resize-mini-windows' is non-nil), it is shown there. Otherwise
-it is displayed in the buffer `*Shell Command Output*'. The output
-is available in that buffer in both cases.
-
-If there is output and an error, a message about the error
-appears at the end of the output.
-
-If there is no output, or if output is inserted in the current buffer,
-then `*Shell Command Output*' is deleted.
-
-If the optional fourth argument OUTPUT-BUFFER is non-nil,
-that says to put the output in some other buffer.
-If OUTPUT-BUFFER is a buffer or buffer name, put the output there.
-If OUTPUT-BUFFER is not a buffer and not nil,
-insert output in the current buffer.
-In either case, the output is inserted after point (leaving mark after it).
-
-If REPLACE, the optional fifth argument, is non-nil, that means insert
-the output in place of text from START to END, putting point and mark
-around it.
-
-If optional sixth argument ERROR-BUFFER is non-nil, it is a buffer
-or buffer name to which to direct the command's standard error output.
-If it is nil, error output is mingled with regular output.
-If DISPLAY-ERROR-BUFFER is non-nil, display the error buffer if there
-were any errors. (This is always t, interactively.)
-In an interactive call, the variable `shell-command-default-error-buffer'
-specifies the value of ERROR-BUFFER."
- (interactive (let (string)
- (unless (mark)
- (error "The mark is not set now, so there is no region"))
- ;; Do this before calling region-beginning
- ;; and region-end, in case subprocess output
- ;; relocates them while we are in the minibuffer.
- (setq string (read-shell-command "Shell command on region: "))
- ;; call-interactively recognizes region-beginning and
- ;; region-end specially, leaving them in the history.
- (list (region-beginning) (region-end)
- string
- current-prefix-arg
- current-prefix-arg
- shell-command-default-error-buffer
- t)))
- (let ((error-file
- (if error-buffer
- (make-temp-file
- (expand-file-name "scor"
- (if (featurep 'xemacs)
- (temp-directory)
- temporary-file-directory)))
- nil))
- exit-status)
- (if (or replace
- (and output-buffer
- (not (or (bufferp output-buffer) (stringp output-buffer)))))
- ;; Replace specified region with output from command.
- (let ((swap (and replace (< start end))))
- ;; Don't muck with mark unless REPLACE says we should.
- (goto-char start)
- (and replace (push-mark (point) 'nomsg))
- (setq exit-status
- (call-process-region start end shell-file-name t
- (if error-file
- (list output-buffer error-file)
- t)
- nil shell-command-switch command))
- ;; It is rude to delete a buffer which the command is not using.
- ;; (let ((shell-buffer (get-buffer "*Shell Command Output*")))
- ;; (and shell-buffer (not (eq shell-buffer (current-buffer)))
- ;; (kill-buffer shell-buffer)))
- ;; Don't muck with mark unless REPLACE says we should.
- (and replace swap (exchange-point-and-mark)))
- ;; No prefix argument: put the output in a temp buffer,
- ;; replacing its entire contents.
- (let ((buffer (get-buffer-create
- (or output-buffer "*Shell Command Output*"))))
- (unwind-protect
- (if (eq buffer (current-buffer))
- ;; If the input is the same buffer as the output,
- ;; delete everything but the specified region,
- ;; then replace that region with the output.
- (progn (setq buffer-read-only nil)
- (delete-region (max start end) (point-max))
- (delete-region (point-min) (min start end))
- (setq exit-status
- (call-process-region (point-min) (point-max)
- shell-file-name t
- (if error-file
- (list t error-file)
- t)
- nil shell-command-switch
- command)))
- ;; Clear the output buffer, then run the command with
- ;; output there.
- (let ((directory default-directory))
- (with-current-buffer buffer
- (setq buffer-read-only nil)
- (if (not output-buffer)
- (setq default-directory directory))
- (erase-buffer)))
- (setq exit-status
- (call-process-region start end shell-file-name nil
- (if error-file
- (list buffer error-file)
- buffer)
- nil shell-command-switch command)))
- ;; Report the output.
- (with-current-buffer buffer
- (setq mode-line-process
- (cond ((null exit-status)
- " - Error")
- ((stringp exit-status)
- (format " - Signal [%s]" exit-status))
- ((not (equal 0 exit-status))
- (format " - Exit [%d]" exit-status)))))
- (if (with-current-buffer buffer (> (point-max) (point-min)))
- ;; There's some output, display it
- (display-message-or-buffer buffer)
- ;; No output; error?
- (let ((output
- (if (and error-file
- (< 0 (nth 7 (file-attributes error-file))))
- "some error output"
- "no output")))
- (cond ((null exit-status)
- (message "(Shell command failed with error)"))
- ((equal 0 exit-status)
- (message "(Shell command succeeded with %s)"
- output))
- ((stringp exit-status)
- (message "(Shell command killed by signal %s)"
- exit-status))
- (t
- (message "(Shell command failed with code %d and %s)"
- exit-status output))))
- ;; Don't kill: there might be useful info in the undo-log.
- ;; (kill-buffer buffer)
- ))))
-
- (when (and error-file (file-exists-p error-file))
- (if (< 0 (nth 7 (file-attributes error-file)))
- (with-current-buffer (get-buffer-create error-buffer)
- (let ((pos-from-end (- (point-max) (point))))
- (or (bobp)
- (insert "\f\n"))
- ;; Do no formatting while reading error file,
- ;; because that can run a shell command, and we
- ;; don't want that to cause an infinite recursion.
- (format-insert-file error-file nil)
- ;; Put point after the inserted errors.
- (goto-char (- (point-max) pos-from-end)))
- (and display-error-buffer
- (display-buffer (current-buffer)))))
- (delete-file error-file))
- exit-status))
-
-(defun org-babel-eval-wipe-error-buffer ()
- "Delete the contents of the Org code block error buffer.
-This buffer is named by `org-babel-error-buffer-name'."
- (when (get-buffer org-babel-error-buffer-name)
- (with-current-buffer org-babel-error-buffer-name
- (delete-region (point-min) (point-max)))))
-
-(provide 'ob-eval)
-
-;; arch-tag: 5328b17f-957d-42d9-94da-a2952682d04d
-
-;;; ob-eval.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-eval.elc b/.emacs.d/org-7.4/lisp/ob-eval.elc
deleted file mode 100644
index ecd4637..0000000
--- a/.emacs.d/org-7.4/lisp/ob-eval.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-exp.el b/.emacs.d/org-7.4/lisp/ob-exp.el
deleted file mode 100644
index 8b6914c..0000000
--- a/.emacs.d/org-7.4/lisp/ob-exp.el
+++ /dev/null
@@ -1,328 +0,0 @@
-;;; ob-exp.el --- Exportation of org-babel source blocks
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Eric Schulte, Dan Davison
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; See the online documentation for more information
-;;
-;; http://orgmode.org/worg/org-contrib/babel/
-
-;;; Code:
-(require 'ob)
-(require 'org-exp-blocks)
-(eval-when-compile
- (require 'cl))
-
-(defvar obe-marker nil)
-(defvar org-current-export-file)
-(defvar org-babel-lob-one-liner-regexp)
-(defvar org-babel-ref-split-regexp)
-(declare-function org-babel-lob-get-info "ob-lob" ())
-(declare-function org-babel-eval-wipe-error-buffer "ob-eval" ())
-(add-to-list 'org-export-interblocks '(src org-babel-exp-inline-src-blocks))
-(add-to-list 'org-export-interblocks '(lob org-babel-exp-lob-one-liners))
-(add-hook 'org-export-blocks-postblock-hook 'org-exp-res/src-name-cleanup)
-
-(org-export-blocks-add-block '(src org-babel-exp-src-blocks nil))
-
-(defcustom org-export-babel-evaluate t
- "Switch controlling code evaluation during export.
-When set to nil no code will be evaluated as part of the export
-process."
- :group 'org-babel
- :type 'boolean)
-(put 'org-export-babel-evaluate 'safe-local-variable (lambda (x) (eq x nil)))
-
-(defvar org-babel-function-def-export-keyword "function"
- "The keyword to substitute for the source name line on export.
-When exporting a source block function, this keyword will
-appear in the exported version in the place of source name
-line. A source block is considered to be a source block function
-if the source name is present and is followed by a parenthesized
-argument list. The parentheses may be empty or contain
-whitespace. An example is the following which generates n random
-\(uniform) numbers.
-
-#+source: rand(n)
-#+begin_src R
- runif(n)
-#+end_src")
-
-(defvar org-babel-function-def-export-indent 4
- "Number of characters to indent a source block on export.
-When exporting a source block function, the block contents will
-be indented by this many characters. See
-`org-babel-function-def-export-name' for the definition of a
-source block function.")
-
-(defmacro org-babel-exp-in-export-file (&rest body)
- `(let* ((lang-headers (intern (concat "org-babel-default-header-args:" lang)))
- (heading (nth 4 (ignore-errors (org-heading-components))))
- (link (when org-current-export-file
- (org-make-link-string
- (if heading
- (concat org-current-export-file "::" heading)
- org-current-export-file))))
- (export-buffer (current-buffer)) results)
- (when link
- ;; resolve parameters in the original file so that
- ;; headline and file-wide parameters are included, attempt
- ;; to go to the same heading in the original file
- (set-buffer (get-file-buffer org-current-export-file))
- (save-restriction
- (condition-case nil
- (org-open-link-from-string link)
- (error (when heading
- (goto-char (point-min))
- (re-search-forward (regexp-quote heading) nil t))))
- (setq results ,@body))
- (set-buffer export-buffer)
- results)))
-
-(defun org-babel-exp-src-blocks (body &rest headers)
- "Process source block for export.
-Depending on the 'export' headers argument in replace the source
-code block with...
-
-both ---- display the code and the results
-
-code ---- the default, display the code inside the block but do
- not process
-
-results - just like none only the block is run on export ensuring
- that it's results are present in the org-mode buffer
-
-none ----- do not display either code or results upon export"
- (interactive)
- (message "org-babel-exp processing...")
- (save-excursion
- (goto-char (match-beginning 0))
- (let* ((info (org-babel-get-src-block-info 'light))
- (lang (nth 0 info))
- (raw-params (nth 2 info)))
- ;; bail if we couldn't get any info from the block
- (when info
- (org-babel-exp-in-export-file
- (setf (nth 2 info)
- (org-babel-merge-params
- org-babel-default-header-args
- (org-babel-params-from-buffer)
- (org-babel-params-from-properties lang)
- (if (boundp lang-headers) (eval lang-headers) nil)
- raw-params)))
- ;; expand noweb references in the original file
- (setf (nth 1 info)
- (if (and (cdr (assoc :noweb (nth 2 info)))
- (string= "yes" (cdr (assoc :noweb (nth 2 info)))))
- (org-babel-expand-noweb-references
- info (get-file-buffer org-current-export-file))
- (nth 1 info)))
- (org-babel-exp-do-export info 'block)))))
-
-(defun org-babel-exp-inline-src-blocks (start end)
- "Process inline source blocks between START and END for export.
-See `org-babel-exp-src-blocks' for export options, currently the
-options and are taken from `org-babel-default-inline-header-args'."
- (interactive)
- (save-excursion
- (goto-char start)
- (while (and (< (point) end)
- (re-search-forward org-babel-inline-src-block-regexp end t))
- (let* ((info (save-match-data (org-babel-parse-inline-src-block-match)))
- (params (nth 2 info))
- (replacement
- (save-match-data
- (if (org-babel-in-example-or-verbatim)
- (buffer-substring (match-beginning 0) (match-end 0))
- ;; expand noweb references in the original file
- (setf (nth 1 info)
- (if (and (cdr (assoc :noweb params))
- (string= "yes" (cdr (assoc :noweb params))))
- (org-babel-expand-noweb-references
- info (get-file-buffer org-current-export-file))
- (nth 1 info)))
- (org-babel-exp-do-export info 'inline)))))
- (setq end (+ end (- (length replacement) (length (match-string 1)))))
- (replace-match replacement t t nil 1)))))
-
-(defun org-exp-res/src-name-cleanup ()
- "Clean up #+results and #+srcname lines for export.
-This function should only be called after all block processing
-has taken place."
- (interactive)
- (save-excursion
- (goto-char (point-min))
- (while (org-re-search-forward-unprotected
- (concat
- "\\("org-babel-src-name-regexp"\\|"org-babel-result-regexp"\\)")
- nil t)
- (delete-region
- (progn (beginning-of-line) (point))
- (progn (end-of-line) (+ 1 (point)))))))
-
-(defun org-babel-in-example-or-verbatim ()
- "Return true if point is in example or verbatim code.
-Example and verbatim code include escaped portions of
-an org-mode buffer code that should be treated as normal
-org-mode text."
- (or (org-in-indented-comment-line)
- (save-excursion
- (save-match-data
- (goto-char (point-at-bol))
- (looking-at "[ \t]*:[ \t]")))
- (org-in-regexps-block-p "^[ \t]*#\\+begin_src" "^[ \t]*#\\+end_src")))
-
-(defun org-babel-exp-lob-one-liners (start end)
- "Process Library of Babel calls between START and END for export.
-See `org-babel-exp-src-blocks' for export options. Currently the
-options are taken from `org-babel-default-header-args'."
- (interactive)
- (let (replacement)
- (save-excursion
- (goto-char start)
- (while (and (< (point) end)
- (re-search-forward org-babel-lob-one-liner-regexp nil t))
- (setq replacement
- (let ((lob-info (org-babel-lob-get-info)))
- (save-match-data
- (org-babel-exp-do-export
- (list "emacs-lisp" "results"
- (org-babel-merge-params
- org-babel-default-header-args
- (org-babel-params-from-buffer)
- (org-babel-params-from-properties)
- (org-babel-parse-header-arguments
- (org-babel-clean-text-properties
- (concat ":var results="
- (mapconcat #'identity
- (butlast lob-info) " ")))))
- (car (last lob-info)))
- 'lob))))
- (setq end (+ end (- (length replacement) (length (match-string 0)))))
- (replace-match replacement t t)))))
-
-(defun org-babel-exp-do-export (info type)
- "Return a string with the exported content of a code block.
-The function respects the value of the :exports header argument."
- (flet ((silently () (let ((session (cdr (assoc :session (nth 2 info)))))
- (when (and session
- (not (equal "none" session)))
- (org-babel-exp-results info type 'silent))))
- (clean () (org-babel-remove-result info)))
- (case (intern (or (cdr (assoc :exports (nth 2 info))) "code"))
- ('none (silently) (clean) "")
- ('code (silently) (clean) (org-babel-exp-code info type))
- ('results (org-babel-exp-results info type))
- ('both (concat (org-babel-exp-code info type)
- "\n\n"
- (org-babel-exp-results info type))))))
-
-(defvar backend)
-(defun org-babel-exp-code (info type)
- "Prepare and return code in the current code block for export.
-Code is prepared in a manner suitable for export by
-org-mode. This function is called by `org-babel-exp-do-export'.
-The code block is not evaluated."
- (let ((lang (nth 0 info))
- (body (nth 1 info))
- (switches (nth 3 info))
- (name (nth 4 info))
- (args (mapcar #'cdr (org-babel-get-header (nth 2 info) :var))))
- (case type
- ('inline (format "=%s=" body))
- ('block
- (let ((str
- (format "#+BEGIN_SRC %s %s\n%s%s#+END_SRC\n" lang switches body
- (if (and body (string-match "\n$" body))
- "" "\n"))))
- (when name
- (add-text-properties
- 0 (length str)
- (list 'org-caption
- (format "%s(%s)"
- name
- (mapconcat #'identity args ", ")))
- str))
- str))
- ('lob
- (let ((call-line (and (string-match "results=" (car args))
- (substring (car args) (match-end 0)))))
- (cond
- ((eq backend 'html)
- (format "\n#+HTML: <label class=\"org-src-name\">%s</label>\n"
- call-line))
- ((format ": %s\n" call-line))))))))
-
-(defun org-babel-exp-results (info type &optional silent)
- "Evaluate and return the results of the current code block for export.
-Results are prepared in a manner suitable for export by org-mode.
-This function is called by `org-babel-exp-do-export'. The code
-block will be evaluated. Optional argument SILENT can be used to
-inhibit insertion of results into the buffer."
- (or
- (when org-export-babel-evaluate
- (let ((lang (nth 0 info))
- (body (nth 1 info)))
- (setf (nth 2 info) (org-babel-exp-in-export-file
- (org-babel-process-params (nth 2 info))))
- ;; skip code blocks which we can't evaluate
- (when (fboundp (intern (concat "org-babel-execute:" lang)))
- (org-babel-eval-wipe-error-buffer)
- (if (equal type 'inline)
- (let ((raw (org-babel-execute-src-block
- nil info '((:results . "silent"))))
- (result-params (split-string
- (cdr (assoc :results (nth 2 info))))))
- (unless silent
- (cond ;; respect the value of the :results header argument
- ((member "file" result-params)
- (org-babel-result-to-file raw))
- ((or (member "raw" result-params)
- (member "org" result-params))
- (format "%s" raw))
- ((member "code" result-params)
- (format "src_%s{%s}" lang raw))
- (t
- (if (stringp raw)
- (if (= 0 (length raw)) "=(no results)="
- (format "%s" raw))
- (format "%S" raw))))))
- (prog1 nil
- (setf (nth 2 info)
- (org-babel-merge-params
- (nth 2 info)
- `((:results . ,(if silent "silent" "replace")))))
- (cond
- ((equal type 'block) (org-babel-execute-src-block nil info))
- ((equal type 'lob)
- (save-excursion
- (re-search-backward org-babel-lob-one-liner-regexp nil t)
- (org-babel-execute-src-block nil info)))))))))
- ""))
-
-(provide 'ob-exp)
-
-;; arch-tag: 523abf4c-76d1-44ed-9f27-e3bddf34bf0f
-
-;;; ob-exp.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-exp.elc b/.emacs.d/org-7.4/lisp/ob-exp.elc
deleted file mode 100644
index 731f574..0000000
--- a/.emacs.d/org-7.4/lisp/ob-exp.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-gnuplot.el b/.emacs.d/org-7.4/lisp/ob-gnuplot.el
deleted file mode 100644
index 423e47e..0000000
--- a/.emacs.d/org-7.4/lisp/ob-gnuplot.el
+++ /dev/null
@@ -1,235 +0,0 @@
-;;; ob-gnuplot.el --- org-babel functions for gnuplot evaluation
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Eric Schulte
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Org-Babel support for evaluating gnuplot source code.
-;;
-;; This differs from most standard languages in that
-;;
-;; 1) we are generally only going to return results of type "file"
-;;
-;; 2) we are adding the "file" and "cmdline" header arguments
-
-;;; Requirements:
-
-;; - gnuplot :: http://www.gnuplot.info/
-;;
-;; - gnuplot-mode :: http://cars9.uchicago.edu/~ravel/software/gnuplot-mode.html
-
-;;; Code:
-(require 'ob)
-(require 'ob-ref)
-(require 'ob-comint)
-(eval-when-compile (require 'cl))
-
-(declare-function org-time-string-to-time "org" (s))
-(declare-function org-combine-plists "org" (&rest plists))
-(declare-function orgtbl-to-generic "org-table" (table params))
-(declare-function gnuplot-mode "ext:gnuplot-mode" ())
-(declare-function gnuplot-send-string-to-gnuplot "ext:gnuplot-mode" (str txt))
-(declare-function gnuplot-send-buffer-to-gnuplot "ext:gnuplot-mode" ())
-
-(defvar org-babel-default-header-args:gnuplot
- '((:results . "file") (:exports . "results") (:session . nil))
- "Default arguments to use when evaluating a gnuplot source block.")
-
-(defvar org-babel-gnuplot-timestamp-fmt nil)
-
-(defun org-babel-gnuplot-process-vars (params)
- "Extract variables from PARAMS and process the variables.
-Dumps all vectors into files and returns an association list
-of variable names and the related value to be used in the gnuplot
-code."
- (mapcar
- (lambda (pair)
- (cons
- (car pair) ;; variable name
- (if (listp (cdr pair)) ;; variable value
- (org-babel-gnuplot-table-to-data
- (cdr pair) (org-babel-temp-file "gnuplot-") params)
- (cdr pair))))
- (mapcar #'cdr (org-babel-get-header params :var))))
-
-(defun org-babel-expand-body:gnuplot (body params)
- "Expand BODY according to PARAMS, return the expanded body."
- (save-window-excursion
- (let* ((vars (org-babel-gnuplot-process-vars params))
- (out-file (cdr (assoc :file params)))
- (term (or (cdr (assoc :term params))
- (when out-file (file-name-extension out-file))))
- (cmdline (cdr (assoc :cmdline params)))
- (title (plist-get params :title))
- (lines (plist-get params :line))
- (sets (plist-get params :set))
- (x-labels (plist-get params :xlabels))
- (y-labels (plist-get params :ylabels))
- (timefmt (plist-get params :timefmt))
- (time-ind (or (plist-get params :timeind)
- (when timefmt 1)))
- output)
- (flet ((add-to-body (text)
- (setq body (concat text "\n" body))))
- ;; append header argument settings to body
- (when title (add-to-body (format "set title '%s'" title))) ;; title
- (when lines (mapc (lambda (el) (add-to-body el)) lines)) ;; line
- (when sets
- (mapc (lambda (el) (add-to-body (format "set %s" el))) sets))
- (when x-labels
- (add-to-body
- (format "set xtics (%s)"
- (mapconcat (lambda (pair)
- (format "\"%s\" %d" (cdr pair) (car pair)))
- x-labels ", "))))
- (when y-labels
- (add-to-body
- (format "set ytics (%s)"
- (mapconcat (lambda (pair)
- (format "\"%s\" %d" (cdr pair) (car pair)))
- y-labels ", "))))
- (when time-ind
- (add-to-body "set xdata time")
- (add-to-body (concat "set timefmt \""
- (or timefmt
- "%Y-%m-%d-%H:%M:%S") "\"")))
- (when out-file (add-to-body (format "set output \"%s\"" out-file)))
- (when term (add-to-body (format "set term %s" term)))
- ;; insert variables into code body: this should happen last
- ;; placing the variables at the *top* of the code in case their
- ;; values are used later
- (add-to-body (mapconcat #'identity
- (org-babel-variable-assignments:gnuplot params)
- "\n"))
- ;; replace any variable names preceded by '$' with the actual
- ;; value of the variable
- (mapc (lambda (pair)
- (setq body (replace-regexp-in-string
- (format "\\$%s" (car pair)) (cdr pair) body)))
- vars))
- body)))
-
-(defun org-babel-execute:gnuplot (body params)
- "Execute a block of Gnuplot code.
-This function is called by `org-babel-execute-src-block'."
- (require 'gnuplot)
- (let ((session (cdr (assoc :session params)))
- (result-type (cdr (assoc :results params)))
- (out-file (cdr (assoc :file params)))
- (body (org-babel-expand-body:gnuplot body params))
- output)
- (save-window-excursion
- ;; evaluate the code body with gnuplot
- (if (string= session "none")
- (let ((script-file (org-babel-temp-file "gnuplot-script-")))
- (with-temp-file script-file
- (insert (concat body "\n")))
- (message "gnuplot \"%s\"" script-file)
- (setq output
- (shell-command-to-string
- (format
- "gnuplot \"%s\""
- (org-babel-process-file-name script-file))))
- (message output))
- (with-temp-buffer
- (insert (concat body "\n"))
- (gnuplot-mode)
- (gnuplot-send-buffer-to-gnuplot)))
- (if (member "output" (split-string result-type))
- output
- out-file))))
-
-(defun org-babel-prep-session:gnuplot (session params)
- "Prepare SESSION according to the header arguments in PARAMS."
- (let* ((session (org-babel-gnuplot-initiate-session session))
- (var-lines (org-babel-variable-assignments:gnuplot params)))
- (message "%S" session)
- (org-babel-comint-in-buffer session
- (mapc (lambda (var-line)
- (insert var-line) (comint-send-input nil t)
- (org-babel-comint-wait-for-output session)
- (sit-for .1) (goto-char (point-max))) var-lines))
- session))
-
-(defun org-babel-load-session:gnuplot (session body params)
- "Load BODY into SESSION."
- (save-window-excursion
- (let ((buffer (org-babel-prep-session:gnuplot session params)))
- (with-current-buffer buffer
- (goto-char (process-mark (get-buffer-process (current-buffer))))
- (insert (org-babel-chomp body)))
- buffer)))
-
-(defun org-babel-variable-assignments:gnuplot (params)
- "Return list of gnuplot statements assigning the block's variables"
- (mapcar
- (lambda (pair) (format "%s = \"%s\"" (car pair) (cdr pair)))
- (org-babel-gnuplot-process-vars params)))
-
-(defvar gnuplot-buffer)
-(defun org-babel-gnuplot-initiate-session (&optional session params)
- "Initiate a gnuplot session.
-If there is not a current inferior-process-buffer in SESSION
-then create one. Return the initialized session. The current
-`gnuplot-mode' doesn't provide support for multiple sessions."
- (require 'gnuplot)
- (unless (string= session "none")
- (save-window-excursion
- (gnuplot-send-string-to-gnuplot "" "line")
- gnuplot-buffer)))
-
-(defun org-babel-gnuplot-quote-timestamp-field (s)
- "Convert S from timestamp to Unix time and export to gnuplot."
- (format-time-string org-babel-gnuplot-timestamp-fmt (org-time-string-to-time s)))
-
-(defvar org-table-number-regexp)
-(defvar org-ts-regexp3)
-(defun org-babel-gnuplot-quote-tsv-field (s)
- "Quote S for export to gnuplot."
- (unless (stringp s)
- (setq s (format "%s" s)))
- (if (string-match org-table-number-regexp s) s
- (if (string-match org-ts-regexp3 s)
- (org-babel-gnuplot-quote-timestamp-field s)
- (concat "\"" (mapconcat 'identity (split-string s "\"") "\"\"") "\""))))
-
-(defun org-babel-gnuplot-table-to-data (table data-file params)
- "Export TABLE to DATA-FILE in a format readable by gnuplot.
-Pass PARAMS through to `orgtbl-to-generic' when exporting TABLE."
- (with-temp-file data-file
- (make-local-variable 'org-babel-gnuplot-timestamp-fmt)
- (setq org-babel-gnuplot-timestamp-fmt (or
- (plist-get params :timefmt)
- "%Y-%m-%d-%H:%M:%S"))
- (insert (orgtbl-to-generic
- table
- (org-combine-plists
- '(:sep "\t" :fmt org-babel-gnuplot-quote-tsv-field)
- params))))
- data-file)
-
-(provide 'ob-gnuplot)
-
-;; arch-tag: 50490ace-a9e1-4b29-a6e5-0db9f16c610b
-
-;;; ob-gnuplot.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-gnuplot.elc b/.emacs.d/org-7.4/lisp/ob-gnuplot.elc
deleted file mode 100644
index 99d4f3c..0000000
--- a/.emacs.d/org-7.4/lisp/ob-gnuplot.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-haskell.el b/.emacs.d/org-7.4/lisp/ob-haskell.el
deleted file mode 100644
index 734e1f6..0000000
--- a/.emacs.d/org-7.4/lisp/ob-haskell.el
+++ /dev/null
@@ -1,217 +0,0 @@
-;;; ob-haskell.el --- org-babel functions for haskell evaluation
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Eric Schulte
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Org-Babel support for evaluating haskell source code. This one will
-;; be sort of tricky because haskell programs must be compiled before
-;; they can be run, but haskell code can also be run through an
-;; interactive interpreter.
-;;
-;; For now lets only allow evaluation using the haskell interpreter.
-
-;;; Requirements:
-
-;; - haskell-mode :: http://www.iro.umontreal.ca/~monnier/elisp/#haskell-mode
-;;
-;; - inf-haskell :: http://www.iro.umontreal.ca/~monnier/elisp/#haskell-mode
-;;
-;; - (optionally) lhs2tex :: http://people.cs.uu.nl/andres/lhs2tex/
-
-;;; Code:
-(require 'ob)
-(require 'ob-comint)
-(require 'comint)
-(eval-when-compile (require 'cl))
-
-(declare-function org-remove-indentation "org" (code &optional n))
-(declare-function haskell-mode "ext:haskell-mode" ())
-(declare-function run-haskell "ext:inf-haskell" (&optional arg))
-(declare-function inferior-haskell-load-file
- "ext:inf-haskell" (&optional reload))
-
-(add-to-list 'org-babel-tangle-lang-exts '("haskell" . "hs"))
-
-(defvar org-babel-default-header-args:haskell '())
-
-(defvar org-babel-haskell-lhs2tex-command "lhs2tex")
-
-(defvar org-babel-haskell-eoe "\"org-babel-haskell-eoe\"")
-
-(defun org-babel-execute:haskell (body params)
- "Execute a block of Haskell code."
- (let* ((session (cdr (assoc :session params)))
- (vars (mapcar #'cdr (org-babel-get-header params :var)))
- (result-type (cdr (assoc :result-type params)))
- (full-body (org-babel-expand-body:generic
- body params
- (org-babel-variable-assignments:haskell params)))
- (session (org-babel-haskell-initiate-session session params))
- (raw (org-babel-comint-with-output
- (session org-babel-haskell-eoe t full-body)
- (insert (org-babel-trim full-body))
- (comint-send-input nil t)
- (insert org-babel-haskell-eoe)
- (comint-send-input nil t)))
- (results (mapcar
- #'org-babel-haskell-read-string
- (cdr (member org-babel-haskell-eoe
- (reverse (mapcar #'org-babel-trim raw)))))))
- (org-babel-reassemble-table
- (cond
- ((equal result-type 'output)
- (mapconcat #'identity (reverse (cdr results)) "\n"))
- ((equal result-type 'value)
- (org-babel-haskell-table-or-string (car results))))
- (org-babel-pick-name (cdr (assoc :colname-names params))
- (cdr (assoc :colname-names params)))
- (org-babel-pick-name (cdr (assoc :rowname-names params))
- (cdr (assoc :rowname-names params))))))
-
-(defun org-babel-haskell-read-string (string)
- "Strip \\\"s from around a haskell string."
- (if (string-match "^\"\\([^\000]+\\)\"$" string)
- (match-string 1 string)
- string))
-
-(defun org-babel-haskell-initiate-session (&optional session params)
- "Initiate a haskell session.
-If there is not a current inferior-process-buffer in SESSION
-then create one. Return the initialized session."
- (require 'inf-haskell)
- (or (get-buffer "*haskell*")
- (save-window-excursion (run-haskell) (sleep-for 0.25) (current-buffer))))
-
-(defun org-babel-load-session:haskell (session body params)
- "Load BODY into SESSION."
- (save-window-excursion
- (let* ((buffer (org-babel-prep-session:haskell session params))
- (load-file (concat (org-babel-temp-file "haskell-load-") ".hs")))
- (with-temp-buffer
- (insert body) (write-file load-file)
- (haskell-mode) (inferior-haskell-load-file))
- buffer)))
-
-(defun org-babel-prep-session:haskell (session params)
- "Prepare SESSION according to the header arguments in PARAMS."
- (save-window-excursion
- (let ((buffer (org-babel-haskell-initiate-session session)))
- (org-babel-comint-in-buffer buffer
- (mapc (lambda (line)
- (insert line)
- (comint-send-input nil t))
- (org-babel-variable-assignments:haskell params)))
- (current-buffer))))
-
-(defun org-babel-variable-assignments:haskell (params)
- "Return list of haskell statements assigning the block's variables"
- (mapcar (lambda (pair)
- (format "let %s = %s"
- (car pair)
- (org-babel-haskell-var-to-haskell (cdr pair))))
- (mapcar #'cdr (org-babel-get-header params :var))))
-
-(defun org-babel-haskell-table-or-string (results)
- "Convert RESULTS to an Emacs-lisp table or string.
-If RESULTS look like a table, then convert them into an
-Emacs-lisp table, otherwise return the results as a string."
- (org-babel-script-escape results))
-
-(defun org-babel-haskell-var-to-haskell (var)
- "Convert an elisp value VAR into a haskell variable.
-The elisp VAR is converted to a string of haskell source code
-specifying a variable of the same value."
- (if (listp var)
- (concat "[" (mapconcat #'org-babel-haskell-var-to-haskell var ", ") "]")
- (format "%S" var)))
-
-(defvar org-src-preserve-indentation)
-(defun org-babel-haskell-export-to-lhs (&optional arg)
- "Export to a .lhs file with all haskell code blocks escaped.
-When called with a prefix argument the resulting
-.lhs file will be exported to a .tex file. This function will
-create two new files, base-name.lhs and base-name.tex where
-base-name is the name of the current org-mode file.
-
-Note that all standard Babel literate programming
-constructs (header arguments, no-web syntax etc...) are ignored."
- (interactive "P")
- (let* ((contents (buffer-string))
- (haskell-regexp
- (concat "^\\([ \t]*\\)#\\+begin_src[ \t]haskell*\\(.*\\)?[\r\n]"
- "\\([^\000]*?\\)[\r\n][ \t]*#\\+end_src.*"))
- (base-name (file-name-sans-extension (buffer-file-name)))
- (tmp-file (org-babel-temp-file "haskell-"))
- (tmp-org-file (concat tmp-file ".org"))
- (tmp-tex-file (concat tmp-file ".tex"))
- (lhs-file (concat base-name ".lhs"))
- (tex-file (concat base-name ".tex"))
- (command (concat org-babel-haskell-lhs2tex-command
- " " (org-babel-process-file-name lhs-file)
- " > " (org-babel-process-file-name tex-file)))
- (preserve-indentp org-src-preserve-indentation)
- indentation)
- ;; escape haskell source-code blocks
- (with-temp-file tmp-org-file
- (insert contents)
- (goto-char (point-min))
- (while (re-search-forward haskell-regexp nil t)
- (save-match-data (setq indentation (length (match-string 1))))
- (replace-match (save-match-data
- (concat
- "#+begin_latex\n\\begin{code}\n"
- (if (or preserve-indentp
- (string-match "-i" (match-string 2)))
- (match-string 3)
- (org-remove-indentation (match-string 3)))
- "\n\\end{code}\n#+end_latex\n"))
- t t)
- (indent-code-rigidly (match-beginning 0) (match-end 0) indentation)))
- (save-excursion
- ;; export to latex w/org and save as .lhs
- (find-file tmp-org-file) (funcall 'org-export-as-latex nil)
- (kill-buffer)
- (delete-file tmp-org-file)
- (find-file tmp-tex-file)
- (goto-char (point-min)) (forward-line 2)
- (insert "%include polycode.fmt\n")
- ;; ensure all \begin/end{code} statements start at the first column
- (while (re-search-forward "^[ \t]+\\\\begin{code}[^\000]+\\\\end{code}" nil t)
- (replace-match (save-match-data (org-remove-indentation (match-string 0)))
- t t))
- (setq contents (buffer-string))
- (save-buffer) (kill-buffer))
- (delete-file tmp-tex-file)
- ;; save org exported latex to a .lhs file
- (with-temp-file lhs-file (insert contents))
- (if (not arg)
- (find-file lhs-file)
- ;; process .lhs file with lhs2tex
- (message "running %s" command) (shell-command command) (find-file tex-file))))
-
-(provide 'ob-haskell)
-
-;; arch-tag: b53f75f3-ba1a-4b05-82d9-a2a0d4e70804
-
-;;; ob-haskell.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-haskell.elc b/.emacs.d/org-7.4/lisp/ob-haskell.elc
deleted file mode 100644
index 3dbdc46..0000000
--- a/.emacs.d/org-7.4/lisp/ob-haskell.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-js.el b/.emacs.d/org-7.4/lisp/ob-js.el
deleted file mode 100644
index 05f8ea4..0000000
--- a/.emacs.d/org-7.4/lisp/ob-js.el
+++ /dev/null
@@ -1,165 +0,0 @@
-;;; ob-js.el --- org-babel functions for Javascript
-
-;; Copyright (C) 2010 Free Software Foundation
-
-;; Author: Eric Schulte
-;; Keywords: literate programming, reproducible research, js
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;;; License:
-
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; Now working with SBCL for both session and external evaluation.
-;;
-;; This certainly isn't optimally robust, but it seems to be working
-;; for the basic use cases.
-
-;;; Requirements:
-
-;; - a non-browser javascript engine such as node.js http://nodejs.org/
-;; or mozrepl http://wiki.github.com/bard/mozrepl/
-;;
-;; - for session based evaluation mozrepl and moz.el are required see
-;; http://wiki.github.com/bard/mozrepl/emacs-integration for
-;; configuration instructions
-
-;;; Code:
-(require 'ob)
-(require 'ob-ref)
-(require 'ob-comint)
-(require 'ob-eval)
-(eval-when-compile (require 'cl))
-
-(declare-function run-mozilla "ext:moz" (arg))
-
-(defvar org-babel-default-header-args:js '()
- "Default header arguments for js code blocks.")
-
-(defvar org-babel-js-eoe "org-babel-js-eoe"
- "String to indicate that evaluation has completed.")
-
-(defcustom org-babel-js-cmd "node"
- "Name of command used to evaluate js blocks."
- :group 'org-babel
- :type 'string)
-
-(defvar org-babel-js-function-wrapper
- "require('sys').print(require('sys').inspect(function(){%s}()));"
- "Javascript code to print value of body.")
-
-(defun org-babel-execute:js (body params)
- "Execute a block of Javascript code with org-babel.
-This function is called by `org-babel-execute-src-block'"
- (let* ((org-babel-js-cmd (or (cdr (assoc :cmd params)) org-babel-js-cmd))
- (result-type (cdr (assoc :result-type params)))
- (full-body (org-babel-expand-body:generic
- body params (org-babel-variable-assignments:js params))))
- (org-babel-js-read
- (if (not (string= (cdr (assoc :session params)) "none"))
- ;; session evaluation
- (let ((session (org-babel-prep-session:js
- (cdr (assoc :session params)) params)))
- (nth 1
- (org-babel-comint-with-output
- (session (format "%S" org-babel-js-eoe) t body)
- (mapc
- (lambda (line)
- (insert (org-babel-chomp line)) (comint-send-input nil t))
- (list body (format "%S" org-babel-js-eoe))))))
- ;; external evaluation
- (let ((script-file (org-babel-temp-file "js-script-")))
- (with-temp-file script-file
- (insert
- ;; return the value or the output
- (if (string= result-type "value")
- (format org-babel-js-function-wrapper full-body)
- full-body)))
- (org-babel-eval
- (format "%s %s" org-babel-js-cmd
- (org-babel-process-file-name script-file)) ""))))))
-
-(defun org-babel-js-read (results)
- "Convert RESULTS into an appropriate elisp value.
-If RESULTS look like a table, then convert them into an
-Emacs-lisp table, otherwise return the results as a string."
- (org-babel-read
- (if (and (stringp results) (string-match "^\\[.+\\]$" results))
- (org-babel-read
- (concat "'"
- (replace-regexp-in-string
- "\\[" "(" (replace-regexp-in-string
- "\\]" ")" (replace-regexp-in-string
- ", " " " (replace-regexp-in-string
- "'" "\"" results))))))
- results)))
-
-(defun org-babel-js-var-to-js (var)
- "Convert VAR into a js variable.
-Convert an elisp value into a string of js source code
-specifying a variable of the same value."
- (if (listp var)
- (concat "[" (mapconcat #'org-babel-js-var-to-js var ", ") "]")
- (format "%S" var)))
-
-(defun org-babel-prep-session:js (session params)
- "Prepare SESSION according to the header arguments specified in PARAMS."
- (let* ((session (org-babel-js-initiate-session session))
- (var-lines (org-babel-variable-assignments:js params)))
- (when session
- (org-babel-comint-in-buffer session
- (sit-for .5) (goto-char (point-max))
- (mapc (lambda (var)
- (insert var) (comint-send-input nil t)
- (org-babel-comint-wait-for-output session)
- (sit-for .1) (goto-char (point-max))) var-lines)))
- session))
-
-(defun org-babel-variable-assignments:js (params)
- "Return list of Javascript statements assigning the block's variables"
- (mapcar
- (lambda (pair) (format "var %s=%s;"
- (car pair) (org-babel-js-var-to-js (cdr pair))))
- (mapcar #'cdr (org-babel-get-header params :var))))
-
-(defun org-babel-js-initiate-session (&optional session)
- "If there is not a current inferior-process-buffer in SESSION
-then create. Return the initialized session."
- (unless (string= session "none")
- (cond
- ((string= "mozrepl" org-babel-js-cmd)
- (require 'moz)
- (let ((session-buffer (save-window-excursion
- (run-mozilla nil)
- (rename-buffer session)
- (current-buffer))))
- (if (org-babel-comint-buffer-livep session-buffer)
- (progn (sit-for .25) session-buffer)
- (sit-for .5)
- (org-babel-js-initiate-session session))))
- ((string= "node" org-babel-js-cmd )
- (error "session evaluation with node.js is not supported"))
- (t
- (error "sessions are only supported with mozrepl add \":cmd mozrepl\"")))))
-
-(provide 'ob-js)
-
-;; arch-tag: 84401fb3-b8d9-4bb6-9a90-cbe2d103d494
-
-;;; ob-js.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-js.elc b/.emacs.d/org-7.4/lisp/ob-js.elc
deleted file mode 100644
index f4e26d3..0000000
--- a/.emacs.d/org-7.4/lisp/ob-js.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-keys.el b/.emacs.d/org-7.4/lisp/ob-keys.el
deleted file mode 100644
index af81906..0000000
--- a/.emacs.d/org-7.4/lisp/ob-keys.el
+++ /dev/null
@@ -1,98 +0,0 @@
-;;; ob-keys.el --- key bindings for org-babel
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Eric Schulte
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Add org-babel keybindings to the org-mode keymap for exposing
-;; org-babel functions. These will all share a common prefix. See
-;; the value of `org-babel-key-bindings' for a list of interactive
-;; functions and their associated keys.
-
-;;; Code:
-(require 'ob)
-
-(defvar org-babel-key-prefix "\C-c\C-v"
- "The key prefix for Babel interactive key-bindings.
-See `org-babel-key-bindings' for the list of interactive babel
-functions which are assigned key bindings, and see
-`org-babel-map' for the actual babel keymap.")
-
-(defvar org-babel-map (make-sparse-keymap)
- "The keymap for interactive Babel functions.")
-
-;;;###autoload
-(defun org-babel-describe-bindings ()
- "Describe all keybindings behind `org-babel-key-prefix'."
- (interactive)
- (describe-bindings org-babel-key-prefix))
-
-(defvar org-babel-key-bindings
- '(("p" . org-babel-previous-src-block)
- ("\C-p" . org-babel-previous-src-block)
- ("n" . org-babel-next-src-block)
- ("\C-n" . org-babel-next-src-block)
- ("e" . org-babel-execute-maybe)
- ("\C-e" . org-babel-execute-maybe)
- ("o" . org-babel-open-src-block-result)
- ("\C-o" . org-babel-open-src-block-result)
- ("\C-v" . org-babel-expand-src-block)
- ("v" . org-babel-expand-src-block)
- ("u" . org-babel-goto-src-block-head)
- ("\C-u" . org-babel-goto-src-block-head)
- ("g" . org-babel-goto-named-src-block)
- ("r" . org-babel-goto-named-result)
- ("\C-r" . org-babel-goto-named-result)
- ("\C-b" . org-babel-execute-buffer)
- ("b" . org-babel-execute-buffer)
- ("\C-s" . org-babel-execute-subtree)
- ("s" . org-babel-execute-subtree)
- ("\C-d" . org-babel-demarcate-block)
- ("d" . org-babel-demarcate-block)
- ("\C-t" . org-babel-tangle)
- ("t" . org-babel-tangle)
- ("\C-f" . org-babel-tangle-file)
- ("f" . org-babel-tangle-file)
- ("\C-l" . org-babel-load-in-session)
- ("l" . org-babel-load-in-session)
- ("\C-i" . org-babel-lob-ingest)
- ("i" . org-babel-lob-ingest)
- ("\C-z" . org-babel-switch-to-session)
- ("z" . org-babel-switch-to-session-with-code)
- ("\C-a" . org-babel-sha1-hash)
- ("a" . org-babel-sha1-hash)
- ("h" . org-babel-describe-bindings)
- ("\C-x" . org-babel-do-key-sequence-in-edit-buffer)
- ("x" . org-babel-do-key-sequence-in-edit-buffer)
- ("\C-\M-h" . org-babel-mark-block))
- "Alist of key bindings and interactive Babel functions.
-This list associates interactive Babel functions
-with keys. Each element of this list will add an entry to the
-`org-babel-map' using the letter key which is the `car' of the
-a-list placed behind the generic `org-babel-key-prefix'.")
-
-(provide 'ob-keys)
-
-;; arch-tag: 01e348ee-4906-46fa-839a-6b7b6f989048
-
-;;; ob-keys.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-keys.elc b/.emacs.d/org-7.4/lisp/ob-keys.elc
deleted file mode 100644
index b0d06d8..0000000
--- a/.emacs.d/org-7.4/lisp/ob-keys.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-latex.el b/.emacs.d/org-7.4/lisp/ob-latex.el
deleted file mode 100644
index 96afbcd..0000000
--- a/.emacs.d/org-7.4/lisp/ob-latex.el
+++ /dev/null
@@ -1,180 +0,0 @@
-;;; ob-latex.el --- org-babel functions for latex "evaluation"
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Eric Schulte
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Org-Babel support for evaluating LaTeX source code.
-;;
-;; Currently on evaluation this returns raw LaTeX code, unless a :file
-;; header argument is given in which case small png or pdf files will
-;; be created directly form the latex source code.
-
-;;; Code:
-(require 'ob)
-
-(declare-function org-create-formula-image "org" (string tofile options buffer))
-(declare-function org-splice-latex-header "org"
- (tpl def-pkg pkg snippets-p &optional extra))
-(declare-function org-export-latex-fix-inputenc "org-latex" ())
-(add-to-list 'org-babel-tangle-lang-exts '("latex" . "tex"))
-
-(defvar org-format-latex-header)
-(defvar org-format-latex-header-extra)
-(defvar org-export-latex-packages-alist)
-(defvar org-export-latex-default-packages-alist)
-(defvar org-export-pdf-logfiles)
-(defvar org-latex-to-pdf-process)
-(defvar org-export-pdf-remove-logfiles)
-(defvar org-format-latex-options)
-(defvar org-export-latex-packages-alist)
-
-(defvar org-babel-default-header-args:latex
- '((:results . "latex") (:exports . "results"))
- "Default arguments to use when evaluating a LaTeX source block.")
-
-(defun org-babel-expand-body:latex (body params)
- "Expand BODY according to PARAMS, return the expanded body."
- (mapc (lambda (pair) ;; replace variables
- (setq body
- (replace-regexp-in-string
- (regexp-quote (format "%S" (car pair)))
- (if (stringp (cdr pair))
- (cdr pair) (format "%S" (cdr pair)))
- body))) (mapcar #'cdr (org-babel-get-header params :var)))
- (org-babel-trim body))
-
-(defun org-babel-execute:latex (body params)
- "Execute a block of Latex code with Babel.
-This function is called by `org-babel-execute-src-block'."
- (setq body (org-babel-expand-body:latex body params))
- (if (cdr (assoc :file params))
- (let* ((out-file (cdr (assoc :file params)))
- (tex-file (org-babel-temp-file "latex-" ".tex"))
- (border (cdr (assoc :border params)))
- (fit (or (cdr (assoc :fit params)) border))
- (height (and fit (cdr (assoc :pdfheight params))))
- (width (and fit (cdr (assoc :pdfwidth params))))
- (headers (cdr (assoc :headers params)))
- (in-buffer (not (string= "no" (cdr (assoc :buffer params)))))
- (org-export-latex-packages-alist
- (append (cdr (assoc :packages params))
- org-export-latex-packages-alist)))
- (cond
- ((string-match "\\.png$" out-file)
- (org-create-formula-image
- body out-file org-format-latex-options in-buffer))
- ((string-match "\\.pdf$" out-file)
- (require 'org-latex)
- (with-temp-file tex-file
- (insert
- (org-splice-latex-header
- org-format-latex-header
- (delq
- nil
- (mapcar
- (lambda (el)
- (unless (and (listp el) (string= "hyperref" (cadr el)))
- el))
- org-export-latex-default-packages-alist))
- org-export-latex-packages-alist
- org-format-latex-header-extra)
- (if fit "\n\\usepackage[active, tightpage]{preview}\n" "")
- (if border (format "\\setlength{\\PreviewBorder}{%s}" border) "")
- (if height (concat "\n" (format "\\pdfpageheight %s" height)) "")
- (if width (concat "\n" (format "\\pdfpagewidth %s" width)) "")
- (if headers
- (concat "\n"
- (if (listp headers)
- (mapconcat #'identity headers "\n")
- headers) "\n")
- "")
- (if org-format-latex-header-extra
- (concat "\n" org-format-latex-header-extra)
- "")
- (if fit
- (concat "\n\\begin{document}\n\\begin{preview}\n" body
- "\n\\end{preview}\n\\end{document}\n")
- (concat "\n\\begin{document}\n" body "\n\\end{document}\n")))
- (org-export-latex-fix-inputenc))
- (when (file-exists-p out-file) (delete-file out-file))
- (rename-file (org-babel-latex-tex-to-pdf tex-file) out-file))
- ((string-match "\\.\\([^\\.]+\\)$" out-file)
- (error "can not create %s files, please specify a .png or .pdf file"
- (match-string 1 out-file))))
- out-file)
- body))
-
-(defun org-babel-latex-tex-to-pdf (file)
- "Generate a pdf file according to the contents FILE.
-Extracted from `org-export-as-pdf' in org-latex.el."
- (let* ((wconfig (current-window-configuration))
- (default-directory (file-name-directory file))
- (base (file-name-sans-extension file))
- (pdffile (concat base ".pdf"))
- (cmds org-latex-to-pdf-process)
- (outbuf (get-buffer-create "*Org PDF LaTeX Output*"))
- output-dir cmd)
- (with-current-buffer outbuf (erase-buffer))
- (message (concat "Processing LaTeX file " file "..."))
- (setq output-dir (file-name-directory file))
- (if (and cmds (symbolp cmds))
- (funcall cmds (shell-quote-argument file))
- (while cmds
- (setq cmd (pop cmds))
- (while (string-match "%b" cmd)
- (setq cmd (replace-match
- (save-match-data
- (shell-quote-argument base))
- t t cmd)))
- (while (string-match "%f" cmd)
- (setq cmd (replace-match
- (save-match-data
- (shell-quote-argument file))
- t t cmd)))
- (while (string-match "%o" cmd)
- (setq cmd (replace-match
- (save-match-data
- (shell-quote-argument output-dir))
- t t cmd)))
- (shell-command cmd outbuf)))
- (message (concat "Processing LaTeX file " file "...done"))
- (if (not (file-exists-p pdffile))
- (error (concat "PDF file " pdffile " was not produced"))
- (set-window-configuration wconfig)
- (when org-export-pdf-remove-logfiles
- (dolist (ext org-export-pdf-logfiles)
- (setq file (concat base "." ext))
- (and (file-exists-p file) (delete-file file))))
- (message "Exporting to PDF...done")
- pdffile)))
-
-(defun org-babel-prep-session:latex (session params)
- "Return an error because LaTeX doesn't support sesstions."
- (error "LaTeX does not support sessions"))
-
-(provide 'ob-latex)
-
-;; arch-tag: 1f13f7e2-26de-4c24-9274-9f331d4c6ff3
-
-;;; ob-latex.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-latex.elc b/.emacs.d/org-7.4/lisp/ob-latex.elc
deleted file mode 100644
index 5f7f6db..0000000
--- a/.emacs.d/org-7.4/lisp/ob-latex.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-ledger.el b/.emacs.d/org-7.4/lisp/ob-ledger.el
deleted file mode 100644
index a02eb6f..0000000
--- a/.emacs.d/org-7.4/lisp/ob-ledger.el
+++ /dev/null
@@ -1,72 +0,0 @@
-;;; ob-ledger.el --- org-babel functions for ledger evaluation
-
-;; Copyright (C) 2010 Free Software Foundation, Inc.
-
-;; Author: Eric S Fraga
-;; Keywords: literate programming, reproducible research, accounting
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Org-Babel support for evaluating ledger entries.
-;;
-;; This differs from most standard languages in that
-;;
-;; 1) there is no such thing as a "session" in ledger
-;;
-;; 2) we are generally only going to return output from the leger program
-;;
-;; 3) we are adding the "cmdline" header argument
-;;
-;; 4) there are no variables
-
-;;; Code:
-(require 'ob)
-
-(defvar org-babel-default-header-args:ledger
- '((:results . "output") (:cmdline . "bal"))
- "Default arguments to use when evaluating a ledger source block.")
-
-(defun org-babel-execute:ledger (body params)
- "Execute a block of Ledger entries with org-babel. This function is
-called by `org-babel-execute-src-block'."
- (message "executing Ledger source code block")
- (let ((result-params (split-string (or (cdr (assoc :results params)) "")))
- (cmdline (cdr (assoc :cmdline params)))
- (in-file (org-babel-temp-file "ledger-"))
- (out-file (org-babel-temp-file "ledger-output-")))
- (with-temp-file in-file (insert body))
- (message (concat "ledger"
- " -f " (org-babel-process-file-name in-file)
- " " cmdline))
- (with-output-to-string
- (shell-command (concat "ledger"
- " -f " (org-babel-process-file-name in-file)
- " " cmdline
- " > " (org-babel-process-file-name out-file))))
- (with-temp-buffer (insert-file-contents out-file) (buffer-string))))
-
-(defun org-babel-prep-session:ledger (session params)
- (error "Ledger does not support sessions"))
-
-(provide 'ob-ledger)
-
-;; arch-tag: 7bbb529e-95a1-4236-9d29-b0000b918c7c
-
-;;; ob-ledger.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-ledger.elc b/.emacs.d/org-7.4/lisp/ob-ledger.elc
deleted file mode 100644
index 4b8710c..0000000
--- a/.emacs.d/org-7.4/lisp/ob-ledger.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-lob.el b/.emacs.d/org-7.4/lisp/ob-lob.el
deleted file mode 100644
index 137a6bc..0000000
--- a/.emacs.d/org-7.4/lisp/ob-lob.el
+++ /dev/null
@@ -1,124 +0,0 @@
-;;; ob-lob.el --- functions supporting the Library of Babel
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Eric Schulte, Dan Davison
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; See the online documentation for more information
-;;
-;; http://orgmode.org/worg/org-contrib/babel/
-
-;;; Code:
-(require 'ob)
-(require 'ob-table)
-
-(defvar org-babel-library-of-babel nil
- "Library of source-code blocks.
-This is an association list. Populate the library by adding
-files to `org-babel-lob-files'.")
-
-(defcustom org-babel-lob-files '()
- "Files used to populate the `org-babel-library-of-babel'.
-To add files to this list use the `org-babel-lob-ingest' command."
- :group 'org-babel
- :type 'list)
-
-;;;###autoload
-(defun org-babel-lob-ingest (&optional file)
- "Add all named source-blocks defined in FILE to
-`org-babel-library-of-babel'."
- (interactive "f")
- (let ((lob-ingest-count 0))
- (org-babel-map-src-blocks file
- (let* ((info (org-babel-get-src-block-info 'light))
- (source-name (nth 4 info)))
- (when source-name
- (setq source-name (intern source-name)
- org-babel-library-of-babel
- (cons (cons source-name info)
- (assq-delete-all source-name org-babel-library-of-babel))
- lob-ingest-count (1+ lob-ingest-count)))))
- (message "%d src block%s added to Library of Babel"
- lob-ingest-count (if (> lob-ingest-count 1) "s" ""))
- lob-ingest-count))
-
-(defconst org-babel-lob-call-aliases '("lob" "call")
- "Aliases to call a source block function.
-If you change the value of this variable then your files may
- become unusable by other org-babel users, and vice versa.")
-
-(defconst org-babel-lob-one-liner-regexp
- (concat
- "^\\([ \t]*\\)#\\+\\(?:"
- (mapconcat #'regexp-quote org-babel-lob-call-aliases "\\|")
- "\\):[ \t]+\\([^\(\)\n]+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)"
- "\(\\([^\n]*\\)\)\\(\\[.+\\]\\|\\)[ \t]*\\([^\n]*\\)")
- "Regexp to match calls to predefined source block functions.")
-
-;; functions for executing lob one-liners
-;;;###autoload
-(defun org-babel-lob-execute-maybe ()
- "Execute a Library of Babel source block, if appropriate.
-Detect if this is context for a Library Of Babel source block and
-if so then run the appropriate source block from the Library."
- (interactive)
- (let ((info (org-babel-lob-get-info)))
- (if (nth 0 info) (progn (org-babel-lob-execute info) t) nil)))
-
-;;;###autoload
-(defun org-babel-lob-get-info ()
- "Return a Library of Babel function call as a string."
- (let ((case-fold-search t))
- (save-excursion
- (beginning-of-line 1)
- (if (looking-at org-babel-lob-one-liner-regexp)
- (append
- (mapcar #'org-babel-clean-text-properties
- (list
- (format "%s%s(%s)%s"
- (match-string 2)
- (if (match-string 4)
- (concat "[" (match-string 4) "]") "")
- (or (match-string 6) "") (match-string 7))
- (match-string 8)))
- (list (length (match-string 1))))))))
-
-(defun org-babel-lob-execute (info)
- "Execute the lob call specified by INFO."
- (let ((params (org-babel-process-params
- (org-babel-merge-params
- org-babel-default-header-args
- (org-babel-params-from-buffer)
- (org-babel-params-from-properties)
- (org-babel-parse-header-arguments
- (org-babel-clean-text-properties
- (concat ":var results="
- (mapconcat #'identity (butlast info) " "))))))))
- (org-babel-execute-src-block
- nil (list "emacs-lisp" "results" params nil nil (nth 2 info)))))
-
-(provide 'ob-lob)
-
-;; arch-tag: ce0712c9-2147-4019-ba3f-42341b8b474b
-
-;;; ob-lob.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-lob.elc b/.emacs.d/org-7.4/lisp/ob-lob.elc
deleted file mode 100644
index 3430f2c..0000000
--- a/.emacs.d/org-7.4/lisp/ob-lob.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-matlab.el b/.emacs.d/org-7.4/lisp/ob-matlab.el
deleted file mode 100644
index 192c73d..0000000
--- a/.emacs.d/org-7.4/lisp/ob-matlab.el
+++ /dev/null
@@ -1,48 +0,0 @@
-;;; ob-matlab.el --- org-babel support for matlab evaluation
-
-;; Copyright (C) 2010 Free Software Foundation, Inc.
-
-;; Author: Dan Davison
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Functions that are common to org-babel support for matlab and
-;; octave are in org-babel-octave.el
-
-;;; Requirements:
-
-;; Matlab
-
-;; matlab.el required for interactive emacs sessions and matlab-mode
-;; major mode for source code editing buffer
-;; http://matlab-emacs.sourceforge.net/
-
-;;; Code:
-(require 'ob)
-(require 'ob-octave)
-
-;; see ob-octave for matlab implementation
-
-(provide 'ob-matlab)
-
-;; arch-tag: 6b234299-c1f7-4eb1-ace8-7b93344065ac
-
-;;; ob-matlab.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-matlab.elc b/.emacs.d/org-7.4/lisp/ob-matlab.elc
deleted file mode 100644
index 195d105..0000000
--- a/.emacs.d/org-7.4/lisp/ob-matlab.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-mscgen.el b/.emacs.d/org-7.4/lisp/ob-mscgen.el
deleted file mode 100644
index 98230da..0000000
--- a/.emacs.d/org-7.4/lisp/ob-mscgen.el
+++ /dev/null
@@ -1,86 +0,0 @@
-;;; ob-msc.el --- org-babel functions for mscgen evaluation
-
-;; Copyright (C) 2010 Free Software Foundation, Inc.
-
-;; Author: Juan Pechiar
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-;;
-;; This software provides EMACS org-babel export support for message
-;; sequence charts. The mscgen utility is used for processing the
-;; sequence definition, and must therefore be installed in the system.
-;;
-;; Mscgen is available and documented at
-;; http://www.mcternan.me.uk/mscgen/index.html
-;;
-;; This code is directly inspired by Eric Schulte's ob-dot.el
-;;
-;; Example:
-;;
-;; #+begin_src mscgen :file example.png
-;; msc {
-;; A,B;
-;; A -> B [ label = "send message" ];
-;; A <- B [ label = "get answer" ];
-;; }
-;; #+end_src
-;;
-;; Header for alternative file type:
-;;
-;; #+begin_src mscgen :file ex2.svg :filetype svg
-
-;; This differs from most standard languages in that
-;;
-;; 1) there is no such thing as a "session" in mscgen
-;; 2) we are generally only going to return results of type "file"
-;; 3) we are adding the "file" and "filetype" header arguments
-;; 4) there are no variables
-
-;;; Code:
-(require 'ob)
-(require 'ob-eval)
-
-(defvar org-babel-default-header-args:mscgen
- '((:results . "file") (:exports . "results"))
- "Default arguments to use when evaluating a mscgen source block.")
-
-(defun org-babel-execute:mscgen (body params)
- "Execute a block of Mscgen code with Babel.
-This function is called by `org-babel-execute-src-block'.
-Default filetype is png. Modify by setting :filetype parameter to
-mscgen supported formats."
- (let* ((out-file (or (cdr (assoc :file params)) "output.png" ))
- (filetype (or (cdr (assoc :filetype params)) "png" )))
- (unless (cdr (assoc :file params))
- (error "
-ERROR: no output file specified. Add \":file name.png\" to the src header"))
- (org-babel-eval (concat "mscgen -T " filetype " -o " out-file) body)
- out-file))
-
-(defun org-babel-prep-session:mscgen (session params)
- "Raise an error because Mscgen doesn't support sessions."
- (error "Mscgen does not support sessions"))
-
-(provide 'ob-mscgen)
-
-;; arch-tag: 74695b1e-715f-4b5a-a3a9-d78ee39ba5c8
-
-;;; ob-msc.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-mscgen.elc b/.emacs.d/org-7.4/lisp/ob-mscgen.elc
deleted file mode 100644
index f29f295..0000000
--- a/.emacs.d/org-7.4/lisp/ob-mscgen.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-ocaml.el b/.emacs.d/org-7.4/lisp/ob-ocaml.el
deleted file mode 100644
index 459dcf3..0000000
--- a/.emacs.d/org-7.4/lisp/ob-ocaml.el
+++ /dev/null
@@ -1,157 +0,0 @@
-;;; ob-ocaml.el --- org-babel functions for ocaml evaluation
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Eric Schulte
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Org-Babel support for evaluating ocaml source code. This one will
-;; be sort of tricky because ocaml programs must be compiled before
-;; they can be run, but ocaml code can also be run through an
-;; interactive interpreter.
-;;
-;; For now lets only allow evaluation using the ocaml interpreter.
-
-;;; Requirements:
-
-;; - tuareg-mode :: http://www-rocq.inria.fr/~acohen/tuareg/
-
-;;; Code:
-(require 'ob)
-(require 'ob-comint)
-(require 'comint)
-(eval-when-compile (require 'cl))
-
-(declare-function tuareg-run-caml "ext:tuareg" ())
-(declare-function tuareg-interactive-send-input "ext:tuareg" ())
-
-(add-to-list 'org-babel-tangle-lang-exts '("ocaml" . "ml"))
-
-(defvar org-babel-default-header-args:ocaml '())
-
-(defvar org-babel-ocaml-eoe-indicator "\"org-babel-ocaml-eoe\";;")
-(defvar org-babel-ocaml-eoe-output "org-babel-ocaml-eoe")
-
-(defun org-babel-execute:ocaml (body params)
- "Execute a block of Ocaml code with Babel."
- (let* ((vars (mapcar #'cdr (org-babel-get-header params :var)))
- (full-body (org-babel-expand-body:generic
- body params
- (org-babel-variable-assignments:ocaml params)))
- (session (org-babel-prep-session:ocaml
- (cdr (assoc :session params)) params))
- (raw (org-babel-comint-with-output
- (session org-babel-ocaml-eoe-output t full-body)
- (insert
- (concat
- (org-babel-chomp full-body)"\n"org-babel-ocaml-eoe-indicator))
- (tuareg-interactive-send-input)))
- (clean
- (car (let ((re (regexp-quote org-babel-ocaml-eoe-output)) out)
- (delq nil (mapcar (lambda (line)
- (if out
- (progn (setq out nil) line)
- (when (string-match re line)
- (progn (setq out t) nil))))
- (mapcar #'org-babel-trim (reverse raw))))))))
- (org-babel-reassemble-table
- (org-babel-ocaml-parse-output (org-babel-trim clean))
- (org-babel-pick-name
- (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
- (org-babel-pick-name
- (cdr (assoc :rowname-names params)) (cdr (assoc :rownames params))))))
-
-(defvar tuareg-interactive-buffer-name)
-(defun org-babel-prep-session:ocaml (session params)
- "Prepare SESSION according to the header arguments in PARAMS."
- (require 'tuareg)
- (let ((tuareg-interactive-buffer-name (if (and (not (string= session "none"))
- (not (string= session "default"))
- (stringp session))
- session
- tuareg-interactive-buffer-name)))
- (save-window-excursion (tuareg-run-caml)
- (get-buffer tuareg-interactive-buffer-name))))
-
-(defun org-babel-variable-assignments:ocaml (params)
- "Return list of ocaml statements assigning the block's variables"
- (mapcar
- (lambda (pair) (format "let %s = %s;;" (car pair)
- (org-babel-ocaml-elisp-to-ocaml (cdr pair))))
- (mapcar #'cdr (org-babel-get-header params :var))))
-
-(defun org-babel-ocaml-elisp-to-ocaml (val)
- "Return a string of ocaml code which evaluates to VAL."
- (if (listp val)
- (concat "[|" (mapconcat #'org-babel-ocaml-elisp-to-ocaml val "; ") "|]")
- (format "%S" val)))
-
-(defun org-babel-ocaml-parse-output (output)
- "Parse OUTPUT.
-OUTPUT is string output from an ocaml process."
- (let ((regexp "%s = \\(.+\\)$"))
- (cond
- ((string-match (format regexp "string") output)
- (org-babel-read (match-string 1 output)))
- ((or (string-match (format regexp "int") output)
- (string-match (format regexp "float") output))
- (string-to-number (match-string 1 output)))
- ((string-match (format regexp "list") output)
- (org-babel-ocaml-read-list (match-string 1 output)))
- ((string-match (format regexp "array") output)
- (org-babel-ocaml-read-array (match-string 1 output)))
- (t (message "don't recognize type of %s" output) output))))
-
-(defun org-babel-ocaml-read-list (results)
- "Convert RESULTS into an elisp table or string.
-If the results look like a table, then convert them into an
-Emacs-lisp table, otherwise return the results as a string."
- (org-babel-read
- (if (and (stringp results) (string-match "^\\[.+\\]$" results))
- (org-babel-read
- (replace-regexp-in-string
- "\\[" "(" (replace-regexp-in-string
- "\\]" ")" (replace-regexp-in-string
- "; " " " (replace-regexp-in-string
- "'" "\"" results)))))
- results)))
-
-(defun org-babel-ocaml-read-array (results)
- "Convert RESULTS into an elisp table or string.
-If the results look like a table, then convert them into an
-Emacs-lisp table, otherwise return the results as a string."
- (org-babel-read
- (if (and (stringp results) (string-match "^\\[.+\\]$" results))
- (org-babel-read
- (concat
- "'" (replace-regexp-in-string
- "\\[|" "(" (replace-regexp-in-string
- "|\\]" ")" (replace-regexp-in-string
- "; " " " (replace-regexp-in-string
- "'" "\"" results))))))
- results)))
-
-(provide 'ob-ocaml)
-
-;; arch-tag: 2e815f4d-365e-4d69-b1df-dd17fdd7b7b7
-
-;;; ob-ocaml.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-ocaml.elc b/.emacs.d/org-7.4/lisp/ob-ocaml.elc
deleted file mode 100644
index e59b9c7..0000000
--- a/.emacs.d/org-7.4/lisp/ob-ocaml.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-octave.el b/.emacs.d/org-7.4/lisp/ob-octave.el
deleted file mode 100644
index 9fcd825..0000000
--- a/.emacs.d/org-7.4/lisp/ob-octave.el
+++ /dev/null
@@ -1,264 +0,0 @@
-;;; ob-octave.el --- org-babel functions for octave and matlab evaluation
-
-;; Copyright (C) 2010 Free Software Foundation, Inc.
-
-;; Author: Dan Davison
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;;; Requirements:
-
-;; octave
-;; octave-mode.el and octave-inf.el come with GNU emacs
-
-;;; Code:
-(require 'ob)
-(require 'ob-ref)
-(require 'ob-comint)
-(require 'ob-eval)
-(eval-when-compile (require 'cl))
-
-(declare-function matlab-shell "ext:matlab-mode")
-(declare-function matlab-shell-run-region "ext:matlab-mode")
-
-(defvar org-babel-default-header-args:matlab '())
-(defvar org-babel-default-header-args:octave '())
-
-(defvar org-babel-matlab-shell-command "matlab -nosplash"
- "Shell command to run matlab as an external process.")
-(defvar org-babel-octave-shell-command "octave -q"
- "Shell command to run octave as an external process.")
-
-(defvar org-babel-matlab-with-emacs-link nil
- "If non-nil use matlab-shell-run-region for session evaluation.
- This will use EmacsLink if (matlab-with-emacs-link) evaluates
- to a non-nil value.")
-
-(defvar org-babel-matlab-emacs-link-wrapper-method
- "%s
-if ischar(ans), fid = fopen('%s', 'w'); fprintf(fid, '%%s\\n', ans); fclose(fid);
-else, save -ascii %s ans
-end
-delete('%s')
-")
-(defvar org-babel-octave-wrapper-method
- "%s
-if ischar(ans), fid = fopen('%s', 'w'); fprintf(fid, '%%s\\n', ans); fclose(fid);
-else, dlmwrite('%s', ans, '\\t')
-end")
-
-(defvar org-babel-octave-eoe-indicator "\'org_babel_eoe\'")
-
-(defvar org-babel-octave-eoe-output "ans = org_babel_eoe")
-
-(defun org-babel-execute:matlab (body params)
- "Execute a block of matlab code with Babel."
- (org-babel-execute:octave body params 'matlab))
-
-(defun org-babel-execute:octave (body params &optional matlabp)
- "Execute a block of octave code with Babel."
- (let* ((session
- (funcall (intern (format "org-babel-%s-initiate-session"
- (if matlabp "matlab" "octave")))
- (cdr (assoc :session params)) params))
- (vars (mapcar #'cdr (org-babel-get-header params :var)))
- (result-params (cdr (assoc :result-params params)))
- (result-type (cdr (assoc :result-type params)))
- (out-file (cdr (assoc :file params)))
- (full-body
- (org-babel-expand-body:generic
- body params (org-babel-variable-assignments:octave params)))
- (result (org-babel-octave-evaluate
- session full-body result-type matlabp)))
- (or out-file
- (org-babel-reassemble-table
- result
- (org-babel-pick-name
- (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
- (org-babel-pick-name
- (cdr (assoc :rowname-names params)) (cdr (assoc :rownames params)))))))
-
-(defun org-babel-prep-session:matlab (session params)
- "Prepare SESSION according to PARAMS."
- (org-babel-prep-session:octave session params 'matlab))
-
-(defun org-babel-variable-assignments:octave (params)
- "Return list of octave statements assigning the block's variables"
- (mapcar
- (lambda (pair)
- (format "%s=%s"
- (car pair)
- (org-babel-octave-var-to-octave (cdr pair))))
- (mapcar #'cdr (org-babel-get-header params :var))))
-
-(defalias 'org-babel-variable-assignments:matlab
- 'org-babel-variable-assignments:octave)
-
-(defun org-babel-octave-var-to-octave (var)
- "Convert an emacs-lisp value into an octave variable.
-Converts an emacs-lisp variable into a string of octave code
-specifying a variable of the same value."
- (if (listp var)
- (concat "[" (mapconcat #'org-babel-octave-var-to-octave var
- (if (listp (car var)) "; " ",")) "]")
- (format "%s" (or var "nil"))))
-
-(defun org-babel-prep-session:octave (session params &optional matlabp)
- "Prepare SESSION according to the header arguments specified in PARAMS."
- (let* ((session (org-babel-octave-initiate-session session params matlabp))
- (var-lines (org-babel-variable-assignments:octave params)))
- (org-babel-comint-in-buffer session
- (mapc (lambda (var)
- (end-of-line 1) (insert var) (comint-send-input nil t)
- (org-babel-comint-wait-for-output session)) var-lines))
- session))
-
-(defun org-babel-matlab-initiate-session (&optional session params)
- "Create a matlab inferior process buffer.
-If there is not a current inferior-process-buffer in SESSION then
-create. Return the initialized session."
- (org-babel-octave-initiate-session session params 'matlab))
-
-(defun org-babel-octave-initiate-session (&optional session params matlabp)
- "Create an octave inferior process buffer.
-If there is not a current inferior-process-buffer in SESSION then
-create. Return the initialized session."
- (if matlabp (require 'matlab) (require 'octave-inf))
- (unless (string= session "none")
- (let ((session (or session
- (if matlabp "*Inferior Matlab*" "*Inferior Octave*"))))
- (if (org-babel-comint-buffer-livep session) session
- (save-window-excursion
- (if matlabp (unless org-babel-matlab-with-emacs-link (matlab-shell))
- (run-octave))
- (rename-buffer (if (bufferp session) (buffer-name session)
- (if (stringp session) session (buffer-name))))
- (current-buffer))))))
-
-(defun org-babel-octave-evaluate
- (session body result-type &optional matlabp)
- "Pass BODY to the octave process in SESSION.
-If RESULT-TYPE equals 'output then return the outputs of the
-statements in BODY, if RESULT-TYPE equals 'value then return the
-value of the last statement in BODY, as elisp."
- (if session
- (org-babel-octave-evaluate-session session body result-type matlabp)
- (org-babel-octave-evaluate-external-process body result-type matlabp)))
-
-(defun org-babel-octave-evaluate-external-process (body result-type matlabp)
- "Evaluate BODY in an external octave process."
- (let ((cmd (if matlabp
- org-babel-matlab-shell-command
- org-babel-octave-shell-command)))
- (case result-type
- (output (org-babel-eval cmd body))
- (value (let ((tmp-file (org-babel-temp-file "octave-")))
- (org-babel-eval
- cmd
- (format org-babel-octave-wrapper-method body
- (org-babel-process-file-name tmp-file 'noquote)
- (org-babel-process-file-name tmp-file 'noquote)))
- (org-babel-octave-import-elisp-from-file tmp-file))))))
-
-(defun org-babel-octave-evaluate-session
- (session body result-type &optional matlabp)
- "Evaluate BODY in SESSION."
- (let* ((tmp-file (org-babel-temp-file (if matlabp "matlab-" "octave-")))
- (wait-file (org-babel-temp-file "matlab-emacs-link-wait-signal-"))
- (full-body
- (case result-type
- (output
- (mapconcat
- #'org-babel-chomp
- (list body org-babel-octave-eoe-indicator) "\n"))
- (value
- (if (and matlabp org-babel-matlab-with-emacs-link)
- (concat
- (format org-babel-matlab-emacs-link-wrapper-method
- body
- (org-babel-process-file-name tmp-file 'noquote)
- (org-babel-process-file-name tmp-file 'noquote) wait-file) "\n")
- (mapconcat
- #'org-babel-chomp
- (list (format org-babel-octave-wrapper-method
- body
- (org-babel-process-file-name tmp-file 'noquote)
- (org-babel-process-file-name tmp-file 'noquote))
- org-babel-octave-eoe-indicator) "\n")))))
- (raw (if (and matlabp org-babel-matlab-with-emacs-link)
- (save-window-excursion
- (with-temp-buffer
- (insert full-body)
- (write-region "" 'ignored wait-file nil nil nil 'excl)
- (matlab-shell-run-region (point-min) (point-max))
- (message "Waiting for Matlab Emacs Link")
- (while (file-exists-p wait-file) (sit-for 0.01))
- "")) ;; matlab-shell-run-region doesn't seem to
- ;; make *matlab* buffer contents easily
- ;; available, so :results output currently
- ;; won't work
- (org-babel-comint-with-output
- (session
- (if matlabp
- org-babel-octave-eoe-indicator
- org-babel-octave-eoe-output)
- t full-body)
- (insert full-body) (comint-send-input nil t)))) results)
- (case result-type
- (value
- (org-babel-octave-import-elisp-from-file tmp-file))
- (output
- (progn
- (setq results
- (if matlabp
- (cdr (reverse (delq "" (mapcar
- #'org-babel-octave-read-string
- (mapcar #'org-babel-trim raw)))))
- (cdr (member org-babel-octave-eoe-output
- (reverse (mapcar
- #'org-babel-octave-read-string
- (mapcar #'org-babel-trim raw)))))))
- (mapconcat #'identity (reverse results) "\n"))))))
-
-(defun org-babel-octave-import-elisp-from-file (file-name)
- "Import data from FILE-NAME.
-This removes initial blank and comment lines and then calls
-`org-babel-import-elisp-from-file'."
- (let ((temp-file (org-babel-temp-file "octave-matlab-")) beg end)
- (with-temp-file temp-file
- (insert-file-contents file-name)
- (re-search-forward "^[ \t]*[^# \t]" nil t)
- (if (< (setq beg (point-min))
- (setq end (point-at-bol)))
- (delete-region beg end)))
- (org-babel-import-elisp-from-file temp-file '(16))))
-
-(defun org-babel-octave-read-string (string)
- "Strip \\\"s from around octave string"
- (if (string-match "^\"\\([^\000]+\\)\"$" string)
- (match-string 1 string)
- string))
-
-(provide 'ob-octave)
-
-;; arch-tag: d8e5f68b-ba13-440a-a495-b653e989e704
-
-;;; ob-octave.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-octave.elc b/.emacs.d/org-7.4/lisp/ob-octave.elc
deleted file mode 100644
index f72a620..0000000
--- a/.emacs.d/org-7.4/lisp/ob-octave.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-org.el b/.emacs.d/org-7.4/lisp/ob-org.el
deleted file mode 100644
index c03fa07..0000000
--- a/.emacs.d/org-7.4/lisp/ob-org.el
+++ /dev/null
@@ -1,62 +0,0 @@
-;;; ob-org.el --- org-babel functions for org code block evaluation
-
-;; Copyright (C) 2010 Free Software Foundation, Inc.
-
-;; Author: Eric Schulte
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This is the simplest of code blocks, where upon evaluation the
-;; contents of the code block are returned in a raw result.
-
-;;; Code:
-(require 'ob)
-
-(declare-function org-export-string "org-exp" (string fmt &optional dir))
-
-(defvar org-babel-default-header-args:org
- '((:results . "raw silent") (:exports . "results"))
- "Default arguments for evaluating a org source block.")
-
-(defvar org-babel-org-default-header
- "#+TITLE: default empty header\n"
- "Default header inserted during export of org blocks.")
-
-(defun org-babel-execute:org (body params)
- "Execute a block of Org code with.
-This function is called by `org-babel-execute-src-block'."
- (let ((result-params (split-string (or (cdr (assoc :results params)) "")))
- (body (replace-regexp-in-string "^," "" body)))
- (cond
- ((member "latex" result-params) (org-export-string body "latex"))
- ((member "html" result-params) (org-export-string body "html"))
- ((member "ascii" result-params) (org-export-string body "ascii"))
- (t body))))
-
-(defun org-babel-prep-session:org (session params)
- "Return an error because org does not support sessions."
- (error "Org does not support sessions"))
-
-(provide 'ob-org)
-
-;; arch-tag: 130af5fe-cc56-46bd-9508-fa0ebd94cb1f
-
-;;; ob-org.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-org.elc b/.emacs.d/org-7.4/lisp/ob-org.elc
deleted file mode 100644
index b991626..0000000
--- a/.emacs.d/org-7.4/lisp/ob-org.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-perl.el b/.emacs.d/org-7.4/lisp/ob-perl.el
deleted file mode 100644
index 1e0cecb..0000000
--- a/.emacs.d/org-7.4/lisp/ob-perl.el
+++ /dev/null
@@ -1,117 +0,0 @@
-;;; ob-perl.el --- org-babel functions for perl evaluation
-
-;; Copyright (C) 2009, 2010 Free Software Foundation
-
-;; Author: Dan Davison, Eric Schulte
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Org-Babel support for evaluating perl source code.
-
-;;; Code:
-(require 'ob)
-(require 'ob-eval)
-(eval-when-compile (require 'cl))
-
-(add-to-list 'org-babel-tangle-lang-exts '("perl" . "pl"))
-
-(defvar org-babel-default-header-args:perl '())
-
-(defvar org-babel-perl-command "perl"
- "Name of command to use for executing perl code.")
-
-(defun org-babel-execute:perl (body params)
- "Execute a block of Perl code with Babel.
-This function is called by `org-babel-execute-src-block'."
- (let* ((session (cdr (assoc :session params)))
- (result-params (cdr (assoc :result-params params)))
- (result-type (cdr (assoc :result-type params)))
- (full-body (org-babel-expand-body:generic
- body params (org-babel-variable-assignments:perl params)))
- (session (org-babel-perl-initiate-session session)))
- (org-babel-reassemble-table
- (org-babel-perl-evaluate session full-body result-type)
- (org-babel-pick-name
- (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
- (org-babel-pick-name
- (cdr (assoc :rowname-names params)) (cdr (assoc :rownames params))))))
-
-(defun org-babel-prep-session:perl (session params)
- "Prepare SESSION according to the header arguments in PARAMS."
- (error "Sessions are not supported for Perl."))
-
-(defun org-babel-variable-assignments:perl (params)
- "Return list of perl statements assigning the block's variables"
- (mapcar
- (lambda (pair)
- (format "$%s=%s;"
- (car pair)
- (org-babel-perl-var-to-perl (cdr pair))))
- (mapcar #'cdr (org-babel-get-header params :var))))
-
-;; helper functions
-
-(defun org-babel-perl-var-to-perl (var)
- "Convert an elisp value to a perl variable.
-The elisp value, VAR, is converted to a string of perl source code
-specifying a var of the same value."
- (if (listp var)
- (concat "[" (mapconcat #'org-babel-perl-var-to-perl var ", ") "]")
- (format "%S" var)))
-
-(defvar org-babel-perl-buffers '(:default . nil))
-
-(defun org-babel-perl-initiate-session (&optional session params)
- "Return nil because sessions are not supported by perl"
-nil)
-
-(defvar org-babel-perl-wrapper-method
- "
-sub main {
-%s
-}
-@r = main;
-open(o, \">%s\");
-print o join(\"\\n\", @r), \"\\n\"")
-
-(defvar org-babel-perl-pp-wrapper-method
- nil)
-
-(defun org-babel-perl-evaluate (session body &optional result-type)
- "Pass BODY to the Perl process in SESSION.
-If RESULT-TYPE equals 'output then return a list of the outputs
-of the statements in BODY, if RESULT-TYPE equals 'value then
-return the value of the last statement in BODY, as elisp."
- (when session (error "Sessions are not supported for Perl."))
- (case result-type
- (output (org-babel-eval org-babel-perl-command body))
- (value (let ((tmp-file (org-babel-temp-file "perl-")))
- (org-babel-eval
- org-babel-perl-command
- (format org-babel-perl-wrapper-method body
- (org-babel-process-file-name tmp-file 'noquote)))
- (org-babel-eval-read-file tmp-file)))))
-
-(provide 'ob-perl)
-
-;; arch-tag: 88ef9396-d857-4dc3-8946-5a72bdfa2337
-
-;;; ob-perl.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-perl.elc b/.emacs.d/org-7.4/lisp/ob-perl.elc
deleted file mode 100644
index a6d3d5b..0000000
--- a/.emacs.d/org-7.4/lisp/ob-perl.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-plantuml.el b/.emacs.d/org-7.4/lisp/ob-plantuml.el
deleted file mode 100644
index fb81dc8..0000000
--- a/.emacs.d/org-7.4/lisp/ob-plantuml.el
+++ /dev/null
@@ -1,83 +0,0 @@
-;;; ob-plantuml.el --- org-babel functions for plantuml evaluation
-
-;; Copyright (C) 2010 Free Software Foundation, Inc.
-
-;; Author: Zhang Weize
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Org-Babel support for evaluating plantuml script.
-;;
-;; Inspired by Ian Yang's org-export-blocks-format-plantuml
-;; http://www.emacswiki.org/emacs/org-export-blocks-format-plantuml.el
-
-;;; Requirements:
-
-;; plantuml | http://plantuml.sourceforge.net/
-;; plantuml.jar | `org-plantuml-jar-path' should point to the jar file
-
-;;; Code:
-(require 'ob)
-(require 'ob-eval)
-
-(defvar org-babel-default-header-args:plantuml
- '((:results . "file") (:exports . "results"))
- "Default arguments for evaluating a plantuml source block.")
-
-(defcustom org-plantuml-jar-path nil
- "Path to the plantuml.jar file."
- :group 'org-babel
- :type 'string)
-
-(defun org-babel-execute:plantuml (body params)
- "Execute a block of plantuml code with org-babel.
-This function is called by `org-babel-execute-src-block'."
- (let* ((result-params (split-string (or (cdr (assoc :results params)) "")))
- (out-file (or (cdr (assoc :file params))
- (error "plantuml requires a \":file\" header argument")))
- (cmdline (cdr (assoc :cmdline params)))
- (in-file (org-babel-temp-file "plantuml-"))
- (cmd (if (not org-plantuml-jar-path)
- (error "`org-plantuml-jar-path' is not set")
- (concat "java -jar "
- (shell-quote-argument
- (expand-file-name org-plantuml-jar-path))
- (if (string= (file-name-extension out-file) "svg")
- " -tsvg" "")
- " -p " cmdline " < "
- (org-babel-process-file-name in-file)
- " > "
- (org-babel-process-file-name out-file)))))
- (unless (file-exists-p org-plantuml-jar-path)
- (error "Could not find plantuml.jar at %s" org-plantuml-jar-path))
- (with-temp-file in-file (insert (concat "@startuml\n" body "\n@enduml")))
- (message "%s" cmd) (org-babel-eval cmd "")
- out-file))
-
-(defun org-babel-prep-session:plantuml (session params)
- "Return an error because plantuml does not support sessions."
- (error "Plantuml does not support sessions"))
-
-(provide 'ob-plantuml)
-
-;; arch-tag: 451f50c5-e779-407e-ad64-70e0e8f161d1
-
-;;; ob-plantuml.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-plantuml.elc b/.emacs.d/org-7.4/lisp/ob-plantuml.elc
deleted file mode 100644
index 28cf32e..0000000
--- a/.emacs.d/org-7.4/lisp/ob-plantuml.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-python.el b/.emacs.d/org-7.4/lisp/ob-python.el
deleted file mode 100644
index 27b69bf..0000000
--- a/.emacs.d/org-7.4/lisp/ob-python.el
+++ /dev/null
@@ -1,282 +0,0 @@
-;;; ob-python.el --- org-babel functions for python evaluation
-
-;; Copyright (C) 2009, 2010 Free Software Foundation
-
-;; Author: Eric Schulte, Dan Davison
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Org-Babel support for evaluating python source code.
-
-;;; Code:
-(require 'ob)
-(require 'ob-ref)
-(require 'ob-comint)
-(require 'ob-eval)
-(eval-when-compile (require 'cl))
-
-(declare-function org-remove-indentation "org" )
-(declare-function py-shell "ext:python-mode" (&optional argprompt))
-(declare-function run-python "ext:python" (&optional cmd noshow new))
-
-(add-to-list 'org-babel-tangle-lang-exts '("python" . "py"))
-
-(defvar org-babel-default-header-args:python '())
-
-(defvar org-babel-python-command "python"
- "Name of command for executing python code.")
-
-(defvar org-babel-python-mode (if (featurep 'xemacs) 'python-mode 'python)
- "Preferred python mode for use in running python interactively.")
-
-(defvar org-src-preserve-indentation)
-
-(defun org-babel-execute:python (body params)
- "Execute a block of Python code with Babel.
-This function is called by `org-babel-execute-src-block'."
- (let* ((session (org-babel-python-initiate-session
- (cdr (assoc :session params))))
- (result-params (cdr (assoc :result-params params)))
- (result-type (cdr (assoc :result-type params)))
- (return-val (when (and (eq result-type 'value) (not session))
- (cdr (assoc :return params))))
- (preamble (cdr (assoc :preamble params)))
- (full-body
- (org-babel-expand-body:generic
- (concat body (if return-val (format "return %s" return-val) ""))
- params (org-babel-variable-assignments:python params)))
- (result (org-babel-python-evaluate
- session full-body result-type result-params preamble)))
- (or (cdr (assoc :file params))
- (org-babel-reassemble-table
- result
- (org-babel-pick-name (cdr (assoc :colname-names params))
- (cdr (assoc :colnames params)))
- (org-babel-pick-name (cdr (assoc :rowname-names params))
- (cdr (assoc :rownames params)))))))
-
-(defun org-babel-prep-session:python (session params)
- "Prepare SESSION according to the header arguments in PARAMS.
-VARS contains resolved variable references"
- (let* ((session (org-babel-python-initiate-session session))
- (var-lines
- (org-babel-variable-assignments:python params)))
- (org-babel-comint-in-buffer session
- (mapc (lambda (var)
- (end-of-line 1) (insert var) (comint-send-input)
- (org-babel-comint-wait-for-output session)) var-lines))
- session))
-
-(defun org-babel-load-session:python (session body params)
- "Load BODY into SESSION."
- (save-window-excursion
- (let ((buffer (org-babel-prep-session:python session params)))
- (with-current-buffer buffer
- (goto-char (process-mark (get-buffer-process (current-buffer))))
- (insert (org-babel-chomp body)))
- buffer)))
-
-;; helper functions
-
-(defun org-babel-variable-assignments:python (params)
- "Return list of python statements assigning the block's variables"
- (mapcar
- (lambda (pair)
- (format "%s=%s"
- (car pair)
- (org-babel-python-var-to-python (cdr pair))))
- (mapcar #'cdr (org-babel-get-header params :var))))
-
-(defun org-babel-python-var-to-python (var)
- "Convert an elisp value to a python variable.
-Convert an elisp value, VAR, into a string of python source code
-specifying a variable of the same value."
- (if (listp var)
- (concat "[" (mapconcat #'org-babel-python-var-to-python var ", ") "]")
- (if (equal var 'hline)
- "None"
- (format
- (if (and (stringp var) (string-match "[\n\r]" var)) "\"\"%S\"\"" "%S")
- var))))
-
-(defun org-babel-python-table-or-string (results)
- "Convert RESULTS into an appropriate elisp value.
-If the results look like a list or tuple, then convert them into an
-Emacs-lisp table, otherwise return the results as a string."
- (org-babel-script-escape results))
-
-(defvar org-babel-python-buffers '((:default . nil)))
-
-(defun org-babel-python-session-buffer (session)
- "Return the buffer associated with SESSION."
- (cdr (assoc session org-babel-python-buffers)))
-
-(defun org-babel-python-initiate-session-by-key (&optional session)
- "Initiate a python session.
-If there is not a current inferior-process-buffer in SESSION
-then create. Return the initialized session."
- (require org-babel-python-mode)
- (save-window-excursion
- (let* ((session (if session (intern session) :default))
- (python-buffer (org-babel-python-session-buffer session)))
- (cond
- ((and (eq 'python org-babel-python-mode)
- (fboundp 'run-python)) ; python.el
- (run-python))
- ((and (eq 'python-mode org-babel-python-mode)
- (fboundp 'py-shell)) ; python-mode.el
- ;; `py-shell' creates a buffer whose name is the value of
- ;; `py-which-bufname' with '*'s at the beginning and end
- (let* ((bufname (if python-buffer
- (replace-regexp-in-string ;; zap surrounding *
- "^\\*\\([^*]+\\)\\*$" "\\1" python-buffer)
- (concat "Python-" (symbol-name session))))
- (py-which-bufname bufname))
- (py-shell)
- (setq python-buffer (concat "*" bufname "*"))))
- (t
- (error "No function available for running an inferior python.")))
- (setq org-babel-python-buffers
- (cons (cons session python-buffer)
- (assq-delete-all session org-babel-python-buffers)))
- session)))
-
-(defun org-babel-python-initiate-session (&optional session params)
- "Create a session named SESSION according to PARAMS."
- (unless (string= session "none")
- (org-babel-python-session-buffer
- (org-babel-python-initiate-session-by-key session))))
-
-(defvar org-babel-python-eoe-indicator "'org_babel_python_eoe'"
- "A string to indicate that evaluation has completed.")
-(defvar org-babel-python-wrapper-method
- "
-def main():
-%s
-
-open('%s', 'w').write( str(main()) )")
-(defvar org-babel-python-pp-wrapper-method
- "
-import pprint
-def main():
-%s
-
-open('%s', 'w').write( pprint.pformat(main()) )")
-
-(defun org-babel-python-evaluate
- (session body &optional result-type result-params preamble)
- "Evaluate BODY as python code."
- (if session
- (org-babel-python-evaluate-session
- session body result-type result-params)
- (org-babel-python-evaluate-external-process
- body result-type result-params preamble)))
-
-(defun org-babel-python-evaluate-external-process
- (body &optional result-type result-params preamble)
- "Evaluate BODY in external python process.
-If RESULT-TYPE equals 'output then return standard output as a
-string. If RESULT-TYPE equals 'value then return the value of the
-last statement in BODY, as elisp."
- (case result-type
- (output (org-babel-eval org-babel-python-command
- (concat (if preamble (concat preamble "\n") "") body)))
- (value (let ((tmp-file (org-babel-temp-file "python-")))
- (org-babel-eval org-babel-python-command
- (concat
- (if preamble (concat preamble "\n") "")
- (format
- (if (member "pp" result-params)
- org-babel-python-pp-wrapper-method
- org-babel-python-wrapper-method)
- (mapconcat
- (lambda (line) (format "\t%s" line))
- (split-string
- (org-remove-indentation
- (org-babel-trim body))
- "[\r\n]") "\n")
- (org-babel-process-file-name tmp-file 'noquote))))
- ((lambda (raw)
- (if (or (member "code" result-params)
- (member "pp" result-params))
- raw
- (org-babel-python-table-or-string raw)))
- (org-babel-eval-read-file tmp-file))))))
-
-(defun org-babel-python-evaluate-session
- (session body &optional result-type result-params)
- "Pass BODY to the Python process in SESSION.
-If RESULT-TYPE equals 'output then return standard output as a
-string. If RESULT-TYPE equals 'value then return the value of the
-last statement in BODY, as elisp."
- (flet ((dump-last-value
- (tmp-file pp)
- (mapc
- (lambda (statement) (insert statement) (comint-send-input))
- (if pp
- (list
- "import pprint"
- (format "open('%s', 'w').write(pprint.pformat(_))"
- (org-babel-process-file-name tmp-file 'noquote)))
- (list (format "open('%s', 'w').write(str(_))"
- (org-babel-process-file-name tmp-file 'noquote))))))
- (input-body (body)
- (mapc (lambda (statement) (insert statement) (comint-send-input))
- (split-string (org-babel-trim body) "[\r\n]+"))
- (comint-send-input) (comint-send-input)))
- (case result-type
- (output
- (mapconcat
- #'org-babel-trim
- (butlast
- (org-babel-comint-with-output
- (session org-babel-python-eoe-indicator t body)
- (let ((comint-process-echoes nil))
- (input-body body)
- (insert org-babel-python-eoe-indicator)
- (comint-send-input))) 2) "\n"))
- (value
- ((lambda (results)
- (if (or (member "code" result-params) (member "pp" result-params))
- results
- (org-babel-python-table-or-string results)))
- (let ((tmp-file (org-babel-temp-file "python-")))
- (org-babel-comint-with-output
- (session org-babel-python-eoe-indicator t body)
- (let ((comint-process-echoes nil))
- (input-body body)
- (dump-last-value tmp-file (member "pp" result-params))
- (comint-send-input) (comint-send-input)
- (insert org-babel-python-eoe-indicator)
- (comint-send-input)))
- (org-babel-eval-read-file tmp-file)))))))
-
-(defun org-babel-python-read-string (string)
- "Strip 's from around python string"
- (if (string-match "^'\\([^\000]+\\)'$" string)
- (match-string 1 string)
- string))
-
-(provide 'ob-python)
-
-;; arch-tag: f19b6c3d-dfcb-4a1a-9ce0-45ade1ebc212
-
-;;; ob-python.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-python.elc b/.emacs.d/org-7.4/lisp/ob-python.elc
deleted file mode 100644
index 55cd4a7..0000000
--- a/.emacs.d/org-7.4/lisp/ob-python.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-ref.el b/.emacs.d/org-7.4/lisp/ob-ref.el
deleted file mode 100644
index 2ca99ca..0000000
--- a/.emacs.d/org-7.4/lisp/ob-ref.el
+++ /dev/null
@@ -1,229 +0,0 @@
-;;; ob-ref.el --- org-babel functions for referencing external data
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Eric Schulte, Dan Davison
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Functions for referencing data from the header arguments of a
-;; org-babel block. The syntax of such a reference should be
-
-;; #+VAR: variable-name=file:resource-id
-
-;; - variable-name :: the name of the variable to which the value
-;; will be assigned
-
-;; - file :: path to the file containing the resource, or omitted if
-;; resource is in the current file
-
-;; - resource-id :: the id or name of the resource
-
-;; So an example of a simple src block referencing table data in the
-;; same file would be
-
-;; #+TBLNAME: sandbox
-;; | 1 | 2 | 3 |
-;; | 4 | org-babel | 6 |
-;;
-;; #+begin_src emacs-lisp :var table=sandbox
-;; (message table)
-;; #+end_src
-
-;;; Code:
-(require 'ob)
-(eval-when-compile
- (require 'org-list)
- (require 'cl))
-
-(declare-function org-remove-if-not "org" (predicate seq))
-(declare-function org-at-table-p "org" (&optional table-type))
-(declare-function org-count "org" (CL-ITEM CL-SEQ))
-(declare-function org-in-item-p "org-list" ())
-
-(defvar org-babel-ref-split-regexp
- "[ \f\t\n\r\v]*\\(.+?\\)[ \f\t\n\r\v]*=[ \f\t\n\r\v]*\\(.+\\)[ \f\t\n\r\v]*")
-
-(defun org-babel-ref-parse (assignment)
- "Parse a variable ASSIGNMENT in a header argument.
-If the right hand side of the assignment has a literal value
-return that value, otherwise interpret as a reference to an
-external resource and find it's value using
-`org-babel-ref-resolve'. Return a list with two elements. The
-first element of the list will be the name of the variable, and
-the second will be an emacs-lisp representation of the value of
-the variable."
- (when (string-match org-babel-ref-split-regexp assignment)
- (let ((var (match-string 1 assignment))
- (ref (match-string 2 assignment)))
- (cons (intern var)
- (let ((out (org-babel-read ref)))
- (if (equal out ref)
- (if (string-match "^\".+\"$" ref)
- (read ref)
- (org-babel-ref-resolve ref))
- out))))))
-
-(defvar org-babel-library-of-babel)
-(defun org-babel-ref-resolve (ref)
- "Resolve the reference REF and return its value."
- (save-excursion
- (let ((case-fold-search t)
- type args new-refere new-header-args new-referent result
- lob-info split-file split-ref index index-row index-col)
- ;; if ref is indexed grab the indices -- beware nested indices
- (when (and (string-match "\\[\\([^\\[]+\\)\\]$" ref)
- (let ((str (substring ref 0 (match-beginning 0))))
- (= (org-count ?( str) (org-count ?) str))))
- (setq index (match-string 1 ref))
- (setq ref (substring ref 0 (match-beginning 0))))
- ;; assign any arguments to pass to source block
- (when (string-match
- "^\\(.+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)\(\\(.*\\)\)$" ref)
- (setq new-refere (match-string 1 ref))
- (setq new-header-args (match-string 3 ref))
- (setq new-referent (match-string 5 ref))
- (when (> (length new-refere) 0)
- (when (> (length new-referent) 0)
- (setq args (mapcar (lambda (ref) (cons :var ref))
- (org-babel-ref-split-args new-referent))))
- (when (> (length new-header-args) 0)
- (setq args (append (org-babel-parse-header-arguments new-header-args)
- args)))
- (setq ref new-refere)))
- (when (string-match "^\\(.+\\):\\(.+\\)$" ref)
- (setq split-file (match-string 1 ref))
- (setq split-ref (match-string 2 ref))
- (find-file split-file) (setq ref split-ref))
- (save-restriction
- (widen)
- (goto-char (point-min))
- (if (let ((result_regexp (concat "^[ \t]*#\\+\\(TBLNAME\\|RESNAME"
- "\\|RESULTS\\):[ \t]*"
- (regexp-quote ref) "[ \t]*$"))
- (regexp (concat org-babel-src-name-regexp
- (regexp-quote ref) "\\(\(.*\)\\)?" "[ \t]*$")))
- ;; goto ref in the current buffer
- (or (and (not args)
- (or (re-search-forward result_regexp nil t)
- (re-search-backward result_regexp nil t)))
- (re-search-forward regexp nil t)
- (re-search-backward regexp nil t)
- ;; check the Library of Babel
- (setq lob-info (cdr (assoc (intern ref)
- org-babel-library-of-babel)))))
- (unless lob-info (goto-char (match-beginning 0)))
- ;; ;; TODO: allow searching for names in other buffers
- ;; (setq id-loc (org-id-find ref 'marker)
- ;; buffer (marker-buffer id-loc)
- ;; loc (marker-position id-loc))
- ;; (move-marker id-loc nil)
- (error "reference '%s' not found in this buffer" ref))
- (if lob-info
- (setq type 'lob)
- (while (not (setq type (org-babel-ref-at-ref-p)))
- (forward-line 1)
- (beginning-of-line)
- (if (or (= (point) (point-min)) (= (point) (point-max)))
- (error "reference not found"))))
- (let ((params (append args '((:results . "silent")))))
- (setq result
- (case type
- ('results-line (org-babel-read-result))
- ('table (org-babel-read-table))
- ('list (org-babel-read-list))
- ('file (org-babel-read-link))
- ('source-block (org-babel-execute-src-block nil nil params))
- ('lob (org-babel-execute-src-block nil lob-info params)))))
- (if (symbolp result)
- (format "%S" result)
- (if (and index (listp result))
- (org-babel-ref-index-list index result)
- result))))))
-
-(defun org-babel-ref-index-list (index lis)
- "Return the subset of LIS indexed by INDEX.
-
-Indices are 0 based and negative indices count from the end of
-LIS, so 0 references the first element of LIS and -1 references
-the last. If INDEX is separated by \",\"s then each \"portion\"
-is assumed to index into the next deepest nesting or dimension.
-
-A valid \"portion\" can consist of either an integer index, two
-integers separated by a \":\" in which case the entire range is
-returned, or an empty string or \"*\" both of which are
-interpreted to mean the entire range and as such are equivalent
-to \"0:-1\"."
- (if (and (> (length index) 0) (string-match "^\\([^,]*\\),?" index))
- (let ((ind-re "\\(\\([-[:digit:]]+\\):\\([-[:digit:]]+\\)\\|\*\\)")
- (length (length lis))
- (portion (match-string 1 index))
- (remainder (substring index (match-end 0))))
- (flet ((wrap (num) (if (< num 0) (+ length num) num))
- (open (ls) (if (and (listp ls) (= (length ls) 1)) (car ls) ls)))
- (open
- (mapcar
- (lambda (sub-lis) (org-babel-ref-index-list remainder sub-lis))
- (if (or (= 0 (length portion)) (string-match ind-re portion))
- (mapcar
- (lambda (n) (nth n lis))
- (apply 'org-number-sequence
- (if (and (> (length portion) 0) (match-string 2 portion))
- (list
- (wrap (string-to-number (match-string 2 portion)))
- (wrap (string-to-number (match-string 3 portion))))
- (list (wrap 0) (wrap -1)))))
- (list (nth (wrap (string-to-number portion)) lis)))))))
- lis))
-
-(defun org-babel-ref-split-args (arg-string)
- "Split ARG-STRING into top-level arguments of balanced parenthesis."
- (let ((index 0) (depth 0) (buffer "") holder return)
- ;; crawl along string, splitting at any ","s which are on the top level
- (while (< index (length arg-string))
- (setq holder (substring arg-string index (+ 1 index)))
- (setq buffer (concat buffer holder))
- (setq index (+ 1 index))
- (cond
- ((string= holder ",")
- (when (= depth 0)
- (setq return (reverse (cons (substring buffer 0 -1) return)))
- (setq buffer "")))
- ((or (string= holder "(") (string= holder "[")) (setq depth (+ depth 1)))
- ((or (string= holder ")") (string= holder "]")) (setq depth (- depth 1)))))
- (mapcar #'org-babel-trim (reverse (cons buffer return)))))
-
-(defvar org-bracket-link-regexp)
-(defun org-babel-ref-at-ref-p ()
- "Return the type of reference located at point.
-Return nil if none of the supported reference types are found.
-Supported reference types are tables and source blocks."
- (cond ((org-at-table-p) 'table)
- ((org-in-item-p) 'list)
- ((looking-at "^[ \t]*#\\+BEGIN_SRC") 'source-block)
- ((looking-at org-bracket-link-regexp) 'file)
- ((looking-at org-babel-result-regexp) 'results-line)))
-
-(provide 'ob-ref)
-
-;; arch-tag: ace4a4f4-ea38-4dac-8fe6-6f52fcc43b6d
-
-;;; ob-ref.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-ref.elc b/.emacs.d/org-7.4/lisp/ob-ref.elc
deleted file mode 100644
index b172193..0000000
--- a/.emacs.d/org-7.4/lisp/ob-ref.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-ruby.el b/.emacs.d/org-7.4/lisp/ob-ruby.el
deleted file mode 100644
index 3f2af39..0000000
--- a/.emacs.d/org-7.4/lisp/ob-ruby.el
+++ /dev/null
@@ -1,239 +0,0 @@
-;;; ob-ruby.el --- org-babel functions for ruby evaluation
-
-;; Copyright (C) 2009, 2010 Free Software Foundation
-
-;; Author: Eric Schulte
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Org-Babel support for evaluating ruby source code.
-
-;;; Requirements:
-
-;; - ruby and irb executables :: http://www.ruby-lang.org/
-;;
-;; - ruby-mode :: Can be installed through ELPA, or from
-;; http://github.com/eschulte/rinari/raw/master/util/ruby-mode.el
-;;
-;; - inf-ruby mode :: Can be installed through ELPA, or from
-;; http://github.com/eschulte/rinari/raw/master/util/inf-ruby.el
-
-;;; Code:
-(require 'ob)
-(require 'ob-ref)
-(require 'ob-comint)
-(require 'ob-eval)
-(eval-when-compile (require 'cl))
-
-(declare-function run-ruby "ext:inf-ruby" (&optional command name))
-
-(add-to-list 'org-babel-tangle-lang-exts '("ruby" . "rb"))
-
-(defvar org-babel-default-header-args:ruby '())
-
-(defvar org-babel-ruby-command "ruby"
- "Name of command to use for executing ruby code.")
-
-(defun org-babel-execute:ruby (body params)
- "Execute a block of Ruby code with Babel.
-This function is called by `org-babel-execute-src-block'."
- (let* ((session (org-babel-ruby-initiate-session
- (cdr (assoc :session params))))
- (result-params (cdr (assoc :result-params params)))
- (result-type (cdr (assoc :result-type params)))
- (full-body (org-babel-expand-body:generic
- body params (org-babel-variable-assignments:ruby params)))
- (result (org-babel-ruby-evaluate
- session full-body result-type result-params)))
- (or (cdr (assoc :file params))
- (org-babel-reassemble-table
- result
- (org-babel-pick-name (cdr (assoc :colname-names params))
- (cdr (assoc :colnames params)))
- (org-babel-pick-name (cdr (assoc :rowname-names params))
- (cdr (assoc :rownames params)))))))
-
-(defun org-babel-prep-session:ruby (session params)
- "Prepare SESSION according to the header arguments specified in PARAMS."
- ;; (message "params=%S" params) ;; debugging
- (let* ((session (org-babel-ruby-initiate-session session))
- (var-lines (org-babel-variable-assignments:ruby params)))
- (org-babel-comint-in-buffer session
- (sit-for .5) (goto-char (point-max))
- (mapc (lambda (var)
- (insert var) (comint-send-input nil t)
- (org-babel-comint-wait-for-output session)
- (sit-for .1) (goto-char (point-max))) var-lines))
- session))
-
-(defun org-babel-load-session:ruby (session body params)
- "Load BODY into SESSION."
- (save-window-excursion
- (let ((buffer (org-babel-prep-session:ruby session params)))
- (with-current-buffer buffer
- (goto-char (process-mark (get-buffer-process (current-buffer))))
- (insert (org-babel-chomp body)))
- buffer)))
-
-;; helper functions
-
-(defun org-babel-variable-assignments:ruby (params)
- "Return list of ruby statements assigning the block's variables"
- (mapcar
- (lambda (pair)
- (format "%s=%s"
- (car pair)
- (org-babel-ruby-var-to-ruby (cdr pair))))
- (mapcar #'cdr (org-babel-get-header params :var))))
-
-(defun org-babel-ruby-var-to-ruby (var)
- "Convert VAR into a ruby variable.
-Convert an elisp value into a string of ruby source code
-specifying a variable of the same value."
- (if (listp var)
- (concat "[" (mapconcat #'org-babel-ruby-var-to-ruby var ", ") "]")
- (format "%S" var)))
-
-(defun org-babel-ruby-table-or-string (results)
- "Convert RESULTS into an appropriate elisp value.
-If RESULTS look like a table, then convert them into an
-Emacs-lisp table, otherwise return the results as a string."
- (org-babel-script-escape results))
-
-(defun org-babel-ruby-initiate-session (&optional session params)
- "Initiate a ruby session.
-If there is not a current inferior-process-buffer in SESSION
-then create one. Return the initialized session."
- (require 'inf-ruby)
- (unless (string= session "none")
- (let ((session-buffer (save-window-excursion
- (run-ruby nil session) (current-buffer))))
- (if (org-babel-comint-buffer-livep session-buffer)
- (progn (sit-for .25) session-buffer)
- (sit-for .5)
- (org-babel-ruby-initiate-session session)))))
-
-(defvar org-babel-ruby-eoe-indicator ":org_babel_ruby_eoe"
- "String to indicate that evaluation has completed.")
-(defvar org-babel-ruby-f-write
- "File.open('%s','w'){|f| f.write((_.class == String) ? _ : _.inspect)}")
-(defvar org-babel-ruby-pp-f-write
- "File.open('%s','w'){|f| $stdout = f; pp(results); $stdout = orig_out}")
-(defvar org-babel-ruby-wrapper-method
- "
-def main()
-%s
-end
-results = main()
-File.open('%s', 'w'){ |f| f.write((results.class == String) ? results : results.inspect) }
-")
-(defvar org-babel-ruby-pp-wrapper-method
- "
-require 'pp'
-def main()
-%s
-end
-results = main()
-File.open('%s', 'w') do |f|
- $stdout = f
- pp results
-end
-")
-
-(defun org-babel-ruby-evaluate
- (buffer body &optional result-type result-params)
- "Pass BODY to the Ruby process in BUFFER.
-If RESULT-TYPE equals 'output then return a list of the outputs
-of the statements in BODY, if RESULT-TYPE equals 'value then
-return the value of the last statement in BODY, as elisp."
- (if (not buffer)
- ;; external process evaluation
- (case result-type
- (output (org-babel-eval org-babel-ruby-command body))
- (value (let ((tmp-file (org-babel-temp-file "ruby-")))
- (org-babel-eval
- org-babel-ruby-command
- (format (if (member "pp" result-params)
- org-babel-ruby-pp-wrapper-method
- org-babel-ruby-wrapper-method)
- body (org-babel-process-file-name tmp-file 'noquote)))
- ((lambda (raw)
- (if (or (member "code" result-params)
- (member "pp" result-params))
- raw
- (org-babel-ruby-table-or-string raw)))
- (org-babel-eval-read-file tmp-file)))))
- ;; comint session evaluation
- (case result-type
- (output
- (mapconcat
- #'identity
- (butlast
- (split-string
- (mapconcat
- #'org-babel-trim
- (butlast
- (org-babel-comint-with-output
- (buffer org-babel-ruby-eoe-indicator t body)
- (mapc
- (lambda (line)
- (insert (org-babel-chomp line)) (comint-send-input nil t))
- (list body org-babel-ruby-eoe-indicator))
- (comint-send-input nil t)) 2)
- "\n") "[\r\n]")) "\n"))
- (value
- ((lambda (results)
- (if (or (member "code" result-params) (member "pp" result-params))
- results
- (org-babel-ruby-table-or-string results)))
- (let* ((tmp-file (org-babel-temp-file "ruby-"))
- (ppp (or (member "code" result-params)
- (member "pp" result-params))))
- (org-babel-comint-with-output
- (buffer org-babel-ruby-eoe-indicator t body)
- (when ppp (insert "require 'pp';") (comint-send-input nil t))
- (mapc
- (lambda (line)
- (insert (org-babel-chomp line)) (comint-send-input nil t))
- (append
- (list body)
- (if (not ppp)
- (list (format org-babel-ruby-f-write
- (org-babel-process-file-name tmp-file 'noquote)))
- (list
- "results=_" "require 'pp'" "orig_out = $stdout"
- (format org-babel-ruby-pp-f-write
- (org-babel-process-file-name tmp-file 'noquote))))
- (list org-babel-ruby-eoe-indicator)))
- (comint-send-input nil t))
- (org-babel-eval-read-file tmp-file)))))))
-
-(defun org-babel-ruby-read-string (string)
- "Strip \\\"s from around a ruby string."
- (if (string-match "^\"\\([^\000]+\\)\"$" string)
- (match-string 1 string)
- string))
-
-(provide 'ob-ruby)
-
-;; arch-tag: 3e9726db-4520-49e2-b263-e8f571ac88f5
-
-;;; ob-ruby.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-ruby.elc b/.emacs.d/org-7.4/lisp/ob-ruby.elc
deleted file mode 100644
index 32a1e65..0000000
--- a/.emacs.d/org-7.4/lisp/ob-ruby.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-sass.el b/.emacs.d/org-7.4/lisp/ob-sass.el
deleted file mode 100644
index b3acc8b..0000000
--- a/.emacs.d/org-7.4/lisp/ob-sass.el
+++ /dev/null
@@ -1,69 +0,0 @@
-;;; ob-sass.el --- org-babel functions for the sass css generation language
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Eric Schulte
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; For more information on sass see http://sass-lang.com/
-;;
-;; This accepts a 'file' header argument which is the target of the
-;; compiled sass. The default output type for sass evaluation is
-;; either file (if a 'file' header argument was given) or scalar if no
-;; such header argument was supplied.
-;;
-;; A 'cmdline' header argument can be supplied to pass arguments to
-;; the sass command line.
-
-;;; Requirements:
-
-;; - sass-mode :: http://github.com/nex3/haml/blob/master/extra/sass-mode.el
-
-;;; Code:
-(require 'ob)
-
-(defvar org-babel-default-header-args:sass '())
-
-(defun org-babel-execute:sass (body params)
- "Execute a block of Sass code with Babel.
-This function is called by `org-babel-execute-src-block'."
- (let* ((result-params (split-string (or (cdr (assoc :results params)) "")))
- (file (cdr (assoc :file params)))
- (out-file (or file (org-babel-temp-file "sass-out-")))
- (cmdline (cdr (assoc :cmdline params)))
- (in-file (org-babel-temp-file "sass-in-"))
- (cmd (concat "sass " (or cmdline "")
- " " (org-babel-process-file-name in-file)
- " " (org-babel-process-file-name out-file))))
- (with-temp-file in-file
- (insert (org-babel-expand-body:generic body params))) (shell-command cmd)
- (or file (with-temp-buffer (insert-file-contents out-file) (buffer-string)))))
-
-(defun org-babel-prep-session:sass (session params)
- "Raise an error because sass does not support sessions."
- (error "Sass does not support sessions"))
-
-(provide 'ob-sass)
-
-;; arch-tag: 2954b169-eef4-45ce-a8e5-3e619f0f07ac
-
-;;; ob-sass.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-sass.elc b/.emacs.d/org-7.4/lisp/ob-sass.elc
deleted file mode 100644
index 06ed6fc..0000000
--- a/.emacs.d/org-7.4/lisp/ob-sass.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-scheme.el b/.emacs.d/org-7.4/lisp/ob-scheme.el
deleted file mode 100644
index b2b9fa6..0000000
--- a/.emacs.d/org-7.4/lisp/ob-scheme.el
+++ /dev/null
@@ -1,139 +0,0 @@
-;;; ob-scheme.el --- org-babel functions for Scheme
-
-;; Copyright (C) 2010 Free Software Foundation
-
-;; Author: Eric Schulte
-;; Keywords: literate programming, reproducible research, scheme
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;;; License:
-
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; Now working with SBCL for both session and external evaluation.
-;;
-;; This certainly isn't optimally robust, but it seems to be working
-;; for the basic use cases.
-
-;;; Requirements:
-
-;; - a working scheme implementation
-;; (e.g. guile http://www.gnu.org/software/guile/guile.html)
-;;
-;; - for session based evaluation cmuscheme.el is required which is
-;; included in Emacs
-
-;;; Code:
-(require 'ob)
-(require 'ob-ref)
-(require 'ob-comint)
-(require 'ob-eval)
-(eval-when-compile (require 'cl))
-
-(declare-function run-scheme "ext:cmuscheme" (cmd))
-
-(defvar org-babel-default-header-args:scheme '()
- "Default header arguments for scheme code blocks.")
-
-(defvar org-babel-scheme-eoe "org-babel-scheme-eoe"
- "String to indicate that evaluation has completed.")
-
-(defcustom org-babel-scheme-cmd "guile"
- "Name of command used to evaluate scheme blocks."
- :group 'org-babel
- :type 'string)
-
-(defun org-babel-expand-body:scheme (body params)
- "Expand BODY according to PARAMS, return the expanded body."
- (let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
- (if (> (length vars) 0)
- (concat "(let ("
- (mapconcat
- (lambda (var) (format "%S" (print `(,(car var) ',(cdr var)))))
- vars "\n ")
- ")\n" body ")")
- body)))
-
-(defvar scheme-program-name)
-(defun org-babel-execute:scheme (body params)
- "Execute a block of Scheme code with org-babel.
-This function is called by `org-babel-execute-src-block'"
- (let* ((result-type (cdr (assoc :result-type params)))
- (org-babel-scheme-cmd (or (cdr (assoc :scheme params))
- org-babel-scheme-cmd))
- (full-body (org-babel-expand-body:scheme body params)))
- (read
- (if (not (string= (cdr (assoc :session params)) "none"))
- ;; session evaluation
- (let ((session (org-babel-prep-session:scheme
- (cdr (assoc :session params)) params)))
- (org-babel-comint-with-output
- (session (format "%S" org-babel-scheme-eoe) t body)
- (mapc
- (lambda (line)
- (insert (org-babel-chomp line)) (comint-send-input nil t))
- (list body (format "%S" org-babel-scheme-eoe)))))
- ;; external evaluation
- (let ((script-file (org-babel-temp-file "scheme-script-")))
- (with-temp-file script-file
- (insert
- ;; return the value or the output
- (if (string= result-type "value")
- (format "(display %s)" full-body)
- full-body)))
- (org-babel-eval
- (format "%s %s" org-babel-scheme-cmd
- (org-babel-process-file-name script-file)) ""))))))
-
-(defun org-babel-prep-session:scheme (session params)
- "Prepare SESSION according to the header arguments specified in PARAMS."
- (let* ((session (org-babel-scheme-initiate-session session))
- (vars (mapcar #'cdr (org-babel-get-header params :var)))
- (var-lines
- (mapcar
- (lambda (var) (format "%S" (print `(define ,(car var) ',(cdr var)))))
- vars)))
- (when session
- (org-babel-comint-in-buffer session
- (sit-for .5) (goto-char (point-max))
- (mapc (lambda (var)
- (insert var) (comint-send-input nil t)
- (org-babel-comint-wait-for-output session)
- (sit-for .1) (goto-char (point-max))) var-lines)))
- session))
-
-(defun org-babel-scheme-initiate-session (&optional session)
- "If there is not a current inferior-process-buffer in SESSION
-then create. Return the initialized session."
- (require 'cmuscheme)
- (unless (string= session "none")
- (let ((session-buffer (save-window-excursion
- (run-scheme org-babel-scheme-cmd)
- (rename-buffer session)
- (current-buffer))))
- (if (org-babel-comint-buffer-livep session-buffer)
- (progn (sit-for .25) session-buffer)
- (sit-for .5)
- (org-babel-scheme-initiate-session session)))))
-
-(provide 'ob-scheme)
-
-;; arch-tag: 6b2fe76f-4b25-4e87-ad1c-225b2f282a71
-
-;;; ob-scheme.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-scheme.elc b/.emacs.d/org-7.4/lisp/ob-scheme.elc
deleted file mode 100644
index 960d7f9..0000000
--- a/.emacs.d/org-7.4/lisp/ob-scheme.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-screen.el b/.emacs.d/org-7.4/lisp/ob-screen.el
deleted file mode 100644
index 7f4af79..0000000
--- a/.emacs.d/org-7.4/lisp/ob-screen.el
+++ /dev/null
@@ -1,147 +0,0 @@
-;;; ob-screen.el --- org-babel support for interactive terminal
-
-;; Copyright (C) 2009, 2010 Free Software Foundation
-
-;; Author: Benjamin Andresen
-;; Keywords: literate programming, interactive shell
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Org-Babel support for interactive terminals. Mostly shell scripts.
-;; Heavily inspired by 'eev' from Eduardo Ochs
-;;
-;; Adding :cmd and :terminal as header arguments
-;; :terminal must support the -T (title) and -e (command) parameter
-;;
-;; You can test the default setup. (xterm + sh) with
-;; M-x org-babel-screen-test RET
-
-;;; Code:
-(require 'ob)
-(require 'ob-ref)
-
-(defvar org-babel-screen-location "screen"
- "The command location for screen.
-In case you want to use a different screen than one selected by your $PATH")
-
-(defvar org-babel-default-header-args:screen
- '((:results . "silent") (:session . "default") (:cmd . "sh") (:terminal . "xterm"))
- "Default arguments to use when running screen source blocks.")
-
-(defun org-babel-execute:screen (body params)
- "Send a block of code via screen to a terminal using Babel.
-\"default\" session is used when none is specified."
- (message "Sending source code block to interactive terminal session...")
- (save-window-excursion
- (let* ((session (cdr (assoc :session params)))
- (socket (org-babel-screen-session-socketname session)))
- (unless socket (org-babel-prep-session:screen session params))
- (org-babel-screen-session-execute-string
- session (org-babel-expand-body:generic body params)))))
-
-(defun org-babel-prep-session:screen (session params)
- "Prepare SESSION according to the header arguments specified in PARAMS."
- (let* ((session (cdr (assoc :session params)))
- (socket (org-babel-screen-session-socketname session))
- (cmd (cdr (assoc :cmd params)))
- (terminal (cdr (assoc :terminal params)))
- (process-name (concat "org-babel: terminal (" session ")")))
- (apply 'start-process process-name "*Messages*"
- terminal `("-T" ,(concat "org-babel: " session) "-e" ,org-babel-screen-location
- "-c" "/dev/null" "-mS" ,(concat "org-babel-session-" session)
- ,cmd))
- ;; XXX: Is there a better way than the following?
- (while (not (org-babel-screen-session-socketname session))
- ;; wait until screen session is available before returning
- )))
-
-;; helper functions
-
-(defun org-babel-screen-session-execute-string (session body)
- "If SESSION exists, send BODY to it."
- (let ((socket (org-babel-screen-session-socketname session)))
- (when socket
- (let ((tmpfile (org-babel-screen-session-write-temp-file session body)))
- (apply 'start-process (concat "org-babel: screen (" session ")") "*Messages*"
- org-babel-screen-location
- `("-S" ,socket "-X" "eval" "msgwait 0"
- ,(concat "readreg z " tmpfile)
- "paste z"))))))
-
-(defun org-babel-screen-session-socketname (session)
- "Check if SESSION exists by parsing output of \"screen -ls\"."
- (let* ((screen-ls (shell-command-to-string "screen -ls"))
- (sockets (delq
- nil
- (mapcar
- (lambda (x)
- (when (string-match (rx (or "(Attached)" "(Detached)")) x)
- x))
- (split-string screen-ls "\n"))))
- (match-socket (car
- (delq
- nil
- (mapcar
- (lambda (x)
- (when (string-match
- (concat "org-babel-session-" session) x)
- x))
- sockets)))))
- (when match-socket (car (split-string match-socket)))))
-
-(defun org-babel-screen-session-write-temp-file (session body)
- "Save BODY in a temp file that is named after SESSION."
- (let ((tmpfile (concat "/tmp/screen.org-babel-session-" session)))
- (with-temp-file tmpfile
- (insert body)
-
- ;; org-babel has superflous spaces
- (goto-char (point-min))
- (delete-matching-lines "^ +$"))
- tmpfile))
-
-(defun org-babel-screen-test ()
- "Test if the default setup works.
-The terminal should shortly flicker."
- (interactive)
- (let* ((session "org-babel-testing")
- (random-string (format "%s" (random 99999)))
- (tmpfile "/tmp/org-babel-screen.test")
- (body (concat "echo '" random-string "' > " tmpfile "\nexit\n"))
- process tmp-string)
- (org-babel-execute:screen body org-babel-default-header-args:screen)
- ;; XXX: need to find a better way to do the following
- (while (not (file-readable-p tmpfile))
- ;; do something, otherwise this will be optimized away
- (format "org-babel-screen: File not readable yet."))
- (setq tmp-string (with-temp-buffer
- (insert-file-contents-literally tmpfile)
- (buffer-substring (point-min) (point-max))))
- (delete-file tmpfile)
- (message (concat "org-babel-screen: Setup "
- (if (string-match random-string tmp-string)
- "WORKS."
- "DOESN'T work.")))))
-
-(provide 'ob-screen)
-
-;; arch-tag: 908e5afe-89a0-4f27-b982-23f1f2e3bac9
-
-;;; ob-screen.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-screen.elc b/.emacs.d/org-7.4/lisp/ob-screen.elc
deleted file mode 100644
index 57735aa..0000000
--- a/.emacs.d/org-7.4/lisp/ob-screen.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-sh.el b/.emacs.d/org-7.4/lisp/ob-sh.el
deleted file mode 100644
index e153d68..0000000
--- a/.emacs.d/org-7.4/lisp/ob-sh.el
+++ /dev/null
@@ -1,171 +0,0 @@
-;;; ob-sh.el --- org-babel functions for shell evaluation
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Eric Schulte
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Org-Babel support for evaluating shell source code.
-
-;;; Code:
-(require 'ob)
-(require 'ob-comint)
-(require 'ob-eval)
-(require 'shell)
-(eval-when-compile (require 'cl))
-
-(declare-function org-babel-comint-in-buffer "ob-comint" (buffer &rest body))
-(declare-function org-babel-comint-wait-for-output "ob-comint" (buffer))
-(declare-function org-babel-comint-buffer-livep "ob-comint" (buffer))
-(declare-function org-babel-comint-with-output "ob-comint" (meta &rest body))
-(declare-function orgtbl-to-generic "org-table" (table params))
-
-(defvar org-babel-default-header-args:sh '())
-
-(defvar org-babel-sh-command "sh"
- "Command used to invoke a shell.
-This will be passed to `shell-command-on-region'")
-
-(defun org-babel-execute:sh (body params)
- "Execute a block of Shell commands with Babel.
-This function is called by `org-babel-execute-src-block'."
- (let* ((session (org-babel-sh-initiate-session
- (cdr (assoc :session params))))
- (result-params (cdr (assoc :result-params params)))
- (full-body (org-babel-expand-body:generic
- body params (org-babel-variable-assignments:sh params))))
- (org-babel-reassemble-table
- (org-babel-sh-evaluate session full-body result-params)
- (org-babel-pick-name
- (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
- (org-babel-pick-name
- (cdr (assoc :rowname-names params)) (cdr (assoc :rownames params))))))
-
-(defun org-babel-prep-session:sh (session params)
- "Prepare SESSION according to the header arguments specified in PARAMS."
- (let* ((session (org-babel-sh-initiate-session session))
- (var-lines (org-babel-variable-assignments:sh params)))
- (org-babel-comint-in-buffer session
- (mapc (lambda (var)
- (insert var) (comint-send-input nil t)
- (org-babel-comint-wait-for-output session)) var-lines))
- session))
-
-(defun org-babel-load-session:sh (session body params)
- "Load BODY into SESSION."
- (save-window-excursion
- (let ((buffer (org-babel-prep-session:sh session params)))
- (with-current-buffer buffer
- (goto-char (process-mark (get-buffer-process (current-buffer))))
- (insert (org-babel-chomp body)))
- buffer)))
-
-;; helper functions
-
-(defun org-babel-variable-assignments:sh (params)
- "Return list of shell statements assigning the block's variables"
- (let ((sep (cdr (assoc :separator params))))
- (mapcar
- (lambda (pair)
- (format "%s=%s"
- (car pair)
- (org-babel-sh-var-to-sh (cdr pair) sep)))
- (mapcar #'cdr (org-babel-get-header params :var)))))
-
-(defun org-babel-sh-var-to-sh (var &optional sep)
- "Convert an elisp value to a shell variable.
-Convert an elisp var into a string of shell commands specifying a
-var of the same value."
- (if (listp var)
- (flet ((deep-string (el)
- (if (listp el)
- (mapcar #'deep-string el)
- (org-babel-sh-var-to-sh el sep))))
- (format "$(cat <<'BABEL_TABLE'\n%s\nBABEL_TABLE\n)"
- (orgtbl-to-generic
- (deep-string (if (listp (car var)) var (list var)))
- (list :sep (or sep "\t")))))
- (if (stringp var)
- (if (string-match "[\n\r]" var)
- (format "$(cat <<BABEL_STRING\n%s\nBABEL_STRING\n)" var)
- (format "%s" var))
- (format "%S" var))))
-
-(defun org-babel-sh-table-or-results (results)
- "Convert RESULTS to an appropriate elisp value.
-If the results look like a table, then convert them into an
-Emacs-lisp table, otherwise return the results as a string."
- (org-babel-script-escape results))
-
-(defun org-babel-sh-initiate-session (&optional session params)
- "Initiate a session named SESSION according to PARAMS."
- (when (and session (not (string= session "none")))
- (save-window-excursion
- (or (org-babel-comint-buffer-livep session)
- (progn (shell session) (get-buffer (current-buffer)))))))
-
-(defvar org-babel-sh-eoe-indicator "echo 'org_babel_sh_eoe'"
- "String to indicate that evaluation has completed.")
-(defvar org-babel-sh-eoe-output "org_babel_sh_eoe"
- "String to indicate that evaluation has completed.")
-
-(defun org-babel-sh-evaluate (session body &optional result-params)
- "Pass BODY to the Shell process in BUFFER.
-If RESULT-TYPE equals 'output then return a list of the outputs
-of the statements in BODY, if RESULT-TYPE equals 'value then
-return the value of the last statement in BODY."
- ((lambda (results)
- (when results
- (if (or (member "scalar" result-params)
- (member "output" result-params))
- results
- (let ((tmp-file (org-babel-temp-file "sh-")))
- (with-temp-file tmp-file (insert results))
- (org-babel-import-elisp-from-file tmp-file)))))
- (if (not session)
- (org-babel-eval org-babel-sh-command (org-babel-trim body))
- (mapconcat
- #'org-babel-sh-strip-weird-long-prompt
- (mapcar
- #'org-babel-trim
- (butlast
- (org-babel-comint-with-output
- (session org-babel-sh-eoe-output t body)
- (mapc
- (lambda (line)
- (insert line) (comint-send-input nil t) (sleep-for 0.25))
- (append
- (split-string (org-babel-trim body) "\n")
- (list org-babel-sh-eoe-indicator))))
- 2)) "\n"))))
-
-(defun org-babel-sh-strip-weird-long-prompt (string)
- "Remove prompt cruft from a string of shell output."
- (while (string-match "^% +[\r\n$]+ *" string)
- (setq string (substring string (match-end 0))))
- string)
-
-(provide 'ob-sh)
-
-;; arch-tag: 416dd531-c230-4b0a-a5bf-8d948f990f2d
-
-;;; ob-sh.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-sh.elc b/.emacs.d/org-7.4/lisp/ob-sh.elc
deleted file mode 100644
index 9a98a42..0000000
--- a/.emacs.d/org-7.4/lisp/ob-sh.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-sql.el b/.emacs.d/org-7.4/lisp/ob-sql.el
deleted file mode 100644
index 5bb123d..0000000
--- a/.emacs.d/org-7.4/lisp/ob-sql.el
+++ /dev/null
@@ -1,126 +0,0 @@
-;;; ob-sql.el --- org-babel functions for sql evaluation
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Eric Schulte
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Org-Babel support for evaluating sql source code.
-;;
-;; SQL is somewhat unique in that there are many different engines for
-;; the evaluation of sql (Mysql, PostgreSQL, etc...), so much of this
-;; file will have to be implemented engine by engine.
-;;
-;; Also SQL evaluation generally takes place inside of a database.
-;;
-;; For now lets just allow a generic ':cmdline' header argument.
-;;
-;; TODO:
-;;
-;; - support for sessions
-;; - add more useful header arguments (user, passwd, database, etc...)
-;; - support for more engines (currently only supports mysql)
-;; - what's a reasonable way to drop table data into SQL?
-;;
-
-;;; Code:
-(require 'ob)
-(eval-when-compile (require 'cl))
-
-(declare-function org-table-import "org-table" (file arg))
-(declare-function orgtbl-to-csv "org-table" (TABLE PARAMS))
-
-(defvar org-babel-default-header-args:sql '())
-
-(defun org-babel-expand-body:sql (body params)
- "Expand BODY according to the values of PARAMS."
- (org-babel-sql-expand-vars
- body (mapcar #'cdr (org-babel-get-header params :var))))
-
-(defun org-babel-execute:sql (body params)
- "Execute a block of Sql code with Babel.
-This function is called by `org-babel-execute-src-block'."
- (let* ((result-params (cdr (assoc :result-params params)))
- (cmdline (cdr (assoc :cmdline params)))
- (engine (cdr (assoc :engine params)))
- (in-file (org-babel-temp-file "sql-in-"))
- (out-file (or (cdr (assoc :out-file params))
- (org-babel-temp-file "sql-out-")))
- (command (case (intern engine)
- ('msosql (format "osql %s -s \"\t\" -i %s -o %s"
- (or cmdline "")
- (org-babel-process-file-name in-file)
- (org-babel-process-file-name out-file)))
- ('mysql (format "mysql %s -e \"source %s\" > %s"
- (or cmdline "")
- (org-babel-process-file-name in-file)
- (org-babel-process-file-name out-file)))
- ('postgresql (format "psql -A -P footer=off -F \"\t\" -f %s -o %s %s"
- (org-babel-process-file-name in-file)
- (org-babel-process-file-name out-file)
- (or cmdline "")))
- (t (error "no support for the %s sql engine" engine)))))
- (with-temp-file in-file
- (insert (org-babel-expand-body:sql body params)))
- (message command)
- (shell-command command)
- (with-temp-buffer
- (org-table-import out-file '(16))
- (org-babel-reassemble-table
- (org-table-to-lisp)
- (org-babel-pick-name (cdr (assoc :colname-names params))
- (cdr (assoc :colnames params)))
- (org-babel-pick-name (cdr (assoc :rowname-names params))
- (cdr (assoc :rownames params)))))))
-
-(defun org-babel-sql-expand-vars (body vars)
- "Expand the variables held in VARS in BODY."
- (mapc
- (lambda (pair)
- (setq body
- (replace-regexp-in-string
- (format "\$%s" (car pair))
- ((lambda (val)
- (if (listp val)
- ((lambda (data-file)
- (with-temp-file data-file
- (insert (orgtbl-to-csv
- val '(:fmt (lambda (el) (if (stringp el)
- el
- (format "%S" el)))))))
- data-file)
- (org-babel-temp-file "sql-data-"))
- (if (stringp val) val (format "%S" val))))
- (cdr pair))
- body)))
- vars)
- body)
-
-(defun org-babel-prep-session:sql (session params)
- "Raise an error because Sql sessions aren't implemented."
- (error "sql sessions not yet implemented"))
-
-(provide 'ob-sql)
-
-;; arch-tag: a43ff944-6de1-4566-a83c-626814e3dad2
-
-;;; ob-sql.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-sql.elc b/.emacs.d/org-7.4/lisp/ob-sql.elc
deleted file mode 100644
index 8a57e86..0000000
--- a/.emacs.d/org-7.4/lisp/ob-sql.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-sqlite.el b/.emacs.d/org-7.4/lisp/ob-sqlite.el
deleted file mode 100644
index 65e8091..0000000
--- a/.emacs.d/org-7.4/lisp/ob-sqlite.el
+++ /dev/null
@@ -1,149 +0,0 @@
-;;; ob-sqlite.el --- org-babel functions for sqlite database interaction
-
-;; Copyright (C) 2010 Free Software Foundation
-
-;; Author: Eric Schulte
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Org-Babel support for evaluating sqlite source code.
-
-;;; Code:
-(require 'ob)
-(require 'ob-eval)
-(require 'ob-ref)
-
-(declare-function org-fill-template "org" (template alist))
-(declare-function org-table-convert-region "org-table"
- (beg0 end0 &optional separator))
-(declare-function orgtbl-to-csv "org-table" (TABLE PARAMS))
-
-(defvar org-babel-default-header-args:sqlite '())
-
-(defvar org-babel-header-arg-names:sqlite
- '(db header echo bail csv column html line list separator nullvalue)
- "Sqlite specific header args.")
-
-(defun org-babel-expand-body:sqlite (body params)
- "Expand BODY according to the values of PARAMS."
- (org-babel-sqlite-expand-vars
- body (mapcar #'cdr (org-babel-get-header params :var))))
-
-(defvar org-babel-sqlite3-command "sqlite3")
-
-(defun org-babel-execute:sqlite (body params)
- "Execute a block of Sqlite code with Babel.
-This function is called by `org-babel-execute-src-block'."
- (let ((result-params (split-string (or (cdr (assoc :results params)) "")))
- (db (cdr (assoc :db params)))
- (separator (cdr (assoc :separator params)))
- (nullvalue (cdr (assoc :nullvalue params)))
- (headers-p (equal "yes" (cdr (assoc :colnames params))))
- (others (delq nil (mapcar
- (lambda (arg) (car (assoc arg params)))
- (list :header :echo :bail :column
- :csv :html :line :list))))
- exit-code)
- (unless db (error "ob-sqlite: can't evaluate without a database."))
- (with-temp-buffer
- (insert
- (org-babel-eval
- (org-fill-template
- "%cmd %header %separator %nullvalue %others %csv %db "
- (list
- (cons "cmd" org-babel-sqlite3-command)
- (cons "header" (if headers-p "-header" "-noheader"))
- (cons "separator"
- (if separator (format "-separator %s" separator) ""))
- (cons "nullvalue"
- (if nullvalue (format "-nullvalue %s" nullvalue) ""))
- (cons "others"
- (mapconcat
- (lambda (arg) (format "-%s" (substring (symbol-name arg) 1)))
- others " "))
- ;; for easy table parsing, default header type should be -csv
- (cons "csv" (if (or (member :csv others) (member :column others)
- (member :line others) (member :list others)
- (member :html others) separator)
- ""
- "-csv"))
- (cons "db " db)))
- ;; body of the code block
- (org-babel-expand-body:sqlite body params)))
- (if (or (member "scalar" result-params)
- (member "html" result-params)
- (member "code" result-params)
- (equal (point-min) (point-max)))
- (buffer-string)
- (org-table-convert-region (point-min) (point-max))
- (org-babel-sqlite-table-or-scalar
- (org-babel-sqlite-offset-colnames
- (org-table-to-lisp) headers-p))))))
-
-(defun org-babel-sqlite-expand-vars (body vars)
- "Expand the variables held in VARS in BODY."
- (mapc
- (lambda (pair)
- (setq body
- (replace-regexp-in-string
- (format "\$%s" (car pair))
- ((lambda (val)
- (if (listp val)
- ((lambda (data-file)
- (with-temp-file data-file
- (insert (orgtbl-to-csv
- val '(:fmt (lambda (el) (if (stringp el)
- el
- (format "%S" el)))))))
- data-file)
- (org-babel-temp-file "sqlite-data-"))
- (if (stringp val) val (format "%S" val))))
- (cdr pair))
- body)))
- vars)
- body)
-
-(defun org-babel-sqlite-table-or-scalar (result)
- "If RESULT looks like a trivial table, then unwrap it."
- (if (and (equal 1 (length result))
- (equal 1 (length (car result))))
- (org-babel-read (caar result))
- (mapcar (lambda (row)
- (if (equal 'hline row)
- 'hline
- (mapcar #'org-babel-read row))) result)))
-
-(defun org-babel-sqlite-offset-colnames (table headers-p)
- "If HEADERS-P is non-nil then offset the first row as column names."
- (if headers-p
- (cons (car table) (cons 'hline (cdr table)))
- table))
-
-(defun org-babel-prep-session:sqlite (session params)
- "Raise an error because support for sqlite sessions isn't implemented.
-Prepare SESSION according to the header arguments specified in PARAMS."
- (error "sqlite sessions not yet implemented"))
-
-(provide 'ob-sqlite)
-
-;; arch-tag: 5c03d7f2-0f72-48b8-bbd1-35aafea248ac
-
-;;; ob-sqlite.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-sqlite.elc b/.emacs.d/org-7.4/lisp/ob-sqlite.elc
deleted file mode 100644
index 6e66482..0000000
--- a/.emacs.d/org-7.4/lisp/ob-sqlite.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-table.el b/.emacs.d/org-7.4/lisp/ob-table.el
deleted file mode 100644
index b7f9673..0000000
--- a/.emacs.d/org-7.4/lisp/ob-table.el
+++ /dev/null
@@ -1,125 +0,0 @@
-;;; ob-table.el --- support for calling org-babel functions from tables
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Eric Schulte
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Should allow calling functions from org-mode tables using the
-;; function `sbe' as so...
-
-;; #+begin_src emacs-lisp :results silent
-;; (defun fibbd (n) (if (< n 2) 1 (+ (fibbd (- n 1)) (fibbd (- n 2)))))
-;; #+end_src
-
-;; #+srcname: fibbd
-;; #+begin_src emacs-lisp :var n=2 :results silent
-;; (fibbd n)
-;; #+end_src
-
-;; | original | fibbd |
-;; |----------+--------|
-;; | 0 | |
-;; | 1 | |
-;; | 2 | |
-;; | 3 | |
-;; | 4 | |
-;; | 5 | |
-;; | 6 | |
-;; | 7 | |
-;; | 8 | |
-;; | 9 | |
-;; #+TBLFM: $2='(sbe 'fibbd (n $1))
-
-;;; Code:
-(require 'ob)
-
-(defun org-babel-table-truncate-at-newline (string)
- "Replace newline character with ellipses.
-If STRING ends in a newline character, then remove the newline
-character and replace it with ellipses."
- (if (and (stringp string) (string-match "[\n\r]\\(.\\)?" string))
- (concat (substring string 0 (match-beginning 0))
- (if (match-string 1 string) "...")) string))
-
-(defmacro sbe (source-block &rest variables)
- "Return the results of calling SOURCE-BLOCK with VARIABLES.
-Each element of VARIABLES should be a two
-element list, whose first element is the name of the variable and
-second element is a string of its value. The following call to
-`sbe' would be equivalent to the following source code block.
-
- (sbe 'source-block (n $2) (m 3))
-
-#+begin_src emacs-lisp :var results=source-block(n=val_at_col_2, m=3) :results silent
-results
-#+end_src
-
-NOTE: by default string variable names are interpreted as
-references to source-code blocks, to force interpretation of a
-cell's value as a string, prefix the identifier with two \"$\"s
-rather than a single \"$\" (i.e. \"$$2\" instead of \"$2\" in the
-example above."
- (let* (quote
- (variables
- (mapcar
- (lambda (var)
- ;; ensure that all cells prefixed with $'s are strings
- (cons (car var)
- (delq nil (mapcar
- (lambda (el)
- (if (eq '$ el)
- (setq quote t)
- (prog1 (if quote
- (format "\"%s\"" el)
- (org-babel-clean-text-properties el))
- (setq quote nil))))
- (cdr var)))))
- variables)))
- (unless (stringp source-block)
- (setq source-block (symbol-name source-block)))
- (org-babel-table-truncate-at-newline ;; org-table cells can't be multi-line
- (if (and source-block (> (length source-block) 0))
- (let ((params
- (eval `(org-babel-parse-header-arguments
- (concat ":var results="
- ,source-block
- "("
- (mapconcat
- (lambda (var-spec)
- (if (> (length (cdr var-spec)) 1)
- (format "%S='%S"
- (car var-spec)
- (mapcar #'read (cdr var-spec)))
- (format "%S=%s"
- (car var-spec) (cadr var-spec))))
- ',variables ", ")
- ")")))))
- (org-babel-execute-src-block
- nil (list "emacs-lisp" "results" params) '((:results . "silent"))))
- ""))))
-
-(provide 'ob-table)
-
-;; arch-tag: 4234cc7c-4fc8-4e92-abb0-2892de1a493b
-
-;;; ob-table.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-table.elc b/.emacs.d/org-7.4/lisp/ob-table.elc
deleted file mode 100644
index 1fc8b46..0000000
--- a/.emacs.d/org-7.4/lisp/ob-table.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob-tangle.el b/.emacs.d/org-7.4/lisp/ob-tangle.el
deleted file mode 100644
index c5ef2a1..0000000
--- a/.emacs.d/org-7.4/lisp/ob-tangle.el
+++ /dev/null
@@ -1,454 +0,0 @@
-;;; ob-tangle.el --- extract source code from org-mode files
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Eric Schulte
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Extract the code from source blocks out into raw source-code files.
-
-;;; Code:
-(require 'ob)
-(require 'org-src)
-(eval-when-compile
- (require 'cl))
-
-(declare-function org-link-escape "org" (text &optional table))
-(declare-function org-heading-components "org" ())
-(declare-function org-back-to-heading "org" (invisible-ok))
-(declare-function org-fill-template "org" (template alist))
-(declare-function org-babel-update-block-body "org" (new-body))
-
-;;;###autoload
-(defcustom org-babel-tangle-lang-exts
- '(("emacs-lisp" . "el"))
- "Alist mapping languages to their file extensions.
-The key is the language name, the value is the string that should
-be inserted as the extension commonly used to identify files
-written in this language. If no entry is found in this list,
-then the name of the language is used."
- :group 'org-babel-tangle
- :type '(repeat
- (cons
- (string "Language name")
- (string "File Extension"))))
-
-(defcustom org-babel-post-tangle-hook nil
- "Hook run in code files tangled by `org-babel-tangle'."
- :group 'org-babel
- :type 'hook)
-
-(defcustom org-babel-pre-tangle-hook '(save-buffer)
- "Hook run at the beginning of `org-babel-tangle'."
- :group 'org-babel
- :type 'hook)
-
-(defcustom org-babel-tangle-pad-newline t
- "Switch indicating whether to pad tangled code with newlines."
- :group 'org-babel
- :type 'boolean)
-
-(defcustom org-babel-tangle-comment-format-beg "[[%link][%source-name]]"
- "Format of inserted comments in tangled code files.
-The following format strings can be used to insert special
-information into the output using `org-fill-template'.
-%start-line --- the line number at the start of the code block
-%file --------- the file from which the code block was tangled
-%link --------- Org-mode style link to the code block
-%source-name -- name of the code block
-
-Whether or not comments are inserted during tangling is
-controlled by the :comments header argument."
- :group 'org-babel
- :type 'string)
-
-(defcustom org-babel-tangle-comment-format-end "%source-name ends here"
- "Format of inserted comments in tangled code files.
-The following format strings can be used to insert special
-information into the output using `org-fill-template'.
-%start-line --- the line number at the start of the code block
-%file --------- the file from which the code block was tangled
-%link --------- Org-mode style link to the code block
-%source-name -- name of the code block
-
-Whether or not comments are inserted during tangling is
-controlled by the :comments header argument."
- :group 'org-babel
- :type 'string)
-
-(defun org-babel-find-file-noselect-refresh (file)
- "Find file ensuring that the latest changes on disk are
-represented in the file."
- (find-file-noselect file)
- (with-current-buffer (get-file-buffer file)
- (revert-buffer t t t)))
-
-(defmacro org-babel-with-temp-filebuffer (file &rest body)
- "Open FILE into a temporary buffer execute BODY there like
-`progn', then kill the FILE buffer returning the result of
-evaluating BODY."
- (declare (indent 1))
- (let ((temp-result (make-symbol "temp-result"))
- (temp-file (make-symbol "temp-file"))
- (visited-p (make-symbol "visited-p")))
- `(let (,temp-result ,temp-file
- (,visited-p (get-file-buffer ,file)))
- (org-babel-find-file-noselect-refresh ,file)
- (setf ,temp-file (get-file-buffer ,file))
- (with-current-buffer ,temp-file
- (setf ,temp-result (progn ,@body)))
- (unless ,visited-p (kill-buffer ,temp-file))
- ,temp-result)))
-
-;;;###autoload
-(defun org-babel-load-file (file)
- "Load Emacs Lisp source code blocks in the Org-mode FILE.
-This function exports the source code using
-`org-babel-tangle' and then loads the resulting file using
-`load-file'."
- (interactive "fFile to load: ")
- (flet ((age (file)
- (float-time
- (time-subtract (current-time)
- (nth 5 (or (file-attributes (file-truename file))
- (file-attributes file)))))))
- (let* ((base-name (file-name-sans-extension file))
- (exported-file (concat base-name ".el")))
- ;; tangle if the org-mode file is newer than the elisp file
- (unless (and (file-exists-p exported-file)
- (> (age file) (age exported-file)))
- (org-babel-tangle-file file exported-file "emacs-lisp"))
- (load-file exported-file)
- (message "loaded %s" exported-file))))
-
-;;;###autoload
-(defun org-babel-tangle-file (file &optional target-file lang)
- "Extract the bodies of source code blocks in FILE.
-Source code blocks are extracted with `org-babel-tangle'.
-Optional argument TARGET-FILE can be used to specify a default
-export file for all source blocks. Optional argument LANG can be
-used to limit the exported source code blocks by language."
- (interactive "fFile to tangle: \nP")
- (let ((visited-p (get-file-buffer (expand-file-name file)))
- to-be-removed)
- (save-window-excursion
- (find-file file)
- (setq to-be-removed (current-buffer))
- (org-babel-tangle target-file lang))
- (unless visited-p
- (kill-buffer to-be-removed))))
-
-(defun org-babel-tangle-publish (_ filename pub-dir)
- "Tangle FILENAME and place the results in PUB-DIR."
- (mapc (lambda (el) (copy-file el pub-dir t)) (org-babel-tangle-file filename)))
-
-;;;###autoload
-(defun org-babel-tangle (&optional target-file lang)
- "Write code blocks to source-specific files.
-Extract the bodies of all source code blocks from the current
-file into their own source-specific files. Optional argument
-TARGET-FILE can be used to specify a default export file for all
-source blocks. Optional argument LANG can be used to limit the
-exported source code blocks by language."
- (interactive)
- (run-hooks 'org-babel-pre-tangle-hook)
- (save-excursion
- (let ((block-counter 0)
- (org-babel-default-header-args
- (if target-file
- (org-babel-merge-params org-babel-default-header-args
- (list (cons :tangle target-file)))
- org-babel-default-header-args))
- path-collector)
- (mapc ;; map over all languages
- (lambda (by-lang)
- (let* ((lang (car by-lang))
- (specs (cdr by-lang))
- (ext (or (cdr (assoc lang org-babel-tangle-lang-exts)) lang))
- (lang-f (intern
- (concat
- (or (and (cdr (assoc lang org-src-lang-modes))
- (symbol-name
- (cdr (assoc lang org-src-lang-modes))))
- lang)
- "-mode")))
- she-banged)
- (mapc
- (lambda (spec)
- (flet ((get-spec (name)
- (cdr (assoc name (nth 4 spec)))))
- (let* ((tangle (get-spec :tangle))
- (she-bang ((lambda (sheb) (when (> (length sheb) 0) sheb))
- (get-spec :shebang)))
- (base-name (cond
- ((string= "yes" tangle)
- (file-name-sans-extension
- (buffer-file-name)))
- ((string= "no" tangle) nil)
- ((> (length tangle) 0) tangle)))
- (file-name (when base-name
- ;; decide if we want to add ext to base-name
- (if (and ext (string= "yes" tangle))
- (concat base-name "." ext) base-name))))
- (when file-name
- ;; delete any old versions of file
- (when (and (file-exists-p file-name)
- (not (member file-name path-collector)))
- (delete-file file-name))
- ;; drop source-block to file
- (with-temp-buffer
- (when (fboundp lang-f) (funcall lang-f))
- (when (and she-bang (not (member file-name she-banged)))
- (insert (concat she-bang "\n"))
- (setq she-banged (cons file-name she-banged)))
- (org-babel-spec-to-string spec)
- ;; We avoid append-to-file as it does not work with tramp.
- (let ((content (buffer-string)))
- (with-temp-buffer
- (if (file-exists-p file-name)
- (insert-file-contents file-name))
- (goto-char (point-max))
- (insert content)
- (write-region nil nil file-name))))
- ;; if files contain she-bangs, then make the executable
- (when she-bang (set-file-modes file-name #o755))
- ;; update counter
- (setq block-counter (+ 1 block-counter))
- (add-to-list 'path-collector file-name)))))
- specs)))
- (org-babel-tangle-collect-blocks lang))
- (message "tangled %d code block%s from %s" block-counter
- (if (= block-counter 1) "" "s")
- (file-name-nondirectory (buffer-file-name (current-buffer))))
- ;; run `org-babel-post-tangle-hook' in all tangled files
- (when org-babel-post-tangle-hook
- (mapc
- (lambda (file)
- (org-babel-with-temp-filebuffer file
- (run-hooks 'org-babel-post-tangle-hook)))
- path-collector))
- path-collector)))
-
-(defun org-babel-tangle-clean ()
- "Remove comments inserted by `org-babel-tangle'.
-Call this function inside of a source-code file generated by
-`org-babel-tangle' to remove all comments inserted automatically
-by `org-babel-tangle'. Warning, this comment removes any lines
-containing constructs which resemble org-mode file links or noweb
-references."
- (interactive)
- (goto-char (point-min))
- (while (or (re-search-forward "\\[\\[file:.*\\]\\[.*\\]\\]" nil t)
- (re-search-forward "<<[^[:space:]]*>>" nil t))
- (delete-region (save-excursion (beginning-of-line 1) (point))
- (save-excursion (end-of-line 1) (forward-char 1) (point)))))
-
-(defvar org-stored-links)
-(defun org-babel-tangle-collect-blocks (&optional language)
- "Collect source blocks in the current Org-mode file.
-Return an association list of source-code block specifications of
-the form used by `org-babel-spec-to-string' grouped by language.
-Optional argument LANG can be used to limit the collected source
-code blocks by language."
- (let ((block-counter 1) (current-heading "") blocks)
- (org-babel-map-src-blocks (buffer-file-name)
- ((lambda (new-heading)
- (if (not (string= new-heading current-heading))
- (progn
- (setq block-counter 1)
- (setq current-heading new-heading))
- (setq block-counter (+ 1 block-counter))))
- (replace-regexp-in-string "[ \t]" "-"
- (condition-case nil
- (nth 4 (org-heading-components))
- (error (buffer-file-name)))))
- (let* ((start-line (save-restriction (widen)
- (+ 1 (line-number-at-pos (point)))))
- (file (buffer-file-name))
- (info (org-babel-get-src-block-info 'light))
- (src-lang (nth 0 info)))
- (unless (string= (cdr (assoc :tangle (nth 2 info))) "no")
- (unless (and language (not (string= language src-lang)))
- (let* ((info (org-babel-get-src-block-info))
- (params (nth 2 info))
- (link (progn (call-interactively 'org-store-link)
- (org-babel-clean-text-properties
- (car (pop org-stored-links)))))
- (source-name
- (intern (or (nth 4 info)
- (format "%s:%d"
- current-heading block-counter))))
- (expand-cmd
- (intern (concat "org-babel-expand-body:" src-lang)))
- (assignments-cmd
- (intern (concat "org-babel-variable-assignments:" src-lang)))
- (body
- ((lambda (body)
- (if (assoc :no-expand params)
- body
- (if (fboundp expand-cmd)
- (funcall expand-cmd body params)
- (org-babel-expand-body:generic
- body params
- (and (fboundp assignments-cmd)
- (funcall assignments-cmd params))))))
- (if (and (cdr (assoc :noweb params))
- (let ((nowebs (split-string
- (cdr (assoc :noweb params)))))
- (or (member "yes" nowebs)
- (member "tangle" nowebs))))
- (org-babel-expand-noweb-references info)
- (nth 1 info))))
- (comment
- (when (or (string= "both" (cdr (assoc :comments params)))
- (string= "org" (cdr (assoc :comments params))))
- ;; from the previous heading or code-block end
- (buffer-substring
- (max (condition-case nil
- (save-excursion
- (org-back-to-heading t) (point))
- (error 0))
- (save-excursion
- (re-search-backward
- org-babel-src-block-regexp nil t)
- (match-end 0)))
- (point))))
- by-lang)
- ;; add the spec for this block to blocks under it's language
- (setq by-lang (cdr (assoc src-lang blocks)))
- (setq blocks (delq (assoc src-lang blocks) blocks))
- (setq blocks (cons
- (cons src-lang
- (cons (list start-line file link
- source-name params body comment)
- by-lang)) blocks)))))))
- ;; ensure blocks in the correct order
- (setq blocks
- (mapcar
- (lambda (by-lang) (cons (car by-lang) (reverse (cdr by-lang))))
- blocks))
- blocks))
-
-(defun org-babel-spec-to-string (spec)
- "Insert SPEC into the current file.
-Insert the source-code specified by SPEC into the current
-source code file. This function uses `comment-region' which
-assumes that the appropriate major-mode is set. SPEC has the
-form
-
- (start-line file link source-name params body comment)"
- (let* ((start-line (nth 0 spec))
- (file (nth 1 spec))
- (link (org-link-escape (nth 2 spec)))
- (source-name (nth 3 spec))
- (body (nth 5 spec))
- (comment (nth 6 spec))
- (comments (cdr (assoc :comments (nth 4 spec))))
- (link-p (or (string= comments "both") (string= comments "link")
- (string= comments "yes")))
- (link-data (mapcar (lambda (el)
- (cons (symbol-name el)
- ((lambda (le)
- (if (stringp le) le (format "%S" le)))
- (eval el))))
- '(start-line file link source-name))))
- (flet ((insert-comment (text)
- (let ((text (org-babel-trim text)))
- (when (and comments (not (string= comments "no"))
- (> (length text) 0))
- (when org-babel-tangle-pad-newline (insert "\n"))
- (comment-region (point) (progn (insert text) (point)))
- (end-of-line nil) (insert "\n")))))
- (when comment (insert-comment comment))
- (when link-p
- (insert-comment
- (org-fill-template org-babel-tangle-comment-format-beg link-data)))
- (when org-babel-tangle-pad-newline (insert "\n"))
- (insert
- (format
- "%s\n"
- (replace-regexp-in-string
- "^," ""
- (org-babel-trim body (if org-src-preserve-indentation "[\f\n\r\v]")))))
- (when link-p
- (insert-comment
- (org-fill-template org-babel-tangle-comment-format-end link-data))))))
-
-;; detangling functions
-(defvar org-bracket-link-analytic-regexp)
-(defun org-babel-detangle (&optional source-code-file)
- "Propagate changes in source file back original to Org-mode file.
-This requires that code blocks were tangled with link comments
-which enable the original code blocks to be found."
- (interactive)
- (save-excursion
- (when source-code-file (find-file source-code-file))
- (goto-char (point-min))
- (let ((counter 0) new-body end)
- (while (re-search-forward org-bracket-link-analytic-regexp nil t)
- (when (re-search-forward
- (concat " " (regexp-quote (match-string 5)) " ends here"))
- (setq end (match-end 0))
- (forward-line -1)
- (save-excursion
- (when (setq new-body (org-babel-tangle-jump-to-org))
- (org-babel-update-block-body new-body)))
- (setq counter (+ 1 counter)))
- (goto-char end))
- (prog1 counter (message "detangled %d code blocks" counter)))))
-
-(defun org-babel-tangle-jump-to-org ()
- "Jump from a tangled code file to the related Org-mode file."
- (interactive)
- (let ((mid (point))
- target-buffer target-char
- start end link path block-name body)
- (save-window-excursion
- (save-excursion
- (unless (and (re-search-backward org-bracket-link-analytic-regexp nil t)
- (setq start (point-at-eol))
- (setq link (match-string 0))
- (setq path (match-string 3))
- (setq block-name (match-string 5))
- (re-search-forward
- (concat " " (regexp-quote block-name) " ends here") nil t)
- (setq end (point-at-bol))
- (< start mid) (< mid end))
- (error "not in tangled code"))
- (setq body (org-babel-trim (buffer-substring start end))))
- (when (string-match "::" path)
- (setq path (substring path 0 (match-beginning 0))))
- (find-file path) (setq target-buffer (current-buffer))
- (goto-char start) (org-open-link-from-string link)
- (if (string-match "[^ \t\n\r]:\\([[:digit:]]+\\)" block-name)
- (org-babel-next-src-block
- (string-to-number (match-string 1 block-name)))
- (org-babel-goto-named-src-block block-name))
- (setq target-char (point)))
- (pop-to-buffer target-buffer)
- (prog1 body (goto-char target-char))))
-
-(provide 'ob-tangle)
-
-;; arch-tag: 413ced93-48f5-4216-86e4-3fc5df8c8f24
-
-;;; ob-tangle.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob-tangle.elc b/.emacs.d/org-7.4/lisp/ob-tangle.elc
deleted file mode 100644
index faaf080..0000000
--- a/.emacs.d/org-7.4/lisp/ob-tangle.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/ob.el b/.emacs.d/org-7.4/lisp/ob.el
deleted file mode 100644
index 1c9f9fd..0000000
--- a/.emacs.d/org-7.4/lisp/ob.el
+++ /dev/null
@@ -1,1968 +0,0 @@
-;;; ob.el --- working with code blocks in org-mode
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Eric Schulte, Dan Davison
-;; Keywords: literate programming, reproducible research
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; See the online documentation for more information
-;;
-;; http://orgmode.org/worg/org-contrib/babel/
-
-;;; Code:
-(eval-when-compile
- (require 'org-list)
- (require 'cl))
-(require 'ob-eval)
-(require 'org-macs)
-
-(defvar org-babel-call-process-region-original)
-(declare-function show-all "outline" ())
-(declare-function tramp-compat-make-temp-file "tramp-compat"
- (filename &optional dir-flag))
-(declare-function tramp-dissect-file-name "tramp" (name &optional nodefault))
-(declare-function tramp-file-name-user "tramp" (vec))
-(declare-function tramp-file-name-host "tramp" (vec))
-(declare-function with-parsed-tramp-file-name "tramp" (filename var &rest body))
-(declare-function org-icompleting-read "org" (&rest args))
-(declare-function org-edit-src-code "org-src"
- (&optional context code edit-buffer-name quietp))
-(declare-function org-edit-src-exit "org-src" (&optional context))
-(declare-function org-open-at-point "org" (&optional in-emacs reference-buffer))
-(declare-function org-save-outline-visibility "org" (use-markers &rest body))
-(declare-function org-outline-overlay-data "org" (&optional use-markers))
-(declare-function org-set-outline-overlay-data "org" (data))
-(declare-function org-narrow-to-subtree "org" ())
-(declare-function org-entry-get "org"
- (pom property &optional inherit literal-nil))
-(declare-function org-make-options-regexp "org" (kwds &optional extra))
-(declare-function org-do-remove-indentation "org" (&optional n))
-(declare-function org-show-context "org" (&optional key))
-(declare-function org-at-table-p "org" (&optional table-type))
-(declare-function org-cycle "org" (&optional arg))
-(declare-function org-uniquify "org" (list))
-(declare-function org-current-level "org" ())
-(declare-function org-table-import "org-table" (file arg))
-(declare-function org-add-hook "org-compat"
- (hook function &optional append local))
-(declare-function org-table-align "org-table" ())
-(declare-function org-table-end "org-table" (&optional table-type))
-(declare-function orgtbl-to-generic "org-table" (table params))
-(declare-function orgtbl-to-orgtbl "org-table" (table params))
-(declare-function org-babel-lob-get-info "ob-lob" nil)
-(declare-function org-babel-ref-split-args "ob-ref" (arg-string))
-(declare-function org-babel-ref-parse "ob-ref" (assignment))
-(declare-function org-babel-ref-resolve "ob-ref" (ref))
-(declare-function org-babel-lob-execute-maybe "ob-lob" ())
-(declare-function org-number-sequence "org-compat" (from &optional to inc))
-(declare-function org-in-item-p "org-list" ())
-(declare-function org-list-parse-list "org-list" (&optional delete))
-(declare-function org-list-to-generic "org-list" (LIST PARAMS))
-(declare-function org-list-bottom-point "org-list" ())
-
-(defgroup org-babel nil
- "Code block evaluation and management in `org-mode' documents."
- :tag "Babel"
- :group 'org)
-
-(defcustom org-confirm-babel-evaluate t
- "Confirm before evaluation.
-Require confirmation before interactively evaluating code
-blocks in Org-mode buffers. The default value of this variable
-is t, meaning confirmation is required for any code block
-evaluation. This variable can be set to nil to inhibit any
-future confirmation requests. This variable can also be set to a
-function which takes two arguments the language of the code block
-and the body of the code block. Such a function should then
-return a non-nil value if the user should be prompted for
-execution or nil if no prompt is required.
-
-Warning: Disabling confirmation may result in accidental
-evaluation of potentially harmful code. It may be advisable
-remove code block execution from C-c C-c as further protection
-against accidental code block evaluation. The
-`org-babel-no-eval-on-ctrl-c-ctrl-c' variable can be used to
-remove code block execution from the C-c C-c keybinding."
- :group 'org-babel
- :type '(choice boolean function))
-;; don't allow this variable to be changed through file settings
-(put 'org-confirm-babel-evaluate 'safe-local-variable (lambda (x) (eq x t)))
-
-(defcustom org-babel-no-eval-on-ctrl-c-ctrl-c nil
- "Remove code block evaluation from the C-c C-c key binding."
- :group 'org-babel
- :type 'boolean)
-
-(defvar org-babel-src-name-regexp
- "^[ \t]*#\\+\\(srcname\\|source\\|function\\):[ \t]*"
- "Regular expression used to match a source name line.")
-
-(defvar org-babel-multi-line-header-regexp
- "^[ \t]*#\\+headers?:[ \t]*\\([^\n]*\\)$"
- "Regular expression used to match multi-line header arguments.")
-
-(defvar org-babel-src-name-w-name-regexp
- (concat org-babel-src-name-regexp
- "\\("
- org-babel-multi-line-header-regexp
- "\\)*"
- "\\([^ ()\f\t\n\r\v]+\\)\\(\(\\(.*\\)\)\\|\\)")
- "Regular expression matching source name lines with a name.")
-
-(defvar org-babel-src-block-regexp
- (concat
- ;; (1) indentation (2) lang
- "^\\([ \t]*\\)#\\+begin_src[ \t]+\\([^ \f\t\n\r\v]+\\)[ \t]*"
- ;; (3) switches
- "\\([^\":\n]*\"[^\"\n*]*\"[^\":\n]*\\|[^\":\n]*\\)"
- ;; (4) header arguments
- "\\([^\n]*\\)\n"
- ;; (5) body
- "\\([^\000]+?\n\\)[ \t]*#\\+end_src")
- "Regexp used to identify code blocks.")
-
-(defvar org-babel-inline-src-block-regexp
- (concat
- ;; (1) replacement target (2) lang
- "[ \f\t\n\r\v]\\(src_\\([^ \f\t\n\r\v]+\\)"
- ;; (3,4) (unused, headers)
- "\\(\\|\\[\\(.*?\\)\\]\\)"
- ;; (5) body
- "{\\([^\f\n\r\v]+?\\)}\\)")
- "Regexp used to identify inline src-blocks.")
-
-(defun org-babel-get-header (params key &optional others)
- "Select only header argument of type KEY from a list.
-Optional argument OTHERS indicates that only the header that do
-not match KEY should be returned."
- (delq nil
- (mapcar
- (lambda (p) (when (funcall (if others #'not #'identity) (eq (car p) key)) p))
- params)))
-
-(defun org-babel-get-src-block-info (&optional light)
- "Get information on the current source block.
-
-Optional argument LIGHT does not resolve remote variable
-references; a process which could likely result in the execution
-of other code blocks.
-
-Returns a list
- (language body header-arguments-alist switches name indent)."
- (let ((case-fold-search t) head info name indent)
- ;; full code block
- (if (setq head (org-babel-where-is-src-block-head))
- (save-excursion
- (goto-char head)
- (setq info (org-babel-parse-src-block-match))
- (setq indent (car (last info)))
- (setq info (butlast info))
- (while (and (forward-line -1)
- (looking-at org-babel-multi-line-header-regexp))
- (setf (nth 2 info)
- (org-babel-merge-params
- (org-babel-parse-header-arguments (match-string 1))
- (nth 2 info))))
- (when (looking-at org-babel-src-name-w-name-regexp)
- (setq name (org-babel-clean-text-properties (match-string 4)))
- (when (match-string 6)
- (setf (nth 2 info) ;; merge functional-syntax vars and header-args
- (org-babel-merge-params
- (mapcar (lambda (ref) (cons :var ref))
- (org-babel-ref-split-args (match-string 6)))
- (nth 2 info))))))
- ;; inline source block
- (when (save-excursion (re-search-backward "[ \f\t\n\r\v]" nil t)
- (looking-at org-babel-inline-src-block-regexp))
- (setq info (org-babel-parse-inline-src-block-match))))
- ;; resolve variable references and add summary parameters
- (when (and info (not light))
- (setf (nth 2 info) (org-babel-process-params (nth 2 info))))
- (when info (append info (list name indent)))))
-
-(defun org-babel-confirm-evaluate (info)
- "Confirm evaluation of the code block INFO.
-This behavior can be suppressed by setting the value of
-`org-confirm-babel-evaluate' to nil, in which case all future
-interactive code block evaluations will proceed without any
-confirmation from the user.
-
-Note disabling confirmation may result in accidental evaluation
-of potentially harmful code."
- (let* ((eval (or (cdr (assoc :eval (nth 2 info)))
- (when (assoc :noeval (nth 2 info)) "no")))
- (query (or (equal eval "query")
- (if (functionp org-confirm-babel-evaluate)
- (funcall org-confirm-babel-evaluate
- (nth 0 info) (nth 1 info))
- org-confirm-babel-evaluate))))
- (if (or (equal eval "never") (equal eval "no")
- (and query
- (not (yes-or-no-p
- (format "Evaluate this%scode block%son your system? "
- (if info (format " %s " (nth 0 info)) " ")
- (if (nth 4 info)
- (format " (%s) " (nth 4 info)) " "))))))
- (prog1 nil (message "Evaluation %s"
- (if (or (equal eval "never") (equal eval "no"))
- "Disabled" "Aborted")))
- t)))
-
-;;;###autoload
-(defun org-babel-execute-safely-maybe ()
- (unless org-babel-no-eval-on-ctrl-c-ctrl-c
- (org-babel-execute-maybe)))
-
-(add-hook 'org-ctrl-c-ctrl-c-hook 'org-babel-execute-safely-maybe)
-
-;;;###autoload
-(defun org-babel-execute-maybe ()
- (interactive)
- (or (org-babel-execute-src-block-maybe)
- (org-babel-lob-execute-maybe)))
-
-(defun org-babel-execute-src-block-maybe ()
- "Conditionally execute a source block.
-Detect if this is context for a Babel src-block and if so
-then run `org-babel-execute-src-block'."
- (interactive)
- (let ((info (org-babel-get-src-block-info)))
- (if info
- (progn (org-babel-eval-wipe-error-buffer)
- (org-babel-execute-src-block current-prefix-arg info) t) nil)))
-
-;;;###autoload
-(defun org-babel-expand-src-block-maybe ()
- "Conditionally expand a source block.
-Detect if this is context for a org-babel src-block and if so
-then run `org-babel-expand-src-block'."
- (interactive)
- (let ((info (org-babel-get-src-block-info)))
- (if info
- (progn (org-babel-expand-src-block current-prefix-arg info) t)
- nil)))
-
-;;;###autoload
-(defun org-babel-load-in-session-maybe ()
- "Conditionally load a source block in a session.
-Detect if this is context for a org-babel src-block and if so
-then run `org-babel-load-in-session'."
- (interactive)
- (let ((info (org-babel-get-src-block-info)))
- (if info
- (progn (org-babel-load-in-session current-prefix-arg info) t)
- nil)))
-
-(add-hook 'org-metaup-hook 'org-babel-load-in-session-maybe)
-
-;;;###autoload
-(defun org-babel-pop-to-session-maybe ()
- "Conditionally pop to a session.
-Detect if this is context for a org-babel src-block and if so
-then run `org-babel-pop-to-session'."
- (interactive)
- (let ((info (org-babel-get-src-block-info)))
- (if info (progn (org-babel-pop-to-session current-prefix-arg info) t) nil)))
-
-(add-hook 'org-metadown-hook 'org-babel-pop-to-session-maybe)
-
-(defconst org-babel-header-arg-names
- '(cache cmdline colnames dir exports file noweb results
- session tangle var eval noeval comments)
- "Common header arguments used by org-babel.
-Note that individual languages may define their own language
-specific header arguments as well.")
-
-(defvar org-babel-default-header-args
- '((:session . "none") (:results . "replace") (:exports . "code")
- (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no"))
- "Default arguments to use when evaluating a source block.")
-
-(defvar org-babel-default-inline-header-args
- '((:session . "none") (:results . "silent") (:exports . "results"))
- "Default arguments to use when evaluating an inline source block.")
-
-(defvar org-babel-current-buffer-properties nil
- "Local cache for buffer properties.")
-(make-variable-buffer-local 'org-babel-current-buffer-properties)
-
-(defvar org-babel-result-regexp
- "^[ \t]*#\\+res\\(ults\\|name\\)\\(\\[\\([[:alnum:]]+\\)\\]\\)?\\:[ \t]*"
- "Regular expression used to match result lines.
-If the results are associated with a hash key then the hash will
-be saved in the second match data.")
-
-(defvar org-babel-result-w-name-regexp
- (concat org-babel-result-regexp
- "\\([^ ()\f\t\n\r\v]+\\)\\(\(\\(.*\\)\)\\|\\)"))
-
-(defvar org-babel-min-lines-for-block-output 10
- "The minimum number of lines for block output.
-If number of lines of output is equal to or exceeds this
-value, the output is placed in a #+begin_example...#+end_example
-block. Otherwise the output is marked as literal by inserting
-colons at the starts of the lines. This variable only takes
-effect if the :results output option is in effect.")
-
-(defvar org-babel-noweb-error-langs nil
- "Languages for which Babel will raise literate programming errors.
-List of languages for which errors should be raised when the
-source code block satisfying a noweb reference in this language
-can not be resolved.")
-
-(defvar org-babel-hash-show 4
- "Number of initial characters to show of a hidden results hash.")
-
-(defvar org-babel-after-execute-hook nil
- "Hook for functions to be called after `org-babel-execute-src-block'")
-(defun org-babel-named-src-block-regexp-for-name (name)
- "This generates a regexp used to match a src block named NAME."
- (concat org-babel-src-name-regexp (regexp-quote name) "[ \t\n]*"
- (substring org-babel-src-block-regexp 1)))
-
-;;; functions
-(defvar call-process-region)
-;;;###autoload
-
-(defun org-babel-execute-src-block (&optional arg info params)
- "Execute the current source code block.
-Insert the results of execution into the buffer. Source code
-execution and the collection and formatting of results can be
-controlled through a variety of header arguments.
-
-With prefix argument ARG, force re-execution even if a an
-existing result cached in the buffer would otherwise have been
-returned.
-
-Optionally supply a value for INFO in the form returned by
-`org-babel-get-src-block-info'.
-
-Optionally supply a value for PARAMS which will be merged with
-the header arguments specified at the front of the source code
-block."
- (interactive)
- (let ((info (or info (org-babel-get-src-block-info))))
- (when (org-babel-confirm-evaluate info)
- (let* ((lang (nth 0 info))
- (params (if params
- (org-babel-process-params
- (org-babel-merge-params (nth 2 info) params))
- (nth 2 info)))
- (cache? (and (not arg) (cdr (assoc :cache params))
- (string= "yes" (cdr (assoc :cache params)))))
- (result-params (cdr (assoc :result-params params)))
- (new-hash (when cache? (org-babel-sha1-hash info)))
- (old-hash (when cache? (org-babel-result-hash info)))
- (body (setf (nth 1 info)
- (let ((noweb (cdr (assoc :noweb params))))
- (if (and noweb
- (or (string= "yes" noweb)
- (string= "tangle" noweb)))
- (org-babel-expand-noweb-references info)
- (nth 1 info)))))
- (cmd (intern (concat "org-babel-execute:" lang)))
- (dir (cdr (assoc :dir params)))
- (default-directory
- (or (and dir (file-name-as-directory dir)) default-directory))
- (org-babel-call-process-region-original
- (if (boundp 'org-babel-call-process-region-original)
- org-babel-call-process-region-original
- (symbol-function 'call-process-region)))
- (indent (car (last info)))
- result)
- (unwind-protect
- (flet ((call-process-region (&rest args)
- (apply 'org-babel-tramp-handle-call-process-region args)))
- (unless (fboundp cmd)
- (error "No org-babel-execute function for %s!" lang))
- (if (and (not arg) new-hash (equal new-hash old-hash))
- (save-excursion ;; return cached result
- (goto-char (org-babel-where-is-src-block-result nil info))
- (end-of-line 1) (forward-char 1)
- (setq result (org-babel-read-result))
- (message (replace-regexp-in-string
- "%" "%%" (format "%S" result))) result)
- (message "executing %s code block%s..."
- (capitalize lang)
- (if (nth 4 info) (format " (%s)" (nth 4 info)) ""))
- (setq result
- ((lambda (result)
- (cond
- ((member "file" result-params)
- (cdr (assoc :file params)))
- ((and (eq (cdr (assoc :result-type params)) 'value)
- (or (member "vector" result-params)
- (member "table" result-params))
- (not (listp result)))
- (list (list result)))
- (t result)))
- (funcall cmd body params)))
- (org-babel-insert-result
- result result-params info new-hash indent lang)
- (run-hooks 'org-babel-after-execute-hook)
- result))
- (setq call-process-region 'org-babel-call-process-region-original))))))
-
-(defun org-babel-expand-body:generic (body params &optional var-lines)
- "Expand BODY with PARAMS.
-Expand a block of code with org-babel according to it's header
-arguments. This generic implementation of body expansion is
-called for languages which have not defined their own specific
-org-babel-expand-body:lang function."
- (mapconcat #'identity (append var-lines (list body)) "\n"))
-
-;;;###autoload
-(defun org-babel-expand-src-block (&optional arg info params)
- "Expand the current source code block.
-Expand according to the source code block's header
-arguments and pop open the results in a preview buffer."
- (interactive)
- (let* ((info (or info (org-babel-get-src-block-info)))
- (lang (nth 0 info))
- (params (setf (nth 2 info)
- (sort (org-babel-merge-params (nth 2 info) params)
- (lambda (el1 el2) (string< (symbol-name (car el1))
- (symbol-name (car el2)))))))
- (body (setf (nth 1 info)
- (if (and (cdr (assoc :noweb params))
- (string= "yes" (cdr (assoc :noweb params))))
- (org-babel-expand-noweb-references info) (nth 1 info))))
- (expand-cmd (intern (concat "org-babel-expand-body:" lang)))
- (assignments-cmd (intern (concat "org-babel-variable-assignments:" lang)))
- (expanded
- (if (fboundp expand-cmd) (funcall expand-cmd body params)
- (org-babel-expand-body:generic
- body params (and (fboundp assignments-cmd) (funcall assignments-cmd params))))))
- (org-edit-src-code
- nil expanded (concat "*Org-Babel Preview " (buffer-name) "[ " lang " ]*"))))
-
-;;;###autoload
-(defun org-babel-load-in-session (&optional arg info)
- "Load the body of the current source-code block.
-Evaluate the header arguments for the source block before
-entering the session. After loading the body this pops open the
-session."
- (interactive)
- (let* ((info (or info (org-babel-get-src-block-info)))
- (lang (nth 0 info))
- (params (nth 2 info))
- (body (setf (nth 1 info)
- (if (and (cdr (assoc :noweb params))
- (string= "yes" (cdr (assoc :noweb params))))
- (org-babel-expand-noweb-references info)
- (nth 1 info))))
- (session (cdr (assoc :session params)))
- (dir (cdr (assoc :dir params)))
- (default-directory
- (or (and dir (file-name-as-directory dir)) default-directory))
- (cmd (intern (concat "org-babel-load-session:" lang))))
- (unless (fboundp cmd)
- (error "No org-babel-load-session function for %s!" lang))
- (pop-to-buffer (funcall cmd session body params))
- (end-of-line 1)))
-
-;;;###autoload
-(defun org-babel-initiate-session (&optional arg info)
- "Initiate session for current code block.
-If called with a prefix argument then resolve any variable
-references in the header arguments and assign these variables in
-the session. Copy the body of the code block to the kill ring."
- (interactive "P")
- (let* ((info (or info (org-babel-get-src-block-info (not arg))))
- (lang (nth 0 info))
- (body (nth 1 info))
- (params (nth 2 info))
- (session (cdr (assoc :session params)))
- (dir (cdr (assoc :dir params)))
- (default-directory
- (or (and dir (file-name-as-directory dir)) default-directory))
- (init-cmd (intern (format "org-babel-%s-initiate-session" lang)))
- (prep-cmd (intern (concat "org-babel-prep-session:" lang))))
- (if (and (stringp session) (string= session "none"))
- (error "This block is not using a session!"))
- (unless (fboundp init-cmd)
- (error "No org-babel-initiate-session function for %s!" lang))
- (with-temp-buffer (insert (org-babel-trim body))
- (copy-region-as-kill (point-min) (point-max)))
- (when arg
- (unless (fboundp prep-cmd)
- (error "No org-babel-prep-session function for %s!" lang))
- (funcall prep-cmd session params))
- (funcall init-cmd session params)))
-
-;;;###autoload
-(defun org-babel-switch-to-session (&optional arg info)
- "Switch to the session of the current code block.
-Uses `org-babel-initiate-session' to start the session. If called
-with a prefix argument then this is passed on to
-`org-babel-initiate-session'."
- (interactive "P")
- (pop-to-buffer (org-babel-initiate-session arg info))
- (end-of-line 1))
-
-(defalias 'org-babel-pop-to-session 'org-babel-switch-to-session)
-
-;;;###autoload
-(defun org-babel-switch-to-session-with-code (&optional arg info)
- "Switch to code buffer and display session."
- (interactive "P")
- (flet ((swap-windows
- ()
- (let ((other-window-buffer (window-buffer (next-window))))
- (set-window-buffer (next-window) (current-buffer))
- (set-window-buffer (selected-window) other-window-buffer))
- (other-window 1)))
- (let ((info (org-babel-get-src-block-info))
- (org-src-window-setup 'reorganize-frame))
- (save-excursion
- (org-babel-switch-to-session arg info))
- (org-edit-src-code))
- (swap-windows)))
-
-(defmacro org-babel-do-in-edit-buffer (&rest body)
- "Evaluate BODY in edit buffer if there is a code block at point.
-Return t if a code block was found at point, nil otherwise."
- `(let ((org-src-window-setup 'switch-invisibly))
- (when (and (org-babel-where-is-src-block-head)
- (org-edit-src-code nil nil nil 'quietly))
- (unwind-protect (progn ,@body)
- (if (org-bound-and-true-p org-edit-src-from-org-mode)
- (org-edit-src-exit)))
- t)))
-
-(defun org-babel-do-key-sequence-in-edit-buffer (key)
- "Read key sequence and execute the command in edit buffer.
-Enter a key sequence to be executed in the language major-mode
-edit buffer. For example, TAB will alter the contents of the
-Org-mode code block according to the effect of TAB in the
-language major-mode buffer. For languages that support
-interactive sessions, this can be used to send code from the Org
-buffer to the session for evaluation using the native major-mode
-evaluation mechanisms."
- (interactive "kEnter key-sequence to execute in edit buffer: ")
- (org-babel-do-in-edit-buffer
- (call-interactively
- (key-binding (or key (read-key-sequence nil))))))
-
-(defvar org-bracket-link-regexp)
-;;;###autoload
-(defun org-babel-open-src-block-result (&optional re-run)
- "If `point' is on a src block then open the results of the
-source code block, otherwise return nil. With optional prefix
-argument RE-RUN the source-code block is evaluated even if
-results already exist."
- (interactive "P")
- (when (org-babel-get-src-block-info)
- (save-excursion
- ;; go to the results, if there aren't any then run the block
- (goto-char (or (and (not re-run) (org-babel-where-is-src-block-result))
- (progn (org-babel-execute-src-block)
- (org-babel-where-is-src-block-result))))
- (end-of-line 1)
- (while (looking-at "[\n\r\t\f ]") (forward-char 1))
- ;; open the results
- (if (looking-at org-bracket-link-regexp)
- ;; file results
- (org-open-at-point)
- (let ((results (org-babel-read-result)))
- (flet ((echo-res (result)
- (if (stringp result) result (format "%S" result))))
- (pop-to-buffer (get-buffer-create "org-babel-results"))
- (delete-region (point-min) (point-max))
- (if (listp results)
- ;; table result
- (insert (orgtbl-to-generic results '(:sep "\t" :fmt echo-res)))
- ;; scalar result
- (insert (echo-res results))))))
- t)))
-
-;;;###autoload
-(defmacro org-babel-map-src-blocks (file &rest body)
- "Evaluate BODY forms on each source-block in FILE.
-If FILE is nil evaluate BODY forms on source blocks in current
-buffer. During evaluation of BODY the following local variables
-are set relative to the currently matched code block.
-
-full-block ------- string holding the entirety of the code block
-beg-block -------- point at the beginning of the code block
-end-block -------- point at the end of the matched code block
-lang ------------- string holding the language of the code block
-beg-lang --------- point at the beginning of the lang
-end-lang --------- point at the end of the lang
-switches --------- string holding the switches
-beg-switches ----- point at the beginning of the switches
-end-switches ----- point at the end of the switches
-header-args ------ string holding the header-args
-beg-header-args -- point at the beginning of the header-args
-end-header-args -- point at the end of the header-args
-body ------------- string holding the body of the code block
-beg-body --------- point at the beginning of the body
-end-body --------- point at the end of the body"
- (declare (indent 1))
- (let ((tempvar (make-symbol "file")))
- `(let* ((,tempvar ,file)
- (visited-p (or (null ,tempvar)
- (get-file-buffer (expand-file-name ,tempvar))))
- (point (point)) to-be-removed)
- (save-window-excursion
- (when ,tempvar (find-file ,tempvar))
- (setq to-be-removed (current-buffer))
- (goto-char (point-min))
- (while (re-search-forward org-babel-src-block-regexp nil t)
- (goto-char (match-beginning 0))
- (let ((full-block (match-string 0))
- (beg-block (match-beginning 0))
- (end-block (match-end 0))
- (lang (match-string 2))
- (beg-lang (match-beginning 2))
- (end-lang (match-end 2))
- (switches (match-string 3))
- (beg-switches (match-beginning 3))
- (end-switches (match-end 3))
- (header-args (match-string 4))
- (beg-header-args (match-beginning 4))
- (end-header-args (match-end 4))
- (body (match-string 5))
- (beg-body (match-beginning 5))
- (end-body (match-end 5)))
- ,@body
- (goto-char end-block))))
- (unless visited-p (kill-buffer to-be-removed))
- (goto-char point))))
-
-;;;###autoload
-(defun org-babel-execute-buffer (&optional arg)
- "Execute source code blocks in a buffer.
-Call `org-babel-execute-src-block' on every source block in
-the current buffer."
- (interactive "P")
- (org-save-outline-visibility t
- (org-babel-map-src-blocks nil
- (org-babel-execute-src-block arg))))
-
-;;;###autoload
-(defun org-babel-execute-subtree (&optional arg)
- "Execute source code blocks in a subtree.
-Call `org-babel-execute-src-block' on every source block in
-the current subtree."
- (interactive "P")
- (save-restriction
- (save-excursion
- (org-narrow-to-subtree)
- (org-babel-execute-buffer arg)
- (widen))))
-
-;;;###autoload
-(defun org-babel-sha1-hash (&optional info)
- "Generate an sha1 hash based on the value of info."
- (interactive)
- (let ((print-level nil)
- (info (or info (org-babel-get-src-block-info))))
- (setf (nth 2 info)
- (sort (copy-sequence (nth 2 info))
- (lambda (a b) (string< (car a) (car b)))))
- (let ((hash (sha1
- (format "%s-%s"
- (mapconcat
- #'identity
- (delq nil
- (mapcar
- (lambda (arg)
- (let ((v (cdr arg)))
- (when (and v (not (and (sequencep v)
- (not (consp v))
- (= (length v) 0))))
- (format "%S" v))))
- (nth 2 info))) ":")
- (nth 1 info)))))
- (when (interactive-p) (message hash))
- hash)))
-
-(defun org-babel-result-hash (&optional info)
- "Return the in-buffer hash associated with INFO."
- (org-babel-where-is-src-block-result nil info)
- (org-babel-clean-text-properties (match-string 3)))
-
-(defun org-babel-hide-hash ()
- "Hide the hash in the current results line.
-Only the initial `org-babel-hash-show' characters of the hash
-will remain visible."
- (add-to-invisibility-spec '(org-babel-hide-hash . t))
- (save-excursion
- (when (and (re-search-forward org-babel-result-regexp nil t)
- (match-string 3))
- (let* ((start (match-beginning 3))
- (hide-start (+ org-babel-hash-show start))
- (end (match-end 3))
- (hash (match-string 3))
- ov1 ov2)
- (setq ov1 (make-overlay start hide-start))
- (setq ov2 (make-overlay hide-start end))
- (overlay-put ov2 'invisible 'org-babel-hide-hash)
- (overlay-put ov1 'babel-hash hash)))))
-
-(defun org-babel-hide-all-hashes ()
- "Hide the hash in the current buffer.
-Only the initial `org-babel-hash-show' characters of each hash
-will remain visible. This function should be called as part of
-the `org-mode-hook'."
- (save-excursion
- (while (re-search-forward org-babel-result-regexp nil t)
- (goto-char (match-beginning 0))
- (org-babel-hide-hash)
- (goto-char (match-end 0)))))
-(add-hook 'org-mode-hook 'org-babel-hide-all-hashes)
-
-(defun org-babel-hash-at-point (&optional point)
- "Return the value of the hash at POINT.
-The hash is also added as the last element of the kill ring.
-This can be called with C-c C-c."
- (interactive)
- (let ((hash (car (delq nil (mapcar
- (lambda (ol) (overlay-get ol 'babel-hash))
- (overlays-at (or point (point))))))))
- (when hash (kill-new hash) (message hash))))
-(add-hook 'org-ctrl-c-ctrl-c-hook 'org-babel-hash-at-point)
-
-(defun org-babel-result-hide-spec ()
- "Hide portions of results lines.
-Add `org-babel-hide-result' as an invisibility spec for hiding
-portions of results lines."
- (add-to-invisibility-spec '(org-babel-hide-result . t)))
-(add-hook 'org-mode-hook 'org-babel-result-hide-spec)
-
-(defvar org-babel-hide-result-overlays nil
- "Overlays hiding results.")
-
-(defun org-babel-result-hide-all ()
- "Fold all results in the current buffer."
- (interactive)
- (org-babel-show-result-all)
- (save-excursion
- (while (re-search-forward org-babel-result-regexp nil t)
- (save-excursion (goto-char (match-beginning 0))
- (org-babel-hide-result-toggle-maybe)))))
-
-(defun org-babel-show-result-all ()
- "Unfold all results in the current buffer."
- (mapc 'delete-overlay org-babel-hide-result-overlays)
- (setq org-babel-hide-result-overlays nil))
-
-;;;###autoload
-(defun org-babel-hide-result-toggle-maybe ()
- "Toggle visibility of result at point."
- (interactive)
- (let ((case-fold-search t))
- (if (save-excursion
- (beginning-of-line 1)
- (looking-at org-babel-result-regexp))
- (progn (org-babel-hide-result-toggle)
- t) ;; to signal that we took action
- nil))) ;; to signal that we did not
-
-(defun org-babel-hide-result-toggle (&optional force)
- "Toggle the visibility of the current result."
- (interactive)
- (save-excursion
- (beginning-of-line)
- (if (re-search-forward org-babel-result-regexp nil t)
- (let ((start (progn (beginning-of-line 2) (- (point) 1)))
- (end (progn (goto-char (- (org-babel-result-end) 1)) (point)))
- ov)
- (if (memq t (mapcar (lambda (overlay)
- (eq (overlay-get overlay 'invisible)
- 'org-babel-hide-result))
- (overlays-at start)))
- (if (or (not force) (eq force 'off))
- (mapc (lambda (ov)
- (when (member ov org-babel-hide-result-overlays)
- (setq org-babel-hide-result-overlays
- (delq ov org-babel-hide-result-overlays)))
- (when (eq (overlay-get ov 'invisible)
- 'org-babel-hide-result)
- (delete-overlay ov)))
- (overlays-at start)))
- (setq ov (make-overlay start end))
- (overlay-put ov 'invisible 'org-babel-hide-result)
- ;; make the block accessible to isearch
- (overlay-put
- ov 'isearch-open-invisible
- (lambda (ov)
- (when (member ov org-babel-hide-result-overlays)
- (setq org-babel-hide-result-overlays
- (delq ov org-babel-hide-result-overlays)))
- (when (eq (overlay-get ov 'invisible)
- 'org-babel-hide-result)
- (delete-overlay ov))))
- (push ov org-babel-hide-result-overlays)))
- (error "Not looking at a result line"))))
-
-;; org-tab-after-check-for-cycling-hook
-(add-hook 'org-tab-first-hook 'org-babel-hide-result-toggle-maybe)
-;; Remove overlays when changing major mode
-(add-hook 'org-mode-hook
- (lambda () (org-add-hook 'change-major-mode-hook
- 'org-babel-show-result-all 'append 'local)))
-
-(defvar org-file-properties)
-(defun org-babel-params-from-properties (&optional lang)
- "Retrieve parameters specified as properties.
-Return an association list of any source block params which
-may be specified in the properties of the current outline entry."
- (save-match-data
- (let (val sym)
- (delq nil
- (mapcar
- (lambda (header-arg)
- (and (setq val
- (or (condition-case nil
- (org-entry-get (point) header-arg t)
- (error nil))
- (cdr (assoc header-arg org-file-properties))))
- (cons (intern (concat ":" header-arg))
- (org-babel-read val))))
- (mapcar
- 'symbol-name
- (append
- org-babel-header-arg-names
- (progn
- (setq sym (intern (concat "org-babel-header-arg-names:" lang)))
- (and (boundp sym) (eval sym))))))))))
-
-(defun org-babel-params-from-buffer ()
- "Retrieve per-buffer parameters.
- Return an association list of any source block params which
-may be specified at the top of the current buffer."
- (or org-babel-current-buffer-properties
- (setq org-babel-current-buffer-properties
- (save-match-data
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (when (re-search-forward
- (org-make-options-regexp (list "BABEL")) nil t)
- (org-babel-parse-header-arguments
- (org-match-string-no-properties 2)))))))))
-
-(defvar org-src-preserve-indentation)
-(defun org-babel-parse-src-block-match ()
- "Parse the results from a match of the `org-babel-src-block-regexp'."
- (let* ((block-indentation (length (match-string 1)))
- (lang (org-babel-clean-text-properties (match-string 2)))
- (lang-headers (intern (concat "org-babel-default-header-args:" lang)))
- (switches (match-string 3))
- (body (org-babel-clean-text-properties (match-string 5)))
- (preserve-indentation (or org-src-preserve-indentation
- (string-match "-i\\>" switches))))
- (list lang
- ;; get block body less properties, protective commas, and indentation
- (with-temp-buffer
- (save-match-data
- (insert (org-babel-strip-protective-commas body))
- (unless preserve-indentation (org-do-remove-indentation))
- (buffer-string)))
- (org-babel-merge-params
- org-babel-default-header-args
- (org-babel-params-from-buffer)
- (org-babel-params-from-properties lang)
- (if (boundp lang-headers) (eval lang-headers) nil)
- (org-babel-parse-header-arguments
- (org-babel-clean-text-properties (or (match-string 4) ""))))
- switches
- block-indentation)))
-
-(defun org-babel-parse-inline-src-block-match ()
- "Parse the results from a match of the `org-babel-inline-src-block-regexp'."
- (let* ((lang (org-babel-clean-text-properties (match-string 2)))
- (lang-headers (intern (concat "org-babel-default-header-args:" lang))))
- (list lang
- (org-babel-strip-protective-commas
- (org-babel-clean-text-properties (match-string 5)))
- (org-babel-merge-params
- org-babel-default-inline-header-args
- (org-babel-params-from-buffer)
- (org-babel-params-from-properties lang)
- (if (boundp lang-headers) (eval lang-headers) nil)
- (org-babel-parse-header-arguments
- (org-babel-clean-text-properties (or (match-string 4) "")))))))
-
-(defun org-babel-parse-header-arguments (arg-string)
- "Parse a string of header arguments returning an alist."
- (when (> (length arg-string) 0)
- (delq nil
- (mapcar
- (lambda (arg)
- (if (string-match
- "\\([^ \f\t\n\r\v]+\\)[ \f\t\n\r\v]+\\([^ \f\t\n\r\v]+.*\\)"
- arg)
- (cons (intern (match-string 1 arg))
- (org-babel-read (org-babel-chomp (match-string 2 arg))))
- (cons (intern (org-babel-chomp arg)) nil)))
- (let ((balance 0) (partial nil) (lst nil) (last 0))
- (mapc (lambda (ch) ; split on [] balanced instances of [ \t]:
- (setq balance (+ balance
- (cond ((equal 91 ch) 1)
- ((equal 93 ch) -1)
- (t 0))))
- (setq partial (cons ch partial))
- (when (and (= ch 58) (= balance 0)
- (or (= last 32) (= last 9)))
- (setq lst (cons (apply #'string (nreverse (cddr partial)))
- lst))
- (setq partial (list ch)))
- (setq last ch))
- (string-to-list arg-string))
- (nreverse (cons (apply #'string (nreverse partial)) lst)))))))
-
-(defun org-babel-process-params (params)
- "Expand variables in PARAMS and add summary parameters."
- (let* ((vars-and-names (org-babel-disassemble-tables
- (mapcar (lambda (el)
- (if (consp (cdr el))
- (cdr el) (org-babel-ref-parse (cdr el))))
- (org-babel-get-header params :var))
- (cdr (assoc :hlines params))
- (cdr (assoc :colnames params))
- (cdr (assoc :rownames params))))
- (result-params (append
- (split-string (or (cdr (assoc :results params)) ""))
- (cdr (assoc :result-params params)))))
- (append
- (mapcar (lambda (var) (cons :var var)) (car vars-and-names))
- (list
- (cons :colname-names (cadr vars-and-names))
- (cons :rowname-names (caddr vars-and-names))
- (cons :result-params result-params)
- (cons :result-type (cond ((member "output" result-params) 'output)
- ((member "value" result-params) 'value)
- (t 'value))))
- (org-babel-get-header params :var 'other))))
-
-;; row and column names
-(defun org-babel-del-hlines (table)
- "Remove all 'hlines from TABLE."
- (remove 'hline table))
-
-(defun org-babel-get-colnames (table)
- "Return the column names of TABLE.
-Return a cons cell, the `car' of which contains the TABLE less
-colnames, and the `cdr' of which contains a list of the column
-names."
- (if (equal 'hline (nth 1 table))
- (cons (cddr table) (car table))
- (cons (cdr table) (car table))))
-
-(defun org-babel-get-rownames (table)
- "Return the row names of TABLE.
-Return a cons cell, the `car' of which contains the TABLE less
-colnames, and the `cdr' of which contains a list of the column
-names. Note: this function removes any hlines in TABLE."
- (flet ((trans (table) (apply #'mapcar* #'list table)))
- (let* ((width (apply 'max
- (mapcar (lambda (el) (if (listp el) (length el) 0)) table)))
- (table (trans (mapcar (lambda (row)
- (if (not (equal row 'hline))
- row
- (setq row '())
- (dotimes (n width)
- (setq row (cons 'hline row)))
- row))
- table))))
- (cons (mapcar (lambda (row) (if (equal (car row) 'hline) 'hline row))
- (trans (cdr table)))
- (remove 'hline (car table))))))
-
-(defun org-babel-put-colnames (table colnames)
- "Add COLNAMES to TABLE if they exist."
- (if colnames (apply 'list colnames 'hline table) table))
-
-(defun org-babel-put-rownames (table rownames)
- "Add ROWNAMES to TABLE if they exist."
- (if rownames
- (mapcar (lambda (row)
- (if (listp row)
- (cons (or (pop rownames) "") row)
- row)) table)
- table))
-
-(defun org-babel-pick-name (names selector)
- "Select one out of an alist of row or column names.
-SELECTOR can be either a list of names in which case those names
-will be returned directly, or an index into the list NAMES in
-which case the indexed names will be return."
- (if (listp selector)
- selector
- (when names
- (if (and selector (symbolp selector) (not (equal t selector)))
- (cdr (assoc selector names))
- (if (integerp selector)
- (nth (- selector 1) names)
- (cdr (car (last names))))))))
-
-(defun org-babel-disassemble-tables (vars hlines colnames rownames)
- "Parse tables for further processing.
-Process the variables in VARS according to the HLINES,
-ROWNAMES and COLNAMES header arguments. Return a list consisting
-of the vars, cnames and rnames."
- (let (cnames rnames)
- (list
- (mapcar
- (lambda (var)
- (when (listp (cdr var))
- (when (and (not (equal colnames "no"))
- (or colnames (and (equal (nth 1 (cdr var)) 'hline)
- (not (member 'hline (cddr (cdr var)))))))
- (let ((both (org-babel-get-colnames (cdr var))))
- (setq cnames (cons (cons (car var) (cdr both))
- cnames))
- (setq var (cons (car var) (car both)))))
- (when (and rownames (not (equal rownames "no")))
- (let ((both (org-babel-get-rownames (cdr var))))
- (setq rnames (cons (cons (car var) (cdr both))
- rnames))
- (setq var (cons (car var) (car both)))))
- (when (and hlines (not (equal hlines "yes")))
- (setq var (cons (car var) (org-babel-del-hlines (cdr var))))))
- var)
- vars)
- cnames rnames)))
-
-(defun org-babel-reassemble-table (table colnames rownames)
- "Add column and row names to a table.
-Given a TABLE and set of COLNAMES and ROWNAMES add the names
-to the table for reinsertion to org-mode."
- (if (listp table)
- ((lambda (table)
- (if (and colnames (listp (car table)) (= (length (car table))
- (length colnames)))
- (org-babel-put-colnames table colnames) table))
- (if (and rownames (= (length table) (length rownames)))
- (org-babel-put-rownames table rownames) table))
- table))
-
-(defun org-babel-where-is-src-block-head ()
- "Find where the current source block begins.
-Return the point at the beginning of the current source
-block. Specifically at the beginning of the #+BEGIN_SRC line.
-If the point is not on a source block then return nil."
- (let ((initial (point)) top bottom)
- (or
- (save-excursion ;; on a source name line
- (beginning-of-line 1)
- (and (looking-at org-babel-src-name-regexp) (forward-line 1)
- (looking-at org-babel-src-block-regexp)
- (point)))
- (save-excursion ;; on a #+begin_src line
- (beginning-of-line 1)
- (and (looking-at org-babel-src-block-regexp)
- (point)))
- (save-excursion ;; inside a src block
- (and
- (re-search-backward "^[ \t]*#\\+begin_src" nil t) (setq top (point))
- (re-search-forward "^[ \t]*#\\+end_src" nil t) (setq bottom (point))
- (< top initial) (< initial bottom)
- (progn (goto-char top) (beginning-of-line 1)
- (looking-at org-babel-src-block-regexp))
- (point))))))
-
-;;;###autoload
-(defun org-babel-goto-src-block-head ()
- "Go to the beginning of the current code block."
- (interactive)
- ((lambda (head)
- (if head (goto-char head) (error "not currently in a code block")))
- (org-babel-where-is-src-block-head)))
-
-;;;###autoload
-(defun org-babel-goto-named-src-block (name)
- "Go to a named source-code block."
- (interactive
- (let ((completion-ignore-case t))
- (list (org-icompleting-read "source-block name: "
- (org-babel-src-block-names) nil t))))
- (let ((point (org-babel-find-named-block name)))
- (if point
- ;; taken from `org-open-at-point'
- (progn (goto-char point) (org-show-context))
- (message "source-code block '%s' not found in this buffer" name))))
-
-(defun org-babel-find-named-block (name)
- "Find a named source-code block.
-Return the location of the source block identified by source
-NAME, or nil if no such block exists. Set match data according to
-org-babel-named-src-block-regexp."
- (save-excursion
- (let ((case-fold-search t)
- (regexp (org-babel-named-src-block-regexp-for-name name)) msg)
- (goto-char (point-min))
- (when (or (re-search-forward regexp nil t)
- (re-search-backward regexp nil t))
- (match-beginning 0)))))
-
-(defun org-babel-src-block-names (&optional file)
- "Returns the names of source blocks in FILE or the current buffer."
- (save-excursion
- (when file (find-file file)) (goto-char (point-min))
- (let (names)
- (while (re-search-forward org-babel-src-name-w-name-regexp nil t)
- (setq names (cons (org-babel-clean-text-properties (match-string 3))
- names)))
- names)))
-
-;;;###autoload
-(defun org-babel-goto-named-result (name)
- "Go to a named result."
- (interactive
- (let ((completion-ignore-case t))
- (list (org-icompleting-read "source-block name: "
- (org-babel-result-names) nil t))))
- (let ((point (org-babel-find-named-result name)))
- (if point
- ;; taken from `org-open-at-point'
- (progn (goto-char point) (org-show-context))
- (message "result '%s' not found in this buffer" name))))
-
-(defun org-babel-find-named-result (name)
- "Find a named result.
-Return the location of the result named NAME in the current
-buffer or nil if no such result exists."
- (save-excursion
- (goto-char (point-min))
- (when (re-search-forward
- (concat org-babel-result-regexp
- "[ \t]" (regexp-quote name) "[ \t\n\f\v\r]") nil t)
- (beginning-of-line 0) (point))))
-
-(defun org-babel-result-names (&optional file)
- "Returns the names of results in FILE or the current buffer."
- (save-excursion
- (when file (find-file file)) (goto-char (point-min))
- (let (names)
- (while (re-search-forward org-babel-result-w-name-regexp nil t)
- (setq names (cons (org-babel-clean-text-properties (match-string 4))
- names)))
- names)))
-
-;;;###autoload
-(defun org-babel-next-src-block (&optional arg)
- "Jump to the next source block.
-With optional prefix argument ARG, jump forward ARG many source blocks."
- (interactive "P")
- (when (looking-at org-babel-src-block-regexp) (forward-char 1))
- (condition-case nil
- (re-search-forward org-babel-src-block-regexp nil nil (or arg 1))
- (error (error "No further code blocks")))
- (goto-char (match-beginning 0)) (org-show-context))
-
-;;;###autoload
-(defun org-babel-previous-src-block (&optional arg)
- "Jump to the previous source block.
-With optional prefix argument ARG, jump backward ARG many source blocks."
- (interactive "P")
- (condition-case nil
- (re-search-backward org-babel-src-block-regexp nil nil (or arg 1))
- (error (error "No previous code blocks")))
- (goto-char (match-beginning 0)) (org-show-context))
-
-(defvar org-babel-load-languages)
-
-;;;###autoload
-(defun org-babel-mark-block ()
- "Mark current src block"
- (interactive)
- ((lambda (head)
- (when head
- (save-excursion
- (goto-char head)
- (looking-at org-babel-src-block-regexp))
- (push-mark (match-end 5) nil t)
- (goto-char (match-beginning 5))))
- (org-babel-where-is-src-block-head)))
-
-(defun org-babel-demarcate-block (&optional arg)
- "Wrap or split the code in the region or on the point.
-When called from inside of a code block the current block is
-split. When called from outside of a code block a new code block
-is created. In both cases if the region is demarcated and if the
-region is not active then the point is demarcated."
- (interactive "P")
- (let ((info (org-babel-get-src-block-info 'light))
- (stars (concat (make-string (or (org-current-level) 1) ?*) " ")))
- (if info
- (mapc
- (lambda (place)
- (save-excursion
- (goto-char place)
- (let ((lang (nth 0 info))
- (indent (make-string (nth 5 info) ? )))
- (when (string-match "^[[:space:]]*$"
- (buffer-substring (point-at-bol)
- (point-at-eol)))
- (delete-region (point-at-bol) (point-at-eol)))
- (insert (concat (if (looking-at "^") "" "\n")
- indent "#+end_src\n"
- (if arg stars indent) "\n"
- indent "#+begin_src " lang
- (if (looking-at "[\n\r]") "" "\n")))))
- (move-end-of-line 2))
- (sort (if (region-active-p) (list (mark) (point)) (list (point))) #'>))
- (let ((start (point))
- (lang (org-icompleting-read "Lang: "
- (mapcar (lambda (el) (symbol-name (car el)))
- org-babel-load-languages)))
- (body (delete-and-extract-region
- (if (region-active-p) (mark) (point)) (point))))
- (insert (concat (if (looking-at "^") "" "\n")
- (if arg (concat stars "\n") "")
- "#+begin_src " lang "\n"
- body
- (if (or (= (length body) 0)
- (string-match "[\r\n]$" body)) "" "\n")
- "#+end_src\n"))
- (goto-char start) (move-end-of-line 1)))))
-
-(defvar org-babel-lob-one-liner-regexp)
-(defun org-babel-where-is-src-block-result (&optional insert info hash indent)
- "Find where the current source block results begin.
-Return the point at the beginning of the result of the current
-source block. Specifically at the beginning of the results line.
-If no result exists for this block then create a results line
-following the source block."
- (save-excursion
- (let* ((on-lob-line (progn (beginning-of-line 1)
- (looking-at org-babel-lob-one-liner-regexp)))
- (name (if on-lob-line
- (nth 0 (org-babel-lob-get-info))
- (nth 4 (or info (org-babel-get-src-block-info)))))
- (head (unless on-lob-line (org-babel-where-is-src-block-head)))
- found beg end)
- (when head (goto-char head))
- (setq
- found ;; was there a result (before we potentially insert one)
- (or
- (and
- ;; named results:
- ;; - return t if it is found, else return nil
- ;; - if it does not need to be rebuilt, then don't set end
- ;; - if it does need to be rebuilt then do set end
- name (setq beg (org-babel-find-named-result name))
- (prog1 beg
- (when (and hash (not (string= hash (match-string 3))))
- (goto-char beg) (setq end beg) ;; beginning of result
- (forward-line 1)
- (delete-region end (org-babel-result-end)) nil)))
- (and
- ;; unnamed results:
- ;; - return t if it is found, else return nil
- ;; - if it is found, and the hash doesn't match, delete and set end
- (or on-lob-line (re-search-forward "^[ \t]*#\\+end_src" nil t))
- (progn (end-of-line 1)
- (if (eobp) (insert "\n") (forward-char 1))
- (setq end (point))
- (or (and (not name)
- (progn ;; unnamed results line already exists
- (re-search-forward "[^ \f\t\n\r\v]" nil t)
- (beginning-of-line 1)
- (looking-at
- (concat org-babel-result-regexp "\n")))
- (prog1 (point)
- ;; must remove and rebuild if hash!=old-hash
- (if (and hash (not (string= hash (match-string 3))))
- (prog1 nil
- (forward-line 1)
- (delete-region
- end (org-babel-result-end)))
- (setq end nil)))))))))
- (if (and insert end)
- (progn
- (goto-char end)
- (unless beg
- (if (looking-at "[\n\r]") (forward-char 1) (insert "\n")))
- (insert (concat
- (if indent
- (mapconcat
- (lambda (el) " ")
- (org-number-sequence 1 indent) "")
- "")
- "#+results"
- (when hash (concat "["hash"]"))
- ":"
- (when name (concat " " name)) "\n"))
- (unless beg (insert "\n") (backward-char))
- (beginning-of-line 0)
- (if hash (org-babel-hide-hash))
- (point))
- found))))
-
-(defvar org-block-regexp)
-(defun org-babel-read-result ()
- "Read the result at `point' into emacs-lisp."
- (let ((case-fold-search t) result-string)
- (cond
- ((org-at-table-p) (org-babel-read-table))
- ((org-in-item-p) (org-babel-read-list))
- ((looking-at org-bracket-link-regexp) (org-babel-read-link))
- ((looking-at org-block-regexp) (org-babel-trim (match-string 4)))
- ((looking-at "^[ \t]*: ")
- (setq result-string
- (org-babel-trim
- (mapconcat (lambda (line)
- (if (and (> (length line) 1)
- (string-match "^[ \t]*: \\(.+\\)" line))
- (match-string 1 line)
- line))
- (split-string
- (buffer-substring
- (point) (org-babel-result-end)) "[\r\n]+")
- "\n")))
- (or (org-babel-number-p result-string) result-string))
- ((looking-at org-babel-result-regexp)
- (save-excursion (forward-line 1) (org-babel-read-result))))))
-
-(defun org-babel-read-table ()
- "Read the table at `point' into emacs-lisp."
- (mapcar (lambda (row)
- (if (and (symbolp row) (equal row 'hline)) row
- (mapcar #'org-babel-read row)))
- (org-table-to-lisp)))
-
-(defun org-babel-read-list ()
- "Read the list at `point' into emacs-lisp."
- (mapcar #'org-babel-read (cdr (org-list-parse-list))))
-
-(defvar org-link-types-re)
-(defun org-babel-read-link ()
- "Read the link at `point' into emacs-lisp.
-If the path of the link is a file path it is expanded using
-`expand-file-name'."
- (let* ((case-fold-search t)
- (raw (and (looking-at org-bracket-link-regexp)
- (org-babel-clean-text-properties (match-string 1))))
- (type (and (string-match org-link-types-re raw)
- (match-string 1 raw))))
- (cond
- ((not type) (expand-file-name raw))
- ((string= type "file")
- (and (string-match "file\\(.*\\):\\(.+\\)" raw)
- (expand-file-name (match-string 2 raw))))
- (t raw))))
-
-(defun org-babel-insert-result
- (result &optional result-params info hash indent lang)
- "Insert RESULT into the current buffer.
-By default RESULT is inserted after the end of the
-current source block. With optional argument RESULT-PARAMS
-controls insertion of results in the org-mode file.
-RESULT-PARAMS can take the following values...
-
-replace - (default option) insert results after the source block
- replacing any previously inserted results
-
-silent -- no results are inserted
-
-file ---- the results are interpreted as a file path, and are
- inserted into the buffer using the Org-mode file syntax
-
-list ---- the results are interpreted as an Org-mode list.
-
-raw ----- results are added directly to the Org-mode file. This
- is a good option if you code block will output org-mode
- formatted text.
-
-org ----- similar in effect to raw, only the results are wrapped
- in an org code block. Similar to the raw option, on
- export the results will be interpreted as org-formatted
- text, however by wrapping the results in an org code
- block they can be replaced upon re-execution of the
- code block.
-
-html ---- results are added inside of a #+BEGIN_HTML block. This
- is a good option if you code block will output html
- formatted text.
-
-latex --- results are added inside of a #+BEGIN_LATEX block.
- This is a good option if you code block will output
- latex formatted text.
-
-code ---- the results are extracted in the syntax of the source
- code of the language being evaluated and are added
- inside of a #+BEGIN_SRC block with the source-code
- language set appropriately. Note this relies on the
- optional LANG argument."
- (if (stringp result)
- (progn
- (setq result (org-babel-clean-text-properties result))
- (when (member "file" result-params)
- (setq result (org-babel-result-to-file result))))
- (unless (listp result) (setq result (format "%S" result))))
- (if (and result-params (member "silent" result-params))
- (progn
- (message (replace-regexp-in-string "%" "%%" (format "%S" result)))
- result)
- (when (and (stringp result) ;; ensure results end in a newline
- (> (length result) 0)
- (not (or (string-equal (substring result -1) "\n")
- (string-equal (substring result -1) "\r"))))
- (setq result (concat result "\n")))
- (save-excursion
- (let ((existing-result (org-babel-where-is-src-block-result
- t info hash indent))
- (results-switches
- (cdr (assoc :results_switches (nth 2 info))))
- beg end)
- (if (not existing-result)
- (setq beg (point))
- (goto-char existing-result)
- (save-excursion
- (re-search-forward "#" nil t)
- (setq indent (- (current-column) 1)))
- (forward-line 1)
- (setq beg (point))
- (cond
- ((member "replace" result-params)
- (delete-region (point) (org-babel-result-end)))
- ((member "append" result-params)
- (goto-char (org-babel-result-end)) (setq beg (point-marker)))
- ((member "prepend" result-params)))) ; already there
- (setq results-switches
- (if results-switches (concat " " results-switches) ""))
- ;; insert results based on type
- (cond
- ;; do nothing for an empty result
- ((= (length result) 0))
- ;; insert a list if preferred
- ((member "list" result-params)
- (insert
- (org-babel-trim
- (org-list-to-generic (cons 'unordered
- (if (listp result) result (list result)))
- '(:splicep nil :istart "- " :iend "\n")))))
- ;; assume the result is a table if it's not a string
- ((not (stringp result))
- (goto-char beg)
- (insert (concat (orgtbl-to-orgtbl
- (if (or (eq 'hline (car result))
- (and (listp (car result))
- (listp (cdr (car result)))))
- result (list result))
- '(:fmt (lambda (cell) (format "%s" cell)))) "\n"))
- (goto-char beg) (when (org-at-table-p) (org-table-align)))
- ((member "file" result-params)
- (insert result))
- (t (goto-char beg) (insert result)))
- (when (listp result) (goto-char (org-table-end)))
- (setq end (point-marker))
- ;; possibly wrap result
- (flet ((wrap (start finish)
- (goto-char beg) (insert start)
- (goto-char end) (insert finish)
- (setq end (point-marker))))
- (cond
- ((member "html" result-params)
- (wrap "#+BEGIN_HTML\n" "#+END_HTML"))
- ((member "latex" result-params)
- (wrap "#+BEGIN_LaTeX\n" "#+END_LaTeX"))
- ((member "code" result-params)
- (wrap (format "#+BEGIN_SRC %s%s\n" (or lang "none") results-switches)
- "#+END_SRC"))
- ((member "org" result-params)
- (wrap "#+BEGIN_ORG\n" "#+END_ORG"))
- ((member "raw" result-params)
- (goto-char beg) (if (org-at-table-p) (org-cycle)))
- ((member "wrap" result-params)
- (when (and (stringp result) (not (member "file" result-params)))
- (org-babel-examplize-region beg end results-switches))
- (wrap "#+BEGIN_RESULT\n" "#+END_RESULT"))
- ((and (stringp result) (not (member "file" result-params)))
- (org-babel-examplize-region beg end results-switches)
- (setq end (point)))))
- ;; possibly indent the results to match the #+results line
- (when (and indent (> indent 0)
- ;; in this case `table-align' does the work for us
- (not (and (listp result)
- (member "append" result-params))))
- (indent-rigidly beg end indent))))
- (if (= (length result) 0)
- (if (member "value" result-params)
- (message "Code block returned no value.")
- (message "Code block produced no output."))
- (message "Code block evaluation complete."))))
-
-(defun org-babel-remove-result (&optional info)
- "Remove the result of the current source block."
- (interactive)
- (let ((location (org-babel-where-is-src-block-result nil info)) start)
- (when location
- (save-excursion
- (goto-char location) (setq start (point)) (forward-line 1)
- (delete-region start (org-babel-result-end))))))
-
-(defun org-babel-result-end ()
- "Return the point at the end of the current set of results"
- (save-excursion
- (cond
- ((org-at-table-p) (progn (goto-char (org-table-end)) (point)))
- ((org-in-item-p) (- (org-list-bottom-point) 1))
- (t
- (let ((case-fold-search t)
- (blocks-re (regexp-opt
- (list "latex" "html" "example" "src" "result"))))
- (if (looking-at (concat "[ \t]*#\\+begin_" blocks-re))
- (re-search-forward (concat "[ \t]*#\\+end_" blocks-re) nil t)
- (while (looking-at "[ \t]*\\(: \\|\\[\\[\\)")
- (forward-line 1))))
- (point)))))
-
-(defun org-babel-result-to-file (result)
- "Convert RESULT into an `org-mode' link.
-If the `default-directory' is different from the containing
-file's directory then expand relative links."
- (format
- "[[file:%s]]"
- (if (and default-directory
- buffer-file-name
- (not (string= (expand-file-name default-directory)
- (expand-file-name
- (file-name-directory buffer-file-name)))))
- (expand-file-name result default-directory)
- result)))
-
-(defun org-babel-examplize-region (beg end &optional results-switches)
- "Comment out region using the ': ' org example quote."
- (interactive "*r")
- (let ((size (count-lines beg end)))
- (save-excursion
- (cond ((= size 0)) ; do nothing for an empty result
- ((< size org-babel-min-lines-for-block-output)
- (goto-char beg)
- (dotimes (n size)
- (beginning-of-line 1) (insert ": ") (forward-line 1)))
- (t
- (goto-char beg)
- (insert (if results-switches
- (format "#+begin_example%s\n" results-switches)
- "#+begin_example\n"))
- (if (markerp end) (goto-char end) (forward-char (- end beg)))
- (insert "#+end_example\n"))))))
-
-(defun org-babel-update-block-body (new-body)
- "Update the body of the current code block to NEW-BODY."
- (if (not (org-babel-where-is-src-block-head))
- (error "not in source block")
- (save-match-data
- (replace-match (concat (org-babel-trim new-body) "\n") nil nil nil 5))
- (indent-rigidly (match-beginning 5) (match-end 5) 2)))
-
-(defun org-babel-merge-params (&rest plists)
- "Combine all parameter association lists in PLISTS.
-Later elements of PLISTS override the values of previous element.
-This takes into account some special considerations for certain
-parameters when merging lists."
- (let ((results-exclusive-groups
- '(("file" "list" "vector" "table" "scalar" "raw" "org"
- "html" "latex" "code" "pp" "wrap")
- ("replace" "silent" "append" "prepend")
- ("output" "value")))
- (exports-exclusive-groups
- '(("code" "results" "both" "none")))
- params results exports tangle noweb cache vars shebang comments)
- (flet ((e-merge (exclusive-groups &rest result-params)
- ;; maintain exclusivity of mutually exclusive parameters
- (let (output)
- (mapc (lambda (new-params)
- (mapc (lambda (new-param)
- (mapc (lambda (exclusive-group)
- (when (member new-param exclusive-group)
- (mapcar (lambda (excluded-param)
- (setq output
- (delete
- excluded-param
- output)))
- exclusive-group)))
- exclusive-groups)
- (setq output (org-uniquify
- (cons new-param output))))
- new-params))
- result-params)
- output)))
- (mapc
- (lambda (plist)
- (mapc
- (lambda (pair)
- (case (car pair)
- (:var
- (let ((name (if (listp (cdr pair))
- (cadr pair)
- (and (string-match "^\\([^= \f\t\n\r\v]+\\)[ \t]*="
- (cdr pair))
- (intern (match-string 1 (cdr pair)))))))
- (when name
- (setq vars
- (cons (cons name pair)
- (if (member name (mapcar #'car vars))
- (delq nil
- (mapcar
- (lambda (p) (unless (equal (car p) name) p))
- vars))
- vars))))))
- (:results
- (setq results (e-merge results-exclusive-groups
- results (split-string (cdr pair)))))
- (:file
- (when (cdr pair)
- (setq results (e-merge results-exclusive-groups
- results '("file")))
- (unless (or (member "both" exports)
- (member "none" exports)
- (member "code" exports))
- (setq exports (e-merge exports-exclusive-groups
- exports '("results"))))
- (setq params (cons pair (assq-delete-all (car pair) params)))))
- (:exports
- (setq exports (e-merge exports-exclusive-groups
- exports (split-string (cdr pair)))))
- (:tangle ;; take the latest -- always overwrite
- (setq tangle (or (list (cdr pair)) tangle)))
- (:noweb
- (setq noweb (e-merge '(("yes" "no" "tangle")) noweb
- (split-string (or (cdr pair) "")))))
- (:cache
- (setq cache (e-merge '(("yes" "no")) cache
- (split-string (or (cdr pair) "")))))
- (:shebang ;; take the latest -- always overwrite
- (setq shebang (or (list (cdr pair)) shebang)))
- (:comments
- (setq comments (e-merge '(("yes" "no")) comments
- (split-string (or (cdr pair) "")))))
- (t ;; replace: this covers e.g. :session
- (setq params (cons pair (assq-delete-all (car pair) params))))))
- plist))
- plists))
- (while vars (setq params (cons (cons :var (cddr (pop vars))) params)))
- (cons (cons :comments (mapconcat 'identity comments " "))
- (cons (cons :shebang (mapconcat 'identity shebang " "))
- (cons (cons :cache (mapconcat 'identity cache " "))
- (cons (cons :noweb (mapconcat 'identity noweb " "))
- (cons (cons :tangle (mapconcat 'identity tangle " "))
- (cons (cons :exports
- (mapconcat 'identity exports " "))
- (cons
- (cons :results
- (mapconcat 'identity results " "))
- params)))))))))
-
-(defun org-babel-expand-noweb-references (&optional info parent-buffer)
- "Expand Noweb references in the body of the current source code block.
-
-For example the following reference would be replaced with the
-body of the source-code block named 'example-block'.
-
-<<example-block>>
-
-Note that any text preceding the <<foo>> construct on a line will
-be interposed between the lines of the replacement text. So for
-example if <<foo>> is placed behind a comment, then the entire
-replacement text will also be commented.
-
-This function must be called from inside of the buffer containing
-the source-code block which holds BODY.
-
-In addition the following syntax can be used to insert the
-results of evaluating the source-code block named 'example-block'.
-
-<<example-block()>>
-
-Any optional arguments can be passed to example-block by placing
-the arguments inside the parenthesis following the convention
-defined by `org-babel-lob'. For example
-
-<<example-block(a=9)>>
-
-would set the value of argument \"a\" equal to \"9\". Note that
-these arguments are not evaluated in the current source-code
-block but are passed literally to the \"example-block\"."
- (let* ((parent-buffer (or parent-buffer (current-buffer)))
- (info (or info (org-babel-get-src-block-info)))
- (lang (nth 0 info))
- (body (nth 1 info))
- (new-body "") index source-name evaluate prefix)
- (flet ((nb-add (text)
- (setq new-body (concat new-body text))))
- (with-temp-buffer
- (insert body) (goto-char (point-min))
- (setq index (point))
- (while (and (re-search-forward "<<\\(.+?\\)>>" nil t))
- (save-match-data (setf source-name (match-string 1)))
- (save-match-data (setq evaluate (string-match "\(.*\)" source-name)))
- (save-match-data
- (setq prefix
- (buffer-substring (match-beginning 0)
- (save-excursion
- (beginning-of-line 1) (point)))))
- ;; add interval to new-body (removing noweb reference)
- (goto-char (match-beginning 0))
- (nb-add (buffer-substring index (point)))
- (goto-char (match-end 0))
- (setq index (point))
- (nb-add (with-current-buffer parent-buffer
- (mapconcat ;; interpose PREFIX between every line
- #'identity
- (split-string
- (if evaluate
- (let ((raw (org-babel-ref-resolve source-name)))
- (if (stringp raw) raw (format "%S" raw)))
- (save-restriction
- (widen)
- (let ((point (org-babel-find-named-block
- source-name)))
- (if point
- (save-excursion
- (goto-char point)
- (org-babel-trim
- (org-babel-expand-noweb-references
- (org-babel-get-src-block-info))))
- ;; optionally raise an error if named
- ;; source-block doesn't exist
- (if (member lang org-babel-noweb-error-langs)
- (error "%s"
- (concat
- "<<" source-name ">> "
- "could not be resolved (see "
- "`org-babel-noweb-error-langs')"))
- "")))))
- "[\n\r]") (concat "\n" prefix)))))
- (nb-add (buffer-substring index (point-max)))))
- new-body))
-
-(defun org-babel-clean-text-properties (text)
- "Strip all properties from text return."
- (when text
- (set-text-properties 0 (length text) nil text) text))
-
-(defun org-babel-strip-protective-commas (body)
- "Strip protective commas from bodies of source blocks."
- (replace-regexp-in-string "^,#" "#" body))
-
-(defun org-babel-script-escape (str)
- "Safely convert tables into elisp lists."
- (let (in-single in-double out)
- (org-babel-read
- (if (and (stringp str) (string-match "^\\[.+\\]$" str))
- (org-babel-read
- (concat
- "'"
- (progn
- (mapc
- (lambda (ch)
- (setq
- out
- (case ch
- (91 (if (or in-double in-single) ; [
- (cons 91 out)
- (cons 40 out)))
- (93 (if (or in-double in-single) ; ]
- (cons 93 out)
- (cons 41 out)))
- (44 (if (or in-double in-single) (cons 44 out) out)) ; ,
- (39 (if in-double ; '
- (cons 39 out)
- (setq in-single (not in-single)) (cons 34 out)))
- (34 (if in-single ; "
- (append (list 34 32) out)
- (setq in-double (not in-double)) (cons 34 out)))
- (t (cons ch out)))))
- (string-to-list str))
- (apply #'string (reverse out)))))
- str))))
-
-(defun org-babel-read (cell)
- "Convert the string value of CELL to a number if appropriate.
-Otherwise if cell looks like lisp (meaning it starts with a
-\"(\" or a \"'\") then read it as lisp, otherwise return it
-unmodified as a string.
-
-This is taken almost directly from `org-read-prop'."
- (if (and (stringp cell) (not (equal cell "")))
- (or (org-babel-number-p cell)
- (if (or (equal "(" (substring cell 0 1))
- (equal "'" (substring cell 0 1))
- (equal "`" (substring cell 0 1)))
- (eval (read cell))
- (progn (set-text-properties 0 (length cell) nil cell) cell)))
- cell))
-
-(defun org-babel-number-p (string)
- "If STRING represents a number return it's value."
- (if (and (string-match "^-?[0-9]*\\.?[0-9]*$" string)
- (= (length (substring string (match-beginning 0)
- (match-end 0)))
- (length string)))
- (string-to-number string)))
-
-(defun org-babel-import-elisp-from-file (file-name &optional separator)
- "Read the results located at FILE-NAME into an elisp table.
-If the table is trivial, then return it as a scalar."
- (let (result)
- (save-window-excursion
- (with-temp-buffer
- (condition-case nil
- (progn
- (org-table-import file-name separator)
- (delete-file file-name)
- (setq result (mapcar (lambda (row)
- (mapcar #'org-babel-string-read row))
- (org-table-to-lisp))))
- (error nil)))
- (if (null (cdr result)) ;; if result is trivial vector, then scalarize it
- (if (consp (car result))
- (if (null (cdr (car result)))
- (caar result)
- result)
- (car result))
- result))))
-
-(defun org-babel-string-read (cell)
- "Strip nested \"s from around strings."
- (org-babel-read (or (and (stringp cell)
- (string-match "\\\"\\(.+\\)\\\"" cell)
- (match-string 1 cell))
- cell)))
-
-(defun org-babel-reverse-string (string)
- "Return the reverse of STRING."
- (apply 'string (reverse (string-to-list string))))
-
-(defun org-babel-chomp (string &optional regexp)
- "Strip trailing spaces and carriage returns from STRING.
-Default regexp used is \"[ \f\t\n\r\v]\" but can be
-overwritten by specifying a regexp as a second argument."
- (let ((regexp (or regexp "[ \f\t\n\r\v]")))
- (while (and (> (length string) 0)
- (string-match regexp (substring string -1)))
- (setq string (substring string 0 -1)))
- string))
-
-(defun org-babel-trim (string &optional regexp)
- "Strip leading and trailing spaces and carriage returns from STRING.
-Like `org-babel-chomp' only it runs on both the front and back
-of the string."
- (org-babel-chomp (org-babel-reverse-string
- (org-babel-chomp (org-babel-reverse-string string) regexp))
- regexp))
-
-(defvar org-babel-org-babel-call-process-region-original nil)
-(defun org-babel-tramp-handle-call-process-region
- (start end program &optional delete buffer display &rest args)
- "Use tramp to handle call-process-region.
-Fixes a bug in `tramp-handle-call-process-region'."
- (if (and (featurep 'tramp) (file-remote-p default-directory))
- (let ((tmpfile (tramp-compat-make-temp-file "")))
- (write-region start end tmpfile)
- (when delete (delete-region start end))
- (unwind-protect
- ;; (apply 'call-process program tmpfile buffer display args)
- ;; bug in tramp
- (apply 'process-file program tmpfile buffer display args)
- (delete-file tmpfile)))
- ;; org-babel-call-process-region-original is the original emacs
- ;; definition. It is in scope from the let binding in
- ;; org-babel-execute-src-block
- (apply org-babel-call-process-region-original
- start end program delete buffer display args)))
-
-(defun org-babel-local-file-name (file)
- "Return the local name component of FILE."
- (if (file-remote-p file)
- (let (localname)
- (with-parsed-tramp-file-name file nil
- localname))
- file))
-
-(defun org-babel-process-file-name (name &optional no-quote-p)
- "Prepare NAME to be used in an external process.
-If NAME specifies a remote location, the remote portion of the
-name is removed, since in that case the process will be executing
-remotely. The file name is then processed by
-`expand-file-name'. Unless second argument NO-QUOTE-P is non-nil,
-the file name is additionally processed by
-`shell-quote-argument'"
- ((lambda (f) (if no-quote-p f (shell-quote-argument f)))
- (expand-file-name (org-babel-local-file-name name))))
-
-(defvar org-babel-temporary-directory)
-(unless (or noninteractive (boundp 'org-babel-temporary-directory))
- (defvar org-babel-temporary-directory
- (or (and (boundp 'org-babel-temporary-directory)
- (file-exists-p org-babel-temporary-directory)
- org-babel-temporary-directory)
- (make-temp-file "babel-" t))
- "Directory to hold temporary files created to execute code blocks.
-Used by `org-babel-temp-file'. This directory will be removed on
-Emacs shutdown."))
-
-(defun org-babel-temp-file (prefix &optional suffix)
- "Create a temporary file in the `org-babel-temporary-directory'.
-Passes PREFIX and SUFFIX directly to `make-temp-file' with the
-value of `temporary-file-directory' temporarily set to the value
-of `org-babel-temporary-directory'."
- (if (file-remote-p default-directory)
- (make-temp-file
- (concat (file-remote-p default-directory)
- (expand-file-name
- prefix temporary-file-directory)
- nil suffix))
- (let ((temporary-file-directory
- (or (and (file-exists-p org-babel-temporary-directory)
- org-babel-temporary-directory)
- temporary-file-directory)))
- (make-temp-file prefix nil suffix))))
-
-(defun org-babel-remove-temporary-directory ()
- "Remove `org-babel-temporary-directory' on Emacs shutdown."
- (when (and (boundp 'org-babel-temporary-directory)
- (file-exists-p org-babel-temporary-directory))
- ;; taken from `delete-directory' in files.el
- (condition-case nil
- (progn
- (mapc (lambda (file)
- ;; This test is equivalent to
- ;; (and (file-directory-p fn) (not (file-symlink-p fn)))
- ;; but more efficient
- (if (eq t (car (file-attributes file)))
- (delete-directory file)
- (delete-file file)))
- ;; We do not want to delete "." and "..".
- (directory-files org-babel-temporary-directory 'full
- "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"))
- (delete-directory org-babel-temporary-directory))
- (error
- (message "Failed to remove temporary Org-babel directory %s"
- org-babel-temporary-directory)))))
-
-(add-hook 'kill-emacs-hook 'org-babel-remove-temporary-directory)
-
-(provide 'ob)
-
-;; arch-tag: 01a7ebee-06c5-4ee4-a709-e660d28c0af1
-
-;;; ob.el ends here
diff --git a/.emacs.d/org-7.4/lisp/ob.elc b/.emacs.d/org-7.4/lisp/ob.elc
deleted file mode 100644
index 3a62e26..0000000
--- a/.emacs.d/org-7.4/lisp/ob.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-agenda.el b/.emacs.d/org-7.4/lisp/org-agenda.el
deleted file mode 100644
index 6bcbf62..0000000
--- a/.emacs.d/org-7.4/lisp/org-agenda.el
+++ /dev/null
@@ -1,8063 +0,0 @@
-;;; org-agenda.el --- Dynamic task and appointment lists for Org
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file contains the code for creating and using the Agenda for Org-mode.
-
-;;; Code:
-
-(require 'org)
-(eval-when-compile
- (require 'cl))
-
-(declare-function diary-add-to-list "diary-lib"
- (date string specifier &optional marker globcolor literal))
-(declare-function calendar-absolute-from-iso "cal-iso" (date))
-(declare-function calendar-astro-date-string "cal-julian" (&optional date))
-(declare-function calendar-bahai-date-string "cal-bahai" (&optional date))
-(declare-function calendar-chinese-date-string "cal-china" (&optional date))
-(declare-function calendar-coptic-date-string "cal-coptic" (&optional date))
-(declare-function calendar-ethiopic-date-string "cal-coptic" (&optional date))
-(declare-function calendar-french-date-string "cal-french" (&optional date))
-(declare-function calendar-goto-date "cal-move" (date))
-(declare-function calendar-hebrew-date-string "cal-hebrew" (&optional date))
-(declare-function calendar-islamic-date-string "cal-islam" (&optional date))
-(declare-function calendar-iso-date-string "cal-iso" (&optional date))
-(declare-function calendar-iso-from-absolute "cal-iso" (date))
-(declare-function calendar-julian-date-string "cal-julian" (&optional date))
-(declare-function calendar-mayan-date-string "cal-mayan" (&optional date))
-(declare-function calendar-persian-date-string "cal-persia" (&optional date))
-(declare-function org-datetree-find-date-create "org-datetree"
- (date &optional keep-restriction))
-(declare-function org-columns-quit "org-colview" ())
-(declare-function diary-date-display-form "diary-lib" (&optional type))
-(declare-function org-mobile-write-agenda-for-mobile "org-mobile" (file))
-(declare-function org-habit-insert-consistency-graphs
- "org-habit" (&optional line))
-(declare-function org-is-habit-p "org-habit" (&optional pom))
-(declare-function org-habit-parse-todo "org-habit" (&optional pom))
-(declare-function org-habit-get-priority "org-habit" (habit &optional moment))
-(defvar calendar-mode-map)
-(defvar org-clock-current-task) ; defined in org-clock.el
-(defvar org-mobile-force-id-on-agenda-items) ; defined in org-mobile.el
-(defvar org-habit-show-habits)
-(defvar org-habit-show-habits-only-for-today)
-
-;; Defined somewhere in this file, but used before definition.
-(defvar org-agenda-buffer-name)
-(defvar org-agenda-overriding-header)
-(defvar org-agenda-title-append nil)
-(defvar entry)
-(defvar date)
-(defvar org-agenda-undo-list)
-(defvar org-agenda-pending-undo-list)
-(defvar original-date) ; dynamically scoped, calendar.el does scope this
-
-(defcustom org-agenda-confirm-kill 1
- "When set, remote killing from the agenda buffer needs confirmation.
-When t, a confirmation is always needed. When a number N, confirmation is
-only needed when the text to be killed contains more than N non-white lines."
- :group 'org-agenda
- :type '(choice
- (const :tag "Never" nil)
- (const :tag "Always" t)
- (integer :tag "When more than N lines")))
-
-(defcustom org-agenda-compact-blocks nil
- "Non-nil means make the block agenda more compact.
-This is done by leaving out unnecessary lines."
- :group 'org-agenda
- :type 'boolean)
-
-(defcustom org-agenda-block-separator ?=
- "The separator between blocks in the agenda.
-If this is a string, it will be used as the separator, with a newline added.
-If it is a character, it will be repeated to fill the window width."
- :group 'org-agenda
- :type '(choice
- (character)
- (string)))
-
-(defgroup org-agenda-export nil
- "Options concerning exporting agenda views in Org-mode."
- :tag "Org Agenda Export"
- :group 'org-agenda)
-
-(defcustom org-agenda-with-colors t
- "Non-nil means use colors in agenda views."
- :group 'org-agenda-export
- :type 'boolean)
-
-(defcustom org-agenda-exporter-settings nil
- "Alist of variable/value pairs that should be active during agenda export.
-This is a good place to set options for ps-print and for htmlize.
-Note that the way this is implemented, the values will be evaluated
-before assigned to the variables. So make sure to quote values you do
-*not* want evaluated, for example
-
- (setq org-agenda-exporter-settings
- '((ps-print-color-p 'black-white)))"
- :group 'org-agenda-export
- :type '(repeat
- (list
- (variable)
- (sexp :tag "Value"))))
-
-(defcustom org-agenda-before-write-hook '(org-agenda-add-entry-text)
- "Hook run in temporary buffer before writing it to an export file.
-A useful function is `org-agenda-add-entry-text'."
- :group 'org-agenda-export
- :type 'hook
- :options '(org-agenda-add-entry-text))
-
-(defcustom org-agenda-add-entry-text-maxlines 0
- "Maximum number of entry text lines to be added to agenda.
-This is only relevant when `org-agenda-add-entry-text' is part of
-`org-agenda-before-write-hook', which it is by default.
-When this is 0, nothing will happen. When it is greater than 0, it
-specifies the maximum number of lines that will be added for each entry
-that is listed in the agenda view.
-
-Note that this variable is not used during display, only when exporting
-the agenda. For agenda display, see the variables `org-agenda-entry-text-mode'
-and `org-agenda-entry-text-maxlines'."
- :group 'org-agenda
- :type 'integer)
-
-(defcustom org-agenda-add-entry-text-descriptive-links t
- "Non-nil means export org-links as descriptive links in agenda added text.
-This variable applies to the text added to the agenda when
-`org-agenda-add-entry-text-maxlines' is larger than 0.
-When this variable nil, the URL will (also) be shown."
- :group 'org-agenda
- :type 'boolean)
-
-(defcustom org-agenda-export-html-style ""
- "The style specification for exported HTML Agenda files.
-If this variable contains a string, it will replace the default <style>
-section as produced by `htmlize'.
-Since there are different ways of setting style information, this variable
-needs to contain the full HTML structure to provide a style, including the
-surrounding HTML tags. The style specifications should include definitions
-the fonts used by the agenda, here is an example:
-
- <style type=\"text/css\">
- p { font-weight: normal; color: gray; }
- .org-agenda-structure {
- font-size: 110%;
- color: #003399;
- font-weight: 600;
- }
- .org-todo {
- color: #cc6666;
- font-weight: bold;
- }
- .org-agenda-done {
- color: #339933;
- }
- .org-done {
- color: #339933;
- }
- .title { text-align: center; }
- .todo, .deadline { color: red; }
- .done { color: green; }
- </style>
-
-or, if you want to keep the style in a file,
-
- <link rel=\"stylesheet\" type=\"text/css\" href=\"mystyles.css\">
-
-As the value of this option simply gets inserted into the HTML <head> header,
-you can \"misuse\" it to also add other text to the header. However,
-<style>...</style> is required, if not present the variable will be ignored."
- :group 'org-agenda-export
- :group 'org-export-html
- :type 'string)
-
-(defcustom org-agenda-persistent-filter nil
- "When set, keep filters from one agenda view to the next."
- :group 'org-agenda
- :type 'boolean)
-
-(defgroup org-agenda-custom-commands nil
- "Options concerning agenda views in Org-mode."
- :tag "Org Agenda Custom Commands"
- :group 'org-agenda)
-
-(defconst org-sorting-choice
- '(choice
- (const time-up) (const time-down)
- (const category-keep) (const category-up) (const category-down)
- (const tag-down) (const tag-up)
- (const priority-up) (const priority-down)
- (const todo-state-up) (const todo-state-down)
- (const effort-up) (const effort-down)
- (const habit-up) (const habit-down)
- (const alpha-up) (const alpha-down)
- (const user-defined-up) (const user-defined-down))
- "Sorting choices.")
-
-(defconst org-agenda-custom-commands-local-options
- `(repeat :tag "Local settings for this command. Remember to quote values"
- (choice :tag "Setting"
- (list :tag "Heading for this block"
- (const org-agenda-overriding-header)
- (string :tag "Headline"))
- (list :tag "Files to be searched"
- (const org-agenda-files)
- (list
- (const :format "" quote)
- (repeat (file))))
- (list :tag "Sorting strategy"
- (const org-agenda-sorting-strategy)
- (list
- (const :format "" quote)
- (repeat
- ,org-sorting-choice)))
- (list :tag "Prefix format"
- (const org-agenda-prefix-format :value " %-12:c%?-12t% s")
- (string))
- (list :tag "Number of days in agenda"
- (const org-agenda-span)
- (choice (const :tag "Day" 'day)
- (const :tag "Week" 'week)
- (const :tag "Month" 'month)
- (const :tag "Year" 'year)
- (integer :tag "Custom")))
- (list :tag "Fixed starting date"
- (const org-agenda-start-day)
- (string :value "2007-11-01"))
- (list :tag "Start on day of week"
- (const org-agenda-start-on-weekday)
- (choice :value 1
- (const :tag "Today" nil)
- (integer :tag "Weekday No.")))
- (list :tag "Include data from diary"
- (const org-agenda-include-diary)
- (boolean))
- (list :tag "Deadline Warning days"
- (const org-deadline-warning-days)
- (integer :value 1))
- (list :tag "Tags filter preset"
- (const org-agenda-filter-preset)
- (list
- (const :format "" quote)
- (repeat
- (string :tag "+tag or -tag"))))
- (list :tag "Set daily/weekly entry types"
- (const org-agenda-entry-types)
- (set :greedy t :value (:deadline :scheduled :timestamp :sexp)
- (const :deadline)
- (const :scheduled)
- (const :timestamp)
- (const :sexp)))
- (list :tag "Standard skipping condition"
- :value (org-agenda-skip-function '(org-agenda-skip-entry-if))
- (const org-agenda-skip-function)
- (list
- (const :format "" quote)
- (list
- (choice
- :tag "Skipping range"
- (const :tag "Skip entry" org-agenda-skip-entry-if)
- (const :tag "Skip subtree" org-agenda-skip-subtree-if))
- (repeat :inline t :tag "Conditions for skipping"
- (choice
- :tag "Condition type"
- (list :tag "Regexp matches" :inline t (const :format "" 'regexp) (regexp))
- (list :tag "Regexp does not match" :inline t (const :format "" 'notregexp) (regexp))
- (list :tag "TODO state is" :inline t
- (const 'todo)
- (choice
- (const :tag "any not-done state" 'todo)
- (const :tag "any done state" 'done)
- (const :tag "any state" 'any)
- (list :tag "Keyword list"
- (const :format "" quote)
- (repeat (string :tag "Keyword")))))
- (list :tag "TODO state is not" :inline t
- (const 'nottodo)
- (choice
- (const :tag "any not-done state" 'todo)
- (const :tag "any done state" 'done)
- (const :tag "any state" 'any)
- (list :tag "Keyword list"
- (const :format "" quote)
- (repeat (string :tag "Keyword")))))
- (const :tag "scheduled" 'scheduled)
- (const :tag "not scheduled" 'notscheduled)
- (const :tag "deadline" 'deadline)
- (const :tag "no deadline" 'notdeadline)
- (const :tag "timestamp" 'timestamp)
- (const :tag "no timestamp" 'nottimestamp))))))
- (list :tag "Non-standard skipping condition"
- :value (org-agenda-skip-function)
- (const org-agenda-skip-function)
- (sexp :tag "Function or form (quoted!)"))
- (list :tag "Any variable"
- (variable :tag "Variable")
- (sexp :tag "Value (sexp)"))))
- "Selection of examples for agenda command settings.
-This will be spliced into the custom type of
-`org-agenda-custom-commands'.")
-
-
-(defcustom org-agenda-custom-commands nil
- "Custom commands for the agenda.
-These commands will be offered on the splash screen displayed by the
-agenda dispatcher \\[org-agenda]. Each entry is a list like this:
-
- (key desc type match settings files)
-
-key The key (one or more characters as a string) to be associated
- with the command.
-desc A description of the command, when omitted or nil, a default
- description is built using MATCH.
-type The command type, any of the following symbols:
- agenda The daily/weekly agenda.
- todo Entries with a specific TODO keyword, in all agenda files.
- search Entries containing search words entry or headline.
- tags Tags/Property/TODO match in all agenda files.
- tags-todo Tags/P/T match in all agenda files, TODO entries only.
- todo-tree Sparse tree of specific TODO keyword in *current* file.
- tags-tree Sparse tree with all tags matches in *current* file.
- occur-tree Occur sparse tree for *current* file.
- ... A user-defined function.
-match What to search for:
- - a single keyword for TODO keyword searches
- - a tags match expression for tags searches
- - a word search expression for text searches.
- - a regular expression for occur searches
- For all other commands, this should be the empty string.
-settings A list of option settings, similar to that in a let form, so like
- this: ((opt1 val1) (opt2 val2) ...). The values will be
- evaluated at the moment of execution, so quote them when needed.
-files A list of files file to write the produced agenda buffer to
- with the command `org-store-agenda-views'.
- If a file name ends in \".html\", an HTML version of the buffer
- is written out. If it ends in \".ps\", a postscript version is
- produced. Otherwise, only the plain text is written to the file.
-
-You can also define a set of commands, to create a composite agenda buffer.
-In this case, an entry looks like this:
-
- (key desc (cmd1 cmd2 ...) general-settings-for-whole-set files)
-
-where
-
-desc A description string to be displayed in the dispatcher menu.
-cmd An agenda command, similar to the above. However, tree commands
- are no allowed, but instead you can get agenda and global todo list.
- So valid commands for a set are:
- (agenda \"\" settings)
- (alltodo \"\" settings)
- (stuck \"\" settings)
- (todo \"match\" settings files)
- (search \"match\" settings files)
- (tags \"match\" settings files)
- (tags-todo \"match\" settings files)
-
-Each command can carry a list of options, and another set of options can be
-given for the whole set of commands. Individual command options take
-precedence over the general options.
-
-When using several characters as key to a command, the first characters
-are prefix commands. For the dispatcher to display useful information, you
-should provide a description for the prefix, like
-
- (setq org-agenda-custom-commands
- '((\"h\" . \"HOME + Name tag searches\") ; describe prefix \"h\"
- (\"hl\" tags \"+HOME+Lisa\")
- (\"hp\" tags \"+HOME+Peter\")
- (\"hk\" tags \"+HOME+Kim\")))"
- :group 'org-agenda-custom-commands
- :type `(repeat
- (choice :value ("x" "Describe command here" tags "" nil)
- (list :tag "Single command"
- (string :tag "Access Key(s) ")
- (option (string :tag "Description"))
- (choice
- (const :tag "Agenda" agenda)
- (const :tag "TODO list" alltodo)
- (const :tag "Search words" search)
- (const :tag "Stuck projects" stuck)
- (const :tag "Tags/Property match (all agenda files)" tags)
- (const :tag "Tags/Property match of TODO entries (all agenda files)" tags-todo)
- (const :tag "TODO keyword search (all agenda files)" todo)
- (const :tag "Tags sparse tree (current buffer)" tags-tree)
- (const :tag "TODO keyword tree (current buffer)" todo-tree)
- (const :tag "Occur tree (current buffer)" occur-tree)
- (sexp :tag "Other, user-defined function"))
- (string :tag "Match (only for some commands)")
- ,org-agenda-custom-commands-local-options
- (option (repeat :tag "Export" (file :tag "Export to"))))
- (list :tag "Command series, all agenda files"
- (string :tag "Access Key(s)")
- (string :tag "Description ")
- (repeat :tag "Component"
- (choice
- (list :tag "Agenda"
- (const :format "" agenda)
- (const :tag "" :format "" "")
- ,org-agenda-custom-commands-local-options)
- (list :tag "TODO list (all keywords)"
- (const :format "" alltodo)
- (const :tag "" :format "" "")
- ,org-agenda-custom-commands-local-options)
- (list :tag "Search words"
- (const :format "" search)
- (string :tag "Match")
- ,org-agenda-custom-commands-local-options)
- (list :tag "Stuck projects"
- (const :format "" stuck)
- (const :tag "" :format "" "")
- ,org-agenda-custom-commands-local-options)
- (list :tag "Tags search"
- (const :format "" tags)
- (string :tag "Match")
- ,org-agenda-custom-commands-local-options)
- (list :tag "Tags search, TODO entries only"
- (const :format "" tags-todo)
- (string :tag "Match")
- ,org-agenda-custom-commands-local-options)
- (list :tag "TODO keyword search"
- (const :format "" todo)
- (string :tag "Match")
- ,org-agenda-custom-commands-local-options)
- (list :tag "Other, user-defined function"
- (symbol :tag "function")
- (string :tag "Match")
- ,org-agenda-custom-commands-local-options)))
-
- (repeat :tag "Settings for entire command set"
- (list (variable :tag "Any variable")
- (sexp :tag "Value")))
- (option (repeat :tag "Export" (file :tag "Export to"))))
- (cons :tag "Prefix key documentation"
- (string :tag "Access Key(s)")
- (string :tag "Description ")))))
-
-(defcustom org-agenda-query-register ?o
- "The register holding the current query string.
-The purpose of this is that if you construct a query string interactively,
-you can then use it to define a custom command."
- :group 'org-agenda-custom-commands
- :type 'character)
-
-(defcustom org-stuck-projects
- '("+LEVEL=2/-DONE" ("TODO" "NEXT" "NEXTACTION") nil "")
- "How to identify stuck projects.
-This is a list of four items:
-1. A tags/todo/property matcher string that is used to identify a project.
- See the manual for a description of tag and property searches.
- The entire tree below a headline matched by this is considered one project.
-2. A list of TODO keywords identifying non-stuck projects.
- If the project subtree contains any headline with one of these todo
- keywords, the project is considered to be not stuck. If you specify
- \"*\" as a keyword, any TODO keyword will mark the project unstuck.
-3. A list of tags identifying non-stuck projects.
- If the project subtree contains any headline with one of these tags,
- the project is considered to be not stuck. If you specify \"*\" as
- a tag, any tag will mark the project unstuck. Note that this is about
- the explicit presence of a tag somewhere in the subtree, inherited
- tags to not count here. If inherited tags make a project not stuck,
- use \"-TAG\" in the tags part of the matcher under (1.) above.
-4. An arbitrary regular expression matching non-stuck projects.
-
-If the project turns out to be not stuck, search continues also in the
-subtree to see if any of the subtasks have project status.
-
-See also the variable `org-tags-match-list-sublevels' which applies
-to projects matched by this search as well.
-
-After defining this variable, you may use \\[org-agenda-list-stuck-projects]
-or `C-c a #' to produce the list."
- :group 'org-agenda-custom-commands
- :type '(list
- (string :tag "Tags/TODO match to identify a project")
- (repeat :tag "Projects are *not* stuck if they have an entry with TODO keyword any of" (string))
- (repeat :tag "Projects are *not* stuck if they have an entry with TAG being any of" (string))
- (regexp :tag "Projects are *not* stuck if this regexp matches inside the subtree")))
-
-(defcustom org-agenda-filter-effort-default-operator "<"
- "The default operator for effort estimate filtering.
-If you select an effort estimate limit without first pressing an operator,
-this one will be used."
- :group 'org-agenda-custom-commands
- :type '(choice (const :tag "less or equal" "<")
- (const :tag "greater or equal"">")
- (const :tag "equal" "=")))
-
-(defgroup org-agenda-skip nil
- "Options concerning skipping parts of agenda files."
- :tag "Org Agenda Skip"
- :group 'org-agenda)
-(defgroup org-agenda-daily/weekly nil
- "Options concerning the daily/weekly agenda."
- :tag "Org Agenda Daily/Weekly"
- :group 'org-agenda)
-(defgroup org-agenda-todo-list nil
- "Options concerning the global todo list agenda view."
- :tag "Org Agenda Todo List"
- :group 'org-agenda)
-(defgroup org-agenda-match-view nil
- "Options concerning the general tags/property/todo match agenda view."
- :tag "Org Agenda Match View"
- :group 'org-agenda)
-(defgroup org-agenda-search-view nil
- "Options concerning the general tags/property/todo match agenda view."
- :tag "Org Agenda Match View"
- :group 'org-agenda)
-
-(defvar org-agenda-archives-mode nil
- "Non-nil means the agenda will include archived items.
-If this is the symbol `trees', trees in the selected agenda scope
-that are marked with the ARCHIVE tag will be included anyway. When this is
-t, also all archive files associated with the current selection of agenda
-files will be included.")
-
-(defcustom org-agenda-skip-comment-trees t
- "Non-nil means skip trees that start with the COMMENT keyword.
-When nil, these trees are also scanned by agenda commands."
- :group 'org-agenda-skip
- :type 'boolean)
-
-(defcustom org-agenda-todo-list-sublevels t
- "Non-nil means check also the sublevels of a TODO entry for TODO entries.
-When nil, the sublevels of a TODO entry are not checked, resulting in
-potentially much shorter TODO lists."
- :group 'org-agenda-skip
- :group 'org-agenda-todo-list
- :type 'boolean)
-
-(defcustom org-agenda-todo-ignore-with-date nil
- "Non-nil means don't show entries with a date in the global todo list.
-You can use this if you prefer to mark mere appointments with a TODO keyword,
-but don't want them to show up in the TODO list.
-When this is set, it also covers deadlines and scheduled items, the settings
-of `org-agenda-todo-ignore-scheduled' and `org-agenda-todo-ignore-deadlines'
-will be ignored.
-See also the variable `org-agenda-tags-todo-honor-ignore-options'."
- :group 'org-agenda-skip
- :group 'org-agenda-todo-list
- :type 'boolean)
-
-(defcustom org-agenda-todo-ignore-timestamp nil
- "Non-nil means don't show entries with a timestamp.
-This applies when creating the global todo list.
-Valid values are:
-
-past Don't show entries for today or in the past.
-
-future Don't show entries with a timestamp in the future.
- The idea behind this is that if it has a future
- timestamp, you don't want to think about it until the
- date.
-
-all Don't show any entries with a timestamp in the global todo list.
- The idea behind this is that by setting a timestamp, you
- have already \"taken care\" of this item.
-
-See also `org-agenda-todo-ignore-with-date'.
-See also the variable `org-agenda-tags-todo-honor-ignore-options' if you want
-to make his option also apply to the tags-todo list."
- :group 'org-agenda-skip
- :group 'org-agenda-todo-list
- :type '(choice
- (const :tag "Ignore future timestamp todos" future)
- (const :tag "Ignore past or present timestamp todos" past)
- (const :tag "Ignore all timestamp todos" all)
- (const :tag "Show timestamp todos" nil)))
-
-(defcustom org-agenda-todo-ignore-scheduled nil
- "Non-nil means, ignore some scheduled TODO items when making TODO list.
-This applies when creating the global todo list.
-Valid values are:
-
-past Don't show entries scheduled today or in the past.
-
-future Don't show entries scheduled in the future.
- The idea behind this is that by scheduling it, you don't want to
- think about it until the scheduled date.
-
-all Don't show any scheduled entries in the global todo list.
- The idea behind this is that by scheduling it, you have already
- \"taken care\" of this item.
-
-t Same as `all', for backward compatibility.
-
-See also `org-agenda-todo-ignore-with-date'.
-See also the variable `org-agenda-tags-todo-honor-ignore-options' if you want
-to make his option also apply to the tags-todo list."
- :group 'org-agenda-skip
- :group 'org-agenda-todo-list
- :type '(choice
- (const :tag "Ignore future-scheduled todos" future)
- (const :tag "Ignore past- or present-scheduled todos" past)
- (const :tag "Ignore all scheduled todos" all)
- (const :tag "Ignore all scheduled todos (compatibility)" t)
- (const :tag "Show scheduled todos" nil)))
-
-(defcustom org-agenda-todo-ignore-deadlines nil
- "Non-nil means ignore some deadlined TODO items when making TODO list.
-There are different motivations for using different values, please think
-carefully when configuring this variable.
-
-This applies when creating the global todo list.
-Valid values are:
-
-near Don't show near deadline entries. A deadline is near when it is
- closer than `org-deadline-warning-days' days. The idea behind this
- is that such items will appear in the agenda anyway.
-
-far Don't show TODO entries where a deadline has been defined, but
- the deadline is not near. This is useful if you don't want to
- use the todo list to figure out what to do now.
-
-past Don't show entries with a deadline timestamp for today or in the past.
-
-future Don't show entries with a deadline timestamp in the future, not even
- when they become `near' ones. Use it with caution.
-
-all Ignore all TODO entries that do have a deadline.
-
-t Same as `near', for backward compatibility.
-
-See also `org-agenda-todo-ignore-with-date'.
-See also the variable `org-agenda-tags-todo-honor-ignore-options' if you want
-to make his option also apply to the tags-todo list."
- :group 'org-agenda-skip
- :group 'org-agenda-todo-list
- :type '(choice
- (const :tag "Ignore near deadlines" near)
- (const :tag "Ignore near deadlines (compatibility)" t)
- (const :tag "Ignore far deadlines" far)
- (const :tag "Ignore all TODOs with a deadlines" all)
- (const :tag "Show all TODOs, even if they have a deadline" nil)))
-
-(defcustom org-agenda-tags-todo-honor-ignore-options nil
- "Non-nil means honor todo-list ...ignore options also in tags-todo search.
-The variables
- `org-agenda-todo-ignore-with-date',
- `org-agenda-todo-ignore-timestamp',
- `org-agenda-todo-ignore-scheduled',
- `org-agenda-todo-ignore-deadlines'
-make the global TODO list skip entries that have time stamps of certain
-kinds. If this option is set, the same options will also apply for the
-tags-todo search, which is the general tags/property matcher
-restricted to unfinished TODO entries only."
- :group 'org-agenda-skip
- :group 'org-agenda-todo-list
- :group 'org-agenda-match-view
- :type 'boolean)
-
-(defcustom org-agenda-skip-scheduled-if-done nil
- "Non-nil means don't show scheduled items in agenda when they are done.
-This is relevant for the daily/weekly agenda, not for the TODO list. And
-it applies only to the actual date of the scheduling. Warnings about
-an item with a past scheduling dates are always turned off when the item
-is DONE."
- :group 'org-agenda-skip
- :group 'org-agenda-daily/weekly
- :type 'boolean)
-
-(defcustom org-agenda-skip-scheduled-if-deadline-is-shown nil
- "Non-nil means skip scheduling line if same entry shows because of deadline.
-In the agenda of today, an entry can show up multiple times because
-it is both scheduled and has a nearby deadline, and maybe a plain time
-stamp as well.
-When this variable is t, then only the deadline is shown and the fact that
-the entry is scheduled today or was scheduled previously is not shown.
-When this variable is nil, the entry will be shown several times. When
-the variable is the symbol `not-today', then skip scheduled previously,
-but not scheduled today."
- :group 'org-agenda-skip
- :group 'org-agenda-daily/weekly
- :type '(choice
- (const :tag "Never" nil)
- (const :tag "Always" t)
- (const :tag "Not when scheduled today" not-today)))
-
-(defcustom org-agenda-skip-deadline-if-done nil
- "Non-nil means don't show deadlines when the corresponding item is done.
-When nil, the deadline is still shown and should give you a happy feeling.
-This is relevant for the daily/weekly agenda. And it applied only to the
-actually date of the deadline. Warnings about approaching and past-due
-deadlines are always turned off when the item is DONE."
- :group 'org-agenda-skip
- :group 'org-agenda-daily/weekly
- :type 'boolean)
-
-(defcustom org-agenda-skip-deadline-prewarning-if-scheduled nil
- "Non-nil means skip deadline prewarning when entry is also scheduled.
-This will apply on all days where a prewarning for the deadline would
-be shown, but not at the day when the entry is actually due. On that day,
-the deadline will be shown anyway.
-This variable may be set to nil, t, or a number which will then give
-the number of days before the actual deadline when the prewarnings
-should resume.
-This can be used in a workflow where the first showing of the deadline will
-trigger you to schedule it, and then you don't want to be reminded of it
-because you will take care of it on the day when scheduled."
- :group 'org-agenda-skip
- :group 'org-agenda-daily/weekly
- :type '(choice
- (const :tag "Alwas show prewarning" nil)
- (const :tag "Remove prewarning if entry is scheduled" t)
- (integer :tag "Restart prewarning N days before deadline")))
-
-(defcustom org-agenda-skip-additional-timestamps-same-entry t
- "When nil, multiple same-day timestamps in entry make multiple agenda lines.
-When non-nil, after the search for timestamps has matched once in an
-entry, the rest of the entry will not be searched."
- :group 'org-agenda-skip
- :type 'boolean)
-
-(defcustom org-agenda-skip-timestamp-if-done nil
- "Non-nil means don't select item by timestamp or -range if it is DONE."
- :group 'org-agenda-skip
- :group 'org-agenda-daily/weekly
- :type 'boolean)
-
-(defcustom org-agenda-dim-blocked-tasks t
- "Non-nil means dim blocked tasks in the agenda display.
-This causes some overhead during agenda construction, but if you
-have turned on `org-enforce-todo-dependencies',
-`org-enforce-todo-checkbox-dependencies', or any other blocking
-mechanism, this will create useful feedback in the agenda.
-
-Instead of t, this variable can also have the value `invisible'.
-Then blocked tasks will be invisible and only become visible when
-they become unblocked. An exemption to this behavior is when a task is
-blocked because of unchecked checkboxes below it. Since checkboxes do
-not show up in the agenda views, making this task invisible you remove any
-trace from agenda views that there is something to do. Therefore, a task
-that is blocked because of checkboxes will never be made invisible, it
-will only be dimmed."
- :group 'org-agenda-daily/weekly
- :group 'org-agenda-todo-list
- :type '(choice
- (const :tag "Do not dim" nil)
- (const :tag "Dim to a grey face" t)
- (const :tag "Make invisible" invisible)))
-
-(defcustom org-timeline-show-empty-dates 3
- "Non-nil means `org-timeline' also shows dates without an entry.
-When nil, only the days which actually have entries are shown.
-When t, all days between the first and the last date are shown.
-When an integer, show also empty dates, but if there is a gap of more than
-N days, just insert a special line indicating the size of the gap."
- :group 'org-agenda-skip
- :type '(choice
- (const :tag "None" nil)
- (const :tag "All" t)
- (integer :tag "at most")))
-
-(defgroup org-agenda-startup nil
- "Options concerning initial settings in the Agenda in Org Mode."
- :tag "Org Agenda Startup"
- :group 'org-agenda)
-
-(defcustom org-agenda-menu-show-matcher t
- "Non-nil menas show the match string in the agenda dispatcher menu.
-When nil, the matcher string is not shown, but is put into the help-echo
-property so than moving the mouse over the command shows it.
-Setting it to nil is good if matcher strings are very long and/or if
-you wnat to use two-column display (see `org-agenda-menu-two-column')."
- :group 'org-agenda
- :type 'boolean)
-
-(defcustom org-agenda-menu-two-column nil
- "Non-nil means, use two columns to show custom commands in the dispatcher.
-If you use this, you probably want to set `org-agenda-menu-show-matcher'
-to nil."
- :group 'org-agenda
- :type 'boolean)
-
-(defcustom org-finalize-agenda-hook nil
- "Hook run just before displaying an agenda buffer."
- :group 'org-agenda-startup
- :type 'hook)
-
-(defcustom org-agenda-mouse-1-follows-link nil
- "Non-nil means mouse-1 on a link will follow the link in the agenda.
-A longer mouse click will still set point. Does not work on XEmacs.
-Needs to be set before org.el is loaded."
- :group 'org-agenda-startup
- :type 'boolean)
-
-(defcustom org-agenda-start-with-follow-mode nil
- "The initial value of follow mode in a newly created agenda window."
- :group 'org-agenda-startup
- :type 'boolean)
-
-(defcustom org-agenda-show-outline-path t
- "Non-nil means show outline path in echo area after line motion."
- :group 'org-agenda-startup
- :type 'boolean)
-
-(defcustom org-agenda-start-with-entry-text-mode nil
- "The initial value of entry-text-mode in a newly created agenda window."
- :group 'org-agenda-startup
- :type 'boolean)
-
-(defcustom org-agenda-entry-text-maxlines 5
- "Number of text lines to be added when `E' is pressed in the agenda.
-
-Note that this variable only used during agenda display. Add add entry text
-when exporting the agenda, configure the variable
-`org-agenda-add-entry-ext-maxlines'."
- :group 'org-agenda
- :type 'integer)
-
-(defcustom org-agenda-entry-text-exclude-regexps nil
- "List of regular expressions to clean up entry text.
-The complete matches of all regular expressions in this list will be
-removed from entry text before it is shown in the agenda."
- :group 'org-agenda
- :type '(repeat (regexp)))
-
-(defvar org-agenda-entry-text-cleanup-hook nil
- "Hook that is run after basic cleanup of entry text to be shown in agenda.
-This cleanup is done in a temporary buffer, so the function may inspect and
-change the entire buffer.
-Some default stuff like drawers and scheduling/deadline dates will already
-have been removed when this is called, as will any matches for regular
-expressions listed in `org-agenda-entry-text-exclude-regexps'.")
-
-(defvar org-agenda-include-inactive-timestamps nil
- "Non-nil means include inactive time stamps in agenda and timeline.")
-
-(defgroup org-agenda-windows nil
- "Options concerning the windows used by the Agenda in Org Mode."
- :tag "Org Agenda Windows"
- :group 'org-agenda)
-
-(defcustom org-agenda-window-setup 'reorganize-frame
- "How the agenda buffer should be displayed.
-Possible values for this option are:
-
-current-window Show agenda in the current window, keeping all other windows.
-other-window Use `switch-to-buffer-other-window' to display agenda.
-reorganize-frame Show only two windows on the current frame, the current
- window and the agenda.
-other-frame Use `switch-to-buffer-other-frame' to display agenda.
- Also, when exiting the agenda, kill that frame.
-See also the variable `org-agenda-restore-windows-after-quit'."
- :group 'org-agenda-windows
- :type '(choice
- (const current-window)
- (const other-frame)
- (const other-window)
- (const reorganize-frame)))
-
-(defcustom org-agenda-window-frame-fractions '(0.5 . 0.75)
- "The min and max height of the agenda window as a fraction of frame height.
-The value of the variable is a cons cell with two numbers between 0 and 1.
-It only matters if `org-agenda-window-setup' is `reorganize-frame'."
- :group 'org-agenda-windows
- :type '(cons (number :tag "Minimum") (number :tag "Maximum")))
-
-(defcustom org-agenda-restore-windows-after-quit nil
- "Non-nil means restore window configuration open exiting agenda.
-Before the window configuration is changed for displaying the agenda,
-the current status is recorded. When the agenda is exited with
-`q' or `x' and this option is set, the old state is restored. If
-`org-agenda-window-setup' is `other-frame', the value of this
-option will be ignored."
- :group 'org-agenda-windows
- :type 'boolean)
-
-(defcustom org-agenda-ndays nil
- "Number of days to include in overview display.
-Should be 1 or 7.
-Obsolete, see `org-agenda-span'."
- :group 'org-agenda-daily/weekly
- :type 'integer)
-
-(make-obsolete-variable 'org-agenda-ndays 'org-agenda-span "24.1")
-
-(defcustom org-agenda-span 'week
- "Number of days to include in overview display.
-Can be day, week, month, year, or any number of days.
-Custom commands can set this variable in the options section."
- :group 'org-agenda-daily/weekly
- :type '(choice (const :tag "Day" day)
- (const :tag "Week" week)
- (const :tag "Month" month)
- (const :tag "Year" year)
- (integer :tag "Custom")))
-
-(defcustom org-agenda-start-on-weekday 1
- "Non-nil means start the overview always on the specified weekday.
-0 denotes Sunday, 1 denotes Monday etc.
-When nil, always start on the current day.
-Custom commands can set this variable in the options section."
- :group 'org-agenda-daily/weekly
- :type '(choice (const :tag "Today" nil)
- (integer :tag "Weekday No.")))
-
-(defcustom org-agenda-show-all-dates t
- "Non-nil means `org-agenda' shows every day in the selected range.
-When nil, only the days which actually have entries are shown."
- :group 'org-agenda-daily/weekly
- :type 'boolean)
-
-(defcustom org-agenda-format-date 'org-agenda-format-date-aligned
- "Format string for displaying dates in the agenda.
-Used by the daily/weekly agenda and by the timeline. This should be
-a format string understood by `format-time-string', or a function returning
-the formatted date as a string. The function must take a single argument,
-a calendar-style date list like (month day year)."
- :group 'org-agenda-daily/weekly
- :type '(choice
- (string :tag "Format string")
- (function :tag "Function")))
-
-(defun org-agenda-format-date-aligned (date)
- "Format a date string for display in the daily/weekly agenda, or timeline.
-This function makes sure that dates are aligned for easy reading."
- (require 'cal-iso)
- (let* ((dayname (calendar-day-name date))
- (day (cadr date))
- (day-of-week (calendar-day-of-week date))
- (month (car date))
- (monthname (calendar-month-name month))
- (year (nth 2 date))
- (iso-week (org-days-to-iso-week
- (calendar-absolute-from-gregorian date)))
- (weekyear (cond ((and (= month 1) (>= iso-week 52))
- (1- year))
- ((and (= month 12) (<= iso-week 1))
- (1+ year))
- (t year)))
- (weekstring (if (= day-of-week 1)
- (format " W%02d" iso-week)
- "")))
- (format "%-10s %2d %s %4d%s"
- dayname day monthname year weekstring)))
-
-(defcustom org-agenda-time-leading-zero nil
- "Non-nil means use leading zero for military times in agenda.
-For example, 9:30am would become 09:30 rather than 9:30."
- :group 'org-agenda-daily/weekly
- :type 'boolean)
-
-(defcustom org-agenda-timegrid-use-ampm nil
- "When set, show AM/PM style timestamps on the timegrid."
- :group 'org-agenda
- :type 'boolean)
-
-(defun org-agenda-time-of-day-to-ampm (time)
- "Convert TIME of a string like '13:45' to an AM/PM style time string."
- (let* ((hour-number (string-to-number (substring time 0 -3)))
- (minute (substring time -2))
- (ampm "am"))
- (cond
- ((equal hour-number 12)
- (setq ampm "pm"))
- ((> hour-number 12)
- (setq ampm "pm")
- (setq hour-number (- hour-number 12))))
- (concat
- (if org-agenda-time-leading-zero
- (format "%02d" hour-number)
- (format "%02s" (number-to-string hour-number)))
- ":" minute ampm)))
-
-(defun org-agenda-time-of-day-to-ampm-maybe (time)
- "Conditionally convert TIME to AM/PM format
-based on `org-agenda-timegrid-use-ampm'"
- (if org-agenda-timegrid-use-ampm
- (org-agenda-time-of-day-to-ampm time)
- time))
-
-(defcustom org-agenda-weekend-days '(6 0)
- "Which days are weekend?
-These days get the special face `org-agenda-date-weekend' in the agenda
-and timeline buffers."
- :group 'org-agenda-daily/weekly
- :type '(set :greedy t
- (const :tag "Monday" 1)
- (const :tag "Tuesday" 2)
- (const :tag "Wednesday" 3)
- (const :tag "Thursday" 4)
- (const :tag "Friday" 5)
- (const :tag "Saturday" 6)
- (const :tag "Sunday" 0)))
-
-(defcustom org-agenda-include-diary nil
- "If non-nil, include in the agenda entries from the Emacs Calendar's diary.
-Custom commands can set this variable in the options section."
- :group 'org-agenda-daily/weekly
- :type 'boolean)
-
-(defcustom org-agenda-include-deadlines t
- "If non-nil, include entries within their deadline warning period.
-Custom commands can set this variable in the options section."
- :group 'org-agenda-daily/weekly
- :type 'boolean)
-
-(defcustom org-agenda-include-all-todo nil
- "Set means weekly/daily agenda will always contain all TODO entries.
-The TODO entries will be listed at the top of the agenda, before
-the entries for specific days.
-This option is deprecated, it is better to define a block agenda instead."
- :group 'org-agenda-daily/weekly
- :type 'boolean)
-
-(defcustom org-agenda-repeating-timestamp-show-all t
- "Non-nil means show all occurrences of a repeating stamp in the agenda.
-When nil, only one occurrence is shown, either today or the
-nearest into the future."
- :group 'org-agenda-daily/weekly
- :type 'boolean)
-
-(defcustom org-scheduled-past-days 10000
- "No. of days to continue listing scheduled items that are not marked DONE.
-When an item is scheduled on a date, it shows up in the agenda on this
-day and will be listed until it is marked done for the number of days
-given here."
- :group 'org-agenda-daily/weekly
- :type 'integer)
-
-(defcustom org-agenda-log-mode-items '(closed clock)
- "List of items that should be shown in agenda log mode.
-This list may contain the following symbols:
-
- closed Show entries that have been closed on that day.
- clock Show entries that have received clocked time on that day.
- state Show all logged state changes.
-Note that instead of changing this variable, you can also press `C-u l' in
-the agenda to display all available LOG items temporarily."
- :group 'org-agenda-daily/weekly
- :type '(set :greedy t (const closed) (const clock) (const state)))
-
-(defcustom org-agenda-log-mode-add-notes t
- "Non-nil means add first line of notes to log entries in agenda views.
-If a log item like a state change or a clock entry is associated with
-notes, the first line of these notes will be added to the entry in the
-agenda display."
- :group 'org-agenda-daily/weekly
- :type 'boolean)
-
-(defcustom org-agenda-start-with-log-mode nil
- "The initial value of log-mode in a newly created agenda window."
- :group 'org-agenda-startup
- :group 'org-agenda-daily/weekly
- :type 'boolean)
-
-(defcustom org-agenda-start-with-clockreport-mode nil
- "The initial value of clockreport-mode in a newly created agenda window."
- :group 'org-agenda-startup
- :group 'org-agenda-daily/weekly
- :type 'boolean)
-
-(defcustom org-agenda-clockreport-parameter-plist '(:link t :maxlevel 2)
- "Property list with parameters for the clocktable in clockreport mode.
-This is the display mode that shows a clock table in the daily/weekly
-agenda, the properties for this dynamic block can be set here.
-The usual clocktable parameters are allowed here, but you cannot set
-the properties :name, :tstart, :tend, :block, and :scope - these will
-be overwritten to make sure the content accurately reflects the
-current display in the agenda."
- :group 'org-agenda-daily/weekly
- :type 'plist)
-
-(defcustom org-agenda-search-view-always-boolean nil
- "Non-nil means the search string is interpreted as individual parts.
-
-The search string for search view can either be interpreted as a phrase,
-or as a list of snippets that define a boolean search for a number of
-strings.
-
-When this is non-nil, the string will be split on whitespace, and each
-snippet will be searched individually, and all must match in order to
-select an entry. A snippet is then a single string of non-white
-characters, or a string in double quotes, or a regexp in {} braces.
-If a snippet is preceded by \"-\", the snippet must *not* match.
-\"+\" is syntactic sugar for positive selection. Each snippet may
-be found as a full word or a partial word, but see the variable
-`org-agenda-search-view-force-full-words'.
-
-When this is nil, search will look for the entire search phrase as one,
-with each space character matching any amount of whitespace, including
-line breaks.
-
-Even when this is nil, you can still switch to Boolean search dynamically
-by preceding the first snippet with \"+\" or \"-\". If the first snippet
-is a regexp marked with braces like \"{abc}\", this will also switch to
-boolean search."
- :group 'org-agenda-search-view
- :type 'boolean)
-
-(if (fboundp 'defvaralias)
- (defvaralias 'org-agenda-search-view-search-words-only
- 'org-agenda-search-view-always-boolean))
-
-(defcustom org-agenda-search-view-force-full-words nil
- "Non-nil means, search words must be matches as complete words.
-When nil, they may also match part of a word."
- :group 'org-agenda-search-view
- :type 'boolean)
-
-(defgroup org-agenda-time-grid nil
- "Options concerning the time grid in the Org-mode Agenda."
- :tag "Org Agenda Time Grid"
- :group 'org-agenda)
-
-(defcustom org-agenda-search-headline-for-time t
- "Non-nil means search headline for a time-of-day.
-If the headline contains a time-of-day in one format or another, it will
-be used to sort the entry into the time sequence of items for a day.
-Some people have time stamps in the headline that refer to the creation
-time or so, and then this produces an unwanted side effect. If this is
-the case for your, use this variable to turn off searching the headline
-for a time."
- :group 'org-agenda-time-grid
- :type 'boolean)
-
-(defcustom org-agenda-use-time-grid t
- "Non-nil means show a time grid in the agenda schedule.
-A time grid is a set of lines for specific times (like every two hours between
-8:00 and 20:00). The items scheduled for a day at specific times are
-sorted in between these lines.
-For details about when the grid will be shown, and what it will look like, see
-the variable `org-agenda-time-grid'."
- :group 'org-agenda-time-grid
- :type 'boolean)
-
-(defcustom org-agenda-time-grid
- '((daily today require-timed)
- "----------------"
- (800 1000 1200 1400 1600 1800 2000))
-
- "The settings for time grid for agenda display.
-This is a list of three items. The first item is again a list. It contains
-symbols specifying conditions when the grid should be displayed:
-
- daily if the agenda shows a single day
- weekly if the agenda shows an entire week
- today show grid on current date, independent of daily/weekly display
- require-timed show grid only if at least one item has a time specification
-
-The second item is a string which will be placed behind the grid time.
-
-The third item is a list of integers, indicating the times that should have
-a grid line."
- :group 'org-agenda-time-grid
- :type
- '(list
- (set :greedy t :tag "Grid Display Options"
- (const :tag "Show grid in single day agenda display" daily)
- (const :tag "Show grid in weekly agenda display" weekly)
- (const :tag "Always show grid for today" today)
- (const :tag "Show grid only if any timed entries are present"
- require-timed)
- (const :tag "Skip grid times already present in an entry"
- remove-match))
- (string :tag "Grid String")
- (repeat :tag "Grid Times" (integer :tag "Time"))))
-
-(defgroup org-agenda-sorting nil
- "Options concerning sorting in the Org-mode Agenda."
- :tag "Org Agenda Sorting"
- :group 'org-agenda)
-
-(defcustom org-agenda-sorting-strategy
- '((agenda habit-down time-up priority-down category-keep)
- (todo priority-down category-keep)
- (tags priority-down category-keep)
- (search category-keep))
- "Sorting structure for the agenda items of a single day.
-This is a list of symbols which will be used in sequence to determine
-if an entry should be listed before another entry. The following
-symbols are recognized:
-
-time-up Put entries with time-of-day indications first, early first
-time-down Put entries with time-of-day indications first, late first
-category-keep Keep the default order of categories, corresponding to the
- sequence in `org-agenda-files'.
-category-up Sort alphabetically by category, A-Z.
-category-down Sort alphabetically by category, Z-A.
-tag-up Sort alphabetically by last tag, A-Z.
-tag-down Sort alphabetically by last tag, Z-A.
-priority-up Sort numerically by priority, high priority last.
-priority-down Sort numerically by priority, high priority first.
-todo-state-up Sort by todo state, tasks that are done last.
-todo-state-down Sort by todo state, tasks that are done first.
-effort-up Sort numerically by estimated effort, high effort last.
-effort-down Sort numerically by estimated effort, high effort first.
-user-defined-up Sort according to `org-agenda-cmp-user-defined', high last.
-user-defined-down Sort according to `org-agenda-cmp-user-defined', high first.
-habit-up Put entries that are habits first
-habit-down Put entries that are habits last
-alpha-up Sort headlines alphabetically
-alpha-down Sort headlines alphabetically, reversed
-
-The different possibilities will be tried in sequence, and testing stops
-if one comparison returns a \"not-equal\". For example, the default
- '(time-up category-keep priority-down)
-means: Pull out all entries having a specified time of day and sort them,
-in order to make a time schedule for the current day the first thing in the
-agenda listing for the day. Of the entries without a time indication, keep
-the grouped in categories, don't sort the categories, but keep them in
-the sequence given in `org-agenda-files'. Within each category sort by
-priority.
-
-Leaving out `category-keep' would mean that items will be sorted across
-categories by priority.
-
-Instead of a single list, this can also be a set of list for specific
-contents, with a context symbol in the car of the list, any of
-`agenda', `todo', `tags', `search' for the corresponding agenda views.
-
-Custom commands can bind this variable in the options section."
- :group 'org-agenda-sorting
- :type `(choice
- (repeat :tag "General" ,org-sorting-choice)
- (list :tag "Individually"
- (cons (const :tag "Strategy for Weekly/Daily agenda" agenda)
- (repeat ,org-sorting-choice))
- (cons (const :tag "Strategy for TODO lists" todo)
- (repeat ,org-sorting-choice))
- (cons (const :tag "Strategy for Tags matches" tags)
- (repeat ,org-sorting-choice))
- (cons (const :tag "Strategy for search matches" search)
- (repeat ,org-sorting-choice)))))
-
-(defcustom org-agenda-cmp-user-defined nil
- "A function to define the comparison `user-defined'.
-This function must receive two arguments, agenda entry a and b.
-If a>b, return +1. If a<b, return -1. If they are equal as seen by
-the user comparison, return nil.
-When this is defined, you can make `user-defined-up' and `user-defined-down'
-part of an agenda sorting strategy."
- :group 'org-agenda-sorting
- :type 'symbol)
-
-(defcustom org-sort-agenda-notime-is-late t
- "Non-nil means items without time are considered late.
-This is only relevant for sorting. When t, items which have no explicit
-time like 15:30 will be considered as 99:01, i.e. later than any items which
-do have a time. When nil, the default time is before 0:00. You can use this
-option to decide if the schedule for today should come before or after timeless
-agenda entries."
- :group 'org-agenda-sorting
- :type 'boolean)
-
-(defcustom org-sort-agenda-noeffort-is-high t
- "Non-nil means items without effort estimate are sorted as high effort.
-This also applies when filtering an agenda view with respect to the
-< or > effort operator. Then, tasks with no effort defined will be treated
-as tasks with high effort.
-When nil, such items are sorted as 0 minutes effort."
- :group 'org-agenda-sorting
- :type 'boolean)
-
-(defgroup org-agenda-line-format nil
- "Options concerning the entry prefix in the Org-mode agenda display."
- :tag "Org Agenda Line Format"
- :group 'org-agenda)
-
-(defcustom org-agenda-prefix-format
- '((agenda . " %i %-12:c%?-12t% s")
- (timeline . " % s")
- (todo . " %i %-12:c")
- (tags . " %i %-12:c")
- (search . " %i %-12:c"))
- "Format specifications for the prefix of items in the agenda views.
-An alist with four entries, for the different agenda types. The keys to the
-sublists are `agenda', `timeline', `todo', and `tags'. The values
-are format strings.
-This format works similar to a printf format, with the following meaning:
-
- %c the category of the item, \"Diary\" for entries from the diary, or
- as given by the CATEGORY keyword or derived from the file name.
- %i the icon category of the item, as give in
- `org-agenda-category-icon-alist'.
- %T the *last* tag of the item. Last because inherited tags come
- first in the list.
- %t the time-of-day specification if one applies to the entry, in the
- format HH:MM
- %s Scheduling/Deadline information, a short string
-
-All specifiers work basically like the standard `%s' of printf, but may
-contain two additional characters: A question mark just after the `%' and
-a whitespace/punctuation character just before the final letter.
-
-If the first character after `%' is a question mark, the entire field
-will only be included if the corresponding value applies to the
-current entry. This is useful for fields which should have fixed
-width when present, but zero width when absent. For example,
-\"%?-12t\" will result in a 12 character time field if a time of the
-day is specified, but will completely disappear in entries which do
-not contain a time.
-
-If there is punctuation or whitespace character just before the final
-format letter, this character will be appended to the field value if
-the value is not empty. For example, the format \"%-12:c\" leads to
-\"Diary: \" if the category is \"Diary\". If the category were be
-empty, no additional colon would be inserted.
-
-The default value of this option is \" %-12:c%?-12t% s\", meaning:
-- Indent the line with two space characters
-- Give the category in a 12 chars wide field, padded with whitespace on
- the right (because of `-'). Append a colon if there is a category
- (because of `:').
-- If there is a time-of-day, put it into a 12 chars wide field. If no
- time, don't put in an empty field, just skip it (because of '?').
-- Finally, put the scheduling information and append a whitespace.
-
-As another example, if you don't want the time-of-day of entries in
-the prefix, you could use:
-
- (setq org-agenda-prefix-format \" %-11:c% s\")
-
-See also the variables `org-agenda-remove-times-when-in-prefix' and
-`org-agenda-remove-tags'.
-
-Custom commands can set this variable in the options section."
- :type '(choice
- (string :tag "General format")
- (list :greedy t :tag "View dependent"
- (cons (const agenda) (string :tag "Format"))
- (cons (const timeline) (string :tag "Format"))
- (cons (const todo) (string :tag "Format"))
- (cons (const tags) (string :tag "Format"))
- (cons (const search) (string :tag "Format"))))
- :group 'org-agenda-line-format)
-
-(defvar org-prefix-format-compiled nil
- "The compiled version of the most recently used prefix format.
-See the variable `org-agenda-prefix-format'.")
-
-(defcustom org-agenda-todo-keyword-format "%-1s"
- "Format for the TODO keyword in agenda lines.
-Set this to something like \"%-12s\" if you want all TODO keywords
-to occupy a fixed space in the agenda display."
- :group 'org-agenda-line-format
- :type 'string)
-
-(defcustom org-agenda-timerange-leaders '("" "(%d/%d): ")
- "Text preceding timerange entries in the agenda view.
-This is a list with two strings. The first applies when the range
-is entirely on one day. The second applies if the range spans several days.
-The strings may have two \"%d\" format specifiers which will be filled
-with the sequence number of the days, and the total number of days in the
-range, respectively."
- :group 'org-agenda-line-format
- :type '(list
- (string :tag "Deadline today ")
- (choice :tag "Deadline relative"
- (string :tag "Format string")
- (function))))
-
-(defcustom org-agenda-scheduled-leaders '("Scheduled: " "Sched.%2dx: ")
- "Text preceding scheduled items in the agenda view.
-This is a list with two strings. The first applies when the item is
-scheduled on the current day. The second applies when it has been scheduled
-previously, it may contain a %d indicating that this is the nth time that
-this item is scheduled, due to automatic rescheduling of unfinished items
-for the following day. So this number is one larger than the number of days
-that passed since this item was scheduled first."
- :group 'org-agenda-line-format
- :type '(list
- (string :tag "Scheduled today ")
- (string :tag "Scheduled previously")))
-
-(defcustom org-agenda-inactive-leader "["
- "Text preceding item pulled into the agenda by inactive time stamps.
-These entries are added to the agenda when pressing \"[\"."
- :group 'org-agenda-line-format
- :type '(list
- (string :tag "Scheduled today ")
- (string :tag "Scheduled previously")))
-
-(defcustom org-agenda-deadline-leaders '("Deadline: " "In %3d d.: ")
- "Text preceding deadline items in the agenda view.
-This is a list with two strings. The first applies when the item has its
-deadline on the current day. The second applies when it is in the past or
-in the future, it may contain %d to capture how many days away the deadline
-is (was)."
- :group 'org-agenda-line-format
- :type '(list
- (string :tag "Deadline today ")
- (choice :tag "Deadline relative"
- (string :tag "Format string")
- (function))))
-
-(defcustom org-agenda-remove-times-when-in-prefix t
- "Non-nil means remove duplicate time specifications in agenda items.
-When the format `org-agenda-prefix-format' contains a `%t' specifier, a
-time-of-day specification in a headline or diary entry is extracted and
-placed into the prefix. If this option is non-nil, the original specification
-\(a timestamp or -range, or just a plain time(range) specification like
-11:30-4pm) will be removed for agenda display. This makes the agenda less
-cluttered.
-The option can be t or nil. It may also be the symbol `beg', indicating
-that the time should only be removed when it is located at the beginning of
-the headline/diary entry."
- :group 'org-agenda-line-format
- :type '(choice
- (const :tag "Always" t)
- (const :tag "Never" nil)
- (const :tag "When at beginning of entry" beg)))
-
-(defcustom org-agenda-remove-timeranges-from-blocks nil
- "Non-nil means remove time ranges specifications in agenda
-items that span on several days."
- :group 'org-agenda-line-format
- :type 'boolean)
-
-(defcustom org-agenda-default-appointment-duration nil
- "Default duration for appointments that only have a starting time.
-When nil, no duration is specified in such cases.
-When non-nil, this must be the number of minutes, e.g. 60 for one hour."
- :group 'org-agenda-line-format
- :type '(choice
- (integer :tag "Minutes")
- (const :tag "No default duration")))
-
-(defcustom org-agenda-show-inherited-tags t
- "Non-nil means show inherited tags in each agenda line."
- :group 'org-agenda-line-format
- :type 'boolean)
-
-(defcustom org-agenda-hide-tags-regexp nil
- "Regular expression used to filter away specific tags in agenda views.
-This means that these tags will be present, but not be shown in the agenda
-line. Secondary filtering will still work on the hidden tags.
-Nil means don't hide any tags."
- :group 'org-agenda-line-format
- :type '(choice
- (const :tag "Hide none" nil)
- (string :tag "Regexp ")))
-
-(defcustom org-agenda-remove-tags nil
- "Non-nil means remove the tags from the headline copy in the agenda.
-When this is the symbol `prefix', only remove tags when
-`org-agenda-prefix-format' contains a `%T' specifier."
- :group 'org-agenda-line-format
- :type '(choice
- (const :tag "Always" t)
- (const :tag "Never" nil)
- (const :tag "When prefix format contains %T" prefix)))
-
-(if (fboundp 'defvaralias)
- (defvaralias 'org-agenda-remove-tags-when-in-prefix
- 'org-agenda-remove-tags))
-
-(defcustom org-agenda-tags-column (if (featurep 'xemacs) -79 -80)
- "Shift tags in agenda items to this column.
-If this number is positive, it specifies the column. If it is negative,
-it means that the tags should be flushright to that column. For example,
--80 works well for a normal 80 character screen."
- :group 'org-agenda-line-format
- :type 'integer)
-
-(if (fboundp 'defvaralias)
- (defvaralias 'org-agenda-align-tags-to-column 'org-agenda-tags-column))
-
-(defcustom org-agenda-fontify-priorities 'cookies
- "Non-nil means highlight low and high priorities in agenda.
-When t, the highest priority entries are bold, lowest priority italic.
-However, settings in `org-priority-faces' will overrule these faces.
-When this variable is the symbol `cookies', only fontify the
-cookies, not the entire task.
-This may also be an association list of priority faces, whose
-keys are the character values of `org-highest-priority',
-`org-default-priority', and `org-lowest-priority' (the default values
-are ?A, ?B, and ?C, respectively). The face may be a named face, a
-color as a string, or a list like `(:background \"Red\")'.
-If it is a color, the variable `org-faces-easy-properties'
-determines if it is a foreground or a background color."
- :group 'org-agenda-line-format
- :type '(choice
- (const :tag "Never" nil)
- (const :tag "Defaults" t)
- (const :tag "Cookies only" cookies)
- (repeat :tag "Specify"
- (list (character :tag "Priority" :value ?A)
- (choice :tag "Face "
- (string :tag "Color")
- (sexp :tag "Face"))))))
-
-(defcustom org-agenda-day-face-function nil
- "Function called to determine what face should be used to display a day.
-The only argument passed to that function is the day. It should
-returns a face, or nil if does not want to specify a face and let
-the normal rules apply."
- :group 'org-agenda-line-format
- :type 'function)
-
-(defcustom org-agenda-category-icon-alist nil
- "Alist of category icon to be displayed in agenda views.
-
-Each entry should have the following format:
-
- (CATEGORY-REGEXP FILE-OR-DATA TYPE DATA-P PROPS)
-
-Where CATEGORY-REGEXP is a regexp matching the categories where
-the icon should be displayed.
-FILE-OR-DATA either a file path or a string containing image data.
-
-The other fields can be ommited safely if not needed:
-TYPE indicates the image type.
-DATA-P is a boolean indicating whether the FILE-OR-DATA string is
-image data.
-PROPS are additional image attributes to assign to the image,
-like, e.g. `:ascent center'.
-
- (\"Org\" \"/path/to/icon.png\" nil nil :ascent center)
-
-If you want to set the display properties yourself, just put a
-list as second element:
-
- (CATEGORY-REGEXP (MY PROPERTY LIST))
-
-For example, to display a 16px horizontal space for Emacs
-category, you can use:
-
- (\"Emacs\" '(space . (:width (16))))"
- :group 'org-agenda-line-format
- :type '(alist :key-type (string :tag "Regexp matching category")
- :value-type (choice (list :tag "Icon"
- (string :tag "File or data")
- (symbol :tag "Type")
- (boolean :tag "Data?")
- (repeat :tag "Extra image properties" :inline t symbol))
- (list :tag "Display properties" sexp))))
-
-(defgroup org-agenda-column-view nil
- "Options concerning column view in the agenda."
- :tag "Org Agenda Column View"
- :group 'org-agenda)
-
-(defcustom org-agenda-columns-show-summaries t
- "Non-nil means show summaries for columns displayed in the agenda view."
- :group 'org-agenda-column-view
- :type 'boolean)
-
-(defcustom org-agenda-columns-remove-prefix-from-item t
- "Non-nil means remove the prefix from a headline for agenda column view.
-The special ITEM field in the columns format contains the current line, with
-all information shown in other columns (like the TODO state or a tag).
-When this variable is non-nil, also the agenda prefix will be removed from
-the content of the ITEM field, to make sure as much as possible of the
-headline can be shown in the limited width of the field."
- :group 'org-agenda
- :type 'boolean)
-
-(defcustom org-agenda-columns-compute-summary-properties t
- "Non-nil means recompute all summary properties before column view.
-When column view in the agenda is listing properties that have a summary
-operator, it can go to all relevant buffers and recompute the summaries
-there. This can mean overhead for the agenda column view, but is necessary
-to have thing up to date.
-As a special case, a CLOCKSUM property also makes sure that the clock
-computations are current."
- :group 'org-agenda-column-view
- :type 'boolean)
-
-(defcustom org-agenda-columns-add-appointments-to-effort-sum nil
- "Non-nil means the duration of an appointment will add to day effort.
-The property to which appointment durations will be added is the one given
-in the option `org-effort-property'. If an appointment does not have
-an end time, `org-agenda-default-appointment-duration' will be used. If that
-is not set, an appointment without end time will not contribute to the time
-estimate."
- :group 'org-agenda-column-view
- :type 'boolean)
-
-(defcustom org-agenda-auto-exclude-function nil
- "A function called with a tag to decide if it is filtered on '/ RET'.
-The sole argument to the function, which is called once for each
-possible tag, is a string giving the name of the tag. The
-function should return either nil if the tag should be included
-as normal, or \"-<TAG>\" to exclude the tag.
-Note that for the purpose of tag filtering, only the lower-case version of
-all tags will be considered, so that this function will only ever see
-the lower-case version of all tags."
- :group 'org-agenda
- :type 'function)
-
-(eval-when-compile
- (require 'cl))
-(require 'org)
-
-(defmacro org-agenda-with-point-at-orig-entry (string &rest body)
- "Execute BODY with point at location given by `org-hd-marker' property.
-If STRING is non-nil, the text property will be fetched from position 0
-in that string. If STRING is nil, it will be fetched from the beginning
-of the current line."
- `(let ((marker (get-text-property (if string 0 (point-at-bol))
- 'org-hd-marker string)))
- (with-current-buffer (marker-buffer marker)
- (save-excursion
- (goto-char marker)
- ,@body))))
-
-(defun org-add-agenda-custom-command (entry)
- "Replace or add a command in `org-agenda-custom-commands'.
-This is mostly for hacking and trying a new command - once the command
-works you probably want to add it to `org-agenda-custom-commands' for good."
- (let ((ass (assoc (car entry) org-agenda-custom-commands)))
- (if ass
- (setcdr ass (cdr entry))
- (push entry org-agenda-custom-commands))))
-
-;;; Define the Org-agenda-mode
-
-(defvar org-agenda-mode-map (make-sparse-keymap)
- "Keymap for `org-agenda-mode'.")
-(if (fboundp 'defvaralias)
- (defvaralias 'org-agenda-keymap 'org-agenda-mode-map))
-
-(defvar org-agenda-menu) ; defined later in this file.
-(defvar org-agenda-restrict) ; defined later in this file.
-(defvar org-agenda-follow-mode nil)
-(defvar org-agenda-entry-text-mode nil)
-(defvar org-agenda-clockreport-mode nil)
-(defvar org-agenda-show-log nil)
-(defvar org-agenda-redo-command nil)
-(defvar org-agenda-query-string nil)
-(defvar org-agenda-mode-hook nil
- "Hook for `org-agenda-mode', run after the mode is turned on.")
-(defvar org-agenda-type nil)
-(defvar org-agenda-force-single-file nil)
-(defvar org-agenda-bulk-marked-entries) ;; Defined further down in this file
-
-(defun org-agenda-mode ()
- "Mode for time-sorted view on action items in Org-mode files.
-
-The following commands are available:
-
-\\{org-agenda-mode-map}"
- (interactive)
- (kill-all-local-variables)
- (setq org-agenda-undo-list nil
- org-agenda-pending-undo-list nil
- org-agenda-bulk-marked-entries nil)
- (setq major-mode 'org-agenda-mode)
- ;; Keep global-font-lock-mode from turning on font-lock-mode
- (org-set-local 'font-lock-global-modes (list 'not major-mode))
- (setq mode-name "Org-Agenda")
- (use-local-map org-agenda-mode-map)
- (easy-menu-add org-agenda-menu)
- (if org-startup-truncated (setq truncate-lines t))
- (org-set-local 'line-move-visual nil)
- (org-add-hook 'post-command-hook 'org-agenda-post-command-hook nil 'local)
- (org-add-hook 'pre-command-hook 'org-unhighlight nil 'local)
- ;; Make sure properties are removed when copying text
- (when (boundp 'buffer-substring-filters)
- (org-set-local 'buffer-substring-filters
- (cons (lambda (x)
- (set-text-properties 0 (length x) nil x) x)
- buffer-substring-filters)))
- (unless org-agenda-keep-modes
- (setq org-agenda-follow-mode org-agenda-start-with-follow-mode
- org-agenda-entry-text-mode org-agenda-start-with-entry-text-mode
- org-agenda-clockreport-mode org-agenda-start-with-clockreport-mode
- org-agenda-show-log org-agenda-start-with-log-mode))
-
- (easy-menu-change
- '("Agenda") "Agenda Files"
- (append
- (list
- (vector
- (if (get 'org-agenda-files 'org-restrict)
- "Restricted to single file"
- "Edit File List")
- '(org-edit-agenda-file-list)
- (not (get 'org-agenda-files 'org-restrict)))
- "--")
- (mapcar 'org-file-menu-entry (org-agenda-files))))
- (org-agenda-set-mode-name)
- (apply
- (if (fboundp 'run-mode-hooks) 'run-mode-hooks 'run-hooks)
- (list 'org-agenda-mode-hook)))
-
-(substitute-key-definition 'undo 'org-agenda-undo
- org-agenda-mode-map global-map)
-(org-defkey org-agenda-mode-map "\C-i" 'org-agenda-goto)
-(org-defkey org-agenda-mode-map [(tab)] 'org-agenda-goto)
-(org-defkey org-agenda-mode-map "\C-m" 'org-agenda-switch-to)
-(org-defkey org-agenda-mode-map "\C-k" 'org-agenda-kill)
-(org-defkey org-agenda-mode-map "\C-c\C-w" 'org-agenda-refile)
-(org-defkey org-agenda-mode-map "m" 'org-agenda-bulk-mark)
-(org-defkey org-agenda-mode-map "u" 'org-agenda-bulk-unmark)
-(org-defkey org-agenda-mode-map "U" 'org-agenda-bulk-remove-all-marks)
-(org-defkey org-agenda-mode-map "B" 'org-agenda-bulk-action)
-(org-defkey org-agenda-mode-map "\C-c\C-x!" 'org-reload)
-(org-defkey org-agenda-mode-map "\C-c\C-x\C-a" 'org-agenda-archive-default)
-(org-defkey org-agenda-mode-map "\C-c\C-xa" 'org-agenda-toggle-archive-tag)
-(org-defkey org-agenda-mode-map "\C-c\C-xA" 'org-agenda-archive-to-archive-sibling)
-(org-defkey org-agenda-mode-map "\C-c\C-x\C-s" 'org-agenda-archive)
-(org-defkey org-agenda-mode-map "\C-c$" 'org-agenda-archive)
-(org-defkey org-agenda-mode-map "$" 'org-agenda-archive)
-(org-defkey org-agenda-mode-map "\C-c\C-o" 'org-agenda-open-link)
-(org-defkey org-agenda-mode-map " " 'org-agenda-show-and-scroll-up)
-(org-defkey org-agenda-mode-map [backspace] 'org-agenda-show-scroll-down)
-(org-defkey org-agenda-mode-map "\d" 'org-agenda-show-scroll-down)
-(org-defkey org-agenda-mode-map [(control shift right)] 'org-agenda-todo-nextset)
-(org-defkey org-agenda-mode-map [(control shift left)] 'org-agenda-todo-previousset)
-(org-defkey org-agenda-mode-map "\C-c\C-xb" 'org-agenda-tree-to-indirect-buffer)
-(org-defkey org-agenda-mode-map "o" 'delete-other-windows)
-(org-defkey org-agenda-mode-map "L" 'org-agenda-recenter)
-(org-defkey org-agenda-mode-map "\C-c\C-t" 'org-agenda-todo)
-(org-defkey org-agenda-mode-map "t" 'org-agenda-todo)
-(org-defkey org-agenda-mode-map "a" 'org-agenda-archive-default-with-confirmation)
-(org-defkey org-agenda-mode-map ":" 'org-agenda-set-tags)
-(org-defkey org-agenda-mode-map "\C-c\C-q" 'org-agenda-set-tags)
-(org-defkey org-agenda-mode-map "." 'org-agenda-goto-today)
-(org-defkey org-agenda-mode-map "j" 'org-agenda-goto-date)
-(org-defkey org-agenda-mode-map "d" 'org-agenda-day-view)
-(org-defkey org-agenda-mode-map "w" 'org-agenda-week-view)
-(org-defkey org-agenda-mode-map "y" 'org-agenda-year-view)
-(org-defkey org-agenda-mode-map "\C-c\C-z" 'org-agenda-add-note)
-(org-defkey org-agenda-mode-map "z" 'org-agenda-add-note)
-(org-defkey org-agenda-mode-map "k" 'org-agenda-action)
-(org-defkey org-agenda-mode-map "\C-c\C-x\C-k" 'org-agenda-action)
-(org-defkey org-agenda-mode-map [(shift right)] 'org-agenda-do-date-later)
-(org-defkey org-agenda-mode-map [(shift left)] 'org-agenda-do-date-earlier)
-(org-defkey org-agenda-mode-map [?\C-c ?\C-x (right)] 'org-agenda-do-date-later)
-(org-defkey org-agenda-mode-map [?\C-c ?\C-x (left)] 'org-agenda-do-date-earlier)
-
-(org-defkey org-agenda-mode-map ">" 'org-agenda-date-prompt)
-(org-defkey org-agenda-mode-map "\C-c\C-s" 'org-agenda-schedule)
-(org-defkey org-agenda-mode-map "\C-c\C-d" 'org-agenda-deadline)
-(let ((l '(1 2 3 4 5 6 7 8 9 0)))
- (while l (org-defkey org-agenda-mode-map
- (int-to-string (pop l)) 'digit-argument)))
-
-(org-defkey org-agenda-mode-map "F" 'org-agenda-follow-mode)
-(org-defkey org-agenda-mode-map "R" 'org-agenda-clockreport-mode)
-(org-defkey org-agenda-mode-map "E" 'org-agenda-entry-text-mode)
-(org-defkey org-agenda-mode-map "l" 'org-agenda-log-mode)
-(org-defkey org-agenda-mode-map "v" 'org-agenda-view-mode-dispatch)
-(org-defkey org-agenda-mode-map "D" 'org-agenda-toggle-diary)
-(org-defkey org-agenda-mode-map "!" 'org-agenda-toggle-deadlines)
-(org-defkey org-agenda-mode-map "G" 'org-agenda-toggle-time-grid)
-(org-defkey org-agenda-mode-map "r" 'org-agenda-redo)
-(org-defkey org-agenda-mode-map "g" 'org-agenda-redo)
-(org-defkey org-agenda-mode-map "e" 'org-agenda-set-effort)
-(org-defkey org-agenda-mode-map "\C-c\C-xe" 'org-agenda-set-effort)
-(org-defkey org-agenda-mode-map "\C-c\C-x\C-e"
- 'org-clock-modify-effort-estimate)
-(org-defkey org-agenda-mode-map "\C-c\C-xp" 'org-agenda-set-property)
-(org-defkey org-agenda-mode-map "q" 'org-agenda-quit)
-(org-defkey org-agenda-mode-map "x" 'org-agenda-exit)
-(org-defkey org-agenda-mode-map "\C-x\C-w" 'org-write-agenda)
-(org-defkey org-agenda-mode-map "\C-x\C-s" 'org-save-all-org-buffers)
-(org-defkey org-agenda-mode-map "s" 'org-save-all-org-buffers)
-(org-defkey org-agenda-mode-map "P" 'org-agenda-show-priority)
-(org-defkey org-agenda-mode-map "T" 'org-agenda-show-tags)
-(org-defkey org-agenda-mode-map "n" 'org-agenda-next-line)
-(org-defkey org-agenda-mode-map "p" 'org-agenda-previous-line)
-(substitute-key-definition 'next-line 'org-agenda-next-line
- org-agenda-mode-map global-map)
-(substitute-key-definition 'previous-line 'org-agenda-previous-line
- org-agenda-mode-map global-map)
-(org-defkey org-agenda-mode-map "\C-c\C-a" 'org-attach)
-(org-defkey org-agenda-mode-map "\C-c\C-n" 'org-agenda-next-date-line)
-(org-defkey org-agenda-mode-map "\C-c\C-p" 'org-agenda-previous-date-line)
-(org-defkey org-agenda-mode-map "," 'org-agenda-priority)
-(org-defkey org-agenda-mode-map "\C-c," 'org-agenda-priority)
-(org-defkey org-agenda-mode-map "i" 'org-agenda-diary-entry)
-(org-defkey org-agenda-mode-map "c" 'org-agenda-goto-calendar)
-(org-defkey org-agenda-mode-map "C" 'org-agenda-convert-date)
-(org-defkey org-agenda-mode-map "M" 'org-agenda-phases-of-moon)
-(org-defkey org-agenda-mode-map "S" 'org-agenda-sunrise-sunset)
-(org-defkey org-agenda-mode-map "h" 'org-agenda-holidays)
-(org-defkey org-agenda-mode-map "H" 'org-agenda-holidays)
-(org-defkey org-agenda-mode-map "\C-c\C-x\C-i" 'org-agenda-clock-in)
-(org-defkey org-agenda-mode-map "I" 'org-agenda-clock-in)
-(org-defkey org-agenda-mode-map "\C-c\C-x\C-o" 'org-agenda-clock-out)
-(org-defkey org-agenda-mode-map "O" 'org-agenda-clock-out)
-(org-defkey org-agenda-mode-map "\C-c\C-x\C-x" 'org-agenda-clock-cancel)
-(org-defkey org-agenda-mode-map "X" 'org-agenda-clock-cancel)
-(org-defkey org-agenda-mode-map "\C-c\C-x\C-j" 'org-clock-goto)
-(org-defkey org-agenda-mode-map "J" 'org-agenda-clock-goto)
-(org-defkey org-agenda-mode-map "+" 'org-agenda-priority-up)
-(org-defkey org-agenda-mode-map "-" 'org-agenda-priority-down)
-(org-defkey org-agenda-mode-map [(shift up)] 'org-agenda-priority-up)
-(org-defkey org-agenda-mode-map [(shift down)] 'org-agenda-priority-down)
-(org-defkey org-agenda-mode-map [?\C-c ?\C-x (up)] 'org-agenda-priority-up)
-(org-defkey org-agenda-mode-map [?\C-c ?\C-x (down)] 'org-agenda-priority-down)
-(org-defkey org-agenda-mode-map "f" 'org-agenda-later)
-(org-defkey org-agenda-mode-map "b" 'org-agenda-earlier)
-(org-defkey org-agenda-mode-map "\C-c\C-x\C-c" 'org-agenda-columns)
-(org-defkey org-agenda-mode-map "\C-c\C-x>" 'org-agenda-remove-restriction-lock)
-
-(org-defkey org-agenda-mode-map "[" 'org-agenda-manipulate-query-add)
-(org-defkey org-agenda-mode-map "]" 'org-agenda-manipulate-query-subtract)
-(org-defkey org-agenda-mode-map "{" 'org-agenda-manipulate-query-add-re)
-(org-defkey org-agenda-mode-map "}" 'org-agenda-manipulate-query-subtract-re)
-(org-defkey org-agenda-mode-map "/" 'org-agenda-filter-by-tag)
-(org-defkey org-agenda-mode-map "\\" 'org-agenda-filter-by-tag-refine)
-(org-defkey org-agenda-mode-map ";" 'org-timer-set-timer)
-(define-key org-agenda-mode-map "?" 'org-agenda-show-the-flagging-note)
-(org-defkey org-agenda-mode-map "\C-c\C-x\C-mg" 'org-mobile-pull)
-(org-defkey org-agenda-mode-map "\C-c\C-x\C-mp" 'org-mobile-push)
-
-(org-defkey org-agenda-mode-map [mouse-2] 'org-agenda-goto-mouse)
-(org-defkey org-agenda-mode-map [mouse-3] 'org-agenda-show-mouse)
-(when org-agenda-mouse-1-follows-link
- (org-defkey org-agenda-mode-map [follow-link] 'mouse-face))
-(easy-menu-define org-agenda-menu org-agenda-mode-map "Agenda menu"
- '("Agenda"
- ("Agenda Files")
- "--"
- ("Agenda Dates"
- ["Goto Today" org-agenda-goto-today (org-agenda-check-type nil 'agenda 'timeline)]
- ["Next Dates" org-agenda-later (org-agenda-check-type nil 'agenda)]
- ["Previous Dates" org-agenda-earlier (org-agenda-check-type nil 'agenda)]
- ["Jump to date" org-agenda-goto-date (org-agenda-check-type nil 'agenda)])
- "--"
- ("View"
- ["Day View" org-agenda-day-view
- :active (org-agenda-check-type nil 'agenda)
- :style radio :selected (eq org-agenda-current-span 'day)
- :keys "v d (or just d)"]
- ["Week View" org-agenda-week-view
- :active (org-agenda-check-type nil 'agenda)
- :style radio :selected (eq org-agenda-current-span 'week)
- :keys "v w (or just w)"]
- ["Month View" org-agenda-month-view
- :active (org-agenda-check-type nil 'agenda)
- :style radio :selected (eq org-agenda-current-span 'month)
- :keys "v m"]
- ["Year View" org-agenda-year-view
- :active (org-agenda-check-type nil 'agenda)
- :style radio :selected (eq org-agenda-current-span 'year)
- :keys "v y"]
- "--"
- ["Include Diary" org-agenda-toggle-diary
- :style toggle :selected org-agenda-include-diary
- :active (org-agenda-check-type nil 'agenda)]
- ["Include Deadlines" org-agenda-toggle-deadlines
- :style toggle :selected org-agenda-include-deadlines
- :active (org-agenda-check-type nil 'agenda)]
- ["Use Time Grid" org-agenda-toggle-time-grid
- :style toggle :selected org-agenda-use-time-grid
- :active (org-agenda-check-type nil 'agenda)]
- "--"
- ["Show clock report" org-agenda-clockreport-mode
- :style toggle :selected org-agenda-clockreport-mode
- :active (org-agenda-check-type nil 'agenda)]
- ["Show some entry text" org-agenda-entry-text-mode
- :style toggle :selected org-agenda-entry-text-mode
- :active t]
- "--"
- ["Show Logbook entries" org-agenda-log-mode
- :style toggle :selected org-agenda-show-log
- :active (org-agenda-check-type nil 'agenda 'timeline)
- :keys "v l (or just l)"]
- ["Include archived trees" org-agenda-archives-mode
- :style toggle :selected org-agenda-archives-mode :active t
- :keys "v a"]
- ["Include archive files" (org-agenda-archives-mode t)
- :style toggle :selected (eq org-agenda-archives-mode t) :active t
- :keys "v A"]
- "--"
- ["Remove Restriction" org-agenda-remove-restriction-lock org-agenda-restrict])
- ["Write view to file" org-write-agenda t]
- ["Rebuild buffer" org-agenda-redo t]
- ["Save all Org-mode Buffers" org-save-all-org-buffers t]
- "--"
- ["Show original entry" org-agenda-show t]
- ["Go To (other window)" org-agenda-goto t]
- ["Go To (this window)" org-agenda-switch-to t]
- ["Follow Mode" org-agenda-follow-mode
- :style toggle :selected org-agenda-follow-mode :active t]
-; ["Tree to indirect frame" org-agenda-tree-to-indirect-buffer t]
- "--"
- ("TODO"
- ["Cycle TODO" org-agenda-todo t]
- ["Next TODO set" org-agenda-todo-nextset t]
- ["Previous TODO set" org-agenda-todo-previousset t]
- ["Add note" org-agenda-add-note t])
- ("Archive/Refile/Delete"
- ["Archive default" org-agenda-archive-default t]
- ["Archive default" org-agenda-archive-default-with-confirmation t]
- ["Toggle ARCHIVE tag" org-agenda-toggle-archive-tag t]
- ["Move to archive sibling" org-agenda-archive-to-archive-sibling t]
- ["Archive subtree" org-agenda-archive t]
- "--"
- ["Refile" org-agenda-refile t]
- "--"
- ["Delete subtree" org-agenda-kill t])
- ("Bulk action"
- ["Mark entry" org-agenda-bulk-mark t]
- ["Unmark entry" org-agenda-bulk-unmark t]
- ["Act on all marked" org-agenda-bulk-action t]
- ["Unmark all entries" org-agenda-bulk-remove-all-marks :active t :keys "C-u s"])
- "--"
- ("Tags and Properties"
- ["Show all Tags" org-agenda-show-tags t]
- ["Set Tags current line" org-agenda-set-tags (not (org-region-active-p))]
- ["Change tag in region" org-agenda-set-tags (org-region-active-p)]
- "--"
- ["Column View" org-columns t])
- ("Deadline/Schedule"
- ["Schedule" org-agenda-schedule t]
- ["Set Deadline" org-agenda-deadline t]
- "--"
- ["Mark item" org-agenda-action :active t :keys "k m"]
- ["Show mark item" org-agenda-action :active t :keys "k v"]
- ["Schedule marked item" org-agenda-action :active t :keys "k s"]
- ["Set Deadline for marked item" org-agenda-action :active t :keys "k d"]
- "--"
- ["Change Date +1 day" org-agenda-date-later (org-agenda-check-type nil 'agenda 'timeline)]
- ["Change Date -1 day" org-agenda-date-earlier (org-agenda-check-type nil 'agenda 'timeline)]
- ["Change Time +1 hour" org-agenda-do-date-later :active (org-agenda-check-type nil 'agenda 'timeline) :keys "C-u S-right"]
- ["Change Time -1 hour" org-agenda-do-date-earlier :active (org-agenda-check-type nil 'agenda 'timeline) :keys "C-u S-left"]
- ["Change Time + min" org-agenda-date-later :active (org-agenda-check-type nil 'agenda 'timeline) :keys "C-u C-u S-right"]
- ["Change Time - min" org-agenda-date-earlier :active (org-agenda-check-type nil 'agenda 'timeline) :keys "C-u C-u S-left"]
- ["Change Date to ..." org-agenda-date-prompt (org-agenda-check-type nil 'agenda 'timeline)])
- ("Clock and Effort"
- ["Clock in" org-agenda-clock-in t]
- ["Clock out" org-agenda-clock-out t]
- ["Clock cancel" org-agenda-clock-cancel t]
- ["Goto running clock" org-clock-goto t]
- "--"
- ["Set Effort" org-agenda-set-effort t]
- ["Change clocked effort" org-clock-modify-effort-estimate
- (org-clock-is-active)])
- ("Priority"
- ["Set Priority" org-agenda-priority t]
- ["Increase Priority" org-agenda-priority-up t]
- ["Decrease Priority" org-agenda-priority-down t]
- ["Show Priority" org-agenda-show-priority t])
- ("Calendar/Diary"
- ["New Diary Entry" org-agenda-diary-entry (org-agenda-check-type nil 'agenda 'timeline)]
- ["Goto Calendar" org-agenda-goto-calendar (org-agenda-check-type nil 'agenda 'timeline)]
- ["Phases of the Moon" org-agenda-phases-of-moon (org-agenda-check-type nil 'agenda 'timeline)]
- ["Sunrise/Sunset" org-agenda-sunrise-sunset (org-agenda-check-type nil 'agenda 'timeline)]
- ["Holidays" org-agenda-holidays (org-agenda-check-type nil 'agenda 'timeline)]
- ["Convert" org-agenda-convert-date (org-agenda-check-type nil 'agenda 'timeline)]
- "--"
- ["Create iCalendar File" org-export-icalendar-combine-agenda-files t])
- "--"
- ["Undo Remote Editing" org-agenda-undo org-agenda-undo-list]
- "--"
- ("MobileOrg"
- ["Push Files and Views" org-mobile-push t]
- ["Get Captured and Flagged" org-mobile-pull t]
- ["Find FLAGGED Tasks" (org-agenda nil "?") :active t :keys "C-c a ?"]
- ["Show note / unflag" org-agenda-show-the-flagging-note t]
- "--"
- ["Setup" (progn (require 'org-mobile) (customize-group 'org-mobile)) t])
- "--"
- ["Quit" org-agenda-quit t]
- ["Exit and Release Buffers" org-agenda-exit t]
- ))
-
-;;; Agenda undo
-
-(defvar org-agenda-allow-remote-undo t
- "Non-nil means allow remote undo from the agenda buffer.")
-(defvar org-agenda-undo-list nil
- "List of undoable operations in the agenda since last refresh.")
-(defvar org-agenda-undo-has-started-in nil
- "Buffers that have already seen `undo-start' in the current undo sequence.")
-(defvar org-agenda-pending-undo-list nil
- "In a series of undo commands, this is the list of remaining undo items.")
-
-
-(defun org-agenda-undo ()
- "Undo a remote editing step in the agenda.
-This undoes changes both in the agenda buffer and in the remote buffer
-that have been changed along."
- (interactive)
- (or org-agenda-allow-remote-undo
- (error "Check the variable `org-agenda-allow-remote-undo' to activate remote undo"))
- (if (not (eq this-command last-command))
- (setq org-agenda-undo-has-started-in nil
- org-agenda-pending-undo-list org-agenda-undo-list))
- (if (not org-agenda-pending-undo-list)
- (error "No further undo information"))
- (let* ((entry (pop org-agenda-pending-undo-list))
- buf line cmd rembuf)
- (setq cmd (pop entry) line (pop entry))
- (setq rembuf (nth 2 entry))
- (org-with-remote-undo rembuf
- (while (bufferp (setq buf (pop entry)))
- (if (pop entry)
- (with-current-buffer buf
- (let ((last-undo-buffer buf)
- (inhibit-read-only t))
- (unless (memq buf org-agenda-undo-has-started-in)
- (push buf org-agenda-undo-has-started-in)
- (make-local-variable 'pending-undo-list)
- (undo-start))
- (while (and pending-undo-list
- (listp pending-undo-list)
- (not (car pending-undo-list)))
- (pop pending-undo-list))
- (undo-more 1))))))
- (org-goto-line line)
- (message "`%s' undone (buffer %s)" cmd (buffer-name rembuf))))
-
-(defun org-verify-change-for-undo (l1 l2)
- "Verify that a real change occurred between the undo lists L1 and L2."
- (while (and l1 (listp l1) (null (car l1))) (pop l1))
- (while (and l2 (listp l2) (null (car l2))) (pop l2))
- (not (eq l1 l2)))
-
-;;; Agenda dispatch
-
-(defvar org-agenda-restrict nil)
-(defvar org-agenda-restrict-begin (make-marker))
-(defvar org-agenda-restrict-end (make-marker))
-(defvar org-agenda-last-dispatch-buffer nil)
-(defvar org-agenda-overriding-restriction nil)
-
-;;;###autoload
-(defun org-agenda (&optional arg keys restriction)
- "Dispatch agenda commands to collect entries to the agenda buffer.
-Prompts for a command to execute. Any prefix arg will be passed
-on to the selected command. The default selections are:
-
-a Call `org-agenda-list' to display the agenda for current day or week.
-t Call `org-todo-list' to display the global todo list.
-T Call `org-todo-list' to display the global todo list, select only
- entries with a specific TODO keyword (the user gets a prompt).
-m Call `org-tags-view' to display headlines with tags matching
- a condition (the user is prompted for the condition).
-M Like `m', but select only TODO entries, no ordinary headlines.
-L Create a timeline for the current buffer.
-e Export views to associated files.
-s Search entries for keywords.
-/ Multi occur across all agenda files and also files listed
- in `org-agenda-text-search-extra-files'.
-< Restrict agenda commands to buffer, subtree, or region.
- Press several times to get the desired effect.
-> Remove a previous restriction.
-# List \"stuck\" projects.
-! Configure what \"stuck\" means.
-C Configure custom agenda commands.
-
-More commands can be added by configuring the variable
-`org-agenda-custom-commands'. In particular, specific tags and TODO keyword
-searches can be pre-defined in this way.
-
-If the current buffer is in Org-mode and visiting a file, you can also
-first press `<' once to indicate that the agenda should be temporarily
-\(until the next use of \\[org-agenda]) restricted to the current file.
-Pressing `<' twice means to restrict to the current subtree or region
-\(if active)."
- (interactive "P")
- (catch 'exit
- (let* ((prefix-descriptions nil)
- (org-agenda-window-setup (if (equal (buffer-name)
- org-agenda-buffer-name)
- 'current-window
- org-agenda-window-setup))
- (org-agenda-custom-commands-orig org-agenda-custom-commands)
- (org-agenda-custom-commands
- ;; normalize different versions
- (delq nil
- (mapcar
- (lambda (x)
- (cond ((stringp (cdr x))
- (push x prefix-descriptions)
- nil)
- ((stringp (nth 1 x)) x)
- ((not (nth 1 x)) (cons (car x) (cons "" (cddr x))))
- (t (cons (car x) (cons "" (cdr x))))))
- org-agenda-custom-commands)))
- (buf (current-buffer))
- (bfn (buffer-file-name (buffer-base-buffer)))
- entry key type match lprops ans)
- ;; Turn off restriction unless there is an overriding one,
- (unless org-agenda-overriding-restriction
- (unless (org-bound-and-true-p org-agenda-keep-restricted-file-list)
- ;; There is a request to keep the file list in place
- (put 'org-agenda-files 'org-restrict nil))
- (setq org-agenda-restrict nil)
- (move-marker org-agenda-restrict-begin nil)
- (move-marker org-agenda-restrict-end nil))
- ;; Delete old local properties
- (put 'org-agenda-redo-command 'org-lprops nil)
- ;; Remember where this call originated
- (setq org-agenda-last-dispatch-buffer (current-buffer))
- (unless keys
- (setq ans (org-agenda-get-restriction-and-command prefix-descriptions)
- keys (car ans)
- restriction (cdr ans)))
- ;; Establish the restriction, if any
- (when (and (not org-agenda-overriding-restriction) restriction)
- (put 'org-agenda-files 'org-restrict (list bfn))
- (cond
- ((eq restriction 'region)
- (setq org-agenda-restrict t)
- (move-marker org-agenda-restrict-begin (region-beginning))
- (move-marker org-agenda-restrict-end (region-end)))
- ((eq restriction 'subtree)
- (save-excursion
- (setq org-agenda-restrict t)
- (org-back-to-heading t)
- (move-marker org-agenda-restrict-begin (point))
- (move-marker org-agenda-restrict-end
- (progn (org-end-of-subtree t)))))))
-
- ;; For example the todo list should not need it (but does...)
- (cond
- ((setq entry (assoc keys org-agenda-custom-commands))
- (if (or (symbolp (nth 2 entry)) (functionp (nth 2 entry)))
- (progn
- (setq type (nth 2 entry) match (eval (nth 3 entry))
- lprops (nth 4 entry))
- (put 'org-agenda-redo-command 'org-lprops lprops)
- (cond
- ((eq type 'agenda)
- (org-let lprops '(org-agenda-list current-prefix-arg)))
- ((eq type 'alltodo)
- (org-let lprops '(org-todo-list current-prefix-arg)))
- ((eq type 'search)
- (org-let lprops '(org-search-view current-prefix-arg match nil)))
- ((eq type 'stuck)
- (org-let lprops '(org-agenda-list-stuck-projects
- current-prefix-arg)))
- ((eq type 'tags)
- (org-let lprops '(org-tags-view current-prefix-arg match)))
- ((eq type 'tags-todo)
- (org-let lprops '(org-tags-view '(4) match)))
- ((eq type 'todo)
- (org-let lprops '(org-todo-list match)))
- ((eq type 'tags-tree)
- (org-check-for-org-mode)
- (org-let lprops '(org-match-sparse-tree current-prefix-arg match)))
- ((eq type 'todo-tree)
- (org-check-for-org-mode)
- (org-let lprops
- '(org-occur (concat "^" outline-regexp "[ \t]*"
- (regexp-quote match) "\\>"))))
- ((eq type 'occur-tree)
- (org-check-for-org-mode)
- (org-let lprops '(org-occur match)))
- ((functionp type)
- (org-let lprops '(funcall type match)))
- ((fboundp type)
- (org-let lprops '(funcall type match)))
- (t (error "Invalid custom agenda command type %s" type))))
- (org-run-agenda-series (nth 1 entry) (cddr entry))))
- ((equal keys "C")
- (setq org-agenda-custom-commands org-agenda-custom-commands-orig)
- (customize-variable 'org-agenda-custom-commands))
- ((equal keys "a") (call-interactively 'org-agenda-list))
- ((equal keys "s") (call-interactively 'org-search-view))
- ((equal keys "t") (call-interactively 'org-todo-list))
- ((equal keys "T") (org-call-with-arg 'org-todo-list (or arg '(4))))
- ((equal keys "m") (call-interactively 'org-tags-view))
- ((equal keys "M") (org-call-with-arg 'org-tags-view (or arg '(4))))
- ((equal keys "e") (call-interactively 'org-store-agenda-views))
- ((equal keys "?") (org-tags-view nil "+FLAGGED")
- (org-add-hook
- 'post-command-hook
- (lambda ()
- (unless (current-message)
- (let* ((m (org-agenda-get-any-marker))
- (note (and m (org-entry-get m "THEFLAGGINGNOTE"))))
- (when note
- (message (concat
- "FLAGGING-NOTE ([?] for more info): "
- (org-add-props
- (replace-regexp-in-string
- "\\\\n" "//"
- (copy-sequence note))
- nil 'face 'org-warning)))))))
- t t))
- ((equal keys "L")
- (unless (org-mode-p)
- (error "This is not an Org-mode file"))
- (unless restriction
- (put 'org-agenda-files 'org-restrict (list bfn))
- (org-call-with-arg 'org-timeline arg)))
- ((equal keys "#") (call-interactively 'org-agenda-list-stuck-projects))
- ((equal keys "/") (call-interactively 'org-occur-in-agenda-files))
- ((equal keys "!") (customize-variable 'org-stuck-projects))
- (t (error "Invalid agenda key"))))))
-
-(defun org-agenda-normalize-custom-commands (cmds)
- (delq nil
- (mapcar
- (lambda (x)
- (cond ((stringp (cdr x)) nil)
- ((stringp (nth 1 x)) x)
- ((not (nth 1 x)) (cons (car x) (cons "" (cddr x))))
- (t (cons (car x) (cons "" (cdr x))))))
- cmds)))
-
-(defun org-agenda-get-restriction-and-command (prefix-descriptions)
- "The user interface for selecting an agenda command."
- (catch 'exit
- (let* ((bfn (buffer-file-name (buffer-base-buffer)))
- (restrict-ok (and bfn (org-mode-p)))
- (region-p (org-region-active-p))
- (custom org-agenda-custom-commands)
- (selstring "")
- restriction second-time
- c entry key type match prefixes rmheader header-end custom1 desc
- line lines left right n n1)
- (save-window-excursion
- (delete-other-windows)
- (org-switch-to-buffer-other-window " *Agenda Commands*")
- (erase-buffer)
- (insert (eval-when-compile
- (let ((header
-"
-Press key for an agenda command: < Buffer, subtree/region restriction
--------------------------------- > Remove restriction
-a Agenda for current week or day e Export agenda views
-t List of all TODO entries T Entries with special TODO kwd
-m Match a TAGS/PROP/TODO query M Like m, but only TODO entries
-L Timeline for current buffer # List stuck projects (!=configure)
-s Search for keywords C Configure custom agenda commands
-/ Multi-occur ? Find :FLAGGED: entries
-")
- (start 0))
- (while (string-match
- "\\(^\\| \\|(\\)\\(\\S-\\)\\( \\|=\\)"
- header start)
- (setq start (match-end 0))
- (add-text-properties (match-beginning 2) (match-end 2)
- '(face bold) header))
- header)))
- (setq header-end (move-marker (make-marker) (point)))
- (while t
- (setq custom1 custom)
- (when (eq rmheader t)
- (org-goto-line 1)
- (re-search-forward ":" nil t)
- (delete-region (match-end 0) (point-at-eol))
- (forward-char 1)
- (looking-at "-+")
- (delete-region (match-end 0) (point-at-eol))
- (move-marker header-end (match-end 0)))
- (goto-char header-end)
- (delete-region (point) (point-max))
-
- ;; Produce all the lines that describe custom commands and prefixes
- (setq lines nil)
- (while (setq entry (pop custom1))
- (setq key (car entry) desc (nth 1 entry)
- type (nth 2 entry)
- match (nth 3 entry))
- (if (> (length key) 1)
- (add-to-list 'prefixes (string-to-char key))
- (setq line
- (format
- "%-4s%-14s"
- (org-add-props (copy-sequence key)
- '(face bold))
- (cond
- ((string-match "\\S-" desc) desc)
- ((eq type 'agenda) "Agenda for current week or day")
- ((eq type 'alltodo) "List of all TODO entries")
- ((eq type 'search) "Word search")
- ((eq type 'stuck) "List of stuck projects")
- ((eq type 'todo) "TODO keyword")
- ((eq type 'tags) "Tags query")
- ((eq type 'tags-todo) "Tags (TODO)")
- ((eq type 'tags-tree) "Tags tree")
- ((eq type 'todo-tree) "TODO kwd tree")
- ((eq type 'occur-tree) "Occur tree")
- ((functionp type) (if (symbolp type)
- (symbol-name type)
- "Lambda expression"))
- (t "???"))))
- (if org-agenda-menu-show-matcher
- (setq line
- (concat line ": "
- (cond
- ((stringp match)
- (setq match (copy-sequence match))
- (org-add-props match nil 'face 'org-warning))
- (match
- (format "set of %d commands" (length match)))
- (t ""))))
- (if (org-string-nw-p match)
- (add-text-properties
- 0 (length line) (list 'help-echo
- (concat "Matcher: "match)) line)))
- (push line lines)))
- (setq lines (nreverse lines))
- (when prefixes
- (mapc (lambda (x)
- (push
- (format "%s %s"
- (org-add-props (char-to-string x)
- nil 'face 'bold)
- (or (cdr (assoc (concat selstring
- (char-to-string x))
- prefix-descriptions))
- "Prefix key"))
- lines))
- prefixes))
-
- ;; Check if we should display in two columns
- (if org-agenda-menu-two-column
- (progn
- (setq n (length lines)
- n1 (+ (/ n 2) (mod n 2))
- right (nthcdr n1 lines)
- left (copy-sequence lines))
- (setcdr (nthcdr (1- n1) left) nil))
- (setq left lines right nil))
- (while left
- (insert "\n" (pop left))
- (when right
- (if (< (current-column) 40)
- (move-to-column 40 t)
- (insert " "))
- (insert (pop right))))
-
- ;; Make the window the right size
- (goto-char (point-min))
- (if second-time
- (if (not (pos-visible-in-window-p (point-max)))
- (org-fit-window-to-buffer))
- (setq second-time t)
- (org-fit-window-to-buffer))
-
- ;; Ask for selection
- (message "Press key for agenda command%s:"
- (if (or restrict-ok org-agenda-overriding-restriction)
- (if org-agenda-overriding-restriction
- " (restriction lock active)"
- (if restriction
- (format " (restricted to %s)" restriction)
- " (unrestricted)"))
- ""))
- (setq c (read-char-exclusive))
- (message "")
- (cond
- ((assoc (char-to-string c) custom)
- (setq selstring (concat selstring (char-to-string c)))
- (throw 'exit (cons selstring restriction)))
- ((memq c prefixes)
- (setq selstring (concat selstring (char-to-string c))
- prefixes nil
- rmheader (or rmheader t)
- custom (delq nil (mapcar
- (lambda (x)
- (if (or (= (length (car x)) 1)
- (/= (string-to-char (car x)) c))
- nil
- (cons (substring (car x) 1) (cdr x))))
- custom))))
- ((and (not restrict-ok) (memq c '(?1 ?0 ?<)))
- (message "Restriction is only possible in Org-mode buffers")
- (ding) (sit-for 1))
- ((eq c ?1)
- (org-agenda-remove-restriction-lock 'noupdate)
- (setq restriction 'buffer))
- ((eq c ?0)
- (org-agenda-remove-restriction-lock 'noupdate)
- (setq restriction (if region-p 'region 'subtree)))
- ((eq c ?<)
- (org-agenda-remove-restriction-lock 'noupdate)
- (setq restriction
- (cond
- ((eq restriction 'buffer)
- (if region-p 'region 'subtree))
- ((memq restriction '(subtree region))
- nil)
- (t 'buffer))))
- ((eq c ?>)
- (org-agenda-remove-restriction-lock 'noupdate)
- (setq restriction nil))
- ((and (equal selstring "") (memq c '(?s ?a ?t ?m ?L ?C ?e ?T ?M ?# ?! ?/ ??)))
- (throw 'exit (cons (setq selstring (char-to-string c)) restriction)))
- ((and (> (length selstring) 0) (eq c ?\d))
- (delete-window)
- (org-agenda-get-restriction-and-command prefix-descriptions))
-
- ((equal c ?q) (error "Abort"))
- (t (error "Invalid key %c" c))))))))
-
-(defun org-run-agenda-series (name series)
- (org-let (nth 1 series) '(org-prepare-agenda name))
- (let* ((org-agenda-multi t)
- (redo (list 'org-run-agenda-series name (list 'quote series)))
- (cmds (car series))
- (gprops (nth 1 series))
- match ;; The byte compiler incorrectly complains about this. Keep it!
- cmd type lprops)
- (while (setq cmd (pop cmds))
- (setq type (car cmd) match (eval (nth 1 cmd)) lprops (nth 2 cmd))
- (cond
- ((eq type 'agenda)
- (org-let2 gprops lprops
- '(call-interactively 'org-agenda-list)))
- ((eq type 'alltodo)
- (org-let2 gprops lprops
- '(call-interactively 'org-todo-list)))
- ((eq type 'search)
- (org-let2 gprops lprops
- '(org-search-view current-prefix-arg match nil)))
- ((eq type 'stuck)
- (org-let2 gprops lprops
- '(call-interactively 'org-agenda-list-stuck-projects)))
- ((eq type 'tags)
- (org-let2 gprops lprops
- '(org-tags-view current-prefix-arg match)))
- ((eq type 'tags-todo)
- (org-let2 gprops lprops
- '(org-tags-view '(4) match)))
- ((eq type 'todo)
- (org-let2 gprops lprops
- '(org-todo-list match)))
- ((fboundp type)
- (org-let2 gprops lprops
- '(funcall type match)))
- (t (error "Invalid type in command series"))))
- (widen)
- (setq org-agenda-redo-command redo)
- (goto-char (point-min)))
- (org-fit-agenda-window)
- (org-let (nth 1 series) '(org-finalize-agenda)))
-
-;;;###autoload
-(defmacro org-batch-agenda (cmd-key &rest parameters)
- "Run an agenda command in batch mode and send the result to STDOUT.
-If CMD-KEY is a string of length 1, it is used as a key in
-`org-agenda-custom-commands' and triggers this command. If it is a
-longer string it is used as a tags/todo match string.
-Parameters are alternating variable names and values that will be bound
-before running the agenda command."
- (let (pars)
- (while parameters
- (push (list (pop parameters) (if parameters (pop parameters))) pars))
- (if (> (length cmd-key) 2)
- (eval (list 'let (nreverse pars)
- (list 'org-tags-view nil cmd-key)))
- (eval (list 'let (nreverse pars) (list 'org-agenda nil cmd-key))))
- (set-buffer org-agenda-buffer-name)
- (princ (org-encode-for-stdout (buffer-string)))))
-
-;(defun org-encode-for-stdout (string)
-; (if (fboundp 'encode-coding-string)
-; (encode-coding-string string buffer-file-coding-system)
-; string))
-
-(defun org-encode-for-stdout (string)
- string)
-
-(defvar org-agenda-info nil)
-
-;;;###autoload
-(defmacro org-batch-agenda-csv (cmd-key &rest parameters)
- "Run an agenda command in batch mode and send the result to STDOUT.
-If CMD-KEY is a string of length 1, it is used as a key in
-`org-agenda-custom-commands' and triggers this command. If it is a
-longer string it is used as a tags/todo match string.
-Parameters are alternating variable names and values that will be bound
-before running the agenda command.
-
-The output gives a line for each selected agenda item. Each
-item is a list of comma-separated values, like this:
-
-category,head,type,todo,tags,date,time,extra,priority-l,priority-n
-
-category The category of the item
-head The headline, without TODO kwd, TAGS and PRIORITY
-type The type of the agenda entry, can be
- todo selected in TODO match
- tagsmatch selected in tags match
- diary imported from diary
- deadline a deadline on given date
- scheduled scheduled on given date
- timestamp entry has timestamp on given date
- closed entry was closed on given date
- upcoming-deadline warning about deadline
- past-scheduled forwarded scheduled item
- block entry has date block including g. date
-todo The todo keyword, if any
-tags All tags including inherited ones, separated by colons
-date The relevant date, like 2007-2-14
-time The time, like 15:00-16:50
-extra Sting with extra planning info
-priority-l The priority letter if any was given
-priority-n The computed numerical priority
-agenda-day The day in the agenda where this is listed"
-
- (let (pars)
- (while parameters
- (push (list (pop parameters) (if parameters (pop parameters))) pars))
- (push (list 'org-agenda-remove-tags t) pars)
- (if (> (length cmd-key) 2)
- (eval (list 'let (nreverse pars)
- (list 'org-tags-view nil cmd-key)))
- (eval (list 'let (nreverse pars) (list 'org-agenda nil cmd-key))))
- (set-buffer org-agenda-buffer-name)
- (let* ((lines (org-split-string (buffer-string) "\n"))
- line)
- (while (setq line (pop lines))
- (catch 'next
- (if (not (get-text-property 0 'org-category line)) (throw 'next nil))
- (setq org-agenda-info
- (org-fix-agenda-info (text-properties-at 0 line)))
- (princ
- (org-encode-for-stdout
- (mapconcat 'org-agenda-export-csv-mapper
- '(org-category txt type todo tags date time extra
- priority-letter priority agenda-day)
- ",")))
- (princ "\n"))))))
-
-(defun org-fix-agenda-info (props)
- "Make sure all properties on an agenda item have a canonical form.
-This ensures the export commands can easily use it."
- (let (tmp re)
- (when (setq tmp (plist-get props 'tags))
- (setq props (plist-put props 'tags (mapconcat 'identity tmp ":"))))
- (when (setq tmp (plist-get props 'date))
- (if (integerp tmp) (setq tmp (calendar-gregorian-from-absolute tmp)))
- (let ((calendar-date-display-form '(year "-" month "-" day)))
- '((format "%4d, %9s %2s, %4s" dayname monthname day year))
-
- (setq tmp (calendar-date-string tmp)))
- (setq props (plist-put props 'date tmp)))
- (when (setq tmp (plist-get props 'day))
- (if (integerp tmp) (setq tmp (calendar-gregorian-from-absolute tmp)))
- (let ((calendar-date-display-form '(year "-" month "-" day)))
- (setq tmp (calendar-date-string tmp)))
- (setq props (plist-put props 'day tmp))
- (setq props (plist-put props 'agenda-day tmp)))
- (when (setq tmp (plist-get props 'txt))
- (when (string-match "\\[#\\([A-Z0-9]\\)\\] ?" tmp)
- (plist-put props 'priority-letter (match-string 1 tmp))
- (setq tmp (replace-match "" t t tmp)))
- (when (and (setq re (plist-get props 'org-todo-regexp))
- (setq re (concat "\\`\\.*" re " ?"))
- (string-match re tmp))
- (plist-put props 'todo (match-string 1 tmp))
- (setq tmp (replace-match "" t t tmp)))
- (plist-put props 'txt tmp)))
- props)
-
-(defun org-agenda-export-csv-mapper (prop)
- (let ((res (plist-get org-agenda-info prop)))
- (setq res
- (cond
- ((not res) "")
- ((stringp res) res)
- (t (prin1-to-string res))))
- (while (string-match "," res)
- (setq res (replace-match ";" t t res)))
- (org-trim res)))
-
-
-;;;###autoload
-(defun org-store-agenda-views (&rest parameters)
- (interactive)
- (eval (list 'org-batch-store-agenda-views)))
-
-;; FIXME, why is this a macro?????
-;;;###autoload
-(defmacro org-batch-store-agenda-views (&rest parameters)
- "Run all custom agenda commands that have a file argument."
- (let ((cmds (org-agenda-normalize-custom-commands org-agenda-custom-commands))
- (pop-up-frames nil)
- (dir default-directory)
- pars cmd thiscmdkey files opts cmd-or-set)
- (while parameters
- (push (list (pop parameters) (if parameters (pop parameters))) pars))
- (setq pars (reverse pars))
- (save-window-excursion
- (while cmds
- (setq cmd (pop cmds)
- thiscmdkey (car cmd)
- cmd-or-set (nth 2 cmd)
- opts (nth (if (listp cmd-or-set) 3 4) cmd)
- files (nth (if (listp cmd-or-set) 4 5) cmd))
- (if (stringp files) (setq files (list files)))
- (when files
- (eval (list 'let (append org-agenda-exporter-settings opts pars)
- (list 'org-agenda nil thiscmdkey)))
- (set-buffer org-agenda-buffer-name)
- (while files
- (eval (list 'let (append org-agenda-exporter-settings opts pars)
- (list 'org-write-agenda
- (expand-file-name (pop files) dir) nil t))))
- (and (get-buffer org-agenda-buffer-name)
- (kill-buffer org-agenda-buffer-name)))))))
-
-(defun org-agenda-mark-header-line (pos)
- "Mark the line at POS as an agenda structure header."
- (save-excursion
- (goto-char pos)
- (put-text-property (point-at-bol) (point-at-eol)
- 'org-agenda-structural-header t)
- (when org-agenda-title-append
- (put-text-property (point-at-bol) (point-at-eol)
- 'org-agenda-title-append org-agenda-title-append))))
-
-(defvar org-mobile-creating-agendas)
-(defun org-write-agenda (file &optional open nosettings)
- "Write the current buffer (an agenda view) as a file.
-Depending on the extension of the file name, plain text (.txt),
-HTML (.html or .htm) or Postscript (.ps) is produced.
-If the extension is .ics, run icalendar export over all files used
-to construct the agenda and limit the export to entries listed in the
-agenda now.
-With prefix argument OPEN, open the new file immediately.
-If NOSETTINGS is given, do not scope the settings of
-`org-agenda-exporter-settings' into the export commands. This is used when
-the settings have already been scoped and we do not wish to overrule other,
-higher priority settings."
- (interactive "FWrite agenda to file: \nP")
- (if (not (file-writable-p file))
- (error "Cannot write agenda to file %s" file))
- (org-let (if nosettings nil org-agenda-exporter-settings)
- '(save-excursion
- (save-window-excursion
- (org-agenda-mark-filtered-text)
- (let ((bs (copy-sequence (buffer-string))) beg)
- (org-agenda-unmark-filtered-text)
- (with-temp-buffer
- (rename-buffer "Agenda View" t)
- (set-buffer-modified-p nil)
- (insert bs)
- (org-agenda-remove-marked-text 'org-filtered)
- (while (setq beg (text-property-any (point-min) (point-max)
- 'org-filtered t))
- (delete-region
- beg (or (next-single-property-change beg 'org-filtered)
- (point-max))))
- (run-hooks 'org-agenda-before-write-hook)
- (cond
- ((org-bound-and-true-p org-mobile-creating-agendas)
- (org-mobile-write-agenda-for-mobile file))
- ((string-match "\\.html?\\'" file)
- (require 'htmlize)
- (set-buffer (htmlize-buffer (current-buffer)))
-
- (when (and org-agenda-export-html-style
- (string-match "<style>" org-agenda-export-html-style))
- ;; replace <style> section with org-agenda-export-html-style
- (goto-char (point-min))
- (kill-region (- (search-forward "<style") 6)
- (search-forward "</style>"))
- (insert org-agenda-export-html-style))
- (write-file file)
- (kill-buffer (current-buffer))
- (message "HTML written to %s" file))
- ((string-match "\\.ps\\'" file)
- (require 'ps-print)
- (ps-print-buffer-with-faces file)
- (message "Postscript written to %s" file))
- ((string-match "\\.pdf\\'" file)
- (require 'ps-print)
- (ps-print-buffer-with-faces
- (concat (file-name-sans-extension file) ".ps"))
- (call-process "ps2pdf" nil nil nil
- (expand-file-name
- (concat (file-name-sans-extension file) ".ps"))
- (expand-file-name file))
- (delete-file (concat (file-name-sans-extension file) ".ps"))
- (message "PDF written to %s" file))
- ((string-match "\\.ics\\'" file)
- (require 'org-icalendar)
- (let ((org-agenda-marker-table
- (org-create-marker-find-array
- (org-agenda-collect-markers)))
- (org-icalendar-verify-function 'org-check-agenda-marker-table)
- (org-combined-agenda-icalendar-file file))
- (apply 'org-export-icalendar 'combine
- (org-agenda-files nil 'ifmode))))
- (t
- (let ((bs (buffer-string)))
- (find-file file)
- (erase-buffer)
- (insert bs)
- (save-buffer 0)
- (kill-buffer (current-buffer))
- (message "Plain text written to %s" file))))))))
- (set-buffer org-agenda-buffer-name))
- (when open (org-open-file file)))
-
-(defvar org-agenda-filter-overlays nil)
-
-(defun org-agenda-mark-filtered-text ()
- "Mark all text hidden by filtering with a text property."
- (let ((inhibit-read-only t))
- (mapc
- (lambda (o)
- (when (equal (overlay-buffer o) (current-buffer))
- (put-text-property
- (overlay-start o) (overlay-end o)
- 'org-filtered t)))
- org-agenda-filter-overlays)))
-
-(defun org-agenda-unmark-filtered-text ()
- "Remove the filtering text property."
- (let ((inhibit-read-only t))
- (remove-text-properties (point-min) (point-max) '(org-filtered t))))
-
-(defun org-agenda-remove-marked-text (property &optional value)
- "Delete all text marked with VALUE of PROPERTY.
-VALUE defaults to t."
- (let (beg)
- (setq value (or value t))
- (while (setq beg (text-property-any (point-min) (point-max)
- property value))
- (delete-region
- beg (or (next-single-property-change beg 'org-filtered)
- (point-max))))))
-
-(defun org-agenda-add-entry-text ()
- "Add entry text to agenda lines.
-This will add a maximum of `org-agenda-add-entry-text-maxlines' lines of the
-entry text following headings shown in the agenda.
-Drawers will be excluded, also the line with scheduling/deadline info."
- (when (and (> org-agenda-add-entry-text-maxlines 0)
- (not (org-bound-and-true-p org-mobile-creating-agendas)))
- (let (m txt)
- (goto-char (point-min))
- (while (not (eobp))
- (if (not (setq m (org-get-at-bol 'org-hd-marker)))
- (beginning-of-line 2)
- (setq txt (org-agenda-get-some-entry-text
- m org-agenda-add-entry-text-maxlines " > "))
- (end-of-line 1)
- (if (string-match "\\S-" txt)
- (insert "\n" txt)
- (or (eobp) (forward-char 1))))))))
-
-(defun org-agenda-get-some-entry-text (marker n-lines &optional indent
- &rest keep)
- "Extract entry text from MARKER, at most N-LINES lines.
-This will ignore drawers etc, just get the text.
-If INDENT is given, prefix every line with this string. If KEEP is
-given, it is a list of symbols, defining stuff that should not be
-removed from the entry content. Currently only `planning' is allowed here."
- (let (txt drawer-re kwd-time-re ind)
- (save-excursion
- (with-current-buffer (marker-buffer marker)
- (if (not (org-mode-p))
- (setq txt "")
- (save-excursion
- (save-restriction
- (widen)
- (goto-char marker)
- (end-of-line 1)
- (setq txt (buffer-substring
- (min (1+ (point)) (point-max))
- (progn (outline-next-heading) (point)))
- drawer-re org-drawer-regexp
- kwd-time-re (concat "^[ \t]*" org-keyword-time-regexp
- ".*\n?"))
- (with-temp-buffer
- (insert txt)
- (when org-agenda-add-entry-text-descriptive-links
- (goto-char (point-min))
- (while (org-activate-bracket-links (point-max))
- (add-text-properties (match-beginning 0) (match-end 0)
- '(face org-link))))
- (goto-char (point-min))
- (while (re-search-forward org-bracket-link-regexp (point-max) t)
- (set-text-properties (match-beginning 0) (match-end 0)
- nil))
- (goto-char (point-min))
- (while (re-search-forward drawer-re nil t)
- (delete-region
- (match-beginning 0)
- (progn (re-search-forward
- "^[ \t]*:END:.*\n?" nil 'move)
- (point))))
- (unless (member 'planning keep)
- (goto-char (point-min))
- (while (re-search-forward kwd-time-re nil t)
- (replace-match "")))
- (goto-char (point-min))
- (when org-agenda-entry-text-exclude-regexps
- (let ((re-list org-agenda-entry-text-exclude-regexps) re)
- (while (setq re (pop re-list))
- (goto-char (point-min))
- (while (re-search-forward re nil t)
- (replace-match "")))))
- (goto-char (point-max))
- (skip-chars-backward " \t\n")
- (if (looking-at "[ \t\n]+\\'") (replace-match ""))
-
- ;; find and remove min common indentation
- (goto-char (point-min))
- (untabify (point-min) (point-max))
- (setq ind (org-get-indentation))
- (while (not (eobp))
- (unless (looking-at "[ \t]*$")
- (setq ind (min ind (org-get-indentation))))
- (beginning-of-line 2))
- (goto-char (point-min))
- (while (not (eobp))
- (unless (looking-at "[ \t]*$")
- (move-to-column ind)
- (delete-region (point-at-bol) (point)))
- (beginning-of-line 2))
-
- (run-hooks 'org-agenda-entry-text-cleanup-hook)
-
- (goto-char (point-min))
- (when indent
- (while (and (not (eobp)) (re-search-forward "^" nil t))
- (replace-match indent t t)))
- (goto-char (point-min))
- (while (looking-at "[ \t]*\n") (replace-match ""))
- (goto-char (point-max))
- (when (> (org-current-line)
- n-lines)
- (org-goto-line (1+ n-lines))
- (backward-char 1))
- (setq txt (buffer-substring (point-min) (point)))))))))
- txt))
-
-(defun org-agenda-collect-markers ()
- "Collect the markers pointing to entries in the agenda buffer."
- (let (m markers)
- (save-excursion
- (goto-char (point-min))
- (while (not (eobp))
- (when (setq m (or (org-get-at-bol 'org-hd-marker)
- (org-get-at-bol 'org-marker)))
- (push m markers))
- (beginning-of-line 2)))
- (nreverse markers)))
-
-(defun org-create-marker-find-array (marker-list)
- "Create a alist of files names with all marker positions in that file."
- (let (f tbl m a p)
- (while (setq m (pop marker-list))
- (setq p (marker-position m)
- f (buffer-file-name (or (buffer-base-buffer
- (marker-buffer m))
- (marker-buffer m))))
- (if (setq a (assoc f tbl))
- (push (marker-position m) (cdr a))
- (push (list f p) tbl)))
- (mapcar (lambda (x) (setcdr x (sort (copy-sequence (cdr x)) '<)) x)
- tbl)))
-
-(defvar org-agenda-marker-table nil) ; dynamically scoped parameter
-(defun org-check-agenda-marker-table ()
- "Check of the current entry is on the marker list."
- (let ((file (buffer-file-name (or (buffer-base-buffer) (current-buffer))))
- a)
- (and (setq a (assoc file org-agenda-marker-table))
- (save-match-data
- (save-excursion
- (org-back-to-heading t)
- (member (point) (cdr a)))))))
-
-(defun org-check-for-org-mode ()
- "Make sure current buffer is in org-mode. Error if not."
- (or (org-mode-p)
- (error "Cannot execute org-mode agenda command on buffer in %s"
- major-mode)))
-
-(defun org-fit-agenda-window ()
- "Fit the window to the buffer size."
- (and (memq org-agenda-window-setup '(reorganize-frame))
- (fboundp 'fit-window-to-buffer)
- (org-fit-window-to-buffer
- nil
- (floor (* (frame-height) (cdr org-agenda-window-frame-fractions)))
- (floor (* (frame-height) (car org-agenda-window-frame-fractions))))))
-
-;;; Agenda prepare and finalize
-
-(defvar org-agenda-multi nil) ; dynamically scoped
-(defvar org-agenda-buffer-name "*Org Agenda*")
-(defvar org-pre-agenda-window-conf nil)
-(defvar org-agenda-columns-active nil)
-(defvar org-agenda-name nil)
-(defvar org-agenda-filter nil)
-(defvar org-agenda-filter-while-redo nil)
-(defvar org-agenda-filter-preset nil
- "A preset of the tags filter used for secondary agenda filtering.
-This must be a list of strings, each string must be a single tag preceded
-by \"+\" or \"-\".
-This variable should not be set directly, but agenda custom commands can
-bind it in the options section. The preset filter is a global property of
-the entire agenda view. In a block agenda, it will not work reliably to
-define a filter for one of the individual blocks. You need to set it in
-the global options and expect it to be applied to the entire view.")
-
-(defun org-prepare-agenda (&optional name)
- (setq org-todo-keywords-for-agenda nil)
- (setq org-done-keywords-for-agenda nil)
- (setq org-drawers-for-agenda nil)
- (unless org-agenda-persistent-filter
- (setq org-agenda-filter nil))
- (put 'org-agenda-filter :preset-filter org-agenda-filter-preset)
- (if org-agenda-multi
- (progn
- (setq buffer-read-only nil)
- (goto-char (point-max))
- (unless (or (bobp) org-agenda-compact-blocks)
- (insert "\n"
- (if (stringp org-agenda-block-separator)
- org-agenda-block-separator
- (make-string (window-width) org-agenda-block-separator))
- "\n"))
- (narrow-to-region (point) (point-max)))
- (org-agenda-reset-markers)
- (setq org-agenda-contributing-files nil)
- (setq org-agenda-columns-active nil)
- (org-prepare-agenda-buffers (org-agenda-files nil 'ifmode))
- (setq org-todo-keywords-for-agenda
- (org-uniquify org-todo-keywords-for-agenda))
- (setq org-done-keywords-for-agenda
- (org-uniquify org-done-keywords-for-agenda))
- (setq org-drawers-for-agenda (org-uniquify org-drawers-for-agenda))
- (let* ((abuf (get-buffer-create org-agenda-buffer-name))
- (awin (get-buffer-window abuf)))
- (cond
- ((equal (current-buffer) abuf) nil)
- (awin (select-window awin))
- ((not (setq org-pre-agenda-window-conf (current-window-configuration))))
- ((equal org-agenda-window-setup 'current-window)
- (switch-to-buffer abuf))
- ((equal org-agenda-window-setup 'other-window)
- (org-switch-to-buffer-other-window abuf))
- ((equal org-agenda-window-setup 'other-frame)
- (switch-to-buffer-other-frame abuf))
- ((equal org-agenda-window-setup 'reorganize-frame)
- (delete-other-windows)
- (org-switch-to-buffer-other-window abuf)))
- ;; additional test in case agenda is invoked from within agenda
- ;; buffer via elisp link
- (unless (equal (current-buffer) abuf)
- (switch-to-buffer abuf)))
- (setq buffer-read-only nil)
- (let ((inhibit-read-only t)) (erase-buffer))
- (org-agenda-mode)
- (and name (not org-agenda-name)
- (org-set-local 'org-agenda-name name)))
- (setq buffer-read-only nil))
-
-(defun org-finalize-agenda ()
- "Finishing touch for the agenda buffer, called just before displaying it."
- (unless org-agenda-multi
- (save-excursion
- (let ((inhibit-read-only t))
- (goto-char (point-min))
- (while (org-activate-bracket-links (point-max))
- (add-text-properties (match-beginning 0) (match-end 0)
- '(face org-link)))
- (org-agenda-align-tags)
- (unless org-agenda-with-colors
- (remove-text-properties (point-min) (point-max) '(face nil))))
- (if (and (boundp 'org-agenda-overriding-columns-format)
- org-agenda-overriding-columns-format)
- (org-set-local 'org-agenda-overriding-columns-format
- org-agenda-overriding-columns-format))
- (if (and (boundp 'org-agenda-view-columns-initially)
- org-agenda-view-columns-initially)
- (org-agenda-columns))
- (when org-agenda-fontify-priorities
- (org-agenda-fontify-priorities))
- (when (and org-agenda-dim-blocked-tasks org-blocker-hook)
- (org-agenda-dim-blocked-tasks))
- (org-agenda-mark-clocking-task)
- (when org-agenda-entry-text-mode
- (org-agenda-entry-text-hide)
- (org-agenda-entry-text-show))
- (if (functionp 'org-habit-insert-consistency-graphs)
- (org-habit-insert-consistency-graphs))
- (run-hooks 'org-finalize-agenda-hook)
- (setq org-agenda-type (org-get-at-bol 'org-agenda-type))
- (when (or org-agenda-filter (get 'org-agenda-filter :preset-filter))
- (org-agenda-filter-apply org-agenda-filter))
- )))
-
-(defun org-agenda-mark-clocking-task ()
- "Mark the current clock entry in the agenda if it is present."
- (mapc (lambda (o)
- (if (eq (overlay-get o 'type) 'org-agenda-clocking)
- (delete-overlay o)))
- (overlays-in (point-min) (point-max)))
- (when (marker-buffer org-clock-hd-marker)
- (save-excursion
- (goto-char (point-min))
- (let (s ov)
- (while (setq s (next-single-property-change (point) 'org-hd-marker))
- (goto-char s)
- (when (equal (org-get-at-bol 'org-hd-marker)
- org-clock-hd-marker)
- (setq ov (make-overlay (point-at-bol) (1+ (point-at-eol))))
- (overlay-put ov 'type 'org-agenda-clocking)
- (overlay-put ov 'face 'org-agenda-clocking)
- (overlay-put ov 'help-echo
- "The clock is running in this item")))))))
-
-(defun org-agenda-fontify-priorities ()
- "Make highest priority lines bold, and lowest italic."
- (interactive)
- (mapc (lambda (o) (if (eq (overlay-get o 'org-type) 'org-priority)
- (delete-overlay o)))
- (overlays-in (point-min) (point-max)))
- (save-excursion
- (let ((inhibit-read-only t)
- b e p ov h l)
- (goto-char (point-min))
- (while (re-search-forward "\\[#\\(.\\)\\]" nil t)
- (setq h (or (get-char-property (point) 'org-highest-priority)
- org-highest-priority)
- l (or (get-char-property (point) 'org-lowest-priority)
- org-lowest-priority)
- p (string-to-char (match-string 1))
- b (match-beginning 0)
- e (if (eq org-agenda-fontify-priorities 'cookies)
- (match-end 0)
- (point-at-eol))
- ov (make-overlay b e))
- (overlay-put
- ov 'face
- (cond ((org-face-from-face-or-color
- 'priority nil
- (cdr (assoc p org-priority-faces))))
- ((and (listp org-agenda-fontify-priorities)
- (org-face-from-face-or-color
- 'priority nil
- (cdr (assoc p org-agenda-fontify-priorities)))))
- ((equal p l) 'italic)
- ((equal p h) 'bold)))
- (overlay-put ov 'org-type 'org-priority)))))
-
-(defun org-agenda-dim-blocked-tasks ()
- "Dim currently blocked TODO's in the agenda display."
- (mapc (lambda (o) (if (eq (overlay-get o 'org-type) 'org-blocked-todo)
- (delete-overlay o)))
- (overlays-in (point-min) (point-max)))
- (save-excursion
- (let ((inhibit-read-only t)
- (org-depend-tag-blocked nil)
- (invis (eq org-agenda-dim-blocked-tasks 'invisible))
- org-blocked-by-checkboxes
- invis1 b e p ov h l)
- (goto-char (point-min))
- (while (let ((pos (next-single-property-change (point) 'todo-state)))
- (and pos (goto-char (1+ pos))))
- (setq org-blocked-by-checkboxes nil invis1 invis)
- (let ((marker (org-get-at-bol 'org-hd-marker)))
- (when (and marker
- (not (with-current-buffer (marker-buffer marker)
- (save-excursion
- (goto-char marker)
- (if (org-entry-get nil "NOBLOCKING")
- t ;; Never block this entry
- (run-hook-with-args-until-failure
- 'org-blocker-hook
- (list :type 'todo-state-change
- :position marker
- :from 'todo
- :to 'done)))))))
- (if org-blocked-by-checkboxes (setq invis1 nil))
- (setq b (if invis1
- (max (point-min) (1- (point-at-bol)))
- (point-at-bol))
- e (point-at-eol)
- ov (make-overlay b e))
- (if invis1
- (overlay-put ov 'invisible t)
- (overlay-put ov 'face 'org-agenda-dimmed-todo-face))
- (overlay-put ov 'org-type 'org-blocked-todo)))))))
-
-(defvar org-agenda-skip-function nil
- "Function to be called at each match during agenda construction.
-If this function returns nil, the current match should not be skipped.
-Otherwise, the function must return a position from where the search
-should be continued.
-This may also be a Lisp form, it will be evaluated.
-Never set this variable using `setq' or so, because then it will apply
-to all future agenda commands. Instead, bind it with `let' to scope
-it dynamically into the agenda-constructing command. A good way to set
-it is through options in `org-agenda-custom-commands'.")
-
-(defun org-agenda-skip ()
- "Throw to `:skip' in places that should be skipped.
-Also moves point to the end of the skipped region, so that search can
-continue from there."
- (let ((p (point-at-bol)) to fp)
- (and org-agenda-skip-archived-trees (not org-agenda-archives-mode)
- (get-text-property p :org-archived)
- (org-end-of-subtree t)
- (throw :skip t))
- (and org-agenda-skip-comment-trees
- (get-text-property p :org-comment)
- (org-end-of-subtree t)
- (throw :skip t))
- (if (equal (char-after p) ?#) (throw :skip t))
- (when (and (or (setq fp (functionp org-agenda-skip-function))
- (consp org-agenda-skip-function))
- (setq to (save-excursion
- (save-match-data
- (if fp
- (funcall org-agenda-skip-function)
- (eval org-agenda-skip-function))))))
- (goto-char to)
- (throw :skip t))))
-
-(defvar org-agenda-markers nil
- "List of all currently active markers created by `org-agenda'.")
-(defvar org-agenda-last-marker-time (org-float-time)
- "Creation time of the last agenda marker.")
-
-(defun org-agenda-new-marker (&optional pos)
- "Return a new agenda marker.
-Org-mode keeps a list of these markers and resets them when they are
-no longer in use."
- (let ((m (copy-marker (or pos (point)))))
- (setq org-agenda-last-marker-time (org-float-time))
- (push m org-agenda-markers)
- m))
-
-(defun org-agenda-reset-markers ()
- "Reset markers created by `org-agenda'."
- (while org-agenda-markers
- (move-marker (pop org-agenda-markers) nil)))
-
-(defun org-agenda-save-markers-for-cut-and-paste (beg end)
- "Save relative positions of markers in region."
- (mapc (lambda (m) (org-check-and-save-marker m beg end))
- org-agenda-markers))
-
-;;; Entry text mode
-
-(defun org-agenda-entry-text-show-here ()
- "Add some text from the entry as context to the current line."
- (let (m txt o)
- (setq m (org-get-at-bol 'org-hd-marker))
- (unless (marker-buffer m)
- (error "No marker points to an entry here"))
- (setq txt (concat "\n" (org-no-properties
- (org-agenda-get-some-entry-text
- m org-agenda-entry-text-maxlines " > "))))
- (when (string-match "\\S-" txt)
- (setq o (make-overlay (point-at-bol) (point-at-eol)))
- (overlay-put o 'evaporate t)
- (overlay-put o 'org-overlay-type 'agenda-entry-content)
- (overlay-put o 'after-string txt))))
-
-(defun org-agenda-entry-text-show ()
- "Add entry context for all agenda lines."
- (interactive)
- (save-excursion
- (goto-char (point-max))
- (beginning-of-line 1)
- (while (not (bobp))
- (when (org-get-at-bol 'org-hd-marker)
- (org-agenda-entry-text-show-here))
- (beginning-of-line 0))))
-
-(defun org-agenda-entry-text-hide ()
- "Remove any shown entry context."
- (delq nil
- (mapcar (lambda (o)
- (if (eq (overlay-get o 'org-overlay-type)
- 'agenda-entry-content)
- (progn (delete-overlay o) t)))
- (overlays-in (point-min) (point-max)))))
-
-(defun org-agenda-get-day-face (date)
- "Return the face DATE should be displayed with."
- (or (and (functionp org-agenda-day-face-function)
- (funcall org-agenda-day-face-function date))
- (cond ((org-agenda-todayp date)
- 'org-agenda-date-today)
- ((member (calendar-day-of-week date) org-agenda-weekend-days)
- 'org-agenda-date-weekend)
- (t 'org-agenda-date))))
-
-;;; Agenda timeline
-
-(defvar org-agenda-only-exact-dates nil) ; dynamically scoped
-
-(defun org-timeline (&optional include-all)
- "Show a time-sorted view of the entries in the current org file.
-Only entries with a time stamp of today or later will be listed. With
-\\[universal-argument] prefix, all unfinished TODO items will also be shown,
-under the current date.
-If the buffer contains an active region, only check the region for
-dates."
- (interactive "P")
- (org-compile-prefix-format 'timeline)
- (org-set-sorting-strategy 'timeline)
- (let* ((dopast t)
- (dotodo include-all)
- (doclosed org-agenda-show-log)
- (entry (buffer-file-name (or (buffer-base-buffer (current-buffer))
- (current-buffer))))
- (date (calendar-current-date))
- (beg (if (org-region-active-p) (region-beginning) (point-min)))
- (end (if (org-region-active-p) (region-end) (point-max)))
- (day-numbers (org-get-all-dates beg end 'no-ranges
- t doclosed ; always include today
- org-timeline-show-empty-dates))
- (org-deadline-warning-days 0)
- (org-agenda-only-exact-dates t)
- (today (org-today))
- (past t)
- args
- s e rtn d emptyp)
- (setq org-agenda-redo-command
- (list 'progn
- (list 'org-switch-to-buffer-other-window (current-buffer))
- (list 'org-timeline (list 'quote include-all))))
- (if (not dopast)
- ;; Remove past dates from the list of dates.
- (setq day-numbers (delq nil (mapcar (lambda(x)
- (if (>= x today) x nil))
- day-numbers))))
- (org-prepare-agenda (concat "Timeline " (file-name-nondirectory entry)))
- (if doclosed (push :closed args))
- (push :timestamp args)
- (push :deadline args)
- (push :scheduled args)
- (push :sexp args)
- (if dotodo (push :todo args))
- (insert "Timeline of file " entry "\n")
- (add-text-properties (point-min) (point)
- (list 'face 'org-agenda-structure))
- (org-agenda-mark-header-line (point-min))
- (while (setq d (pop day-numbers))
- (if (and (listp d) (eq (car d) :omitted))
- (progn
- (setq s (point))
- (insert (format "\n[... %d empty days omitted]\n\n" (cdr d)))
- (put-text-property s (1- (point)) 'face 'org-agenda-structure))
- (if (listp d) (setq d (car d) emptyp t) (setq emptyp nil))
- (if (and (>= d today)
- dopast
- past)
- (progn
- (setq past nil)
- (insert (make-string 79 ?-) "\n")))
- (setq date (calendar-gregorian-from-absolute d))
- (setq s (point))
- (setq rtn (and (not emptyp)
- (apply 'org-agenda-get-day-entries entry
- date args)))
- (if (or rtn (equal d today) org-timeline-show-empty-dates)
- (progn
- (insert
- (if (stringp org-agenda-format-date)
- (format-time-string org-agenda-format-date
- (org-time-from-absolute date))
- (funcall org-agenda-format-date date))
- "\n")
- (put-text-property s (1- (point)) 'face
- (org-agenda-get-day-face date))
- (put-text-property s (1- (point)) 'org-date-line t)
- (put-text-property s (1- (point)) 'org-agenda-date-header t)
- (if (equal d today)
- (put-text-property s (1- (point)) 'org-today t))
- (and rtn (insert (org-finalize-agenda-entries rtn) "\n"))
- (put-text-property s (1- (point)) 'day d)))))
- (goto-char (point-min))
- (goto-char (or (text-property-any (point-min) (point-max) 'org-today t)
- (point-min)))
- (add-text-properties (point-min) (point-max) '(org-agenda-type timeline))
- (org-finalize-agenda)
- (setq buffer-read-only t)))
-
-(defun org-get-all-dates (beg end &optional no-ranges force-today inactive empty pre-re)
- "Return a list of all relevant day numbers from BEG to END buffer positions.
-If NO-RANGES is non-nil, include only the start and end dates of a range,
-not every single day in the range. If FORCE-TODAY is non-nil, make
-sure that TODAY is included in the list. If INACTIVE is non-nil, also
-inactive time stamps (those in square brackets) are included.
-When EMPTY is non-nil, also include days without any entries."
- (let ((re (concat
- (if pre-re pre-re "")
- (if inactive org-ts-regexp-both org-ts-regexp)))
- dates dates1 date day day1 day2 ts1 ts2)
- (if force-today
- (setq dates (list (org-today))))
- (save-excursion
- (goto-char beg)
- (while (re-search-forward re end t)
- (setq day (time-to-days (org-time-string-to-time
- (substring (match-string 1) 0 10))))
- (or (memq day dates) (push day dates)))
- (unless no-ranges
- (goto-char beg)
- (while (re-search-forward org-tr-regexp end t)
- (setq ts1 (substring (match-string 1) 0 10)
- ts2 (substring (match-string 2) 0 10)
- day1 (time-to-days (org-time-string-to-time ts1))
- day2 (time-to-days (org-time-string-to-time ts2)))
- (while (< (setq day1 (1+ day1)) day2)
- (or (memq day1 dates) (push day1 dates)))))
- (setq dates (sort dates '<))
- (when empty
- (while (setq day (pop dates))
- (setq day2 (car dates))
- (push day dates1)
- (when (and day2 empty)
- (if (or (eq empty t)
- (and (numberp empty) (<= (- day2 day) empty)))
- (while (< (setq day (1+ day)) day2)
- (push (list day) dates1))
- (push (cons :omitted (- day2 day)) dates1))))
- (setq dates (nreverse dates1)))
- dates)))
-
-;;; Agenda Daily/Weekly
-
-(defvar org-agenda-overriding-arguments nil) ; dynamically scoped parameter
-(defvar org-agenda-start-day nil ; dynamically scoped parameter
-"Custom commands can set this variable in the options section.")
-(defvar org-agenda-last-arguments nil
- "The arguments of the previous call to `org-agenda'.")
-(defvar org-starting-day nil) ; local variable in the agenda buffer
-(defvar org-agenda-current-span nil
- "The current span used in the agenda view.") ; local variable in the agenda buffer
-(defvar org-include-all-loc nil) ; local variable
-
-(defvar org-agenda-entry-types '(:deadline :scheduled :timestamp :sexp)
- "List of types searched for when creating the daily/weekly agenda.
-This variable is a list of symbols that controls the types of
-items that appear in the daily/weekly agenda. Allowed symbols in this
-list are are
-
- :timestamp List items containing a date stamp or date range matching
- the selected date. This includes sexp entries in
- angular brackets.
-
- :sexp List entries resulting from plain diary-like sexps.
-
- :deadline List deadline due on that date. When the date is today,
- also list any deadlines past due, or due within
- `org-deadline-warning-days'. `:deadline' must appear before
- `:scheduled' if the setting of
- `org-agenda-skip-scheduled-if-deadline-is-shown' is to have
- any effect.
-
- :scheduled List all items which are scheduled for the given date.
- The diary for *today* also contains items which were
- scheduled earlier and are not yet marked DONE.
-
-By default, all four types are turned on.
-
-Never set this variable globally using `setq', because then it
-will apply to all future agenda commands. Instead, bind it with
-`let' to scope it dynamically into the the agenda-constructing
-command. A good way to set it is through options in
-`org-agenda-custom-commands'. For a more flexible (though
-somewhat less efficient) way of determining what is included in
-the daily/weekly agenda, see `org-agenda-skip-function'.")
-
-;;;###autoload
-(defun org-agenda-list (&optional include-all start-day span)
- "Produce a daily/weekly view from all files in variable `org-agenda-files'.
-The view will be for the current day or week, but from the overview buffer
-you will be able to go to other days/weeks.
-
-With one \\[universal-argument] prefix argument INCLUDE-ALL,
-all unfinished TODO items will also be shown, before the agenda.
-This feature is considered obsolete, please use the TODO list or a block
-agenda instead.
-
-With a numeric prefix argument in an interactive call, the agenda will
-span INCLUDE-ALL days. Lisp programs should instead specify SPAN to change
-the number of days. SPAN defaults to `org-agenda-span'.
-
-START-DAY defaults to TODAY, or to the most recent match for the weekday
-given in `org-agenda-start-on-weekday'."
- (interactive "P")
- (if (and (integerp include-all) (> include-all 0))
- (setq span include-all include-all nil))
- (setq start-day (or start-day org-agenda-start-day))
- (if org-agenda-overriding-arguments
- (setq include-all (car org-agenda-overriding-arguments)
- start-day (nth 1 org-agenda-overriding-arguments)
- span (nth 2 org-agenda-overriding-arguments)))
- (if (stringp start-day)
- ;; Convert to an absolute day number
- (setq start-day (time-to-days (org-read-date nil t start-day))))
- (setq org-agenda-last-arguments (list include-all start-day span))
- (org-compile-prefix-format 'agenda)
- (org-set-sorting-strategy 'agenda)
- (let* ((span (org-agenda-ndays-to-span (or span org-agenda-ndays org-agenda-span)))
- (today (org-today))
- (sd (or start-day today))
- (ndays (org-agenda-span-to-ndays span sd))
- (org-agenda-start-on-weekday
- (if (eq ndays 7)
- org-agenda-start-on-weekday))
- (thefiles (org-agenda-files nil 'ifmode))
- (files thefiles)
- (start (if (or (null org-agenda-start-on-weekday)
- (< ndays 7))
- sd
- (let* ((nt (calendar-day-of-week
- (calendar-gregorian-from-absolute sd)))
- (n1 org-agenda-start-on-weekday)
- (d (- nt n1)))
- (- sd (+ (if (< d 0) 7 0) d)))))
- (day-numbers (list start))
- (day-cnt 0)
- (inhibit-redisplay (not debug-on-error))
- s e rtn rtnall file date d start-pos end-pos todayp
- clocktable-start clocktable-end filter)
- (setq org-agenda-redo-command
- (list 'org-agenda-list (list 'quote include-all) start-day (list 'quote span)))
- (dotimes (n (1- ndays))
- (push (1+ (car day-numbers)) day-numbers))
- (setq day-numbers (nreverse day-numbers))
- (setq clocktable-start (car day-numbers)
- clocktable-end (1+ (or (org-last day-numbers) 0)))
- (org-prepare-agenda "Day/Week")
- (org-set-local 'org-starting-day (car day-numbers))
- (org-set-local 'org-include-all-loc include-all)
- (org-set-local 'org-agenda-current-span (org-agenda-ndays-to-span span))
- (when (and (or include-all org-agenda-include-all-todo)
- (member today day-numbers))
- (setq files thefiles
- rtnall nil)
- (while (setq file (pop files))
- (catch 'nextfile
- (org-check-agenda-file file)
- (setq date (calendar-gregorian-from-absolute today)
- rtn (org-agenda-get-day-entries
- file date :todo))
- (setq rtnall (append rtnall rtn))))
- (when rtnall
- (insert "All currently open TODO items:\n")
- (add-text-properties (point-min) (1- (point))
- (list 'face 'org-agenda-structure
- 'short-heading "All TODO items"))
- (org-agenda-mark-header-line (point-min))
- (insert (org-finalize-agenda-entries rtnall) "\n")))
- (unless org-agenda-compact-blocks
- (let* ((d1 (car day-numbers))
- (d2 (org-last day-numbers))
- (w1 (org-days-to-iso-week d1))
- (w2 (org-days-to-iso-week d2)))
- (setq s (point))
- (if org-agenda-overriding-header
- (insert (org-add-props (copy-sequence org-agenda-overriding-header)
- nil 'face 'org-agenda-structure) "\n")
- (insert (org-agenda-span-name span)
- "-agenda"
- (if (< (- d2 d1) 350)
- (if (= w1 w2)
- (format " (W%02d)" w1)
- (format " (W%02d-W%02d)" w1 w2))
- "")
- ":\n")))
- (add-text-properties s (1- (point)) (list 'face 'org-agenda-structure
- 'org-date-line t))
- (org-agenda-mark-header-line s))
- (while (setq d (pop day-numbers))
- (setq date (calendar-gregorian-from-absolute d)
- s (point))
- (if (or (setq todayp (= d today))
- (and (not start-pos) (= d sd)))
- (setq start-pos (point))
- (if (and start-pos (not end-pos))
- (setq end-pos (point))))
- (setq files thefiles
- rtnall nil)
- (while (setq file (pop files))
- (catch 'nextfile
- (org-check-agenda-file file)
- (let ((org-agenda-entry-types org-agenda-entry-types))
- (unless org-agenda-include-deadlines
- (setq org-agenda-entry-types
- (delq :deadline org-agenda-entry-types)))
- (cond
- ((eq org-agenda-show-log 'only)
- (setq rtn (org-agenda-get-day-entries
- file date :closed)))
- (org-agenda-show-log
- (setq rtn (apply 'org-agenda-get-day-entries
- file date
- (append '(:closed) org-agenda-entry-types))))
- (t
- (setq rtn (apply 'org-agenda-get-day-entries
- file date
- org-agenda-entry-types)))))
- (setq rtnall (append rtnall rtn))))
- (if org-agenda-include-diary
- (let ((org-agenda-search-headline-for-time t))
- (require 'diary-lib)
- (setq rtn (org-get-entries-from-diary date))
- (setq rtnall (append rtnall rtn))))
- (if (or rtnall org-agenda-show-all-dates)
- (progn
- (setq day-cnt (1+ day-cnt))
- (insert
- (if (stringp org-agenda-format-date)
- (format-time-string org-agenda-format-date
- (org-time-from-absolute date))
- (funcall org-agenda-format-date date))
- "\n")
- (put-text-property s (1- (point)) 'face
- (org-agenda-get-day-face date))
- (put-text-property s (1- (point)) 'org-date-line t)
- (put-text-property s (1- (point)) 'org-agenda-date-header t)
- (put-text-property s (1- (point)) 'org-day-cnt day-cnt)
- (when todayp
- (put-text-property s (1- (point)) 'org-today t))
- (if rtnall (insert
- (org-finalize-agenda-entries
- (org-agenda-add-time-grid-maybe
- rtnall ndays todayp))
- "\n"))
- (put-text-property s (1- (point)) 'day d)
- (put-text-property s (1- (point)) 'org-day-cnt day-cnt))))
- (when (and org-agenda-clockreport-mode clocktable-start)
- (let ((org-agenda-files (org-agenda-files nil 'ifmode))
- ;; the above line is to ensure the restricted range!
- (p org-agenda-clockreport-parameter-plist)
- tbl)
- (setq p (org-plist-delete p :block))
- (setq p (plist-put p :tstart clocktable-start))
- (setq p (plist-put p :tend clocktable-end))
- (setq p (plist-put p :scope 'agenda))
- (when (and (eq org-agenda-clockreport-mode 'with-filter)
- (setq filter (or org-agenda-filter-while-redo
- (get 'org-agenda-filter :preset-filter))))
- (setq p (plist-put p :tags (mapconcat (lambda (x)
- (if (string-match "[<>=]" x)
- ""
- x))
- filter ""))))
- (message "%s" (plist-get p :tags)) (sit-for 2)
- (setq tbl (apply 'org-get-clocktable p))
- (insert tbl)))
- (goto-char (point-min))
- (or org-agenda-multi (org-fit-agenda-window))
- (unless (and (pos-visible-in-window-p (point-min))
- (pos-visible-in-window-p (point-max)))
- (goto-char (1- (point-max)))
- (recenter -1)
- (if (not (pos-visible-in-window-p (or start-pos 1)))
- (progn
- (goto-char (or start-pos 1))
- (recenter 1))))
- (goto-char (or start-pos 1))
- (add-text-properties (point-min) (point-max) '(org-agenda-type agenda))
- (org-finalize-agenda)
- (setq buffer-read-only t)
- (message "")))
-
-(defun org-agenda-ndays-to-span (n)
- "Return a span symbol for a span of N days, or N if none matches."
- (cond ((symbolp n) n)
- ((= n 1) 'day)
- ((= n 7) 'week)
- (t n)))
-
-(defun org-agenda-span-to-ndays (span start-day)
- "Return ndays from SPAN starting at START-DAY."
- (cond ((numberp span) span)
- ((eq span 'day) 1)
- ((eq span 'week) 7)
- ((eq span 'month)
- (let ((date (calendar-gregorian-from-absolute start-day)))
- (calendar-last-day-of-month (car date) (caddr date))))
- ((eq span 'year)
- (let ((date (calendar-gregorian-from-absolute start-day)))
- (if (calendar-leap-year-p (caddr date)) 366 365)))))
-
-(defun org-agenda-span-name (span)
- "Return a SPAN name."
- (if (null span)
- ""
- (if (symbolp span)
- (capitalize (symbol-name span))
- (format "%d days" span))))
-
-;;; Agenda word search
-
-(defvar org-agenda-search-history nil)
-(defvar org-todo-only nil)
-
-(defvar org-search-syntax-table nil
- "Special syntax table for org-mode search.
-In this table, we have single quotes not as word constituents, to
-that when \"+Ameli\" is searched as a work, it will also match \"Ameli's\"")
-
-(defun org-search-syntax-table ()
- (unless org-search-syntax-table
- (setq org-search-syntax-table (copy-syntax-table org-mode-syntax-table))
- (modify-syntax-entry ?' "." org-search-syntax-table)
- (modify-syntax-entry ?` "." org-search-syntax-table))
- org-search-syntax-table)
-
-(defvar org-agenda-last-search-view-search-was-boolean nil)
-
-;;;###autoload
-(defun org-search-view (&optional todo-only string edit-at)
- "Show all entries that contain a phrase or words or regular expressions.
-
-With optional prefix argument TODO-ONLY, only consider entries that are
-TODO entries. The argument STRING can be used to pass a default search
-string into this function. If EDIT-AT is non-nil, it means that the
-user should get a chance to edit this string, with cursor at position
-EDIT-AT.
-
-The search string can be viewed either as a phrase that should be found as
-is, or it can be broken into a number of snippets, each of which must match
-in a Boolean way to select an entry. The default depends on the variable
-`org-agenda-search-view-always-boolean'.
-Even if this is turned off (the default) you can always switch to
-Boolean search dynamically by preceding the first word with \"+\" or \"-\".
-
-The default is a direct search of the whole phrase, where each space in
-the search string can expand to an arbitrary amount of whitespace,
-including newlines.
-
-If using a Boolean search, the search string is split on whitespace and
-each snippet is searched separately, with logical AND to select an entry.
-Words prefixed with a minus must *not* occur in the entry. Words without
-a prefix or prefixed with a plus must occur in the entry. Matching is
-case-insensitive. Words are enclosed by word delimiters (i.e. they must
-match whole words, not parts of a word) if
-`org-agenda-search-view-force-full-words' is set (default is nil).
-
-Boolean search snippets enclosed by curly braces are interpreted as
-regular expressions that must or (when preceded with \"-\") must not
-match in the entry. Snippets enclosed into double quotes will be taken
-as a whole, to include whitespace.
-
-- If the search string starts with an asterisk, search only in headlines.
-- If (possibly after the leading star) the search string starts with an
- exclamation mark, this also means to look at TODO entries only, an effect
- that can also be achieved with a prefix argument.
-- If (possibly after star and exclamation mark) the search string starts
- with a colon, this will mean that the (non-regexp) snippets of the
- Boolean search must match as full words.
-
-This command searches the agenda files, and in addition the files listed
-in `org-agenda-text-search-extra-files'."
- (interactive "P")
- (org-compile-prefix-format 'search)
- (org-set-sorting-strategy 'search)
- (org-prepare-agenda "SEARCH")
- (let* ((props (list 'face nil
- 'done-face 'org-agenda-done
- 'org-not-done-regexp org-not-done-regexp
- 'org-todo-regexp org-todo-regexp
- 'org-complex-heading-regexp org-complex-heading-regexp
- 'mouse-face 'highlight
- 'help-echo (format "mouse-2 or RET jump to location")))
- (full-words org-agenda-search-view-force-full-words)
- (org-agenda-text-search-extra-files org-agenda-text-search-extra-files)
- regexp rtn rtnall files file pos
- marker category tags c neg re boolean
- ee txt beg end words regexps+ regexps- hdl-only buffer beg1 str)
- (unless (and (not edit-at)
- (stringp string)
- (string-match "\\S-" string))
- (setq string (read-string
- (if org-agenda-search-view-always-boolean
- "[+-]Word/{Regexp} ...: "
- "Phrase, or [+-]Word/{Regexp} ...: ")
- (cond
- ((integerp edit-at) (cons string edit-at))
- (edit-at string))
- 'org-agenda-search-history)))
- (org-set-local 'org-todo-only todo-only)
- (setq org-agenda-redo-command
- (list 'org-search-view (if todo-only t nil) string
- '(if current-prefix-arg 1 nil)))
- (setq org-agenda-query-string string)
-
- (if (equal (string-to-char string) ?*)
- (setq hdl-only t
- words (substring string 1))
- (setq words string))
- (when (equal (string-to-char words) ?!)
- (setq todo-only t
- words (substring words 1)))
- (when (equal (string-to-char words) ?:)
- (setq full-words t
- words (substring words 1)))
- (if (or org-agenda-search-view-always-boolean
- (member (string-to-char words) '(?- ?+ ?\{)))
- (setq boolean t))
- (setq words (org-split-string words))
- (let (www w)
- (while (setq w (pop words))
- (while (and (string-match "\\\\\\'" w) words)
- (setq w (concat (substring w 0 -1) " " (pop words))))
- (push w www))
- (setq words (nreverse www) www nil)
- (while (setq w (pop words))
- (when (and (string-match "\\`[-+]?{" w)
- (not (string-match "}\\'" w)))
- (while (and words (not (string-match "}\\'" (car words))))
- (setq w (concat w " " (pop words))))
- (setq w (concat w " " (pop words))))
- (push w www))
- (setq words (nreverse www)))
- (setq org-agenda-last-search-view-search-was-boolean boolean)
- (when boolean
- (let (wds w)
- (while (setq w (pop words))
- (if (or (equal (substring w 0 1) "\"")
- (and (> (length w) 1)
- (member (substring w 0 1) '("+" "-"))
- (equal (substring w 1 2) "\"")))
- (while (and words (not (equal (substring w -1) "\"")))
- (setq w (concat w " " (pop words)))))
- (and (string-match "\\`\\([-+]?\\)\"" w)
- (setq w (replace-match "\\1" nil nil w)))
- (and (equal (substring w -1) "\"") (setq w (substring w 0 -1)))
- (push w wds))
- (setq words (nreverse wds))))
- (if boolean
- (mapc (lambda (w)
- (setq c (string-to-char w))
- (if (equal c ?-)
- (setq neg t w (substring w 1))
- (if (equal c ?+)
- (setq neg nil w (substring w 1))
- (setq neg nil)))
- (if (string-match "\\`{.*}\\'" w)
- (setq re (substring w 1 -1))
- (if full-words
- (setq re (concat "\\<" (regexp-quote (downcase w)) "\\>"))
- (setq re (regexp-quote (downcase w)))))
- (if neg (push re regexps-) (push re regexps+)))
- words)
- (push (mapconcat (lambda (w) (regexp-quote w)) words "\\s-+")
- regexps+))
- (setq regexps+ (sort regexps+ (lambda (a b) (> (length a) (length b)))))
- (if (not regexps+)
- (setq regexp (concat "^" org-outline-regexp))
- (setq regexp (pop regexps+))
- (if hdl-only (setq regexp (concat "^" org-outline-regexp ".*?"
- regexp))))
- (setq files (org-agenda-files nil 'ifmode))
- (when (eq (car org-agenda-text-search-extra-files) 'agenda-archives)
- (pop org-agenda-text-search-extra-files)
- (setq files (org-add-archive-files files)))
- (setq files (append files org-agenda-text-search-extra-files)
- rtnall nil)
- (while (setq file (pop files))
- (setq ee nil)
- (catch 'nextfile
- (org-check-agenda-file file)
- (setq buffer (if (file-exists-p file)
- (org-get-agenda-file-buffer file)
- (error "No such file %s" file)))
- (if (not buffer)
- ;; If file does not exist, make sure an error message is sent
- (setq rtn (list (format "ORG-AGENDA-ERROR: No such org-file %s"
- file))))
- (with-current-buffer buffer
- (with-syntax-table (org-search-syntax-table)
- (unless (org-mode-p)
- (error "Agenda file %s is not in `org-mode'" file))
- (let ((case-fold-search t))
- (save-excursion
- (save-restriction
- (if org-agenda-restrict
- (narrow-to-region org-agenda-restrict-begin
- org-agenda-restrict-end)
- (widen))
- (goto-char (point-min))
- (unless (or (org-on-heading-p)
- (outline-next-heading))
- (throw 'nextfile t))
- (goto-char (max (point-min) (1- (point))))
- (while (re-search-forward regexp nil t)
- (org-back-to-heading t)
- (skip-chars-forward "* ")
- (setq beg (point-at-bol)
- beg1 (point)
- end (progn (outline-next-heading) (point)))
- (catch :skip
- (goto-char beg)
- (org-agenda-skip)
- (setq str (buffer-substring-no-properties
- (point-at-bol)
- (if hdl-only (point-at-eol) end)))
- (mapc (lambda (wr) (when (string-match wr str)
- (goto-char (1- end))
- (throw :skip t)))
- regexps-)
- (mapc (lambda (wr) (unless (string-match wr str)
- (goto-char (1- end))
- (throw :skip t)))
- (if todo-only
- (cons (concat "^\*+[ \t]+" org-not-done-regexp)
- regexps+)
- regexps+))
- (goto-char beg)
- (setq marker (org-agenda-new-marker (point))
- category (org-get-category)
- tags (org-get-tags-at (point))
- txt (org-format-agenda-item
- ""
- (buffer-substring-no-properties
- beg1 (point-at-eol))
- category tags))
- (org-add-props txt props
- 'org-marker marker 'org-hd-marker marker
- 'org-todo-regexp org-todo-regexp
- 'org-complex-heading-regexp org-complex-heading-regexp
- 'priority 1000 'org-category category
- 'type "search")
- (push txt ee)
- (goto-char (1- end))))))))))
- (setq rtn (nreverse ee))
- (setq rtnall (append rtnall rtn)))
- (if org-agenda-overriding-header
- (insert (org-add-props (copy-sequence org-agenda-overriding-header)
- nil 'face 'org-agenda-structure) "\n")
- (insert "Search words: ")
- (add-text-properties (point-min) (1- (point))
- (list 'face 'org-agenda-structure))
- (setq pos (point))
- (insert string "\n")
- (add-text-properties pos (1- (point)) (list 'face 'org-warning))
- (setq pos (point))
- (unless org-agenda-multi
- (insert "Press `[', `]' to add/sub word, `{', `}' to add/sub regexp, `C-u r' to edit\n")
- (add-text-properties pos (1- (point))
- (list 'face 'org-agenda-structure))))
- (org-agenda-mark-header-line (point-min))
- (when rtnall
- (insert (org-finalize-agenda-entries rtnall) "\n"))
- (goto-char (point-min))
- (or org-agenda-multi (org-fit-agenda-window))
- (add-text-properties (point-min) (point-max) '(org-agenda-type search))
- (org-finalize-agenda)
- (setq buffer-read-only t)))
-
-;;; Agenda TODO list
-
-(defvar org-select-this-todo-keyword nil)
-(defvar org-last-arg nil)
-
-;;;###autoload
-(defun org-todo-list (arg)
- "Show all (not done) TODO entries from all agenda file in a single list.
-The prefix arg can be used to select a specific TODO keyword and limit
-the list to these. When using \\[universal-argument], you will be prompted
-for a keyword. A numeric prefix directly selects the Nth keyword in
-`org-todo-keywords-1'."
- (interactive "P")
- (org-compile-prefix-format 'todo)
- (org-set-sorting-strategy 'todo)
- (org-prepare-agenda "TODO")
- (if (and (stringp arg) (not (string-match "\\S-" arg))) (setq arg nil))
- (let* ((today (org-today))
- (date (calendar-gregorian-from-absolute today))
- (kwds org-todo-keywords-for-agenda)
- (completion-ignore-case t)
- (org-select-this-todo-keyword
- (if (stringp arg) arg
- (and arg (integerp arg) (> arg 0)
- (nth (1- arg) kwds))))
- rtn rtnall files file pos)
- (when (equal arg '(4))
- (setq org-select-this-todo-keyword
- (org-icompleting-read "Keyword (or KWD1|K2D2|...): "
- (mapcar 'list kwds) nil nil)))
- (and (equal 0 arg) (setq org-select-this-todo-keyword nil))
- (org-set-local 'org-last-arg arg)
- (setq org-agenda-redo-command
- '(org-todo-list (or current-prefix-arg org-last-arg)))
- (setq files (org-agenda-files nil 'ifmode)
- rtnall nil)
- (while (setq file (pop files))
- (catch 'nextfile
- (org-check-agenda-file file)
- (setq rtn (org-agenda-get-day-entries file date :todo))
- (setq rtnall (append rtnall rtn))))
- (if org-agenda-overriding-header
- (insert (org-add-props (copy-sequence org-agenda-overriding-header)
- nil 'face 'org-agenda-structure) "\n")
- (insert "Global list of TODO items of type: ")
- (add-text-properties (point-min) (1- (point))
- (list 'face 'org-agenda-structure
- 'short-heading
- (concat "ToDo: "
- (or org-select-this-todo-keyword "ALL"))))
- (org-agenda-mark-header-line (point-min))
- (setq pos (point))
- (insert (or org-select-this-todo-keyword "ALL") "\n")
- (add-text-properties pos (1- (point)) (list 'face 'org-warning))
- (setq pos (point))
- (unless org-agenda-multi
- (insert "Available with `N r': (0)ALL")
- (let ((n 0) s)
- (mapc (lambda (x)
- (setq s (format "(%d)%s" (setq n (1+ n)) x))
- (if (> (+ (current-column) (string-width s) 1) (frame-width))
- (insert "\n "))
- (insert " " s))
- kwds))
- (insert "\n"))
- (add-text-properties pos (1- (point)) (list 'face 'org-agenda-structure)))
- (org-agenda-mark-header-line (point-min))
- (when rtnall
- (insert (org-finalize-agenda-entries rtnall) "\n"))
- (goto-char (point-min))
- (or org-agenda-multi (org-fit-agenda-window))
- (add-text-properties (point-min) (point-max) '(org-agenda-type todo))
- (org-finalize-agenda)
- (setq buffer-read-only t)))
-
-;;; Agenda tags match
-
-;;;###autoload
-(defun org-tags-view (&optional todo-only match)
- "Show all headlines for all `org-agenda-files' matching a TAGS criterion.
-The prefix arg TODO-ONLY limits the search to TODO entries."
- (interactive "P")
- (org-compile-prefix-format 'tags)
- (org-set-sorting-strategy 'tags)
- (let* ((org-tags-match-list-sublevels
- org-tags-match-list-sublevels)
- (completion-ignore-case t)
- rtn rtnall files file pos matcher
- buffer)
- (when (and (stringp match) (not (string-match "\\S-" match)))
- (setq match nil))
- (setq matcher (org-make-tags-matcher match)
- match (car matcher) matcher (cdr matcher))
- (org-prepare-agenda (concat "TAGS " match))
- (setq org-agenda-query-string match)
- (setq org-agenda-redo-command
- (list 'org-tags-view (list 'quote todo-only)
- (list 'if 'current-prefix-arg nil 'org-agenda-query-string)))
- (setq files (org-agenda-files nil 'ifmode)
- rtnall nil)
- (while (setq file (pop files))
- (catch 'nextfile
- (org-check-agenda-file file)
- (setq buffer (if (file-exists-p file)
- (org-get-agenda-file-buffer file)
- (error "No such file %s" file)))
- (if (not buffer)
- ;; If file does not exist, error message to agenda
- (setq rtn (list
- (format "ORG-AGENDA-ERROR: No such org-file %s" file))
- rtnall (append rtnall rtn))
- (with-current-buffer buffer
- (unless (org-mode-p)
- (error "Agenda file %s is not in `org-mode'" file))
- (save-excursion
- (save-restriction
- (if org-agenda-restrict
- (narrow-to-region org-agenda-restrict-begin
- org-agenda-restrict-end)
- (widen))
- (setq rtn (org-scan-tags 'agenda matcher todo-only))
- (setq rtnall (append rtnall rtn))))))))
- (if org-agenda-overriding-header
- (insert (org-add-props (copy-sequence org-agenda-overriding-header)
- nil 'face 'org-agenda-structure) "\n")
- (insert "Headlines with TAGS match: ")
- (add-text-properties (point-min) (1- (point))
- (list 'face 'org-agenda-structure
- 'short-heading
- (concat "Match: " match)))
- (setq pos (point))
- (insert match "\n")
- (add-text-properties pos (1- (point)) (list 'face 'org-warning))
- (setq pos (point))
- (unless org-agenda-multi
- (insert "Press `C-u r' to search again with new search string\n"))
- (add-text-properties pos (1- (point)) (list 'face 'org-agenda-structure)))
- (org-agenda-mark-header-line (point-min))
- (when rtnall
- (insert (org-finalize-agenda-entries rtnall) "\n"))
- (goto-char (point-min))
- (or org-agenda-multi (org-fit-agenda-window))
- (add-text-properties (point-min) (point-max) '(org-agenda-type tags))
- (org-finalize-agenda)
- (setq buffer-read-only t)))
-
-;;; Agenda Finding stuck projects
-
-(defvar org-agenda-skip-regexp nil
- "Regular expression used in skipping subtrees for the agenda.
-This is basically a temporary global variable that can be set and then
-used by user-defined selections using `org-agenda-skip-function'.")
-
-(defvar org-agenda-overriding-header nil
- "When this is set during todo and tags searches, will replace header.
-This variable should not be set directly, but custom commands can bind it
-in the options section.")
-
-(defun org-agenda-skip-entry-when-regexp-matches ()
- "Check if the current entry contains match for `org-agenda-skip-regexp'.
-If yes, it returns the end position of this entry, causing agenda commands
-to skip the entry but continuing the search in the subtree. This is a
-function that can be put into `org-agenda-skip-function' for the duration
-of a command."
- (let ((end (save-excursion (org-end-of-subtree t)))
- skip)
- (save-excursion
- (setq skip (re-search-forward org-agenda-skip-regexp end t)))
- (and skip end)))
-
-(defun org-agenda-skip-subtree-when-regexp-matches ()
- "Check if the current subtree contains match for `org-agenda-skip-regexp'.
-If yes, it returns the end position of this tree, causing agenda commands
-to skip this subtree. This is a function that can be put into
-`org-agenda-skip-function' for the duration of a command."
- (let ((end (save-excursion (org-end-of-subtree t)))
- skip)
- (save-excursion
- (setq skip (re-search-forward org-agenda-skip-regexp end t)))
- (and skip end)))
-
-(defun org-agenda-skip-entry-when-regexp-matches-in-subtree ()
- "Check if the current subtree contains match for `org-agenda-skip-regexp'.
-If yes, it returns the end position of the current entry (NOT the tree),
-causing agenda commands to skip the entry but continuing the search in
-the subtree. This is a function that can be put into
-`org-agenda-skip-function' for the duration of a command. An important
-use of this function is for the stuck project list."
- (let ((end (save-excursion (org-end-of-subtree t)))
- (entry-end (save-excursion (outline-next-heading) (1- (point))))
- skip)
- (save-excursion
- (setq skip (re-search-forward org-agenda-skip-regexp end t)))
- (and skip entry-end)))
-
-(defun org-agenda-skip-entry-if (&rest conditions)
- "Skip entry if any of CONDITIONS is true.
-See `org-agenda-skip-if' for details."
- (org-agenda-skip-if nil conditions))
-
-(defun org-agenda-skip-subtree-if (&rest conditions)
- "Skip entry if any of CONDITIONS is true.
-See `org-agenda-skip-if' for details."
- (org-agenda-skip-if t conditions))
-
-(defun org-agenda-skip-if (subtree conditions)
- "Checks current entity for CONDITIONS.
-If SUBTREE is non-nil, the entire subtree is checked. Otherwise, only
-the entry, i.e. the text before the next heading is checked.
-
-CONDITIONS is a list of symbols, boolean OR is used to combine the results
-from different tests. Valid conditions are:
-
-scheduled Check if there is a scheduled cookie
-notscheduled Check if there is no scheduled cookie
-deadline Check if there is a deadline
-notdeadline Check if there is no deadline
-timestamp Check if there is a timestamp (also deadline or scheduled)
-nottimestamp Check if there is no timestamp (also deadline or scheduled)
-regexp Check if regexp matches
-notregexp Check if regexp does not match.
-todo Check if TODO keyword matches
-nottodo Check if TODO keyword does not match
-
-The regexp is taken from the conditions list, it must come right after
-the `regexp' or `notregexp' element.
-
-`todo' and `nottodo' accept as an argument a list of todo
-keywords, which may include \"*\" to match any todo keyword.
-
- (org-agenda-skip-entry-if 'todo '(\"TODO\" \"WAITING\"))
-
-would skip all entries with \"TODO\" or \"WAITING\" keywords.
-
-Instead of a list a keyword class may be given
-
- (org-agenda-skip-entry-if 'nottodo 'done)
-
-would skip entries that haven't been marked with any of \"DONE\"
-keywords. Possible classes are: `todo', `done', `any'.
-
-If any of these conditions is met, this function returns the end point of
-the entity, causing the search to continue from there. This is a function
-that can be put into `org-agenda-skip-function' for the duration of a command."
- (let (beg end m)
- (org-back-to-heading t)
- (setq beg (point)
- end (if subtree
- (progn (org-end-of-subtree t) (point))
- (progn (outline-next-heading) (1- (point)))))
- (goto-char beg)
- (and
- (or
- (and (memq 'scheduled conditions)
- (re-search-forward org-scheduled-time-regexp end t))
- (and (memq 'notscheduled conditions)
- (not (re-search-forward org-scheduled-time-regexp end t)))
- (and (memq 'deadline conditions)
- (re-search-forward org-deadline-time-regexp end t))
- (and (memq 'notdeadline conditions)
- (not (re-search-forward org-deadline-time-regexp end t)))
- (and (memq 'timestamp conditions)
- (re-search-forward org-ts-regexp end t))
- (and (memq 'nottimestamp conditions)
- (not (re-search-forward org-ts-regexp end t)))
- (and (setq m (memq 'regexp conditions))
- (stringp (nth 1 m))
- (re-search-forward (nth 1 m) end t))
- (and (setq m (memq 'notregexp conditions))
- (stringp (nth 1 m))
- (not (re-search-forward (nth 1 m) end t)))
- (and (or
- (setq m (memq 'todo conditions))
- (setq m (memq 'nottodo conditions)))
- (org-agenda-skip-if-todo m end)))
- end)))
-
-(defun org-agenda-skip-if-todo (args end)
- "Helper function for `org-agenda-skip-if', do not use it directly.
-ARGS is a list with first element either `todo' or `nottodo'.
-The remainder is either a list of TODO keywords, or a state symbol
-`todo' or `done' or `any'."
- (let ((kw (car args))
- (arg (cadr args))
- todo-wds todo-re)
- (setq todo-wds
- (org-uniquify
- (cond
- ((listp arg) ;; list of keywords
- (if (member "*" arg)
- (mapcar 'substring-no-properties org-todo-keywords-1)
- arg))
- ((symbolp arg) ;; keyword class name
- (cond
- ((eq arg 'todo)
- (org-delete-all org-done-keywords
- (mapcar 'substring-no-properties
- org-todo-keywords-1)))
- ((eq arg 'done) org-done-keywords)
- ((eq arg 'any)
- (mapcar 'substring-no-properties org-todo-keywords-1)))))))
- (setq todo-re
- (concat "^\\*+[ \t]+\\<\\("
- (mapconcat 'identity todo-wds "\\|")
- "\\)\\>"))
- (if (eq kw 'todo)
- (re-search-forward todo-re end t)
- (not (re-search-forward todo-re end t)))))
-
-;;;###autoload
-(defun org-agenda-list-stuck-projects (&rest ignore)
- "Create agenda view for projects that are stuck.
-Stuck projects are project that have no next actions. For the definitions
-of what a project is and how to check if it stuck, customize the variable
-`org-stuck-projects'."
- (interactive)
- (let* ((org-agenda-skip-function
- 'org-agenda-skip-entry-when-regexp-matches-in-subtree)
- ;; We could have used org-agenda-skip-if here.
- (org-agenda-overriding-header
- (or org-agenda-overriding-header "List of stuck projects: "))
- (matcher (nth 0 org-stuck-projects))
- (todo (nth 1 org-stuck-projects))
- (todo-wds (if (member "*" todo)
- (progn
- (org-prepare-agenda-buffers (org-agenda-files
- nil 'ifmode))
- (org-delete-all
- org-done-keywords-for-agenda
- (copy-sequence org-todo-keywords-for-agenda)))
- todo))
- (todo-re (concat "^\\*+[ \t]+\\("
- (mapconcat 'identity todo-wds "\\|")
- "\\)\\>"))
- (tags (nth 2 org-stuck-projects))
- (tags-re (if (member "*" tags)
- (org-re "^\\*+ .*:[[:alnum:]_@#%]+:[ \t]*$")
- (if tags
- (concat "^\\*+ .*:\\("
- (mapconcat 'identity tags "\\|")
- (org-re "\\):[[:alnum:]_@#%:]*[ \t]*$")))))
- (gen-re (nth 3 org-stuck-projects))
- (re-list
- (delq nil
- (list
- (if todo todo-re)
- (if tags tags-re)
- (and gen-re (stringp gen-re) (string-match "\\S-" gen-re)
- gen-re)))))
- (setq org-agenda-skip-regexp
- (if re-list
- (mapconcat 'identity re-list "\\|")
- (error "No information how to identify unstuck projects")))
- (org-tags-view nil matcher)
- (with-current-buffer org-agenda-buffer-name
- (setq org-agenda-redo-command
- '(org-agenda-list-stuck-projects
- (or current-prefix-arg org-last-arg))))))
-
-;;; Diary integration
-
-(defvar org-disable-agenda-to-diary nil) ;Dynamically-scoped param.
-(defvar list-diary-entries-hook)
-
-(defun org-get-entries-from-diary (date)
- "Get the (Emacs Calendar) diary entries for DATE."
- (require 'diary-lib)
- (let* ((diary-fancy-buffer "*temporary-fancy-diary-buffer*")
- (diary-display-hook '(fancy-diary-display))
- (diary-display-function 'fancy-diary-display)
- (pop-up-frames nil)
- (list-diary-entries-hook
- (cons 'org-diary-default-entry list-diary-entries-hook))
- (diary-file-name-prefix-function nil) ; turn this feature off
- (diary-modify-entry-list-string-function 'org-modify-diary-entry-string)
- entries
- (org-disable-agenda-to-diary t))
- (save-excursion
- (save-window-excursion
- (funcall (if (fboundp 'diary-list-entries)
- 'diary-list-entries 'list-diary-entries)
- date 1)))
- (if (not (get-buffer diary-fancy-buffer))
- (setq entries nil)
- (with-current-buffer diary-fancy-buffer
- (setq buffer-read-only nil)
- (if (zerop (buffer-size))
- ;; No entries
- (setq entries nil)
- ;; Omit the date and other unnecessary stuff
- (org-agenda-cleanup-fancy-diary)
- ;; Add prefix to each line and extend the text properties
- (if (zerop (buffer-size))
- (setq entries nil)
- (setq entries (buffer-substring (point-min) (- (point-max) 1)))))
- (set-buffer-modified-p nil)
- (kill-buffer diary-fancy-buffer)))
- (when entries
- (setq entries (org-split-string entries "\n"))
- (setq entries
- (mapcar
- (lambda (x)
- (setq x (org-format-agenda-item "" x "Diary" nil 'time))
- ;; Extend the text properties to the beginning of the line
- (org-add-props x (text-properties-at (1- (length x)) x)
- 'type "diary" 'date date 'face 'org-agenda-diary))
- entries)))))
-
-(defvar org-agenda-cleanup-fancy-diary-hook nil
- "Hook run when the fancy diary buffer is cleaned up.")
-
-(defun org-agenda-cleanup-fancy-diary ()
- "Remove unwanted stuff in buffer created by `fancy-diary-display'.
-This gets rid of the date, the underline under the date, and
-the dummy entry installed by `org-mode' to ensure non-empty diary for each
-date. It also removes lines that contain only whitespace."
- (goto-char (point-min))
- (if (looking-at ".*?:[ \t]*")
- (progn
- (replace-match "")
- (re-search-forward "\n=+$" nil t)
- (replace-match "")
- (while (re-search-backward "^ +\n?" nil t) (replace-match "")))
- (re-search-forward "\n=+$" nil t)
- (delete-region (point-min) (min (point-max) (1+ (match-end 0)))))
- (goto-char (point-min))
- (while (re-search-forward "^ +\n" nil t)
- (replace-match ""))
- (goto-char (point-min))
- (if (re-search-forward "^Org-mode dummy\n?" nil t)
- (replace-match ""))
- (run-hooks 'org-agenda-cleanup-fancy-diary-hook))
-
-;; Make sure entries from the diary have the right text properties.
-(eval-after-load "diary-lib"
- '(if (boundp 'diary-modify-entry-list-string-function)
- ;; We can rely on the hook, nothing to do
- nil
- ;; Hook not available, must use advice to make this work
- (defadvice add-to-diary-list (before org-mark-diary-entry activate)
- "Make the position visible."
- (if (and org-disable-agenda-to-diary ;; called from org-agenda
- (stringp string)
- buffer-file-name)
- (setq string (org-modify-diary-entry-string string))))))
-
-(defun org-modify-diary-entry-string (string)
- "Add text properties to string, allowing org-mode to act on it."
- (org-add-props string nil
- 'mouse-face 'highlight
- 'help-echo (if buffer-file-name
- (format "mouse-2 or RET jump to diary file %s"
- (abbreviate-file-name buffer-file-name))
- "")
- 'org-agenda-diary-link t
- 'org-marker (org-agenda-new-marker (point-at-bol))))
-
-(defun org-diary-default-entry ()
- "Add a dummy entry to the diary.
-Needed to avoid empty dates which mess up holiday display."
- ;; Catch the error if dealing with the new add-to-diary-alist
- (when org-disable-agenda-to-diary
- (condition-case nil
- (org-add-to-diary-list original-date "Org-mode dummy" "")
- (error
- (org-add-to-diary-list original-date "Org-mode dummy" "" nil)))))
-
-(defun org-add-to-diary-list (&rest args)
- (if (fboundp 'diary-add-to-list)
- (apply 'diary-add-to-list args)
- (apply 'add-to-diary-list args)))
-
-(defvar org-diary-last-run-time nil)
-
-;;;###autoload
-(defun org-diary (&rest args)
- "Return diary information from org-files.
-This function can be used in a \"sexp\" diary entry in the Emacs calendar.
-It accesses org files and extracts information from those files to be
-listed in the diary. The function accepts arguments specifying what
-items should be listed. For a list of arguments allowed here, see the
-variable `org-agenda-entry-types'.
-
-The call in the diary file should look like this:
-
- &%%(org-diary) ~/path/to/some/orgfile.org
-
-Use a separate line for each org file to check. Or, if you omit the file name,
-all files listed in `org-agenda-files' will be checked automatically:
-
- &%%(org-diary)
-
-If you don't give any arguments (as in the example above), the default
-arguments (:deadline :scheduled :timestamp :sexp) are used.
-So the example above may also be written as
-
- &%%(org-diary :deadline :timestamp :sexp :scheduled)
-
-The function expects the lisp variables `entry' and `date' to be provided
-by the caller, because this is how the calendar works. Don't use this
-function from a program - use `org-agenda-get-day-entries' instead."
- (when (> (- (org-float-time)
- org-agenda-last-marker-time)
- 5)
- (org-agenda-reset-markers))
- (org-compile-prefix-format 'agenda)
- (org-set-sorting-strategy 'agenda)
- (setq args (or args '(:deadline :scheduled :timestamp :sexp)))
- (let* ((files (if (and entry (stringp entry) (string-match "\\S-" entry))
- (list entry)
- (org-agenda-files t)))
- (time (org-float-time))
- file rtn results)
- (when (or (not org-diary-last-run-time)
- (> (- time
- org-diary-last-run-time)
- 3))
- (org-prepare-agenda-buffers files))
- (setq org-diary-last-run-time time)
- ;; If this is called during org-agenda, don't return any entries to
- ;; the calendar. Org Agenda will list these entries itself.
- (if org-disable-agenda-to-diary (setq files nil))
- (while (setq file (pop files))
- (setq rtn (apply 'org-agenda-get-day-entries file date args))
- (setq results (append results rtn)))
- (if results
- (concat (org-finalize-agenda-entries results) "\n"))))
-
-;;; Agenda entry finders
-
-(defun org-agenda-get-day-entries (file date &rest args)
- "Does the work for `org-diary' and `org-agenda'.
-FILE is the path to a file to be checked for entries. DATE is date like
-the one returned by `calendar-current-date'. ARGS are symbols indicating
-which kind of entries should be extracted. For details about these, see
-the documentation of `org-diary'."
- (setq args (or args '(:deadline :scheduled :timestamp :sexp)))
- (let* ((org-startup-folded nil)
- (org-startup-align-all-tables nil)
- (buffer (if (file-exists-p file)
- (org-get-agenda-file-buffer file)
- (error "No such file %s" file)))
- arg results rtn deadline-results)
- (if (not buffer)
- ;; If file does not exist, make sure an error message ends up in diary
- (list (format "ORG-AGENDA-ERROR: No such org-file %s" file))
- (with-current-buffer buffer
- (unless (org-mode-p)
- (error "Agenda file %s is not in `org-mode'" file))
- (let ((case-fold-search nil))
- (save-excursion
- (save-restriction
- (if org-agenda-restrict
- (narrow-to-region org-agenda-restrict-begin
- org-agenda-restrict-end)
- (widen))
- ;; The way we repeatedly append to `results' makes it O(n^2) :-(
- (while (setq arg (pop args))
- (cond
- ((and (eq arg :todo)
- (equal date (calendar-current-date)))
- (setq rtn (org-agenda-get-todos))
- (setq results (append results rtn)))
- ((eq arg :timestamp)
- (setq rtn (org-agenda-get-blocks))
- (setq results (append results rtn))
- (setq rtn (org-agenda-get-timestamps))
- (setq results (append results rtn)))
- ((eq arg :sexp)
- (setq rtn (org-agenda-get-sexps))
- (setq results (append results rtn)))
- ((eq arg :scheduled)
- (setq rtn (org-agenda-get-scheduled deadline-results))
- (setq results (append results rtn)))
- ((eq arg :closed)
- (setq rtn (org-agenda-get-progress))
- (setq results (append results rtn)))
- ((eq arg :deadline)
- (setq rtn (org-agenda-get-deadlines))
- (setq deadline-results (copy-sequence rtn))
- (setq results (append results rtn))))))))
- results))))
-
-(defun org-agenda-get-todos ()
- "Return the TODO information for agenda display."
- (let* ((props (list 'face nil
- 'done-face 'org-agenda-done
- 'org-not-done-regexp org-not-done-regexp
- 'org-todo-regexp org-todo-regexp
- 'org-complex-heading-regexp org-complex-heading-regexp
- 'mouse-face 'highlight
- 'help-echo
- (format "mouse-2 or RET jump to org file %s"
- (abbreviate-file-name buffer-file-name))))
- (regexp (concat "^\\*+[ \t]+\\("
- (if org-select-this-todo-keyword
- (if (equal org-select-this-todo-keyword "*")
- org-todo-regexp
- (concat "\\<\\("
- (mapconcat 'identity (org-split-string org-select-this-todo-keyword "|") "\\|")
- "\\)\\>"))
- org-not-done-regexp)
- "[^\n\r]*\\)"))
- marker priority category tags todo-state
- ee txt beg end)
- (goto-char (point-min))
- (while (re-search-forward regexp nil t)
- (catch :skip
- (save-match-data
- (beginning-of-line)
- (setq beg (point) end (save-excursion (outline-next-heading) (point)))
- (when (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item end)
- (goto-char (1+ beg))
- (or org-agenda-todo-list-sublevels (org-end-of-subtree 'invisible))
- (throw :skip nil)))
- (goto-char beg)
- (org-agenda-skip)
- (goto-char (match-beginning 1))
- (setq marker (org-agenda-new-marker (match-beginning 0))
- category (org-get-category)
- txt (match-string 1)
- tags (org-get-tags-at (point))
- txt (org-format-agenda-item "" txt category tags)
- priority (1+ (org-get-priority txt))
- todo-state (org-get-todo-state))
- (org-add-props txt props
- 'org-marker marker 'org-hd-marker marker
- 'priority priority 'org-category category
- 'type "todo" 'todo-state todo-state)
- (push txt ee)
- (if org-agenda-todo-list-sublevels
- (goto-char (match-end 1))
- (org-end-of-subtree 'invisible))))
- (nreverse ee)))
-
-;;;###autoload
-(defun org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item
- (&optional end)
- "Do we have a reason to ignore this TODO entry because it has a time stamp?"
- (when (or org-agenda-todo-ignore-with-date
- org-agenda-todo-ignore-scheduled
- org-agenda-todo-ignore-deadlines
- org-agenda-todo-ignore-timestamp)
- (setq end (or end (save-excursion (outline-next-heading) (point))))
- (save-excursion
- (or (and org-agenda-todo-ignore-with-date
- (re-search-forward org-ts-regexp end t))
- (and org-agenda-todo-ignore-scheduled
- (re-search-forward org-scheduled-time-regexp end t)
- (cond
- ((eq org-agenda-todo-ignore-scheduled 'future)
- (> (org-days-to-time (match-string 1)) 0))
- ((eq org-agenda-todo-ignore-scheduled 'past)
- (<= (org-days-to-time (match-string 1)) 0))
- (t)))
- (and org-agenda-todo-ignore-deadlines
- (re-search-forward org-deadline-time-regexp end t)
- (cond
- ((memq org-agenda-todo-ignore-deadlines '(t all)) t)
- ((eq org-agenda-todo-ignore-deadlines 'far)
- (not (org-deadline-close (match-string 1))))
- ((eq org-agenda-todo-ignore-deadlines 'future)
- (> (org-days-to-time (match-string 1)) 0))
- ((eq org-agenda-todo-ignore-deadlines 'past)
- (<= (org-days-to-time (match-string 1)) 0))
- (t (org-deadline-close (match-string 1)))))
- (and org-agenda-todo-ignore-timestamp
- (let ((buffer (current-buffer))
- (regexp
- (concat
- org-scheduled-time-regexp "\\|" org-deadline-time-regexp))
- (start (point)))
- ;; Copy current buffer into a temporary one
- (with-temp-buffer
- (insert-buffer-substring buffer start end)
- (goto-char (point-min))
- ;; Delete SCHEDULED and DEADLINE items
- (while (re-search-forward regexp end t)
- (delete-region (match-beginning 0) (match-end 0)))
- (goto-char (point-min))
- ;; No search for timestamp left
- (when (re-search-forward org-ts-regexp nil t)
- (cond
- ((eq org-agenda-todo-ignore-timestamp 'future)
- (> (org-days-to-time (match-string 1)) 0))
- ((eq org-agenda-todo-ignore-timestamp 'past)
- (<= (org-days-to-time (match-string 1)) 0))
- (t))))))))))
-
-(defconst org-agenda-no-heading-message
- "No heading for this item in buffer or region.")
-
-(defun org-agenda-get-timestamps ()
- "Return the date stamp information for agenda display."
- (let* ((props (list 'face nil
- 'org-not-done-regexp org-not-done-regexp
- 'org-todo-regexp org-todo-regexp
- 'org-complex-heading-regexp org-complex-heading-regexp
- 'mouse-face 'highlight
- 'help-echo
- (format "mouse-2 or RET jump to org file %s"
- (abbreviate-file-name buffer-file-name))))
- (d1 (calendar-absolute-from-gregorian date))
- (remove-re
- (concat
- (regexp-quote
- (format-time-string
- "<%Y-%m-%d"
- (encode-time 0 0 0 (nth 1 date) (nth 0 date) (nth 2 date))))
- ".*?>"))
- (regexp
- (concat
- (if org-agenda-include-inactive-timestamps "[[<]" "<")
- (regexp-quote
- (substring
- (format-time-string
- (car org-time-stamp-formats)
- (apply 'encode-time ; DATE bound by calendar
- (list 0 0 0 (nth 1 date) (car date) (nth 2 date))))
- 1 11))
- "\\|\\(<[0-9]+-[0-9]+-[0-9]+[^>\n]+?\\+[0-9]+[dwmy]>\\)"
- "\\|\\(<%%\\(([^>\n]+)\\)>\\)"))
- marker hdmarker deadlinep scheduledp clockp closedp inactivep
- donep tmp priority category ee txt timestr tags b0 b3 e3 head
- todo-state end-of-match)
- (goto-char (point-min))
- (while (setq end-of-match (re-search-forward regexp nil t))
- (setq b0 (match-beginning 0)
- b3 (match-beginning 3) e3 (match-end 3))
- (catch :skip
- (and (org-at-date-range-p) (throw :skip nil))
- (org-agenda-skip)
- (if (and (match-end 1)
- (not (= d1 (org-time-string-to-absolute
- (match-string 1) d1 nil
- org-agenda-repeating-timestamp-show-all))))
- (throw :skip nil))
- (if (and e3
- (not (org-diary-sexp-entry (buffer-substring b3 e3) "" date)))
- (throw :skip nil))
- (setq tmp (buffer-substring (max (point-min)
- (- b0 org-ds-keyword-length))
- b0)
- timestr (if b3 "" (buffer-substring b0 (point-at-eol)))
- inactivep (= (char-after b0) ?\[)
- deadlinep (string-match org-deadline-regexp tmp)
- scheduledp (string-match org-scheduled-regexp tmp)
- closedp (and org-agenda-include-inactive-timestamps
- (string-match org-closed-string tmp))
- clockp (and org-agenda-include-inactive-timestamps
- (or (string-match org-clock-string tmp)
- (string-match "]-+\\'" tmp)))
- todo-state (ignore-errors (org-get-todo-state))
- donep (member todo-state org-done-keywords))
- (if (or scheduledp deadlinep closedp clockp
- (and donep org-agenda-skip-timestamp-if-done))
- (throw :skip t))
- (if (string-match ">" timestr)
- ;; substring should only run to end of time stamp
- (setq timestr (substring timestr 0 (match-end 0))))
- (setq marker (org-agenda-new-marker b0)
- category (org-get-category b0))
- (save-excursion
- (if (not (re-search-backward "^\\*+ " nil t))
- (setq txt org-agenda-no-heading-message)
- (goto-char (match-beginning 0))
- (setq hdmarker (org-agenda-new-marker)
- tags (org-get-tags-at))
- (looking-at "\\*+[ \t]+\\([^\r\n]+\\)")
- (setq head (match-string 1))
- (setq txt (org-format-agenda-item
- (if inactivep org-agenda-inactive-leader nil)
- head category tags timestr nil
- remove-re)))
- (setq priority (org-get-priority txt))
- (org-add-props txt props
- 'org-marker marker 'org-hd-marker hdmarker)
- (org-add-props txt nil 'priority priority
- 'org-category category 'date date
- 'todo-state todo-state
- 'type "timestamp")
- (push txt ee))
- (if org-agenda-skip-additional-timestamps-same-entry
- (outline-next-heading)
- (goto-char end-of-match))))
- (nreverse ee)))
-
-(defun org-agenda-get-sexps ()
- "Return the sexp information for agenda display."
- (require 'diary-lib)
- (let* ((props (list 'face nil
- 'mouse-face 'highlight
- 'help-echo
- (format "mouse-2 or RET jump to org file %s"
- (abbreviate-file-name buffer-file-name))))
- (regexp "^&?%%(")
- marker category ee txt tags entry result beg b sexp sexp-entry
- todo-state)
- (goto-char (point-min))
- (while (re-search-forward regexp nil t)
- (catch :skip
- (org-agenda-skip)
- (setq beg (match-beginning 0))
- (goto-char (1- (match-end 0)))
- (setq b (point))
- (forward-sexp 1)
- (setq sexp (buffer-substring b (point)))
- (setq sexp-entry (if (looking-at "[ \t]*\\(\\S-.*\\)")
- (org-trim (match-string 1))
- ""))
- (setq result (org-diary-sexp-entry sexp sexp-entry date))
- (when result
- (setq marker (org-agenda-new-marker beg)
- category (org-get-category beg)
- todo-state (org-get-todo-state))
-
- (dolist (r (if (stringp result)
- (list result)
- result)) ;; we expect a list here
- (if (string-match "\\S-" r)
- (setq txt r)
- (setq txt "SEXP entry returned empty string"))
-
- (setq txt (org-format-agenda-item
- "" txt category tags 'time))
- (org-add-props txt props 'org-marker marker)
- (org-add-props txt nil
- 'org-category category 'date date 'todo-state todo-state
- 'type "sexp")
- (push txt ee)))))
- (nreverse ee)))
-
-(defun org-diary-class (m1 d1 y1 m2 d2 y2 dayname &rest skip-weeks)
- "Entry applies if date is between dates on DAYNAME, but skips SKIP-WEEKS.
-The order of the first 2 times 3 arguments depends on the variable
-`calendar-date-style' or, if that is not defined, on `european-calendar-style'.
-So for American calendars, give this as MONTH DAY YEAR, for European as
-DAY MONTH YEAR, and for ISO as YEAR MONTH DAY.
-DAYNAME is a number between 0 (Sunday) and 6 (Saturday). SKIP-WEEKS
-is any number of ISO weeks in the block period for which the item should
-be skipped."
- (let* ((date1 (calendar-absolute-from-gregorian
- (org-order-calendar-date-args m1 d1 y1)))
- (date2 (calendar-absolute-from-gregorian
- (org-order-calendar-date-args m2 d2 y2)))
- (d (calendar-absolute-from-gregorian date)))
- (and
- (<= date1 d)
- (<= d date2)
- (= (calendar-day-of-week date) dayname)
- (or (not skip-weeks)
- (progn
- (require 'cal-iso)
- (not (member (car (calendar-iso-from-absolute d)) skip-weeks))))
- entry)))
-
-(defalias 'org-get-closed 'org-agenda-get-progress)
-(defun org-agenda-get-progress ()
- "Return the logged TODO entries for agenda display."
- (let* ((props (list 'mouse-face 'highlight
- 'org-not-done-regexp org-not-done-regexp
- 'org-todo-regexp org-todo-regexp
- 'org-complex-heading-regexp org-complex-heading-regexp
- 'help-echo
- (format "mouse-2 or RET jump to org file %s"
- (abbreviate-file-name buffer-file-name))))
- (items (if (consp org-agenda-show-log)
- org-agenda-show-log
- org-agenda-log-mode-items))
- (parts
- (delq nil
- (list
- (if (memq 'closed items) (concat "\\<" org-closed-string))
- (if (memq 'clock items) (concat "\\<" org-clock-string))
- (if (memq 'state items) "- State \"\\([a-zA-Z0-9]+\\)\".*?"))))
- (parts-re (if parts (mapconcat 'identity parts "\\|")
- (error "`org-agenda-log-mode-items' is empty")))
- (regexp (concat
- "\\(" parts-re "\\)"
- " *\\["
- (regexp-quote
- (substring
- (format-time-string
- (car org-time-stamp-formats)
- (apply 'encode-time ; DATE bound by calendar
- (list 0 0 0 (nth 1 date) (car date) (nth 2 date))))
- 1 11))))
- (org-agenda-search-headline-for-time nil)
- marker hdmarker priority category tags closedp statep clockp state
- ee txt extra timestr rest clocked)
- (goto-char (point-min))
- (while (re-search-forward regexp nil t)
- (catch :skip
- (org-agenda-skip)
- (setq marker (org-agenda-new-marker (match-beginning 0))
- closedp (equal (match-string 1) org-closed-string)
- statep (equal (string-to-char (match-string 1)) ?-)
- clockp (not (or closedp statep))
- state (and statep (match-string 2))
- category (org-get-category (match-beginning 0))
- timestr (buffer-substring (match-beginning 0) (point-at-eol))
- )
- (when (string-match "\\]" timestr)
- ;; substring should only run to end of time stamp
- (setq rest (substring timestr (match-end 0))
- timestr (substring timestr 0 (match-end 0)))
- (if (and (not closedp) (not statep)
- (string-match "\\([0-9]\\{1,2\\}:[0-9]\\{2\\}\\)\\].*?\\([0-9]\\{1,2\\}:[0-9]\\{2\\}\\)" rest))
- (progn (setq timestr (concat (substring timestr 0 -1)
- "-" (match-string 1 rest) "]"))
- (setq clocked (match-string 2 rest)))
- (setq clocked "-")))
- (save-excursion
- (setq extra nil)
- (cond
- ((not org-agenda-log-mode-add-notes))
- (statep
- (and (looking-at ".*\n[ \t]*\\([^-\n \t].*?\\)[ \t]*$")
- (setq extra (match-string 1))))
- (clockp
- (and (looking-at ".*\n[ \t]*-[ \t]+\\([^-\n \t].*?\\)[ \t]*$")
- (setq extra (match-string 1)))))
- (if (not (re-search-backward "^\\*+ " nil t))
- (setq txt org-agenda-no-heading-message)
- (goto-char (match-beginning 0))
- (setq hdmarker (org-agenda-new-marker)
- tags (org-get-tags-at))
- (looking-at "\\*+[ \t]+\\([^\r\n]+\\)")
- (setq txt (match-string 1))
- (when extra
- (if (string-match "\\([ \t]+\\)\\(:[^ \n\t]*?:\\)[ \t]*$" txt)
- (setq txt (concat (substring txt 0 (match-beginning 1))
- " - " extra " " (match-string 2 txt)))
- (setq txt (concat txt " - " extra))))
- (setq txt (org-format-agenda-item
- (cond
- (closedp "Closed: ")
- (statep (concat "State: (" state ")"))
- (t (concat "Clocked: (" clocked ")")))
- txt category tags timestr)))
- (setq priority 100000)
- (org-add-props txt props
- 'org-marker marker 'org-hd-marker hdmarker 'face 'org-agenda-done
- 'priority priority 'org-category category
- 'type "closed" 'date date
- 'undone-face 'org-warning 'done-face 'org-agenda-done)
- (push txt ee))
- (goto-char (point-at-eol))))
- (nreverse ee)))
-
-(defun org-agenda-get-deadlines ()
- "Return the deadline information for agenda display."
- (let* ((props (list 'mouse-face 'highlight
- 'org-not-done-regexp org-not-done-regexp
- 'org-todo-regexp org-todo-regexp
- 'org-complex-heading-regexp org-complex-heading-regexp
- 'help-echo
- (format "mouse-2 or RET jump to org file %s"
- (abbreviate-file-name buffer-file-name))))
- (regexp org-deadline-time-regexp)
- (todayp (org-agenda-todayp date)) ; DATE bound by calendar
- (d1 (calendar-absolute-from-gregorian date)) ; DATE bound by calendar
- d2 diff dfrac wdays pos pos1 category tags
- suppress-prewarning
- ee txt head face s todo-state upcomingp donep timestr)
- (goto-char (point-min))
- (while (re-search-forward regexp nil t)
- (setq suppress-prewarning nil)
- (catch :skip
- (org-agenda-skip)
- (when (and org-agenda-skip-deadline-prewarning-if-scheduled
- (save-match-data
- (string-match org-scheduled-time-regexp
- (buffer-substring (point-at-bol)
- (point-at-eol)))))
- (setq suppress-prewarning
- (if (integerp org-agenda-skip-deadline-prewarning-if-scheduled)
- org-agenda-skip-deadline-prewarning-if-scheduled
- 0)))
- (setq s (match-string 1)
- txt nil
- pos (1- (match-beginning 1))
- d2 (org-time-string-to-absolute
- (match-string 1) d1 'past
- org-agenda-repeating-timestamp-show-all)
- diff (- d2 d1)
- wdays (if suppress-prewarning
- (let ((org-deadline-warning-days suppress-prewarning))
- (org-get-wdays s))
- (org-get-wdays s))
- dfrac (/ (* 1.0 (- wdays diff)) (max wdays 1))
- upcomingp (and todayp (> diff 0)))
- ;; When to show a deadline in the calendar:
- ;; If the expiration is within wdays warning time.
- ;; Past-due deadlines are only shown on the current date
- (if (and (or (and (<= diff wdays)
- (and todayp (not org-agenda-only-exact-dates)))
- (= diff 0)))
- (save-excursion
- (setq todo-state (org-get-todo-state))
- (setq donep (member todo-state org-done-keywords))
- (if (and donep
- (or org-agenda-skip-deadline-if-done
- (not (= diff 0))))
- (setq txt nil)
- (setq category (org-get-category))
- (if (not (re-search-backward "^\\*+[ \t]+" nil t))
- (setq txt org-agenda-no-heading-message)
- (goto-char (match-end 0))
- (setq pos1 (match-beginning 0))
- (setq tags (org-get-tags-at pos1))
- (setq head (buffer-substring-no-properties
- (point)
- (progn (skip-chars-forward "^\r\n")
- (point))))
- (if (string-match " \\([012]?[0-9]:[0-9][0-9]\\)" s)
- (setq timestr
- (concat (substring s (match-beginning 1)) " "))
- (setq timestr 'time))
- (setq txt (org-format-agenda-item
- (if (= diff 0)
- (car org-agenda-deadline-leaders)
- (if (functionp
- (nth 1 org-agenda-deadline-leaders))
- (funcall
- (nth 1 org-agenda-deadline-leaders)
- diff date)
- (format (nth 1 org-agenda-deadline-leaders)
- diff)))
- head category tags
- (if (not (= diff 0)) nil timestr)))))
- (when txt
- (setq face (org-agenda-deadline-face dfrac wdays))
- (org-add-props txt props
- 'org-marker (org-agenda-new-marker pos)
- 'org-hd-marker (org-agenda-new-marker pos1)
- 'priority (+ (- diff)
- (org-get-priority txt))
- 'org-category category
- 'todo-state todo-state
- 'type (if upcomingp "upcoming-deadline" "deadline")
- 'date (if upcomingp date d2)
- 'face (if donep 'org-agenda-done face)
- 'undone-face face 'done-face 'org-agenda-done)
- (push txt ee))))))
- (nreverse ee)))
-
-(defun org-agenda-deadline-face (fraction &optional wdays)
- "Return the face to displaying a deadline item.
-FRACTION is what fraction of the head-warning time has passed."
- (if (equal wdays 0) (setq fraction 1.))
- (let ((faces org-agenda-deadline-faces) f)
- (catch 'exit
- (while (setq f (pop faces))
- (if (>= fraction (car f)) (throw 'exit (cdr f)))))))
-
-(defun org-agenda-get-scheduled (&optional deadline-results)
- "Return the scheduled information for agenda display."
- (let* ((props (list 'org-not-done-regexp org-not-done-regexp
- 'org-todo-regexp org-todo-regexp
- 'org-complex-heading-regexp org-complex-heading-regexp
- 'done-face 'org-agenda-done
- 'mouse-face 'highlight
- 'help-echo
- (format "mouse-2 or RET jump to org file %s"
- (abbreviate-file-name buffer-file-name))))
- (regexp org-scheduled-time-regexp)
- (todayp (org-agenda-todayp date)) ; DATE bound by calendar
- (d1 (calendar-absolute-from-gregorian date)) ; DATE bound by calendar
- mm
- (deadline-position-alist
- (mapcar (lambda (a) (and (setq mm (get-text-property
- 0 'org-hd-marker a))
- (cons (marker-position mm) a)))
- deadline-results))
- d2 diff pos pos1 category tags donep
- ee txt head pastschedp todo-state face timestr s habitp)
- (goto-char (point-min))
- (while (re-search-forward regexp nil t)
- (catch :skip
- (org-agenda-skip)
- (setq s (match-string 1)
- txt nil
- pos (1- (match-beginning 1))
- d2 (org-time-string-to-absolute
- (match-string 1) d1 'past
- org-agenda-repeating-timestamp-show-all)
- diff (- d2 d1))
- (setq pastschedp (and todayp (< diff 0)))
- ;; When to show a scheduled item in the calendar:
- ;; If it is on or past the date.
- (when (or (and (< diff 0)
- (< (abs diff) org-scheduled-past-days)
- (and todayp (not org-agenda-only-exact-dates)))
- (= diff 0))
- (save-excursion
- (setq todo-state (org-get-todo-state))
- (setq donep (member todo-state org-done-keywords))
- (setq habitp (and (functionp 'org-is-habit-p)
- (org-is-habit-p)))
- (if (and donep
- (or habitp org-agenda-skip-scheduled-if-done
- (not (= diff 0))))
- (setq txt nil)
- (setq category (org-get-category))
- (if (not (re-search-backward "^\\*+[ \t]+" nil t))
- (setq txt org-agenda-no-heading-message)
- (goto-char (match-end 0))
- (setq pos1 (match-beginning 0))
- (if habitp
- (if (or (not org-habit-show-habits)
- (and (not todayp)
- org-habit-show-habits-only-for-today))
- (throw :skip nil))
- (if (and
- (or (eq t org-agenda-skip-scheduled-if-deadline-is-shown)
- (and org-agenda-skip-scheduled-if-deadline-is-shown
- pastschedp))
- (setq mm (assoc pos1 deadline-position-alist)))
- (throw :skip nil)))
- (setq tags (org-get-tags-at))
- (setq head (buffer-substring-no-properties
- (point)
- (progn (skip-chars-forward "^\r\n") (point))))
- (if (string-match " \\([012]?[0-9]:[0-9][0-9]\\)" s)
- (setq timestr
- (concat (substring s (match-beginning 1)) " "))
- (setq timestr 'time))
- (setq txt (org-format-agenda-item
- (if (= diff 0)
- (car org-agenda-scheduled-leaders)
- (format (nth 1 org-agenda-scheduled-leaders)
- (- 1 diff)))
- head category tags
- (if (not (= diff 0)) nil timestr)
- nil nil habitp))))
- (when txt
- (setq face
- (cond
- ((and (not habitp) pastschedp)
- 'org-scheduled-previously)
- (todayp 'org-scheduled-today)
- (t 'org-scheduled))
- habitp (and habitp (org-habit-parse-todo)))
- (org-add-props txt props
- 'undone-face face
- 'face (if donep 'org-agenda-done face)
- 'org-marker (org-agenda-new-marker pos)
- 'org-hd-marker (org-agenda-new-marker pos1)
- 'type (if pastschedp "past-scheduled" "scheduled")
- 'date (if pastschedp d2 date)
- 'priority (if habitp
- (org-habit-get-priority habitp)
- (+ 94 (- 5 diff) (org-get-priority txt)))
- 'org-category category
- 'org-habit-p habitp
- 'todo-state todo-state)
- (push txt ee))))))
- (nreverse ee)))
-
-(defun org-agenda-get-blocks ()
- "Return the date-range information for agenda display."
- (let* ((props (list 'face nil
- 'org-not-done-regexp org-not-done-regexp
- 'org-todo-regexp org-todo-regexp
- 'org-complex-heading-regexp org-complex-heading-regexp
- 'mouse-face 'highlight
- 'help-echo
- (format "mouse-2 or RET jump to org file %s"
- (abbreviate-file-name buffer-file-name))))
- (regexp org-tr-regexp)
- (d0 (calendar-absolute-from-gregorian date))
- marker hdmarker ee txt d1 d2 s1 s2 timestr category todo-state tags pos
- head donep)
- (goto-char (point-min))
- (while (re-search-forward regexp nil t)
- (catch :skip
- (org-agenda-skip)
- (setq pos (point))
- (setq timestr (match-string 0)
- s1 (match-string 1)
- s2 (match-string 2)
- d1 (time-to-days (org-time-string-to-time s1))
- d2 (time-to-days (org-time-string-to-time s2)))
- (if (and (> (- d0 d1) -1) (> (- d2 d0) -1))
- ;; Only allow days between the limits, because the normal
- ;; date stamps will catch the limits.
- (save-excursion
- (setq todo-state (org-get-todo-state))
- (setq donep (member todo-state org-done-keywords))
- (if (and donep org-agenda-skip-timestamp-if-done)
- (throw :skip t))
- (setq marker (org-agenda-new-marker (point)))
- (setq category (org-get-category))
- (if (not (re-search-backward "^\\*+ " nil t))
- (setq txt org-agenda-no-heading-message)
- (goto-char (match-beginning 0))
- (setq hdmarker (org-agenda-new-marker (point)))
- (setq tags (org-get-tags-at))
- (looking-at "\\*+[ \t]+\\([^\r\n]+\\)")
- (setq head (match-string 1))
- (let ((remove-re
- (if org-agenda-remove-timeranges-from-blocks
- (concat
- "<" (regexp-quote s1) ".*?>"
- "--"
- "<" (regexp-quote s2) ".*?>")
- nil)))
- (setq txt (org-format-agenda-item
- (format
- (nth (if (= d1 d2) 0 1)
- org-agenda-timerange-leaders)
- (1+ (- d0 d1)) (1+ (- d2 d1)))
- head category tags
- timestr nil remove-re))))
- (org-add-props txt props
- 'org-marker marker 'org-hd-marker hdmarker
- 'type "block" 'date date
- 'todo-state todo-state
- 'priority (org-get-priority txt) 'org-category category)
- (push txt ee)))
- (goto-char pos)))
- ;; Sort the entries by expiration date.
- (nreverse ee)))
-
-;;; Agenda presentation and sorting
-
-(defvar org-prefix-has-time nil
- "A flag, set by `org-compile-prefix-format'.
-The flag is set if the currently compiled format contains a `%t'.")
-(defvar org-prefix-has-tag nil
- "A flag, set by `org-compile-prefix-format'.
-The flag is set if the currently compiled format contains a `%T'.")
-(defvar org-prefix-has-effort nil
- "A flag, set by `org-compile-prefix-format'.
-The flag is set if the currently compiled format contains a `%e'.")
-(defvar org-prefix-category-length nil
- "Used by `org-compile-prefix-format' to remember the category field width.")
-(defvar org-prefix-category-max-length nil
- "Used by `org-compile-prefix-format' to remember the category field width.")
-
-(defun org-agenda-get-category-icon (category)
- "Return an image for CATEGORY according to `org-agenda-category-icon-alist'."
- (dolist (entry org-agenda-category-icon-alist)
- (when (org-string-match-p (car entry) category)
- (if (listp (cadr entry))
- (return (cadr entry))
- (return (apply 'create-image (cdr entry)))))))
-
-(defun org-format-agenda-item (extra txt &optional category tags dotime
- noprefix remove-re habitp)
- "Format TXT to be inserted into the agenda buffer.
-In particular, it adds the prefix and corresponding text properties. EXTRA
-must be a string and replaces the `%s' specifier in the prefix format.
-CATEGORY (string, symbol or nil) may be used to overrule the default
-category taken from local variable or file name. It will replace the `%c'
-specifier in the format. DOTIME, when non-nil, indicates that a
-time-of-day should be extracted from TXT for sorting of this entry, and for
-the `%t' specifier in the format. When DOTIME is a string, this string is
-searched for a time before TXT is. NOPREFIX is a flag and indicates that
-only the correctly processes TXT should be returned - this is used by
-`org-agenda-change-all-lines'. TAGS can be the tags of the headline.
-Any match of REMOVE-RE will be removed from TXT."
- (save-match-data
- ;; Diary entries sometimes have extra whitespace at the beginning
- (if (string-match "^ +" txt) (setq txt (replace-match "" nil nil txt)))
-
- ;; Fix the tags part in txt
- (setq txt (org-agenda-fix-displayed-tags
- txt tags
- org-agenda-show-inherited-tags
- org-agenda-hide-tags-regexp))
- (let* ((category (or category
- (if (stringp org-category)
- org-category
- (and org-category (symbol-name org-category)))
- (if buffer-file-name
- (file-name-sans-extension
- (file-name-nondirectory buffer-file-name))
- "")))
- (category-icon (org-agenda-get-category-icon category))
- (category-icon (if category-icon
- (propertize " " 'display category-icon)
- ""))
- ;; time, tag, effort are needed for the eval of the prefix format
- (tag (if tags (nth (1- (length tags)) tags) ""))
- time effort neffort
- (ts (if dotime (concat
- (if (stringp dotime) dotime "")
- (and org-agenda-search-headline-for-time txt))))
- (time-of-day (and dotime (org-get-time-of-day ts)))
- stamp plain s0 s1 s2 t1 t2 rtn srp l
- duration thecategory)
- (and (org-mode-p) buffer-file-name
- (add-to-list 'org-agenda-contributing-files buffer-file-name))
- (when (and dotime time-of-day)
- ;; Extract starting and ending time and move them to prefix
- (when (or (setq stamp (string-match org-stamp-time-of-day-regexp ts))
- (setq plain (string-match org-plain-time-of-day-regexp ts)))
- (setq s0 (match-string 0 ts)
- srp (and stamp (match-end 3))
- s1 (match-string (if plain 1 2) ts)
- s2 (match-string (if plain 8 (if srp 4 6)) ts))
-
- ;; If the times are in TXT (not in DOTIMES), and the prefix will list
- ;; them, we might want to remove them there to avoid duplication.
- ;; The user can turn this off with a variable.
- (if (and org-prefix-has-time
- org-agenda-remove-times-when-in-prefix (or stamp plain)
- (string-match (concat (regexp-quote s0) " *") txt)
- (not (equal ?\] (string-to-char (substring txt (match-end 0)))))
- (if (eq org-agenda-remove-times-when-in-prefix 'beg)
- (= (match-beginning 0) 0)
- t))
- (setq txt (replace-match "" nil nil txt))))
- ;; Normalize the time(s) to 24 hour
- (if s1 (setq s1 (org-get-time-of-day s1 'string t)))
- (if s2 (setq s2 (org-get-time-of-day s2 'string t)))
- ;; Compute the duration
- (when s1
- (setq t1 (+ (* 60 (string-to-number (substring s1 0 2)))
- (string-to-number (substring s1 3)))
- t2 (cond
- (s2 (+ (* 60 (string-to-number (substring s2 0 2)))
- (string-to-number (substring s2 3))))
- (org-agenda-default-appointment-duration
- (+ t1 org-agenda-default-appointment-duration))
- (t nil)))
- (setq duration (if t2 (- t2 t1)))))
-
- (when (and s1 (not s2) org-agenda-default-appointment-duration
- (string-match "\\([0-9]+\\):\\([0-9]+\\)" s1))
- (let ((m (+ (string-to-number (match-string 2 s1))
- (* 60 (string-to-number (match-string 1 s1)))
- org-agenda-default-appointment-duration))
- h)
- (setq h (/ m 60) m (- m (* h 60)))
- (setq s2 (format "%02d:%02d" h m))))
-
- (when (string-match (org-re "\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$")
- txt)
- ;; Tags are in the string
- (if (or (eq org-agenda-remove-tags t)
- (and org-agenda-remove-tags
- org-prefix-has-tag))
- (setq txt (replace-match "" t t txt))
- (setq txt (replace-match
- (concat (make-string (max (- 50 (length txt)) 1) ?\ )
- (match-string 2 txt))
- t t txt))))
- (when (org-mode-p)
- (setq effort
- (condition-case nil
- (org-get-effort
- (or (get-text-property 0 'org-hd-marker txt)
- (get-text-property 0 'org-marker txt)))
- (error nil)))
- (when effort
- (setq neffort (org-hh:mm-string-to-minutes effort)
- effort (setq effort (concat "[" effort "]" )))))
-
- (when remove-re
- (while (string-match remove-re txt)
- (setq txt (replace-match "" t t txt))))
-
- ;; Create the final string
- (if noprefix
- (setq rtn txt)
- ;; Prepare the variables needed in the eval of the compiled format
- (setq time (cond (s2 (concat
- (org-agenda-time-of-day-to-ampm-maybe s1)
- "-" (org-agenda-time-of-day-to-ampm-maybe s2)
- (if org-agenda-timegrid-use-ampm " ")))
- (s1 (concat
- (org-agenda-time-of-day-to-ampm-maybe s1)
- (if org-agenda-timegrid-use-ampm
- "........ "
- "......")))
- (t ""))
- extra (or (and (not habitp) extra) "")
- category (if (symbolp category) (symbol-name category) category)
- thecategory (copy-sequence category))
- (if (string-match org-bracket-link-regexp category)
- (progn
- (setq l (if (match-end 3)
- (- (match-end 3) (match-beginning 3))
- (- (match-end 1) (match-beginning 1))))
- (when (< l (or org-prefix-category-length 0))
- (setq category (copy-sequence category))
- (org-add-props category nil
- 'extra-space (make-string
- (- org-prefix-category-length l 1) ?\ ))))
- (if (and org-prefix-category-max-length
- (>= (length category) org-prefix-category-max-length))
- (setq category (substring category 0 (1- org-prefix-category-max-length)))))
- ;; Evaluate the compiled format
- (setq rtn (concat (eval org-prefix-format-compiled) txt)))
-
- ;; And finally add the text properties
- (remove-text-properties 0 (length rtn) '(line-prefix t wrap-prefix t) rtn)
- (org-add-props rtn nil
- 'org-category (if thecategory (downcase thecategory) category)
- 'tags (mapcar 'org-downcase-keep-props tags)
- 'org-highest-priority org-highest-priority
- 'org-lowest-priority org-lowest-priority
- 'prefix-length (- (length rtn) (length txt))
- 'time-of-day time-of-day
- 'duration duration
- 'effort effort
- 'effort-minutes neffort
- 'txt txt
- 'time time
- 'extra extra
- 'dotime dotime))))
-
-(defun org-agenda-fix-displayed-tags (txt tags add-inherited hide-re)
- "Remove tags string from TXT, and add a modified list of tags.
-The modified list may contain inherited tags, and tags matched by
-`org-agenda-hide-tags-regexp' will be removed."
- (when (or add-inherited hide-re)
- (if (string-match (org-re "\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$") txt)
- (setq txt (substring txt 0 (match-beginning 0))))
- (setq tags
- (delq nil
- (mapcar (lambda (tg)
- (if (or (and hide-re (string-match hide-re tg))
- (and (not add-inherited)
- (get-text-property 0 'inherited tg)))
- nil
- tg))
- tags)))
- (when tags
- (let ((have-i (get-text-property 0 'inherited (car tags)))
- i)
- (setq txt (concat txt " :"
- (mapconcat
- (lambda (x)
- (setq i (get-text-property 0 'inherited x))
- (if (and have-i (not i))
- (progn
- (setq have-i nil)
- (concat ":" x))
- x))
- tags ":")
- (if have-i "::" ":"))))))
- txt)
-
-(defun org-downcase-keep-props (s)
- (let ((props (text-properties-at 0 s)))
- (setq s (downcase s))
- (add-text-properties 0 (length s) props s)
- s))
-
-(defvar org-agenda-sorting-strategy) ;; because the def is in a let form
-(defvar org-agenda-sorting-strategy-selected nil)
-
-(defun org-agenda-add-time-grid-maybe (list ndays todayp)
- (catch 'exit
- (cond ((not org-agenda-use-time-grid) (throw 'exit list))
- ((and todayp (member 'today (car org-agenda-time-grid))))
- ((and (= ndays 1) (member 'daily (car org-agenda-time-grid))))
- ((member 'weekly (car org-agenda-time-grid)))
- (t (throw 'exit list)))
- (let* ((have (delq nil (mapcar
- (lambda (x) (get-text-property 1 'time-of-day x))
- list)))
- (string (nth 1 org-agenda-time-grid))
- (gridtimes (nth 2 org-agenda-time-grid))
- (req (car org-agenda-time-grid))
- (remove (member 'remove-match req))
- new time)
- (if (and (member 'require-timed req) (not have))
- ;; don't show empty grid
- (throw 'exit list))
- (while (setq time (pop gridtimes))
- (unless (and remove (member time have))
- (setq time (replace-regexp-in-string " " "0" (format "%04s" time)))
- (push (org-format-agenda-item
- nil string "" nil
- (concat (substring time 0 -2) ":" (substring time -2)))
- new)
- (put-text-property
- 2 (length (car new)) 'face 'org-time-grid (car new))))
- (if (member 'time-up org-agenda-sorting-strategy-selected)
- (append new list)
- (append list new)))))
-
-(defun org-compile-prefix-format (key)
- "Compile the prefix format into a Lisp form that can be evaluated.
-The resulting form is returned and stored in the variable
-`org-prefix-format-compiled'."
- (setq org-prefix-has-time nil org-prefix-has-tag nil
- org-prefix-category-length nil org-prefix-has-effort nil)
- (let ((s (cond
- ((stringp org-agenda-prefix-format)
- org-agenda-prefix-format)
- ((assq key org-agenda-prefix-format)
- (cdr (assq key org-agenda-prefix-format)))
- (t " %-12:c%?-12t% s")))
- (start 0)
- varform vars var e c f opt)
- (while (string-match "%\\(\\?\\)?\\([-+]?[0-9.]*\\)\\([ .;,:!?=|/<>]?\\)\\([ctsei]\\)"
- s start)
- (setq var (cdr (assoc (match-string 4 s)
- '(("c" . category) ("t" . time) ("s" . extra)
- ("i" . category-icon) ("T" . tag) ("e" . effort))))
- c (or (match-string 3 s) "")
- opt (match-beginning 1)
- start (1+ (match-beginning 0)))
- (if (equal var 'time) (setq org-prefix-has-time t))
- (if (equal var 'tag) (setq org-prefix-has-tag t))
- (if (equal var 'effort) (setq org-prefix-has-effort t))
- (setq f (concat "%" (match-string 2 s) "s"))
- (when (equal var 'category)
- (setq org-prefix-category-length
- (floor (abs (string-to-number (match-string 2 s)))))
- (setq org-prefix-category-max-length
- (let ((x (match-string 2 s)))
- (save-match-data
- (if (string-match "\\.[0-9]+" x)
- (string-to-number (substring (match-string 0 x) 1)))))))
- (if opt
- (setq varform
- `(if (equal "" ,var)
- ""
- (format ,f (if (equal "" ,var) "" (concat ,var ,c)))))
- (setq varform `(format ,f (if (equal ,var "") "" (concat ,var ,c (get-text-property 0 'extra-space ,var))))))
- (setq s (replace-match "%s" t nil s))
- (push varform vars))
- (setq vars (nreverse vars))
- (setq org-prefix-format-compiled `(format ,s ,@vars))))
-
-(defun org-set-sorting-strategy (key)
- (if (symbolp (car org-agenda-sorting-strategy))
- ;; the old format
- (setq org-agenda-sorting-strategy-selected org-agenda-sorting-strategy)
- (setq org-agenda-sorting-strategy-selected
- (or (cdr (assq key org-agenda-sorting-strategy))
- (cdr (assq 'agenda org-agenda-sorting-strategy))
- '(time-up category-keep priority-down)))))
-
-(defun org-get-time-of-day (s &optional string mod24)
- "Check string S for a time of day.
-If found, return it as a military time number between 0 and 2400.
-If not found, return nil.
-The optional STRING argument forces conversion into a 5 character wide string
-HH:MM."
- (save-match-data
- (when
- (or (string-match "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)\\([AaPp][Mm]\\)?\\> *" s)
- (string-match "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)?\\([AaPp][Mm]\\)\\> *" s))
- (let* ((h (string-to-number (match-string 1 s)))
- (m (if (match-end 3) (string-to-number (match-string 3 s)) 0))
- (ampm (if (match-end 4) (downcase (match-string 4 s))))
- (am-p (equal ampm "am"))
- (h1 (cond ((not ampm) h)
- ((= h 12) (if am-p 0 12))
- (t (+ h (if am-p 0 12)))))
- (h2 (if (and string mod24 (not (and (= m 0) (= h1 24))))
- (mod h1 24) h1))
- (t0 (+ (* 100 h2) m))
- (t1 (concat (if (>= h1 24) "+" " ")
- (if (and org-agenda-time-leading-zero
- (< t0 1000)) "0" "")
- (if (< t0 100) "0" "")
- (if (< t0 10) "0" "")
- (int-to-string t0))))
- (if string (concat (substring t1 -4 -2) ":" (substring t1 -2)) t0)))))
-
-(defvar org-agenda-before-sorting-filter-function nil
- "Function to be applied to agenda items prior to sorting.
-Prior to sorting also means just before they are inserted into the agenda.
-
-To aid sorting, you may revisit the original entries and add more text
-properties which will later be used by the sorting functions.
-
-The function should take a string argument, an agenda line.
-It has access to the text properties in that line, which contain among
-other things, the property `org-hd-marker' that points to the entry
-where the line comes from. Note that not all lines going into the agenda
-have this property, only most.
-
-The function should return the modified string. It is probably best
-to ONLY change text properties.
-
-You can also use this function as a filter, by returning nil for lines
-you don't want to have in the agenda at all. For this application, you
-could bind the variable in the options section of a custom command.")
-
-(defun org-finalize-agenda-entries (list &optional nosort)
- "Sort and concatenate the agenda items."
- (setq list (mapcar 'org-agenda-highlight-todo list))
- (if nosort
- list
- (when org-agenda-before-sorting-filter-function
- (setq list (delq nil (mapcar org-agenda-before-sorting-filter-function list))))
- (mapconcat 'identity (sort list 'org-entries-lessp) "\n")))
-
-(defun org-agenda-highlight-todo (x)
- (let ((org-done-keywords org-done-keywords-for-agenda)
- (case-fold-search nil)
- re pl)
- (if (eq x 'line)
- (save-excursion
- (beginning-of-line 1)
- (setq re (org-get-at-bol 'org-todo-regexp))
- (goto-char (+ (point) (or (org-get-at-bol 'prefix-length) 0)))
- (when (looking-at (concat "[ \t]*\\.*\\(" re "\\) +"))
- (add-text-properties (match-beginning 0) (match-end 1)
- (list 'face (org-get-todo-face 1)))
- (let ((s (buffer-substring (match-beginning 1) (match-end 1))))
- (delete-region (match-beginning 1) (1- (match-end 0)))
- (goto-char (match-beginning 1))
- (insert (format org-agenda-todo-keyword-format s)))))
- (setq re (concat (get-text-property 0 'org-todo-regexp x))
- pl (get-text-property 0 'prefix-length x))
- (when (and re
- (equal (string-match (concat "\\(\\.*\\)" re "\\( +\\)")
- x (or pl 0)) pl))
- (add-text-properties
- (or (match-end 1) (match-end 0)) (match-end 0)
- (list 'face (org-get-todo-face (match-string 2 x)))
- x)
- (when (match-end 1)
- (setq x (concat (substring x 0 (match-end 1))
- (format org-agenda-todo-keyword-format
- (match-string 2 x))
- (org-add-props " " (text-properties-at 0 x))
- (substring x (match-end 3))))))
- x)))
-
-(defsubst org-cmp-priority (a b)
- "Compare the priorities of string A and B."
- (let ((pa (or (get-text-property 1 'priority a) 0))
- (pb (or (get-text-property 1 'priority b) 0)))
- (cond ((> pa pb) +1)
- ((< pa pb) -1)
- (t nil))))
-
-(defsubst org-cmp-effort (a b)
- "Compare the priorities of string A and B."
- (let* ((def (if org-sort-agenda-noeffort-is-high 32767 -1))
- (ea (or (get-text-property 1 'effort-minutes a) def))
- (eb (or (get-text-property 1 'effort-minutes b) def)))
- (cond ((> ea eb) +1)
- ((< ea eb) -1)
- (t nil))))
-
-(defsubst org-cmp-category (a b)
- "Compare the string values of categories of strings A and B."
- (let ((ca (or (get-text-property 1 'org-category a) ""))
- (cb (or (get-text-property 1 'org-category b) "")))
- (cond ((string-lessp ca cb) -1)
- ((string-lessp cb ca) +1)
- (t nil))))
-
-(defsubst org-cmp-todo-state (a b)
- "Compare the todo states of strings A and B."
- (let* ((ma (or (get-text-property 1 'org-marker a)
- (get-text-property 1 'org-hd-marker a)))
- (mb (or (get-text-property 1 'org-marker b)
- (get-text-property 1 'org-hd-marker b)))
- (fa (and ma (marker-buffer ma)))
- (fb (and mb (marker-buffer mb)))
- (todo-kwds
- (or (and fa (with-current-buffer fa org-todo-keywords-1))
- (and fb (with-current-buffer fb org-todo-keywords-1))))
- (ta (or (get-text-property 1 'todo-state a) ""))
- (tb (or (get-text-property 1 'todo-state b) ""))
- (la (- (length (member ta todo-kwds))))
- (lb (- (length (member tb todo-kwds))))
- (donepa (member ta org-done-keywords-for-agenda))
- (donepb (member tb org-done-keywords-for-agenda)))
- (cond ((and donepa (not donepb)) -1)
- ((and (not donepa) donepb) +1)
- ((< la lb) -1)
- ((< lb la) +1)
- (t nil))))
-
-(defsubst org-cmp-alpha (a b)
- "Compare the headlines, alphabetically."
- (let* ((pla (get-text-property 0 'prefix-length a))
- (plb (get-text-property 0 'prefix-length b))
- (ta (and pla (substring a pla)))
- (tb (and plb (substring b plb))))
- (when pla
- (if (string-match (concat "\\`[ \t]*" (or (get-text-property 0 'org-todo-regexp a) "")
- "\\([ \t]*\\[[a-zA-Z0-9]\\]\\)? *") ta)
- (setq ta (substring ta (match-end 0))))
- (setq ta (downcase ta)))
- (when plb
- (if (string-match (concat "\\`[ \t]*" (or (get-text-property 0 'org-todo-regexp b) "")
- "\\([ \t]*\\[[a-zA-Z0-9]\\]\\)? *") tb)
- (setq tb (substring tb (match-end 0))))
- (setq tb (downcase tb)))
- (cond ((not ta) +1)
- ((not tb) -1)
- ((string-lessp ta tb) -1)
- ((string-lessp tb ta) +1)
- (t nil))))
-
-(defsubst org-cmp-tag (a b)
- "Compare the string values of the first tags of A and B."
- (let ((ta (car (last (get-text-property 1 'tags a))))
- (tb (car (last (get-text-property 1 'tags b)))))
- (cond ((not ta) +1)
- ((not tb) -1)
- ((string-lessp ta tb) -1)
- ((string-lessp tb ta) +1)
- (t nil))))
-
-(defsubst org-cmp-time (a b)
- "Compare the time-of-day values of strings A and B."
- (let* ((def (if org-sort-agenda-notime-is-late 9901 -1))
- (ta (or (get-text-property 1 'time-of-day a) def))
- (tb (or (get-text-property 1 'time-of-day b) def)))
- (cond ((< ta tb) -1)
- ((< tb ta) +1)
- (t nil))))
-
-(defsubst org-cmp-habit-p (a b)
- "Compare the todo states of strings A and B."
- (let ((ha (get-text-property 1 'org-habit-p a))
- (hb (get-text-property 1 'org-habit-p b)))
- (cond ((and ha (not hb)) -1)
- ((and (not ha) hb) +1)
- (t nil))))
-
-(defsubst org-em (x y list) (or (memq x list) (memq y list)))
-
-(defun org-entries-lessp (a b)
- "Predicate for sorting agenda entries."
- ;; The following variables will be used when the form is evaluated.
- ;; So even though the compiler complains, keep them.
- (let* ((ss org-agenda-sorting-strategy-selected)
- (time-up (and (org-em 'time-up 'time-down ss)
- (org-cmp-time a b)))
- (time-down (if time-up (- time-up) nil))
- (priority-up (and (org-em 'priority-up 'priority-down ss)
- (org-cmp-priority a b)))
- (priority-down (if priority-up (- priority-up) nil))
- (effort-up (and (org-em 'effort-up 'effort-down ss)
- (org-cmp-effort a b)))
- (effort-down (if effort-up (- effort-up) nil))
- (category-up (and (or (org-em 'category-up 'category-down ss)
- (memq 'category-keep ss))
- (org-cmp-category a b)))
- (category-down (if category-up (- category-up) nil))
- (category-keep (if category-up +1 nil))
- (tag-up (and (org-em 'tag-up 'tag-down ss)
- (org-cmp-tag a b)))
- (tag-down (if tag-up (- tag-up) nil))
- (todo-state-up (and (org-em 'todo-state-up 'todo-state-down ss)
- (org-cmp-todo-state a b)))
- (todo-state-down (if todo-state-up (- todo-state-up) nil))
- (habit-up (and (org-em 'habit-up 'habit-down ss)
- (org-cmp-habit-p a b)))
- (habit-down (if habit-up (- habit-up) nil))
- (alpha-up (and (org-em 'alpha-up 'alpha-down ss)
- (org-cmp-alpha a b)))
- (alpha-down (if alpha-up (- alpha-up) nil))
- (need-user-cmp (org-em 'user-defined-up 'user-defined-down ss))
- user-defined-up user-defined-down)
- (if (and need-user-cmp org-agenda-cmp-user-defined
- (functionp org-agenda-cmp-user-defined))
- (setq user-defined-up
- (funcall org-agenda-cmp-user-defined a b)
- user-defined-down (if user-defined-up (- user-defined-up) nil)))
- (cdr (assoc
- (eval (cons 'or org-agenda-sorting-strategy-selected))
- '((-1 . t) (1 . nil) (nil . nil))))))
-
-;;; Agenda restriction lock
-
-(defvar org-agenda-restriction-lock-overlay (make-overlay 1 1)
- "Overlay to mark the headline to which agenda commands are restricted.")
-(overlay-put org-agenda-restriction-lock-overlay
- 'face 'org-agenda-restriction-lock)
-(overlay-put org-agenda-restriction-lock-overlay
- 'help-echo "Agendas are currently limited to this subtree.")
-(org-detach-overlay org-agenda-restriction-lock-overlay)
-
-(defun org-agenda-set-restriction-lock (&optional type)
- "Set restriction lock for agenda, to current subtree or file.
-Restriction will be the file if TYPE is `file', or if type is the
-universal prefix '(4), or if the cursor is before the first headline
-in the file. Otherwise, restriction will be to the current subtree."
- (interactive "P")
- (and (equal type '(4)) (setq type 'file))
- (setq type (cond
- (type type)
- ((org-at-heading-p) 'subtree)
- ((condition-case nil (org-back-to-heading t) (error nil))
- 'subtree)
- (t 'file)))
- (if (eq type 'subtree)
- (progn
- (setq org-agenda-restrict t)
- (setq org-agenda-overriding-restriction 'subtree)
- (put 'org-agenda-files 'org-restrict
- (list (buffer-file-name (buffer-base-buffer))))
- (org-back-to-heading t)
- (move-overlay org-agenda-restriction-lock-overlay (point) (point-at-eol))
- (move-marker org-agenda-restrict-begin (point))
- (move-marker org-agenda-restrict-end
- (save-excursion (org-end-of-subtree t)))
- (message "Locking agenda restriction to subtree"))
- (put 'org-agenda-files 'org-restrict
- (list (buffer-file-name (buffer-base-buffer))))
- (setq org-agenda-restrict nil)
- (setq org-agenda-overriding-restriction 'file)
- (move-marker org-agenda-restrict-begin nil)
- (move-marker org-agenda-restrict-end nil)
- (message "Locking agenda restriction to file"))
- (setq current-prefix-arg nil)
- (org-agenda-maybe-redo))
-
-(defun org-agenda-remove-restriction-lock (&optional noupdate)
- "Remove the agenda restriction lock."
- (interactive "P")
- (org-detach-overlay org-agenda-restriction-lock-overlay)
- (org-detach-overlay org-speedbar-restriction-lock-overlay)
- (setq org-agenda-overriding-restriction nil)
- (setq org-agenda-restrict nil)
- (put 'org-agenda-files 'org-restrict nil)
- (move-marker org-agenda-restrict-begin nil)
- (move-marker org-agenda-restrict-end nil)
- (setq current-prefix-arg nil)
- (message "Agenda restriction lock removed")
- (or noupdate (org-agenda-maybe-redo)))
-
-(defun org-agenda-maybe-redo ()
- "If there is any window showing the agenda view, update it."
- (let ((w (get-buffer-window org-agenda-buffer-name t))
- (w0 (selected-window)))
- (when w
- (select-window w)
- (org-agenda-redo)
- (select-window w0)
- (if org-agenda-overriding-restriction
- (message "Agenda view shifted to new %s restriction"
- org-agenda-overriding-restriction)
- (message "Agenda restriction lock removed")))))
-
-;;; Agenda commands
-
-(defun org-agenda-check-type (error &rest types)
- "Check if agenda buffer is of allowed type.
-If ERROR is non-nil, throw an error, otherwise just return nil."
- (if (memq org-agenda-type types)
- t
- (if error
- (error "Not allowed in %s-type agenda buffers" org-agenda-type)
- nil)))
-
-(defun org-agenda-quit ()
- "Exit agenda by removing the window or the buffer."
- (interactive)
- (if org-agenda-columns-active
- (org-columns-quit)
- (let ((buf (current-buffer)))
- (if (eq org-agenda-window-setup 'other-frame)
- (progn
- (kill-buffer buf)
- (org-agenda-reset-markers)
- (org-columns-remove-overlays)
- (setq org-agenda-archives-mode nil)
- (delete-frame))
- (and (not (eq org-agenda-window-setup 'current-window))
- (not (one-window-p))
- (delete-window))
- (kill-buffer buf)
- (org-agenda-reset-markers)
- (org-columns-remove-overlays)
- (setq org-agenda-archives-mode nil)))
- ;; Maybe restore the pre-agenda window configuration.
- (and org-agenda-restore-windows-after-quit
- (not (eq org-agenda-window-setup 'other-frame))
- org-pre-agenda-window-conf
- (set-window-configuration org-pre-agenda-window-conf))))
-
-(defun org-agenda-exit ()
- "Exit agenda by removing the window or the buffer.
-Also kill all Org-mode buffers which have been loaded by `org-agenda'.
-Org-mode buffers visited directly by the user will not be touched."
- (interactive)
- (org-release-buffers org-agenda-new-buffers)
- (setq org-agenda-new-buffers nil)
- (org-agenda-quit))
-
-(defun org-agenda-execute (arg)
- "Execute another agenda command, keeping same window.
-So this is just a shortcut for \\<global-map>`\\[org-agenda]', available
-in the agenda."
- (interactive "P")
- (let ((org-agenda-window-setup 'current-window))
- (org-agenda arg)))
-
-(defun org-agenda-redo ()
- "Rebuild Agenda.
-When this is the global TODO list, a prefix argument will be interpreted."
- (interactive)
- (let* ((org-agenda-keep-modes t)
- (filter org-agenda-filter)
- (preset (get 'org-agenda-filter :preset-filter))
- (org-agenda-filter-while-redo (or filter preset))
- (cols org-agenda-columns-active)
- (line (org-current-line))
- (window-line (- line (org-current-line (window-start))))
- (lprops (get 'org-agenda-redo-command 'org-lprops)))
- (put 'org-agenda-filter :preset-filter nil)
- (and cols (org-columns-quit))
- (message "Rebuilding agenda buffer...")
- (org-let lprops '(eval org-agenda-redo-command))
- (setq org-agenda-undo-list nil
- org-agenda-pending-undo-list nil)
- (message "Rebuilding agenda buffer...done")
- (put 'org-agenda-filter :preset-filter preset)
- (and (or filter preset) (org-agenda-filter-apply filter))
- (and cols (interactive-p) (org-agenda-columns))
- (org-goto-line line)
- (recenter window-line)))
-
-
-(defvar org-global-tags-completion-table nil)
-(defvar org-agenda-filter-form nil)
-(defun org-agenda-filter-by-tag (strip &optional char narrow)
- "Keep only those lines in the agenda buffer that have a specific tag.
-The tag is selected with its fast selection letter, as configured.
-With prefix argument STRIP, remove all lines that do have the tag.
-A lisp caller can specify CHAR. NARROW means that the new tag should be
-used to narrow the search - the interactive user can also press `-' or `+'
-to switch to narrowing."
- (interactive "P")
- (let* ((alist org-tag-alist-for-agenda)
- (tag-chars (mapconcat
- (lambda (x) (if (and (not (symbolp (car x)))
- (cdr x))
- (char-to-string (cdr x))
- ""))
- alist ""))
- (efforts (org-split-string
- (or (cdr (assoc (concat org-effort-property "_ALL")
- org-global-properties))
- "0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00 8:00" "")))
- (effort-op org-agenda-filter-effort-default-operator)
- (effort-prompt "")
- (inhibit-read-only t)
- (current org-agenda-filter)
- a n tag)
- (unless char
- (message
- "%s by tag [%s ], [TAB], %s[/]:off, [+-]:narrow, [>=<?]:effort: "
- (if narrow "Narrow" "Filter") tag-chars
- (if org-agenda-auto-exclude-function "[RET], " ""))
- (setq char (read-char)))
- (when (member char '(?+ ?-))
- ;; Narrowing down
- (cond ((equal char ?-) (setq strip t narrow t))
- ((equal char ?+) (setq strip nil narrow t)))
- (message
- "Narrow by tag [%s ], [TAB], [/]:off, [>=<]:effort: " tag-chars)
- (setq char (read-char)))
- (when (member char '(?< ?> ?= ??))
- ;; An effort operator
- (setq effort-op (char-to-string char))
- (setq alist nil) ; to make sure it will be interpreted as effort.
- (unless (equal char ??)
- (loop for i from 0 to 9 do
- (setq effort-prompt
- (concat
- effort-prompt " ["
- (if (= i 9) "0" (int-to-string (1+ i)))
- "]" (nth i efforts))))
- (message "Effort%s: %s " effort-op effort-prompt)
- (setq char (read-char))
- (when (or (< char ?0) (> char ?9))
- (error "Need 1-9,0 to select effort" ))))
- (when (equal char ?\t)
- (unless (local-variable-p 'org-global-tags-completion-table (current-buffer))
- (org-set-local 'org-global-tags-completion-table
- (org-global-tags-completion-table)))
- (let ((completion-ignore-case t))
- (setq tag (org-icompleting-read
- "Tag: " org-global-tags-completion-table))))
- (cond
- ((equal char ?\r)
- (org-agenda-filter-by-tag-show-all)
- (when org-agenda-auto-exclude-function
- (setq org-agenda-filter '())
- (dolist (tag (org-agenda-get-represented-tags))
- (let ((modifier (funcall org-agenda-auto-exclude-function tag)))
- (if modifier
- (push modifier org-agenda-filter))))
- (if (not (null org-agenda-filter))
- (org-agenda-filter-apply org-agenda-filter))))
- ((equal char ?/)
- (org-agenda-filter-by-tag-show-all)
- (when (get 'org-agenda-filter :preset-filter)
- (org-agenda-filter-apply org-agenda-filter)))
- ((or (equal char ?\ )
- (setq a (rassoc char alist))
- (and (>= char ?0) (<= char ?9)
- (setq n (if (= char ?0) 9 (- char ?0 1))
- tag (concat effort-op (nth n efforts))
- a (cons tag nil)))
- (and (= char ??)
- (setq tag "?eff")
- a (cons tag nil))
- (and tag (setq a (cons tag nil))))
- (org-agenda-filter-by-tag-show-all)
- (setq tag (car a))
- (setq org-agenda-filter
- (cons (concat (if strip "-" "+") tag)
- (if narrow current nil)))
- (org-agenda-filter-apply org-agenda-filter))
- (t (error "Invalid tag selection character %c" char)))))
-
-(defun org-agenda-get-represented-tags ()
- "Get a list of all tags currently represented in the agenda."
- (let (p tags)
- (save-excursion
- (goto-char (point-min))
- (while (setq p (next-single-property-change (point) 'tags))
- (goto-char p)
- (mapc (lambda (x) (add-to-list 'tags x))
- (get-text-property (point) 'tags))))
- tags))
-
-(defun org-agenda-filter-by-tag-refine (strip &optional char)
- "Refine the current filter. See `org-agenda-filter-by-tag."
- (interactive "P")
- (org-agenda-filter-by-tag strip char 'refine))
-
-(defun org-agenda-filter-make-matcher ()
- "Create the form that tests a line for the agenda filter."
- (let (f f1)
- (dolist (x (append (get 'org-agenda-filter :preset-filter)
- org-agenda-filter))
- (if (member x '("-" "+"))
- (setq f1 (if (equal x "-") 'tags '(not tags)))
- (if (string-match "[<=>?]" x)
- (setq f1 (org-agenda-filter-effort-form x))
- (setq f1 (list 'member (downcase (substring x 1)) 'tags)))
- (if (equal (string-to-char x) ?-)
- (setq f1 (list 'not f1))))
- (push f1 f))
- (cons 'and (nreverse f))))
-
-(defun org-agenda-filter-effort-form (e)
- "Return the form to compare the effort of the current line with what E says.
-E looks like \"+<2:25\"."
- (let (op)
- (setq e (substring e 1))
- (setq op (string-to-char e) e (substring e 1))
- (setq op (cond ((equal op ?<) '<=)
- ((equal op ?>) '>=)
- ((equal op ??) op)
- (t '=)))
- (list 'org-agenda-compare-effort (list 'quote op)
- (org-hh:mm-string-to-minutes e))))
-
-(defun org-agenda-compare-effort (op value)
- "Compare the effort of the current line with VALUE, using OP.
-If the line does not have an effort defined, return nil."
- (let ((eff (org-get-at-bol 'effort-minutes)))
- (if (equal op ??)
- (not eff)
- (funcall op (or eff (if org-sort-agenda-noeffort-is-high 32767 0))
- value))))
-
-(defun org-agenda-filter-apply (filter)
- "Set FILTER as the new agenda filter and apply it."
- (let (tags)
- (setq org-agenda-filter filter
- org-agenda-filter-form (org-agenda-filter-make-matcher))
- (org-agenda-set-mode-name)
- (save-excursion
- (goto-char (point-min))
- (while (not (eobp))
- (if (org-get-at-bol 'org-marker)
- (progn
- (setq tags (org-get-at-bol 'tags)) ; used in eval
- (if (not (eval org-agenda-filter-form))
- (org-agenda-filter-by-tag-hide-line))
- (beginning-of-line 2))
- (beginning-of-line 2))))
- (if (get-char-property (point) 'invisible)
- (org-agenda-previous-line))))
-
-(defun org-agenda-filter-by-tag-hide-line ()
- (let (ov)
- (setq ov (make-overlay (max (point-min) (1- (point-at-bol)))
- (point-at-eol)))
- (overlay-put ov 'invisible t)
- (overlay-put ov 'type 'tags-filter)
- (push ov org-agenda-filter-overlays)))
-
-(defun org-agenda-fix-tags-filter-overlays-at (&optional pos)
- (setq pos (or pos (point)))
- (save-excursion
- (dolist (ov (overlays-at pos))
- (when (and (overlay-get ov 'invisible)
- (eq (overlay-get ov 'type) 'tags-filter))
- (goto-char pos)
- (if (< (overlay-start ov) (point-at-eol))
- (move-overlay ov (point-at-eol)
- (overlay-end ov)))))))
-
-(defun org-agenda-filter-by-tag-show-all ()
- (mapc 'delete-overlay org-agenda-filter-overlays)
- (setq org-agenda-filter-overlays nil)
- (setq org-agenda-filter nil)
- (setq org-agenda-filter-form nil)
- (org-agenda-set-mode-name))
-
-(defun org-agenda-manipulate-query-add ()
- "Manipulate the query by adding a search term with positive selection.
-Positive selection means the term must be matched for selection of an entry."
- (interactive)
- (org-agenda-manipulate-query ?\[))
-(defun org-agenda-manipulate-query-subtract ()
- "Manipulate the query by adding a search term with negative selection.
-Negative selection means term must not be matched for selection of an entry."
- (interactive)
- (org-agenda-manipulate-query ?\]))
-(defun org-agenda-manipulate-query-add-re ()
- "Manipulate the query by adding a search regexp with positive selection.
-Positive selection means the regexp must match for selection of an entry."
- (interactive)
- (org-agenda-manipulate-query ?\{))
-(defun org-agenda-manipulate-query-subtract-re ()
- "Manipulate the query by adding a search regexp with negative selection.
-Negative selection means regexp must not match for selection of an entry."
- (interactive)
- (org-agenda-manipulate-query ?\}))
-(defun org-agenda-manipulate-query (char)
- (cond
- ((memq org-agenda-type '(timeline agenda))
- (let ((org-agenda-include-inactive-timestamps t))
- (org-agenda-redo))
- (message "Display now includes inactive timestamps as well"))
- ((eq org-agenda-type 'search)
- (org-add-to-string
- 'org-agenda-query-string
- (if org-agenda-last-search-view-search-was-boolean
- (cdr (assoc char '((?\[ . " +") (?\] . " -")
- (?\{ . " +{}") (?\} . " -{}"))))
- " "))
- (setq org-agenda-redo-command
- (list 'org-search-view
- org-todo-only
- org-agenda-query-string
- (+ (length org-agenda-query-string)
- (if (member char '(?\{ ?\})) 0 1))))
- (set-register org-agenda-query-register org-agenda-query-string)
- (org-agenda-redo))
- (t (error "Cannot manipulate query for %s-type agenda buffers"
- org-agenda-type))))
-
-(defun org-add-to-string (var string)
- (set var (concat (symbol-value var) string)))
-
-(defun org-agenda-goto-date (date)
- "Jump to DATE in agenda."
- (interactive (list (let ((org-read-date-prefer-future
- (eval org-agenda-jump-prefer-future)))
- (org-read-date))))
- (org-agenda-list nil date))
-
-(defun org-agenda-goto-today ()
- "Go to today."
- (interactive)
- (org-agenda-check-type t 'timeline 'agenda)
- (let ((tdpos (text-property-any (point-min) (point-max) 'org-today t)))
- (cond
- (tdpos (goto-char tdpos))
- ((eq org-agenda-type 'agenda)
- (let* ((sd (org-agenda-compute-starting-span
- (org-today) (or org-agenda-ndays org-agenda-span)))
- (org-agenda-overriding-arguments org-agenda-last-arguments))
- (setf (nth 1 org-agenda-overriding-arguments) sd)
- (org-agenda-redo)
- (org-agenda-find-same-or-today-or-agenda)))
- (t (error "Cannot find today")))))
-
-(defun org-agenda-find-same-or-today-or-agenda (&optional cnt)
- (goto-char
- (or (and cnt (text-property-any (point-min) (point-max) 'org-day-cnt cnt))
- (text-property-any (point-min) (point-max) 'org-today t)
- (text-property-any (point-min) (point-max) 'org-agenda-type 'agenda)
- (point-min))))
-
-(defun org-agenda-later (arg)
- "Go forward in time by thee current span.
-With prefix ARG, go forward that many times the current span."
- (interactive "p")
- (org-agenda-check-type t 'agenda)
- (let* ((span org-agenda-current-span)
- (sd org-starting-day)
- (greg (calendar-gregorian-from-absolute sd))
- (cnt (org-get-at-bol 'org-day-cnt))
- greg2)
- (cond
- ((eq span 'day)
- (setq sd (+ arg sd)))
- ((eq span 'week)
- (setq sd (+ (* 7 arg) sd)))
- ((eq span 'month)
- (setq greg2 (list (+ (car greg) arg) (nth 1 greg) (nth 2 greg))
- sd (calendar-absolute-from-gregorian greg2))
- (setcar greg2 (1+ (car greg2))))
- ((eq span 'year)
- (setq greg2 (list (car greg) (nth 1 greg) (+ arg (nth 2 greg)))
- sd (calendar-absolute-from-gregorian greg2))
- (setcar (nthcdr 2 greg2) (1+ (nth 2 greg2))))
- (t
- (setq sd (+ (* span arg) sd))))
- (let ((org-agenda-overriding-arguments
- (list (car org-agenda-last-arguments) sd span t)))
- (org-agenda-redo)
- (org-agenda-find-same-or-today-or-agenda cnt))))
-
-(defun org-agenda-earlier (arg)
- "Go backward in time by the current span.
-With prefix ARG, go backward that many times the current span."
- (interactive "p")
- (org-agenda-later (- arg)))
-
-(defun org-agenda-view-mode-dispatch ()
- "Call one of the view mode commands."
- (interactive)
- (message "View: [d]ay [w]eek [m]onth [y]ear [q]uit/abort
- time[G]rid [[]inactive [f]ollow [l]og [L]og-all [E]ntryText
- [a]rch-trees [A]rch-files clock[R]eport include[D]iary")
- (let ((a (read-char-exclusive)))
- (case a
- (?d (call-interactively 'org-agenda-day-view))
- (?w (call-interactively 'org-agenda-week-view))
- (?m (call-interactively 'org-agenda-month-view))
- (?y (call-interactively 'org-agenda-year-view))
- (?l (call-interactively 'org-agenda-log-mode))
- (?L (org-agenda-log-mode '(4)))
- ((?F ?f) (call-interactively 'org-agenda-follow-mode))
- (?a (call-interactively 'org-agenda-archives-mode))
- (?A (org-agenda-archives-mode 'files))
- ((?R ?r) (call-interactively 'org-agenda-clockreport-mode))
- ((?E ?e) (call-interactively 'org-agenda-entry-text-mode))
- (?G (call-interactively 'org-agenda-toggle-time-grid))
- (?D (call-interactively 'org-agenda-toggle-diary))
- (?\! (call-interactively 'org-agenda-toggle-deadlines))
- (?\[ (let ((org-agenda-include-inactive-timestamps t))
- (org-agenda-check-type t 'timeline 'agenda)
- (org-agenda-redo))
- (message "Display now includes inactive timestamps as well"))
- (?q (message "Abort"))
- (otherwise (error "Invalid key" )))))
-
-(defun org-agenda-day-view (&optional day-of-year)
- "Switch to daily view for agenda.
-With argument DAY-OF-YEAR, switch to that day of the year."
- (interactive "P")
- (org-agenda-change-time-span 'day day-of-year))
-(defun org-agenda-week-view (&optional iso-week)
- "Switch to daily view for agenda.
-With argument ISO-WEEK, switch to the corresponding ISO week.
-If ISO-WEEK has more then 2 digits, only the last two encode the
-week. Any digits before this encode a year. So 200712 means
-week 12 of year 2007. Years in the range 1938-2037 can also be
-written as 2-digit years."
- (interactive "P")
- (org-agenda-change-time-span 'week iso-week))
-(defun org-agenda-month-view (&optional month)
- "Switch to monthly view for agenda.
-With argument MONTH, switch to that month."
- (interactive "P")
- (org-agenda-change-time-span 'month month))
-(defun org-agenda-year-view (&optional year)
- "Switch to yearly view for agenda.
-With argument YEAR, switch to that year.
-If MONTH has more then 2 digits, only the last two encode the
-month. Any digits before this encode a year. So 200712 means
-December year 2007. Years in the range 1938-2037 can also be
-written as 2-digit years."
- (interactive "P")
- (when year
- (setq year (org-small-year-to-year year)))
- (if (y-or-n-p "Are you sure you want to compute the agenda for an entire year? ")
- (org-agenda-change-time-span 'year year)
- (error "Abort")))
-
-(defun org-agenda-change-time-span (span &optional n)
- "Change the agenda view to SPAN.
-SPAN may be `day', `week', `month', `year'."
- (org-agenda-check-type t 'agenda)
- (if (and (not n) (equal org-agenda-current-span span))
- (error "Viewing span is already \"%s\"" span))
- (let* ((sd (or (org-get-at-bol 'day)
- org-starting-day))
- (sd (org-agenda-compute-starting-span sd span n))
- (org-agenda-overriding-arguments
- (list (car org-agenda-last-arguments) sd span t)))
- (org-agenda-redo)
- (org-agenda-find-same-or-today-or-agenda))
- (org-agenda-set-mode-name)
- (message "Switched to %s view" span))
-
-(defun org-agenda-compute-starting-span (sd span &optional n)
- "Compute starting date for agenda.
-SPAN may be `day', `week', `month', `year'. The return value
-is a cons cell with the starting date and the number of days,
-so that the date SD will be in that range."
- (let* ((greg (calendar-gregorian-from-absolute sd))
- (dg (nth 1 greg))
- (mg (car greg))
- (yg (nth 2 greg)))
- (cond
- ((eq span 'day)
- (when n
- (setq sd (+ (calendar-absolute-from-gregorian
- (list mg 1 yg))
- n -1))))
- ((eq span 'week)
- (let* ((nt (calendar-day-of-week
- (calendar-gregorian-from-absolute sd)))
- (d (if org-agenda-start-on-weekday
- (- nt org-agenda-start-on-weekday)
- 0))
- y1)
- (setq sd (- sd (+ (if (< d 0) 7 0) d)))
- (when n
- (require 'cal-iso)
- (when (> n 99)
- (setq y1 (org-small-year-to-year (/ n 100))
- n (mod n 100)))
- (setq sd
- (calendar-absolute-from-iso
- (list n 1
- (or y1 (nth 2 (calendar-iso-from-absolute sd)))))))))
- ((eq span 'month)
- (let (y1)
- (when (and n (> n 99))
- (setq y1 (org-small-year-to-year (/ n 100))
- n (mod n 100)))
- (setq sd (calendar-absolute-from-gregorian
- (list (or n mg) 1 (or y1 yg))))))
- ((eq span 'year)
- (setq sd (calendar-absolute-from-gregorian
- (list 1 1 (or n yg))))))
- sd))
-
-(defun org-agenda-next-date-line (&optional arg)
- "Jump to the next line indicating a date in agenda buffer."
- (interactive "p")
- (org-agenda-check-type t 'agenda 'timeline)
- (beginning-of-line 1)
- ;; This does not work if user makes date format that starts with a blank
- (if (looking-at "^\\S-") (forward-char 1))
- (if (not (re-search-forward "^\\S-" nil t arg))
- (progn
- (backward-char 1)
- (error "No next date after this line in this buffer")))
- (goto-char (match-beginning 0)))
-
-(defun org-agenda-previous-date-line (&optional arg)
- "Jump to the previous line indicating a date in agenda buffer."
- (interactive "p")
- (org-agenda-check-type t 'agenda 'timeline)
- (beginning-of-line 1)
- (if (not (re-search-backward "^\\S-" nil t arg))
- (error "No previous date before this line in this buffer")))
-
-;; Initialize the highlight
-(defvar org-hl (make-overlay 1 1))
-(overlay-put org-hl 'face 'highlight)
-
-(defun org-highlight (begin end &optional buffer)
- "Highlight a region with overlay."
- (move-overlay org-hl begin end (or buffer (current-buffer))))
-
-(defun org-unhighlight ()
- "Detach overlay INDEX."
- (org-detach-overlay org-hl))
-
-;; FIXME this is currently not used.
-(defun org-highlight-until-next-command (beg end &optional buffer)
- "Move the highlight overlay to BEG/END, remove it before the next command."
- (org-highlight beg end buffer)
- (add-hook 'pre-command-hook 'org-unhighlight-once))
-(defun org-unhighlight-once ()
- "Remove the highlight from its position, and this function from the hook."
- (remove-hook 'pre-command-hook 'org-unhighlight-once)
- (org-unhighlight))
-
-(defun org-agenda-follow-mode ()
- "Toggle follow mode in an agenda buffer."
- (interactive)
- (setq org-agenda-follow-mode (not org-agenda-follow-mode))
- (org-agenda-set-mode-name)
- (if (and org-agenda-follow-mode (org-get-at-bol 'org-marker))
- (org-agenda-show))
- (message "Follow mode is %s"
- (if org-agenda-follow-mode "on" "off")))
-
-(defun org-agenda-entry-text-mode (&optional arg)
- "Toggle entry text mode in an agenda buffer."
- (interactive "P")
- (setq org-agenda-entry-text-mode (or (integerp arg)
- (not org-agenda-entry-text-mode)))
- (org-agenda-entry-text-hide)
- (and org-agenda-entry-text-mode
- (let ((org-agenda-entry-text-maxlines
- (if (integerp arg) arg org-agenda-entry-text-maxlines)))
- (org-agenda-entry-text-show)))
- (org-agenda-set-mode-name)
- (message "Entry text mode is %s. Maximum number of lines is %d"
- (if org-agenda-entry-text-mode "on" "off")
- (if (integerp arg) arg org-agenda-entry-text-maxlines)))
-
-(defun org-agenda-clockreport-mode (&optional with-filter)
- "Toggle clocktable mode in an agenda buffer.
-With prefix arg WITH-FILTER, make the clocktable respect the current
-agenda filter."
- (interactive "P")
- (org-agenda-check-type t 'agenda)
- (if with-filter
- (setq org-agenda-clockreport-mode 'with-filter)
- (setq org-agenda-clockreport-mode (not org-agenda-clockreport-mode)))
- (org-agenda-set-mode-name)
- (org-agenda-redo)
- (message "Clocktable mode is %s"
- (if org-agenda-clockreport-mode "on" "off")))
-
-(defun org-agenda-log-mode (&optional special)
- "Toggle log mode in an agenda buffer.
-With argument SPECIAL, show all possible log items, not only the ones
-configured in `org-agenda-log-mode-items'.
-With a double `C-u' prefix arg, show *only* log items, nothing else."
- (interactive "P")
- (org-agenda-check-type t 'agenda 'timeline)
- (setq org-agenda-show-log
- (if (equal special '(16))
- 'only
- (if special '(closed clock state)
- (not org-agenda-show-log))))
- (org-agenda-set-mode-name)
- (org-agenda-redo)
- (message "Log mode is %s"
- (if org-agenda-show-log "on" "off")))
-
-(defun org-agenda-archives-mode (&optional with-files)
- "Toggle inclusion of items in trees marked with :ARCHIVE:.
-When called with a prefix argument, include all archive files as well."
- (interactive "P")
- (setq org-agenda-archives-mode
- (if with-files t (if org-agenda-archives-mode nil 'trees)))
- (org-agenda-set-mode-name)
- (org-agenda-redo)
- (message
- "%s"
- (cond
- ((eq org-agenda-archives-mode nil)
- "No archives are included")
- ((eq org-agenda-archives-mode 'trees)
- (format "Trees with :%s: tag are included" org-archive-tag))
- ((eq org-agenda-archives-mode t)
- (format "Trees with :%s: tag and all active archive files are included"
- org-archive-tag)))))
-
-(defun org-agenda-toggle-diary ()
- "Toggle diary inclusion in an agenda buffer."
- (interactive)
- (org-agenda-check-type t 'agenda)
- (setq org-agenda-include-diary (not org-agenda-include-diary))
- (org-agenda-redo)
- (org-agenda-set-mode-name)
- (message "Diary inclusion turned %s"
- (if org-agenda-include-diary "on" "off")))
-
-(defun org-agenda-toggle-deadlines ()
- "Toggle inclusion of entries with a deadline in an agenda buffer."
- (interactive)
- (org-agenda-check-type t 'agenda)
- (setq org-agenda-include-deadlines (not org-agenda-include-deadlines))
- (org-agenda-redo)
- (org-agenda-set-mode-name)
- (message "Deadlines inclusion turned %s"
- (if org-agenda-include-deadlines "on" "off")))
-
-(defun org-agenda-toggle-time-grid ()
- "Toggle time grid in an agenda buffer."
- (interactive)
- (org-agenda-check-type t 'agenda)
- (setq org-agenda-use-time-grid (not org-agenda-use-time-grid))
- (org-agenda-redo)
- (org-agenda-set-mode-name)
- (message "Time-grid turned %s"
- (if org-agenda-use-time-grid "on" "off")))
-
-(defun org-agenda-set-mode-name ()
- "Set the mode name to indicate all the small mode settings."
- (setq mode-name
- (list "Org-Agenda"
- (if (get 'org-agenda-files 'org-restrict) " []" "")
- " "
- '(:eval (org-agenda-span-name org-agenda-current-span))
- (if org-agenda-follow-mode " Follow" "")
- (if org-agenda-entry-text-mode " ETxt" "")
- (if org-agenda-include-diary " Diary" "")
- (if org-agenda-include-deadlines " Ddl" "")
- (if org-agenda-use-time-grid " Grid" "")
- (if (and (boundp 'org-habit-show-habits)
- org-habit-show-habits) " Habit" "")
- (if (consp org-agenda-show-log) " LogAll"
- (if org-agenda-show-log " Log" ""))
- (if (or org-agenda-filter (get 'org-agenda-filter
- :preset-filter))
- (concat " {" (mapconcat
- 'identity
- (append (get 'org-agenda-filter
- :preset-filter)
- org-agenda-filter) "") "}")
- "")
- (if org-agenda-archives-mode
- (if (eq org-agenda-archives-mode t)
- " Archives"
- (format " :%s:" org-archive-tag))
- "")
- (if org-agenda-clockreport-mode
- (if (eq org-agenda-clockreport-mode 'with-filter)
- " Clock{}" " Clock")
- "")))
- (force-mode-line-update))
-
-(defun org-agenda-post-command-hook ()
- (setq org-agenda-type
- (or (get-text-property (point) 'org-agenda-type)
- (get-text-property (max (point-min) (1- (point)))
- 'org-agenda-type))))
-
-(defun org-agenda-next-line ()
- "Move cursor to the next line, and show if follow mode is active."
- (interactive)
- (call-interactively 'next-line)
- (org-agenda-do-context-action))
-
-(defun org-agenda-previous-line ()
- "Move cursor to the previous line, and show if follow-mode is active."
- (interactive)
- (call-interactively 'previous-line)
- (org-agenda-do-context-action))
-
-(defun org-agenda-do-context-action ()
- "Show outline path and, maybe, follow mode window."
- (let ((m (org-get-at-bol 'org-marker)))
- (if (and org-agenda-follow-mode m)
- (org-agenda-show))
- (if (and m org-agenda-show-outline-path)
- (org-with-point-at m
- (org-display-outline-path t)))))
-
-(defun org-agenda-show-priority ()
- "Show the priority of the current item.
-This priority is composed of the main priority given with the [#A] cookies,
-and by additional input from the age of a schedules or deadline entry."
- (interactive)
- (let* ((pri (org-get-at-bol 'priority)))
- (message "Priority is %d" (if pri pri -1000))))
-
-(defun org-agenda-show-tags ()
- "Show the tags applicable to the current item."
- (interactive)
- (let* ((tags (org-get-at-bol 'tags)))
- (if tags
- (message "Tags are :%s:"
- (org-no-properties (mapconcat 'identity tags ":")))
- (message "No tags associated with this line"))))
-
-(defun org-agenda-goto (&optional highlight)
- "Go to the Org-mode file which contains the item at point."
- (interactive)
- (let* ((marker (or (org-get-at-bol 'org-marker)
- (org-agenda-error)))
- (buffer (marker-buffer marker))
- (pos (marker-position marker)))
- (switch-to-buffer-other-window buffer)
- (widen)
- (push-mark)
- (goto-char pos)
- (when (org-mode-p)
- (org-show-context 'agenda)
- (save-excursion
- (and (outline-next-heading)
- (org-flag-heading nil)))) ; show the next heading
- (recenter (/ (window-height) 2))
- (run-hooks 'org-agenda-after-show-hook)
- (and highlight (org-highlight (point-at-bol) (point-at-eol)))))
-
-(defvar org-agenda-after-show-hook nil
- "Normal hook run after an item has been shown from the agenda.
-Point is in the buffer where the item originated.")
-
-(defun org-agenda-kill ()
- "Kill the entry or subtree belonging to the current agenda entry."
- (interactive)
- (or (eq major-mode 'org-agenda-mode) (error "Not in agenda"))
- (let* ((marker (or (org-get-at-bol 'org-marker)
- (org-agenda-error)))
- (buffer (marker-buffer marker))
- (pos (marker-position marker))
- (type (org-get-at-bol 'type))
- dbeg dend (n 0) conf)
- (org-with-remote-undo buffer
- (with-current-buffer buffer
- (save-excursion
- (goto-char pos)
- (if (and (org-mode-p) (not (member type '("sexp"))))
- (setq dbeg (progn (org-back-to-heading t) (point))
- dend (org-end-of-subtree t t))
- (setq dbeg (point-at-bol)
- dend (min (point-max) (1+ (point-at-eol)))))
- (goto-char dbeg)
- (while (re-search-forward "^[ \t]*\\S-" dend t) (setq n (1+ n)))))
- (setq conf (or (eq t org-agenda-confirm-kill)
- (and (numberp org-agenda-confirm-kill)
- (> n org-agenda-confirm-kill))))
- (and conf
- (not (y-or-n-p
- (format "Delete entry with %d lines in buffer \"%s\"? "
- n (buffer-name buffer))))
- (error "Abort"))
- (org-remove-subtree-entries-from-agenda buffer dbeg dend)
- (with-current-buffer buffer (delete-region dbeg dend))
- (message "Agenda item and source killed"))))
-
-(defvar org-archive-default-command)
-(defun org-agenda-archive-default ()
- "Archive the entry or subtree belonging to the current agenda entry."
- (interactive)
- (require 'org-archive)
- (org-agenda-archive-with org-archive-default-command))
-
-(defun org-agenda-archive-default-with-confirmation ()
- "Archive the entry or subtree belonging to the current agenda entry."
- (interactive)
- (require 'org-archive)
- (org-agenda-archive-with org-archive-default-command 'confirm))
-
-(defun org-agenda-archive ()
- "Archive the entry or subtree belonging to the current agenda entry."
- (interactive)
- (org-agenda-archive-with 'org-archive-subtree))
-
-(defun org-agenda-archive-to-archive-sibling ()
- "Move the entry to the archive sibling."
- (interactive)
- (org-agenda-archive-with 'org-archive-to-archive-sibling))
-
-(defun org-agenda-archive-with (cmd &optional confirm)
- "Move the entry to the archive sibling."
- (interactive)
- (or (eq major-mode 'org-agenda-mode) (error "Not in agenda"))
- (let* ((marker (or (org-get-at-bol 'org-marker)
- (org-agenda-error)))
- (buffer (marker-buffer marker))
- (pos (marker-position marker)))
- (org-with-remote-undo buffer
- (with-current-buffer buffer
- (if (org-mode-p)
- (if (and confirm
- (not (y-or-n-p "Archive this subtree or entry? ")))
- (error "Abort")
- (save-excursion
- (goto-char pos)
- (org-remove-subtree-entries-from-agenda)
- (org-back-to-heading t)
- (funcall cmd)))
- (error "Archiving works only in Org-mode files"))))))
-
-(defun org-remove-subtree-entries-from-agenda (&optional buf beg end)
- "Remove all lines in the agenda that correspond to a given subtree.
-The subtree is the one in buffer BUF, starting at BEG and ending at END.
-If this information is not given, the function uses the tree at point."
- (let ((buf (or buf (current-buffer))) m p)
- (save-excursion
- (unless (and beg end)
- (org-back-to-heading t)
- (setq beg (point))
- (org-end-of-subtree t)
- (setq end (point)))
- (set-buffer (get-buffer org-agenda-buffer-name))
- (save-excursion
- (goto-char (point-max))
- (beginning-of-line 1)
- (while (not (bobp))
- (when (and (setq m (org-get-at-bol 'org-marker))
- (equal buf (marker-buffer m))
- (setq p (marker-position m))
- (>= p beg)
- (< p end))
- (let ((inhibit-read-only t))
- (delete-region (point-at-bol) (1+ (point-at-eol)))))
- (beginning-of-line 0))))))
-
-(defun org-agenda-refile (&optional goto rfloc no-update)
- "Refile the item at point."
- (interactive "P")
- (if (equal goto '(16))
- (org-refile-goto-last-stored)
- (let* ((marker (or (org-get-at-bol 'org-hd-marker)
- (org-agenda-error)))
- (buffer (marker-buffer marker))
- (pos (marker-position marker))
- (rfloc (or rfloc
- (org-refile-get-location
- (if goto "Goto: " "Refile to: ") buffer
- org-refile-allow-creating-parent-nodes))))
- (with-current-buffer buffer
- (save-excursion
- (save-restriction
- (widen)
- (goto-char marker)
- (org-remove-subtree-entries-from-agenda)
- (org-refile goto buffer rfloc)))))
- (unless no-update (org-agenda-redo))))
-
-(defun org-agenda-open-link (&optional arg)
- "Follow the link in the current line, if any.
-This looks for a link in the displayed line in the agenda. It also looks
-at the text of the entry itself."
- (interactive "P")
- (let* ((marker (or (org-get-at-bol 'org-hd-marker)
- (org-get-at-bol 'org-marker)))
- (buffer (and marker (marker-buffer marker)))
- (prefix (buffer-substring
- (point-at-bol)
- (+ (point-at-bol)
- (or (org-get-at-bol 'prefix-length) 0)))))
- (cond
- (buffer
- (with-current-buffer buffer
- (save-excursion
- (save-restriction
- (widen)
- (goto-char marker)
- (org-offer-links-in-entry arg prefix)))))
- ((or (org-in-regexp (concat "\\(" org-bracket-link-regexp "\\)"))
- (save-excursion
- (beginning-of-line 1)
- (looking-at (concat ".*?\\(" org-bracket-link-regexp "\\)"))))
- (org-open-link-from-string (match-string 1)))
- (t (error "No link to open here")))))
-
-(defun org-agenda-copy-local-variable (var)
- "Get a variable from a referenced buffer and install it here."
- (let ((m (org-get-at-bol 'org-marker)))
- (when (and m (buffer-live-p (marker-buffer m)))
- (org-set-local var (with-current-buffer (marker-buffer m)
- (symbol-value var))))))
-
-(defun org-agenda-switch-to (&optional delete-other-windows)
- "Go to the Org-mode file which contains the item at point."
- (interactive)
- (if (and org-return-follows-link
- (not (org-get-at-bol 'org-marker))
- (org-in-regexp org-bracket-link-regexp))
- (org-open-link-from-string (match-string 0))
- (let* ((marker (or (org-get-at-bol 'org-marker)
- (org-agenda-error)))
- (buffer (marker-buffer marker))
- (pos (marker-position marker)))
- (switch-to-buffer buffer)
- (and delete-other-windows (delete-other-windows))
- (widen)
- (goto-char pos)
- (when (org-mode-p)
- (org-show-context 'agenda)
- (save-excursion
- (and (outline-next-heading)
- (org-flag-heading nil))))))) ; show the next heading
-
-(defun org-agenda-goto-mouse (ev)
- "Go to the Org-mode file which contains the item at the mouse click."
- (interactive "e")
- (mouse-set-point ev)
- (org-agenda-goto))
-
-(defun org-agenda-show (&optional full-entry)
- "Display the Org-mode file which contains the item at point.
-With prefix argument FULL-ENTRY, make the entire entry visible
-if it was hidden in the outline."
- (interactive "P")
- (let ((win (selected-window)))
- (if full-entry
- (let ((org-show-entry-below t))
- (org-agenda-goto t))
- (org-agenda-goto t))
- (select-window win)))
-
-(defvar org-agenda-show-window nil)
-(defun org-agenda-show-and-scroll-up ()
- "Display the Org-mode file which contains the item at point.
-When called repeatedly, scroll the window that is displaying the buffer."
- (interactive)
- (let ((win (selected-window)))
- (if (and (window-live-p org-agenda-show-window)
- (eq this-command last-command))
- (progn
- (select-window org-agenda-show-window)
- (ignore-errors (scroll-up)))
- (org-agenda-goto t)
- (show-subtree)
- (setq org-agenda-show-window (selected-window)))
- (select-window win)))
-
-(defun org-agenda-show-scroll-down ()
- "Scroll down the window showing the agenda."
- (interactive)
- (let ((win (selected-window)))
- (when (window-live-p org-agenda-show-window)
- (select-window org-agenda-show-window)
- (ignore-errors (scroll-down))
- (select-window win))))
-
-(defun org-agenda-show-1 (&optional more)
- "Display the Org-mode file which contains the item at point.
-The prefix arg selects the amount of information to display:
-
-0 hide the subtree
-1 just show the entry according to defaults.
-2 show the children view
-3 show the subtree view
-4 show the entire subtree and any LOGBOOK drawers
-5 show the entire subtree and any drawers
-With prefix argument FULL-ENTRY, make the entire entry visible
-if it was hidden in the outline."
- (interactive "p")
- (let ((win (selected-window)))
- (org-agenda-goto t)
- (org-recenter-heading 1)
- (cond
- ((= more 0)
- (hide-subtree)
- (save-excursion
- (org-back-to-heading)
- (run-hook-with-args 'org-cycle-hook 'folded))
- (message "Remote: FOLDED"))
- ((and (interactive-p) (= more 1))
- (message "Remote: show with default settings"))
- ((= more 2)
- (show-entry)
- (show-children)
- (save-excursion
- (org-back-to-heading)
- (run-hook-with-args 'org-cycle-hook 'children))
- (message "Remote: CHILDREN"))
- ((= more 3)
- (show-subtree)
- (save-excursion
- (org-back-to-heading)
- (run-hook-with-args 'org-cycle-hook 'subtree))
- (message "Remote: SUBTREE"))
- ((= more 4)
- (let* ((org-drawers (delete "LOGBOOK" (copy-sequence org-drawers)))
- (org-drawer-regexp
- (concat "^[ \t]*:\\("
- (mapconcat 'regexp-quote org-drawers "\\|")
- "\\):[ \t]*$")))
- (show-subtree)
- (save-excursion
- (org-back-to-heading)
- (org-cycle-hide-drawers 'subtree)))
- (message "Remote: SUBTREE AND LOGBOOK"))
- ((> more 4)
- (show-subtree)
- (message "Remote: SUBTREE AND ALL DRAWERS")))
- (select-window win)))
-
-(defun org-recenter-heading (n)
- (save-excursion
- (org-back-to-heading)
- (recenter n)))
-
-(defvar org-agenda-cycle-counter nil)
-(defun org-agenda-cycle-show (&optional n)
- "Show the current entry in another window, with default settings.
-Default settings are taken from `org-show-hierarchy-above' and siblings.
-When use repeatedly in immediate succession, the remote entry will cycle
-through visibility
-
-children -> subtree -> folded
-
-When called with a numeric prefix arg, that arg will be passed through to
-`org-agenda-show-1'. For the interpretation of that argument, see the
-docstring of `org-agenda-show-1'."
- (interactive "P")
- (if (integerp n)
- (setq org-agenda-cycle-counter n)
- (if (not (eq last-command this-command))
- (setq org-agenda-cycle-counter 1)
- (if (equal org-agenda-cycle-counter 0)
- (setq org-agenda-cycle-counter 2)
- (setq org-agenda-cycle-counter (1+ org-agenda-cycle-counter))
- (if (> org-agenda-cycle-counter 3)
- (setq org-agenda-cycle-counter 0)))))
- (org-agenda-show-1 org-agenda-cycle-counter))
-
-(defun org-agenda-recenter (arg)
- "Display the Org-mode file which contains the item at point and recenter."
- (interactive "P")
- (let ((win (selected-window)))
- (org-agenda-goto t)
- (recenter arg)
- (select-window win)))
-
-(defun org-agenda-show-mouse (ev)
- "Display the Org-mode file which contains the item at the mouse click."
- (interactive "e")
- (mouse-set-point ev)
- (org-agenda-show))
-
-(defun org-agenda-check-no-diary ()
- "Check if the entry is a diary link and abort if yes."
- (if (org-get-at-bol 'org-agenda-diary-link)
- (org-agenda-error)))
-
-(defun org-agenda-error ()
- (error "Command not allowed in this line"))
-
-(defun org-agenda-tree-to-indirect-buffer ()
- "Show the subtree corresponding to the current entry in an indirect buffer.
-This calls the command `org-tree-to-indirect-buffer' from the original
-Org-mode buffer.
-With numerical prefix arg ARG, go up to this level and then take that tree.
-With a \\[universal-argument] prefix, make a separate frame for this tree (i.e. don't
-use the dedicated frame)."
- (interactive)
- (org-agenda-check-no-diary)
- (let* ((marker (or (org-get-at-bol 'org-marker)
- (org-agenda-error)))
- (buffer (marker-buffer marker))
- (pos (marker-position marker)))
- (with-current-buffer buffer
- (save-excursion
- (goto-char pos)
- (call-interactively 'org-tree-to-indirect-buffer)))))
-
-(defvar org-last-heading-marker (make-marker)
- "Marker pointing to the headline that last changed its TODO state
-by a remote command from the agenda.")
-
-(defun org-agenda-todo-nextset ()
- "Switch TODO entry to next sequence."
- (interactive)
- (org-agenda-todo 'nextset))
-
-(defun org-agenda-todo-previousset ()
- "Switch TODO entry to previous sequence."
- (interactive)
- (org-agenda-todo 'previousset))
-
-(defun org-agenda-todo (&optional arg)
- "Cycle TODO state of line at point, also in Org-mode file.
-This changes the line at point, all other lines in the agenda referring to
-the same tree node, and the headline of the tree node in the Org-mode file."
- (interactive "P")
- (org-agenda-check-no-diary)
- (let* ((col (current-column))
- (marker (or (org-get-at-bol 'org-marker)
- (org-agenda-error)))
- (buffer (marker-buffer marker))
- (pos (marker-position marker))
- (hdmarker (org-get-at-bol 'org-hd-marker))
- (todayp (org-agenda-todayp (org-get-at-bol 'day)))
- (inhibit-read-only t)
- org-agenda-headline-snapshot-before-repeat newhead just-one)
- (org-with-remote-undo buffer
- (with-current-buffer buffer
- (widen)
- (goto-char pos)
- (org-show-context 'agenda)
- (save-excursion
- (and (outline-next-heading)
- (org-flag-heading nil))) ; show the next heading
- (let ((current-prefix-arg arg))
- (call-interactively 'org-todo))
- (and (bolp) (forward-char 1))
- (setq newhead (org-get-heading))
- (when (and (org-bound-and-true-p
- org-agenda-headline-snapshot-before-repeat)
- (not (equal org-agenda-headline-snapshot-before-repeat
- newhead))
- todayp)
- (setq newhead org-agenda-headline-snapshot-before-repeat
- just-one t))
- (save-excursion
- (org-back-to-heading)
- (move-marker org-last-heading-marker (point))))
- (beginning-of-line 1)
- (save-excursion
- (org-agenda-change-all-lines newhead hdmarker 'fixface just-one))
- (org-move-to-column col))))
-
-(defun org-agenda-add-note (&optional arg)
- "Add a time-stamped note to the entry at point."
- (interactive "P")
- (org-agenda-check-no-diary)
- (let* ((marker (or (org-get-at-bol 'org-marker)
- (org-agenda-error)))
- (buffer (marker-buffer marker))
- (pos (marker-position marker))
- (hdmarker (org-get-at-bol 'org-hd-marker))
- (inhibit-read-only t))
- (with-current-buffer buffer
- (widen)
- (goto-char pos)
- (org-show-context 'agenda)
- (save-excursion
- (and (outline-next-heading)
- (org-flag-heading nil))) ; show the next heading
- (org-add-note))))
-
-(defun org-agenda-change-all-lines (newhead hdmarker
- &optional fixface just-this)
- "Change all lines in the agenda buffer which match HDMARKER.
-The new content of the line will be NEWHEAD (as modified by
-`org-format-agenda-item'). HDMARKER is checked with
-`equal' against all `org-hd-marker' text properties in the file.
-If FIXFACE is non-nil, the face of each item is modified according to
-the new TODO state.
-If JUST-THIS is non-nil, change just the current line, not all.
-If FORCE-TAGS is non nil, the car of it returns the new tags."
- (let* ((inhibit-read-only t)
- (line (org-current-line))
- (thetags (with-current-buffer (marker-buffer hdmarker)
- (save-excursion (save-restriction (widen)
- (goto-char hdmarker)
- (org-get-tags-at)))))
- props m pl undone-face done-face finish new dotime cat tags)
- (save-excursion
- (goto-char (point-max))
- (beginning-of-line 1)
- (while (not finish)
- (setq finish (bobp))
- (when (and (setq m (org-get-at-bol 'org-hd-marker))
- (or (not just-this) (= (org-current-line) line))
- (equal m hdmarker))
- (setq props (text-properties-at (point))
- dotime (org-get-at-bol 'dotime)
- cat (org-get-at-bol 'org-category)
- tags thetags
- new (org-format-agenda-item "x" newhead cat tags dotime 'noprefix)
- pl (org-get-at-bol 'prefix-length)
- undone-face (org-get-at-bol 'undone-face)
- done-face (org-get-at-bol 'done-face))
- (goto-char (+ (point) pl))
- ;; (org-move-to-column pl) FIXME: does the above line work correctly?
- (cond
- ((equal new "")
- (beginning-of-line 1)
- (and (looking-at ".*\n?") (replace-match "")))
- ((looking-at ".*")
- (replace-match new t t)
- (beginning-of-line 1)
- (add-text-properties (point-at-bol) (point-at-eol) props)
- (when fixface
- (add-text-properties
- (point-at-bol) (point-at-eol)
- (list 'face
- (if org-last-todo-state-is-todo
- undone-face done-face))))
- (org-agenda-highlight-todo 'line)
- (beginning-of-line 1))
- (t (error "Line update did not work"))))
- (beginning-of-line 0)))
- (org-finalize-agenda)))
-
-(defun org-agenda-align-tags (&optional line)
- "Align all tags in agenda items to `org-agenda-tags-column'."
- (let ((inhibit-read-only t) l c)
- (save-excursion
- (goto-char (if line (point-at-bol) (point-min)))
- (while (re-search-forward (org-re "\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$")
- (if line (point-at-eol) nil) t)
- (add-text-properties
- (match-beginning 2) (match-end 2)
- (list 'face (delq nil (let ((prop (get-text-property
- (match-beginning 2) 'face)))
- (or (listp prop) (setq prop (list prop)))
- (if (memq 'org-tag prop)
- prop
- (cons 'org-tag prop))))))
- (setq l (- (match-end 2) (match-beginning 2))
- c (if (< org-agenda-tags-column 0)
- (- (abs org-agenda-tags-column) l)
- org-agenda-tags-column))
- (delete-region (match-beginning 1) (match-end 1))
- (goto-char (match-beginning 1))
- (insert (org-add-props
- (make-string (max 1 (- c (current-column))) ?\ )
- (plist-put (copy-sequence (text-properties-at (point)))
- 'face nil))))
- (goto-char (point-min))
- (org-font-lock-add-tag-faces (point-max)))))
-
-(defun org-agenda-priority-up ()
- "Increase the priority of line at point, also in Org-mode file."
- (interactive)
- (org-agenda-priority 'up))
-
-(defun org-agenda-priority-down ()
- "Decrease the priority of line at point, also in Org-mode file."
- (interactive)
- (org-agenda-priority 'down))
-
-(defun org-agenda-priority (&optional force-direction)
- "Set the priority of line at point, also in Org-mode file.
-This changes the line at point, all other lines in the agenda referring to
-the same tree node, and the headline of the tree node in the Org-mode file."
- (interactive)
- (unless org-enable-priority-commands
- (error "Priority commands are disabled"))
- (org-agenda-check-no-diary)
- (let* ((marker (or (org-get-at-bol 'org-marker)
- (org-agenda-error)))
- (hdmarker (org-get-at-bol 'org-hd-marker))
- (buffer (marker-buffer hdmarker))
- (pos (marker-position hdmarker))
- (inhibit-read-only t)
- newhead)
- (org-with-remote-undo buffer
- (with-current-buffer buffer
- (widen)
- (goto-char pos)
- (org-show-context 'agenda)
- (save-excursion
- (and (outline-next-heading)
- (org-flag-heading nil))) ; show the next heading
- (funcall 'org-priority force-direction)
- (end-of-line 1)
- (setq newhead (org-get-heading)))
- (org-agenda-change-all-lines newhead hdmarker)
- (beginning-of-line 1))))
-
-;; FIXME: should fix the tags property of the agenda line.
-(defun org-agenda-set-tags (&optional tag onoff)
- "Set tags for the current headline."
- (interactive)
- (org-agenda-check-no-diary)
- (if (and (org-region-active-p) (interactive-p))
- (call-interactively 'org-change-tag-in-region)
- (org-agenda-show) ;;; FIXME This is a stupid hack and should not be needed
- (let* ((hdmarker (or (org-get-at-bol 'org-hd-marker)
- (org-agenda-error)))
- (buffer (marker-buffer hdmarker))
- (pos (marker-position hdmarker))
- (inhibit-read-only t)
- newhead)
- (org-with-remote-undo buffer
- (with-current-buffer buffer
- (widen)
- (goto-char pos)
- (save-excursion
- (org-show-context 'agenda))
- (save-excursion
- (and (outline-next-heading)
- (org-flag-heading nil))) ; show the next heading
- (goto-char pos)
- (if tag
- (org-toggle-tag tag onoff)
- (call-interactively 'org-set-tags))
- (end-of-line 1)
- (setq newhead (org-get-heading)))
- (org-agenda-change-all-lines newhead hdmarker)
- (beginning-of-line 1)))))
-
-(defun org-agenda-set-property ()
- "Set a property for the current headline."
- (interactive)
- (org-agenda-check-no-diary)
- (org-agenda-show) ;;; FIXME This is a stupid hack and should not be needed
- (let* ((hdmarker (or (org-get-at-bol 'org-hd-marker)
- (org-agenda-error)))
- (buffer (marker-buffer hdmarker))
- (pos (marker-position hdmarker))
- (inhibit-read-only t)
- newhead)
- (org-with-remote-undo buffer
- (with-current-buffer buffer
- (widen)
- (goto-char pos)
- (save-excursion
- (org-show-context 'agenda))
- (save-excursion
- (and (outline-next-heading)
- (org-flag-heading nil))) ; show the next heading
- (goto-char pos)
- (call-interactively 'org-set-property)))))
-
-(defun org-agenda-set-effort ()
- "Set the effort property for the current headline."
- (interactive)
- (org-agenda-check-no-diary)
- (org-agenda-show) ;;; FIXME This is a stupid hack and should not be needed
- (let* ((hdmarker (or (org-get-at-bol 'org-hd-marker)
- (org-agenda-error)))
- (buffer (marker-buffer hdmarker))
- (pos (marker-position hdmarker))
- (inhibit-read-only t)
- newhead)
- (org-with-remote-undo buffer
- (with-current-buffer buffer
- (widen)
- (goto-char pos)
- (save-excursion
- (org-show-context 'agenda))
- (save-excursion
- (and (outline-next-heading)
- (org-flag-heading nil))) ; show the next heading
- (goto-char pos)
- (call-interactively 'org-set-effort)
- (end-of-line 1)))))
-
-(defun org-agenda-toggle-archive-tag ()
- "Toggle the archive tag for the current entry."
- (interactive)
- (org-agenda-check-no-diary)
- (org-agenda-show) ;;; FIXME This is a stupid hack and should not be needed
- (let* ((hdmarker (or (org-get-at-bol 'org-hd-marker)
- (org-agenda-error)))
- (buffer (marker-buffer hdmarker))
- (pos (marker-position hdmarker))
- (inhibit-read-only t)
- newhead)
- (org-with-remote-undo buffer
- (with-current-buffer buffer
- (widen)
- (goto-char pos)
- (org-show-context 'agenda)
- (save-excursion
- (and (outline-next-heading)
- (org-flag-heading nil))) ; show the next heading
- (call-interactively 'org-toggle-archive-tag)
- (end-of-line 1)
- (setq newhead (org-get-heading)))
- (org-agenda-change-all-lines newhead hdmarker)
- (beginning-of-line 1))))
-
-(defun org-agenda-do-date-later (arg)
- (interactive "P")
- (cond
- ((or (equal arg '(16))
- (memq last-command
- '(org-agenda-date-later-minutes org-agenda-date-earlier-minutes)))
- (setq this-command 'org-agenda-date-later-minutes)
- (org-agenda-date-later-minutes 1))
- ((or (equal arg '(4))
- (memq last-command
- '(org-agenda-date-later-hours org-agenda-date-earlier-hours)))
- (setq this-command 'org-agenda-date-later-hours)
- (org-agenda-date-later-hours 1))
- (t
- (org-agenda-date-later (prefix-numeric-value arg)))))
-
-(defun org-agenda-do-date-earlier (arg)
- (interactive "P")
- (cond
- ((or (equal arg '(16))
- (memq last-command
- '(org-agenda-date-later-minutes org-agenda-date-earlier-minutes)))
- (setq this-command 'org-agenda-date-earlier-minutes)
- (org-agenda-date-earlier-minutes 1))
- ((or (equal arg '(4))
- (memq last-command
- '(org-agenda-date-later-hours org-agenda-date-earlier-hours)))
- (setq this-command 'org-agenda-date-earlier-hours)
- (org-agenda-date-earlier-hours 1))
- (t
- (org-agenda-date-earlier (prefix-numeric-value arg)))))
-
-(defun org-agenda-date-later (arg &optional what)
- "Change the date of this item to one day later."
- (interactive "p")
- (org-agenda-check-type t 'agenda 'timeline)
- (org-agenda-check-no-diary)
- (let* ((marker (or (org-get-at-bol 'org-marker)
- (org-agenda-error)))
- (buffer (marker-buffer marker))
- (pos (marker-position marker)))
- (org-with-remote-undo buffer
- (with-current-buffer buffer
- (widen)
- (goto-char pos)
- (if (not (org-at-timestamp-p))
- (error "Cannot find time stamp"))
- (org-timestamp-change arg (or what 'day)))
- (org-agenda-show-new-time marker org-last-changed-timestamp))
- (message "Time stamp changed to %s" org-last-changed-timestamp)))
-
-(defun org-agenda-date-earlier (arg &optional what)
- "Change the date of this item to one day earlier."
- (interactive "p")
- (org-agenda-date-later (- arg) what))
-
-(defun org-agenda-date-later-minutes (arg)
- "Change the time of this item, in units of `org-time-stamp-rounding-minutes'."
- (interactive "p")
- (setq arg (* arg (cadr org-time-stamp-rounding-minutes)))
- (org-agenda-date-later arg 'minute))
-
-(defun org-agenda-date-earlier-minutes (arg)
- "Change the time of this item, in units of `org-time-stamp-rounding-minutes'."
- (interactive "p")
- (setq arg (* arg (cadr org-time-stamp-rounding-minutes)))
- (org-agenda-date-earlier arg 'minute))
-
-(defun org-agenda-date-later-hours (arg)
- "Change the time of this item, in hour steps."
- (interactive "p")
- (org-agenda-date-later arg 'hour))
-
-(defun org-agenda-date-earlier-hours (arg)
- "Change the time of this item, in hour steps."
- (interactive "p")
- (org-agenda-date-earlier arg 'hour))
-
-(defun org-agenda-show-new-time (marker stamp &optional prefix)
- "Show new date stamp via text properties."
- ;; We use text properties to make this undoable
- (let ((inhibit-read-only t)
- (buffer-invisibility-spec))
- (setq stamp (concat " " prefix " => " stamp))
- (save-excursion
- (goto-char (point-max))
- (while (not (bobp))
- (when (equal marker (org-get-at-bol 'org-marker))
- (org-move-to-column (- (window-width) (length stamp)) t)
- (org-agenda-fix-tags-filter-overlays-at (point))
- (if (featurep 'xemacs)
- ;; Use `duplicable' property to trigger undo recording
- (let ((ex (make-extent nil nil))
- (gl (make-glyph stamp)))
- (set-glyph-face gl 'secondary-selection)
- (set-extent-properties
- ex (list 'invisible t 'end-glyph gl 'duplicable t))
- (insert-extent ex (1- (point)) (point-at-eol)))
- (add-text-properties
- (1- (point)) (point-at-eol)
- (list 'display (org-add-props stamp nil
- 'face 'secondary-selection))))
- (beginning-of-line 1))
- (beginning-of-line 0)))))
-
-(defun org-agenda-date-prompt (arg)
- "Change the date of this item. Date is prompted for, with default today.
-The prefix ARG is passed to the `org-time-stamp' command and can therefore
-be used to request time specification in the time stamp."
- (interactive "P")
- (org-agenda-check-type t 'agenda 'timeline)
- (org-agenda-check-no-diary)
- (let* ((marker (or (org-get-at-bol 'org-marker)
- (org-agenda-error)))
- (buffer (marker-buffer marker))
- (pos (marker-position marker)))
- (org-with-remote-undo buffer
- (with-current-buffer buffer
- (widen)
- (goto-char pos)
- (if (not (org-at-timestamp-p t))
- (error "Cannot find time stamp"))
- (org-time-stamp arg (equal (char-after (match-beginning 0)) ?\[)))
- (org-agenda-show-new-time marker org-last-changed-timestamp))
- (message "Time stamp changed to %s" org-last-changed-timestamp)))
-
-(defun org-agenda-schedule (arg)
- "Schedule the item at point.
-Arg is passed through to `org-schedule'."
- (interactive "P")
- (org-agenda-check-type t 'agenda 'timeline 'todo 'tags 'search)
- (org-agenda-check-no-diary)
- (let* ((marker (or (org-get-at-bol 'org-marker)
- (org-agenda-error)))
- (type (marker-insertion-type marker))
- (buffer (marker-buffer marker))
- (pos (marker-position marker))
- (org-insert-labeled-timestamps-at-point nil)
- ts)
- (set-marker-insertion-type marker t)
- (org-with-remote-undo buffer
- (with-current-buffer buffer
- (widen)
- (goto-char pos)
- (setq ts (org-schedule arg)))
- (org-agenda-show-new-time marker ts "S"))
- (message "Item scheduled for %s" ts)))
-
-(defun org-agenda-deadline (arg)
- "Schedule the item at point.
-Arg is passed through to `org-deadline'."
- (interactive "P")
- (org-agenda-check-type t 'agenda 'timeline 'todo 'tags 'search)
- (org-agenda-check-no-diary)
- (let* ((marker (or (org-get-at-bol 'org-marker)
- (org-agenda-error)))
- (buffer (marker-buffer marker))
- (pos (marker-position marker))
- (org-insert-labeled-timestamps-at-point nil)
- ts)
- (org-with-remote-undo buffer
- (with-current-buffer buffer
- (widen)
- (goto-char pos)
- (setq ts (org-deadline arg)))
- (org-agenda-show-new-time marker ts "D"))
- (message "Deadline for this item set to %s" ts)))
-
-(defun org-agenda-action ()
- "Select entry for agenda action, or execute an agenda action.
-This command prompts for another letter. Valid inputs are:
-
-m Mark the entry at point for an agenda action
-s Schedule the marked entry to the date at the cursor
-d Set the deadline of the marked entry to the date at the cursor
-r Call `org-remember' with cursor date as the default date
-c Call `org-capture' with cursor date as the default date
-SPC Show marked entry in other window
-TAB Visit marked entry in other window
-
-The cursor may be at a date in the calendar, or in the Org agenda."
- (interactive)
- (let (ans)
- (message "Select action: [m]ark | [s]chedule [d]eadline [r]emember [c]apture [ ]show")
- (setq ans (read-char-exclusive))
- (cond
- ((equal ans ?m)
- ;; Mark this entry
- (if (eq major-mode 'org-agenda-mode)
- (let ((m (or (org-get-at-bol 'org-hd-marker)
- (org-get-at-bol 'org-marker))))
- (if m
- (progn
- (move-marker org-agenda-action-marker
- (marker-position m) (marker-buffer m))
- (message "Entry marked for action; press `k' at desired date in agenda or calendar"))
- (error "Don't know which entry to mark")))
- (error "This command works only in the agenda")))
- ((equal ans ?s)
- (org-agenda-do-action '(org-schedule nil org-overriding-default-time)))
- ((equal ans ?d)
- (org-agenda-do-action '(org-deadline nil org-overriding-default-time)))
- ((equal ans ?r)
- (org-agenda-do-action '(org-remember) t))
- ((equal ans ?c)
- (org-agenda-do-action '(org-capture) t))
- ((equal ans ?\ )
- (let ((cw (selected-window)))
- (org-switch-to-buffer-other-window
- (marker-buffer org-agenda-action-marker))
- (goto-char org-agenda-action-marker)
- (org-show-context 'agenda)
- (select-window cw)))
- ((equal ans ?\C-i)
- (org-switch-to-buffer-other-window
- (marker-buffer org-agenda-action-marker))
- (goto-char org-agenda-action-marker)
- (org-show-context 'agenda))
- (t (error "Invalid agenda action %c" ans)))))
-
-(defun org-agenda-do-action (form &optional current-buffer)
- "Evaluate FORM at the entry pointed to by `org-agenda-action-marker'."
- (let ((org-overriding-default-time (org-get-cursor-date)))
- (if current-buffer
- (eval form)
- (if (not (marker-buffer org-agenda-action-marker))
- (error "No entry has been selected for agenda action")
- (with-current-buffer (marker-buffer org-agenda-action-marker)
- (save-excursion
- (save-restriction
- (widen)
- (goto-char org-agenda-action-marker)
- (eval form))))))))
-
-(defun org-agenda-clock-in (&optional arg)
- "Start the clock on the currently selected item."
- (interactive "P")
- (org-agenda-check-no-diary)
- (if (equal arg '(4))
- (org-clock-in arg)
- (let* ((marker (or (org-get-at-bol 'org-marker)
- (org-agenda-error)))
- (hdmarker (or (org-get-at-bol 'org-hd-marker)
- marker))
- (pos (marker-position marker))
- newhead)
- (org-with-remote-undo (marker-buffer marker)
- (with-current-buffer (marker-buffer marker)
- (widen)
- (goto-char pos)
- (org-show-context 'agenda)
- (org-show-entry)
- (org-cycle-hide-drawers 'children)
- (org-clock-in arg)
- (setq newhead (org-get-heading)))
- (org-agenda-change-all-lines newhead hdmarker)))))
-
-(defun org-agenda-clock-out ()
- "Stop the currently running clock."
- (interactive)
- (unless (marker-buffer org-clock-marker)
- (error "No running clock"))
- (let ((marker (make-marker)) newhead)
- (org-with-remote-undo (marker-buffer org-clock-marker)
- (with-current-buffer (marker-buffer org-clock-marker)
- (save-excursion
- (save-restriction
- (widen)
- (goto-char org-clock-marker)
- (org-back-to-heading t)
- (move-marker marker (point))
- (org-clock-out)
- (setq newhead (org-get-heading))))))
- (org-agenda-change-all-lines newhead marker)
- (move-marker marker nil)))
-
-(defun org-agenda-clock-cancel (&optional arg)
- "Cancel the currently running clock."
- (interactive "P")
- (unless (marker-buffer org-clock-marker)
- (error "No running clock"))
- (org-with-remote-undo (marker-buffer org-clock-marker)
- (org-clock-cancel)))
-
-(defun org-agenda-clock-goto ()
- "Jump to the currently clocked in task within the agenda.
-If the currently clocked in task is not listed in the agenda
-buffer, display it in another window."
- (interactive)
- (let (pos)
- (mapc (lambda (o)
- (if (eq (overlay-get o 'type) 'org-agenda-clocking)
- (setq pos (overlay-start o))))
- (overlays-in (point-min) (point-max)))
- (cond (pos (goto-char pos))
- ;; If the currently clocked entry is not in the agenda
- ;; buffer, we visit it in another window:
- (org-clock-current-task
- (org-switch-to-buffer-other-window (org-clock-goto)))
- (t (message "No running clock, use `C-c C-x C-j' to jump to the most recent one")))))
-
-(defun org-agenda-diary-entry-in-org-file ()
- "Make a diary entry in the file `org-agenda-diary-file'."
- (let (d1 d2 char (text "") dp1 dp2)
- (if (equal (buffer-name) "*Calendar*")
- (setq d1 (calendar-cursor-to-date t)
- d2 (car calendar-mark-ring))
- (setq dp1 (get-text-property (point-at-bol) 'day))
- (unless dp1 (error "No date defined in current line"))
- (setq d1 (calendar-gregorian-from-absolute dp1)
- d2 (and (ignore-errors (mark))
- (save-excursion
- (goto-char (mark))
- (setq dp2 (get-text-property (point-at-bol) 'day)))
- (calendar-gregorian-from-absolute dp2))))
- (message "Diary entry: [d]ay [a]nniversary [b]lock [j]ump to date tree")
- (setq char (read-char-exclusive))
- (cond
- ((equal char ?d)
- (setq text (read-string "Day entry: "))
- (org-agenda-add-entry-to-org-agenda-diary-file 'day text d1)
- (and (equal (buffer-name) org-agenda-buffer-name) (org-agenda-redo)))
- ((equal char ?a)
- (setq d1 (list (car d1) (nth 1 d1)
- (read-number (format "Reference year [%d]: " (nth 2 d1))
- (nth 2 d1))))
- (setq text (read-string "Anniversary (use %d to show years): "))
- (org-agenda-add-entry-to-org-agenda-diary-file 'anniversary text d1)
- (and (equal (buffer-name) org-agenda-buffer-name) (org-agenda-redo)))
- ((equal char ?b)
- (setq text (read-string "Block entry: "))
- (unless (and d1 d2 (not (equal d1 d2)))
- (error "No block of days selected"))
- (org-agenda-add-entry-to-org-agenda-diary-file 'block text d1 d2)
- (and (equal (buffer-name) org-agenda-buffer-name) (org-agenda-redo)))
- ((equal char ?j)
- (org-switch-to-buffer-other-window
- (find-file-noselect org-agenda-diary-file))
- (require 'org-datetree)
- (org-datetree-find-date-create d1)
- (org-reveal t))
- (t (error "Invalid selection character `%c'" char)))))
-
-(defcustom org-agenda-insert-diary-strategy 'date-tree
- "Where in `org-agenda-diary-file' should new entries be added?
-Valid values:
-
-date-tree in the date tree, as child of the date
-top-level as top-level entries at the end of the file."
- :group 'org-agenda
- :type '(choice
- (const :tag "in a date tree" date-tree)
- (const :tag "as top level at end of file" top-level)))
-
-(defcustom org-agenda-insert-diary-extract-time nil
- "Non-nil means extract any time specification from the diary entry."
- :group 'org-agenda
- :type 'boolean)
-
-(defun org-agenda-add-entry-to-org-agenda-diary-file (type text &optional d1 d2)
- "Add a diary entry with TYPE to `org-agenda-diary-file'.
-If TEXT is not empty, it will become the headline of the new entry, and
-the resulting entry will not be shown. When TEXT is empty, switch to
-`org-agenda-diary-file' and let the user finish the entry there."
- (let ((cw (current-window-configuration)))
- (org-switch-to-buffer-other-window
- (find-file-noselect org-agenda-diary-file))
- (widen)
- (goto-char (point-min))
- (cond
- ((eq type 'anniversary)
- (or (re-search-forward "^*[ \t]+Anniversaries" nil t)
- (progn
- (or (org-on-heading-p t)
- (progn
- (outline-next-heading)
- (insert "* Anniversaries\n\n")
- (beginning-of-line -1)))))
- (outline-next-heading)
- (org-back-over-empty-lines)
- (backward-char 1)
- (insert "\n")
- (require 'diary-lib)
- (let ((calendar-date-display-form
- (if (if (boundp 'calendar-date-style)
- (eq calendar-date-style 'european)
- (with-no-warnings ;; european-calendar-style is obsolete as of version 23.1
- (org-bound-and-true-p european-calendar-style))) ; Emacs 22
- '(day " " month " " year)
- '(month " " day " " year))))
-
- (insert (format "%%%%(diary-anniversary %s) %s"
- (calendar-date-string d1 nil t) text))))
- ((eq type 'day)
- (let ((org-prefix-has-time t)
- (org-agenda-time-leading-zero t)
- fmt time time2)
- (if org-agenda-insert-diary-extract-time
- ;; Use org-format-agenda-item to parse text for a time-range and
- ;; remove it. FIXME: This is a hack, we should refactor
- ;; that function to make time extraction available separately
- (setq fmt (org-format-agenda-item nil text nil nil t)
- time (get-text-property 0 'time fmt)
- time2 (if (> (length time) 0)
- ;; split-string removes trailing ...... if
- ;; no end time given. First space
- ;; separates time from date.
- (concat " " (car (split-string time "\\.")))
- nil)
- text (get-text-property 0 'txt fmt)))
- (if (eq org-agenda-insert-diary-strategy 'top-level)
- (org-agenda-insert-diary-as-top-level text)
- (require 'org-datetree)
- (org-datetree-find-date-create d1)
- (org-agenda-insert-diary-make-new-entry text))
- (org-insert-time-stamp (org-time-from-absolute
- (calendar-absolute-from-gregorian d1))
- nil nil nil nil time2))
- (end-of-line 0))
- ((eq type 'block)
- (if (> (calendar-absolute-from-gregorian d1)
- (calendar-absolute-from-gregorian d2))
- (setq d1 (prog1 d2 (setq d2 d1))))
- (if (eq org-agenda-insert-diary-strategy 'top-level)
- (org-agenda-insert-diary-as-top-level text)
- (require 'org-datetree)
- (org-datetree-find-date-create d1)
- (org-agenda-insert-diary-make-new-entry text))
- (org-insert-time-stamp (org-time-from-absolute
- (calendar-absolute-from-gregorian d1)))
- (insert "--")
- (org-insert-time-stamp (org-time-from-absolute
- (calendar-absolute-from-gregorian d2)))
- (end-of-line 0)))
- (if (string-match "\\S-" text)
- (progn
- (set-window-configuration cw)
- (message "%s entry added to %s"
- (capitalize (symbol-name type))
- (abbreviate-file-name org-agenda-diary-file)))
- (org-reveal t)
- (message "Please finish entry here"))))
-
-(defun org-agenda-insert-diary-as-top-level (text)
- "Make new entry as a top-level entry at the end of the file.
-Add TEXT as headline, and position the cursor in the second line so that
-a timestamp can be added there."
- (widen)
- (goto-char (point-max))
- (or (bolp) (insert "\n"))
- (insert "* " text "\n")
- (if org-adapt-indentation (org-indent-to-column 2)))
-
-(defun org-agenda-insert-diary-make-new-entry (text)
- "Make new entry as last child of current entry.
-Add TEXT as headline, and position the cursor in the second line so that
-a timestamp can be added there."
- (let ((org-show-following-heading t)
- (org-show-siblings t)
- (org-show-hierarchy-above t)
- (org-show-entry-below t)
- col)
- (outline-next-heading)
- (org-back-over-empty-lines)
- (or (looking-at "[ \t]*$")
- (progn (insert "\n") (backward-char 1)))
- (org-insert-heading nil t)
- (org-do-demote)
- (setq col (current-column))
- (insert text "\n")
- (if org-adapt-indentation (org-indent-to-column col))
- (let ((org-show-following-heading t)
- (org-show-siblings t)
- (org-show-hierarchy-above t)
- (org-show-entry-below t))
- (org-show-context))))
-
-(defun org-agenda-diary-entry ()
- "Make a diary entry, like the `i' command from the calendar.
-All the standard commands work: block, weekly etc.
-When `org-agenda-diary-file' points to a file,
-`org-agenda-diary-entry-in-org-file' is called instead to create
-entries in that Org-mode file."
- (interactive)
- (org-agenda-check-type t 'agenda 'timeline)
- (if (not (eq org-agenda-diary-file 'diary-file))
- (org-agenda-diary-entry-in-org-file)
- (require 'diary-lib)
- (let* ((char (progn
- (message "Diary entry: [d]ay [w]eekly [m]onthly [y]early [a]nniversary [b]lock [c]yclic")
- (read-char-exclusive)))
- (cmd (cdr (assoc char
- '((?d . insert-diary-entry)
- (?w . insert-weekly-diary-entry)
- (?m . insert-monthly-diary-entry)
- (?y . insert-yearly-diary-entry)
- (?a . insert-anniversary-diary-entry)
- (?b . insert-block-diary-entry)
- (?c . insert-cyclic-diary-entry)))))
- (oldf (symbol-function 'calendar-cursor-to-date))
- ;; (buf (get-file-buffer (substitute-in-file-name diary-file)))
- (point (point))
- (mark (or (mark t) (point))))
- (unless cmd
- (error "No command associated with <%c>" char))
- (unless (and (get-text-property point 'day)
- (or (not (equal ?b char))
- (get-text-property mark 'day)))
- (error "Don't know which date to use for diary entry"))
- ;; We implement this by hacking the `calendar-cursor-to-date' function
- ;; and the `calendar-mark-ring' variable. Saves a lot of code.
- (let ((calendar-mark-ring
- (list (calendar-gregorian-from-absolute
- (or (get-text-property mark 'day)
- (get-text-property point 'day))))))
- (unwind-protect
- (progn
- (fset 'calendar-cursor-to-date
- (lambda (&optional error dummy)
- (calendar-gregorian-from-absolute
- (get-text-property point 'day))))
- (call-interactively cmd))
- (fset 'calendar-cursor-to-date oldf))))))
-
-(defun org-agenda-execute-calendar-command (cmd)
- "Execute a calendar command from the agenda, with the date associated to
-the cursor position."
- (org-agenda-check-type t 'agenda 'timeline)
- (require 'diary-lib)
- (unless (get-text-property (point) 'day)
- (error "Don't know which date to use for calendar command"))
- (let* ((oldf (symbol-function 'calendar-cursor-to-date))
- (point (point))
- (date (calendar-gregorian-from-absolute
- (get-text-property point 'day)))
- ;; the following 2 vars are needed in the calendar
- (displayed-month (car date))
- (displayed-year (nth 2 date)))
- (unwind-protect
- (progn
- (fset 'calendar-cursor-to-date
- (lambda (&optional error dummy)
- (calendar-gregorian-from-absolute
- (get-text-property point 'day))))
- (call-interactively cmd))
- (fset 'calendar-cursor-to-date oldf))))
-
-(defun org-agenda-phases-of-moon ()
- "Display the phases of the moon for the 3 months around the cursor date."
- (interactive)
- (org-agenda-execute-calendar-command 'calendar-phases-of-moon))
-
-(defun org-agenda-holidays ()
- "Display the holidays for the 3 months around the cursor date."
- (interactive)
- (org-agenda-execute-calendar-command 'list-calendar-holidays))
-
-(defvar calendar-longitude)
-(defvar calendar-latitude)
-(defvar calendar-location-name)
-
-(defun org-agenda-sunrise-sunset (arg)
- "Display sunrise and sunset for the cursor date.
-Latitude and longitude can be specified with the variables
-`calendar-latitude' and `calendar-longitude'. When called with prefix
-argument, latitude and longitude will be prompted for."
- (interactive "P")
- (require 'solar)
- (let ((calendar-longitude (if arg nil calendar-longitude))
- (calendar-latitude (if arg nil calendar-latitude))
- (calendar-location-name
- (if arg "the given coordinates" calendar-location-name)))
- (org-agenda-execute-calendar-command 'calendar-sunrise-sunset)))
-
-(defun org-agenda-goto-calendar ()
- "Open the Emacs calendar with the date at the cursor."
- (interactive)
- (org-agenda-check-type t 'agenda 'timeline)
- (let* ((day (or (get-text-property (point) 'day)
- (error "Don't know which date to open in calendar")))
- (date (calendar-gregorian-from-absolute day))
- (calendar-move-hook nil)
- (calendar-view-holidays-initially-flag nil)
- (calendar-view-diary-initially-flag nil))
- (calendar)
- (calendar-goto-date date)))
-
-;;;###autoload
-(defun org-calendar-goto-agenda ()
- "Compute the Org-mode agenda for the calendar date displayed at the cursor.
-This is a command that has to be installed in `calendar-mode-map'."
- (interactive)
- (org-agenda-list nil (calendar-absolute-from-gregorian
- (calendar-cursor-to-date))
- nil))
-
-(defun org-agenda-convert-date ()
- (interactive)
- (org-agenda-check-type t 'agenda 'timeline)
- (let ((day (get-text-property (point) 'day))
- date s)
- (unless day
- (error "Don't know which date to convert"))
- (setq date (calendar-gregorian-from-absolute day))
- (setq s (concat
- "Gregorian: " (calendar-date-string date) "\n"
- "ISO: " (calendar-iso-date-string date) "\n"
- "Day of Yr: " (calendar-day-of-year-string date) "\n"
- "Julian: " (calendar-julian-date-string date) "\n"
- "Astron. JD: " (calendar-astro-date-string date)
- " (Julian date number at noon UTC)\n"
- "Hebrew: " (calendar-hebrew-date-string date) " (until sunset)\n"
- "Islamic: " (calendar-islamic-date-string date) " (until sunset)\n"
- "French: " (calendar-french-date-string date) "\n"
- "Baha'i: " (calendar-bahai-date-string date) " (until sunset)\n"
- "Mayan: " (calendar-mayan-date-string date) "\n"
- "Coptic: " (calendar-coptic-date-string date) "\n"
- "Ethiopic: " (calendar-ethiopic-date-string date) "\n"
- "Persian: " (calendar-persian-date-string date) "\n"
- "Chinese: " (calendar-chinese-date-string date) "\n"))
- (with-output-to-temp-buffer "*Dates*"
- (princ s))
- (org-fit-window-to-buffer (get-buffer-window "*Dates*"))))
-
-;;; Bulk commands
-
-(defvar org-agenda-bulk-marked-entries nil
- "List of markers that refer to marked entries in the agenda.")
-
-(defun org-agenda-bulk-marked-p ()
- (eq (get-char-property (point-at-bol) 'type)
- 'org-marked-entry-overlay))
-
-(defun org-agenda-bulk-mark (&optional arg)
- "Mark the entry at point for future bulk action."
- (interactive "p")
- (dotimes (i (max arg 1))
- (unless (org-get-at-bol 'org-agenda-diary-link)
- (let* ((m (org-get-at-bol 'org-hd-marker))
- ov)
- (unless (org-agenda-bulk-marked-p)
- (unless m (error "Nothing to mark at point"))
- (push m org-agenda-bulk-marked-entries)
- (setq ov (make-overlay (point-at-bol) (+ 2 (point-at-bol))))
- (org-overlay-display ov "> "
- (org-get-todo-face "TODO")
- 'evaporate)
- (overlay-put ov 'type 'org-marked-entry-overlay))
- (beginning-of-line 2)
- (while (and (get-char-property (point) 'invisible) (not (eobp)))
- (beginning-of-line 2))
- (message "%d entries marked for bulk action"
- (length org-agenda-bulk-marked-entries))))))
-
-(defun org-agenda-bulk-unmark ()
- "Unmark the entry at point for future bulk action."
- (interactive)
- (when (org-agenda-bulk-marked-p)
- (org-agenda-bulk-remove-overlays
- (point-at-bol) (+ 2 (point-at-bol)))
- (setq org-agenda-bulk-marked-entries
- (delete (org-get-at-bol 'org-hd-marker)
- org-agenda-bulk-marked-entries)))
- (beginning-of-line 2)
- (while (and (get-char-property (point) 'invisible) (not (eobp)))
- (beginning-of-line 2))
- (message "%d entries marked for bulk action"
- (length org-agenda-bulk-marked-entries)))
-
-(defun org-agenda-bulk-toggle ()
- "Toggle marking the entry at point for bulk action."
- (interactive)
- (if (org-agenda-bulk-marked-p)
- (org-agenda-bulk-unmark)
- (org-agenda-bulk-mark)))
-
-(defun org-agenda-bulk-remove-overlays (&optional beg end)
- "Remove the mark overlays between BEG and END in the agenda buffer.
-BEG and END default to the buffer limits.
-
-This only removes the overlays, it does not remove the markers
-from the list in `org-agenda-bulk-marked-entries'."
- (interactive)
- (mapc (lambda (ov)
- (and (eq (overlay-get ov 'type) 'org-marked-entry-overlay)
- (delete-overlay ov)))
- (overlays-in (or beg (point-min)) (or end (point-max)))))
-
-(defun org-agenda-bulk-remove-all-marks ()
- "Remove all marks in the agenda buffer.
-This will remove the markers, and the overlays."
- (interactive)
- (mapc (lambda (m) (move-marker m nil)) org-agenda-bulk-marked-entries)
- (setq org-agenda-bulk-marked-entries nil)
- (org-agenda-bulk-remove-overlays (point-min) (point-max)))
-
-(defun org-agenda-bulk-action (&optional arg)
- "Execute an remote-editing action on all marked entries.
-The prefix arg is passed through to the command if possible."
- (interactive "P")
- (unless org-agenda-bulk-marked-entries
- (error "No entries are marked"))
- (message "Bulk: [r]efile [$]arch [A]rch->sib [t]odo [+/-]tag [s]chd [S]catter [d]eadline")
- (let* ((action (read-char-exclusive))
- (org-log-refile (if org-log-refile 'time nil))
- (entries (reverse org-agenda-bulk-marked-entries))
- redo-at-end
- cmd rfloc state e tag pos (cnt 0) (cntskip 0))
- (cond
- ((equal action ?$)
- (setq cmd '(org-agenda-archive)))
-
- ((equal action ?A)
- (setq cmd '(org-agenda-archive-to-archive-sibling)))
-
- ((member action '(?r ?w))
- (setq rfloc (org-refile-get-location
- "Refile to: "
- (marker-buffer (car org-agenda-bulk-marked-entries))
- org-refile-allow-creating-parent-nodes))
- (if (nth 3 rfloc)
- (setcar (nthcdr 3 rfloc)
- (move-marker (make-marker) (nth 3 rfloc)
- (or (get-file-buffer (nth 1 rfloc))
- (find-buffer-visiting (nth 1 rfloc))
- (error "This should not happen")))))
-
- (setq cmd (list 'org-agenda-refile nil (list 'quote rfloc) t)
- redo-at-end t))
-
- ((equal action ?t)
- (setq state (org-icompleting-read
- "Todo state: "
- (with-current-buffer (marker-buffer (car entries))
- (mapcar 'list org-todo-keywords-1))))
- (setq cmd `(let ((org-inhibit-blocking t)
- (org-inhibit-logging 'note))
- (org-agenda-todo ,state))))
-
- ((memq action '(?- ?+))
- (setq tag (org-icompleting-read
- (format "Tag to %s: " (if (eq action ?+) "add" "remove"))
- (with-current-buffer (marker-buffer (car entries))
- (delq nil
- (mapcar (lambda (x)
- (if (stringp (car x)) x)) org-tag-alist)))))
- (setq cmd `(org-agenda-set-tags ,tag ,(if (eq action ?+) ''on ''off))))
-
- ((memq action '(?s ?d))
- (let* ((date (unless arg
- (org-read-date
- nil nil nil
- (if (eq action ?s) "(Re)Schedule to" "Set Deadline to"))))
- (ans (if arg nil org-read-date-final-answer))
- (c1 (if (eq action ?s) 'org-agenda-schedule 'org-agenda-deadline)))
- (setq cmd `(let* ((bound (fboundp 'read-string))
- (old (and bound (symbol-function 'read-string))))
- (unwind-protect
- (progn
- (fset 'read-string (lambda (&rest ignore) ,ans))
- (eval '(,c1 arg)))
- (if bound
- (fset 'read-string old)
- (fmakunbound 'read-string)))))))
-
- ((eq action '?S)
- (let ((days (read-number
- (format "Scatter tasks across how many %sdays: "
- (if arg "week" "")) 7)))
- (setq cmd
- `(let ((distance (random ,(1+ days))))
- (if arg
- (let ((dist distance)
- (day-of-week
- (calendar-day-of-week
- (calendar-gregorian-from-absolute (org-today)))))
- (dotimes (i (1+ dist))
- (while (member day-of-week org-agenda-weekend-days)
- (incf distance)
- (incf day-of-week)
- (if (= day-of-week 7)
- (setq day-of-week 0)))
- (incf day-of-week)
- (if (= day-of-week 7)
- (setq day-of-week 0)))))
- (org-agenda-date-later distance)))))
-
- (t (error "Invalid bulk action")))
-
- ;; Sort the markers, to make sure that parents are handled before children
- (setq entries (sort entries
- (lambda (a b)
- (cond
- ((equal (marker-buffer a) (marker-buffer b))
- (< (marker-position a) (marker-position b)))
- (t
- (string< (buffer-name (marker-buffer a))
- (buffer-name (marker-buffer b))))))))
-
- ;; Now loop over all markers and apply cmd
- (while (setq e (pop entries))
- (setq pos (text-property-any (point-min) (point-max) 'org-hd-marker e))
- (if (not pos)
- (progn (message "Skipping removed entry at %s" e)
- (setq cntskip (1+ cntskip)))
- (goto-char pos)
- (eval cmd)
- (setq org-agenda-bulk-marked-entries
- (delete e org-agenda-bulk-marked-entries))
- (setq cnt (1+ cnt))))
- (setq org-agenda-bulk-marked-entries nil)
- (org-agenda-bulk-remove-all-marks)
- (when redo-at-end (org-agenda-redo))
- (message "Acted on %d entries%s"
- cnt
- (if (= cntskip 0)
- ""
- (format ", skipped %d (disappeared before their turn)"
- cntskip)))))
-
-;;; Flagging notes
-
-(defun org-agenda-show-the-flagging-note ()
- "Display the flagging note in the other window.
-When called a second time in direct sequence, offer to remove the FLAGGING
-tag and (if present) the flagging note."
- (interactive)
- (let ((hdmarker (org-get-at-bol 'org-hd-marker))
- (win (selected-window))
- note heading newhead)
- (unless hdmarker
- (error "No linked entry at point"))
- (if (and (eq this-command last-command)
- (y-or-n-p "Unflag and remove any flagging note? "))
- (progn
- (org-agenda-remove-flag hdmarker)
- (let ((win (get-buffer-window "*Flagging Note*")))
- (and win (delete-window win)))
- (message "Entry unflaged"))
- (setq note (org-entry-get hdmarker "THEFLAGGINGNOTE"))
- (unless note
- (error "No flagging note"))
- (org-kill-new note)
- (org-switch-to-buffer-other-window "*Flagging Note*")
- (erase-buffer)
- (insert note)
- (goto-char (point-min))
- (while (re-search-forward "\\\\n" nil t)
- (replace-match "\n" t t))
- (goto-char (point-min))
- (select-window win)
- (message "Flagging note pushed to kill ring. Press [?] again to remove tag and note"))))
-
-(defun org-agenda-remove-flag (marker)
- "Remove the FLAGGED tag and any flagging note in the entry."
- (let (newhead)
- (org-with-point-at marker
- (org-toggle-tag "FLAGGED" 'off)
- (org-entry-delete nil "THEFLAGGINGNOTE")
- (setq newhead (org-get-heading)))
- (org-agenda-change-all-lines newhead marker)
- (message "Entry unflaged")))
-
-(defun org-agenda-get-any-marker (&optional pos)
- (or (get-text-property (or pos (point-at-bol)) 'org-hd-marker)
- (get-text-property (or pos (point-at-bol)) 'org-marker)))
-
-;;; Appointment reminders
-
-(defvar appt-time-msg-list)
-
-;;;###autoload
-(defun org-agenda-to-appt (&optional refresh filter)
- "Activate appointments found in `org-agenda-files'.
-With a \\[universal-argument] prefix, refresh the list of
-appointments.
-
-If FILTER is t, interactively prompt the user for a regular
-expression, and filter out entries that don't match it.
-
-If FILTER is a string, use this string as a regular expression
-for filtering entries out.
-
-FILTER can also be an alist with the car of each cell being
-either 'headline or 'category. For example:
-
- '((headline \"IMPORTANT\")
- (category \"Work\"))
-
-will only add headlines containing IMPORTANT or headlines
-belonging to the \"Work\" category."
- (interactive "P")
- (if refresh (setq appt-time-msg-list nil))
- (if (eq filter t)
- (setq filter (read-from-minibuffer "Regexp filter: ")))
- (let* ((cnt 0) ; count added events
- (org-agenda-new-buffers nil)
- (org-deadline-warning-days 0)
- ;; Do not use `org-today' here because appt only takes
- ;; time and without date as argument, so it may pass wrong
- ;; information otherwise
- (today (org-date-to-gregorian
- (time-to-days (current-time))))
- (org-agenda-restrict nil)
- (files (org-agenda-files 'unrestricted)) entries file)
- ;; Get all entries which may contain an appt
- (org-prepare-agenda-buffers files)
- (while (setq file (pop files))
- (setq entries
- (append entries
- (org-agenda-get-day-entries
- file today :timestamp :scheduled :deadline))))
- (setq entries (delq nil entries))
- ;; Map thru entries and find if we should filter them out
- (mapc
- (lambda(x)
- (let* ((evt (org-trim (or (get-text-property 1 'txt x) "")))
- (cat (get-text-property 1 'org-category x))
- (tod (get-text-property 1 'time-of-day x))
- (ok (or (null filter)
- (and (stringp filter) (string-match filter evt))
- (and (listp filter)
- (or (string-match
- (cadr (assoc 'category filter)) cat)
- (string-match
- (cadr (assoc 'headline filter)) evt))))))
- ;; FIXME: Shall we remove text-properties for the appt text?
- ;; (setq evt (set-text-properties 0 (length evt) nil evt))
- (when (and ok tod)
- (setq tod (concat "00" (number-to-string tod))
- tod (when (string-match
- "\\([0-9]\\{1,2\\}\\)\\([0-9]\\{2\\}\\)\\'" tod)
- (concat (match-string 1 tod) ":"
- (match-string 2 tod))))
- (appt-add tod evt)
- (setq cnt (1+ cnt))))) entries)
- (org-release-buffers org-agenda-new-buffers)
- (if (eq cnt 0)
- (message "No event to add")
- (message "Added %d event%s for today" cnt (if (> cnt 1) "s" "")))))
-
-(defun org-agenda-todayp (date)
- "Does DATE mean today, when considering `org-extend-today-until'?"
- (let ((today (org-today))
- (date (if (and date (listp date)) (calendar-absolute-from-gregorian date)
- date)))
- (eq date today)))
-
-(provide 'org-agenda)
-
-;; arch-tag: 77f7565d-7c4b-44af-a2df-9f6f7070cff1
-
-;;; org-agenda.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-agenda.elc b/.emacs.d/org-7.4/lisp/org-agenda.elc
deleted file mode 100644
index 3e27fec..0000000
--- a/.emacs.d/org-7.4/lisp/org-agenda.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-archive.el b/.emacs.d/org-7.4/lisp/org-archive.el
deleted file mode 100644
index e56b01f..0000000
--- a/.emacs.d/org-7.4/lisp/org-archive.el
+++ /dev/null
@@ -1,471 +0,0 @@
-;;; org-archive.el --- Archiving for Org-mode
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file contains the face definitions for Org.
-
-;;; Code:
-
-(require 'org)
-
-(declare-function org-inlinetask-remove-END-maybe "org-inlinetask" ())
-
-(defcustom org-archive-default-command 'org-archive-subtree
- "The default archiving command."
- :group 'org-archive
- :type '(choice
- (const org-archive-subtree)
- (const org-archive-to-archive-sibling)
- (const org-archive-set-tag)))
-
-(defcustom org-archive-reversed-order nil
- "Non-nil means make the tree first child under the archive heading, not last."
- :group 'org-archive
- :type 'boolean)
-
-(defcustom org-archive-sibling-heading "Archive"
- "Name of the local archive sibling that is used to archive entries locally.
-Locally means: in the tree, under a sibling.
-See `org-archive-to-archive-sibling' for more information."
- :group 'org-archive
- :type 'string)
-
-(defcustom org-archive-mark-done nil
- "Non-nil means mark entries as DONE when they are moved to the archive file.
-This can be a string to set the keyword to use. When t, Org-mode will
-use the first keyword in its list that means done."
- :group 'org-archive
- :type '(choice
- (const :tag "No" nil)
- (const :tag "Yes" t)
- (string :tag "Use this keyword")))
-
-(defcustom org-archive-stamp-time t
- "Non-nil means add a time stamp to entries moved to an archive file.
-This variable is obsolete and has no effect anymore, instead add or remove
-`time' from the variable `org-archive-save-context-info'."
- :group 'org-archive
- :type 'boolean)
-
-(defcustom org-archive-save-context-info '(time file olpath category todo itags)
- "Parts of context info that should be stored as properties when archiving.
-When a subtree is moved to an archive file, it loses information given by
-context, like inherited tags, the category, and possibly also the TODO
-state (depending on the variable `org-archive-mark-done').
-This variable can be a list of any of the following symbols:
-
-time The time of archiving.
-file The file where the entry originates.
-ltags The local tags, in the headline of the subtree.
-itags The tags the subtree inherits from further up the hierarchy.
-todo The pre-archive TODO state.
-category The category, taken from file name or #+CATEGORY lines.
-olpath The outline path to the item. These are all headlines above
- the current item, separated by /, like a file path.
-
-For each symbol present in the list, a property will be created in
-the archived entry, with a prefix \"PRE_ARCHIVE_\", to remember this
-information."
- :group 'org-archive
- :type '(set :greedy t
- (const :tag "Time" time)
- (const :tag "File" file)
- (const :tag "Category" category)
- (const :tag "TODO state" todo)
- (const :tag "Priority" priority)
- (const :tag "Inherited tags" itags)
- (const :tag "Outline path" olpath)
- (const :tag "Local tags" ltags)))
-
-(defun org-get-local-archive-location ()
- "Get the archive location applicable at point."
- (let ((re "^#\\+ARCHIVE:[ \t]+\\(\\S-.*\\S-\\)[ \t]*$")
- prop)
- (save-excursion
- (save-restriction
- (widen)
- (setq prop (org-entry-get nil "ARCHIVE" 'inherit))
- (cond
- ((and prop (string-match "\\S-" prop))
- prop)
- ((or (re-search-backward re nil t)
- (re-search-forward re nil t))
- (match-string 1))
- (t org-archive-location))))))
-
-(defun org-add-archive-files (files)
- "Splice the archive files into the list of files.
-This implies visiting all these files and finding out what the
-archive file is."
- (org-uniquify
- (apply
- 'append
- (mapcar
- (lambda (f)
- (if (not (file-exists-p f))
- nil
- (with-current-buffer (org-get-agenda-file-buffer f)
- (cons f (org-all-archive-files)))))
- files))))
-
-(defun org-all-archive-files ()
- "Get a list of all archive files used in the current buffer."
- (let (file files)
- (save-excursion
- (save-restriction
- (goto-char (point-min))
- (while (re-search-forward
- "^\\(#\\+\\|[ \t]*:\\)ARCHIVE:[ \t]+\\(.*\\)"
- nil t)
- (setq file (org-extract-archive-file
- (org-match-string-no-properties 2)))
- (and file (> (length file) 0) (file-exists-p file)
- (add-to-list 'files file)))))
- (setq files (nreverse files))
- (setq file (org-extract-archive-file))
- (and file (> (length file) 0) (file-exists-p file)
- (add-to-list 'files file))
- files))
-
-(defun org-extract-archive-file (&optional location)
- "Extract and expand the file name from archive LOCATION.
-if LOCATION is not given, the value of `org-archive-location' is used."
- (setq location (or location org-archive-location))
- (if (string-match "\\(.*\\)::\\(.*\\)" location)
- (if (= (match-beginning 1) (match-end 1))
- (buffer-file-name)
- (expand-file-name
- (format (match-string 1 location)
- (file-name-nondirectory buffer-file-name))))))
-
-(defun org-extract-archive-heading (&optional location)
- "Extract the heading from archive LOCATION.
-if LOCATION is not given, the value of `org-archive-location' is used."
- (setq location (or location org-archive-location))
- (if (string-match "\\(.*\\)::\\(.*\\)" location)
- (format (match-string 2 location)
- (file-name-nondirectory buffer-file-name))))
-
-(defun org-archive-subtree (&optional find-done)
- "Move the current subtree to the archive.
-The archive can be a certain top-level heading in the current file, or in
-a different file. The tree will be moved to that location, the subtree
-heading be marked DONE, and the current time will be added.
-
-When called with prefix argument FIND-DONE, find whole trees without any
-open TODO items and archive them (after getting confirmation from the user).
-If the cursor is not at a headline when this command is called, try all level
-1 trees. If the cursor is on a headline, only try the direct children of
-this heading."
- (interactive "P")
- (if find-done
- (org-archive-all-done)
- ;; Save all relevant TODO keyword-relatex variables
-
- (let ((tr-org-todo-line-regexp org-todo-line-regexp) ; keep despite compiler
- (tr-org-todo-keywords-1 org-todo-keywords-1)
- (tr-org-todo-kwd-alist org-todo-kwd-alist)
- (tr-org-done-keywords org-done-keywords)
- (tr-org-todo-regexp org-todo-regexp)
- (tr-org-todo-line-regexp org-todo-line-regexp)
- (tr-org-odd-levels-only org-odd-levels-only)
- (this-buffer (current-buffer))
- ;; start of variables that will be used for saving context
- ;; The compiler complains about them - keep them anyway!
- (file (abbreviate-file-name (buffer-file-name)))
- (olpath (mapconcat 'identity (org-get-outline-path) "/"))
- (time (format-time-string
- (substring (cdr org-time-stamp-formats) 1 -1)
- (current-time)))
- category todo priority ltags itags
- ;; end of variables that will be used for saving context
- location afile heading buffer level newfile-p visiting)
-
- ;; Find the local archive location
- (setq location (org-get-local-archive-location)
- afile (org-extract-archive-file location)
- heading (org-extract-archive-heading location))
- (unless afile
- (error "Invalid `org-archive-location'"))
-
- (if (> (length afile) 0)
- (setq newfile-p (not (file-exists-p afile))
- visiting (find-buffer-visiting afile)
- buffer (or visiting (find-file-noselect afile)))
- (setq buffer (current-buffer)))
- (unless buffer
- (error "Cannot access file \"%s\"" afile))
- (if (and (> (length heading) 0)
- (string-match "^\\*+" heading))
- (setq level (match-end 0))
- (setq heading nil level 0))
- (save-excursion
- (org-back-to-heading t)
- ;; Get context information that will be lost by moving the tree
- (org-refresh-category-properties)
- (setq category (org-get-category)
- todo (and (looking-at org-todo-line-regexp)
- (match-string 2))
- priority (org-get-priority
- (if (match-end 3) (match-string 3) ""))
- ltags (org-get-tags)
- itags (org-delete-all ltags (org-get-tags-at)))
- (setq ltags (mapconcat 'identity ltags " ")
- itags (mapconcat 'identity itags " "))
- ;; We first only copy, in case something goes wrong
- ;; we need to protect `this-command', to avoid kill-region sets it,
- ;; which would lead to duplication of subtrees
- (let (this-command) (org-copy-subtree 1 nil t))
- (set-buffer buffer)
- ;; Enforce org-mode for the archive buffer
- (if (not (org-mode-p))
- ;; Force the mode for future visits.
- (let ((org-insert-mode-line-in-empty-file t)
- (org-inhibit-startup t))
- (call-interactively 'org-mode)))
- (when newfile-p
- (goto-char (point-max))
- (insert (format "\nArchived entries from file %s\n\n"
- (buffer-file-name this-buffer))))
- ;; Force the TODO keywords of the original buffer
- (let ((org-todo-line-regexp tr-org-todo-line-regexp)
- (org-todo-keywords-1 tr-org-todo-keywords-1)
- (org-todo-kwd-alist tr-org-todo-kwd-alist)
- (org-done-keywords tr-org-done-keywords)
- (org-todo-regexp tr-org-todo-regexp)
- (org-todo-line-regexp tr-org-todo-line-regexp)
- (org-odd-levels-only
- (if (local-variable-p 'org-odd-levels-only (current-buffer))
- org-odd-levels-only
- tr-org-odd-levels-only)))
- (goto-char (point-min))
- (show-all)
- (if heading
- (progn
- (if (re-search-forward
- (concat "^" (regexp-quote heading)
- (org-re "[ \t]*\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*\\($\\|\r\\)"))
- nil t)
- (goto-char (match-end 0))
- ;; Heading not found, just insert it at the end
- (goto-char (point-max))
- (or (bolp) (insert "\n"))
- (insert "\n" heading "\n")
- (end-of-line 0))
- ;; Make the subtree visible
- (show-subtree)
- (if org-archive-reversed-order
- (progn
- (org-back-to-heading t)
- (outline-next-heading))
- (org-end-of-subtree t))
- (skip-chars-backward " \t\r\n")
- (and (looking-at "[ \t\r\n]*")
- (replace-match "\n\n")))
- ;; No specific heading, just go to end of file.
- (goto-char (point-max)) (insert "\n"))
- ;; Paste
- (org-paste-subtree (org-get-valid-level level (and heading 1)))
-
- ;; Mark the entry as done
- (when (and org-archive-mark-done
- (looking-at org-todo-line-regexp)
- (or (not (match-end 2))
- (not (member (match-string 2) org-done-keywords))))
- (let (org-log-done org-todo-log-states)
- (org-todo
- (car (or (member org-archive-mark-done org-done-keywords)
- org-done-keywords)))))
-
- ;; Add the context info
- (when org-archive-save-context-info
- (let ((l org-archive-save-context-info) e n v)
- (while (setq e (pop l))
- (when (and (setq v (symbol-value e))
- (stringp v) (string-match "\\S-" v))
- (setq n (concat "ARCHIVE_" (upcase (symbol-name e))))
- (org-entry-put (point) n v)))))
-
- ;; Save and kill the buffer, if it is not the same buffer.
- (when (not (eq this-buffer buffer))
- (save-buffer))
- ))
- ;; Here we are back in the original buffer. Everything seems to have
- ;; worked. So now cut the tree and finish up.
- (let (this-command) (org-cut-subtree))
- (when (featurep 'org-inlinetask)
- (org-inlinetask-remove-END-maybe))
- (setq org-markers-to-move nil)
- (message "Subtree archived %s"
- (if (eq this-buffer buffer)
- (concat "under heading: " heading)
- (concat "in file: " (abbreviate-file-name afile))))))
- (org-reveal)
- (if (looking-at "^[ \t]*$")
- (outline-next-visible-heading 1)))
-
-(defun org-archive-to-archive-sibling ()
- "Archive the current heading by moving it under the archive sibling.
-The archive sibling is a sibling of the heading with the heading name
-`org-archive-sibling-heading' and an `org-archive-tag' tag. If this
-sibling does not exist, it will be created at the end of the subtree."
- (interactive)
- (save-restriction
- (widen)
- (let (b e pos leader level)
- (org-back-to-heading t)
- (looking-at outline-regexp)
- (setq leader (match-string 0)
- level (funcall outline-level))
- (setq pos (point))
- (condition-case nil
- (outline-up-heading 1 t)
- (error (setq e (point-max)) (goto-char (point-min))))
- (setq b (point))
- (unless e
- (condition-case nil
- (org-end-of-subtree t t)
- (error (goto-char (point-max))))
- (setq e (point)))
- (goto-char b)
- (unless (re-search-forward
- (concat "^" (regexp-quote leader)
- "[ \t]*"
- org-archive-sibling-heading
- "[ \t]*:"
- org-archive-tag ":") e t)
- (goto-char e)
- (or (bolp) (newline))
- (insert leader org-archive-sibling-heading "\n")
- (beginning-of-line 0)
- (org-toggle-tag org-archive-tag 'on))
- (beginning-of-line 1)
- (if org-archive-reversed-order
- (outline-next-heading)
- (org-end-of-subtree t t))
- (save-excursion
- (goto-char pos)
- (let ((this-command this-command)) (org-cut-subtree)))
- (org-paste-subtree (org-get-valid-level level 1))
- (org-set-property
- "ARCHIVE_TIME"
- (format-time-string
- (substring (cdr org-time-stamp-formats) 1 -1)
- (current-time)))
- (outline-up-heading 1 t)
- (hide-subtree)
- (org-cycle-show-empty-lines 'folded)
- (goto-char pos)))
- (org-reveal)
- (if (looking-at "^[ \t]*$")
- (outline-next-visible-heading 1)))
-
-(defun org-archive-all-done (&optional tag)
- "Archive sublevels of the current tree without open TODO items.
-If the cursor is not on a headline, try all level 1 trees. If
-it is on a headline, try all direct children.
-When TAG is non-nil, don't move trees, but mark them with the ARCHIVE tag."
- (let ((re (concat "^\\*+ +" org-not-done-regexp)) re1
- (rea (concat ".*:" org-archive-tag ":"))
- (begm (make-marker))
- (endm (make-marker))
- (question (if tag "Set ARCHIVE tag (no open TODO items)? "
- "Move subtree to archive (no open TODO items)? "))
- beg end (cntarch 0))
- (if (org-on-heading-p)
- (progn
- (setq re1 (concat "^" (regexp-quote
- (make-string
- (+ (- (match-end 0) (match-beginning 0) 1)
- (if org-odd-levels-only 2 1))
- ?*))
- " "))
- (move-marker begm (point))
- (move-marker endm (org-end-of-subtree t)))
- (setq re1 "^* ")
- (move-marker begm (point-min))
- (move-marker endm (point-max)))
- (save-excursion
- (goto-char begm)
- (while (re-search-forward re1 endm t)
- (setq beg (match-beginning 0)
- end (save-excursion (org-end-of-subtree t) (point)))
- (goto-char beg)
- (if (re-search-forward re end t)
- (goto-char end)
- (goto-char beg)
- (if (and (or (not tag) (not (looking-at rea)))
- (y-or-n-p question))
- (progn
- (if tag
- (org-toggle-tag org-archive-tag 'on)
- (org-archive-subtree))
- (setq cntarch (1+ cntarch)))
- (goto-char end)))))
- (message "%d trees archived" cntarch)))
-
-(defun org-toggle-archive-tag (&optional find-done)
- "Toggle the archive tag for the current headline.
-With prefix ARG, check all children of current headline and offer tagging
-the children that do not contain any open TODO items."
- (interactive "P")
- (if find-done
- (org-archive-all-done 'tag)
- (let (set)
- (save-excursion
- (org-back-to-heading t)
- (setq set (org-toggle-tag org-archive-tag))
- (when set (hide-subtree)))
- (and set (beginning-of-line 1))
- (message "Subtree %s" (if set "archived" "unarchived")))))
-
-(defun org-archive-set-tag ()
- "Set the ARCHIVE tag."
- (interactive)
- (org-toggle-tag org-archive-tag 'on))
-
-;;;###autoload
-(defun org-archive-subtree-default ()
- "Archive the current subtree with the default command.
-This command is set with the variable `org-archive-default-command'."
- (interactive)
- (call-interactively org-archive-default-command))
-
-;;;###autoload
-(defun org-archive-subtree-default-with-confirmation ()
- "Archive the current subtree with the default command.
-This command is set with the variable `org-archive-default-command'."
- (interactive)
- (if (y-or-n-p "Archive this subtree or entry? ")
- (call-interactively org-archive-default-command)
- (error "Abort")))
-
-(provide 'org-archive)
-
-;; arch-tag: 0837f601-9699-43c3-8b90-631572ae6c85
-
-;;; org-archive.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-archive.elc b/.emacs.d/org-7.4/lisp/org-archive.elc
deleted file mode 100644
index 9b0ccff..0000000
--- a/.emacs.d/org-7.4/lisp/org-archive.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-ascii.el b/.emacs.d/org-7.4/lisp/org-ascii.el
deleted file mode 100644
index 99facb1..0000000
--- a/.emacs.d/org-7.4/lisp/org-ascii.el
+++ /dev/null
@@ -1,723 +0,0 @@
-;;; org-ascii.el --- ASCII export for Org-mode
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;;; Code:
-
-(require 'org-exp)
-
-(eval-when-compile
- (require 'cl))
-
-(defgroup org-export-ascii nil
- "Options specific for ASCII export of Org-mode files."
- :tag "Org Export ASCII"
- :group 'org-export)
-
-(defcustom org-export-ascii-underline '(?\$ ?\# ?^ ?\~ ?\= ?\-)
- "Characters for underlining headings in ASCII export.
-In the given sequence, these characters will be used for level 1, 2, ..."
- :group 'org-export-ascii
- :type '(repeat character))
-
-(defcustom org-export-ascii-bullets '(?* ?+ ?-)
- "Bullet characters for headlines converted to lists in ASCII export.
-The first character is used for the first lest level generated in this
-way, and so on. If there are more levels than characters given here,
-the list will be repeated.
-Note that plain lists will keep the same bullets as the have in the
-Org-mode file."
- :group 'org-export-ascii
- :type '(repeat character))
-
-(defcustom org-export-ascii-links-to-notes t
- "Non-nil means convert links to notes before the next headline.
-When nil, the link will be exported in place. If the line becomes long
-in this way, it will be wrapped."
- :group 'org-export-ascii
- :type 'boolean)
-
-(defcustom org-export-ascii-table-keep-all-vertical-lines nil
- "Non-nil means keep all vertical lines in ASCII tables.
-When nil, vertical lines will be removed except for those needed
-for column grouping."
- :group 'org-export-ascii
- :type 'boolean)
-
-(defcustom org-export-ascii-table-widen-columns t
- "Non-nil means widen narrowed columns for export.
-When nil, narrowed columns will look in ASCII export just like in org-mode,
-i.e. with \"=>\" as ellipsis."
- :group 'org-export-ascii
- :type 'boolean)
-
-(defvar org-export-ascii-entities 'ascii
- "The ascii representation to be used during ascii export.
-Possible values are:
-
-ascii Only use plain ASCII characters
-latin1 Include Latin-1 character
-utf8 Use all UTF-8 characters")
-
-;;; Hooks
-
-(defvar org-export-ascii-final-hook nil
- "Hook run at the end of ASCII export, in the new buffer.")
-
-;;; ASCII export
-
-(defvar org-ascii-current-indentation nil) ; For communication
-
-;;;###autoload
-(defun org-export-as-latin1 (&rest args)
- "Like `org-export-as-ascii', use latin1 encoding for special symbols."
- (interactive)
- (org-export-as-encoding 'org-export-as-ascii (interactive-p)
- 'latin1 args))
-
-;;;###autoload
-(defun org-export-as-latin1-to-buffer (&rest args)
- "Like `org-export-as-ascii-to-buffer', use latin1 encoding for symbols."
- (interactive)
- (org-export-as-encoding 'org-export-as-ascii-to-buffer (interactive-p)
- 'latin1 args))
-
-;;;###autoload
-(defun org-export-as-utf8 (&rest args)
- "Like `org-export-as-ascii', use use encoding for special symbols."
- (interactive)
- (org-export-as-encoding 'org-export-as-ascii (interactive-p)
- 'utf8 args))
-
-;;;###autoload
-(defun org-export-as-utf8-to-buffer (&rest args)
- "Like `org-export-as-ascii-to-buffer', use utf8 encoding for symbols."
- (interactive)
- (org-export-as-encoding 'org-export-as-ascii-to-buffer (interactive-p)
- 'utf8 args))
-
-(defun org-export-as-encoding (command interactivep encoding &rest args)
- (let ((org-export-ascii-entities encoding))
- (if interactivep
- (call-interactively command)
- (apply command args))))
-
-
-;;;###autoload
-(defun org-export-as-ascii-to-buffer (arg)
- "Call `org-export-as-ascii` with output to a temporary buffer.
-No file is created. The prefix ARG is passed through to `org-export-as-ascii'."
- (interactive "P")
- (org-export-as-ascii arg nil nil "*Org ASCII Export*")
- (when org-export-show-temporary-export-buffer
- (switch-to-buffer-other-window "*Org ASCII Export*")))
-
-;;;###autoload
-(defun org-replace-region-by-ascii (beg end)
- "Assume the current region has org-mode syntax, and convert it to plain ASCII.
-This can be used in any buffer. For example, you could write an
-itemized list in org-mode syntax in a Mail buffer and then use this
-command to convert it."
- (interactive "r")
- (let (reg ascii buf pop-up-frames)
- (save-window-excursion
- (if (org-mode-p)
- (setq ascii (org-export-region-as-ascii
- beg end t 'string))
- (setq reg (buffer-substring beg end)
- buf (get-buffer-create "*Org tmp*"))
- (with-current-buffer buf
- (erase-buffer)
- (insert reg)
- (org-mode)
- (setq ascii (org-export-region-as-ascii
- (point-min) (point-max) t 'string)))
- (kill-buffer buf)))
- (delete-region beg end)
- (insert ascii)))
-
-;;;###autoload
-(defun org-export-region-as-ascii (beg end &optional body-only buffer)
- "Convert region from BEG to END in org-mode buffer to plain ASCII.
-If prefix arg BODY-ONLY is set, omit file header, footer, and table of
-contents, and only produce the region of converted text, useful for
-cut-and-paste operations.
-If BUFFER is a buffer or a string, use/create that buffer as a target
-of the converted ASCII. If BUFFER is the symbol `string', return the
-produced ASCII as a string and leave not buffer behind. For example,
-a Lisp program could call this function in the following way:
-
- (setq ascii (org-export-region-as-ascii beg end t 'string))
-
-When called interactively, the output buffer is selected, and shown
-in a window. A non-interactive call will only return the buffer."
- (interactive "r\nP")
- (when (interactive-p)
- (setq buffer "*Org ASCII Export*"))
- (let ((transient-mark-mode t) (zmacs-regions t)
- ext-plist rtn)
- (setq ext-plist (plist-put ext-plist :ignore-subtree-p t))
- (goto-char end)
- (set-mark (point)) ;; to activate the region
- (goto-char beg)
- (setq rtn (org-export-as-ascii
- nil nil ext-plist
- buffer body-only))
- (if (fboundp 'deactivate-mark) (deactivate-mark))
- (if (and (interactive-p) (bufferp rtn))
- (switch-to-buffer-other-window rtn)
- rtn)))
-
-;;;###autoload
-(defun org-export-as-ascii (arg &optional hidden ext-plist
- to-buffer body-only pub-dir)
- "Export the outline as a pretty ASCII file.
-If there is an active region, export only the region.
-The prefix ARG specifies how many levels of the outline should become
-underlined headlines, default is 3. Lower levels will become bulleted
-lists. When HIDDEN is non-nil, don't display the ASCII buffer.
-EXT-PLIST is a property list with external parameters overriding
-org-mode's default settings, but still inferior to file-local
-settings. When TO-BUFFER is non-nil, create a buffer with that
-name and export to that buffer. If TO-BUFFER is the symbol
-`string', don't leave any buffer behind but just return the
-resulting ASCII as a string. When BODY-ONLY is set, don't produce
-the file header and footer. When PUB-DIR is set, use this as the
-publishing directory."
- (interactive "P")
- (run-hooks 'org-export-first-hook)
- (setq-default org-todo-line-regexp org-todo-line-regexp)
- (let* ((opt-plist (org-combine-plists (org-default-export-plist)
- ext-plist
- (org-infile-export-plist)))
- (region-p (org-region-active-p))
- (rbeg (and region-p (region-beginning)))
- (rend (and region-p (region-end)))
- (subtree-p
- (if (plist-get opt-plist :ignore-subtree-p)
- nil
- (when region-p
- (save-excursion
- (goto-char rbeg)
- (and (org-at-heading-p)
- (>= (org-end-of-subtree t t) rend))))))
- (level-offset (if subtree-p
- (save-excursion
- (goto-char rbeg)
- (+ (funcall outline-level)
- (if org-odd-levels-only 1 0)))
- 0))
- (opt-plist (setq org-export-opt-plist
- (if subtree-p
- (org-export-add-subtree-options opt-plist rbeg)
- opt-plist)))
- ;; The following two are dynamically scoped into other
- ;; routines below.
- (org-current-export-dir
- (or pub-dir (org-export-directory :html opt-plist)))
- (org-current-export-file buffer-file-name)
- (custom-times org-display-custom-times)
- (org-ascii-current-indentation '(0 . 0))
- (level 0) line txt
- (umax nil)
- (umax-toc nil)
- (case-fold-search nil)
- (bfname (buffer-file-name (or (buffer-base-buffer) (current-buffer))))
- (filename (if to-buffer
- nil
- (concat (file-name-as-directory
- (or pub-dir
- (org-export-directory :ascii opt-plist)))
- (file-name-sans-extension
- (or (and subtree-p
- (org-entry-get (region-beginning)
- "EXPORT_FILE_NAME" t))
- (file-name-nondirectory bfname)))
- ".txt")))
- (filename (and filename
- (if (equal (file-truename filename)
- (file-truename bfname))
- (concat filename ".txt")
- filename)))
- (buffer (if to-buffer
- (cond
- ((eq to-buffer 'string)
- (get-buffer-create "*Org ASCII Export*"))
- (t (get-buffer-create to-buffer)))
- (find-file-noselect filename)))
- (org-levels-open (make-vector org-level-max nil))
- (odd org-odd-levels-only)
- (date (plist-get opt-plist :date))
- (author (plist-get opt-plist :author))
- (title (or (and subtree-p (org-export-get-title-from-subtree))
- (plist-get opt-plist :title)
- (and (not
- (plist-get opt-plist :skip-before-1st-heading))
- (org-export-grab-title-from-buffer))
- (and (buffer-file-name)
- (file-name-sans-extension
- (file-name-nondirectory bfname)))
- "UNTITLED"))
- (email (plist-get opt-plist :email))
- (language (plist-get opt-plist :language))
- (quote-re0 (concat "^[ \t]*" org-quote-string "\\>"))
- (todo nil)
- (lang-words nil)
- (region
- (buffer-substring
- (if (org-region-active-p) (region-beginning) (point-min))
- (if (org-region-active-p) (region-end) (point-max))))
- (lines (org-split-string
- (org-export-preprocess-string
- region
- :for-ascii t
- :skip-before-1st-heading
- (plist-get opt-plist :skip-before-1st-heading)
- :drawers (plist-get opt-plist :drawers)
- :tags (plist-get opt-plist :tags)
- :priority (plist-get opt-plist :priority)
- :footnotes (plist-get opt-plist :footnotes)
- :timestamps (plist-get opt-plist :timestamps)
- :todo-keywords (plist-get opt-plist :todo-keywords)
- :verbatim-multiline t
- :select-tags (plist-get opt-plist :select-tags)
- :exclude-tags (plist-get opt-plist :exclude-tags)
- :archived-trees
- (plist-get opt-plist :archived-trees)
- :add-text (plist-get opt-plist :text))
- "\n"))
- thetoc have-headings first-heading-pos
- table-open table-buffer link-buffer link type path desc desc0 rpl wrap fnc)
- (let ((inhibit-read-only t))
- (org-unmodified
- (remove-text-properties (point-min) (point-max)
- '(:org-license-to-kill t))))
-
- (setq org-min-level (org-get-min-level lines level-offset))
- (setq org-last-level org-min-level)
- (org-init-section-numbers)
- (setq lang-words (or (assoc language org-export-language-setup)
- (assoc "en" org-export-language-setup)))
- (set-buffer buffer)
- (erase-buffer)
- (fundamental-mode)
- (org-install-letbind)
- ;; create local variables for all options, to make sure all called
- ;; functions get the correct information
- (mapc (lambda (x)
- (set (make-local-variable (nth 2 x))
- (plist-get opt-plist (car x))))
- org-export-plist-vars)
- (org-set-local 'org-odd-levels-only odd)
- (setq umax (if arg (prefix-numeric-value arg)
- org-export-headline-levels))
- (setq umax-toc (if (integerp org-export-with-toc)
- (min org-export-with-toc umax)
- umax))
-
- ;; File header
- (unless body-only
- (when (and title (not (string= "" title)))
- (org-insert-centered title ?=)
- (insert "\n"))
-
- (if (and (or author email)
- org-export-author-info)
- (insert (concat (nth 1 lang-words) ": " (or author "")
- (if (and org-export-email-info
- email (string-match "\\S-" email))
- (concat " <" email ">") "")
- "\n")))
-
- (cond
- ((and date (string-match "%" date))
- (setq date (format-time-string date)))
- (date)
- (t (setq date (format-time-string "%Y-%m-%d %T %Z"))))
-
- (if (and date org-export-time-stamp-file)
- (insert (concat (nth 2 lang-words) ": " date"\n")))
-
- (unless (= (point) (point-min))
- (insert "\n\n")))
-
- (if (and org-export-with-toc (not body-only))
- (progn
- (push (concat (nth 3 lang-words) "\n") thetoc)
- (push (concat (make-string (string-width (nth 3 lang-words)) ?=)
- "\n") thetoc)
- (mapc '(lambda (line)
- (if (string-match org-todo-line-regexp
- line)
- ;; This is a headline
- (progn
- (setq have-headings t)
- (setq level (- (match-end 1) (match-beginning 1)
- level-offset)
- level (org-tr-level level)
- txt (match-string 3 line)
- todo
- (or (and org-export-mark-todo-in-toc
- (match-beginning 2)
- (not (member (match-string 2 line)
- org-done-keywords)))
- ; TODO, not DONE
- (and org-export-mark-todo-in-toc
- (= level umax-toc)
- (org-search-todo-below
- line lines level))))
- (setq txt (org-html-expand-for-ascii txt))
-
- (while (string-match org-bracket-link-regexp txt)
- (setq txt
- (replace-match
- (match-string (if (match-end 2) 3 1) txt)
- t t txt)))
-
- (if (and (memq org-export-with-tags '(not-in-toc nil))
- (string-match
- (org-re "[ \t]+:[[:alnum:]_@#%:]+:[ \t]*$")
- txt))
- (setq txt (replace-match "" t t txt)))
- (if (string-match quote-re0 txt)
- (setq txt (replace-match "" t t txt)))
-
- (if org-export-with-section-numbers
- (setq txt (concat (org-section-number level)
- " " txt)))
- (if (<= level umax-toc)
- (progn
- (push
- (concat
- (make-string
- (* (max 0 (- level org-min-level)) 4) ?\ )
- (format (if todo "%s (*)\n" "%s\n") txt))
- thetoc)
- (setq org-last-level level))
- ))))
- lines)
- (setq thetoc (if have-headings (nreverse thetoc) nil))))
-
- (org-init-section-numbers)
- (while (setq line (pop lines))
- (when (and link-buffer (string-match "^\\*+ " line))
- (org-export-ascii-push-links (nreverse link-buffer))
- (setq link-buffer nil))
- (setq wrap nil)
- ;; Remove the quoted HTML tags.
- (setq line (org-html-expand-for-ascii line))
- ;; Replace links with the description when possible
- (while (string-match org-bracket-link-analytic-regexp++ line)
- (setq path (match-string 3 line)
- link (concat (match-string 1 line) path)
- type (match-string 2 line)
- desc0 (match-string 5 line)
- desc (or desc0 link))
- (if (and (> (length link) 8)
- (equal (substring link 0 8) "coderef:"))
- (setq line (replace-match
- (format (org-export-get-coderef-format (substring link 8) desc)
- (cdr (assoc
- (substring link 8)
- org-export-code-refs)))
- t t line))
- (setq rpl (concat "[" desc "]"))
- (if (functionp (setq fnc (nth 2 (assoc type org-link-protocols))))
- (setq rpl (or (save-match-data
- (funcall fnc (org-link-unescape path)
- desc0 'ascii))
- rpl))
- (when (and desc0 (not (equal desc0 link)))
- (if org-export-ascii-links-to-notes
- (push (cons desc0 link) link-buffer)
- (setq rpl (concat rpl " (" link ")")
- wrap (+ (length line) (- (length (match-string 0 line)))
- (length desc))))))
- (setq line (replace-match rpl t t line))))
- (when custom-times
- (setq line (org-translate-time line)))
- (cond
- ((string-match "^\\(\\*+\\)[ \t]+\\(.*\\)" line)
- ;; a Headline
- (setq first-heading-pos (or first-heading-pos (point)))
- (setq level (org-tr-level (- (match-end 1) (match-beginning 1)
- level-offset))
- txt (match-string 2 line))
- (org-ascii-level-start level txt umax lines))
-
- ((and org-export-with-tables
- (string-match "^\\([ \t]*\\)\\(|\\|\\+-+\\+\\)" line))
- (if (not table-open)
- ;; New table starts
- (setq table-open t table-buffer nil))
- ;; Accumulate lines
- (setq table-buffer (cons line table-buffer))
- (when (or (not lines)
- (not (string-match "^\\([ \t]*\\)\\(|\\|\\+-+\\+\\)"
- (car lines))))
- (setq table-open nil
- table-buffer (nreverse table-buffer))
- (insert (mapconcat
- (lambda (x)
- (org-fix-indentation x org-ascii-current-indentation))
- (org-format-table-ascii table-buffer)
- "\n") "\n")))
- (t
- (if (string-match "^\\([ \t]*\\)\\([-+*][ \t]+\\)\\(.*?\\)\\( ::\\)"
- line)
- (setq line (replace-match "\\1\\3:" t nil line)))
- (setq line (org-fix-indentation line org-ascii-current-indentation))
- ;; Remove forced line breaks
- (if (string-match "\\\\\\\\[ \t]*$" line)
- (setq line (replace-match "" t t line)))
- (if (and org-export-with-fixed-width
- (string-match "^\\([ \t]*\\)\\(:\\( \\|$\\)\\)" line))
- (setq line (replace-match "\\1" nil nil line))
- (if wrap (setq line (org-export-ascii-wrap line wrap))))
- (insert line "\n"))))
-
- (org-export-ascii-push-links (nreverse link-buffer))
-
- (normal-mode)
-
- ;; insert the table of contents
- (when thetoc
- (goto-char (point-min))
- (if (re-search-forward "^[ \t]*\\[TABLE-OF-CONTENTS\\][ \t]*$" nil t)
- (progn
- (goto-char (match-beginning 0))
- (replace-match ""))
- (goto-char first-heading-pos))
- (mapc 'insert thetoc)
- (or (looking-at "[ \t]*\n[ \t]*\n")
- (insert "\n\n")))
-
- ;; Convert whitespace place holders
- (goto-char (point-min))
- (let (beg end)
- (while (setq beg (next-single-property-change (point) 'org-whitespace))
- (setq end (next-single-property-change beg 'org-whitespace))
- (goto-char beg)
- (delete-region beg end)
- (insert (make-string (- end beg) ?\ ))))
-
- ;; remove display and invisible chars
- (let (beg end)
- (goto-char (point-min))
- (while (setq beg (next-single-property-change (point) 'display))
- (setq end (next-single-property-change beg 'display))
- (delete-region beg end)
- (goto-char beg)
- (insert "=>"))
- (goto-char (point-min))
- (while (setq beg (next-single-property-change (point) 'org-cwidth))
- (setq end (next-single-property-change beg 'org-cwidth))
- (delete-region beg end)
- (goto-char beg)))
- (run-hooks 'org-export-ascii-final-hook)
- (or to-buffer (save-buffer))
- (goto-char (point-min))
- (or (org-export-push-to-kill-ring "ASCII")
- (message "Exporting... done"))
- ;; Return the buffer or a string, according to how this function was called
- (if (eq to-buffer 'string)
- (prog1 (buffer-substring (point-min) (point-max))
- (kill-buffer (current-buffer)))
- (current-buffer))))
-
-(defun org-export-ascii-preprocess (parameters)
- "Do extra work for ASCII export."
- ;;
- ;; Realign tables to get rid of narrowing
- (when org-export-ascii-table-widen-columns
- (let ((org-table-do-narrow nil))
- (goto-char (point-min))
- (org-ascii-replace-entities)
- (goto-char (point-min))
- (org-table-map-tables
- (lambda () (org-if-unprotected (org-table-align)))
- 'quietly)))
- ;; Put quotes around verbatim text
- (goto-char (point-min))
- (while (re-search-forward org-verbatim-re nil t)
- (org-if-unprotected-at (match-beginning 4)
- (goto-char (match-end 2))
- (backward-delete-char 1) (insert "'")
- (goto-char (match-beginning 2))
- (delete-char 1) (insert "`")
- (goto-char (match-end 2))))
- ;; Remove target markers
- (goto-char (point-min))
- (while (re-search-forward "<<<?\\([^<>]*\\)>>>?\\([ \t]*\\)" nil t)
- (org-if-unprotected-at (match-beginning 1)
- (replace-match "\\1\\2")))
- ;; Remove list start counters
- (goto-char (point-min))
- (while (org-search-forward-unenclosed
- "\\[@\\(?:start:\\)?[0-9]+\\][ \t]*" nil t)
- (replace-match ""))
- (remove-text-properties
- (point-min) (point-max)
- '(face nil font-lock-fontified nil font-lock-multiline nil line-prefix nil wrap-prefix nil)))
-
-(defun org-html-expand-for-ascii (line)
- "Handle quoted HTML for ASCII export."
- (if org-export-html-expand
- (while (string-match "@<[^<>\n]*>" line)
- ;; We just remove the tags for now.
- (setq line (replace-match "" nil nil line))))
- line)
-
-(defun org-ascii-replace-entities ()
- "Replace entities with the ASCII representation."
- (let (e)
- (while (re-search-forward "\\\\\\([a-zA-Z]+[0-9]*\\)\\({}\\)?" nil t)
- (org-if-unprotected-at (match-beginning 1)
- (setq e (org-entity-get-representation (match-string 1)
- org-export-ascii-entities))
- (and e (replace-match e t t))))))
-
-(defun org-export-ascii-wrap (line where)
- "Wrap LINE at or before WHERE."
- (let ((ind (org-get-indentation line))
- pos)
- (catch 'found
- (loop for i from where downto (/ where 2) do
- (and (equal (aref line i) ?\ )
- (setq pos i)
- (throw 'found t))))
- (if pos
- (concat (substring line 0 pos) "\n"
- (make-string ind ?\ )
- (substring line (1+ pos)))
- line)))
-
-(defun org-export-ascii-push-links (link-buffer)
- "Push out links in the buffer."
- (when link-buffer
- ;; We still have links to push out.
- (insert "\n")
- (let ((ind ""))
- (save-match-data
- (if (save-excursion
- (re-search-backward
- "^\\(\\([ \t]*\\)\\|\\(\\*+ \\)\\)[^ \t\n]" nil t))
- (setq ind (or (match-string 2)
- (make-string (length (match-string 3)) ?\ )))))
- (mapc (lambda (x) (insert ind "[" (car x) "]: " (cdr x) "\n"))
- link-buffer))
- (insert "\n")))
-
-(defun org-ascii-level-start (level title umax &optional lines)
- "Insert a new level in ASCII export."
- (let (char (n (- level umax 1)) (ind 0))
- (if (> level umax)
- (progn
- (insert (make-string (* 2 n) ?\ )
- (char-to-string (nth (% n (length org-export-ascii-bullets))
- org-export-ascii-bullets))
- " " title "\n")
- ;; find the indentation of the next non-empty line
- (catch 'stop
- (while lines
- (if (string-match "^\\* " (car lines)) (throw 'stop nil))
- (if (string-match "^\\([ \t]*\\)\\S-" (car lines))
- (throw 'stop (setq ind (org-get-indentation (car lines)))))
- (pop lines)))
- (setq org-ascii-current-indentation (cons (* 2 (1+ n)) ind)))
- (if (or (not (equal (char-before) ?\n))
- (not (equal (char-before (1- (point))) ?\n)))
- (insert "\n"))
- (setq char (nth (- umax level) (reverse org-export-ascii-underline)))
- (unless org-export-with-tags
- (if (string-match (org-re "[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$") title)
- (setq title (replace-match "" t t title))))
- (if org-export-with-section-numbers
- (setq title (concat (org-section-number level) " " title)))
- (insert title "\n" (make-string (string-width title) char) "\n")
- (setq org-ascii-current-indentation '(0 . 0)))))
-
-(defun org-insert-centered (s &optional underline)
- "Insert the string S centered and underline it with character UNDERLINE."
- (let ((ind (max (/ (- fill-column (string-width s)) 2) 0)))
- (insert (make-string ind ?\ ) s "\n")
- (if underline
- (insert (make-string ind ?\ )
- (make-string (string-width s) underline)
- "\n"))))
-
-(defvar org-table-colgroup-info nil)
-(defun org-format-table-ascii (lines)
- "Format a table for ascii export."
- (if (stringp lines)
- (setq lines (org-split-string lines "\n")))
- (if (not (string-match "^[ \t]*|" (car lines)))
- ;; Table made by table.el - test for spanning
- lines
-
- ;; A normal org table
- ;; Get rid of hlines at beginning and end
- (if (string-match "^[ \t]*|-" (car lines)) (setq lines (cdr lines)))
- (setq lines (nreverse lines))
- (if (string-match "^[ \t]*|-" (car lines)) (setq lines (cdr lines)))
- (setq lines (nreverse lines))
- (when org-export-table-remove-special-lines
- ;; Check if the table has a marking column. If yes remove the
- ;; column and the special lines
- (setq lines (org-table-clean-before-export lines)))
- ;; Get rid of the vertical lines except for grouping
- (if org-export-ascii-table-keep-all-vertical-lines
- lines
- (let ((vl (org-colgroup-info-to-vline-list org-table-colgroup-info))
- rtn line vl1 start)
- (while (setq line (pop lines))
- (if (string-match org-table-hline-regexp line)
- (and (string-match "|\\(.*\\)|" line)
- (setq line (replace-match " \\1" t nil line)))
- (setq start 0 vl1 vl)
- (while (string-match "|" line start)
- (setq start (match-end 0))
- (or (pop vl1) (setq line (replace-match " " t t line)))))
- (push line rtn))
- (nreverse rtn)))))
-
-(defun org-colgroup-info-to-vline-list (info)
- (let (vl new last)
- (while info
- (setq last new new (pop info))
- (if (or (memq last '(:end :startend))
- (memq new '(:start :startend)))
- (push t vl)
- (push nil vl)))
- (setq vl (nreverse vl))
- (and vl (setcar vl nil))
- vl))
-
-(provide 'org-ascii)
-
-;; arch-tag: aa96f882-f477-4e13-86f5-70d43e7adf3c
-;;; org-ascii.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-ascii.elc b/.emacs.d/org-7.4/lisp/org-ascii.elc
deleted file mode 100644
index 3aa6a15..0000000
--- a/.emacs.d/org-7.4/lisp/org-ascii.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-attach.el b/.emacs.d/org-7.4/lisp/org-attach.el
deleted file mode 100644
index a894064..0000000
--- a/.emacs.d/org-7.4/lisp/org-attach.el
+++ /dev/null
@@ -1,422 +0,0 @@
-;;; org-attach.el --- Manage file attachments to org-mode tasks
-
-;; Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: John Wiegley <johnw@newartisans.com>
-;; Keywords: org data task
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; See the Org-mode manual for information on how to use it.
-;;
-;; Attachments are managed in a special directory called "data", which
-;; lives in the same directory as the org file itself. If this data
-;; directory is initialized as a Git repository, then org-attach will
-;; automatically commit changes when it sees them.
-;;
-;; Attachment directories are identified using a UUID generated for the
-;; task which has the attachments. These are added as property to the
-;; task when necessary, and should not be deleted or changed by the
-;; user, ever. UUIDs are generated by a mechanism defined in the variable
-;; `org-id-method'.
-
-;;; Code:
-
-(eval-when-compile
- (require 'cl))
-(require 'org-id)
-(require 'org)
-
-(defgroup org-attach nil
- "Options concerning entry attachments in Org-mode."
- :tag "Org Attach"
- :group 'org)
-
-(defcustom org-attach-directory "data/"
- "The directory where attachments are stored.
-If this is a relative path, it will be interpreted relative to the directory
-where the Org file lives."
- :group 'org-attach
- :type 'directory)
-
-(defcustom org-attach-auto-tag "ATTACH"
- "Tag that will be triggered automatically when an entry has an attachment."
- :group 'org-attach
- :type '(choice
- (const :tag "None" nil)
- (string :tag "Tag")))
-
-(defcustom org-attach-file-list-property "Attachments"
- "The property used to keep a list of attachment belonging to this entry.
-This is not really needed, so you may set this to nil if you don't want it.
-Also, for entries where children inherit the directory, the list of
-attachments is not kept in this property."
- :group 'org-attach
- :type '(choice
- (const :tag "None" nil)
- (string :tag "Tag")))
-
-(defcustom org-attach-method 'cp
- "The preferred method to attach a file.
-Allowed values are:
-
-mv rename the file to move it into the attachment directory
-cp copy the file
-ln create a hard link. Note that this is not supported
- on all systems, and then the result is not defined."
- :group 'org-attach
- :type '(choice
- (const :tag "Copy" cp)
- (const :tag "Move/Rename" mv)
- (const :tag "Link" ln)))
-
-(defcustom org-attach-expert nil
- "Non-nil means do not show the splash buffer with the attach dispatcher."
- :group 'org-attach
- :type 'boolean)
-
-(defcustom org-attach-allow-inheritance t
- "Non-nil means allow attachment directories be inherited."
- :group 'org-attach
- :type 'boolean)
-
-
-(defvar org-attach-inherited nil
- "Indicates if the last access to the attachment directory was inherited.")
-
-;;;###autoload
-(defun org-attach ()
- "The dispatcher for attachment commands.
-Shows a list of commands and prompts for another key to execute a command."
- (interactive)
- (let (c marker)
- (when (eq major-mode 'org-agenda-mode)
- (setq marker (or (get-text-property (point) 'org-hd-marker)
- (get-text-property (point) 'org-marker)))
- (unless marker
- (error "No task in current line")))
- (save-excursion
- (when marker
- (set-buffer (marker-buffer marker))
- (goto-char marker))
- (org-back-to-heading t)
- (save-excursion
- (save-window-excursion
- (unless org-attach-expert
- (with-output-to-temp-buffer "*Org Attach*"
- (princ "Select an Attachment Command:
-
-a Select a file and attach it to the task, using `org-attach-method'.
-c/m/l Attach a file using copy/move/link method.
-n Create a new attachment, as an Emacs buffer.
-z Synchronize the current task with its attachment
- directory, in case you added attachments yourself.
-
-o Open current task's attachments.
-O Like \"o\", but force opening in Emacs.
-f Open current task's attachment directory.
-F Like \"f\", but force using dired in Emacs.
-
-d Delete one attachment, you will be prompted for a file name.
-D Delete all of a task's attachments. A safer way is
- to open the directory in dired and delete from there.
-
-s Set a specific attachment directory for this entry.
-i Make children of the current entry inherit its attachment directory.")))
- (org-fit-window-to-buffer (get-buffer-window "*Org Attach*"))
- (message "Select command: [acmlzoOfFdD]")
- (setq c (read-char-exclusive))
- (and (get-buffer "*Org Attach*") (kill-buffer "*Org Attach*"))))
- (cond
- ((memq c '(?a ?\C-a)) (call-interactively 'org-attach-attach))
- ((memq c '(?c ?\C-c))
- (let ((org-attach-method 'cp)) (call-interactively 'org-attach-attach)))
- ((memq c '(?m ?\C-m))
- (let ((org-attach-method 'mv)) (call-interactively 'org-attach-attach)))
- ((memq c '(?l ?\C-l))
- (let ((org-attach-method 'ln)) (call-interactively 'org-attach-attach)))
- ((memq c '(?n ?\C-n)) (call-interactively 'org-attach-new))
- ((memq c '(?z ?\C-z)) (call-interactively 'org-attach-sync))
- ((memq c '(?o ?\C-o)) (call-interactively 'org-attach-open))
- ((eq c ?O) (call-interactively 'org-attach-open-in-emacs))
- ((memq c '(?f ?\C-f)) (call-interactively 'org-attach-reveal))
- ((memq c '(?F)) (call-interactively 'org-attach-reveal-in-emacs))
- ((memq c '(?d ?\C-d)) (call-interactively
- 'org-attach-delete-one))
- ((eq c ?D) (call-interactively 'org-attach-delete-all))
- ((eq c ?q) (message "Abort"))
- ((memq c '(?s ?\C-s)) (call-interactively
- 'org-attach-set-directory))
- ((memq c '(?i ?\C-i)) (call-interactively
- 'org-attach-set-inherit))
- (t (error "No such attachment command %c" c))))))
-
-(defun org-attach-dir (&optional create-if-not-exists-p)
- "Return the directory associated with the current entry.
-This first checks for a local property ATTACH_DIR, and then for an inherited
-property ATTACH_DIR_INHERIT. If neither exists, the default mechanism
-using the entry ID will be invoked to access the unique directory for the
-current entry.
-If the directory does not exist and CREATE-IF-NOT-EXISTS-P is non-nil,
-the directory and (if necessary) the corresponding ID will be created."
- (let (attach-dir uuid inherit)
- (setq org-attach-inherited (org-entry-get nil "ATTACH_DIR_INHERIT"))
- (cond
- ((setq attach-dir (org-entry-get nil "ATTACH_DIR"))
- (org-attach-check-absolute-path attach-dir))
- ((and org-attach-allow-inheritance
- (setq inherit (org-entry-get nil "ATTACH_DIR_INHERIT" t)))
- (setq attach-dir
- (save-excursion
- (save-restriction
- (widen)
- (goto-char org-entry-property-inherited-from)
- (let (org-attach-allow-inheritance)
- (org-attach-dir create-if-not-exists-p)))))
- (org-attach-check-absolute-path attach-dir)
- (setq org-attach-inherited t))
- (t ; use the ID
- (org-attach-check-absolute-path nil)
- (setq uuid (org-id-get (point) create-if-not-exists-p))
- (when (or uuid create-if-not-exists-p)
- (unless uuid (error "ID retrieval/creation failed"))
- (setq attach-dir (expand-file-name
- (format "%s/%s"
- (substring uuid 0 2)
- (substring uuid 2))
- (expand-file-name org-attach-directory))))))
- (when attach-dir
- (if (and create-if-not-exists-p
- (not (file-directory-p attach-dir)))
- (make-directory attach-dir t))
- (and (file-exists-p attach-dir)
- attach-dir))))
-
-(defun org-attach-check-absolute-path (dir)
- "Check if we have enough information to root the attachment directory.
-When DIR is given, check also if it is already absolute. Otherwise,
-assume that it will be relative, and check if `org-attach-directory' is
-absolute, or if at least the current buffer has a file name.
-Throw an error if we cannot root the directory."
- (or (and dir (file-name-absolute-p dir))
- (file-name-absolute-p org-attach-directory)
- (buffer-file-name (buffer-base-buffer))
- (error "Need absolute `org-attach-directory' to attach in buffers without filename")))
-
-(defun org-attach-set-directory ()
- "Set the ATTACH_DIR property of the current entry.
-The property defines the directory that is used for attachments
-of the entry."
- (interactive)
- (let ((dir (org-entry-get nil "ATTACH_DIR")))
- (setq dir (read-directory-name "Attachment directory: " dir))
- (org-entry-put nil "ATTACH_DIR" dir)))
-
-(defun org-attach-set-inherit ()
- "Set the ATTACH_DIR_INHERIT property of the current entry.
-The property defines the directory that is used for attachments
-of the entry and any children that do not explicitly define (by setting
-the ATTACH_DIR property) their own attachment directory."
- (interactive)
- (org-entry-put nil "ATTACH_DIR_INHERIT" "t")
- (message "Children will inherit attachment directory"))
-
-(defun org-attach-commit ()
- "Commit changes to git if `org-attach-directory' is properly initialized.
-This checks for the existence of a \".git\" directory in that directory."
- (let ((dir (expand-file-name org-attach-directory)))
- (when (file-exists-p (expand-file-name ".git" dir))
- (with-temp-buffer
- (cd dir)
- (shell-command "git add .")
- (shell-command "git ls-files --deleted" t)
- (mapc '(lambda (file)
- (unless (string= file "")
- (shell-command
- (concat "git rm \"" file "\""))))
- (split-string (buffer-string) "\n"))
- (shell-command "git commit -m 'Synchronized attachments'")))))
-
-(defun org-attach-tag (&optional off)
- "Turn the autotag on or (if OFF is set) off."
- (when org-attach-auto-tag
- (save-excursion
- (org-back-to-heading t)
- (org-toggle-tag org-attach-auto-tag (if off 'off 'on)))))
-
-(defun org-attach-untag ()
- "Turn the autotag off."
- (org-attach-tag 'off))
-
-(defun org-attach-attach (file &optional visit-dir method)
- "Move/copy/link FILE into the attachment directory of the current task.
-If VISIT-DIR is non-nil, visit the directory with dired.
-METHOD may be `cp', `mv', or `ln', default taken from `org-attach-method'."
- (interactive "fFile to keep as an attachment: \nP")
- (setq method (or method org-attach-method))
- (let ((basename (file-name-nondirectory file)))
- (when (and org-attach-file-list-property (not org-attach-inherited))
- (org-entry-add-to-multivalued-property
- (point) org-attach-file-list-property basename))
- (let* ((attach-dir (org-attach-dir t))
- (fname (expand-file-name basename attach-dir)))
- (cond
- ((eq method 'mv) (rename-file file fname))
- ((eq method 'cp) (copy-file file fname))
- ((eq method 'ln) (add-name-to-file file fname)))
- (org-attach-commit)
- (org-attach-tag)
- (if visit-dir
- (dired attach-dir)
- (message "File \"%s\" is now a task attachment." basename)))))
-
-(defun org-attach-attach-cp ()
- "Attach a file by copying it."
- (interactive)
- (let ((org-attach-method 'cp)) (call-interactively 'org-attach-attach)))
-(defun org-attach-attach-mv ()
- "Attach a file by moving (renaming) it."
- (interactive)
- (let ((org-attach-method 'mv)) (call-interactively 'org-attach-attach)))
-(defun org-attach-attach-ln ()
- "Attach a file by creating a hard link to it.
-Beware that this does not work on systems that do not support hard links.
-On some systems, this apparently does copy the file instead."
- (interactive)
- (let ((org-attach-method 'ln)) (call-interactively 'org-attach-attach)))
-
-(defun org-attach-new (file)
- "Create a new attachment FILE for the current task.
-The attachment is created as an Emacs buffer."
- (interactive "sCreate attachment named: ")
- (when (and org-attach-file-list-property (not org-attach-inherited))
- (org-entry-add-to-multivalued-property
- (point) org-attach-file-list-property file))
- (let ((attach-dir (org-attach-dir t)))
- (org-attach-tag)
- (find-file (expand-file-name file attach-dir))
- (message "New attachment %s" file)))
-
-(defun org-attach-delete-one (&optional file)
- "Delete a single attachment."
- (interactive)
- (let* ((attach-dir (org-attach-dir t))
- (files (org-attach-file-list attach-dir))
- (file (or file
- (org-icompleting-read
- "Delete attachment: "
- (mapcar (lambda (f)
- (list (file-name-nondirectory f)))
- files)))))
- (setq file (expand-file-name file attach-dir))
- (unless (file-exists-p file)
- (error "No such attachment: %s" file))
- (delete-file file)
- (org-attach-commit)))
-
-(defun org-attach-delete-all (&optional force)
- "Delete all attachments from the current task.
-This actually deletes the entire attachment directory.
-A safer way is to open the directory in dired and delete from there."
- (interactive "P")
- (when (and org-attach-file-list-property (not org-attach-inherited))
- (org-entry-delete (point) org-attach-file-list-property))
- (let ((attach-dir (org-attach-dir)))
- (when
- (and attach-dir
- (or force
- (y-or-n-p "Are you sure you want to remove all attachments of this entry? ")))
- (shell-command (format "rm -fr %s" attach-dir))
- (message "Attachment directory removed")
- (org-attach-commit)
- (org-attach-untag))))
-
-(defun org-attach-sync ()
- "Synchronize the current tasks with its attachments.
-This can be used after files have been added externally."
- (interactive)
- (org-attach-commit)
- (when (and org-attach-file-list-property (not org-attach-inherited))
- (org-entry-delete (point) org-attach-file-list-property))
- (let ((attach-dir (org-attach-dir)))
- (when attach-dir
- (let ((files (org-attach-file-list attach-dir)))
- (and files (org-attach-tag))
- (when org-attach-file-list-property
- (dolist (file files)
- (unless (string-match "^\\." file)
- (org-entry-add-to-multivalued-property
- (point) org-attach-file-list-property file))))))))
-
-(defun org-attach-file-list (dir)
- "Return a list of files in the attachment directory.
-This ignores files starting with a \".\", and files ending in \"~\"."
- (delq nil
- (mapcar (lambda (x) (if (string-match "^\\." x) nil x))
- (directory-files dir nil "[^~]\\'"))))
-
-(defun org-attach-reveal (&optional if-exists)
- "Show the attachment directory of the current task in dired."
- (interactive "P")
- (let ((attach-dir (org-attach-dir (not if-exists))))
- (and attach-dir (org-open-file attach-dir))))
-
-(defun org-attach-reveal-in-emacs ()
- "Show the attachment directory of the current task.
-This will attempt to use an external program to show the directory."
- (interactive)
- (let ((attach-dir (org-attach-dir t)))
- (dired attach-dir)))
-
-(defun org-attach-open (&optional in-emacs)
- "Open an attachment of the current task.
-If there are more than one attachment, you will be prompted for the file name.
-This command will open the file using the settings in `org-file-apps'
-and in the system-specific variants of this variable.
-If IN-EMACS is non-nil, force opening in Emacs."
- (interactive "P")
- (let* ((attach-dir (org-attach-dir t))
- (files (org-attach-file-list attach-dir))
- (file (if (= (length files) 1)
- (car files)
- (org-icompleting-read "Open attachment: "
- (mapcar 'list files) nil t))))
- (org-open-file (expand-file-name file attach-dir) in-emacs)))
-
-(defun org-attach-open-in-emacs ()
- "Open attachment, force opening in Emacs.
-See `org-attach-open'."
- (interactive)
- (org-attach-open 'in-emacs))
-
-(defun org-attach-expand (file)
- "Return the full path to the current entry's attachment file FILE.
-Basically, this adds the path to the attachment directory."
- (expand-file-name file (org-attach-dir)))
-
-(defun org-attach-expand-link (file)
- "Return a file link pointing to the current entry's attachment file FILE.
-Basically, this adds the path to the attachment directory, and a \"file:\"
-prefix."
- (concat "file:" (org-attach-expand file)))
-
-(provide 'org-attach)
-
-;; arch-tag: fce93c2e-fe07-4fa3-a905-e10dcc7a6248
-;;; org-attach.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-attach.elc b/.emacs.d/org-7.4/lisp/org-attach.elc
deleted file mode 100644
index baee093..0000000
--- a/.emacs.d/org-7.4/lisp/org-attach.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-bbdb.el b/.emacs.d/org-7.4/lisp/org-bbdb.el
deleted file mode 100644
index 4155f58..0000000
--- a/.emacs.d/org-7.4/lisp/org-bbdb.el
+++ /dev/null
@@ -1,386 +0,0 @@
-;;; org-bbdb.el --- Support for links to BBDB entries from within Org-mode
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>,
-;; Thomas Baumann <thomas dot baumann at ch dot tum dot de>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file implements links to BBDB database entries from within Org-mode.
-;; Org-mode loads this module by default - if this is not what you want,
-;; configure the variable `org-modules'.
-
-;; It also implements an interface (based on Ivar Rummelhoff's
-;; bbdb-anniv.el) for those org-mode users, who do not use the diary
-;; but who do want to include the anniversaries stored in the BBDB
-;; into the org-agenda. If you already include the `diary' into the
-;; agenda, you might want to prefer to include the anniversaries in
-;; the diary using bbdb-anniv.el.
-;;
-;; Put the following in /somewhere/at/home/diary.org and make sure
-;; that this file is in `org-agenda-files`
-;;
-;; %%(org-bbdb-anniversaries)
-;;
-;; For example my diary.org looks like:
-;; * Anniversaries
-;; #+CATEGORY: Anniv
-;; %%(org-bbdb-anniversaries)
-;;
-;;
-;; To add an anniversary to a BBDB record, press `C-o' in the record.
-;; You will be prompted for the field name, in this case it must be
-;; "anniversary". If this is the first time you are using this field,
-;; you need to confirm that it should be created.
-;;
-;; The format of an anniversary field stored in BBDB is the following
-;; (items in {} are optional):
-;;
-;; YYYY-MM-DD{ CLASS-OR-FORMAT-STRING}
-;; {\nYYYY-MM-DD CLASS-OR-FORMAT-STRING}...
-;;
-;; CLASS-OR-FORMAT-STRING is one of two things:
-;;
-;; - an identifier for a class of anniversaries (eg. birthday or
-;; wedding) from `org-bbdb-anniversary-format-alist' which then
-;; defines the format string for this class
-;; - the (format) string displayed in the diary.
-;;
-;; You can enter multiple anniversaries for a single BBDB record by
-;; separating them with a newline character. At the BBDB prompt for
-;; the field value, type `C-q C-j' to enter a newline between two
-;; anniversaries.
-;;
-;; If you omit the CLASS-OR-FORMAT-STRING entirely, it defaults to the
-;; value of `org-bbdb-default-anniversary-format' ("birthday" by
-;; default).
-;;
-;; The substitutions in the format string are (in order):
-;; - the name of the record containing this anniversary
-;; - the number of years
-;; - an ordinal suffix (st, nd, rd, th) for the year
-;;
-;; See the documentation of `org-bbdb-anniversary-format-alist' for
-;; further options.
-;;
-;; Example
-;;
-;; 1973-06-22
-;; 20??-??-?? wedding
-;; 1998-03-12 %s created bbdb-anniv.el %d years ago
-;;
-;; From Org's agenda, you can use `C-c C-o' to jump to the BBDB
-;; link from which the entry at point originates.
-;;
-;;; Code:
-
-(require 'org)
-(eval-when-compile
- (require 'cl))
-
-;; Declare external functions and variables
-
-(declare-function bbdb "ext:bbdb-com" (string elidep))
-(declare-function bbdb-company "ext:bbdb-com" (string elidep))
-(declare-function bbdb-current-record "ext:bbdb-com"
- (&optional planning-on-modifying))
-(declare-function bbdb-name "ext:bbdb-com" (string elidep))
-(declare-function bbdb-completing-read-record "ext:bbdb-com"
- (prompt &optional omit-records))
-(declare-function bbdb-record-getprop "ext:bbdb" (record property))
-(declare-function bbdb-record-name "ext:bbdb" (record))
-(declare-function bbdb-records "ext:bbdb"
- (&optional dont-check-disk already-in-db-buffer))
-(declare-function bbdb-split "ext:bbdb" (string separators))
-(declare-function bbdb-string-trim "ext:bbdb" (string))
-
-(declare-function calendar-leap-year-p "calendar" (year))
-(declare-function diary-ordinal-suffix "diary-lib" (n))
-
-(defvar date) ;; dynamically scoped from Org
-
-;; Customization
-
-(defgroup org-bbdb-anniversaries nil
- "Customizations for including anniversaries from BBDB into Agenda."
- :group 'org-bbdb)
-
-(defcustom org-bbdb-default-anniversary-format "birthday"
- "Default anniversary class."
- :type 'string
- :group 'org-bbdb-anniversaries
- :require 'bbdb)
-
-(defcustom org-bbdb-anniversary-format-alist
- '(("birthday" lambda
- (name years suffix)
- (concat "Birthday: [[bbdb:" name "][" name " ("
- (number-to-string years)
- suffix ")]]"))
- ("wedding" lambda
- (name years suffix)
- (concat "[[bbdb:" name "][" name "'s "
- (number-to-string years)
- suffix " wedding anniversary]]")))
- "How different types of anniversaries should be formatted.
-An alist of elements (STRING . FORMAT) where STRING is the name of an
-anniversary class and format is either:
-1) A format string with the following substitutions (in order):
- * the name of the record containing this anniversary
- * the number of years
- * an ordinal suffix (st, nd, rd, th) for the year
-
-2) A function to be called with three arguments: NAME YEARS SUFFIX
- (string int string) returning a string for the diary or nil.
-
-3) An Emacs Lisp form that should evaluate to a string (or nil) in the
- scope of variables NAME, YEARS and SUFFIX (among others)."
- :type 'sexp
- :group 'org-bbdb-anniversaries
- :require 'bbdb)
-
-(defcustom org-bbdb-anniversary-field 'anniversary
- "The BBDB field which contains anniversaries.
-The anniversaries are stored in the following format
-
-YYYY-MM-DD Class-or-Format-String
-
-where class is one of the customized classes for anniversaries;
-birthday and wedding are predefined. Format-String can take three
-substitutions 1) the name of the record containing this
-anniversary, 2) the number of years, and 3) an ordinal suffix for
-the year.
-
-Multiple anniversaries can be separated by \\n."
- :type 'symbol
- :group 'org-bbdb-anniversaries
- :require 'bbdb)
-
-(defcustom org-bbdb-extract-date-fun 'org-bbdb-anniv-extract-date
- "How to retrieve `month date year' from the anniversary field.
-
-Customize if you have already filled your BBDB with dates
-different from YYYY-MM-DD. The function must return a list (month
-date year)."
- :type 'function
- :group 'org-bbdb-anniversaries
- :require 'bbdb)
-
-
-;; Install the link type
-(org-add-link-type "bbdb" 'org-bbdb-open 'org-bbdb-export)
-(add-hook 'org-store-link-functions 'org-bbdb-store-link)
-
-;; Implementation
-(defun org-bbdb-store-link ()
- "Store a link to a BBDB database entry."
- (when (eq major-mode 'bbdb-mode)
- ;; This is BBDB, we make this link!
- (let* ((name (bbdb-record-name (bbdb-current-record)))
- (company (bbdb-record-getprop (bbdb-current-record) 'company))
- (link (org-make-link "bbdb:" name)))
- (org-store-link-props :type "bbdb" :name name :company company
- :link link :description name)
- link)))
-
-(defun org-bbdb-export (path desc format)
- "Create the export version of a BBDB link specified by PATH or DESC.
-If exporting to either HTML or LaTeX FORMAT the link will be
-italicized, in all other cases it is left unchanged."
- (cond
- ((eq format 'html) (format "<i>%s</i>" (or desc path)))
- ((eq format 'latex) (format "\\textit{%s}" (or desc path)))
- (t (or desc path))))
-
-(defun org-bbdb-open (name)
- "Follow a BBDB link to NAME."
- (require 'bbdb)
- (let ((inhibit-redisplay (not debug-on-error))
- (bbdb-electric-p nil))
- (catch 'exit
- ;; Exact match on name
- (bbdb-name (concat "\\`" name "\\'") nil)
- (if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
- ;; Exact match on name
- (bbdb-company (concat "\\`" name "\\'") nil)
- (if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
- ;; Partial match on name
- (bbdb-name name nil)
- (if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
- ;; Partial match on company
- (bbdb-company name nil)
- (if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
- ;; General match including network address and notes
- (bbdb name nil)
- (when (= 0 (buffer-size (get-buffer "*BBDB*")))
- (delete-window (get-buffer-window "*BBDB*"))
- (error "No matching BBDB record")))))
-
-(defun org-bbdb-anniv-extract-date (time-str)
- "Convert YYYY-MM-DD to (month date year).
-Argument TIME-STR is the value retrieved from BBDB."
- (multiple-value-bind (y m d) (values-list (bbdb-split time-str "-"))
- (list (string-to-number m)
- (string-to-number d)
- (string-to-number y))))
-
-(defun org-bbdb-anniv-split (str)
- "Split multiple entries in the BBDB anniversary field.
-Argument STR is the anniversary field in BBDB."
- (let ((pos (string-match "[ \t]" str)))
- (if pos (list (substring str 0 pos)
- (bbdb-string-trim (substring str pos)))
- (list str nil))))
-
-(defvar org-bbdb-anniv-hash nil
- "A hash holding anniversaries extracted from BBDB.
-The hash table is created on first use.")
-
-(defvar org-bbdb-updated-p t
- "This is non-nil if BBDB has been updated since we last built the hash.")
-
-(defun org-bbdb-make-anniv-hash ()
- "Create a hash with anniversaries extracted from BBDB, for fast access.
-The anniversaries are assumed to be stored `org-bbdb-anniversary-field'."
-
- (let (split tmp annivs)
- (clrhash org-bbdb-anniv-hash)
- (dolist (rec (bbdb-records))
- (when (setq annivs (bbdb-record-getprop
- rec org-bbdb-anniversary-field))
- (setq annivs (bbdb-split annivs "\n"))
- (while annivs
- (setq split (org-bbdb-anniv-split (pop annivs)))
- (multiple-value-bind (m d y)
- (values-list (funcall org-bbdb-extract-date-fun (car split)))
- (setq tmp (gethash (list m d) org-bbdb-anniv-hash))
- (puthash (list m d) (cons (list y
- (bbdb-record-name rec)
- (cadr split))
- tmp)
- org-bbdb-anniv-hash))))))
- (setq org-bbdb-updated-p nil))
-
-(defun org-bbdb-updated (rec)
- "Record the fact that BBDB has been updated.
-This is used by Org to re-create the anniversary hash table."
- (setq org-bbdb-updated-p t))
-
-(add-hook 'bbdb-after-change-hook 'org-bbdb-updated)
-
-;;;###autoload
-(defun org-bbdb-anniversaries()
- "Extract anniversaries from BBDB for display in the agenda."
- (require 'bbdb)
- (require 'diary-lib)
- (unless (hash-table-p org-bbdb-anniv-hash)
- (setq org-bbdb-anniv-hash
- (make-hash-table :test 'equal :size 366)))
-
- (when (or org-bbdb-updated-p
- (= 0 (hash-table-count org-bbdb-anniv-hash)))
- (org-bbdb-make-anniv-hash))
-
- (let* ((m (car date)) ; month
- (d (nth 1 date)) ; day
- (y (nth 2 date)) ; year
- (annivs (gethash (list m d) org-bbdb-anniv-hash))
- (text ())
- rec recs)
-
- ;; we don't want to miss people born on Feb. 29th
- (when (and (= m 3) (= d 1)
- (not (null (gethash (list 2 29) org-bbdb-anniv-hash)))
- (not (calendar-leap-year-p y)))
- (setq recs (gethash (list 2 29) org-bbdb-anniv-hash))
- (while (setq rec (pop recs))
- (push rec annivs)))
-
- (when annivs
- (while (setq rec (pop annivs))
- (when rec
- (let* ((class (or (nth 2 rec)
- org-bbdb-default-anniversary-format))
- (form (or (cdr (assoc-string
- class org-bbdb-anniversary-format-alist t))
- class)) ; (as format string)
- (name (nth 1 rec))
- (years (- y (car rec)))
- (suffix (diary-ordinal-suffix years))
- (tmp (cond
- ((functionp form)
- (funcall form name years suffix))
- ((listp form) (eval form))
- (t (format form name years suffix)))))
- (org-add-props tmp nil 'org-bbdb-name name)
- (if text
- (setq text (append text (list tmp)))
- (setq text (list tmp)))))
- ))
- text))
-
-(defun org-bbdb-complete-link ()
- "Read a bbdb link with name completion."
- (require 'bbdb-com)
- (concat "bbdb:"
- (bbdb-record-name (car (bbdb-completing-read-record "Name: ")))))
-
-(defun org-bbdb-anniv-export-ical ()
- "Extract anniversaries from BBDB and convert them to icalendar format."
- (require 'bbdb)
- (require 'diary-lib)
- (unless (hash-table-p org-bbdb-anniv-hash)
- (setq org-bbdb-anniv-hash
- (make-hash-table :test 'equal :size 366)))
- (when (or org-bbdb-updated-p
- (= 0 (hash-table-count org-bbdb-anniv-hash)))
- (org-bbdb-make-anniv-hash))
- (maphash 'org-bbdb-format-vevent org-bbdb-anniv-hash))
-
-(defun org-bbdb-format-vevent (key recs)
- (let (rec categ)
- (while (setq rec (pop recs))
- (setq categ (or (nth 2 rec) org-bbdb-default-anniversary-format))
- (princ (format "BEGIN:VEVENT
-UID: ANNIV-%4i%02i%02i-%s
-DTSTART:%4i%02i%02i
-SUMMARY:%s
-DESCRIPTION:%s
-CATEGORIES:%s
-RRULE:FREQ=YEARLY
-END:VEVENT\n"
- (nth 0 rec) (nth 0 key) (nth 1 key)
- (mapconcat 'identity
- (org-split-string (nth 1 rec) "[^a-zA-Z0-90]+")
- "-")
- (nth 0 rec) (nth 0 key) (nth 1 key)
- (nth 1 rec)
- (concat (capitalize categ) " " (nth 1 rec))
- categ)))))
-
-(provide 'org-bbdb)
-
-;; arch-tag: 9e4f275d-d080-48c1-b040-62247f66b5c2
-
-;;; org-bbdb.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-bbdb.elc b/.emacs.d/org-7.4/lisp/org-bbdb.elc
deleted file mode 100644
index e270d9c..0000000
--- a/.emacs.d/org-7.4/lisp/org-bbdb.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-beamer.el b/.emacs.d/org-7.4/lisp/org-beamer.el
deleted file mode 100644
index c88df85..0000000
--- a/.emacs.d/org-7.4/lisp/org-beamer.el
+++ /dev/null
@@ -1,636 +0,0 @@
-;;; org-beamer.el --- Beamer-specific LaTeX export for org-mode
-;;
-;; Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-;;
-;; Version: 7.4
-;; Author: Carsten Dominik <carsten.dominik AT gmail DOT com>
-;; Maintainer: Carsten Dominik <carsten.dominik AT gmail DOT com>
-;; Keywords: org, wp, tex
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-;;
-;; This library implement the special treatment needed by using the
-;; beamer class during LaTeX export.
-
-;;; Code:
-
-(require 'org)
-(require 'org-exp)
-
-(defvar org-export-latex-header)
-(defvar org-export-latex-options-plist)
-(defvar org-export-opt-plist)
-
-(defgroup org-beamer nil
- "Options specific for using the beamer class in LaTeX export."
- :tag "Org Beamer"
- :group 'org-export-latex)
-
-(defcustom org-beamer-use-parts nil
- ""
- :group 'org-beamer
- :type 'boolean)
-
-(defcustom org-beamer-frame-level 1
- "The level that should be interpreted as a frame.
-The levels above this one will be translated into a sectioning structure.
-Setting this to 2 will allow sections, 3 will allow subsections as well.
-You can set this to 4 as well, if you at the same time set
-`org-beamer-use-parts' to make the top levels `\part'."
- :group 'org-beamer
- :type '(choice
- (const :tag "Frames need a BEAMER_env property" nil)
- (integer :tag "Specific level makes a frame")))
-
-(defcustom org-beamer-frame-default-options ""
- "Default options string to use for frames, should contains the [brackets].
-And example for this is \"[allowframebreaks]\"."
- :group 'org-beamer
- :type '(string :tag "[options]"))
-
-(defcustom org-beamer-column-view-format
- "%45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)"
- "Default column view format that should be used to fill the template."
- :group 'org-beamer
- :type '(choice
- (const :tag "Do not insert Beamer column view format" nil)
- (string :tag "Beamer column view format")))
-
-(defcustom org-beamer-themes
- "\\usetheme{default}\\usecolortheme{default}"
- "Default string to be used for extra heading stuff in beamer presentations.
-When a beamer template is filled, this will be the default for
-BEAMER_HEADER_EXTRA, which will be inserted just before \\begin{document}."
- :group 'org-beamer
- :type '(choice
- (const :tag "Do not insert Beamer themes" nil)
- (string :tag "Beamer themes")))
-
-(defconst org-beamer-column-widths
- "0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.0 :ETC"
-"The column widths that should be installed as allowed property values.")
-
-(defconst org-beamer-transitions
- "\transblindsvertical \transblindshorizontal \transboxin \transboxout \transdissolve \transduration \transglitter \transsplithorizontalin \transsplithorizontalout \transsplitverticalin \transsplitverticalout \transwipe :ETC"
- "Transitions available for beamer.
-These are just a completion help.")
-
-(defconst org-beamer-environments-default
- '(("frame" "f" "dummy- special handling hard coded" "dummy")
- ("columns" "C" "\\begin{columns}%o %% %h%x" "\\end{columns}")
- ("column" "c" "\\begin{column}%o{%h\\textwidth}%x" "\\end{column}")
- ("block" "b" "\\begin{block}%a{%h}%x" "\\end{block}")
- ("alertblock" "a" "\\begin{alertblock}%a{%h}%x" "\\end{alertblock}")
- ("verse" "v" "\\begin{verse}%a %% %h%x" "\\end{verse}")
- ("quotation" "q" "\\begin{quotation}%a %% %h%x" "\\end{quotation}")
- ("quote" "Q" "\\begin{quote}%a %% %h%x" "\\end{quote}")
- ("structureenv" "s" "\\begin{structureenv}%a %% %h%x" "\\end{structureenv}")
- ("theorem" "t" "\\begin{theorem}%a%U%x" "\\end{theorem}")
- ("definition" "d" "\\begin{definition}%a%U%x" "\\end{definition}")
- ("example" "e" "\\begin{example}%a%U%x" "\\end{example}")
- ("proof" "p" "\\begin{proof}%a%U%x" "\\end{proof}")
- ("beamercolorbox" "o" "\\begin{beamercolorbox}%o{%h}%x" "\\end{beamercolorbox}")
- ("normal" "h" "%h" "") ; Emit the heading as normal text
- ("note" "n" "\\note%o%a{%h" "}")
- ("noteNH" "N" "\\note%o%a{" "}") ; note, ignore heading
- ("ignoreheading" "i" "%%%% %h" ""))
- "Environments triggered by properties in Beamer export.
-These are the defaults - for user definitions, see
-`org-beamer-environments-extra'.
-\"normal\" is a special fake environment, which emit the heading as
-normal text. It is needed when an environment should be surrounded
-by normal text. Since beamer export converts nodes into environments,
-you need to have a node to end the environment.
-For example
-
- ** a frame
- some text
- *** Blocktitle :B_block:
- inside the block
- *** After the block :B_normal:
- continuing here
- ** next frame")
-
-(defcustom org-beamer-environments-extra nil
- "Environments triggered by tags in Beamer export.
-Each entry has 4 elements:
-
-name Name of the environment
-key Selection key for `org-beamer-select-environment'
-open The opening template for the environment, with the following escapes
- %a the action/overlay specification
- %A the default action/overlay specification
- %o the options argument of the template
- %h the headline text
- %H if there is headline text, that text in {} braces
- %U if there is headline text, that text in [] brackets
-close The closing string of the environment."
-
- :group 'org-beamer
- :type '(repeat
- (list
- (string :tag "Environment")
- (string :tag "Selection key")
- (string :tag "Begin")
- (string :tag "End"))))
-
-(defvar org-beamer-frame-level-now nil)
-(defvar org-beamer-header-extra nil)
-(defvar org-beamer-export-is-beamer-p nil)
-(defvar org-beamer-inside-frame-at-level nil)
-(defvar org-beamer-columns-open nil)
-(defvar org-beamer-column-open nil)
-
-(defun org-beamer-cleanup-column-width (width)
- "Make sure the width is not empty, and that it has a unit."
- (setq width (org-trim (or width "")))
- (unless (string-match "\\S-" width) (setq width "0.5"))
- (if (string-match "\\`[.0-9]+\\'" width)
- (setq width (concat width "\\textwidth")))
- width)
-
-(defun org-beamer-open-column (&optional width opt)
- (org-beamer-close-column-maybe)
- (setq org-beamer-column-open t)
- (setq width (org-beamer-cleanup-column-width width))
- (insert (format "\\begin{column}%s{%s}\n" (or opt "") width)))
-(defun org-beamer-close-column-maybe ()
- (when org-beamer-column-open
- (setq org-beamer-column-open nil)
- (insert "\\end{column}\n")))
-(defun org-beamer-open-columns-maybe (&optional opts)
- (unless org-beamer-columns-open
- (setq org-beamer-columns-open t)
- (insert (format "\\begin{columns}%s\n" (or opts "")))))
-(defun org-beamer-close-columns-maybe ()
- (org-beamer-close-column-maybe)
- (when org-beamer-columns-open
- (setq org-beamer-columns-open nil)
- (insert "\\end{columns}\n")))
-
-(defun org-beamer-select-environment ()
- "Select the environment to be used by beamer for this entry.
-While this uses (for convenience) a tag selection interface, the result
-of this command will be that the BEAMER_env *property* of the entry is set.
-
-In addition to this, the command will also set a tag as a visual aid, but
-the tag does not have any semantic meaning."
- (interactive)
- (let* ((envs (append org-beamer-environments-extra
- org-beamer-environments-default))
- (org-tag-alist
- (append '((:startgroup))
- (mapcar (lambda (e) (cons (concat "B_" (car e))
- (string-to-char (nth 1 e))))
- envs)
- '((:endgroup))
- '(("BMCOL" . ?|))))
- (org-fast-tag-selection-single-key t))
- (org-set-tags)
- (let ((tags (or (ignore-errors (org-get-tags-string)) "")))
- (cond
- ((equal org-last-tag-selection-key ?|)
- (if (string-match ":BMCOL:" tags)
- (org-set-property "BEAMER_col" (read-string "Column width: "))
- (org-delete-property "BEAMER_col")))
- ((string-match (concat ":B_\\("
- (mapconcat 'car envs "\\|")
- "\\):")
- tags)
- (org-entry-put nil "BEAMER_env" (match-string 1 tags)))
- (t (org-entry-delete nil "BEAMER_env"))))))
-
-
-(defun org-beamer-sectioning (level text)
- "Return the sectioning entry for the current headline.
-LEVEL is the reduced level of the headline.
-TEXT is the text of the headline, everything except the leading stars.
-The return value is a cons cell. The car is the headline text, usually
-just TEXT, but possibly modified if options have been extracted from the
-text. The cdr is the sectioning entry, similar to what is given
-in org-export-latex-classes."
- (let* ((frame-level (or org-beamer-frame-level-now org-beamer-frame-level))
- (default
- (if org-beamer-use-parts
- '((1 . ("\\part{%s}" . "\\part*{%s}"))
- (2 . ("\\section{%s}" . "\\section*{%s}"))
- (3 . ("\\subsection{%s}" . "\\subsection*{%s}")))
- '((1 . ("\\section{%s}" . "\\section*{%s}"))
- (2 . ("\\subsection{%s}" . "\\subsection*{%s}")))))
- (envs (append org-beamer-environments-extra
- org-beamer-environments-default))
- (props (org-get-text-property-any 0 'org-props text))
- (in "") (out "") option action defaction environment extra
- columns-option column-option
- env have-text ass tmp)
- (if (= frame-level 0) (setq frame-level nil))
- (when (and org-beamer-inside-frame-at-level
- (<= level org-beamer-inside-frame-at-level))
- (setq org-beamer-inside-frame-at-level nil))
- (when (setq tmp (org-beamer-assoc-not-empty "BEAMER_col" props))
- (if (and (string-match "\\`[0-9.]+\\'" tmp)
- (or (= (string-to-number tmp) 1.0)
- (= (string-to-number tmp) 0.0)))
- ;; column width 1 means close columns, go back to full width
- (org-beamer-close-columns-maybe)
- (when (setq ass (assoc "BEAMER_envargs" props))
- (let (case-fold-search)
- (while (string-match "C\\(\\[[^][]*\\]\\|<[^<>]*>\\)" (cdr ass))
- (setq columns-option (match-string 1 (cdr ass)))
- (setcdr ass (replace-match "" t t (cdr ass))))
- (while (string-match "c\\(\\[[^][]*\\]\\|<[^<>]*>\\)" (cdr ass))
- (setq column-option (match-string 1 (cdr ass)))
- (setcdr ass (replace-match "" t t (cdr ass))))))
- (org-beamer-open-columns-maybe columns-option)
- (org-beamer-open-column tmp column-option)))
- (cond
- ((or (equal (cdr (assoc "BEAMER_env" props)) "frame")
- (and frame-level (= level frame-level)))
- ;; A frame
- (org-beamer-get-special props)
-
- (setq in (org-fill-template
- "\\begin{frame}%a%A%o%T%S%x"
- (list (cons "a" (or action ""))
- (cons "A" (or defaction ""))
- (cons "o" (or option org-beamer-frame-default-options ""))
- (cons "x" (if extra (concat "\n" extra) ""))
- (cons "h" "%s")
- (cons "T" (if (string-match "\\S-" text)
- "\n\\frametitle{%s}" ""))
- (cons "S" (if (string-match "\\\\\\\\" text)
- "\n\\framesubtitle{%s}" ""))))
- out (copy-sequence "\\end{frame}"))
- (org-add-props out
- '(org-insert-hook org-beamer-close-columns-maybe))
- (setq org-beamer-inside-frame-at-level level)
- (cons text (list in out in out)))
- ((and (setq env (cdr (assoc "BEAMER_env" props)))
- (setq ass (assoc env envs)))
- ;; A beamer environment selected by the BEAMER_env property
- (if (string-match "[ \t]+:[ \t]*$" text)
- (setq text (replace-match "" t t text)))
- (if (member env '("note" "noteNH"))
- ;; There should be no labels in a note, so we remove the targets
- ;; FIXME???
- (remove-text-properties 0 (length text) '(target nil) text))
- (org-beamer-get-special props)
- (setq text (org-trim text))
- (setq have-text (string-match "\\S-" text))
- (setq in (org-fill-template
- (nth 2 ass)
- (list (cons "a" (or action ""))
- (cons "A" (or defaction ""))
- (cons "o" (or option ""))
- (cons "x" (if extra (concat "\n" extra) ""))
- (cons "h" "%s")
- (cons "H" (if have-text (concat "{" text "}") ""))
- (cons "U" (if have-text (concat "[" text "]") ""))))
- out (nth 3 ass))
- (cond
- ((equal out "\\end{columns}")
- (setq org-beamer-columns-open t)
- (setq out (org-add-props (copy-sequence out)
- '(org-insert-hook
- (lambda ()
- (org-beamer-close-column-maybe)
- (setq org-beamer-columns-open nil))))))
- ((equal out "\\end{column}")
- (org-beamer-open-columns-maybe)))
- (cons text (list in out in out)))
- ((and (not org-beamer-inside-frame-at-level)
- (or (not frame-level)
- (< level frame-level))
- (assoc level default))
- ;; Normal sectioning
- (cons text (cdr (assoc level default))))
- (t nil))))
-
-(defvar extra)
-(defvar option)
-(defvar action)
-(defvar defaction)
-(defvar environment)
-(defun org-beamer-get-special (props)
- "Extract an option, action, and default action string from text.
-The variables option, action, defaction, extra are all scoped into
-this function dynamically."
- (let (tmp)
- (setq environment (org-beamer-assoc-not-empty "BEAMER_env" props))
- (setq extra (org-beamer-assoc-not-empty "BEAMER_extra" props))
- (when extra
- (setq extra (replace-regexp-in-string "\\\\n" "\n" extra)))
- (setq tmp (org-beamer-assoc-not-empty "BEAMER_envargs" props))
- (when tmp
- (setq tmp (copy-sequence tmp))
- (if (string-match "\\[<[^][<>]*>\\]" tmp)
- (setq defaction (match-string 0 tmp)
- tmp (replace-match "" t t tmp)))
- (if (string-match "\\[[^][]*\\]" tmp)
- (setq option (match-string 0 tmp)
- tmp (replace-match "" t t tmp)))
- (if (string-match "<[^<>]*>" tmp)
- (setq action (match-string 0 tmp)
- tmp (replace-match "" t t tmp))))))
-
-(defun org-beamer-assoc-not-empty (elt list)
- (let ((tmp (cdr (assoc elt list))))
- (and tmp (string-match "\\S-" tmp) tmp)))
-
-
-(defvar org-beamer-mode-map (make-sparse-keymap)
- "The keymap for `org-beamer-mode'.")
-(define-key org-beamer-mode-map "\C-c\C-b" 'org-beamer-select-environment)
-
-(define-minor-mode org-beamer-mode
- "Special support for editing Org-mode files made to export to beamer."
- nil " Bm" nil)
-(when (fboundp 'font-lock-add-keywords)
- (font-lock-add-keywords
- 'org-mode
- '((":\\(B_[a-z]+\\|BMCOL\\):" 1 'org-beamer-tag prepend))
- 'prepent))
-
-(defun org-beamer-place-default-actions-for-lists ()
- "Find default overlay specifications in items, and move them.
-The need to be after the begin statement of the environment."
- (when org-beamer-export-is-beamer-p
- (let (dovl)
- (goto-char (point-min))
- (while (re-search-forward
- "^[ \t]*\\\\begin{\\(itemize\\|enumerate\\|description\\)}[ \t\n]*\\\\item\\>\\( ?\\(<[^<>\n]*>\\|\\[[^][\n*]\\]\\)\\)?[ \t]*\\S-" nil t)
- (if (setq dovl (cdr (assoc "BEAMER_dovl"
- (get-text-property (match-end 0)
- 'org-props))))
- (save-excursion
- (goto-char (1+ (match-end 1)))
- (insert dovl)))))))
-
-(defun org-beamer-amend-header ()
- "Add `org-beamer-header-extra' to the LaTeX header.
-If the file contains the string BEAMER-HEADER-EXTRA-HERE on a line
-by itself, it will be replaced with `org-beamer-header-extra'. If not,
-the value will be inserted right after the documentclass statement."
- (when (and org-beamer-export-is-beamer-p
- org-beamer-header-extra)
- (goto-char (point-min))
- (cond
- ((re-search-forward
- "^[ \t]*\\[?BEAMER-HEADER-EXTRA\\(-HERE\\)?\\]?[ \t]*$" nil t)
- (replace-match org-beamer-header-extra t t)
- (or (bolp) (insert "\n")))
- ((re-search-forward "^[ \t]*\\\\begin{document}" nil t)
- (beginning-of-line 1)
- (insert org-beamer-header-extra)
- (or (bolp) (insert "\n"))))))
-
-(defcustom org-beamer-fragile-re "^[ \t]*\\\\begin{\\(verbatim\\|lstlisting\\)}"
- "If this regexp matches in a frame, the frame is marked as fragile."
- :group 'org-beamer
- :type 'regexp)
-
-(defface org-beamer-tag '((t (:box (:line-width 1 :color grey40))))
- "The special face for beamer tags."
- :group 'org-beamer)
-
-
-;; Functions to initialize and post-process
-;; These fuctions will be hooked into various places in the export process
-
-(defun org-beamer-initialize-open-trackers ()
- "Reset variables that track if certain environments are open during export."
- (setq org-beamer-columns-open nil)
- (setq org-beamer-column-open nil)
- (setq org-beamer-inside-frame-at-level nil)
- (setq org-beamer-export-is-beamer-p nil))
-
-(defun org-beamer-after-initial-vars ()
- "Find special settings for beamer and store them.
-The effect is that these values will be accessible during export."
- ;; First verify that we are exporting using the beamer class
- (setq org-beamer-export-is-beamer-p
- (string-match "\\\\documentclass\\(\\[[^][]*?\\]\\)?{beamer}"
- org-export-latex-header))
- (when org-beamer-export-is-beamer-p
- ;; Find the frame level
- (setq org-beamer-frame-level-now
- (or (and (org-region-active-p)
- (save-excursion
- (goto-char (region-beginning))
- (and (looking-at org-complex-heading-regexp)
- (org-entry-get nil "BEAMER_FRAME_LEVEL" 'selective))))
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (and (re-search-forward
- "^#\\+BEAMER_FRAME_LEVEL:[ \t]*\\(.*?\\)[ \t]*$" nil t)
- (match-string 1))))
- (plist-get org-export-latex-options-plist :beamer-frame-level)
- org-beamer-frame-level))
- ;; Normalize the value so that the functions can trust the value
- (cond
- ((not org-beamer-frame-level-now)
- (setq org-beamer-frame-level-now nil))
- ((stringp org-beamer-frame-level-now)
- (setq org-beamer-frame-level-now
- (string-to-number org-beamer-frame-level-now))))
- ;; Find the header additons, most likely theme commands
- (setq org-beamer-header-extra
- (or (and (org-region-active-p)
- (save-excursion
- (goto-char (region-beginning))
- (and (looking-at org-complex-heading-regexp)
- (org-entry-get nil "BEAMER_HEADER_EXTRA"
- 'selective))))
- (save-excursion
- (save-restriction
- (widen)
- (let ((txt ""))
- (goto-char (point-min))
- (while (re-search-forward
- "^#\\+BEAMER_HEADER_EXTRA:[ \t]*\\(.*?\\)[ \t]*$"
- nil t)
- (setq txt (concat txt "\n" (match-string 1))))
- (if (> (length txt) 0) (substring txt 1)))))
- (plist-get org-export-latex-options-plist
- :beamer-header-extra)))
- (let ((inhibit-read-only t)
- (case-fold-search nil)
- props)
- (org-unmodified
- (remove-text-properties (point-min) (point-max) '(org-props nil))
- (org-map-entries
- '(progn
- (setq props (org-entry-properties nil 'standard))
- (if (and (not (assoc "BEAMER_env" props))
- (looking-at ".*?:B_\\(note\\(NH\\)?\\):"))
- (push (cons "BEAMER_env" (match-string 1)) props))
- (put-text-property (point-at-bol) (point-at-eol) 'org-props props)))
- (setq org-export-latex-options-plist
- (plist-put org-export-latex-options-plist :tags nil))))))
-
-(defun org-beamer-auto-fragile-frames ()
- "Mark any frames containing verbatim environments as fragile.
-This function will run in the final LaTeX document."
- (when org-beamer-export-is-beamer-p
- (let (opts)
- (goto-char (point-min))
- ;; Find something that might be fragile
- (while (re-search-forward org-beamer-fragile-re nil t)
- (save-excursion
- ;; Are we inside a frame here?
- (when (and (re-search-backward "^[ \t]*\\\\\\(begin\\|end\\){frame}"
- nil t)
- (equal (match-string 1) "begin"))
- ;; yes, inside a frame, make sure "fragile" is one of the options
- (goto-char (match-end 0))
- (if (not (looking-at "\\[.*?\\]"))
- (insert "[fragile]")
- (setq opts (substring (match-string 0) 1 -1))
- (delete-region (match-beginning 0) (match-end 0))
- (setq opts (org-split-string opts ","))
- (add-to-list 'opts "fragile")
- (insert "[" (mapconcat 'identity opts ",") "]"))))))))
-
-(defcustom org-beamer-outline-frame-title "Outline"
- "Default title of a frame containing an outline."
- :group 'org-beamer
- :type '(string :tag "Outline frame title")
-)
-
-(defcustom org-beamer-outline-frame-options nil
- "Outline frame options appended after \\begin{frame}.
-You might want to put e.g. [allowframebreaks=0.9] here. Remember to
-include square brackets."
- :group 'org-beamer
- :type '(string :tag "Outline frame options")
-)
-
-(defun org-beamer-fix-toc ()
- "Fix the table of contents by removing the vspace line."
- (when org-beamer-export-is-beamer-p
- (save-excursion
- (goto-char (point-min))
- (when (re-search-forward "\\(\\\\setcounter{tocdepth.*\n\\\\tableofcontents.*\n\\)\\(\\\\vspace\\*.*\\)"
- nil t)
- (replace-match
- (concat "\\\\begin{frame}" org-beamer-outline-frame-options
- "\n\\\\frametitle{"
- org-beamer-outline-frame-title
- "}\n\\1\\\\end{frame}")
- t nil)))))
-
-(defun org-beamer-property-changed (property value)
- "Track the BEAMER_env property with tags."
- (cond
- ((equal property "BEAMER_env")
- (save-excursion
- (org-back-to-heading t)
- (let ((tags (org-get-tags)))
- (setq tags (delq nil (mapcar (lambda (x)
- (if (string-match "^B_" x) nil x))
- tags)))
- (org-set-tags-to tags))
- (when (and value (stringp value) (string-match "\\S-" value))
- (org-toggle-tag (concat "B_" value) 'on))))
- ((equal property "BEAMER_col")
- (org-toggle-tag "BMCOL" (if (and value (string-match "\\S-" value))
- 'on 'off)))))
-
-(defun org-beamer-select-beamer-code ()
- "Take code marked for BEAMER and turn it into marked for LaTeX."
- (when org-beamer-export-is-beamer-p
- (goto-char (point-min))
- (while (re-search-forward
- "^\\([ \]*#\\+\\(begin_\\|end_\\)?\\)\\(beamer\\)\\>" nil t)
- (replace-match "\\1latex"))))
-
-;; OK, hook all these functions into appropriate places
-(add-hook 'org-export-first-hook
- 'org-beamer-initialize-open-trackers)
-(add-hook 'org-property-changed-functions
- 'org-beamer-property-changed)
-(add-hook 'org-export-latex-after-initial-vars-hook
- 'org-beamer-after-initial-vars)
-(add-hook 'org-export-latex-final-hook
- 'org-beamer-place-default-actions-for-lists)
-(add-hook 'org-export-latex-final-hook
- 'org-beamer-auto-fragile-frames)
-(add-hook 'org-export-latex-final-hook
- 'org-beamer-fix-toc)
-(add-hook 'org-export-latex-final-hook
- 'org-beamer-amend-header)
-(add-hook 'org-export-preprocess-before-selecting-backend-code-hook
- 'org-beamer-select-beamer-code)
-
-(defun org-insert-beamer-options-template (kind)
- "Insert a settings template, to make sure users do this right."
- (interactive (progn
- (message "Current [s]ubtree or [g]lobal?")
- (if (equal (read-char-exclusive) ?g)
- (list 'global)
- (list 'subtree))))
- (if (eq kind 'subtree)
- (progn
- (org-back-to-heading t)
- (org-reveal)
- (org-entry-put nil "LaTeX_CLASS" "beamer")
- (org-entry-put nil "LaTeX_CLASS_OPTIONS" "[presentation]")
- (org-entry-put nil "EXPORT_FILE_NAME" "presentation.pdf")
- (org-entry-put nil "BEAMER_FRAME_LEVEL" (number-to-string
- org-beamer-frame-level))
- (when org-beamer-themes
- (org-entry-put nil "BEAMER_HEADER_EXTRA" org-beamer-themes))
- (when org-beamer-column-view-format
- (org-entry-put nil "COLUMNS" org-beamer-column-view-format))
- (org-entry-put nil "BEAMER_col_ALL" "0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC"))
- (insert "#+LaTeX_CLASS: beamer\n")
- (insert "#+LaTeX_CLASS_OPTIONS: [presentation]\n")
- (insert (format "#+BEAMER_FRAME_LEVEL: %d\n" org-beamer-frame-level) "\n")
- (when org-beamer-themes
- (insert "#+BEAMER_HEADER_EXTRA: " org-beamer-themes "\n"))
- (when org-beamer-column-view-format
- (insert "#+COLUMNS: " org-beamer-column-view-format "\n"))
- (insert "#+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC\n")))
-
-
-(defun org-beamer-allowed-property-values (property)
- "Supply allowed values for BEAMER properties."
- (cond
- ((and (equal property "BEAMER_env")
- (not (org-entry-get nil (concat property "_ALL") 'inherit)))
- ;; If no allowed values for BEAMER_env have been defined,
- ;; supply all defined environments
- (mapcar 'car (append org-beamer-environments-extra
- org-beamer-environments-default)))
- ((and (equal property "BEAMER_col")
- (not (org-entry-get nil (concat property "_ALL") 'inherit)))
- ;; If no allowed values for BEAMER_col have been defined,
- ;; supply some
- '("0.1" "0.2" "0.3" "0.4" "0.5" "0.6" "0.7" "0.8" "0.9" "" ":ETC"))
- (t nil)))
-
-(add-hook 'org-property-allowed-value-functions
- 'org-beamer-allowed-property-values)
-
-(provide 'org-beamer)
-
-;; arch-tag: 68bac91a-a946-43a3-8173-a9269306f67c
-
-;;; org-beamer.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-beamer.elc b/.emacs.d/org-7.4/lisp/org-beamer.elc
deleted file mode 100644
index 9a78f15..0000000
--- a/.emacs.d/org-7.4/lisp/org-beamer.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-bibtex.el b/.emacs.d/org-7.4/lisp/org-bibtex.el
deleted file mode 100644
index e34e157..0000000
--- a/.emacs.d/org-7.4/lisp/org-bibtex.el
+++ /dev/null
@@ -1,205 +0,0 @@
-;;; org-bibtex.el --- Org links to BibTeX entries
-;;
-;; Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-;;
-;; Author: Bastien Guerry <bzg at altern dot org>
-;; Carsten Dominik <carsten dot dominik at gmail dot com>
-;; Keywords: org, wp, remember
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;
-;;; Commentary:
-;;
-;; This file implements links to database entries in BibTeX files.
-;; Instead of defining a special link prefix, it uses the normal file
-;; links combined with a custom search mechanism to find entries
-;; by reference key. And it constructs a nice description tag for
-;; the link that contains the author name, the year and a short title.
-;;
-;; It also stores detailed information about the entry so that
-;; remember templates can access and enter this information easily.
-;;
-;; The available properties for each entry are listed here:
-;;
-;; :author :publisher :volume :pages
-;; :editor :url :number :journal
-;; :title :year :series :address
-;; :booktitle :month :annote :abstract
-;; :key :btype
-;;
-;; Here is an example of a remember template that use some of this
-;; information (:author :year :title :journal :pages):
-;;
-;; (setq org-remember-templates
-;; '((?b "* READ %?\n\n%a\n\n%:author (%:year): %:title\n \
-;; In %:journal, %:pages.")))
-;;
-;; Let's say you want to remember this BibTeX entry:
-;;
-;; @Article{dolev83,
-;; author = {Danny Dolev and Andrew C. Yao},
-;; title = {On the security of public-key protocols},
-;; journal = {IEEE Transaction on Information Theory},
-;; year = 1983,
-;; volume = 2,
-;; number = 29,
-;; pages = {198--208},
-;; month = {Mars}
-;; }
-;;
-;; M-x `org-remember' on this entry will produce this buffer:
-;;
-;; =====================================================================
-;; * READ <== [point here]
-;;
-;; [[file:/file.bib::dolev83][Dolev & Yao 1983: security of public key protocols]]
-;;
-;; Danny Dolev and Andrew C. Yao (1983): On the security of public-key protocols
-;; In IEEE Transaction on Information Theory, 198--208.
-;; =====================================================================
-;;
-;;; History:
-;;
-;; The link creation part has been part of Org-mode for a long time.
-;;
-;; Creating better remember template information was inspired by a request
-;; of Austin Frank: http://article.gmane.org/gmane.emacs.orgmode/4112
-;; and then implemented by Bastien Guerry.
-;;
-;; Org-mode loads this module by default - if this is not what you want,
-;; configure the variable `org-modules'.
-
-;;; Code:
-
-(require 'org)
-
-(defvar description nil) ; dynamically scoped from org.el
-
-(declare-function bibtex-beginning-of-entry "bibtex" ())
-(declare-function bibtex-generate-autokey "bibtex" ())
-(declare-function bibtex-parse-entry "bibtex" (&optional content))
-(declare-function bibtex-url "bibtex" (&optional pos no-browse))
-
-(org-add-link-type "bibtex" 'org-bibtex-open)
-(add-hook 'org-store-link-functions 'org-bibtex-store-link)
-
-;; (defun org-bibtex-publish (path)
-;; "Build the description of the BibTeX entry for publishing."
-;; (let* ((search (when (string-match "::\\(.+\\)\\'" path)
-;; (match-string 1 path)))
-;; (path (substring path 0 (match-beginning 0)))
-;; key)
-;; (with-temp-buffer
-;; (org-open-file path t nil search)
-;; (setq key (org-create-file-search-functions)))
-;; (or description key)))
-
-(defun org-bibtex-open (path)
- "Visit the bibliography entry on PATH."
- (let* ((search (when (string-match "::\\(.+\\)\\'" path)
- (match-string 1 path)))
- (path (substring path 0 (match-beginning 0))))
- (org-open-file path t nil search)))
-
-(defun org-bibtex-store-link ()
- "Store a link to a BibTeX entry."
- (when (eq major-mode 'bibtex-mode)
- (let* ((search (org-create-file-search-in-bibtex))
- (link (concat "file:" (abbreviate-file-name buffer-file-name)
- "::" search))
- (entry (mapcar ; repair strings enclosed in "..." or {...}
- (lambda(c)
- (if (string-match
- "^\\(?:{\\|\"\\)\\(.*\\)\\(?:}\\|\"\\)$" (cdr c))
- (cons (car c) (match-string 1 (cdr c))) c))
- (save-excursion
- (bibtex-beginning-of-entry)
- (bibtex-parse-entry)))))
- (org-store-link-props
- :key (cdr (assoc "=key=" entry))
- :author (or (cdr (assoc "author" entry)) "[no author]")
- :editor (or (cdr (assoc "editor" entry)) "[no editor]")
- :title (or (cdr (assoc "title" entry)) "[no title]")
- :booktitle (or (cdr (assoc "booktitle" entry)) "[no booktitle]")
- :journal (or (cdr (assoc "journal" entry)) "[no journal]")
- :publisher (or (cdr (assoc "publisher" entry)) "[no publisher]")
- :pages (or (cdr (assoc "pages" entry)) "[no pages]")
- :url (or (cdr (assoc "url" entry)) "[no url]")
- :year (or (cdr (assoc "year" entry)) "[no year]")
- :month (or (cdr (assoc "month" entry)) "[no month]")
- :address (or (cdr (assoc "address" entry)) "[no address]")
- :volume (or (cdr (assoc "volume" entry)) "[no volume]")
- :number (or (cdr (assoc "number" entry)) "[no number]")
- :annote (or (cdr (assoc "annote" entry)) "[no annotation]")
- :series (or (cdr (assoc "series" entry)) "[no series]")
- :abstract (or (cdr (assoc "abstract" entry)) "[no abstract]")
- :btype (or (cdr (assoc "=type=" entry)) "[no type]")
- :type "bibtex"
- :link link
- :description description))))
-
-(defun org-create-file-search-in-bibtex ()
- "Create the search string and description for a BibTeX database entry."
- ;; Make a good description for this entry, using names, year and the title
- ;; Put it into the `description' variable which is dynamically scoped.
- (let ((bibtex-autokey-names 1)
- (bibtex-autokey-names-stretch 1)
- (bibtex-autokey-name-case-convert-function 'identity)
- (bibtex-autokey-name-separator " & ")
- (bibtex-autokey-additional-names " et al.")
- (bibtex-autokey-year-length 4)
- (bibtex-autokey-name-year-separator " ")
- (bibtex-autokey-titlewords 3)
- (bibtex-autokey-titleword-separator " ")
- (bibtex-autokey-titleword-case-convert-function 'identity)
- (bibtex-autokey-titleword-length 'infty)
- (bibtex-autokey-year-title-separator ": "))
- (setq description (bibtex-generate-autokey)))
- ;; Now parse the entry, get the key and return it.
- (save-excursion
- (bibtex-beginning-of-entry)
- (cdr (assoc "=key=" (bibtex-parse-entry)))))
-
-(defun org-execute-file-search-in-bibtex (s)
- "Find the link search string S as a key for a database entry."
- (when (eq major-mode 'bibtex-mode)
- ;; Yes, we want to do the search in this file.
- ;; We construct a regexp that searches for "@entrytype{" followed by the key
- (goto-char (point-min))
- (and (re-search-forward (concat "@[a-zA-Z]+[ \t\n]*{[ \t\n]*"
- (regexp-quote s) "[ \t\n]*,") nil t)
- (goto-char (match-beginning 0)))
- (if (and (match-beginning 0) (equal current-prefix-arg '(16)))
- ;; Use double prefix to indicate that any web link should be browsed
- (let ((b (current-buffer)) (p (point)))
- ;; Restore the window configuration because we just use the web link
- (set-window-configuration org-window-config-before-follow-link)
- (with-current-buffer b
- (goto-char p)
- (bibtex-url)))
- (recenter 0)) ; Move entry start to beginning of window
- ;; return t to indicate that the search is done.
- t))
-
-;; Finally add the link search function to the right hook.
-(add-hook 'org-execute-file-search-functions 'org-execute-file-search-in-bibtex)
-
-(provide 'org-bibtex)
-
-;; arch-tag: 83987d5a-01b8-41c7-85bc-77700f1285f5
-
-;;; org-bibtex.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-bibtex.elc b/.emacs.d/org-7.4/lisp/org-bibtex.elc
deleted file mode 100644
index c12de93..0000000
--- a/.emacs.d/org-7.4/lisp/org-bibtex.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-capture.el b/.emacs.d/org-7.4/lisp/org-capture.el
deleted file mode 100644
index 5c7b038..0000000
--- a/.emacs.d/org-7.4/lisp/org-capture.el
+++ /dev/null
@@ -1,1391 +0,0 @@
-;;; org-capture.el --- Fast note taking in Org-mode
-
-;; Copyright (C) 2010 Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file contains an alternative implementation of the same functionality
-;; that is also provided by org-remember.el. The implementation is more
-;; streamlined, can produce more target types (e.g. plain list items or
-;; table lines). Also, it does not use a temporary buffer for editing
-;; the captured entry - instead it uses an indirect buffer that visits
-;; the new entry already in the target buffer (this was an idea by Samuel
-;; Wales). John Wiegley's excellent `remember.el' is not needed for this
-;; implementation, even though we borrow heavily from its ideas.
-
-;; This implementation heavily draws on ideas by James TD Smith and
-;; Samuel Wales, and, of cause, uses John Wiegley's remember.el as inspiration.
-
-;;; TODO
-
-;; - find a clever way to not always insert an annotation maybe a
-;; predicate function that can check for conditions for %a to be
-;; used. This could be one of the properties.
-
-;; - Should there be plist members that arrange for properties to be
-;; asked for, like James proposed in his RFC?
-
-;;; Code:
-
-(eval-when-compile
- (require 'cl))
-(require 'org)
-(require 'org-mks)
-
-(declare-function org-datetree-find-date-create "org-datetree"
- (DATE &optional KEEP-RESTRICTION))
-(declare-function org-table-get-specials "org-table" ())
-(declare-function org-table-goto-line "org-table" (N))
-(defvar org-remember-default-headline)
-(defvar org-remember-templates)
-(defvar org-table-hlines)
-
-(defvar org-capture-clock-was-started nil
- "Internal flag, noting if the clock was started.")
-
-(defvar org-capture-last-stored-marker (make-marker)
- "Marker pointing to the entry most recently stored with `org-capture'.")
-
-;; The following variable is scoped dynamically by org-protocol
-;; to indicate that the link properties have already been stored
-(defvar org-capture-link-is-already-stored nil)
-
-(defgroup org-capture nil
- "Options concerning capturing new entries."
- :tag "Org Capture"
- :group 'org)
-
-(defcustom org-capture-templates nil
- "Templates for the creation of new entries.
-
-Each entry is a list with the following items:
-
-keys The keys that will select the template, as a string, characters
- only, for example \"a\" for a template to be selected with a
- single key, or \"bt\" for selection with two keys. When using
- several keys, keys using the same prefix key must be together
- in the list and preceded by a 2-element entry explaining the
- prefix key, for example
-
- (\"b\" \"Templates for marking stuff to buy\")
-
- The \"C\" key is used by default for quick access to the
- customization of the template variable. But if you want to use
- that key for a template, you can.
-
-description A short string describing the template, will be shown during
- selection.
-
-type The type of entry. Valid types are:
- entry an Org-mode node, with a headline. Will be
- filed as the child of the target entry or as
- a top-level entry.
- item a plain list item, will be placed in the
- first plain list at the target
- location.
- checkitem a checkbox item. This differs from the
- plain list item only is so far as it uses a
- different default template.
- table-line a new line in the first table at target location.
- plain text to be inserted as it is.
-
-target Specification of where the captured item should be placed.
- In Org-mode files, targets usually define a node. Entries will
- become children of this node, other types will be added to the
- table or list in the body of this node.
-
- Valid values are:
-
- (file \"path/to/file\")
- Text will be placed at the beginning or end of that file
-
- (id \"id of existing org entry\")
- File as child of this entry, or in the body of the entry
-
- (file+headline \"path/to/file\" \"node headline\")
- Fast configuration if the target heading is unique in the file
-
- (file+olp \"path/to/file\" \"Level 1 heading\" \"Level 2\" ...)
- For non-unique headings, the full path is safer
-
- (file+regexp \"path/to/file\" \"regexp to find location\")
- File to the entry matching regexp
-
- (file+datetree \"path/to/file\")
- Will create a heading in a date tree for today's date
-
- (file+datetree+prompt \"path/to/file\")
- Will create a heading in a date tree, promts for date
-
- (file+function \"path/to/file\" function-finding-location)
- A function to find the right location in the file
-
- (clock)
- File to the entry that is currently being clocked
-
- (function function-finding-location)
- Most general way, write your own function to find both
- file and location
-
-template The template for creating the capture item. If you leave this
- empty, an appropriate default template will be used. See below
- for more details. Instead of a string, this may also be one of
-
- (file \"/path/to/template-file\")
- (function function-returning-the-template)
-
- in order to get a template from a file, or dynamically
- from a function.
-
-The rest of the entry is a property list of additional options. Recognized
-properties are:
-
- :prepend Normally newly captured information will be appended at
- the target location (last child, last table line,
- last list item...). Setting this property will
- change that.
-
- :immediate-finish When set, do not offer to edit the information, just
- file it away immediately. This makes sense if the
- template only needs information that can be added
- automatically.
-
- :empty-lines Set this to the number of lines the should be inserted
- before and after the new item. Default 0, only common
- other value is 1.
-
- :clock-in Start the clock in this item.
-
- :clock-resume Start the interrupted clock when finishing the capture.
-
- :unnarrowed Do not narrow the target buffer, simply show the
- full buffer. Default is to narrow it so that you
- only see the new stuff.
-
- :table-line-pos Specification of the location in the table where the
- new line should be inserted. It looks like \"II-3\"
- which means that the new line should become the third
- line before the second horizontal separator line.
-
- :kill-buffer If the target file was not yet visited by a buffer when
- capture was invoked, kill the buffer again after capture
- is finalized.
-
-The template defines the text to be inserted. Often this is an org-mode
-entry (so the first line should start with a star) that will be filed as a
-child of the target headline. It can also be freely formatted text.
-Furthermore, the following %-escapes will be replaced with content:
-
- %^{prompt} prompt the user for a string and replace this sequence with it.
- A default value and a completion table ca be specified like this:
- %^{prompt|default|completion2|completion3|...}
- %t time stamp, date only
- %T time stamp with date and time
- %u, %U like the above, but inactive time stamps
- %^t like %t, but prompt for date. Similarly %^T, %^u, %^U.
- You may define a prompt like %^{Please specify birthday
- %n user name (taken from `user-full-name')
- %a annotation, normally the link created with `org-store-link'
- %i initial content, copied from the active region. If %i is
- indented, the entire inserted text will be indented as well.
- %c current kill ring head
- %x content of the X clipboard
- %^C interactive selection of which kill or clip to use
- %^L like %^C, but insert as link
- %k title of currently clocked task
- %K link to currently clocked task
- %^g prompt for tags, with completion on tags in target file
- %^G prompt for tags, with completion on all tags in all agenda files
- %^{prop}p prompt the user for a value for property `prop'
- %:keyword specific information for certain link types, see below
- %[pathname] insert the contents of the file given by `pathname'
- %(sexp) evaluate elisp `(sexp)' and replace with the result
-
- %? After completing the template, position cursor here.
-
-Apart from these general escapes, you can access information specific to the
-link type that is created. For example, calling `org-capture' in emails
-or gnus will record the author and the subject of the message, which you
-can access with \"%:from\" and \"%:subject\", respectively. Here is a
-complete list of what is recorded for each link type.
-
-Link type | Available information
-------------------------+------------------------------------------------------
-bbdb | %:type %:name %:company
-vm, wl, mh, mew, rmail | %:type %:subject %:message-id
- | %:from %:fromname %:fromaddress
- | %:to %:toname %:toaddress
- | %:fromto (either \"to NAME\" or \"from NAME\")
- | %:date
- | %:date-timestamp (as active timestamp)
- | %:date-timestamp-inactive (as inactive timestamp)
-gnus | %:group, for messages also all email fields
-w3, w3m | %:type %:url
-info | %:type %:file %:node
-calendar | %:type %:date"
- :group 'org-capture
- :type
- '(repeat
- (choice :value ("" "" entry (file "~/org/notes.org") "")
- (list :tag "Multikey description"
- (string :tag "Keys ")
- (string :tag "Description"))
- (list :tag "Template entry"
- (string :tag "Keys ")
- (string :tag "Description ")
- (choice :tag "Capture Type " :value entry
- (const :tag "Org entry" entry)
- (const :tag "Plain list item" item)
- (const :tag "Checkbox item" checkitem)
- (const :tag "Plain text" plain)
- (const :tag "Table line" table-line))
- (choice :tag "Target location"
- (list :tag "File"
- (const :format "" file)
- (file :tag " File"))
- (list :tag "ID"
- (const :format "" id)
- (string :tag " ID"))
- (list :tag "File & Headline"
- (const :format "" file+headline)
- (file :tag " File ")
- (string :tag " Headline"))
- (list :tag "File & Outline path"
- (const :format "" file+olp)
- (file :tag " File ")
- (repeat :tag "Outline path" :inline t
- (string :tag "Headline")))
- (list :tag "File & Regexp"
- (const :format "" file+regexp)
- (file :tag " File ")
- (regexp :tag " Regexp"))
- (list :tag "File & Date tree"
- (const :format "" file+datetree)
- (file :tag " File"))
- (list :tag "File & Date tree, prompt for date"
- (const :format "" file+datetree+prompt)
- (file :tag " File"))
- (list :tag "File & function"
- (const :format "" file+function)
- (file :tag " File ")
- (sexp :tag " Function"))
- (list :tag "Current clocking task"
- (const :format "" clock))
- (list :tag "Function"
- (const :format "" function)
- (sexp :tag " Function")))
- (choice :tag "Template"
- (string)
- (list :tag "File"
- (const :format "" file)
- (file :tag "Template file"))
- (list :tag "Function"
- (const :format "" function)
- (function :tag "Template function")))
- (plist :inline t
- ;; Give the most common options as checkboxes
- :options (((const :format "%v " :prepend) (const t))
- ((const :format "%v " :immediate-finish) (const t))
- ((const :format "%v " :empty-lines) (const 1))
- ((const :format "%v " :clock-in) (const t))
- ((const :format "%v " :clock-resume) (const t))
- ((const :format "%v " :unnarrowed) (const t))
- ((const :format "%v " :kill-buffer) (const t))))))))
-
-(defcustom org-capture-before-finalize-hook nil
- "Hook that is run right before a remember process is finalized.
-The remember buffer is still current when this hook runs."
- :group 'org-capture
- :type 'hook)
-
-(defcustom org-capture-after-finalize-hook nil
- "Hook that is run right after a capture process is finalized.
- Suitable for window cleanup"
- :group 'org-capture
- :type 'hook)
-
-;;; The property list for keeping information about the capture process
-
-(defvar org-capture-plist nil
- "Plist for the current capture process, global, to avoid having to pass it.")
-(defvar org-capture-current-plist nil
- "Local variable holding the plist in a capture buffer.
-This is used to store the plist for use when finishing a capture process.
-Another such process might have changed the global variable by then.")
-
-(defun org-capture-put (&rest stuff)
- (while stuff
- (setq org-capture-plist (plist-put org-capture-plist
- (pop stuff) (pop stuff)))))
-(defun org-capture-get (prop &optional local)
- (plist-get (if local org-capture-current-plist org-capture-plist) prop))
-
-(defun org-capture-member (prop)
- (plist-get org-capture-plist prop))
-
-;;; The minor mode
-
-(defvar org-capture-mode-map (make-sparse-keymap)
- "Keymap for `org-capture-mode', a minor mode.
-Use this map to set additional keybindings for when Org-mode is used
-for a Remember buffer.")
-
-(defvar org-capture-mode-hook nil
- "Hook for the minor `org-capture-mode'.")
-
-(define-minor-mode org-capture-mode
- "Minor mode for special key bindings in a remember buffer."
- nil " Rem" org-capture-mode-map
- (org-set-local
- 'header-line-format
- "Capture buffer. Finish `C-c C-c', refile `C-c C-w', abort `C-c C-k'.")
- (run-hooks 'org-capture-mode-hook))
-(define-key org-capture-mode-map "\C-c\C-c" 'org-capture-finalize)
-(define-key org-capture-mode-map "\C-c\C-k" 'org-capture-kill)
-(define-key org-capture-mode-map "\C-c\C-w" 'org-capture-refile)
-
-;;; The main commands
-
-;;;###autoload
-(defun org-capture (&optional goto keys)
- "Capture something.
-\\<org-capture-mode-map>
-This will let you select a template from `org-capture-templates', and then
-file the newly captured information. The text is immediately inserted
-at the target location, and an indirect buffer is shown where you can
-edit it. Pressing \\[org-capture-finalize] brings you back to the previous state
-of Emacs, so that you can continue your work.
-
-When called interactively with a \\[universal-argument] prefix argument GOTO, don't capture
-anything, just go to the file/headline where the selected template
-stores its notes. With a double prefix argument \
-\\[universal-argument] \\[universal-argument], go to the last note
-stored.
-
-When called with a `C-0' (zero) prefix, insert a template at point.
-
-Lisp programs can set KEYS to a string associated with a template in
-`org-capture-templates'. In this case, interactive selection will be
-bypassed."
- (interactive "P")
- (cond
- ((equal goto '(4)) (org-capture-goto-target))
- ((equal goto '(16)) (org-capture-goto-last-stored))
- (t
- ;; FIXME: Are these needed?
- (let* ((orig-buf (current-buffer))
- (annotation (if (and (boundp 'org-capture-link-is-already-stored)
- org-capture-link-is-already-stored)
- (plist-get org-store-link-plist :annotation)
- (org-store-link nil)))
- (initial (and (org-region-active-p)
- (buffer-substring (point) (mark))))
- (entry (org-capture-select-template keys)))
- (when (stringp initial)
- (remove-text-properties 0 (length initial) '(read-only t) initial))
- (when (stringp annotation)
- (remove-text-properties 0 (length annotation)
- '(read-only t) annotation))
- (cond
- ((equal entry "C")
- (customize-variable 'org-capture-templates))
- ((equal entry "q")
- (error "Abort"))
- (t
- (org-capture-set-plist entry)
- (org-capture-get-template)
- (org-capture-put :original-buffer orig-buf :annotation annotation
- :initial initial)
- (org-capture-put :default-time
- (or org-overriding-default-time
- (org-current-time)))
- (org-capture-set-target-location)
- (condition-case error
- (org-capture-put :template (org-capture-fill-template))
- ((error quit)
- (if (get-buffer "*Capture*") (kill-buffer "*Capture*"))
- (error "Capture abort: %s" error)))
-
- (if (equal goto 0)
- ;;insert at point
- (org-capture-insert-template-here)
- (condition-case error
- (org-capture-place-template)
- ((error quit)
- (if (and (buffer-base-buffer (current-buffer))
- (string-match "\\`CAPTURE-" (buffer-name)))
- (kill-buffer (current-buffer)))
- (set-window-configuration (org-capture-get :return-to-wconf))
- (error "Capture template `%s': %s"
- (org-capture-get :key)
- (nth 1 error))))
- (if (org-capture-get :immediate-finish)
- (org-capture-finalize)
- (if (and (org-mode-p)
- (org-capture-get :clock-in))
- (condition-case nil
- (progn
- (if (org-clock-is-active)
- (org-capture-put :interrupted-clock
- (copy-marker org-clock-marker)))
- (org-clock-in)
- (org-set-local 'org-capture-clock-was-started t))
- (error
- "Could not start the clock in this capture buffer")))))))))))
-
-
-(defun org-capture-get-template ()
- "Get the template from a file or a function if necessary."
- (let ((txt (org-capture-get :template)) file)
- (cond
- ((and (listp txt) (eq (car txt) 'file))
- (if (file-exists-p
- (setq file (expand-file-name (nth 1 txt) org-directory)))
- (setq txt (org-file-contents file))
- (setq txt (format "* Template file %s not found" (nth 1 txt)))))
- ((and (listp txt) (eq (car txt) 'function))
- (if (fboundp (nth 1 txt))
- (setq txt (funcall (nth 1 txt)))
- (setq txt (format "* Template function %s not found" (nth 1 txt)))))
- ((not txt) (setq txt ""))
- ((stringp txt))
- (t (setq txt "* Invalid capture template")))
- (org-capture-put :template txt)))
-
-(defun org-capture-finalize (&optional stay-with-capture)
- "Finalize the capture process.
-With prefix argument STAY-WITH-CAPTURE, jump to the location of the
-captured item after finalizing."
- (interactive "P")
- (unless (and org-capture-mode
- (buffer-base-buffer (current-buffer)))
- (error "This does not seem to be a capture buffer for Org-mode"))
-
- ;; Did we start the clock in this capture buffer?
- (when (and org-capture-clock-was-started
- org-clock-marker (marker-buffer org-clock-marker)
- (equal (marker-buffer org-clock-marker) (buffer-base-buffer))
- (> org-clock-marker (point-min))
- (< org-clock-marker (point-max)))
- ;; Looks like the clock we started is still running. Clock out.
- (let (org-log-note-clock-out) (org-clock-out))
- (when (and (org-capture-get :clock-resume 'local)
- (markerp (org-capture-get :interrupted-clock 'local))
- (buffer-live-p (marker-buffer
- (org-capture-get :interrupted-clock 'local))))
- (let ((clock-in-task (org-capture-get :interrupted-clock 'local)))
- (org-with-point-at clock-in-task
- (org-clock-in)))
- (message "Interrupted clock has been resumed")))
-
- (let ((beg (point-min))
- (end (point-max))
- (abort-note nil))
- (widen)
-
- (if org-note-abort
- (let ((m1 (org-capture-get :begin-marker 'local))
- (m2 (org-capture-get :end-marker 'local)))
- (if (and m1 m2 (= m1 beg) (= m2 end))
- (progn
- (setq abort-note 'clean)
- (kill-region m1 m2))
- (setq abort-note 'dirty)))
-
- ;; Make sure that the empty lines after are correct
- (when (and (> (point-max) end) ; indeed, the buffer was still narrowed
- (member (org-capture-get :type 'local)
- '(entry item checkitem plain)))
- (save-excursion
- (goto-char end)
- (or (bolp) (newline))
- (org-capture-empty-lines-after
- (or (org-capture-get :empty-lines 'local) 0))))
- ;; Postprocessing: Update Statistics cookies, do the sorting
- (when (org-mode-p)
- (save-excursion
- (when (ignore-errors (org-back-to-heading))
- (org-update-parent-todo-statistics)
- (org-update-checkbox-count)))
- ;; FIXME Here we should do the sorting
- ;; If we have added a table line, maybe recompute?
- (when (and (eq (org-capture-get :type 'local) 'table-line)
- (org-at-table-p))
- (if (org-table-get-stored-formulas)
- (org-table-recalculate 'all) ;; FIXME: Should we iterate???
- (org-table-align)))
- )
- ;; Store this place as the last one where we stored something
- ;; Do the marking in the base buffer, so that it makes sense after
- ;; the indirect buffer has been killed.
- (org-capture-bookmark-last-stored-position)
-
- ;; Run the hook
- (run-hooks 'org-capture-before-finalize-hook)
- )
-
- ;; Kill the indirect buffer
- (save-buffer)
- (let ((return-wconf (org-capture-get :return-to-wconf 'local))
- (new-buffer (org-capture-get :new-buffer 'local))
- (kill-buffer (org-capture-get :kill-buffer 'local))
- (base-buffer (buffer-base-buffer (current-buffer))))
-
- ;; Kill the indiret buffer
- (kill-buffer (current-buffer))
-
- ;; Kill the target buffer if that is desired
- (when (and base-buffer new-buffer kill-buffer)
- (with-current-buffer base-buffer (save-buffer))
- (kill-buffer base-buffer))
-
- ;; Restore the window configuration before capture
- (set-window-configuration return-wconf))
-
- (run-hooks 'org-capture-after-finalize-hook)
- ;; Special cases
- (cond
- (abort-note
- (cond
- ((equal abort-note 'clean)
- (message "Capture process aborted and target buffer cleaned up"))
- ((equal abort-note 'dirty)
- (error "Capture process aborted, but target buffer could not be cleaned up correctly"))))
- (stay-with-capture
- (org-capture-goto-last-stored)))
- ;; Return if we did store something
- (not abort-note)))
-
-(defun org-capture-refile ()
- "Finalize the current capture and then refile the entry.
-Refiling is done from the base buffer, because the indirect buffer is then
-already gone. Any prefix argument will be passed to the refile comand."
- (interactive)
- (unless (eq (org-capture-get :type 'local) 'entry)
- (error
- "Refiling from a capture buffer makes only sense for `entry'-type templates"))
- (let ((pos (point))
- (base (buffer-base-buffer (current-buffer)))
- (org-refile-for-capture t))
- (org-capture-finalize)
- (save-window-excursion
- (with-current-buffer (or base (current-buffer))
- (save-excursion
- (save-restriction
- (widen)
- (goto-char pos)
- (call-interactively 'org-refile)))))))
-
-(defun org-capture-kill ()
- "Abort the current capture process."
- (interactive)
- ;; FIXME: This does not do the right thing, we need to remove the new stuff
- ;; By hand it is easy: undo, then kill the buffer
- (let ((org-note-abort t) (org-capture-before-finalize-hook nil))
- (org-capture-finalize)))
-
-(defun org-capture-goto-last-stored ()
- "Go to the location where the last remember note was stored."
- (interactive)
- (org-goto-marker-or-bmk org-capture-last-stored-marker
- "org-capture-last-stored")
- (message "This is the last note stored by a capture process"))
-
-;;; Supporting functions for handling the process
-
-(defun org-capture-set-target-location (&optional target)
- "Find target buffer and position and store then in the property list."
- (let ((target-entry-p t))
- (setq target (or target (org-capture-get :target)))
- (save-excursion
- (cond
- ((eq (car target) 'file)
- (set-buffer (org-capture-target-buffer (nth 1 target)))
- (setq target-entry-p nil))
-
- ((eq (car target) 'id)
- (let ((loc (org-id-find (nth 1 target))))
- (if (not loc)
- (error "Cannot find target ID \"%s\"" (nth 1 target))
- (set-buffer (org-capture-target-buffer (car loc)))
- (goto-char (cdr loc)))))
-
- ((eq (car target) 'file+headline)
- (set-buffer (org-capture-target-buffer (nth 1 target)))
- (let ((hd (nth 2 target)))
- (goto-char (point-min))
- (unless (org-mode-p)
- (error "Target buffer for file+headline should be in Org mode"))
- (if (re-search-forward
- (format org-complex-heading-regexp-format (regexp-quote hd))
- nil t)
- (goto-char (point-at-bol))
- (goto-char (point-max))
- (or (bolp) (insert "\n"))
- (insert "* " hd "\n")
- (beginning-of-line 0))))
-
- ((eq (car target) 'file+olp)
- (let ((m (org-find-olp (cdr target))))
- (set-buffer (marker-buffer m))
- (goto-char m)))
-
- ((eq (car target) 'file+regexp)
- (set-buffer (org-capture-target-buffer (nth 1 target)))
- (goto-char (point-min))
- (if (re-search-forward (nth 2 target) nil t)
- (progn
- (goto-char (if (org-capture-get :prepend)
- (match-beginning 0) (match-end 0)))
- (org-capture-put :exact-position (point))
- (setq target-entry-p (and (org-mode-p) (org-at-heading-p))))
- (error "No match for target regexp in file %s" (nth 1 target))))
-
- ((memq (car target) '(file+datetree file+datetree+prompt))
- (require 'org-datetree)
- (set-buffer (org-capture-target-buffer (nth 1 target)))
- ;; Make a date tree entry, with the current date (or yesterday,
- ;; if we are extending dates for a couple of hours)
- (org-datetree-find-date-create
- (calendar-gregorian-from-absolute
- (cond
-
- (org-overriding-default-time
- ;; use the overriding default time
- (time-to-days org-overriding-default-time))
-
- ((eq (car target) 'file+datetree+prompt)
- ;; prompt for date
- (time-to-days (org-read-date
- nil t nil "Date for tree entry:"
- (days-to-time (org-today)))))
- (t
- ;; current date, possible corrected for late night workers
- (org-today))))))
-
- ((eq (car target) 'file+function)
- (set-buffer (org-capture-target-buffer (nth 1 target)))
- (funcall (nth 2 target))
- (org-capture-put :exact-position (point))
- (setq target-entry-p (and (org-mode-p) (org-at-heading-p))))
-
- ((eq (car target) 'function)
- (funcall (nth 1 target))
- (org-capture-put :exact-position (point))
- (setq target-entry-p (and (org-mode-p) (org-at-heading-p))))
-
- ((eq (car target) 'clock)
- (if (and (markerp org-clock-hd-marker)
- (marker-buffer org-clock-hd-marker))
- (progn (set-buffer (marker-buffer org-clock-hd-marker))
- (goto-char org-clock-hd-marker))
- (error "No running clock that could be used as capture target")))
-
- (t (error "Invalid capture target specification")))
-
- (org-capture-put :buffer (current-buffer) :pos (point)
- :target-entry-p target-entry-p))))
-
-(defun org-capture-target-buffer (file)
- "Get a buffer for FILE."
- (setq file (or (org-string-nw-p file)
- org-default-notes-file
- (error "No notes file specified, and no default available")))
- (or (org-find-base-buffer-visiting file)
- (progn (org-capture-put :new-buffer t)
- (find-file-noselect (expand-file-name file org-directory)))))
-
-(defun org-capture-steal-local-variables (buffer)
- "Install Org-mode local variables."
- (mapc (lambda (v)
- (ignore-errors (org-set-local (car v) (cdr v))))
- (buffer-local-variables buffer)))
-
-(defun org-capture-place-template ()
- "Insert the template at the target location, and display the buffer."
- (org-capture-put :return-to-wconf (current-window-configuration))
- (delete-other-windows)
- (org-switch-to-buffer-other-window
- (org-capture-get-indirect-buffer (org-capture-get :buffer) "CAPTURE"))
- (widen)
- (show-all)
- (goto-char (org-capture-get :pos))
- (org-set-local 'org-capture-target-marker
- (move-marker (make-marker) (point)))
- (let* ((template (org-capture-get :template))
- (type (org-capture-get :type)))
- (case type
- ((nil entry) (org-capture-place-entry))
- (table-line (org-capture-place-table-line))
- (plain (org-capture-place-plain-text))
- (item (org-capture-place-item))
- (checkitem (org-capture-place-item))))
- (org-capture-mode 1)
- (org-set-local 'org-capture-current-plist org-capture-plist))
-
-(defun org-capture-place-entry ()
- "Place the template as a new Org entry."
- (let* ((txt (org-capture-get :template))
- (reversed (org-capture-get :prepend))
- (target-entry-p (org-capture-get :target-entry-p))
- level beg end file)
-
- (cond
- ((org-capture-get :exact-position)
- (goto-char (org-capture-get :exact-position)))
- ((not target-entry-p)
- ;; Insert as top-level entry, either at beginning or at end of file
- (setq level 1)
- (if reversed
- (progn (goto-char (point-min))
- (or (org-at-heading-p)
- (outline-next-heading)))
- (goto-char (point-max))
- (or (bolp) (insert "\n"))))
- (t
- ;; Insert as a child of the current entry
- (and (looking-at "\\*+")
- (setq level (- (match-end 0) (match-beginning 0))))
- (setq level (org-get-valid-level (or level 1) 1))
- (if reversed
- (progn
- (outline-next-heading)
- (or (bolp) (insert "\n")))
- (org-end-of-subtree t t)
- (or (bolp) (insert "\n")))))
- (org-capture-empty-lines-before)
- (setq beg (point))
- (org-paste-subtree level txt 'for-yank)
- (org-capture-empty-lines-after 1)
- (org-capture-position-for-last-stored beg)
- (outline-next-heading)
- (setq end (point))
- (org-capture-mark-kill-region beg (1- end))
- (org-capture-narrow beg (1- end))
- (goto-char beg)
- (if (re-search-forward "%\\?" end t) (replace-match ""))))
-
-(defun org-capture-place-item ()
- "Place the template as a new plain list item."
- (let* ((txt (org-capture-get :template))
- (target-entry-p (org-capture-get :target-entry-p))
- (ind 0)
- beg end)
- (cond
- ((org-capture-get :exact-position)
- (goto-char (org-capture-get :exact-position)))
- ((not target-entry-p)
- ;; Insert as top-level entry, either at beginning or at end of file
- (setq beg (point-min) end (point-max)))
- (t
- (setq beg (1+ (point-at-eol))
- end (save-excursion (outline-next-heading) (point)))))
- (if (org-capture-get :prepend)
- (progn
- (goto-char beg)
- (if (org-search-forward-unenclosed org-item-beginning-re end t)
- (progn
- (goto-char (match-beginning 0))
- (setq ind (org-get-indentation)))
- (goto-char end)
- (setq ind 0)))
- (goto-char end)
- (if (org-search-backward-unenclosed org-item-beginning-re beg t)
- (progn
- (setq ind (org-get-indentation))
- (org-end-of-item))
- (setq ind 0)))
- ;; Remove common indentation
- (setq txt (org-remove-indentation txt))
- ;; Make sure this is indeed an item
- (unless (string-match (concat "\\`" (org-item-re)) txt)
- (setq txt (concat "- "
- (mapconcat 'identity (split-string txt "\n")
- "\n "))))
- ;; Set the correct indentation, depending on context
- (setq ind (make-string ind ?\ ))
- (setq txt (concat ind
- (mapconcat 'identity (split-string txt "\n")
- (concat "\n" ind))
- "\n"))
- ;; Insert, with surrounding empty lines
- (org-capture-empty-lines-before)
- (setq beg (point))
- (insert txt)
- (or (bolp) (insert "\n"))
- (org-capture-empty-lines-after 1)
- (org-capture-position-for-last-stored beg)
- (forward-char 1)
- (setq end (point))
- (org-capture-mark-kill-region beg (1- end))
- (org-capture-narrow beg (1- end))
- (if (re-search-forward "%\\?" end t) (replace-match ""))))
-
-(defun org-capture-place-table-line ()
- "Place the template as a table line."
- (require 'org-table)
- (let* ((txt (org-capture-get :template))
- (target-entry-p (org-capture-get :target-entry-p))
- (table-line-pos (org-capture-get :table-line-pos))
- ind beg end)
- (cond
- ((org-capture-get :exact-position)
- (goto-char (org-capture-get :exact-position)))
- ((not target-entry-p)
- ;; Table is not necessarily under a heading
- (setq beg (point-min) end (point-max)))
- (t
- ;; WE are at a heading, limit search to the body
- (setq beg (1+ (point-at-eol))
- end (save-excursion (outline-next-heading) (point)))))
- (if (re-search-forward org-table-dataline-regexp end t)
- (let ((b (org-table-begin)) (e (org-table-end)))
- (goto-char e)
- (if (looking-at "[ \t]*#\\+TBLFM:")
- (forward-line 1))
- (narrow-to-region b (point)))
- (goto-char end)
- (insert "\n| |\n|----|\n| |\n")
- (narrow-to-region (1+ end) (point)))
- ;; We are narrowed to the table, or to an empty line if there was no table
-
- ;; Check if the template is good
- (if (not (string-match org-table-dataline-regexp txt))
- (setq txt "| %?Bad template |\n"))
- (cond
- ((and table-line-pos
- (string-match "\\(I+\\)\\([-+][0-9]\\)" table-line-pos))
- ;; we have a complex line specification
- (goto-char (point-min))
- (let ((nh (- (match-end 1) (match-beginning 1)))
- (delta (string-to-number (match-string 2 table-line-pos)))
- ll)
- ;; The user wants a special position in the table
- (org-table-get-specials)
- (setq ll (ignore-errors (aref org-table-hlines nh)))
- (unless ll (error "Invalid table line specification \"%s\""
- table-line-pos))
- (setq ll (+ ll delta (if (< delta 0) 0 -1)))
- (org-goto-line ll)
- (org-table-insert-row 'below)
- (beginning-of-line 1)
- (delete-region (point) (1+ (point-at-eol)))
- (setq beg (point))
- (insert txt)
- (setq end (point))))
- ((org-capture-get :prepend)
- (goto-char (point-min))
- (re-search-forward org-table-hline-regexp nil t)
- (beginning-of-line 1)
- (re-search-forward org-table-dataline-regexp nil t)
- (beginning-of-line 1)
- (setq beg (point))
- (org-table-insert-row)
- (beginning-of-line 1)
- (delete-region (point) (1+ (point-at-eol)))
- (insert txt)
- (setq end (point)))
- (t
- (goto-char (point-max))
- (re-search-backward org-table-dataline-regexp nil t)
- (beginning-of-line 1)
- (org-table-insert-row 'below)
- (beginning-of-line 1)
- (delete-region (point) (1+ (point-at-eol)))
- (setq beg (point))
- (insert txt)
- (setq end (point))))
- (goto-char beg)
- (org-capture-position-for-last-stored 'table-line)
- (if (re-search-forward "%\\?" end t) (replace-match ""))
- (org-table-align)))
-
-(defun org-capture-place-plain-text ()
- "Place the template plainly."
- (let* ((txt (org-capture-get :template))
- beg end)
- (goto-char (cond
- ((org-capture-get :exact-position))
- ((org-capture-get :prepend) (point-min))
- (t (point-max))))
- (or (bolp) (newline))
- (org-capture-empty-lines-before)
- (setq beg (point))
- (insert txt)
- (org-capture-empty-lines-after 1)
- (org-capture-position-for-last-stored beg)
- (setq end (point))
- (org-capture-mark-kill-region beg (1- end))
- (org-capture-narrow beg (1- end))
- (if (re-search-forward "%\\?" end t) (replace-match ""))))
-
-(defun org-capture-mark-kill-region (beg end)
- "Mark the region that will have to be killed when aborting capture."
- (let ((m1 (move-marker (make-marker) beg))
- (m2 (move-marker (make-marker) end)))
- (org-capture-put :begin-marker m1)
- (org-capture-put :end-marker m2)))
-
-(defun org-capture-position-for-last-stored (where)
- "Memorize the position that should later become the position of last capture."
- (cond
- ((integerp where)
- (org-capture-put :position-for-last-stored
- (move-marker (make-marker) where
- (or (buffer-base-buffer (current-buffer))
- (current-buffer)))))
- ((eq where 'table-line)
- (org-capture-put :position-for-last-stored
- (list 'table-line
- (org-table-current-dline))))
- (t (error "This should not happen"))))
-
-(defun org-capture-bookmark-last-stored-position ()
- "Bookmark the last-captured position."
- (let* ((where (org-capture-get :position-for-last-stored 'local))
- (pos (cond
- ((markerp where)
- (prog1 (marker-position where)
- (move-marker where nil)))
- ((and (listp where) (eq (car where) 'table-line))
- (if (org-at-table-p)
- (save-excursion
- (org-table-goto-line (nth 1 where))
- (point-at-bol))
- (point))))))
- (with-current-buffer (buffer-base-buffer (current-buffer))
- (save-excursion
- (save-restriction
- (widen)
- (goto-char pos)
- (bookmark-set "org-capture-last-stored")
- (move-marker org-capture-last-stored-marker (point)))))))
-
-(defun org-capture-narrow (beg end)
- "Narrow, unless configuration says not to narrow."
- (unless (org-capture-get :unnarrowed)
- (narrow-to-region beg end)
- (goto-char beg)))
-
-(defun org-capture-empty-lines-before (&optional n)
- "Arrange for the correct number of empty lines before the insertion point.
-Point will be after the empty lines, so insertion can directly be done."
- (setq n (or n (org-capture-get :empty-lines) 0))
- (let ((pos (point)))
- (org-back-over-empty-lines)
- (delete-region (point) pos)
- (if (> n 0) (newline n))))
-
-(defun org-capture-empty-lines-after (&optional n)
- "Arrange for the correct number of empty lines after the inserted string.
-Point will remain at the first line after the inserted text."
- (setq n (or n (org-capture-get :empty-lines) 0))
- (org-back-over-empty-lines)
- (while (looking-at "[ \t]*\n") (replace-match ""))
- (let ((pos (point)))
- (if (> n 0) (newline n))
- (goto-char pos)))
-
-(defvar org-clock-marker) ; Defined in org.el
-;;;###autoload
-(defun org-capture-insert-template-here ()
- (let* ((template (org-capture-get :template))
- (type (org-capture-get :type))
- beg end pp)
- (or (bolp) (newline))
- (setq beg (point))
- (cond
- ((and (eq type 'entry) (org-mode-p))
- (org-paste-subtree nil template t))
- ((and (memq type '(item checkitem))
- (org-mode-p)
- (save-excursion (skip-chars-backward " \t\n")
- (setq pp (point))
- (org-in-item-p)))
- (goto-char pp)
- (org-insert-item)
- (skip-chars-backward " ")
- (skip-chars-backward "-+*0123456789).")
- (delete-region (point) (point-at-eol))
- (setq beg (point))
- (org-remove-indentation template)
- (insert template)
- (org-capture-empty-lines-after)
- (goto-char beg)
- (org-list-repair)
- (org-end-of-item)
- (setq end (point)))
- (t (insert template)))
- (setq end (point))
- (goto-char beg)
- (if (re-search-forward "%\\?" end t)
- (replace-match ""))))
-
-(defun org-capture-set-plist (entry)
- "Initialize the property list from the template definition."
- (setq org-capture-plist (copy-sequence (nthcdr 5 entry)))
- (org-capture-put :key (car entry) :description (nth 1 entry)
- :target (nth 3 entry))
- (let ((txt (nth 4 entry)) (type (or (nth 2 entry) 'entry)))
- (when (or (not txt) (and (stringp txt) (not (string-match "\\S-" txt))))
- ;; The template may be empty or omitted for special types.
- ;; Here we insert the default templates for such cases.
- (cond
- ((eq type 'item) (setq txt "- %?"))
- ((eq type 'checkitem) (setq txt "- [ ] %?"))
- ((eq type 'table-line) (setq txt "| %? |"))
- ((member type '(nil entry)) (setq txt "* %?\n %a"))))
- (org-capture-put :template txt :type type)))
-
-(defun org-capture-goto-target (&optional template-key)
- "Go to the target location of a capture template.
-The user is queried for the template."
- (interactive)
- (let* (org-select-template-temp-major-mode
- (entry (org-capture-select-template template-key)))
- (unless entry
- (error "No capture template selected"))
- (org-capture-set-plist entry)
- (org-capture-set-target-location)
- (switch-to-buffer (org-capture-get :buffer))
- (goto-char (org-capture-get :pos))))
-
-(defun org-capture-get-indirect-buffer (&optional buffer prefix)
- "Make an indirect buffer for a capture process.
-Use PREFIX as a prefix for the name of the indirect buffer."
- (setq buffer (or buffer (current-buffer)))
- (let ((n 1) (base (buffer-name buffer)) bname)
- (setq bname (concat prefix "-" base))
- (while (buffer-live-p (get-buffer bname))
- (setq bname (concat prefix "-" (number-to-string (incf n)) "-" base)))
- (condition-case nil
- (make-indirect-buffer buffer bname 'clone)
- (error (make-indirect-buffer buffer bname)))))
-
-
-;;; The template code
-
-(defun org-capture-select-template (&optional keys)
- "Select a capture template.
-Lisp programs can force the template by setting KEYS to a string."
- (if org-capture-templates
- (if keys
- (or (assoc keys org-capture-templates)
- (error "No capture template referred to by \"%s\" keys" keys))
- (if (= 1 (length org-capture-templates))
- (car org-capture-templates)
- (org-mks org-capture-templates
- "Select a capture template\n========================="
- "Template key: "
- '(("C" "Customize org-capture-templates")
- ("q" "Abort")))))
- ;; Use an arbitrary default template
- '("t" "Task" entry (file+headline "" "Tasks") "* TODO %?\n %u\n %a")))
-
-(defun org-capture-fill-template (&optional template initial annotation)
- "Fill a template and return the filled template as a string.
-The template may still contain \"%?\" for cursor positioning."
- (setq template (or template (org-capture-get :template)))
- (when (stringp initial)
- (setq initial (org-no-properties initial))
- (remove-text-properties 0 (length initial) '(read-only t) initial))
- (let* ((buffer (org-capture-get :buffer))
- (file (buffer-file-name (or (buffer-base-buffer buffer) buffer)))
- (ct (org-capture-get :default-time))
- (dct (decode-time ct))
- (ct1
- (if (< (nth 2 dct) org-extend-today-until)
- (encode-time 0 59 23 (1- (nth 3 dct)) (nth 4 dct) (nth 5 dct))
- ct))
- (plist-p (if org-store-link-plist t nil))
- (v-c (and (> (length kill-ring) 0) (current-kill 0)))
- (v-x (or (org-get-x-clipboard 'PRIMARY)
- (org-get-x-clipboard 'CLIPBOARD)
- (org-get-x-clipboard 'SECONDARY)))
- (v-t (format-time-string (car org-time-stamp-formats) ct))
- (v-T (format-time-string (cdr org-time-stamp-formats) ct))
- (v-u (concat "[" (substring v-t 1 -1) "]"))
- (v-U (concat "[" (substring v-T 1 -1) "]"))
- ;; `initial' and `annotation' might habe been passed.
- ;; But if the property list has them, we prefer those values
- (v-i (or (plist-get org-store-link-plist :initial)
- initial
- (org-capture-get :initial)
- ""))
- (v-a (or (plist-get org-store-link-plist :annotation)
- annotation
- (org-capture-get :annotation)
- ""))
- ;; Is the link empty? Then we do not want it...
- (v-a (if (equal v-a "[[]]") "" v-a))
- (clipboards (remove nil (list v-i
- (org-get-x-clipboard 'PRIMARY)
- (org-get-x-clipboard 'CLIPBOARD)
- (org-get-x-clipboard 'SECONDARY)
- v-c)))
- (v-A (if (and v-a
- (string-match
- "\\[\\(\\[.*?\\]\\)\\(\\[.*?\\]\\)?\\]" v-a))
- (replace-match "[\\1[%^{Link description}]]" nil nil v-a)
- v-a))
- (v-n user-full-name)
- (v-k (if (marker-buffer org-clock-marker)
- (org-substring-no-properties org-clock-heading)))
- (v-K (if (marker-buffer org-clock-marker)
- (org-make-link-string
- (buffer-file-name (marker-buffer org-clock-marker))
- org-clock-heading)))
- v-I
- (org-startup-folded nil)
- (org-inhibit-startup t)
- org-time-was-given org-end-time-was-given x
- prompt completions char time pos default histvar)
-
- (setq org-store-link-plist
- (plist-put org-store-link-plist :annotation v-a)
- org-store-link-plist
- (plist-put org-store-link-plist :initial v-i))
- (setq initial v-i)
-
- (unless template (setq template "") (message "No template") (ding)
- (sit-for 1))
- (save-window-excursion
- (delete-other-windows)
- (switch-to-buffer (get-buffer-create "*Capture*"))
- (erase-buffer)
- (insert template)
- (goto-char (point-min))
- (org-capture-steal-local-variables buffer)
- (setq buffer-file-name nil)
-
- ;; %[] Insert contents of a file.
- (goto-char (point-min))
- (while (re-search-forward "%\\[\\(.+\\)\\]" nil t)
- (unless (org-capture-escaped-%)
- (let ((start (match-beginning 0))
- (end (match-end 0))
- (filename (expand-file-name (match-string 1))))
- (goto-char start)
- (delete-region start end)
- (condition-case error
- (insert-file-contents filename)
- (error (insert (format "%%![Couldn't insert %s: %s]"
- filename error)))))))
- ;; %() embedded elisp
- (goto-char (point-min))
- (while (re-search-forward "%\\((.+)\\)" nil t)
- (unless (org-capture-escaped-%)
- (goto-char (match-beginning 0))
- (let ((template-start (point)))
- (forward-char 1)
- (let ((result
- (condition-case error
- (eval (read (current-buffer)))
- (error (format "%%![Error: %s]" error)))))
- (delete-region template-start (point))
- (insert result)))))
-
- ;; Simple %-escapes
- (goto-char (point-min))
- (while (re-search-forward "%\\([tTuUaiAcxkKI]\\)" nil t)
- (unless (org-capture-escaped-%)
- (when (and initial (equal (match-string 0) "%i"))
- (save-match-data
- (let* ((lead (buffer-substring
- (point-at-bol) (match-beginning 0))))
- (setq v-i (mapconcat 'identity
- (org-split-string initial "\n")
- (concat "\n" lead))))))
- (replace-match
- (or (eval (intern (concat "v-" (match-string 1)))) "")
- t t)))
-
- ;; From the property list
- (when plist-p
- (goto-char (point-min))
- (while (re-search-forward "%\\(:[-a-zA-Z]+\\)" nil t)
- (unless (org-capture-escaped-%)
- (and (setq x (or (plist-get org-store-link-plist
- (intern (match-string 1))) ""))
- (replace-match x t t)))))
-
- ;; Turn on org-mode in temp buffer, set local variables
- ;; This is to support completion in interactive prompts
- (let ((org-inhibit-startup t)) (org-mode))
- ;; Interactive template entries
- (goto-char (point-min))
- (while (re-search-forward "%^\\({\\([^}]*\\)}\\)?\\([gGtTuUCLp]\\)?"
- nil t)
- (unless (org-capture-escaped-%)
- (setq char (if (match-end 3) (match-string 3))
- prompt (if (match-end 2) (match-string 2)))
- (goto-char (match-beginning 0))
- (replace-match "")
- (setq completions nil default nil)
- (when prompt
- (setq completions (org-split-string prompt "|")
- prompt (pop completions)
- default (car completions)
- histvar (intern (concat
- "org-capture-template-prompt-history::"
- (or prompt "")))
- completions (mapcar 'list completions)))
- (unless (boundp histvar) (set histvar nil))
- (cond
- ((member char '("G" "g"))
- (let* ((org-last-tags-completion-table
- (org-global-tags-completion-table
- (if (equal char "G")
- (org-agenda-files)
- (and file (list file)))))
- (org-add-colon-after-tag-completion t)
- (ins (org-icompleting-read
- (if prompt (concat prompt ": ") "Tags: ")
- 'org-tags-completion-function nil nil nil
- 'org-tags-history)))
- (setq ins (mapconcat 'identity
- (org-split-string
- ins (org-re "[^[:alnum:]_@#%]+"))
- ":"))
- (when (string-match "\\S-" ins)
- (or (equal (char-before) ?:) (insert ":"))
- (insert ins)
- (or (equal (char-after) ?:) (insert ":"))
- (and (org-on-heading-p) (org-set-tags nil 'align)))))
- ((equal char "C")
- (cond ((= (length clipboards) 1) (insert (car clipboards)))
- ((> (length clipboards) 1)
- (insert (read-string "Clipboard/kill value: "
- (car clipboards) '(clipboards . 1)
- (car clipboards))))))
- ((equal char "L")
- (cond ((= (length clipboards) 1)
- (org-insert-link 0 (car clipboards)))
- ((> (length clipboards) 1)
- (org-insert-link 0 (read-string "Clipboard/kill value: "
- (car clipboards)
- '(clipboards . 1)
- (car clipboards))))))
- ((equal char "p")
- (let*
- ((prop (org-substring-no-properties prompt))
- (pall (concat prop "_ALL"))
- (allowed
- (with-current-buffer
- (get-buffer (file-name-nondirectory file))
- (or (cdr (assoc pall org-file-properties))
- (cdr (assoc pall org-global-properties))
- (cdr (assoc pall org-global-properties-fixed)))))
- (existing (with-current-buffer
- (get-buffer (file-name-nondirectory file))
- (mapcar 'list (org-property-values prop))))
- (propprompt (concat "Value for " prop ": "))
- (val (if allowed
- (org-completing-read
- propprompt
- (mapcar 'list (org-split-string allowed
- "[ \t]+"))
- nil 'req-match)
- (org-completing-read-no-i propprompt
- existing nil nil
- "" nil ""))))
- (org-set-property prop val)))
- (char
- ;; These are the date/time related ones
- (setq org-time-was-given (equal (upcase char) char))
- (setq time (org-read-date (equal (upcase char) char) t nil
- prompt))
- (if (equal (upcase char) char) (setq org-time-was-given t))
- (org-insert-time-stamp time org-time-was-given
- (member char '("u" "U"))
- nil nil (list org-end-time-was-given)))
- (t
- (let (org-completion-use-ido)
- (insert (org-completing-read-no-i
- (concat (if prompt prompt "Enter string")
- (if default (concat " [" default "]"))
- ": ")
- completions nil nil nil histvar default)))))))
- ;; Make sure there are no empty lines before the text, and that
- ;; it ends with a newline character
- (goto-char (point-min))
- (while (looking-at "[ \t]*\n") (replace-match ""))
- (if (re-search-forward "[ \t\n]*\\'" nil t) (replace-match "\n"))
- ;; Return the expanded tempate and kill the temporary buffer
- (untabify (point-min) (point-max))
- (set-buffer-modified-p nil)
- (prog1 (buffer-string) (kill-buffer (current-buffer))))))
-
-(defun org-capture-escaped-% ()
- "Check if % was escaped - if yes, unescape it now."
- (if (equal (char-before (match-beginning 0)) ?\\)
- (progn
- (delete-region (1- (match-beginning 0)) (match-beginning 0))
- t)
- nil))
-
-;;;###autoload
-(defun org-capture-import-remember-templates ()
- "Set org-capture-templates to be similar to `org-remember-templates'."
- (interactive)
- (when (and (yes-or-no-p
- "Import old remember templates into org-capture-templates? ")
- (yes-or-no-p
- "Note that this will remove any templates currently defined in `org-capture-templates'. Do you still want to go ahead? "))
- (require 'org-remember)
- (setq org-capture-templates
- (mapcar
- (lambda (entry)
- (let ((desc (car entry))
- (key (char-to-string (nth 1 entry)))
- (template (nth 2 entry))
- (file (or (nth 3 entry) org-default-notes-file))
- (position (or (nth 4 entry) org-remember-default-headline))
- (type 'entry)
- (prepend org-reverse-note-order)
- immediate target)
- (cond
- ((member position '(top bottom))
- (setq target (list 'file file)
- prepend (eq position 'top)))
- ((eq position 'date-tree)
- (setq target (list 'file+datetree file)
- prepend nil))
- (t (setq target (list 'file+headline file position))))
-
- (when (string-match "%!" template)
- (setq template (replace-match "" t t template)
- immediate t))
-
- (append (list key desc type target template)
- (if prepend '(:prepend t))
- (if immediate '(:immediate-finish t)))))
-
- org-remember-templates))))
-
-(provide 'org-capture)
-
-;; arch-tag: 986bf41b-8ada-4e28-bf20-e8388a7205a0
-
-;;; org-capture.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-capture.elc b/.emacs.d/org-7.4/lisp/org-capture.elc
deleted file mode 100644
index 1341270..0000000
--- a/.emacs.d/org-7.4/lisp/org-capture.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-clock.el b/.emacs.d/org-7.4/lisp/org-clock.el
deleted file mode 100644
index 93b0b52..0000000
--- a/.emacs.d/org-7.4/lisp/org-clock.el
+++ /dev/null
@@ -1,2499 +0,0 @@
-;;; org-clock.el --- The time clocking code for Org-mode
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file contains the time clocking code for Org-mode
-
-(require 'org)
-;;; Code:
-
-(eval-when-compile
- (require 'cl))
-
-(declare-function calendar-absolute-from-iso "cal-iso" (&optional date))
-(declare-function notifications-notify "notifications" (&rest params))
-(defvar org-time-stamp-formats)
-
-(defgroup org-clock nil
- "Options concerning clocking working time in Org-mode."
- :tag "Org Clock"
- :group 'org-progress)
-
-(defcustom org-clock-into-drawer org-log-into-drawer
- "Should clocking info be wrapped into a drawer?
-When t, clocking info will always be inserted into a :LOGBOOK: drawer.
-If necessary, the drawer will be created.
-When nil, the drawer will not be created, but used when present.
-When an integer and the number of clocking entries in an item
-reaches or exceeds this number, a drawer will be created.
-When a string, it names the drawer to be used.
-
-The default for this variable is the value of `org-log-into-drawer',
-which see."
- :group 'org-todo
- :group 'org-clock
- :type '(choice
- (const :tag "Always" t)
- (const :tag "Only when drawer exists" nil)
- (integer :tag "When at least N clock entries")
- (const :tag "Into LOGBOOK drawer" "LOGBOOK")
- (string :tag "Into Drawer named...")))
-
-(defcustom org-clock-out-when-done t
- "When non-nil, clock will be stopped when the clocked entry is marked DONE.
-DONE here means any DONE-like state.
-A nil value means clock will keep running until stopped explicitly with
-`C-c C-x C-o', or until the clock is started in a different item.
-Instead of t, this can also be a list of TODO states that should trigger
-clocking out."
- :group 'org-clock
- :type '(choice
- (const :tag "No" nil)
- (const :tag "Yes, when done" t)
- (repeat :tag "State list"
- (string :tag "TODO keyword"))))
-
-(defcustom org-clock-out-remove-zero-time-clocks nil
- "Non-nil means remove the clock line when the resulting time is zero."
- :group 'org-clock
- :type 'boolean)
-
-(defcustom org-clock-in-switch-to-state nil
- "Set task to a special todo state while clocking it.
-The value should be the state to which the entry should be
-switched. If the value is a function, it must take one
-parameter (the current TODO state of the item) and return the
-state to switch it to."
- :group 'org-clock
- :group 'org-todo
- :type '(choice
- (const :tag "Don't force a state" nil)
- (string :tag "State")
- (symbol :tag "Function")))
-
-(defcustom org-clock-out-switch-to-state nil
- "Set task to a special todo state after clocking out.
-The value should be the state to which the entry should be
-switched. If the value is a function, it must take one
-parameter (the current TODO state of the item) and return the
-state to switch it to."
- :group 'org-clock
- :group 'org-todo
- :type '(choice
- (const :tag "Don't force a state" nil)
- (string :tag "State")
- (symbol :tag "Function")))
-
-(defcustom org-clock-history-length 5
- "Number of clock tasks to remember in history."
- :group 'org-clock
- :type 'integer)
-
-(defcustom org-clock-goto-may-find-recent-task t
- "Non-nil means `org-clock-goto' can go to recent task if no active clock."
- :group 'org-clock
- :type 'boolean)
-
-(defcustom org-clock-heading-function nil
- "When non-nil, should be a function to create `org-clock-heading'.
-This is the string shown in the mode line when a clock is running.
-The function is called with point at the beginning of the headline."
- :group 'org-clock
- :type 'function)
-
-(defcustom org-clock-string-limit 0
- "Maximum length of clock strings in the modeline. 0 means no limit."
- :group 'org-clock
- :type 'integer)
-
-(defcustom org-clock-in-resume nil
- "If non-nil, resume clock when clocking into task with open clock.
-When clocking into a task with a clock entry which has not been closed,
-the clock can be resumed from that point."
- :group 'org-clock
- :type 'boolean)
-
-(defcustom org-clock-persist nil
- "When non-nil, save the running clock when Emacs is closed.
-The clock is resumed when Emacs restarts.
-When this is t, both the running clock, and the entire clock
-history are saved. When this is the symbol `clock', only the
-running clock is saved.
-
-When Emacs restarts with saved clock information, the file containing the
-running clock as well as all files mentioned in the clock history will
-be visited.
-All this depends on running `org-clock-persistence-insinuate' in .emacs"
- :group 'org-clock
- :type '(choice
- (const :tag "Just the running clock" clock)
- (const :tag "Just the history" history)
- (const :tag "Clock and history" t)
- (const :tag "No persistence" nil)))
-
-(defcustom org-clock-persist-file (convert-standard-filename
- "~/.emacs.d/org-clock-save.el")
- "File to save clock data to."
- :group 'org-clock
- :type 'string)
-
-(defcustom org-clock-persist-query-save nil
- "When non-nil, ask before saving the current clock on exit."
- :group 'org-clock
- :type 'boolean)
-
-(defcustom org-clock-persist-query-resume t
- "When non-nil, ask before resuming any stored clock during load."
- :group 'org-clock
- :type 'boolean)
-
-(defcustom org-clock-sound nil
- "Sound that will used for notifications.
-Possible values:
-
-nil no sound played.
-t standard Emacs beep
-file name play this sound file. If not possible, fall back to beep"
- :group 'org-clock
- :type '(choice
- (const :tag "No sound" nil)
- (const :tag "Standard beep" t)
- (file :tag "Play sound file")))
-
-(defcustom org-clock-modeline-total 'auto
- "Default setting for the time included for the modeline clock.
-This can be overruled locally using the CLOCK_MODELINE_TOTAL property.
-Allowed values are:
-
-current Only the time in the current instance of the clock
-today All time clocked into this task today
-repeat All time clocked into this task since last repeat
-all All time ever recorded for this task
-auto Automatically, either `all', or `repeat' for repeating tasks"
- :group 'org-clock
- :type '(choice
- (const :tag "Current clock" current)
- (const :tag "Today's task time" today)
- (const :tag "Since last repeat" repeat)
- (const :tag "All task time" all)
- (const :tag "Automatically, `all' or since `repeat'" auto)))
-
-(defcustom org-task-overrun-text nil
- "The extra modeline text that should indicate that the clock is overrun.
-The can be nil to indicate that instead of adding text, the clock time
-should get a different face (`org-mode-line-clock-overrun').
-When this is a string, it is prepended to the clock string as an indication,
-also using the face `org-mode-line-clock-overrun'."
- :group 'org-clock
- :type '(choice
- (const :tag "Just mark the time string" nil)
- (string :tag "Text to prepend")))
-
-(defcustom org-show-notification-handler nil
- "Function or program to send notification with.
-The function or program will be called with the notification
-string as argument."
- :group 'org-clock
- :type '(choice
- (string :tag "Program")
- (function :tag "Function")))
-
-(defgroup org-clocktable nil
- "Options concerning the clock table in Org-mode."
- :tag "Org Clock Table"
- :group 'org-clock)
-
-(defcustom org-clocktable-defaults
- (list
- :maxlevel 2
- :scope 'file
- :block nil
- :tstart nil
- :tend nil
- :step nil
- :stepskip0 nil
- :fileskip0 nil
- :tags nil
- :emphasize nil
- :link nil
- :narrow '40!
- :indent t
- :formula nil
- :timestamp nil
- :level nil
- :tcolumns nil
- :formatter nil)
- "Default properties for clock tables."
- :group 'org-clock
- :type 'plist)
-
-(defcustom org-clock-clocktable-formatter 'org-clocktable-write-default
- "Function to turn clocking data into a table.
-For more information, see `org-clocktable-write-default'."
- :group 'org-clocktable
- :type 'function)
-
-(defcustom org-clock-clocktable-default-properties '(:maxlevel 2 :scope file)
- "Default properties for new clocktables.
-These will be inserted into the BEGIN line, to make it easy for users to
-play with them."
- :group 'org-clocktable
- :type 'plist)
-
-(defcustom org-clock-idle-time nil
- "When non-nil, resolve open clocks if the user is idle more than X minutes."
- :group 'org-clock
- :type '(choice
- (const :tag "Never" nil)
- (integer :tag "After N minutes")))
-
-(defcustom org-clock-auto-clock-resolution 'when-no-clock-is-running
- "When to automatically resolve open clocks found in Org buffers."
- :group 'org-clock
- :type '(choice
- (const :tag "Never" nil)
- (const :tag "Always" t)
- (const :tag "When no clock is running" when-no-clock-is-running)))
-
-(defcustom org-clock-report-include-clocking-task nil
- "When non-nil, include the current clocking task time in clock reports."
- :group 'org-clock
- :type 'boolean)
-
-(defcustom org-clock-resolve-expert nil
- "Non-nil means do not show the splash buffer with the clock resolver."
- :group 'org-clock
- :type 'boolean)
-
-(defvar org-clock-in-prepare-hook nil
- "Hook run when preparing the clock.
-This hook is run before anything happens to the task that
-you want to clock in. For example, you can use this hook
-to add an effort property.")
-(defvar org-clock-in-hook nil
- "Hook run when starting the clock.")
-(defvar org-clock-out-hook nil
- "Hook run when stopping the current clock.")
-
-(defvar org-clock-cancel-hook nil
- "Hook run when cancelling the current clock.")
-(defvar org-clock-goto-hook nil
- "Hook run when selecting the currently clocked-in entry.")
-(defvar org-clock-has-been-used nil
- "Has the clock been used during the current Emacs session?")
-
-;;; The clock for measuring work time.
-
-(defvar org-mode-line-string "")
-(put 'org-mode-line-string 'risky-local-variable t)
-
-(defvar org-clock-mode-line-timer nil)
-(defvar org-clock-idle-timer nil)
-(defvar org-clock-heading) ; defined in org.el
-(defvar org-clock-heading-for-remember "")
-(defvar org-clock-start-time "")
-
-(defvar org-clock-leftover-time nil
- "If non-nil, user cancelled a clock; this is when leftover time started.")
-
-(defvar org-clock-effort ""
- "Effort estimate of the currently clocking task.")
-
-(defvar org-clock-total-time nil
- "Holds total time, spent previously on currently clocked item.
-This does not include the time in the currently running clock.")
-
-(defvar org-clock-history nil
- "List of marker pointing to recent clocked tasks.")
-
-(defvar org-clock-default-task (make-marker)
- "Marker pointing to the default task that should clock time.
-The clock can be made to switch to this task after clocking out
-of a different task.")
-
-(defvar org-clock-interrupted-task (make-marker)
- "Marker pointing to the task that has been interrupted by the current clock.")
-
-(defvar org-clock-mode-line-map (make-sparse-keymap))
-(define-key org-clock-mode-line-map [mode-line mouse-2] 'org-clock-goto)
-(define-key org-clock-mode-line-map [mode-line mouse-1] 'org-clock-menu)
-
-(defun org-clock-menu ()
- (interactive)
- (popup-menu
- '("Clock"
- ["Clock out" org-clock-out t]
- ["Change effort estimate" org-clock-modify-effort-estimate t]
- ["Go to clock entry" org-clock-goto t]
- ["Switch task" (lambda () (interactive) (org-clock-in '(4))) :active t :keys "C-u C-c C-x C-i"])))
-
-(defun org-clock-history-push (&optional pos buffer)
- "Push a marker to the clock history."
- (setq org-clock-history-length (max 1 (min 35 org-clock-history-length)))
- (let ((m (move-marker (make-marker)
- (or pos (point)) (org-base-buffer
- (or buffer (current-buffer)))))
- n l)
- (while (setq n (member m org-clock-history))
- (move-marker (car n) nil))
- (setq org-clock-history
- (delq nil
- (mapcar (lambda (x) (if (marker-buffer x) x nil))
- org-clock-history)))
- (when (>= (setq l (length org-clock-history)) org-clock-history-length)
- (setq org-clock-history
- (nreverse
- (nthcdr (- l org-clock-history-length -1)
- (nreverse org-clock-history)))))
- (push m org-clock-history)))
-
-(defun org-clock-save-markers-for-cut-and-paste (beg end)
- "Save relative positions of markers in region."
- (org-check-and-save-marker org-clock-marker beg end)
- (org-check-and-save-marker org-clock-hd-marker beg end)
- (org-check-and-save-marker org-clock-default-task beg end)
- (org-check-and-save-marker org-clock-interrupted-task beg end)
- (mapc (lambda (m) (org-check-and-save-marker m beg end))
- org-clock-history))
-
-(defun org-clocking-buffer ()
- "Return the clocking buffer if we are currently clocking a task or nil."
- (marker-buffer org-clock-marker))
-
-(defun org-clocking-p ()
- "Return t when clocking a task."
- (not (equal (org-clocking-buffer) nil)))
-
-(defun org-clock-select-task (&optional prompt)
- "Select a task that recently was associated with clocking."
- (interactive)
- (let (sel-list rpl (i 0) s)
- (save-window-excursion
- (org-switch-to-buffer-other-window
- (get-buffer-create "*Clock Task Select*"))
- (erase-buffer)
- (when (marker-buffer org-clock-default-task)
- (insert (org-add-props "Default Task\n" nil 'face 'bold))
- (setq s (org-clock-insert-selection-line ?d org-clock-default-task))
- (push s sel-list))
- (when (marker-buffer org-clock-interrupted-task)
- (insert (org-add-props "The task interrupted by starting the last one\n" nil 'face 'bold))
- (setq s (org-clock-insert-selection-line ?i org-clock-interrupted-task))
- (push s sel-list))
- (when (org-clocking-p)
- (insert (org-add-props "Current Clocking Task\n" nil 'face 'bold))
- (setq s (org-clock-insert-selection-line ?c org-clock-marker))
- (push s sel-list))
- (insert (org-add-props "Recent Tasks\n" nil 'face 'bold))
- (mapc
- (lambda (m)
- (when (marker-buffer m)
- (setq i (1+ i)
- s (org-clock-insert-selection-line
- (if (< i 10)
- (+ i ?0)
- (+ i (- ?A 10))) m))
- (if (fboundp 'int-to-char) (setf (car s) (int-to-char (car s))))
- (push s sel-list)))
- org-clock-history)
- (org-fit-window-to-buffer)
- (message (or prompt "Select task for clocking:"))
- (setq rpl (read-char-exclusive))
- (cond
- ((eq rpl ?q) nil)
- ((eq rpl ?x) nil)
- ((assoc rpl sel-list) (cdr (assoc rpl sel-list)))
- (t (error "Invalid task choice %c" rpl))))))
-
-(defun org-clock-insert-selection-line (i marker)
- "Insert a line for the clock selection menu.
-And return a cons cell with the selection character integer and the marker
-pointing to it."
- (when (marker-buffer marker)
- (let (file cat task heading prefix)
- (with-current-buffer (org-base-buffer (marker-buffer marker))
- (save-excursion
- (save-restriction
- (widen)
- (ignore-errors
- (goto-char marker)
- (setq file (buffer-file-name (marker-buffer marker))
- cat (or (org-get-category)
- (progn (org-refresh-category-properties)
- (org-get-category)))
- heading (org-get-heading 'notags)
- prefix (save-excursion
- (org-back-to-heading t)
- (looking-at "\\*+ ")
- (match-string 0))
- task (substring
- (org-fontify-like-in-org-mode
- (concat prefix heading)
- org-odd-levels-only)
- (length prefix)))))))
- (when (and cat task)
- (insert (format "[%c] %-15s %s\n" i cat task))
- (cons i marker)))))
-
-(defvar org-task-overrun nil
- "Internal flag indicating if the clock has overrun the planned time.")
-(defvar org-clock-update-period 60
- "Number of seconds between mode line clock string updates.")
-
-(defun org-clock-get-clock-string ()
- "Form a clock-string, that will be shown in the mode line.
-If an effort estimate was defined for the current item, use
-01:30/01:50 format (clocked/estimated).
-If not, show simply the clocked time like 01:50."
- (let* ((clocked-time (org-clock-get-clocked-time))
- (h (floor clocked-time 60))
- (m (- clocked-time (* 60 h))))
- (if org-clock-effort
- (let* ((effort-in-minutes
- (org-hh:mm-string-to-minutes org-clock-effort))
- (effort-h (floor effort-in-minutes 60))
- (effort-m (- effort-in-minutes (* effort-h 60)))
- (work-done-str
- (org-propertize
- (format org-time-clocksum-format h m)
- 'face (if (and org-task-overrun (not org-task-overrun-text))
- 'org-mode-line-clock-overrun 'org-mode-line-clock)))
- (effort-str (format org-time-clocksum-format effort-h effort-m))
- (clockstr (org-propertize
- (concat "[%s/" effort-str
- "] (" (replace-regexp-in-string "%" "%%" org-clock-heading) ")")
- 'face 'org-mode-line-clock)))
- (format clockstr work-done-str))
- (org-propertize (format
- (concat "[" org-time-clocksum-format " (%s)]")
- h m org-clock-heading)
- 'face 'org-mode-line-clock))))
-
-(defun org-clock-update-mode-line ()
- (if org-clock-effort
- (org-clock-notify-once-if-expired)
- (setq org-task-overrun nil))
- (setq org-mode-line-string
- (org-propertize
- (let ((clock-string (org-clock-get-clock-string))
- (help-text "Org-mode clock is running.\nmouse-1 shows a menu\nmouse-2 will jump to task"))
- (if (and (> org-clock-string-limit 0)
- (> (length clock-string) org-clock-string-limit))
- (org-propertize
- (substring clock-string 0 org-clock-string-limit)
- 'help-echo (concat help-text ": " org-clock-heading))
- (org-propertize clock-string 'help-echo help-text)))
- 'local-map org-clock-mode-line-map
- 'mouse-face (if (featurep 'xemacs) 'highlight 'mode-line-highlight)
- ))
- (if (and org-task-overrun org-task-overrun-text)
- (setq org-mode-line-string
- (concat (org-propertize
- org-task-overrun-text
- 'face 'org-mode-line-clock-overrun) org-mode-line-string)))
- (force-mode-line-update))
-
-(defun org-clock-get-clocked-time ()
- "Get the clocked time for the current item in minutes.
-The time returned includes the time spent on this task in
-previous clocking intervals."
- (let ((currently-clocked-time
- (floor (- (org-float-time)
- (org-float-time org-clock-start-time)) 60)))
- (+ currently-clocked-time (or org-clock-total-time 0))))
-
-(defun org-clock-modify-effort-estimate (&optional value)
- "Add to or set the effort estimate of the item currently being clocked.
-VALUE can be a number of minutes, or a string with format hh:mm or mm.
-When the string starts with a + or a - sign, the current value of the effort
-property will be changed by that amount.
-This will update the \"Effort\" property of currently clocked item, and
-the mode line."
- (interactive)
- (when (org-clock-is-active)
- (let ((current org-clock-effort) sign)
- (unless value
- ;; Prompt user for a value or a change
- (setq value
- (read-string
- (format "Set effort (hh:mm or mm%s): "
- (if current
- (format ", prefix + to add to %s" org-clock-effort)
- "")))))
- (when (stringp value)
- ;; A string. See if it is a delta
- (setq sign (string-to-char value))
- (if (member sign '(?- ?+))
- (setq current (org-hh:mm-string-to-minutes current)
- value (substring value 1))
- (setq current 0))
- (setq value (org-hh:mm-string-to-minutes value))
- (if (equal ?- sign)
- (setq value (- current value))
- (if (equal ?+ sign) (setq value (+ current value)))))
- (setq value (max 0 value)
- org-clock-effort (org-minutes-to-hh:mm-string value))
- (org-entry-put org-clock-marker "Effort" org-clock-effort)
- (org-clock-update-mode-line)
- (message "Effort is now %s" org-clock-effort))))
-
-(defvar org-clock-notification-was-shown nil
- "Shows if we have shown notification already.")
-
-(defun org-clock-notify-once-if-expired ()
- "Show notification if we spent more time than we estimated before.
-Notification is shown only once."
- (when (org-clocking-p)
- (let ((effort-in-minutes (org-hh:mm-string-to-minutes org-clock-effort))
- (clocked-time (org-clock-get-clocked-time)))
- (if (setq org-task-overrun
- (if (or (null effort-in-minutes) (zerop effort-in-minutes))
- nil
- (>= clocked-time effort-in-minutes)))
- (unless org-clock-notification-was-shown
- (setq org-clock-notification-was-shown t)
- (org-notify
- (format "Task '%s' should be finished by now. (%s)"
- org-clock-heading org-clock-effort) t))
- (setq org-clock-notification-was-shown nil)))))
-
-(defun org-notify (notification &optional play-sound)
- "Send a NOTIFICATION and maybe PLAY-SOUND."
- (org-show-notification notification)
- (if play-sound (org-clock-play-sound)))
-
-(defun org-show-notification (notification)
- "Show notification.
-Use `org-show-notification-handler' if defined,
-use libnotify if available, or fall back on a message."
- (cond ((functionp org-show-notification-handler)
- (funcall org-show-notification-handler notification))
- ((stringp org-show-notification-handler)
- (start-process "emacs-timer-notification" nil
- org-show-notification-handler notification))
- ((featurep 'notifications)
- (require 'notifications)
- (notifications-notify
- :title "Org-mode message"
- :body notification
- ;; FIXME how to link to the Org icon?
- ;; :app-icon "~/.emacs.d/icons/mail.png"
- :urgency 'low))
- ((org-program-exists "notify-send")
- (start-process "emacs-timer-notification" nil
- "notify-send" notification))
- ;; Maybe the handler will send a message, so only use message as
- ;; a fall back option
- (t (message "%s" notification))))
-
-(defun org-clock-play-sound ()
- "Play sound as configured by `org-clock-sound'.
-Use alsa's aplay tool if available."
- (cond
- ((not org-clock-sound))
- ((eq org-clock-sound t) (beep t) (beep t))
- ((stringp org-clock-sound)
- (let ((file (expand-file-name org-clock-sound)))
- (if (file-exists-p file)
- (if (org-program-exists "aplay")
- (start-process "org-clock-play-notification" nil
- "aplay" file)
- (condition-case nil
- (play-sound-file file)
- (error (beep t) (beep t)))))))))
-
-(defun org-program-exists (program-name)
- "Checks whenever we can locate program and launch it."
- (if (eq system-type 'gnu/linux)
- (= 0 (call-process "which" nil nil nil program-name))))
-
-(defvar org-clock-mode-line-entry nil
- "Information for the modeline about the running clock.")
-
-(defun org-find-open-clocks (file)
- "Search through the given file and find all open clocks."
- (let ((buf (or (get-file-buffer file)
- (find-file-noselect file)))
- clocks)
- (with-current-buffer buf
- (save-excursion
- (goto-char (point-min))
- (while (re-search-forward "CLOCK: \\(\\[.*?\\]\\)$" nil t)
- (push (cons (copy-marker (match-end 1) t)
- (org-time-string-to-time (match-string 1))) clocks))))
- clocks))
-
-(defsubst org-is-active-clock (clock)
- "Return t if CLOCK is the currently active clock."
- (and (org-clock-is-active)
- (= org-clock-marker (car clock))))
-
-(defmacro org-with-clock-position (clock &rest forms)
- "Evaluate FORMS with CLOCK as the current active clock."
- `(with-current-buffer (marker-buffer (car ,clock))
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (car ,clock))
- (beginning-of-line)
- ,@forms))))
-
-(put 'org-with-clock-position 'lisp-indent-function 1)
-
-(defmacro org-with-clock (clock &rest forms)
- "Evaluate FORMS with CLOCK as the current active clock.
-This macro also protects the current active clock from being altered."
- `(org-with-clock-position ,clock
- (let ((org-clock-start-time (cdr ,clock))
- (org-clock-total-time)
- (org-clock-history)
- (org-clock-effort)
- (org-clock-marker (car ,clock))
- (org-clock-hd-marker (save-excursion
- (outline-back-to-heading t)
- (point-marker))))
- ,@forms)))
-
-(put 'org-with-clock 'lisp-indent-function 1)
-
-(defsubst org-clock-clock-in (clock &optional resume start-time)
- "Clock in to the clock located by CLOCK.
-If necessary, clock-out of the currently active clock."
- (org-with-clock-position clock
- (let ((org-clock-in-resume (or resume org-clock-in-resume)))
- (org-clock-in nil start-time))))
-
-(defsubst org-clock-clock-out (clock &optional fail-quietly at-time)
- "Clock out of the clock located by CLOCK."
- (let ((temp (copy-marker (car clock)
- (marker-insertion-type (car clock)))))
- (if (org-is-active-clock clock)
- (org-clock-out fail-quietly at-time)
- (org-with-clock clock
- (org-clock-out fail-quietly at-time)))
- (setcar clock temp)))
-
-(defsubst org-clock-clock-cancel (clock)
- "Cancel the clock located by CLOCK."
- (let ((temp (copy-marker (car clock)
- (marker-insertion-type (car clock)))))
- (if (org-is-active-clock clock)
- (org-clock-cancel)
- (org-with-clock clock
- (org-clock-cancel)))
- (setcar clock temp)))
-
-(defvar org-clock-clocking-in nil)
-(defvar org-clock-resolving-clocks nil)
-(defvar org-clock-resolving-clocks-due-to-idleness nil)
-
-(defun org-clock-resolve-clock (clock resolve-to clock-out-time
- &optional close-p restart-p fail-quietly)
- "Resolve `CLOCK' given the time `RESOLVE-TO', and the present.
-`CLOCK' is a cons cell of the form (MARKER START-TIME)."
- (let ((org-clock-resolving-clocks t))
- (cond
- ((null resolve-to)
- (org-clock-clock-cancel clock)
- (if (and restart-p (not org-clock-clocking-in))
- (org-clock-clock-in clock)))
-
- ((eq resolve-to 'now)
- (if restart-p
- (error "RESTART-P is not valid here"))
- (if (or close-p org-clock-clocking-in)
- (org-clock-clock-out clock fail-quietly)
- (unless (org-is-active-clock clock)
- (org-clock-clock-in clock t))))
-
- ((not (time-less-p resolve-to (current-time)))
- (error "RESOLVE-TO must refer to a time in the past"))
-
- (t
- (if restart-p
- (error "RESTART-P is not valid here"))
- (org-clock-clock-out clock fail-quietly (or clock-out-time
- resolve-to))
- (unless org-clock-clocking-in
- (if close-p
- (setq org-clock-leftover-time (and (null clock-out-time)
- resolve-to))
- (org-clock-clock-in clock nil (and clock-out-time
- resolve-to))))))))
-
-(defun org-clock-jump-to-current-clock (&optional effective-clock)
- (interactive)
- (let ((clock (or effective-clock (cons org-clock-marker
- org-clock-start-time))))
- (unless (marker-buffer (car clock))
- (error "No clock is currently running"))
- (org-with-clock clock (org-clock-goto))
- (with-current-buffer (marker-buffer (car clock))
- (goto-char (car clock))
- (if org-clock-into-drawer
- (let ((logbook
- (if (stringp org-clock-into-drawer)
- (concat ":" org-clock-into-drawer ":")
- ":LOGBOOK:")))
- (ignore-errors
- (outline-flag-region
- (save-excursion
- (outline-back-to-heading t)
- (search-forward logbook)
- (goto-char (match-beginning 0)))
- (save-excursion
- (outline-back-to-heading t)
- (search-forward logbook)
- (search-forward ":END:")
- (goto-char (match-end 0)))
- nil)))))))
-
-(defun org-clock-resolve (clock &optional prompt-fn last-valid fail-quietly)
- "Resolve an open org-mode clock.
-An open clock was found, with `dangling' possibly being non-nil.
-If this function was invoked with a prefix argument, non-dangling
-open clocks are ignored. The given clock requires some sort of
-user intervention to resolve it, either because a clock was left
-dangling or due to an idle timeout. The clock resolution can
-either be:
-
- (a) deleted, the user doesn't care about the clock
- (b) restarted from the current time (if no other clock is open)
- (c) closed, giving the clock X minutes
- (d) closed and then restarted
- (e) resumed, as if the user had never left
-
-The format of clock is (CONS MARKER START-TIME), where MARKER
-identifies the buffer and position the clock is open at (and
-thus, the heading it's under), and START-TIME is when the clock
-was started."
- (assert clock)
- (let* ((ch
- (save-window-excursion
- (save-excursion
- (unless org-clock-resolving-clocks-due-to-idleness
- (org-clock-jump-to-current-clock clock))
- (unless org-clock-resolve-expert
- (with-output-to-temp-buffer "*Org Clock*"
- (princ "Select a Clock Resolution Command:
-
-i/q/C-g Ignore this question; the same as keeping all the idle time.
-
-k/K Keep X minutes of the idle time (default is all). If this
- amount is less than the default, you will be clocked out
- that many minutes after the time that idling began, and then
- clocked back in at the present time.
-g/G Indicate that you \"got back\" X minutes ago. This is quite
- different from 'k': it clocks you out from the beginning of
- the idle period and clock you back in X minutes ago.
-s/S Subtract the idle time from the current clock. This is the
- same as keeping 0 minutes.
-C Cancel the open timer altogether. It will be as though you
- never clocked in.
-j/J Jump to the current clock, to make manual adjustments.
-
-For all these options, using uppercase makes your final state
-to be CLOCKED OUT.")))
- (org-fit-window-to-buffer (get-buffer-window "*Org Clock*"))
- (let (char-pressed)
- (when (featurep 'xemacs)
- (message (concat (funcall prompt-fn clock)
- " [jkKgGsScCiq]? "))
- (setq char-pressed (read-char-exclusive)))
- (while (or (null char-pressed)
- (and (not (memq char-pressed
- '(?k ?K ?g ?G ?s ?S ?C
- ?j ?J ?i ?q)))
- (or (ding) t)))
- (setq char-pressed
- (read-char (concat (funcall prompt-fn clock)
- " [jkKgGSscCiq]? ")
- nil 45)))
- (and (not (memq char-pressed '(?i ?q))) char-pressed)))))
- (default
- (floor (/ (org-float-time
- (time-subtract (current-time) last-valid)) 60)))
- (keep
- (and (memq ch '(?k ?K))
- (read-number "Keep how many minutes? " default)))
- (gotback
- (and (memq ch '(?g ?G))
- (read-number "Got back how many minutes ago? " default)))
- (subtractp (memq ch '(?s ?S)))
- (barely-started-p (< (- (org-float-time last-valid)
- (org-float-time (cdr clock))) 45))
- (start-over (and subtractp barely-started-p)))
- (cond
- ((memq ch '(?j ?J))
- (if (eq ch ?J)
- (org-clock-resolve-clock clock 'now nil t nil fail-quietly))
- (org-clock-jump-to-current-clock clock))
- ((or (null ch)
- (not (memq ch '(?k ?K ?g ?G ?s ?S ?C))))
- (message ""))
- (t
- (org-clock-resolve-clock
- clock (cond
- ((or (eq ch ?C)
- ;; If the time on the clock was less than a minute before
- ;; the user went away, and they've ask to subtract all the
- ;; time...
- start-over)
- nil)
- ((or subtractp
- (and gotback (= gotback 0)))
- last-valid)
- ((or (and keep (= keep default))
- (and gotback (= gotback default)))
- 'now)
- (keep
- (time-add last-valid (seconds-to-time (* 60 keep))))
- (gotback
- (time-subtract (current-time)
- (seconds-to-time (* 60 gotback))))
- (t
- (error "Unexpected, please report this as a bug")))
- (and gotback last-valid)
- (memq ch '(?K ?G ?S))
- (and start-over
- (not (memq ch '(?K ?G ?S ?C))))
- fail-quietly)))))
-
-(defun org-resolve-clocks (&optional only-dangling-p prompt-fn last-valid)
- "Resolve all currently open org-mode clocks.
-If `only-dangling-p' is non-nil, only ask to resolve dangling
-\(i.e., not currently open and valid) clocks."
- (interactive "P")
- (unless org-clock-resolving-clocks
- (let ((org-clock-resolving-clocks t))
- (dolist (file (org-files-list))
- (let ((clocks (org-find-open-clocks file)))
- (dolist (clock clocks)
- (let ((dangling (or (not (org-clock-is-active))
- (/= (car clock) org-clock-marker))))
- (if (or (not only-dangling-p) dangling)
- (org-clock-resolve
- clock
- (or prompt-fn
- (function
- (lambda (clock)
- (format
- "Dangling clock started %d mins ago"
- (floor
- (/ (- (org-float-time (current-time))
- (org-float-time (cdr clock))) 60))))))
- (or last-valid
- (cdr clock)))))))))))
-
-(defun org-emacs-idle-seconds ()
- "Return the current Emacs idle time in seconds, or nil if not idle."
- (let ((idle-time (current-idle-time)))
- (if idle-time
- (org-float-time idle-time)
- 0)))
-
-(defun org-mac-idle-seconds ()
- "Return the current Mac idle time in seconds."
- (string-to-number (shell-command-to-string "ioreg -c IOHIDSystem | perl -ane 'if (/Idle/) {$idle=(pop @F)/1000000000; print $idle; last}'")))
-
-(defun org-x11-idle-seconds ()
- "Return the current X11 idle time in seconds."
- (/ (string-to-number (shell-command-to-string "x11idle")) 1000))
-
-(defun org-user-idle-seconds ()
- "Return the number of seconds the user has been idle for.
-This routine returns a floating point number."
- (cond
- ((eq system-type 'darwin)
- (org-mac-idle-seconds))
- ((eq window-system 'x)
- (org-x11-idle-seconds))
- (t
- (org-emacs-idle-seconds))))
-
-(defvar org-clock-user-idle-seconds)
-
-(defun org-resolve-clocks-if-idle ()
- "Resolve all currently open org-mode clocks.
-This is performed after `org-clock-idle-time' minutes, to check
-if the user really wants to stay clocked in after being idle for
-so long."
- (when (and org-clock-idle-time (not org-clock-resolving-clocks)
- org-clock-marker)
- (let* ((org-clock-user-idle-seconds (org-user-idle-seconds))
- (org-clock-user-idle-start
- (time-subtract (current-time)
- (seconds-to-time org-clock-user-idle-seconds)))
- (org-clock-resolving-clocks-due-to-idleness t))
- (if (> org-clock-user-idle-seconds (* 60 org-clock-idle-time))
- (org-clock-resolve
- (cons org-clock-marker
- org-clock-start-time)
- (function
- (lambda (clock)
- (format "Clocked in & idle for %.1f mins"
- (/ (org-float-time
- (time-subtract (current-time)
- org-clock-user-idle-start))
- 60.0))))
- org-clock-user-idle-start)))))
-
-(defun org-clock-in (&optional select start-time)
- "Start the clock on the current item.
-If necessary, clock-out of the currently active clock.
-With a prefix argument SELECT (\\[universal-argument]), offer a list of \
-recently clocked tasks to
-clock into. When SELECT is \\[universal-argument] \\[universal-argument], \
-clock into the current task and mark
-is as the default task, a special task that will always be offered in
-the clocking selection, associated with the letter `d'."
- (interactive "P")
- (setq org-clock-notification-was-shown nil)
- (catch 'abort
- (let ((interrupting (and (not org-clock-resolving-clocks-due-to-idleness)
- (org-clocking-p)))
- ts selected-task target-pos (msg-extra "")
- (leftover (and (not org-clock-resolving-clocks)
- org-clock-leftover-time)))
- (when (and org-clock-auto-clock-resolution
- (or (not interrupting)
- (eq t org-clock-auto-clock-resolution))
- (not org-clock-clocking-in)
- (not org-clock-resolving-clocks))
- (setq org-clock-leftover-time nil)
- (let ((org-clock-clocking-in t))
- (org-resolve-clocks))) ; check if any clocks are dangling
- (when (equal select '(4))
- (setq selected-task (org-clock-select-task "Clock-in on task: "))
- (if selected-task
- (setq selected-task (copy-marker selected-task))
- (error "Abort")))
- (when interrupting
- ;; We are interrupting the clocking of a different task.
- ;; Save a marker to this task, so that we can go back.
- ;; First check if we are trying to clock into the same task!
- (when (save-excursion
- (unless selected-task
- (org-back-to-heading t))
- (and (equal (marker-buffer org-clock-hd-marker)
- (if selected-task
- (marker-buffer selected-task)
- (current-buffer)))
- (= (marker-position org-clock-hd-marker)
- (if selected-task
- (marker-position selected-task)
- (point)))))
- (message "Clock continues in \"%s\"" org-clock-heading)
- (throw 'abort nil))
- (move-marker org-clock-interrupted-task
- (marker-position org-clock-marker)
- (marker-buffer org-clock-marker))
- (let ((org-clock-clocking-in t))
- (org-clock-out t)))
-
- (when (equal select '(16))
- ;; Mark as default clocking task
- (org-clock-mark-default-task))
-
- ;; Clock in at which position?
- (setq target-pos
- (if (and (eobp) (not (org-on-heading-p)))
- (point-at-bol 0)
- (point)))
- (run-hooks 'org-clock-in-prepare-hook)
- (save-excursion
- (when (and selected-task (marker-buffer selected-task))
- ;; There is a selected task, move to the correct buffer
- ;; and set the new target position.
- (set-buffer (org-base-buffer (marker-buffer selected-task)))
- (setq target-pos (marker-position selected-task))
- (move-marker selected-task nil))
- (save-excursion
- (save-restriction
- (widen)
- (goto-char target-pos)
- (org-back-to-heading t)
- (or interrupting (move-marker org-clock-interrupted-task nil))
- (org-clock-history-push)
- (org-clock-set-current)
- (cond ((functionp org-clock-in-switch-to-state)
- (looking-at org-complex-heading-regexp)
- (let ((newstate (funcall org-clock-in-switch-to-state
- (match-string 2))))
- (if newstate (org-todo newstate))))
- ((and org-clock-in-switch-to-state
- (not (looking-at (concat outline-regexp "[ \t]*"
- org-clock-in-switch-to-state
- "\\>"))))
- (org-todo org-clock-in-switch-to-state)))
- (setq org-clock-heading-for-remember
- (and (looking-at org-complex-heading-regexp)
- (match-end 4)
- (org-trim (buffer-substring (match-end 1)
- (match-end 4)))))
- (setq org-clock-heading
- (cond ((and org-clock-heading-function
- (functionp org-clock-heading-function))
- (funcall org-clock-heading-function))
- ((looking-at org-complex-heading-regexp)
- (replace-regexp-in-string
- "\\[\\[.*?\\]\\[\\(.*?\\)\\]\\]" "\\1"
- (match-string 4)))
- (t "???")))
- (setq org-clock-heading (org-propertize org-clock-heading
- 'face nil))
- (org-clock-find-position org-clock-in-resume)
- (cond
- ((and org-clock-in-resume
- (looking-at
- (concat "^[ \t]* " org-clock-string
- " \\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}"
- " +\\sw+\.? +[012][0-9]:[0-5][0-9]\\)\\][ \t]*$")))
- (message "Matched %s" (match-string 1))
- (setq ts (concat "[" (match-string 1) "]"))
- (goto-char (match-end 1))
- (setq org-clock-start-time
- (apply 'encode-time
- (org-parse-time-string (match-string 1))))
- (setq org-clock-effort (org-get-effort))
- (setq org-clock-total-time (org-clock-sum-current-item
- (org-clock-get-sum-start))))
- ((eq org-clock-in-resume 'auto-restart)
- ;; called from org-clock-load during startup,
- ;; do not interrupt, but warn!
- (message "Cannot restart clock because task does not contain unfinished clock")
- (ding)
- (sit-for 2)
- (throw 'abort nil))
- (t
- (insert-before-markers "\n")
- (backward-char 1)
- (org-indent-line-function)
- (when (and (save-excursion
- (end-of-line 0)
- (org-in-item-p)))
- (beginning-of-line 1)
- (org-indent-line-to (- (org-get-indentation) 2)))
- (insert org-clock-string " ")
- (setq org-clock-effort (org-get-effort))
- (setq org-clock-total-time (org-clock-sum-current-item
- (org-clock-get-sum-start)))
- (setq org-clock-start-time
- (or (and leftover
- (y-or-n-p
- (format
- "You stopped another clock %d mins ago; start this one from then? "
- (/ (- (org-float-time (current-time))
- (org-float-time leftover)) 60)))
- leftover)
- start-time
- (current-time)))
- (setq ts (org-insert-time-stamp org-clock-start-time
- 'with-hm 'inactive))))
- (move-marker org-clock-marker (point) (buffer-base-buffer))
- (move-marker org-clock-hd-marker
- (save-excursion (org-back-to-heading t) (point))
- (buffer-base-buffer))
- (setq org-clock-has-been-used t)
- (or global-mode-string (setq global-mode-string '("")))
- (or (memq 'org-mode-line-string global-mode-string)
- (setq global-mode-string
- (append global-mode-string '(org-mode-line-string))))
- (org-clock-update-mode-line)
- (when org-clock-mode-line-timer
- (cancel-timer org-clock-mode-line-timer)
- (setq org-clock-mode-line-timer nil))
- (setq org-clock-mode-line-timer
- (run-with-timer org-clock-update-period
- org-clock-update-period
- 'org-clock-update-mode-line))
- (when org-clock-idle-timer
- (cancel-timer org-clock-idle-timer)
- (setq org-clock-idle-timer nil))
- (setq org-clock-idle-timer
- (run-with-timer 60 60 'org-resolve-clocks-if-idle))
- (message "Clock starts at %s - %s" ts msg-extra)
- (run-hooks 'org-clock-in-hook)))))))
-
-(defvar org-clock-current-task nil
- "Task currently clocked in.")
-(defun org-clock-set-current ()
- "Set `org-clock-current-task' to the task currently clocked in."
- (setq org-clock-current-task (nth 4 (org-heading-components))))
-
-(defun org-clock-delete-current ()
- "Reset `org-clock-current-task' to nil."
- (setq org-clock-current-task nil))
-
-(defun org-clock-mark-default-task ()
- "Mark current task as default task."
- (interactive)
- (save-excursion
- (org-back-to-heading t)
- (move-marker org-clock-default-task (point))))
-
-(defvar msg-extra)
-(defun org-clock-get-sum-start ()
- "Return the time from which clock times should be counted.
-This is for the currently running clock as it is displayed
-in the mode line. This function looks at the properties
-LAST_REPEAT and in particular CLOCK_MODELINE_TOTAL and the
-corresponding variable `org-clock-modeline-total' and then
-decides which time to use."
- (let ((cmt (or (org-entry-get nil "CLOCK_MODELINE_TOTAL")
- (symbol-name org-clock-modeline-total)))
- (lr (org-entry-get nil "LAST_REPEAT")))
- (cond
- ((equal cmt "current")
- (setq msg-extra "showing time in current clock instance")
- (current-time))
- ((equal cmt "today")
- (setq msg-extra "showing today's task time.")
- (let* ((dt (decode-time (current-time))))
- (setq dt (append (list 0 0 0) (nthcdr 3 dt)))
- (if org-extend-today-until
- (setf (nth 2 dt) org-extend-today-until))
- (apply 'encode-time dt)))
- ((or (equal cmt "all")
- (and (or (not cmt) (equal cmt "auto"))
- (not lr)))
- (setq msg-extra "showing entire task time.")
- nil)
- ((or (equal cmt "repeat")
- (and (or (not cmt) (equal cmt "auto"))
- lr))
- (setq msg-extra "showing task time since last repeat.")
- (if (not lr)
- nil
- (org-time-string-to-time lr)))
- (t nil))))
-
-(defun org-clock-find-position (find-unclosed)
- "Find the location where the next clock line should be inserted.
-When FIND-UNCLOSED is non-nil, first check if there is an unclosed clock
-line and position cursor in that line."
- (org-back-to-heading t)
- (catch 'exit
- (let ((beg (save-excursion
- (beginning-of-line 2)
- (or (bolp) (newline))
- (point)))
- (end (progn (outline-next-heading) (point)))
- (re (concat "^[ \t]*" org-clock-string))
- (cnt 0)
- (drawer (if (stringp org-clock-into-drawer)
- org-clock-into-drawer "LOGBOOK"))
- first last ind-last)
- (goto-char beg)
- (when (and find-unclosed
- (re-search-forward
- (concat "^[ \t]* " org-clock-string
- " \\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}"
- " +\\sw+ +[012][0-9]:[0-5][0-9]\\)\\][ \t]*$")
- end t))
- (beginning-of-line 1)
- (throw 'exit t))
- (when (eobp) (newline) (setq end (max (point) end)))
- (when (re-search-forward (concat "^[ \t]*:" drawer ":") end t)
- ;; we seem to have a CLOCK drawer, so go there.
- (beginning-of-line 2)
- (or org-log-states-order-reversed
- (and (re-search-forward org-property-end-re nil t)
- (goto-char (match-beginning 0))))
- (throw 'exit t))
- ;; Lets count the CLOCK lines
- (goto-char beg)
- (while (re-search-forward re end t)
- (setq first (or first (match-beginning 0))
- last (match-beginning 0)
- cnt (1+ cnt)))
- (when (and (integerp org-clock-into-drawer)
- last
- (>= (1+ cnt) org-clock-into-drawer))
- ;; Wrap current entries into a new drawer
- (goto-char last)
- (setq ind-last (org-get-indentation))
- (beginning-of-line 2)
- (if (and (>= (org-get-indentation) ind-last)
- (org-at-item-p))
- (org-end-of-item))
- (insert ":END:\n")
- (beginning-of-line 0)
- (org-indent-line-to ind-last)
- (goto-char first)
- (insert ":" drawer ":\n")
- (beginning-of-line 0)
- (org-indent-line-function)
- (org-flag-drawer t)
- (beginning-of-line 2)
- (or org-log-states-order-reversed
- (and (re-search-forward org-property-end-re nil t)
- (goto-char (match-beginning 0))))
- (throw 'exit nil))
-
- (goto-char beg)
- (while (and (looking-at (concat "[ \t]*" org-keyword-time-regexp))
- (not (equal (match-string 1) org-clock-string)))
- ;; Planning info, skip to after it
- (beginning-of-line 2)
- (or (bolp) (newline)))
- (when (or (eq org-clock-into-drawer t)
- (stringp org-clock-into-drawer)
- (and (integerp org-clock-into-drawer)
- (< org-clock-into-drawer 2)))
- (insert ":" drawer ":\n:END:\n")
- (beginning-of-line -1)
- (org-indent-line-function)
- (org-flag-drawer t)
- (beginning-of-line 2)
- (org-indent-line-function)
- (beginning-of-line)
- (or org-log-states-order-reversed
- (and (re-search-forward org-property-end-re nil t)
- (goto-char (match-beginning 0))))))))
-
-(defun org-clock-out (&optional fail-quietly at-time)
- "Stop the currently running clock.
-If there is no running clock, throw an error, unless FAIL-QUIETLY is set."
- (interactive)
- (catch 'exit
- (when (not (org-clocking-p))
- (setq global-mode-string
- (delq 'org-mode-line-string global-mode-string))
- (force-mode-line-update)
- (if fail-quietly (throw 'exit t) (error "No active clock")))
- (let (ts te s h m remove)
- (save-excursion ; Do not replace this with `with-current-buffer'.
- (with-no-warnings (set-buffer (org-clocking-buffer)))
- (save-restriction
- (widen)
- (goto-char org-clock-marker)
- (beginning-of-line 1)
- (if (and (looking-at (concat "[ \t]*" org-keyword-time-regexp))
- (equal (match-string 1) org-clock-string))
- (setq ts (match-string 2))
- (if fail-quietly (throw 'exit nil) (error "Clock start time is gone")))
- (goto-char (match-end 0))
- (delete-region (point) (point-at-eol))
- (insert "--")
- (setq te (org-insert-time-stamp (or at-time (current-time))
- 'with-hm 'inactive))
- (setq s (- (org-float-time (apply 'encode-time (org-parse-time-string te)))
- (org-float-time (apply 'encode-time (org-parse-time-string ts))))
- h (floor (/ s 3600))
- s (- s (* 3600 h))
- m (floor (/ s 60))
- s (- s (* 60 s)))
- (insert " => " (format "%2d:%02d" h m))
- (when (setq remove (and org-clock-out-remove-zero-time-clocks
- (= (+ h m) 0)))
- (beginning-of-line 1)
- (delete-region (point) (point-at-eol))
- (and (looking-at "\n") (> (point-max) (1+ (point)))
- (delete-char 1)))
- (move-marker org-clock-marker nil)
- (move-marker org-clock-hd-marker nil)
- (when org-log-note-clock-out
- (org-add-log-setup 'clock-out nil nil nil nil
- (concat "# Task: " (org-get-heading t) "\n\n")))
- (when org-clock-mode-line-timer
- (cancel-timer org-clock-mode-line-timer)
- (setq org-clock-mode-line-timer nil))
- (when org-clock-idle-timer
- (cancel-timer org-clock-idle-timer)
- (setq org-clock-idle-timer nil))
- (setq global-mode-string
- (delq 'org-mode-line-string global-mode-string))
- (when org-clock-out-switch-to-state
- (save-excursion
- (org-back-to-heading t)
- (let ((org-inhibit-logging t)
- (org-clock-out-when-done nil))
- (cond
- ((functionp org-clock-out-switch-to-state)
- (looking-at org-complex-heading-regexp)
- (let ((newstate (funcall org-clock-out-switch-to-state
- (match-string 2))))
- (if newstate (org-todo newstate))))
- ((and org-clock-out-switch-to-state
- (not (looking-at (concat outline-regexp "[ \t]*"
- org-clock-out-switch-to-state
- "\\>"))))
- (org-todo org-clock-out-switch-to-state))))))
- (force-mode-line-update)
- (message (concat "Clock stopped at %s after HH:MM = " org-time-clocksum-format "%s") te h m
- (if remove " => LINE REMOVED" ""))
- (run-hooks 'org-clock-out-hook)
- (org-clock-delete-current))))))
-
-(defun org-clock-cancel ()
- "Cancel the running clock by removing the start timestamp."
- (interactive)
- (when (not (org-clocking-p))
- (setq global-mode-string
- (delq 'org-mode-line-string global-mode-string))
- (force-mode-line-update)
- (error "No active clock"))
- (save-excursion ; Do not replace this with `with-current-buffer'.
- (with-no-warnings (set-buffer (org-clocking-buffer)))
- (goto-char org-clock-marker)
- (delete-region (1- (point-at-bol)) (point-at-eol))
- ;; Just in case, remove any empty LOGBOOK left over
- (org-remove-empty-drawer-at "LOGBOOK" (point)))
- (move-marker org-clock-marker nil)
- (move-marker org-clock-hd-marker nil)
- (setq global-mode-string
- (delq 'org-mode-line-string global-mode-string))
- (force-mode-line-update)
- (message "Clock canceled")
- (run-hooks 'org-clock-cancel-hook))
-
-(defun org-clock-goto (&optional select)
- "Go to the currently clocked-in entry, or to the most recently clocked one.
-With prefix arg SELECT, offer recently clocked tasks for selection."
- (interactive "@P")
- (let* ((recent nil)
- (m (cond
- (select
- (or (org-clock-select-task "Select task to go to: ")
- (error "No task selected")))
- ((org-clocking-p) org-clock-marker)
- ((and org-clock-goto-may-find-recent-task
- (car org-clock-history)
- (marker-buffer (car org-clock-history)))
- (setq recent t)
- (car org-clock-history))
- (t (error "No active or recent clock task")))))
- (switch-to-buffer (marker-buffer m))
- (if (or (< m (point-min)) (> m (point-max))) (widen))
- (goto-char m)
- (org-show-entry)
- (org-back-to-heading t)
- (org-cycle-hide-drawers 'children)
- (recenter)
- (org-reveal)
- (if recent
- (message "No running clock, this is the most recently clocked task"))
- (run-hooks 'org-clock-goto-hook)))
-
-(defvar org-clock-file-total-minutes nil
- "Holds the file total time in minutes, after a call to `org-clock-sum'.")
-(make-variable-buffer-local 'org-clock-file-total-minutes)
-
-(defun org-clock-sum (&optional tstart tend headline-filter)
- "Sum the times for each subtree.
-Puts the resulting times in minutes as a text property on each headline.
-TSTART and TEND can mark a time range to be considered. HEADLINE-FILTER is a
-zero-arg function that, if specified, is called for each headline in the time
-range with point at the headline. Headlines for which HEADLINE-FILTER returns
-nil are excluded from the clock summation."
- (interactive)
- (let* ((bmp (buffer-modified-p))
- (re (concat "^\\(\\*+\\)[ \t]\\|^[ \t]*"
- org-clock-string
- "[ \t]*\\(?:\\(\\[.*?\\]\\)-+\\(\\[.*?\\]\\)\\|=>[ \t]+\\([0-9]+\\):\\([0-9]+\\)\\)"))
- (lmax 30)
- (ltimes (make-vector lmax 0))
- (t1 0)
- (level 0)
- ts te dt
- time)
- (if (stringp tstart) (setq tstart (org-time-string-to-seconds tstart)))
- (if (stringp tend) (setq tend (org-time-string-to-seconds tend)))
- (if (consp tstart) (setq tstart (org-float-time tstart)))
- (if (consp tend) (setq tend (org-float-time tend)))
- (remove-text-properties (point-min) (point-max)
- '(:org-clock-minutes t
- :org-clock-force-headline-inclusion t))
- (save-excursion
- (goto-char (point-max))
- (while (re-search-backward re nil t)
- (cond
- ((match-end 2)
- ;; Two time stamps
- (setq ts (match-string 2)
- te (match-string 3)
- ts (org-float-time
- (apply 'encode-time (org-parse-time-string ts)))
- te (org-float-time
- (apply 'encode-time (org-parse-time-string te)))
- ts (if tstart (max ts tstart) ts)
- te (if tend (min te tend) te)
- dt (- te ts)
- t1 (if (> dt 0) (+ t1 (floor (/ dt 60))) t1)))
- ((match-end 4)
- ;; A naked time
- (setq t1 (+ t1 (string-to-number (match-string 5))
- (* 60 (string-to-number (match-string 4))))))
- (t ;; A headline
- ;; Add the currently clocking item time to the total
- (when (and org-clock-report-include-clocking-task
- (equal (org-clocking-buffer) (current-buffer))
- (equal (marker-position org-clock-hd-marker) (point))
- tstart
- tend
- (>= (org-float-time org-clock-start-time) tstart)
- (<= (org-float-time org-clock-start-time) tend))
- (let ((time (floor (- (org-float-time)
- (org-float-time org-clock-start-time)) 60)))
- (setq t1 (+ t1 time))))
- (let* ((headline-forced
- (get-text-property (point)
- :org-clock-force-headline-inclusion))
- (headline-included
- (or (null headline-filter)
- (save-excursion
- (save-match-data (funcall headline-filter))))))
- (setq level (- (match-end 1) (match-beginning 1)))
- (when (or (> t1 0) (> (aref ltimes level) 0))
- (when (or headline-included headline-forced)
- (if headline-included
- (loop for l from 0 to level do
- (aset ltimes l (+ (aref ltimes l) t1))))
- (setq time (aref ltimes level))
- (goto-char (match-beginning 0))
- (put-text-property (point) (point-at-eol) :org-clock-minutes time)
- (if headline-filter
- (save-excursion
- (save-match-data
- (while
- (> (funcall outline-level) 1)
- (outline-up-heading 1 t)
- (put-text-property
- (point) (point-at-eol)
- :org-clock-force-headline-inclusion t))))))
- (setq t1 0)
- (loop for l from level to (1- lmax) do
- (aset ltimes l 0)))))))
- (setq org-clock-file-total-minutes (aref ltimes 0)))
- (set-buffer-modified-p bmp)))
-
-(defun org-clock-sum-current-item (&optional tstart)
- "Return time, clocked on current item in total."
- (save-excursion
- (save-restriction
- (org-narrow-to-subtree)
- (org-clock-sum tstart)
- org-clock-file-total-minutes)))
-
-(defun org-clock-display (&optional total-only)
- "Show subtree times in the entire buffer.
-If TOTAL-ONLY is non-nil, only show the total time for the entire file
-in the echo area."
- (interactive)
- (org-clock-remove-overlays)
- (let (time h m p)
- (org-clock-sum)
- (unless total-only
- (save-excursion
- (goto-char (point-min))
- (while (or (and (equal (setq p (point)) (point-min))
- (get-text-property p :org-clock-minutes))
- (setq p (next-single-property-change
- (point) :org-clock-minutes)))
- (goto-char p)
- (when (setq time (get-text-property p :org-clock-minutes))
- (org-clock-put-overlay time (funcall outline-level))))
- (setq h (/ org-clock-file-total-minutes 60)
- m (- org-clock-file-total-minutes (* 60 h)))
- ;; Arrange to remove the overlays upon next change.
- (when org-remove-highlights-with-change
- (org-add-hook 'before-change-functions 'org-clock-remove-overlays
- nil 'local))))
- (if org-time-clocksum-use-fractional
- (message (concat "Total file time: " org-time-clocksum-fractional-format
- " (%d hours and %d minutes)")
- (/ (+ (* h 60.0) m) 60.0) h m)
- (message (concat "Total file time: " org-time-clocksum-format
- " (%d hours and %d minutes)") h m h m))))
-
-(defvar org-clock-overlays nil)
-(make-variable-buffer-local 'org-clock-overlays)
-
-(defun org-clock-put-overlay (time &optional level)
- "Put an overlays on the current line, displaying TIME.
-If LEVEL is given, prefix time with a corresponding number of stars.
-This creates a new overlay and stores it in `org-clock-overlays', so that it
-will be easy to remove."
- (let* ((c 60) (h (floor (/ time 60))) (m (- time (* 60 h)))
- (l (if level (org-get-valid-level level 0) 0))
- (fmt (concat "%s " (if org-time-clocksum-use-fractional
- org-time-clocksum-fractional-format
- org-time-clocksum-format) "%s"))
- (off 0)
- ov tx)
- (org-move-to-column c)
- (unless (eolp) (skip-chars-backward "^ \t"))
- (skip-chars-backward " \t")
- (setq ov (make-overlay (1- (point)) (point-at-eol))
- tx (concat (buffer-substring (1- (point)) (point))
- (make-string (+ off (max 0 (- c (current-column)))) ?.)
- (org-add-props (if org-time-clocksum-use-fractional
- (format fmt
- (make-string l ?*)
- (/ (+ (* h 60.0) m) 60.0)
- (make-string (- 16 l) ?\ ))
- (format fmt
- (make-string l ?*) h m
- (make-string (- 16 l) ?\ )))
- (list 'face 'org-clock-overlay))
- ""))
- (if (not (featurep 'xemacs))
- (overlay-put ov 'display tx)
- (overlay-put ov 'invisible t)
- (overlay-put ov 'end-glyph (make-glyph tx)))
- (push ov org-clock-overlays)))
-
-(defun org-clock-remove-overlays (&optional beg end noremove)
- "Remove the occur highlights from the buffer.
-BEG and END are ignored. If NOREMOVE is nil, remove this function
-from the `before-change-functions' in the current buffer."
- (interactive)
- (unless org-inhibit-highlight-removal
- (mapc 'delete-overlay org-clock-overlays)
- (setq org-clock-overlays nil)
- (unless noremove
- (remove-hook 'before-change-functions
- 'org-clock-remove-overlays 'local))))
-
-(defvar state) ;; dynamically scoped into this function
-(defun org-clock-out-if-current ()
- "Clock out if the current entry contains the running clock.
-This is used to stop the clock after a TODO entry is marked DONE,
-and is only done if the variable `org-clock-out-when-done' is not nil."
- (when (and org-clock-out-when-done
- (or (and (eq t org-clock-out-when-done)
- (member state org-done-keywords))
- (and (listp org-clock-out-when-done)
- (member state org-clock-out-when-done)))
- (equal (or (buffer-base-buffer (org-clocking-buffer))
- (org-clocking-buffer))
- (or (buffer-base-buffer (current-buffer))
- (current-buffer)))
- (< (point) org-clock-marker)
- (> (save-excursion (outline-next-heading) (point))
- org-clock-marker))
- ;; Clock out, but don't accept a logging message for this.
- (let ((org-log-note-clock-out nil)
- (org-clock-out-switch-to-state nil))
- (org-clock-out))))
-
-(add-hook 'org-after-todo-state-change-hook
- 'org-clock-out-if-current)
-
-;;;###autoload
-(defun org-get-clocktable (&rest props)
- "Get a formatted clocktable with parameters according to PROPS.
-The table is created in a temporary buffer, fully formatted and
-fontified, and then returned."
- ;; Set the defaults
- (setq props (plist-put props :name "clocktable"))
- (unless (plist-member props :maxlevel)
- (setq props (plist-put props :maxlevel 2)))
- (unless (plist-member props :scope)
- (setq props (plist-put props :scope 'agenda)))
- (with-temp-buffer
- (org-mode)
- (org-create-dblock props)
- (org-update-dblock)
- (font-lock-fontify-buffer)
- (forward-line 2)
- (buffer-substring (point) (progn
- (re-search-forward "^[ \t]*#\\+END" nil t)
- (point-at-bol)))))
-
-(defun org-clock-report (&optional arg)
- "Create a table containing a report about clocked time.
-If the cursor is inside an existing clocktable block, then the table
-will be updated. If not, a new clocktable will be inserted.
-When called with a prefix argument, move to the first clock table in the
-buffer and update it."
- (interactive "P")
- (org-clock-remove-overlays)
- (when arg
- (org-find-dblock "clocktable")
- (org-show-entry))
- (if (org-in-clocktable-p)
- (goto-char (org-in-clocktable-p))
- (org-create-dblock (append (list :name "clocktable")
- org-clock-clocktable-default-properties)))
- (org-update-dblock))
-
-(defun org-in-clocktable-p ()
- "Check if the cursor is in a clocktable."
- (let ((pos (point)) start)
- (save-excursion
- (end-of-line 1)
- (and (re-search-backward "^[ \t]*#\\+BEGIN:[ \t]+clocktable" nil t)
- (setq start (match-beginning 0))
- (re-search-forward "^[ \t]*#\\+END:.*" nil t)
- (>= (match-end 0) pos)
- start))))
-
-(defun org-day-of-week (day month year)
- "Returns the day of the week as an integer."
- (nth 6
- (decode-time
- (date-to-time
- (format "%d-%02d-%02dT00:00:00" year month day)))))
-
-(defun org-quarter-to-date (quarter year)
- "Get the date (week day year) of the first day of a given quarter."
- (let (startday)
- (cond
- ((= quarter 1)
- (setq startday (org-day-of-week 1 1 year))
- (cond
- ((= startday 0)
- (list 52 7 (- year 1)))
- ((= startday 6)
- (list 52 6 (- year 1)))
- ((<= startday 4)
- (list 1 startday year))
- ((> startday 4)
- (list 53 startday (- year 1)))
- )
- )
- ((= quarter 2)
- (setq startday (org-day-of-week 1 4 year))
- (cond
- ((= startday 0)
- (list 13 startday year))
- ((< startday 4)
- (list 14 startday year))
- ((>= startday 4)
- (list 13 startday year))
- )
- )
- ((= quarter 3)
- (setq startday (org-day-of-week 1 7 year))
- (cond
- ((= startday 0)
- (list 26 startday year))
- ((< startday 4)
- (list 27 startday year))
- ((>= startday 4)
- (list 26 startday year))
- )
- )
- ((= quarter 4)
- (setq startday (org-day-of-week 1 10 year))
- (cond
- ((= startday 0)
- (list 39 startday year))
- ((<= startday 4)
- (list 40 startday year))
- ((> startday 4)
- (list 39 startday year)))))))
-
-(defun org-clock-special-range (key &optional time as-strings)
- "Return two times bordering a special time range.
-Key is a symbol specifying the range and can be one of `today', `yesterday',
-`thisweek', `lastweek', `thismonth', `lastmonth', `thisyear', `lastyear'.
-A week starts Monday 0:00 and ends Sunday 24:00.
-The range is determined relative to TIME. TIME defaults to the current time.
-The return value is a cons cell with two internal times like the ones
-returned by `current time' or `encode-time'. if AS-STRINGS is non-nil,
-the returned times will be formatted strings."
- (if (integerp key) (setq key (intern (number-to-string key))))
- (let* ((tm (decode-time (or time (current-time))))
- (s 0) (m (nth 1 tm)) (h (nth 2 tm))
- (d (nth 3 tm)) (month (nth 4 tm)) (y (nth 5 tm))
- (dow (nth 6 tm))
- (skey (symbol-name key))
- (shift 0)
- (q (cond ((>= (nth 4 tm) 10) 4)
- ((>= (nth 4 tm) 7) 3)
- ((>= (nth 4 tm) 4) 2)
- ((>= (nth 4 tm) 1) 1)))
- s1 m1 h1 d1 month1 y1 diff ts te fm txt w date
- interval tmp shiftedy shiftedm shiftedq)
- (cond
- ((string-match "^[0-9]+$" skey)
- (setq y (string-to-number skey) m 1 d 1 key 'year))
- ((string-match "^\\([0-9]+\\)-\\([0-9]\\{1,2\\}\\)$" skey)
- (setq y (string-to-number (match-string 1 skey))
- month (string-to-number (match-string 2 skey))
- d 1 key 'month))
- ((string-match "^\\([0-9]+\\)-[wW]\\([0-9]\\{1,2\\}\\)$" skey)
- (require 'cal-iso)
- (setq y (string-to-number (match-string 1 skey))
- w (string-to-number (match-string 2 skey)))
- (setq date (calendar-gregorian-from-absolute
- (calendar-absolute-from-iso (list w 1 y))))
- (setq d (nth 1 date) month (car date) y (nth 2 date)
- dow 1
- key 'week))
- ((string-match "^\\([0-9]+\\)-[qQ]\\([1-4]\\)$" skey)
- (require 'cal-iso)
- (setq y (string-to-number (match-string 1 skey)))
- (setq q (string-to-number (match-string 2 skey)))
- (setq date (calendar-gregorian-from-absolute
- (calendar-absolute-from-iso (org-quarter-to-date q y))))
- (setq d (nth 1 date) month (car date) y (nth 2 date)
- dow 1
- key 'quarter))
- ((string-match "^\\([0-9]+\\)-\\([0-9]\\{1,2\\}\\)-\\([0-9]\\{1,2\\}\\)$" skey)
- (setq y (string-to-number (match-string 1 skey))
- month (string-to-number (match-string 2 skey))
- d (string-to-number (match-string 3 skey))
- key 'day))
- ((string-match "\\([-+][0-9]+\\)$" skey)
- (setq shift (string-to-number (match-string 1 skey))
- key (intern (substring skey 0 (match-beginning 1))))
- (if(and (memq key '(quarter thisq)) (> shift 0))
- (error "Looking forward with quarters isn't implemented.")
- ())))
-
- (when (= shift 0)
- (cond ((eq key 'yesterday) (setq key 'today shift -1))
- ((eq key 'lastweek) (setq key 'week shift -1))
- ((eq key 'lastmonth) (setq key 'month shift -1))
- ((eq key 'lastyear) (setq key 'year shift -1))
- ((eq key 'lastq) (setq key 'quarter shift -1))))
- (cond
- ((memq key '(day today))
- (setq d (+ d shift) h 0 m 0 h1 24 m1 0))
- ((memq key '(week thisweek))
- (setq diff (+ (* -7 shift) (if (= dow 0) 6 (1- dow)))
- m 0 h 0 d (- d diff) d1 (+ 7 d)))
- ((memq key '(month thismonth))
- (setq d 1 h 0 m 0 d1 1 month (+ month shift) month1 (1+ month) h1 0 m1 0))
- ((memq key '(quarter thisq))
- ; compute if this shift remains in this year
- ; if not, compute how many years and quarters we have to shift (via floor*)
- ; and compute the shifted years, months and quarters
- (cond
- ((< (+ (- q 1) shift) 0) ; shift not in this year
- (setq interval (* -1 (+ (- q 1) shift)))
- ; set tmp to ((years to shift) (quarters to shift))
- (setq tmp (org-floor* interval 4))
- ; due to the use of floor, 0 quarters actually means 4
- (if (= 0 (nth 1 tmp))
- (setq shiftedy (- y (nth 0 tmp))
- shiftedm 1
- shiftedq 1)
- (setq shiftedy (- y (+ 1 (nth 0 tmp)))
- shiftedm (- 13 (* 3 (nth 1 tmp)))
- shiftedq (- 5 (nth 1 tmp))))
- (setq d 1 h 0 m 0 d1 1 month shiftedm month1 (+ 3 shiftedm) h1 0 m1 0 y shiftedy))
- ((> (+ q shift) 0) ; shift is whitin this year
- (setq shiftedq (+ q shift))
- (setq shiftedy y)
- (setq d 1 h 0 m 0 d1 1 month (+ 1 (* 3 (- (+ q shift) 1))) month1 (+ 4 (* 3 (- (+ q shift) 1))) h1 0 m1 0))))
- ((memq key '(year thisyear))
- (setq m 0 h 0 d 1 month 1 y (+ y shift) y1 (1+ y)))
- (t (error "No such time block %s" key)))
- (setq ts (encode-time s m h d month y)
- te (encode-time (or s1 s) (or m1 m) (or h1 h)
- (or d1 d) (or month1 month) (or y1 y)))
- (setq fm (cdr org-time-stamp-formats))
- (cond
- ((memq key '(day today))
- (setq txt (format-time-string "%A, %B %d, %Y" ts)))
- ((memq key '(week thisweek))
- (setq txt (format-time-string "week %G-W%V" ts)))
- ((memq key '(month thismonth))
- (setq txt (format-time-string "%B %Y" ts)))
- ((memq key '(year thisyear))
- (setq txt (format-time-string "the year %Y" ts)))
- ((memq key '(quarter thisq))
- (setq txt (concatenate 'string (org-count-quarter shiftedq) " quarter of " (number-to-string shiftedy))))
- )
- (if as-strings
- (list (format-time-string fm ts) (format-time-string fm te) txt)
- (list ts te txt))))
-
-(defun org-count-quarter (n)
- (cond
- ((= n 1) "1st")
- ((= n 2) "2nd")
- ((= n 3) "3rd")
- ((= n 4) "4th")))
-
-(defun org-clocktable-shift (dir n)
- "Try to shift the :block date of the clocktable at point.
-Point must be in the #+BEGIN: line of a clocktable, or this function
-will throw an error.
-DIR is a direction, a symbol `left', `right', `up', or `down'.
-Both `left' and `down' shift the block toward the past, `up' and `right'
-push it toward the future.
-N is the number of shift steps to take. The size of the step depends on
-the currently selected interval size."
- (setq n (prefix-numeric-value n))
- (and (memq dir '(left down)) (setq n (- n)))
- (save-excursion
- (goto-char (point-at-bol))
- (if (not (looking-at "^[ \t]*#\\+BEGIN:[ \t]+clocktable\\>.*?:block[ \t]+\\(\\S-+\\)"))
- (error "Line needs a :block definition before this command works")
- (let* ((b (match-beginning 1)) (e (match-end 1))
- (s (match-string 1))
- block shift ins y mw d date wp m)
- (cond
- ((equal s "yesterday") (setq s "today-1"))
- ((equal s "lastweek") (setq s "thisweek-1"))
- ((equal s "lastmonth") (setq s "thismonth-1"))
- ((equal s "lastyear") (setq s "thisyear-1"))
- ((equal s "lastq") (setq s "thisq-1")))
-
- (cond
- ((string-match "^\\(today\\|thisweek\\|thismonth\\|thisyear\\|thisq\\)\\([-+][0-9]+\\)?$" s)
- (setq block (match-string 1 s)
- shift (if (match-end 2)
- (string-to-number (match-string 2 s))
- 0))
- (setq shift (+ shift n))
- (setq ins (if (= shift 0) block (format "%s%+d" block shift))))
- ((string-match "\\([0-9]+\\)\\(-\\([wWqQ]?\\)\\([0-9]\\{1,2\\}\\)\\(-\\([0-9]\\{1,2\\}\\)\\)?\\)?" s)
- ;; 1 1 2 3 3 4 4 5 6 6 5 2
- (setq y (string-to-number (match-string 1 s))
- wp (and (match-end 3) (match-string 3 s))
- mw (and (match-end 4) (string-to-number (match-string 4 s)))
- d (and (match-end 6) (string-to-number (match-string 6 s))))
- (cond
- (d (setq ins (format-time-string
- "%Y-%m-%d"
- (encode-time 0 0 0 (+ d n) m y))))
- ((and wp (string-match "w\\|W" wp) mw (> (length wp) 0))
- (require 'cal-iso)
- (setq date (calendar-gregorian-from-absolute (calendar-absolute-from-iso (list (+ mw n) 1 y))))
- (setq ins (format-time-string
- "%G-W%V"
- (encode-time 0 0 0 (nth 1 date) (car date) (nth 2 date)))))
- ((and wp (string-match "q\\|Q" wp) mw (> (length wp) 0))
- (require 'cal-iso)
- ; if the 4th + 1 quarter is requested we flip to the 1st quarter of the next year
- (if (> (+ mw n) 4)
- (setq mw 0
- y (+ 1 y))
- ())
- ; if the 1st - 1 quarter is requested we flip to the 4th quarter of the previous year
- (if (= (+ mw n) 0)
- (setq mw 5
- y (- y 1))
- ())
- (setq date (calendar-gregorian-from-absolute (calendar-absolute-from-iso (org-quarter-to-date (+ mw n) y))))
- (setq ins (format-time-string
- (concatenate 'string (number-to-string y) "-Q" (number-to-string (+ mw n)))
- (encode-time 0 0 0 (nth 1 date) (car date) (nth 2 date)))))
- (mw
- (setq ins (format-time-string
- "%Y-%m"
- (encode-time 0 0 0 1 (+ mw n) y))))
- (y
- (setq ins (number-to-string (+ y n))))))
- (t (error "Cannot shift clocktable block")))
- (when ins
- (goto-char b)
- (insert ins)
- (delete-region (point) (+ (point) (- e b)))
- (beginning-of-line 1)
- (org-update-dblock)
- t)))))
-
-(defun org-dblock-write:clocktable (params)
- "Write the standard clocktable."
- (setq params (org-combine-plists org-clocktable-defaults params))
- (catch 'exit
- (let* ((scope (plist-get params :scope))
- (block (plist-get params :block))
- (ts (plist-get params :tstart))
- (te (plist-get params :tend))
- (link (plist-get params :link))
- (maxlevel (or (plist-get params :maxlevel) 3))
- (step (plist-get params :step))
- (timestamp (plist-get params :timestamp))
- (formatter (or (plist-get params :formatter)
- org-clock-clocktable-formatter
- 'org-clocktable-write-default))
- cc range-text ipos pos one-file-with-archives
- scope-is-list tbls level)
-
- ;; Check if we need to do steps
- (when block
- ;; Get the range text for the header
- (setq cc (org-clock-special-range block nil t)
- ts (car cc) te (nth 1 cc) range-text (nth 2 cc)))
- (when step
- ;; Write many tables, in steps
- (unless (or block (and ts te))
- (error "Clocktable `:step' can only be used with `:block' or `:tstart,:end'"))
- (org-clocktable-steps params)
- (throw 'exit nil))
-
- (setq ipos (point)) ; remember the insertion position
-
- ;; Get the right scope
- (setq pos (point))
- (cond
- ((and scope (listp scope) (symbolp (car scope)))
- (setq scope (eval scope)))
- ((eq scope 'agenda)
- (setq scope (org-agenda-files t)))
- ((eq scope 'agenda-with-archives)
- (setq scope (org-agenda-files t))
- (setq scope (org-add-archive-files scope)))
- ((eq scope 'file-with-archives)
- (setq scope (org-add-archive-files (list (buffer-file-name)))
- one-file-with-archives t)))
- (setq scope-is-list (and scope (listp scope)))
- (if scope-is-list
- ;; we collect from several files
- (let* ((files scope)
- file)
- (org-prepare-agenda-buffers files)
- (while (setq file (pop files))
- (with-current-buffer (find-buffer-visiting file)
- (save-excursion
- (save-restriction
- (push (org-clock-get-table-data file params) tbls))))))
- ;; Just from the current file
- (save-restriction
- ;; get the right range into the restriction
- (org-prepare-agenda-buffers (list (buffer-file-name)))
- (cond
- ((not scope)) ; use the restriction as it is now
- ((eq scope 'file) (widen))
- ((eq scope 'subtree) (org-narrow-to-subtree))
- ((eq scope 'tree)
- (while (org-up-heading-safe))
- (org-narrow-to-subtree))
- ((and (symbolp scope) (string-match "^tree\\([0-9]+\\)$"
- (symbol-name scope)))
- (setq level (string-to-number (match-string 1 (symbol-name scope))))
- (catch 'exit
- (while (org-up-heading-safe)
- (looking-at outline-regexp)
- (if (<= (org-reduced-level (funcall outline-level)) level)
- (throw 'exit nil))))
- (org-narrow-to-subtree)))
- ;; do the table, with no file name.
- (push (org-clock-get-table-data nil params) tbls)))
-
- ;; OK, at this point we tbls as a list of tables, one per file
- (setq tbls (nreverse tbls))
-
- (setq params (plist-put params :multifile scope-is-list))
- (setq params (plist-put params :one-file-with-archives
- one-file-with-archives))
-
- (funcall formatter ipos tbls params))))
-
-(defun org-clocktable-write-default (ipos tables params)
- "Write out a clock table at position IPOS in the current buffer.
-TABLES is a list of tables with clocking data as produced by
-`org-clock-get-table-data'. PARAMS is the parameter property list obtained
-from the dynamic block defintion."
- ;; This function looks quite complicated, mainly because there are a lot
- ;; of options which can add or remove columns. I have massively commented
- ;; function, to I hope it is understandable. If someone want to write
- ;; there own special formatter, this maybe much easier because there can
- ;; be a fixed format with a well-defined number of columns...
- (let* ((hlchars '((1 . "*") (2 . "/")))
- (multifile (plist-get params :multifile))
- (block (plist-get params :block))
- (ts (plist-get params :tstart))
- (te (plist-get params :tend))
- (header (plist-get params :header))
- (narrow (plist-get params :narrow))
- (link (plist-get params :link))
- (maxlevel (or (plist-get params :maxlevel) 3))
- (emph (plist-get params :emphasize))
- (level-p (plist-get params :level))
- (timestamp (plist-get params :timestamp))
- (ntcol (max 1 (or (plist-get params :tcolumns) 100)))
- (rm-file-column (plist-get params :one-file-with-archives))
- (indent (plist-get params :indent))
- range-text total-time tbl level hlc formula pcol
- file-time entries entry headline
- recalc content narrow-cut-p tcol)
-
- ;; Implement abbreviations
- (when (plist-get params :compact)
- (setq level nil indent t narrow (or narrow '40!) ntcol 1))
-
- ;; Some consistency test for parameters
- (unless (integerp ntcol)
- (setq params (plist-put params :tcolumns (setq ntcol 100))))
-
- (when (and narrow (integerp narrow) link)
- ;; We cannot have both integer narrow and link
- (message
- "Using hard narrowing in clocktable to allow for links")
- (setq narrow (intern (format "%d!" narrow))))
-
- (when narrow
- (cond
- ((integerp narrow))
- ((and (symbolp narrow)
- (string-match "\\`[0-9]+!\\'" (symbol-name narrow)))
- (setq narrow-cut-p t
- narrow (string-to-number (substring (symbol-name narrow)
- 0 -1))))
- (t
- (error "Invalid value %s of :narrow property in clock table"
- narrow))))
-
- (when block
- ;; Get the range text for the header
- (setq range-text (nth 2 (org-clock-special-range block nil t))))
-
- ;; Compute the total time
- (setq total-time (apply '+ (mapcar 'cadr tables)))
-
- ;; Now we need to output this tsuff
- (goto-char ipos)
-
- ;; Insert the text *before* the actual table
- (insert-before-markers
- (or header
- ;; Format the standard header
- (concat
- "Clock summary at ["
- (substring
- (format-time-string (cdr org-time-stamp-formats))
- 1 -1)
- "]"
- (if block (concat ", for " range-text ".") "")
- "\n\n")))
-
- ;; Insert the narrowing line
- (when (and narrow (integerp narrow) (not narrow-cut-p))
- (insert-before-markers
- "|" ; table line starter
- (if multifile "|" "") ; file column, maybe
- (if level-p "|" "") ; level column, maybe
- (if timestamp "|" "") ; timestamp column, maybe
- (format "<%d>| |\n" narrow))) ; headline and time columns
-
- ;; Insert the table header line
- (insert-before-markers
- "|" ; table line starter
- (if multifile "File|" "") ; file column, maybe
- (if level-p "L|" "") ; level column, maybe
- (if timestamp "Timestamp|" "") ; timestamp column, maybe
- "Headline|Time|\n") ; headline and time columns
-
- ;; Insert the total time in the table
- (insert-before-markers
- "|-\n" ; a hline
- "|" ; table line starter
- (if multifile "| ALL " "") ; file column, maybe
- (if level-p "|" "") ; level column, maybe
- (if timestamp "|" "") ; timestamp column, maybe
- "*Total time*| " ; instead of a headline
- "*"
- (org-minutes-to-hh:mm-string (or total-time 0)) ; the time
- "*|\n") ; close line
-
- ;; Now iterate over the tables and insert the data
- ;; but only if any time has been collected
- (when (and total-time (> total-time 0))
-
- (while (setq tbl (pop tables))
- ;; now tbl is the table resulting from one file.
- (setq file-time (nth 1 tbl))
- (when (or (and file-time (> file-time 0))
- (not (plist-get params :fileskip0)))
- (insert-before-markers "|-\n") ; a hline because a new file starts
- ;; First the file time, if we have multiple files
- (when multifile
- ;; Summarize the time colleted from this file
- (insert-before-markers
- (format "| %s %s | %s*File time* | *%s*|\n"
- (file-name-nondirectory (car tbl))
- (if level-p "| " "") ; level column, maybe
- (if timestamp "| " "") ; timestamp column, maybe
- (org-minutes-to-hh:mm-string (nth 1 tbl))))) ; the time
-
- ;; Get the list of node entries and iterate over it
- (setq entries (nth 2 tbl))
- (while (setq entry (pop entries))
- (setq level (car entry)
- headline (nth 1 entry)
- hlc (if emph (or (cdr (assoc level hlchars)) "") ""))
- (when narrow-cut-p
- (if (and (string-match (concat "\\`" org-bracket-link-regexp
- "\\'")
- headline)
- (match-end 3))
- (setq headline
- (format "[[%s][%s]]"
- (match-string 1 headline)
- (org-shorten-string (match-string 3 headline)
- narrow)))
- (setq headline (org-shorten-string headline narrow))))
- (insert-before-markers
- "|" ; start the table line
- (if multifile "|" "") ; free space for file name column?
- (if level-p (format "%d|" (car entry)) "") ; level, maybe
- (if timestamp (concat (nth 2 entry) "|") "") ; timestamp, maybe
- (if indent (org-clocktable-indent-string level) "") ; indentation
- hlc headline hlc "|" ; headline
- (make-string (min (1- ntcol) (or (- level 1))) ?|)
- ; empty fields for higher levels
- hlc (org-minutes-to-hh:mm-string (nth 3 entry)) hlc ; time
- "|\n" ; close line
- )))))
- (backward-delete-char 1)
- (if (setq formula (plist-get params :formula))
- (cond
- ((eq formula '%)
- ;; compute the column where the % numbers need to go
- (setq pcol (+ 2
- (if multifile 1 0)
- (if level-p 1 0)
- (if timestamp 1 0)
- (min maxlevel (or ntcol 100))))
- ;; compute the column where the total time is
- (setq tcol (+ 2
- (if multifile 1 0)
- (if level-p 1 0)
- (if timestamp 1 0)))
- (insert
- (format
- "\n#+TBLFM: $%d='(org-clock-time%% @%d$%d $%d..$%d);%%.1f"
- pcol ; the column where the % numbers should go
- (if (and narrow (not narrow-cut-p)) 3 2) ; row of the total time
- tcol ; column of the total time
- tcol (1- pcol) ; range of columns where times can be found
- ))
- (setq recalc t))
- ((stringp formula)
- (insert "\n#+TBLFM: " formula)
- (setq recalc t))
- (t (error "invalid formula in clocktable")))
- ;; Should we rescue an old formula?
- (when (stringp (setq content (plist-get params :content)))
- (when (string-match "^\\([ \t]*#\\+TBLFM:.*\\)" content)
- (setq recalc t)
- (insert "\n" (match-string 1 (plist-get params :content)))
- (beginning-of-line 0))))
- ;; Back to beginning, align the table, recalculate if necessary
- (goto-char ipos)
- (skip-chars-forward "^|")
- (org-table-align)
- (when org-hide-emphasis-markers
- ;; we need to align a second time
- (org-table-align))
- (when recalc
- (if (eq formula '%)
- (save-excursion
- (if (and narrow (not narrow-cut-p)) (beginning-of-line 2))
- (org-table-goto-column pcol nil 'force)
- (insert "%")))
- (org-table-recalculate 'all))
- (when rm-file-column
- ;; The file column is actually not wanted
- (forward-char 1)
- (org-table-delete-column))
- total-time))
-
-(defun org-clocktable-indent-string (level)
- (if (= level 1)
- ""
- (let ((str "\\__"))
- (while (> level 2)
- (setq level (1- level)
- str (concat str "___")))
- (concat str " "))))
-
-(defun org-clocktable-steps (params)
- "Step through the range to make a number of clock tables."
- (let* ((p1 (copy-sequence params))
- (ts (plist-get p1 :tstart))
- (te (plist-get p1 :tend))
- (step0 (plist-get p1 :step))
- (step (cdr (assoc step0 '((day . 86400) (week . 604800)))))
- (stepskip0 (plist-get p1 :stepskip0))
- (block (plist-get p1 :block))
- cc range-text step-time)
- (when block
- (setq cc (org-clock-special-range block nil t)
- ts (car cc) te (nth 1 cc) range-text (nth 2 cc)))
- (cond
- ((numberp ts)
- ;; If ts is a number, it's an absolute day number from org-agenda.
- (destructuring-bind (month day year) (calendar-gregorian-from-absolute ts)
- (setq ts (org-float-time (encode-time 0 0 0 day month year)))))
- (ts
- (setq ts (org-float-time
- (apply 'encode-time (org-parse-time-string ts))))))
- (cond
- ((numberp te)
- ;; Likewise for te.
- (destructuring-bind (month day year) (calendar-gregorian-from-absolute te)
- (setq te (org-float-time (encode-time 0 0 0 day month year)))))
- (te
- (setq te (org-float-time
- (apply 'encode-time (org-parse-time-string te))))))
- (setq p1 (plist-put p1 :header ""))
- (setq p1 (plist-put p1 :step nil))
- (setq p1 (plist-put p1 :block nil))
- (while (< ts te)
- (or (bolp) (insert "\n"))
- (setq p1 (plist-put p1 :tstart (format-time-string
- (org-time-stamp-format nil t)
- (seconds-to-time ts))))
- (setq p1 (plist-put p1 :tend (format-time-string
- (org-time-stamp-format nil t)
- (seconds-to-time (setq ts (+ ts step))))))
- (insert "\n" (if (eq step0 'day) "Daily report: "
- "Weekly report starting on: ")
- (plist-get p1 :tstart) "\n")
- (setq step-time (org-dblock-write:clocktable p1))
- (re-search-forward "^[ \t]*#\\+END:")
- (when (and (equal step-time 0) stepskip0)
- ;; Remove the empty table
- (delete-region (point-at-bol)
- (save-excursion
- (re-search-backward "^\\(Daily\\|Weekly\\) report"
- nil t)
- (point))))
- (end-of-line 0))))
-
-(defun org-clock-get-table-data (file params)
- "Get the clocktable data for file FILE, with parameters PARAMS.
-FILE is only for identification - this function assumes that
-the correct buffer is current, and that the wanted restriction is
-in place.
-The return value will be a list with the file name and the total
-file time (in minutes) as 1st and 2nd elements. The third element
-of this list will be a list of headline entries. Each entry has the
-following structure:
-
- (LEVEL HEADLINE TIMESTAMP TIME)
-
-LEVEL: The level of the headline, as an integer. This will be
- the reduced leve, so 1,2,3,... even if only odd levels
- are being used.
-HEADLINE: The text of the headline. Depending on PARAMS, this may
- already be formatted like a link.
-TIMESTAMP: If PARAMS require it, this will be a time stamp found in the
- entry, any of SCHEDULED, DEADLINE, NORMAL, or first inactive,
- in this sequence.
-TIME: The sum of all time spend in this tree, in minutes. This time
- will of cause be restricted to the time block and tags match
- specified in PARAMS."
- (let* ((maxlevel (or (plist-get params :maxlevel) 3))
- (timestamp (plist-get params :timestamp))
- (ts (plist-get params :tstart))
- (te (plist-get params :tend))
- (block (plist-get params :block))
- (link (plist-get params :link))
- (tags (plist-get params :tags))
- (matcher (if tags (cdr (org-make-tags-matcher tags))))
- cc range-text st p time level hdl props tsp tbl)
-
- (setq org-clock-file-total-minutes nil)
- (when block
- (setq cc (org-clock-special-range block nil t)
- ts (car cc) te (nth 1 cc) range-text (nth 2 cc)))
- (when (integerp ts) (setq ts (calendar-gregorian-from-absolute ts)))
- (when (integerp te) (setq te (calendar-gregorian-from-absolute te)))
- (when (and ts (listp ts))
- (setq ts (format "%4d-%02d-%02d" (nth 2 ts) (car ts) (nth 1 ts))))
- (when (and te (listp te))
- (setq te (format "%4d-%02d-%02d" (nth 2 te) (car te) (nth 1 te))))
- ;; Now the times are strings we can parse.
- (if ts (setq ts (org-float-time
- (apply 'encode-time (org-parse-time-string ts)))))
- (if te (setq te (org-float-time
- (apply 'encode-time (org-parse-time-string te)))))
- (save-excursion
- (org-clock-sum ts te
- (unless (null matcher)
- (lambda ()
- (let ((tags-list (org-get-tags-at)))
- (eval matcher)))))
- (goto-char (point-min))
- (setq st t)
- (while (or (and (bobp) (prog1 st (setq st nil))
- (get-text-property (point) :org-clock-minutes)
- (setq p (point-min)))
- (setq p (next-single-property-change
- (point) :org-clock-minutes)))
- (goto-char p)
- (when (setq time (get-text-property p :org-clock-minutes))
- (save-excursion
- (beginning-of-line 1)
- (when (and (looking-at (org-re "\\(\\*+\\)[ \t]+\\(.*?\\)\\([ \t]+:[[:alnum:]_@#%:]+:\\)?[ \t]*$"))
- (setq level (org-reduced-level
- (- (match-end 1) (match-beginning 1))))
- (<= level maxlevel))
- (setq hdl (if (not link)
- (match-string 2)
- (org-make-link-string
- (format "file:%s::%s"
- (buffer-file-name)
- (save-match-data
- (org-make-org-heading-search-string
- (match-string 2))))
- (match-string 2)))
- tsp (when timestamp
- (setq props (org-entry-properties (point)))
- (or (cdr (assoc "SCHEDULED" props))
- (cdr (assoc "DEADLINE" props))
- (cdr (assoc "TIMESTAMP" props))
- (cdr (assoc "TIMESTAMP_IA" props)))))
- (when (> time 0) (push (list level hdl tsp time) tbl))))))
- (setq tbl (nreverse tbl))
- (list file org-clock-file-total-minutes tbl))))
-
-(defun org-clock-time% (total &rest strings)
- "Compute a time fraction in percent.
-TOTAL s a time string like 10:21 specifying the total times.
-STRINGS is a list of strings that should be checked for a time.
-The first string that does have a time will be used.
-This function is made for clock tables."
- (let ((re "\\([0-9]+\\):\\([0-9]+\\)")
- tot s)
- (save-match-data
- (catch 'exit
- (if (not (string-match re total))
- (throw 'exit 0.)
- (setq tot (+ (string-to-number (match-string 2 total))
- (* 60 (string-to-number (match-string 1 total)))))
- (if (= tot 0.) (throw 'exit 0.)))
- (while (setq s (pop strings))
- (if (string-match "\\([0-9]+\\):\\([0-9]+\\)" s)
- (throw 'exit
- (/ (* 100.0 (+ (string-to-number (match-string 2 s))
- (* 60 (string-to-number
- (match-string 1 s)))))
- tot))))
- 0))))
-
-(defvar org-clock-loaded nil
- "Was the clock file loaded?")
-
-(defun org-clock-save ()
- "Persist various clock-related data to disk.
-The details of what will be saved are regulated by the variable
-`org-clock-persist'."
- (when (and org-clock-persist
- (or org-clock-loaded
- org-clock-has-been-used
- (not (file-exists-p org-clock-persist-file))))
- (let (b)
- (with-current-buffer (find-file (expand-file-name org-clock-persist-file))
- (progn
- (delete-region (point-min) (point-max))
- ;;Store clock
- (insert (format ";; org-persist.el - %s at %s\n"
- system-name (format-time-string
- (cdr org-time-stamp-formats))))
- (if (and (memq org-clock-persist '(t clock))
- (setq b (org-clocking-buffer))
- (setq b (or (buffer-base-buffer b) b))
- (buffer-live-p b)
- (buffer-file-name b)
- (or (not org-clock-persist-query-save)
- (y-or-n-p (concat "Save current clock ("
- (substring-no-properties
- org-clock-heading)
- ") "))))
- (insert "(setq resume-clock '(\""
- (buffer-file-name (org-clocking-buffer))
- "\" . " (int-to-string (marker-position org-clock-marker))
- "))\n"))
- ;; Store clocked task history. Tasks are stored reversed to make
- ;; reading simpler
- (when (and (memq org-clock-persist '(t history))
- org-clock-history)
- (insert
- "(setq stored-clock-history '("
- (mapconcat
- (lambda (m)
- (when (and (setq b (marker-buffer m))
- (setq b (or (buffer-base-buffer b) b))
- (buffer-live-p b)
- (buffer-file-name b))
- (concat "(\"" (buffer-file-name b)
- "\" . " (int-to-string (marker-position m))
- ")")))
- (reverse org-clock-history) " ") "))\n"))
- (save-buffer)
- (kill-buffer (current-buffer)))))))
-
-(defun org-clock-load ()
- "Load clock-related data from disk, maybe resuming a stored clock."
- (when (and org-clock-persist (not org-clock-loaded))
- (let ((filename (expand-file-name org-clock-persist-file))
- (org-clock-in-resume 'auto-restart)
- resume-clock stored-clock-history)
- (if (not (file-readable-p filename))
- (message "Not restoring clock data; %s not found"
- org-clock-persist-file)
- (message "%s" "Restoring clock data")
- (setq org-clock-loaded t)
- (load-file filename)
- ;; load history
- (when stored-clock-history
- (save-window-excursion
- (mapc (lambda (task)
- (if (file-exists-p (car task))
- (org-clock-history-push (cdr task)
- (find-file (car task)))))
- stored-clock-history)))
- ;; resume clock
- (when (and resume-clock org-clock-persist
- (file-exists-p (car resume-clock))
- (or (not org-clock-persist-query-resume)
- (y-or-n-p
- (concat
- "Resume clock ("
- (with-current-buffer (find-file (car resume-clock))
- (save-excursion
- (goto-char (cdr resume-clock))
- (org-back-to-heading t)
- (and (looking-at org-complex-heading-regexp)
- (match-string 4))))
- ") "))))
- (when (file-exists-p (car resume-clock))
- (with-current-buffer (find-file (car resume-clock))
- (goto-char (cdr resume-clock))
- (let ((org-clock-auto-clock-resolution nil))
- (org-clock-in)
- (if (org-invisible-p)
- (org-show-context))))))))))
-
-;;;###autoload
-(defun org-clock-persistence-insinuate ()
- "Set up hooks for clock persistence."
- (add-hook 'org-mode-hook 'org-clock-load)
- (add-hook 'kill-emacs-hook 'org-clock-save))
-
-;; Suggested bindings
-(org-defkey org-mode-map "\C-c\C-x\C-e" 'org-clock-modify-effort-estimate)
-
-(provide 'org-clock)
-
-;; arch-tag: 7b42c5d4-9b36-48be-97c0-66a869daed4c
-
-;;; org-clock.el ends here
-
diff --git a/.emacs.d/org-7.4/lisp/org-clock.elc b/.emacs.d/org-7.4/lisp/org-clock.elc
deleted file mode 100644
index 7c9a932..0000000
--- a/.emacs.d/org-7.4/lisp/org-clock.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-colview-xemacs.el b/.emacs.d/org-7.4/lisp/org-colview-xemacs.el
deleted file mode 100644
index 06a1253..0000000
--- a/.emacs.d/org-7.4/lisp/org-colview-xemacs.el
+++ /dev/null
@@ -1,1736 +0,0 @@
-;;; org-colview-xemacs.el --- Column View in Org-mode, XEmacs-specific version
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file contains the column view for Org.
-
-;;; Code:
-
-(eval-when-compile (require 'cl))
-(require 'org)
-
-(declare-function org-agenda-redo "org-agenda" ())
-
-
-;;; Define additional faces for column view
-
-(when (featurep 'xemacs)
-
- (defface org-columns-level-1;; font-lock-function-name-face
- (org-compatible-face
- 'outline-1
- '((((class color) (min-colors 88) (background light)) (:foreground "Blue1" :background "grey90"))
- (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue" :background "grey30"))
- (((class color) (min-colors 16) (background light)) (:foreground "Blue" :background "grey90"))
- (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue" :background "grey30"))
- (((class color) (min-colors 8)) (:foreground "blue" :bold t))
- (t (:bold t))))
- "Face used for columns-level 1 headlines."
- :group 'org-faces)
-
- (defface org-columns-level-2;; font-lock-variable-name-face
- (org-compatible-face
- 'outline-2
- '((((class color) (min-colors 16) (background light)) (:foreground "DarkGoldenrod" :background "grey90"))
- (((class color) (min-colors 16) (background dark)) (:foreground "LightGoldenrod" :background "grey30"))
- (((class color) (min-colors 8) (background light)) (:foreground "yellow" :background "grey90"))
- (((class color) (min-colors 8) (background dark)) (:foreground "yellow" :bold t))
- (t (:bold t))))
- "Face used for columns-level 2 headlines."
- :group 'org-faces)
-
- (defface org-columns-level-3;; font-lock-keyword-face
- (org-compatible-face
- 'outline-3
- '((((class color) (min-colors 88) (background light)) (:foreground "Purple" :background "grey90"))
- (((class color) (min-colors 88) (background dark)) (:foreground "Cyan1" :background "grey30"))
- (((class color) (min-colors 16) (background light)) (:foreground "Purple" :background "grey90"))
- (((class color) (min-colors 16) (background dark)) (:foreground "Cyan" :background "grey30"))
- (((class color) (min-colors 8) (background light)) (:foreground "purple" :bold t))
- (((class color) (min-colors 8) (background dark)) (:foreground "cyan" :bold t))
- (t (:bold t))))
- "Face used for columns-level 3 headlines."
- :group 'org-faces)
-
- (defface org-columns-level-4;; font-lock-comment-face
- (org-compatible-face
- 'outline-4
- '((((class color) (min-colors 88) (background light)) (:foreground "Firebrick" :background "grey90"))
- (((class color) (min-colors 88) (background dark)) (:foreground "chocolate1" :background "grey30"))
- (((class color) (min-colors 16) (background light)) (:foreground "red"))
- (((class color) (min-colors 16) (background dark)) (:foreground "red1"))
- (((class color) (min-colors 8) (background light)) (:foreground "red" :bold t))
- (((class color) (min-colors 8) (background dark)) (:foreground "red" :bold t))
- (t (:bold t))))
- "Face used for columns-level 4 headlines."
- :group 'org-faces)
-
- (defface org-columns-level-5;; font-lock-type-face
- (org-compatible-face
- 'outline-5
- '((((class color) (min-colors 16) (background light)) (:foreground "ForestGreen" :background "grey90"))
- (((class color) (min-colors 16) (background dark)) (:foreground "PaleGreen" :background "grey30"))
- (((class color) (min-colors 8)) (:foreground "green"))))
- "Face used for columns-level 5 headlines."
- :group 'org-faces)
-
- (defface org-columns-level-6;; font-lock-constant-face
- (org-compatible-face
- 'outline-6
- '((((class color) (min-colors 16) (background light)) (:foreground "CadetBlue" :background "grey90"))
- (((class color) (min-colors 16) (background dark)) (:foreground "Aquamarine" :background "grey30"))
- (((class color) (min-colors 8)) (:foreground "magenta"))))
- "Face used for columns-level 6 headlines."
- :group 'org-faces)
-
- (defface org-columns-level-7;; font-lock-builtin-face
- (org-compatible-face
- 'outline-7
- '((((class color) (min-colors 16) (background light)) (:foreground "Orchid" :background "grey90"))
- (((class color) (min-colors 16) (background dark)) (:foreground "LightSteelBlue" :background "grey30"))
- (((class color) (min-colors 8)) (:foreground "blue"))))
- "Face used for columns-level 7 headlines."
- :group 'org-faces)
-
- (defface org-columns-level-8;; font-lock-string-face
- (org-compatible-face
- 'outline-8
- '((((class color) (min-colors 16) (background light)) (:foreground "RosyBrown" :background "grey90"))
- (((class color) (min-colors 16) (background dark)) (:foreground "LightSalmon" :background "grey30"))
- (((class color) (min-colors 8)) (:foreground "green"))))
- "Face used for columns-level 8 headlines."
- :group 'org-faces)
-
-
- (defface org-columns-space;; font-lock-function-name-face
- (org-compatible-face
- 'outline-1
- '((((class color) (min-colors 88) (background light)) (:background "grey90"))
- (((class color) (min-colors 88) (background dark)) (:background "grey30"))
- (((class color) (min-colors 16) (background light)) (:background "grey90"))
- (((class color) (min-colors 16) (background dark)) (:background "grey30"))
- (((class color) (min-colors 8)) (:bold t :underline t))))
- "Face used for columns space headlines."
- :group 'org-faces)
-
- (defface org-columns-space1;; font-lock-function-name-face
- (org-compatible-face
- 'outline-1
- '((((class color) (min-colors 88) (background light)) (:background "grey90"))
- (((class color) (min-colors 88) (background dark)) (:background "grey30"))
- (((class color) (min-colors 16) (background light)) (:background "grey90"))
- (((class color) (min-colors 16) (background dark)) (:background "grey30"))
- (((class color) (min-colors 8)) (:bold t :underline t))))
- "Face used for columns space headlines."
- :group 'org-faces)
- )
-
-(when (featurep 'xemacs)
- (defconst org-columns-level-faces
- '(org-columns-level-1
- org-columns-level-2 org-columns-level-3
- org-columns-level-4 org-columns-level-5 org-columns-level-6
- org-columns-level-7 org-columns-level-8
- ))
-
- (defun org-get-columns-level-face (n)
- "Get the right face for match N in font-lock matching of headlines."
- (setq org-l (- (match-end 2) (match-beginning 1) 1))
- (if org-odd-levels-only (setq org-l (1+ (/ org-l 2))))
- (setq org-f (nth (% (1- org-l) org-n-level-faces) org-columns-level-faces))
- (cond
- ((eq n 1) (if org-hide-leading-stars 'org-hide org-f))
- ((eq n 2) org-f)
- (t (if org-level-color-stars-only nil org-f))))
- )
-
-
-;;; Column View
-
-(defvar org-columns-overlays nil
- "Holds the list of current column overlays.")
-
-(defvar org-columns-current-fmt nil
- "Local variable, holds the currently active column format.")
-(make-variable-buffer-local 'org-columns-current-fmt)
-(defvar org-columns-current-fmt-compiled nil
- "Local variable, holds the currently active column format.
-This is the compiled version of the format.")
-(make-variable-buffer-local 'org-columns-current-fmt-compiled)
-(defvar org-columns-current-widths nil
- "Local variable, holds the currently widths of fields.")
-(make-variable-buffer-local 'org-columns-current-widths)
-(defvar org-columns-current-maxwidths nil
- "Local variable, holds the currently active maximum column widths.")
-(make-variable-buffer-local 'org-columns-current-maxwidths)
-(defvar org-columns-begin-marker (make-marker)
- "Points to the position where last a column creation command was called.")
-(defvar org-columns-top-level-marker (make-marker)
- "Points to the position where current columns region starts.")
-
-(defvar org-columns-map (make-sparse-keymap)
- "The keymap valid in column display.")
-
-(defun org-columns-content ()
- "Switch to contents view while in columns view."
- (interactive)
- (org-overview)
- (org-content))
-
-(org-defkey org-columns-map "c" 'org-columns-content)
-(org-defkey org-columns-map "o" 'org-overview)
-(org-defkey org-columns-map "e" 'org-columns-edit-value)
-(org-defkey org-columns-map "\C-c\C-t" 'org-columns-todo)
-(org-defkey org-columns-map "\C-c\C-c" 'org-columns-set-tags-or-toggle)
-(org-defkey org-columns-map "\C-c\C-o" 'org-columns-open-link)
-(org-defkey org-columns-map "v" 'org-columns-show-value)
-(org-defkey org-columns-map "q" 'org-columns-quit)
-(org-defkey org-columns-map "r" 'org-columns-redo)
-(org-defkey org-columns-map "g" 'org-columns-redo)
-(org-defkey org-columns-map [left] 'org-columns-backward-char)
-(org-defkey org-columns-map "\M-b" 'org-columns-backward-char)
-(org-defkey org-columns-map "a" 'org-columns-edit-allowed)
-(org-defkey org-columns-map "s" 'org-columns-edit-attributes)
-(org-defkey org-columns-map "\M-f" 'org-columns-forward-char)
-(org-defkey org-columns-map [right] 'org-columns-forward-char)
-(org-defkey org-columns-map [(shift right)] 'org-columns-next-allowed-value)
-(org-defkey org-columns-map "n" 'org-columns-next-allowed-value)
-(org-defkey org-columns-map [(shift left)] 'org-columns-previous-allowed-value)
-(org-defkey org-columns-map "p" 'org-columns-previous-allowed-value)
-(org-defkey org-columns-map "<" 'org-columns-narrow)
-(org-defkey org-columns-map ">" 'org-columns-widen)
-(org-defkey org-columns-map [(meta right)] 'org-columns-move-right)
-(org-defkey org-columns-map [(meta left)] 'org-columns-move-left)
-(org-defkey org-columns-map [(shift meta right)] 'org-columns-new)
-(org-defkey org-columns-map [(shift meta left)] 'org-columns-delete)
-(dotimes (i 10)
- (org-defkey org-columns-map (number-to-string i)
- `(lambda () (interactive)
- (org-columns-next-allowed-value nil ,i))))
-
-(easy-menu-define org-columns-menu org-columns-map "Org Column Menu"
- '("Column"
- ["Edit property" org-columns-edit-value t]
- ["Next allowed value" org-columns-next-allowed-value t]
- ["Previous allowed value" org-columns-previous-allowed-value t]
- ["Show full value" org-columns-show-value t]
- ["Edit allowed values" org-columns-edit-allowed t]
- "--"
- ["Edit column attributes" org-columns-edit-attributes t]
- ["Increase column width" org-columns-widen t]
- ["Decrease column width" org-columns-narrow t]
- "--"
- ["Move column right" org-columns-move-right t]
- ["Move column left" org-columns-move-left t]
- ["Add column" org-columns-new t]
- ["Delete column" org-columns-delete t]
- "--"
- ["CONTENTS" org-columns-content t]
- ["OVERVIEW" org-overview t]
- ["Refresh columns display" org-columns-redo t]
- "--"
- ["Open link" org-columns-open-link t]
- "--"
- ["Quit" org-columns-quit t]))
-
-(defun org-columns-current-column ()
- (if (featurep 'xemacs)
- (/ (current-column) 2)
- (current-column)))
-
-(defun org-columns-forward-char ()
- (interactive)
- (forward-char)
- (if (featurep 'xemacs)
- (while (not (or (eolp)
- (member (extent-at
- (point) (current-buffer)
- 'org-columns-key) org-columns-overlays)))
- (forward-char))))
-
-(defun org-columns-backward-char ()
- (interactive)
- (backward-char)
- (if (featurep 'xemacs)
- (while (not (or (bolp)
- (member (extent-at (point) (current-buffer) 'org-columns-key) org-columns-overlays)))
- (backward-char))))
-
-(defun org-columns-new-overlay (beg end &optional string face)
- "Create a new column overlay and add it to the list."
- (let ((ov (make-overlay beg end)))
- (if (featurep 'xemacs)
- (progn
- (overlay-put ov 'face (or face 'org-columns-space1))
- (overlay-put ov 'start-open t)
- (if string
- (org-overlay-display ov string (or face 'org-columns-space1))))
- (overlay-put ov 'face (or face 'secondary-selection))
- (org-overlay-display ov string face))
- (push ov org-columns-overlays)
- ov))
-
-(defun org-columns-display-here (&optional props)
- "Overlay the current line with column display."
- (interactive)
- (let* ((fmt org-columns-current-fmt-compiled)
- (beg (point-at-bol))
- (level-face (save-excursion
- (beginning-of-line 1)
- (and (looking-at "\\(\\**\\)\\(\\* \\)")
- (org-get-level-face 2))))
- (item (save-match-data
- (org-no-properties
- (org-remove-tabs
- (buffer-substring-no-properties
- (point-at-bol) (point-at-eol))))))
- (color (if (featurep 'xemacs)
- (save-excursion
- (beginning-of-line 1)
- (and (looking-at "\\(\\**\\)\\(\\* \\)")
- (org-get-columns-level-face 2)))
- (list :foreground
- (face-attribute
- (or level-face
- (and (eq major-mode 'org-agenda-mode)
- (get-text-property (point-at-bol) 'face))
- 'default) :foreground))))
- (face (if (featurep 'xemacs) color (list color 'org-column)))
- (pl (or (get-text-property (point-at-bol) 'prefix-length) 0))
- (cphr (get-text-property (point-at-bol) 'org-complex-heading-regexp))
- pom property ass width f string ov column val modval s2 title calc)
- ;; Check if the entry is in another buffer.
- (unless props
- (if (eq major-mode 'org-agenda-mode)
- (setq pom (or (org-get-at-bol 'org-hd-marker)
- (org-get-at-bol 'org-marker))
- props (if pom (org-entry-properties pom) nil))
- (setq props (org-entry-properties nil))))
- ;; Walk the format
- (while (setq column (pop fmt))
- (setq property (car column)
- title (nth 1 column)
- ass (if (equal property "ITEM")
- (cons "ITEM" item)
- (assoc property props))
- width (or (cdr (assoc property org-columns-current-maxwidths))
- (nth 2 column)
- (length property))
- f (format (if (featurep 'xemacs) "%%-%d.%ds |" "%%-%d.%ds | ")
- width width)
- val (or (cdr ass) "")
- calc (nth 7 column)
- modval (cond ((and org-columns-modify-value-for-display-function
- (functionp
- org-columns-modify-value-for-display-function))
- (funcall org-columns-modify-value-for-display-function
- title val))
- ((equal property "ITEM")
- (if (org-mode-p)
- (org-columns-cleanup-item
- val org-columns-current-fmt-compiled)
- (org-agenda-columns-cleanup-item
- val pl cphr org-columns-current-fmt-compiled)))
- ((and calc (functionp calc)
- (not (string= val ""))
- (not (get-text-property 0 'org-computed val)))
- (org-columns-number-to-string
- (funcall calc (org-columns-string-to-number
- val (nth 4 column)))
- (nth 4 column)))))
- (setq s2 (org-columns-add-ellipses (or modval val) width))
- (setq string (format f s2))
- ;; Create the overlay
- (org-unmodified
- (setq ov (org-columns-new-overlay
- beg (setq beg (1+ beg)) string face))
- (overlay-put ov 'keymap org-columns-map)
- (overlay-put ov 'org-columns-key property)
- (overlay-put ov 'org-columns-value (cdr ass))
- (overlay-put ov 'org-columns-value-modified modval)
- (overlay-put ov 'org-columns-pom pom)
- (overlay-put ov 'org-columns-format f)
- (when (featurep 'xemacs)
- (if (or (not (char-after beg))
- (equal (char-after beg) ?\n))
- (let ((inhibit-read-only t))
- (save-excursion
- (goto-char beg)
- (org-unmodified (insert " "))
- ;; FIXME: add props and remove later?
- )))
- (goto-char beg)
- (org-columns-new-overlay
- beg (1+ beg) nil 'org-columns-space)
- (setq beg (1+ beg))))
-
- (if (or (not (char-after beg))
- (equal (char-after beg) ?\n))
- (let ((inhibit-read-only t))
- (save-excursion
- (goto-char beg)
- ;; FIXME: add props and remove later?
- (org-unmodified (insert " "))))))
- ;; Make the rest of the line disappear.
- (org-unmodified
- (setq ov (org-columns-new-overlay beg (point-at-eol)))
- (overlay-put ov 'invisible t)
- (overlay-put ov 'keymap org-columns-map)
- (overlay-put ov 'intangible t)
- (push ov org-columns-overlays)
- (setq ov (make-overlay (1- (point-at-eol)) (1+ (point-at-eol))))
- (overlay-put ov 'keymap org-columns-map)
- (push ov org-columns-overlays)
- (let ((inhibit-read-only t))
- (put-text-property (max (point-min) (1- (point-at-bol)))
- (min (point-max) (1+ (point-at-eol)))
- 'read-only "Type `e' to edit property")))))
-
-(defun org-columns-add-ellipses (string width)
- "Truncate STRING with WIDTH characters, with ellipses."
- (cond
- ((<= (length string) width) string)
- ((<= width (length org-columns-ellipses))
- (substring org-columns-ellipses 0 width))
- (t (concat (substring string 0 (- width (length org-columns-ellipses)))
- org-columns-ellipses))))
-
-(defvar org-columns-full-header-line-format nil
- "The full header line format, will be shifted by horizontal scrolling." )
-(defvar org-previous-header-line-format nil
- "The header line format before column view was turned on.")
-(defvar org-columns-inhibit-recalculation nil
- "Inhibit recomputing of columns on column view startup.")
-
-
-(defvar header-line-format)
-(defvar org-columns-previous-hscroll 0)
-
-(defun org-columns-display-here-title ()
- "Overlay the newline before the current line with the table title."
- (interactive)
- (let ((fmt org-columns-current-fmt-compiled)
- string (title "")
- property width f column str widths)
- (while (setq column (pop fmt))
- (setq property (car column)
- str (or (nth 1 column) property)
- width (or (cdr (assoc property org-columns-current-maxwidths))
- (nth 2 column)
- (length str))
- widths (push width widths)
- f (format "%%-%d.%ds | " width width)
- string (format f str)
- title (concat title string)))
- (if (featurep 'xemacs)
- (let ((ext (make-extent nil nil)))
- (set-extent-endpoints ext 0 (length title) title)
- (set-extent-face ext (list 'bold 'underline 'org-columns-space1))
- (org-set-local 'org-previous-header-line-format
- (specifier-specs top-gutter))
- (org-set-local 'org-columns-current-widths (nreverse widths))
- (set-specifier top-gutter (make-gutter-specifier
- (cons (current-buffer) title))))
- (setq title (concat
- (org-add-props " " nil 'display '(space :align-to 0))
- (org-add-props title nil 'face '(:weight bold :underline t))))
- (org-set-local 'org-previous-header-line-format header-line-format)
- (org-set-local 'org-columns-current-widths (nreverse widths))
- (setq org-columns-full-header-line-format title)
- (setq org-columns-previous-hscroll -1)
- (org-add-hook 'post-command-hook 'org-columns-hscoll-title nil 'local))))
-
-(defun org-columns-hscoll-title ()
- "Set the `header-line-format' so that it scrolls along with the table."
- (sit-for .0001) ; need to force a redisplay to update window-hscroll
- (when (not (= (window-hscroll) org-columns-previous-hscroll))
- (setq header-line-format
- (concat (substring org-columns-full-header-line-format 0 1)
- (substring org-columns-full-header-line-format
- (1+ (window-hscroll))))
- org-columns-previous-hscroll (window-hscroll))
- (force-mode-line-update)))
-
-(defvar org-colview-initial-truncate-line-value nil
- "Remember the value of `truncate-lines' across colview.")
-
-(defun org-columns-remove-overlays ()
- "Remove all currently active column overlays."
- (interactive)
- (when (marker-buffer org-columns-begin-marker)
- (with-current-buffer (marker-buffer org-columns-begin-marker)
- (when (local-variable-p 'org-previous-header-line-format (current-buffer))
- (if (featurep 'xemacs)
- (set-specifier top-gutter
- (make-gutter-specifier
- (cons (current-buffer)
- (cdar org-previous-header-line-format))))
- (setq header-line-format org-previous-header-line-format)
- (remove-hook 'post-command-hook 'org-columns-hscoll-title 'local))
- (kill-local-variable 'org-previous-header-line-format))
- (move-marker org-columns-begin-marker nil)
- (move-marker org-columns-top-level-marker nil)
- (org-unmodified
- (mapc 'delete-overlay org-columns-overlays)
- (setq org-columns-overlays nil)
- (let ((inhibit-read-only t))
- (remove-text-properties (point-min) (point-max) '(read-only t))))
- (when (local-variable-p 'org-colview-initial-truncate-line-value
- (current-buffer))
- (setq truncate-lines org-colview-initial-truncate-line-value)))))
-
-
-(defun org-columns-cleanup-item (item fmt)
- "Remove from ITEM what is a column in the format FMT."
- (if (not org-complex-heading-regexp)
- item
- (when (string-match org-complex-heading-regexp item)
- (setq item
- (concat
- (org-add-props (match-string 1 item) nil
- 'org-whitespace (* 2 (1- (org-reduced-level (- (match-end 1) (match-beginning 1))))))
- (and (match-end 2) (not (assoc "TODO" fmt)) (concat " " (match-string 2 item)))
- (and (match-end 3) (not (assoc "PRIORITY" fmt)) (concat " " (match-string 3 item)))
- " " (save-match-data (org-columns-compact-links (match-string 4 item)))
- (and (match-end 5) (not (assoc "TAGS" fmt)) (concat " " (match-string 5 item)))))
- (add-text-properties
- 0 (1+ (match-end 1))
- (list 'org-whitespace (* 2 (1- (org-reduced-level (- (match-end 1) (match-beginning 1))))))
- item)
- item)))
-
-(defun org-columns-compact-links (s)
- "Replace [[link][desc]] with [desc] or [link]."
- (while (string-match org-bracket-link-regexp s)
- (setq s (replace-match
- (concat "[" (match-string (if (match-end 3) 3 1) s) "]")
- t t s)))
- s)
-
-(defvar org-agenda-columns-remove-prefix-from-item)
-
-(defun org-agenda-columns-cleanup-item (item pl cphr fmt)
- "Cleanup the time property for agenda column view.
-See also the variable `org-agenda-columns-remove-prefix-from-item'."
- (let* ((org-complex-heading-regexp cphr)
- (prefix (substring item 0 pl))
- (rest (substring item pl))
- (fake (concat "* " rest))
- (cleaned (org-trim (substring (org-columns-cleanup-item fake fmt) 1))))
- (if org-agenda-columns-remove-prefix-from-item
- cleaned
- (concat prefix cleaned))))
-
-(defun org-columns-show-value ()
- "Show the full value of the property."
- (interactive)
- (let ((value (get-char-property (point) 'org-columns-value)))
- (message "Value is: %s" (or value ""))))
-
-(defvar org-agenda-columns-active) ;; defined in org-agenda.el
-
-(defun org-columns-quit ()
- "Remove the column overlays and in this way exit column editing."
- (interactive)
- (org-unmodified
- (org-columns-remove-overlays)
- (let ((inhibit-read-only t))
- (remove-text-properties (point-min) (point-max) '(read-only t))))
- (when (eq major-mode 'org-agenda-mode)
- (setq org-agenda-columns-active nil)
- (message
- "Modification not yet reflected in Agenda buffer, use `r' to refresh")))
-
-(defun org-columns-check-computed ()
- "Check if this column value is computed.
-If yes, throw an error indicating that changing it does not make sense."
- (let ((val (get-char-property (point) 'org-columns-value)))
- (when (and (stringp val)
- (get-char-property 0 'org-computed val))
- (error "This value is computed from the entry's children"))))
-
-(defun org-columns-todo (&optional arg)
- "Change the TODO state during column view."
- (interactive "P")
- (org-columns-edit-value "TODO"))
-
-(defun org-columns-set-tags-or-toggle (&optional arg)
- "Toggle checkbox at point, or set tags for current headline."
- (interactive "P")
- (if (string-match "\\`\\[[ xX-]\\]\\'"
- (get-char-property (point) 'org-columns-value))
- (org-columns-next-allowed-value)
- (org-columns-edit-value "TAGS")))
-
-(defun org-columns-edit-value (&optional key)
- "Edit the value of the property at point in column view.
-Where possible, use the standard interface for changing this line."
- (interactive)
- (org-columns-check-computed)
- (let* ((col (current-column))
- (key (or key (get-char-property (point) 'org-columns-key)))
- (value (get-char-property (point) 'org-columns-value))
- (bol (point-at-bol)) (eol (point-at-eol))
- (pom (or (get-text-property bol 'org-hd-marker)
- (point))) ; keep despite of compiler warning
- (line-overlays
- (delq nil (mapcar (lambda (x)
- (and (eq (overlay-buffer x) (current-buffer))
- (>= (overlay-start x) bol)
- (<= (overlay-start x) eol)
- x))
- org-columns-overlays)))
- (org-columns-time (time-to-number-of-days (current-time)))
- nval eval allowed)
- (cond
- ((equal key "CLOCKSUM")
- (error "This special column cannot be edited"))
- ((equal key "ITEM")
- (setq eval '(org-with-point-at pom (org-edit-headline))))
- ((equal key "TODO")
- (setq eval '(org-with-point-at
- pom
- (call-interactively 'org-todo))))
- ((equal key "PRIORITY")
- (setq eval '(org-with-point-at pom
- (call-interactively 'org-priority))))
- ((equal key "TAGS")
- (setq eval '(org-with-point-at
- pom
- (let ((org-fast-tag-selection-single-key
- (if (eq org-fast-tag-selection-single-key 'expert)
- t org-fast-tag-selection-single-key)))
- (call-interactively 'org-set-tags)))))
- ((equal key "DEADLINE")
- (setq eval '(org-with-point-at
- pom
- (call-interactively 'org-deadline))))
- ((equal key "SCHEDULED")
- (setq eval '(org-with-point-at
- pom
- (call-interactively 'org-schedule))))
- (t
- (setq allowed (org-property-get-allowed-values pom key 'table))
- (if allowed
- (setq nval (org-icompleting-read
- "Value: " allowed nil
- (not (get-text-property 0 'org-unrestricted
- (caar allowed)))))
- (setq nval (read-string "Edit: " value)))
- (setq nval (org-trim nval))
- (when (not (equal nval value))
- (setq eval '(org-entry-put pom key nval)))))
- (when eval
-
- (cond
- ((equal major-mode 'org-agenda-mode)
- (org-columns-eval eval)
- ;; The following let preserves the current format, and makes sure
- ;; that in only a single file things need to be upated.
- (let* ((org-agenda-overriding-columns-format org-columns-current-fmt)
- (buffer (marker-buffer pom))
- (org-agenda-contributing-files
- (list (with-current-buffer buffer
- (buffer-file-name (buffer-base-buffer))))))
- (org-agenda-columns)))
- (t
- (let ((inhibit-read-only t))
- (org-unmodified
- (remove-text-properties
- (max (point-min) (1- bol)) eol '(read-only t)))
- (unwind-protect
- (progn
- (setq org-columns-overlays
- (org-delete-all line-overlays org-columns-overlays))
- (mapc 'delete-overlay line-overlays)
- (org-columns-eval eval))
- (org-columns-display-here)))
- (org-move-to-column col)
- (if (and (org-mode-p)
- (nth 3 (assoc key org-columns-current-fmt-compiled)))
- (org-columns-update key)))))))
-
-(defun org-edit-headline () ; FIXME: this is not columns specific. Make interactive????? Use from agenda????
- "Edit the current headline, the part without TODO keyword, TAGS."
- (org-back-to-heading)
- (when (looking-at org-todo-line-regexp)
- (let ((pos (point))
- (pre (buffer-substring (match-beginning 0) (match-beginning 3)))
- (txt (match-string 3))
- (post "")
- txt2)
- (if (string-match (org-re "[ \t]+:[[:alnum:]:_@#%]+:[ \t]*$") txt)
- (setq post (match-string 0 txt)
- txt (substring txt 0 (match-beginning 0))))
- (setq txt2 (read-string "Edit: " txt))
- (when (not (equal txt txt2))
- (goto-char pos)
- (insert pre txt2 post)
- (delete-region (point) (point-at-eol))
- (org-set-tags nil t)))))
-
-(defun org-columns-edit-allowed ()
- "Edit the list of allowed values for the current property."
- (interactive)
- (let* ((pom (or (org-get-at-bol 'org-marker)
- (org-get-at-bol 'org-hd-marker)
- (point)))
- (key (get-char-property (point) 'org-columns-key))
- (key1 (concat key "_ALL"))
- (allowed (org-entry-get pom key1 t))
- nval)
- ;; FIXME: Cover editing TODO, TAGS etc in-buffer settings.????
- ;; FIXME: Write back to #+PROPERTY setting if that is needed.
- (setq nval (read-string "Allowed: " allowed))
- (org-entry-put
- (cond ((marker-position org-entry-property-inherited-from)
- org-entry-property-inherited-from)
- ((marker-position org-columns-top-level-marker)
- org-columns-top-level-marker)
- (t pom))
- key1 nval)))
-
-(defun org-columns-eval (form)
- (let (hidep)
- (save-excursion
- (beginning-of-line 1)
- ;; `next-line' is needed here, because it skips invisible line.
- (condition-case nil (org-no-warnings (next-line 1)) (error nil))
- (setq hidep (org-on-heading-p 1)))
- (eval form)
- (and hidep (hide-entry))))
-
-(defun org-columns-previous-allowed-value ()
- "Switch to the previous allowed value for this column."
- (interactive)
- (org-columns-next-allowed-value t))
-
-(defun org-columns-next-allowed-value (&optional previous nth)
- "Switch to the next allowed value for this column.
-When PREVIOUS is set, go to the previous value. When NTH is
-an integer, select that value."
- (interactive)
- (org-columns-check-computed)
- (let* ((col (current-column))
- (key (get-char-property (point) 'org-columns-key))
- (value (get-char-property (point) 'org-columns-value))
- (bol (point-at-bol)) (eol (point-at-eol))
- (pom (or (get-text-property bol 'org-hd-marker)
- (point))) ; keep despite of compiler waring
- (line-overlays
- (delq nil (mapcar (lambda (x)
- (and (eq (overlay-buffer x) (current-buffer))
- (>= (overlay-start x) bol)
- (<= (overlay-start x) eol)
- x))
- org-columns-overlays)))
- (allowed (or (org-property-get-allowed-values pom key)
- (and (memq
- (nth 4 (assoc key org-columns-current-fmt-compiled))
- '(checkbox checkbox-n-of-m checkbox-percent))
- '("[ ]" "[X]"))
- (org-colview-construct-allowed-dates value)))
- nval)
- (when (integerp nth)
- (setq nth (1- nth))
- (if (= nth -1) (setq nth 9)))
- (when (equal key "ITEM")
- (error "Cannot edit item headline from here"))
- (unless (or allowed (member key '("SCHEDULED" "DEADLINE")))
- (error "Allowed values for this property have not been defined"))
- (if (member key '("SCHEDULED" "DEADLINE"))
- (setq nval (if previous 'earlier 'later))
- (if previous (setq allowed (reverse allowed)))
- (cond
- (nth
- (setq nval (nth nth allowed))
- (if (not nval)
- (error "There are only %d allowed values for property `%s'"
- (length allowed) key)))
- ((member value allowed)
- (setq nval (or (car (cdr (member value allowed)))
- (car allowed)))
- (if (equal nval value)
- (error "Only one allowed value for this property")))
- (t (setq nval (car allowed)))))
- (cond
- ((equal major-mode 'org-agenda-mode)
- (org-columns-eval '(org-entry-put pom key nval))
- ;; The following let preserves the current format, and makes sure
- ;; that in only a single file things need to be upated.
- (let* ((org-agenda-overriding-columns-format org-columns-current-fmt)
- (buffer (marker-buffer pom))
- (org-agenda-contributing-files
- (list (with-current-buffer buffer
- (buffer-file-name (buffer-base-buffer))))))
- (org-agenda-columns)))
- (t
- (let ((inhibit-read-only t))
- (remove-text-properties (1- bol) eol '(read-only t))
- (unwind-protect
- (progn
- (setq org-columns-overlays
- (org-delete-all line-overlays org-columns-overlays))
- (mapc 'delete-overlay line-overlays)
- (org-columns-eval '(org-entry-put pom key nval)))
- (org-columns-display-here)))
- (org-move-to-column col)
- (and (nth 3 (assoc key org-columns-current-fmt-compiled))
- (org-columns-update key))))))
-
-(defun org-colview-construct-allowed-dates (s)
- "Construct a list of three dates around the date in S.
-This respects the format of the time stamp in S, active or non-active,
-and also including time or not. S must be just a time stamp, no text
-around it."
- (when (and s (string-match (concat "^" org-ts-regexp3 "$") s))
- (let* ((time (org-parse-time-string s 'nodefaults))
- (active (equal (string-to-char s) ?<))
- (fmt (funcall (if (nth 1 time) 'cdr 'car) org-time-stamp-formats))
- time-before time-after)
- (unless active (setq fmt (concat "[" (substring fmt 1 -1) "]")))
- (setf (car time) (or (car time) 0))
- (setf (nth 1 time) (or (nth 1 time) 0))
- (setf (nth 2 time) (or (nth 2 time) 0))
- (setq time-before (copy-sequence time))
- (setq time-after (copy-sequence time))
- (setf (nth 3 time-before) (1- (nth 3 time)))
- (setf (nth 3 time-after) (1+ (nth 3 time)))
- (mapcar (lambda (x) (format-time-string fmt (apply 'encode-time x)))
- (list time-before time time-after)))))
-
-(defun org-verify-version (task)
- (cond
- ((eq task 'columns)
- (if (or (and (featurep 'xemacs) (not (featurep 'org-colview-xemacs)))
- (and (not (featurep 'xemacs)) (< emacs-major-version 22)))
- (error "This version of Emacs cannot run Column View")))))
-
-(defun org-columns-open-link (&optional arg)
- (interactive "P")
- (let ((value (get-char-property (point) 'org-columns-value)))
- (org-open-link-from-string value arg)))
-
-(defun org-columns-get-format-and-top-level ()
- (let (fmt)
- (when (condition-case nil (org-back-to-heading) (error nil))
- (setq fmt (org-entry-get nil "COLUMNS" t)))
- (setq fmt (or fmt org-columns-default-format))
- (org-set-local 'org-columns-current-fmt fmt)
- (org-columns-compile-format fmt)
- (if (marker-position org-entry-property-inherited-from)
- (move-marker org-columns-top-level-marker
- org-entry-property-inherited-from)
- (move-marker org-columns-top-level-marker (point)))
- fmt))
-
-(defun org-columns ()
- "Turn on column view on an org-mode file."
- (interactive)
- (org-verify-version 'columns)
- (when (featurep 'xemacs)
- (set-face-foreground 'org-columns-space
- (face-background 'org-columns-space)))
- (org-columns-remove-overlays)
- (move-marker org-columns-begin-marker (point))
- (let ((org-columns-time (time-to-number-of-days (current-time)))
- beg end fmt cache maxwidths)
- (setq fmt (org-columns-get-format-and-top-level))
- (save-excursion
- (goto-char org-columns-top-level-marker)
- (setq beg (point))
- (unless org-columns-inhibit-recalculation
- (org-columns-compute-all))
- (setq end (or (condition-case nil (org-end-of-subtree t t) (error nil))
- (point-max)))
- ;; Get and cache the properties
- (goto-char beg)
- (when (assoc "CLOCKSUM" org-columns-current-fmt-compiled)
- (save-excursion
- (save-restriction
- (narrow-to-region beg end)
- (org-clock-sum))))
- (while (re-search-forward (concat "^" outline-regexp) end t)
- (if (and org-columns-skip-archived-trees
- (looking-at (concat ".*:" org-archive-tag ":")))
- (org-end-of-subtree t)
- (push (cons (org-current-line) (org-entry-properties)) cache)))
- (when cache
- (setq maxwidths (org-columns-get-autowidth-alist fmt cache))
- (org-set-local 'org-columns-current-maxwidths maxwidths)
- (org-columns-display-here-title)
- (unless (local-variable-p 'org-colview-initial-truncate-line-value
- (current-buffer))
- (org-set-local 'org-colview-initial-truncate-line-value
- truncate-lines))
- (setq truncate-lines t)
- (mapc (lambda (x)
- (org-goto-line (car x))
- (org-columns-display-here (cdr x)))
- cache)))))
-
-(eval-when-compile (defvar org-columns-time))
-
-(defvar org-columns-compile-map
- '(("none" none +)
- (":" add_times +)
- ("+" add_numbers +)
- ("$" currency +)
- ("X" checkbox +)
- ("X/" checkbox-n-of-m +)
- ("X%" checkbox-percent +)
- ("max" max_numbers max)
- ("min" min_numbers min)
- ("mean" mean_numbers
- (lambda (&rest x) (/ (apply '+ x) (float (length x)))))
- (":max" max_times max)
- (":min" min_times min)
- (":mean" mean_times
- (lambda (&rest x) (/ (apply '+ x) (float (length x)))))
- ("@min" min_age min (lambda (x) (- org-columns-time x)))
- ("@max" max_age max (lambda (x) (- org-columns-time x)))
- ("@mean" mean_age
- (lambda (&rest x) (/ (apply '+ x) (float (length x))))
- (lambda (x) (- org-columns-time x)))
- ("est+" estimate org-estimate-combine))
- "Operator <-> format,function,calc map.
-Used to compile/uncompile columns format and completing read in
-interactive function `org-columns-new'.
-
- operator string used in #+COLUMNS definition describing the
- summary type
- format symbol describing summary type selected interactively in
- `org-columns-new' and internally in
- `org-columns-number-to-string' and
- `org-columns-string-to-number'
- function called with a list of values as argument to calculate
- the summary value
- calc function called on every element before summarizing. This is
- optional and should only be specified if needed")
-
-
-(defun org-columns-new (&optional prop title width op fmt fun &rest rest)
- "Insert a new column, to the left of the current column."
- (interactive)
- (let ((n (org-columns-current-column))
- (editp (and prop (assoc prop org-columns-current-fmt-compiled)))
- cell)
- (setq prop (org-icompleting-read
- "Property: " (mapcar 'list (org-buffer-property-keys t nil t))
- nil nil prop))
- (setq title (read-string (concat "Column title [" prop "]: ") (or title prop)))
- (setq width (read-string "Column width: " (if width (number-to-string width))))
- (if (string-match "\\S-" width)
- (setq width (string-to-number width))
- (setq width nil))
- (setq fmt (org-icompleting-read "Summary [none]: "
- (mapcar (lambda (x) (list (symbol-name (cadr x)))) org-columns-compile-map)
- nil t))
- (setq fmt (intern fmt)
- fun (cdr (assoc fmt (mapcar 'cdr org-columns-compile-map))))
- (if (eq fmt 'none) (setq fmt nil))
- (if editp
- (progn
- (setcar editp prop)
- (setcdr editp (list title width nil fmt nil fun)))
- (setq cell (nthcdr (1- n) org-columns-current-fmt-compiled))
- (setcdr cell (cons (list prop title width nil fmt nil
- (car fun) (cadr fun))
- (cdr cell))))
- (org-columns-store-format)
- (org-columns-redo)))
-
-(defun org-columns-delete ()
- "Delete the column at point from columns view."
- (interactive)
- (let* ((n (org-columns-current-column))
- (title (nth 1 (nth n org-columns-current-fmt-compiled))))
- (when (y-or-n-p
- (format "Are you sure you want to remove column \"%s\"? " title))
- (setq org-columns-current-fmt-compiled
- (delq (nth n org-columns-current-fmt-compiled)
- org-columns-current-fmt-compiled))
- (org-columns-store-format)
- (org-columns-redo)
- (if (>= (org-columns-current-column)
- (length org-columns-current-fmt-compiled))
- (org-columns-backward-char)))))
-
-(defun org-columns-edit-attributes ()
- "Edit the attributes of the current column."
- (interactive)
- (let* ((n (org-columns-current-column))
- (info (nth n org-columns-current-fmt-compiled)))
- (apply 'org-columns-new info)))
-
-(defun org-columns-widen (arg)
- "Make the column wider by ARG characters."
- (interactive "p")
- (let* ((n (org-columns-current-column))
- (entry (nth n org-columns-current-fmt-compiled))
- (width (or (nth 2 entry)
- (cdr (assoc (car entry) org-columns-current-maxwidths)))))
- (setq width (max 1 (+ width arg)))
- (setcar (nthcdr 2 entry) width)
- (org-columns-store-format)
- (org-columns-redo)))
-
-(defun org-columns-narrow (arg)
- "Make the column narrower by ARG characters."
- (interactive "p")
- (org-columns-widen (- arg)))
-
-(defun org-columns-move-right ()
- "Swap this column with the one to the right."
- (interactive)
- (let* ((n (org-columns-current-column))
- (cell (nthcdr n org-columns-current-fmt-compiled))
- e)
- (when (>= n (1- (length org-columns-current-fmt-compiled)))
- (error "Cannot shift this column further to the right"))
- (setq e (car cell))
- (setcar cell (car (cdr cell)))
- (setcdr cell (cons e (cdr (cdr cell))))
- (org-columns-store-format)
- (org-columns-redo)
- (org-columns-forward-char)))
-
-(defun org-columns-move-left ()
- "Swap this column with the one to the left."
- (interactive)
- (let* ((n (org-columns-current-column)))
- (when (= n 0)
- (error "Cannot shift this column further to the left"))
- (org-columns-backward-char)
- (org-columns-move-right)
- (org-columns-backward-char)))
-
-(defun org-columns-store-format ()
- "Store the text version of the current columns format in appropriate place.
-This is either in the COLUMNS property of the node starting the current column
-display, or in the #+COLUMNS line of the current buffer."
- (let (fmt (cnt 0))
- (setq fmt (org-columns-uncompile-format org-columns-current-fmt-compiled))
- (org-set-local 'org-columns-current-fmt fmt)
- (if (marker-position org-columns-top-level-marker)
- (save-excursion
- (goto-char org-columns-top-level-marker)
- (if (and (org-at-heading-p)
- (org-entry-get nil "COLUMNS"))
- (org-entry-put nil "COLUMNS" fmt)
- (goto-char (point-min))
- ;; Overwrite all #+COLUMNS lines....
- (while (re-search-forward "^#\\+COLUMNS:.*" nil t)
- (setq cnt (1+ cnt))
- (replace-match (concat "#+COLUMNS: " fmt) t t))
- (unless (> cnt 0)
- (goto-char (point-min))
- (or (org-on-heading-p t) (outline-next-heading))
- (let ((inhibit-read-only t))
- (insert-before-markers "#+COLUMNS: " fmt "\n")))
- (org-set-local 'org-columns-default-format fmt))))))
-
-(defvar org-agenda-overriding-columns-format nil
- "When set, overrides any other format definition for the agenda.
-Don't set this, this is meant for dynamic scoping.")
-
-(defun org-columns-get-autowidth-alist (s cache)
- "Derive the maximum column widths from the format and the cache."
- (let ((start 0) rtn)
- (while (string-match (org-re "%\\([[:alpha:]][[:alnum:]_-]*\\)") s start)
- (push (cons (match-string 1 s) 1) rtn)
- (setq start (match-end 0)))
- (mapc (lambda (x)
- (setcdr x (apply 'max
- (mapcar
- (lambda (y)
- (length (or (cdr (assoc (car x) (cdr y))) " ")))
- cache))))
- rtn)
- rtn))
-
-(defun org-columns-compute-all ()
- "Compute all columns that have operators defined."
- (org-unmodified
- (remove-text-properties (point-min) (point-max) '(org-summaries t)))
- (let ((columns org-columns-current-fmt-compiled)
- (org-columns-time (time-to-number-of-days (current-time)))
- col)
- (while (setq col (pop columns))
- (when (nth 3 col)
- (save-excursion
- (org-columns-compute (car col)))))))
-
-(defun org-columns-update (property)
- "Recompute PROPERTY, and update the columns display for it."
- (org-columns-compute property)
- (let (fmt val pos face)
- (save-excursion
- (mapc (lambda (ov)
- (when (equal (overlay-get ov 'org-columns-key) property)
- (setq pos (overlay-start ov))
- (goto-char pos)
- (when (setq val (cdr (assoc property
- (get-text-property
- (point-at-bol) 'org-summaries))))
- (setq fmt (overlay-get ov 'org-columns-format))
- (overlay-put ov 'org-columns-value val)
- (if (featurep 'xemacs)
- (progn
- (setq face (glyph-face (extent-end-glyph ov)))
- (org-overlay-display ov (format fmt val) face))
- (org-overlay-display ov (format fmt val))))))
- org-columns-overlays))))
-
-(defun org-columns-compute (property)
- "Sum the values of property PROPERTY hierarchically, for the entire buffer."
- (interactive)
- (let* ((re (concat "^" outline-regexp))
- (lmax 30) ; Does anyone use deeper levels???
- (lvals (make-vector lmax nil))
- (lflag (make-vector lmax nil))
- (level 0)
- (ass (assoc property org-columns-current-fmt-compiled))
- (format (nth 4 ass))
- (printf (nth 5 ass))
- (fun (nth 6 ass))
- (calc (or (nth 7 ass) 'identity))
- (beg org-columns-top-level-marker)
- last-level val valflag flag end sumpos sum-alist sum str str1 useval)
- (save-excursion
- ;; Find the region to compute
- (goto-char beg)
- (setq end (condition-case nil (org-end-of-subtree t) (error (point-max))))
- (goto-char end)
- ;; Walk the tree from the back and do the computations
- (while (re-search-backward re beg t)
- (setq sumpos (match-beginning 0)
- last-level level
- level (org-outline-level)
- val (org-entry-get nil property)
- valflag (and val (string-match "\\S-" val)))
- (cond
- ((< level last-level)
- ;; put the sum of lower levels here as a property
- (setq sum (when (aref lvals last-level)
- (apply fun (aref lvals last-level)))
- flag (aref lflag last-level) ; any valid entries from children?
- str (org-columns-number-to-string sum format printf)
- str1 (org-add-props (copy-sequence str) nil 'org-computed t 'face 'bold)
- useval (if flag str1 (if valflag val ""))
- sum-alist (get-text-property sumpos 'org-summaries))
- (if (assoc property sum-alist)
- (setcdr (assoc property sum-alist) useval)
- (push (cons property useval) sum-alist)
- (org-unmodified
- (add-text-properties sumpos (1+ sumpos)
- (list 'org-summaries sum-alist))))
- (when (and val (not (equal val (if flag str val))))
- (org-entry-put nil property (if flag str val)))
- ;; add current to current level accumulator
- (when (or flag valflag)
- (push (if flag
- sum
- (funcall calc (org-columns-string-to-number
- (if flag str val) format)))
- (aref lvals level))
- (aset lflag level t))
- ;; clear accumulators for deeper levels
- (loop for l from (1+ level) to (1- lmax) do
- (aset lvals l nil)
- (aset lflag l nil)))
- ((>= level last-level)
- ;; add what we have here to the accumulator for this level
- (when valflag
- (push (funcall calc (org-columns-string-to-number val format))
- (aref lvals level))
- (aset lflag level t)))
- (t (error "This should not happen")))))))
-
-(defun org-columns-redo ()
- "Construct the column display again."
- (interactive)
- (message "Recomputing columns...")
- (save-excursion
- (if (marker-position org-columns-begin-marker)
- (goto-char org-columns-begin-marker))
- (org-columns-remove-overlays)
- (if (org-mode-p)
- (call-interactively 'org-columns)
- (org-agenda-redo)
- (call-interactively 'org-agenda-columns)))
- (when (featurep 'xemacs)
- (while (not (or (eolp)
- (member (extent-at (point)) org-columns-overlays)))
- (forward-char)))
- (message "Recomputing columns...done"))
-
-(defun org-columns-not-in-agenda ()
- (if (eq major-mode 'org-agenda-mode)
- (error "This command is only allowed in Org-mode buffers")))
-
-(defun org-string-to-number (s)
- "Convert string to number, and interpret hh:mm:ss."
- (if (not (string-match ":" s))
- (string-to-number s)
- (let ((l (nreverse (org-split-string s ":"))) (sum 0.0))
- (while l
- (setq sum (+ (string-to-number (pop l)) (/ sum 60))))
- sum)))
-
-(defun org-columns-number-to-string (n fmt &optional printf)
- "Convert a computed column number to a string value, according to FMT."
- (cond
- ((memq fmt '(estimate)) (org-estimate-print n printf))
- ((not (numberp n)) "")
- ((memq fmt '(add_times max_times min_times mean_times))
- (let* ((h (floor n)) (m (floor (+ 0.5 (* 60 (- n h))))))
- (format org-time-clocksum-format h m)))
- ((eq fmt 'checkbox)
- (cond ((= n (floor n)) "[X]")
- ((> n 1.) "[-]")
- (t "[ ]")))
- ((memq fmt '(checkbox-n-of-m checkbox-percent))
- (let* ((n1 (floor n)) (n2 (floor (+ .5 (* 1000000 (- n n1))))))
- (org-nofm-to-completion n1 (+ n2 n1) (eq fmt 'checkbox-percent))))
- (printf (format printf n))
- ((eq fmt 'currency)
- (format "%.2f" n))
- ((memq fmt '(min_age max_age mean_age))
- (org-format-time-period n))
- (t (number-to-string n))))
-
-(defun org-nofm-to-completion (n m &optional percent)
- (if (not percent)
- (format "[%d/%d]" n m)
- (format "[%d%%]"(floor (+ 0.5 (* 100. (/ (* 1.0 n) m)))))))
-
-(defun org-columns-string-to-number (s fmt)
- "Convert a column value to a number that can be used for column computing."
- (if s
- (cond
- ((memq fmt '(min_age max_age mean_age))
- (cond ((string= s "") org-columns-time)
- ((string-match
- "\\([0-9]+\\)d \\([0-9]+\\)h \\([0-9]+\\)m \\([0-9]+\\)s"
- s)
- (+ (* 60 (+ (* 60 (+ (* 24 (string-to-number (match-string 1 s)))
- (string-to-number (match-string 2 s))))
- (string-to-number (match-string 3 s))))
- (string-to-number (match-string 4 s))))
- (t (time-to-number-of-days (apply 'encode-time
- (org-parse-time-string s t))))))
- ((string-match ":" s)
- (let ((l (nreverse (org-split-string s ":"))) (sum 0.0))
- (while l
- (setq sum (+ (string-to-number (pop l)) (/ sum 60))))
- sum))
- ((memq fmt '(checkbox checkbox-n-of-m checkbox-percent))
- (if (equal s "[X]") 1. 0.000001))
- ((memq fmt '(estimate)) (org-string-to-estimate s))
- (t (string-to-number s)))))
-
-(defun org-columns-uncompile-format (cfmt)
- "Turn the compiled columns format back into a string representation."
- (let ((rtn "") e s prop title op op-match width fmt printf fun calc)
- (while (setq e (pop cfmt))
- (setq prop (car e)
- title (nth 1 e)
- width (nth 2 e)
- op (nth 3 e)
- fmt (nth 4 e)
- printf (nth 5 e)
- fun (nth 6 e)
- calc (nth 7 e))
- (when (setq op-match (rassoc (list fmt fun calc) org-columns-compile-map))
- (setq op (car op-match)))
- (if (and op printf) (setq op (concat op ";" printf)))
- (if (equal title prop) (setq title nil))
- (setq s (concat "%" (if width (number-to-string width))
- prop
- (if title (concat "(" title ")"))
- (if op (concat "{" op "}"))))
- (setq rtn (concat rtn " " s)))
- (org-trim rtn)))
-
-(defun org-columns-compile-format (fmt)
- "Turn a column format string into an alist of specifications.
-The alist has one entry for each column in the format. The elements of
-that list are:
-property the property
-title the title field for the columns
-width the column width in characters, can be nil for automatic
-operator the operator if any
-format the output format for computed results, derived from operator
-printf a printf format for computed values
-fun the lisp function to compute summary values, derived from operator
-calc function to get values from base elements"
- (let ((start 0) width prop title op op-match f printf fun calc)
- (setq org-columns-current-fmt-compiled nil)
- (while (string-match
- (org-re "%\\([0-9]+\\)?\\([[:alnum:]_-]+\\)\\(?:(\\([^)]+\\))\\)?\\(?:{\\([^}]+\\)}\\)?\\s-*")
- fmt start)
- (setq start (match-end 0)
- width (match-string 1 fmt)
- prop (match-string 2 fmt)
- title (or (match-string 3 fmt) prop)
- op (match-string 4 fmt)
- f nil
- printf nil
- fun '+
- calc nil)
- (if width (setq width (string-to-number width)))
- (when (and op (string-match ";" op))
- (setq printf (substring op (match-end 0))
- op (substring op 0 (match-beginning 0))))
- (when (setq op-match (assoc op org-columns-compile-map))
- (setq f (cadr op-match)
- fun (caddr op-match)
- calc (cadddr op-match)))
- (push (list prop title width op f printf fun calc)
- org-columns-current-fmt-compiled))
- (setq org-columns-current-fmt-compiled
- (nreverse org-columns-current-fmt-compiled))))
-
-
-;;; Dynamic block for Column view
-
-(defun org-columns-capture-view (&optional maxlevel skip-empty-rows)
- "Get the column view of the current buffer or subtree.
-The first optional argument MAXLEVEL sets the level limit. A
-second optional argument SKIP-EMPTY-ROWS tells whether to skip
-empty rows, an empty row being one where all the column view
-specifiers except ITEM are empty. This function returns a list
-containing the title row and all other rows. Each row is a list
-of fields."
- (if (featurep 'xemacs)
- (save-excursion
- (let* ((title (mapcar 'cadr org-columns-current-fmt-compiled))
- (re-comment (concat "\\*+[ \t]+" org-comment-string "\\>"))
- (re-archive (concat ".*:" org-archive-tag ":"))
- (n (length title)) row tbl)
- (goto-char (point-min))
-
- (while (re-search-forward "^\\(\\*+\\) " nil t)
- (catch 'next
- (when (and (or (null maxlevel)
- (>= maxlevel
- (if org-odd-levels-only
- (/ (1+ (length (match-string 1))) 2)
- (length (match-string 1)))))
- (get-char-property (match-beginning 0) 'org-columns-key))
- (goto-char (match-beginning 0))
- (when (save-excursion
- (goto-char (point-at-bol))
- (or (looking-at re-comment)
- (looking-at re-archive)))
- (org-end-of-subtree t)
- (throw 'next t))
- (setq row nil)
- (loop for i from 0 to (1- n) do
- (push
- (org-quote-vert
- (or (get-char-property (point)
- 'org-columns-value-modified)
- (get-char-property (point) 'org-columns-value)
- ""))
- row)
- (org-columns-forward-char))
- (setq row (nreverse row))
- (unless (and skip-empty-rows
- (eq 1 (length (delete "" (delete-dups (copy-sequence row))))))
- (push row tbl)))))
- (append (list title 'hline) (nreverse tbl))))
- (save-excursion
- (let* ((title (mapcar 'cadr org-columns-current-fmt-compiled))
- (n (length title)) row tbl)
- (goto-char (point-min))
- (while (and (re-search-forward "^\\(\\*+\\) " nil t)
- (or (null maxlevel)
- (>= maxlevel
- (if org-odd-levels-only
- (/ (1+ (length (match-string 1))) 2)
- (length (match-string 1))))))
- (when (get-char-property (match-beginning 0) 'org-columns-key)
- (setq row nil)
- (loop for i from 0 to (1- n) do
- (push (or (get-char-property (+ (match-beginning 0) i)
- 'org-columns-value-modified)
- (get-char-property (+ (match-beginning 0) i)
- 'org-columns-value)
- "")
- row))
- (setq row (nreverse row))
- (unless (and skip-empty-rows
- (eq 1 (length (delete "" (delete-dups row)))))
- (push row tbl))))
- (append (list title 'hline) (nreverse tbl))))))
-
-(defun org-dblock-write:columnview (params)
- "Write the column view table.
-PARAMS is a property list of parameters:
-
-:width enforce same column widths with <N> specifiers.
-:id the :ID: property of the entry where the columns view
- should be built. When the symbol `local', call locally.
- When `global' call column view with the cursor at the beginning
- of the buffer (usually this means that the whole buffer switches
- to column view). When \"file:path/to/file.org\", invoke column
- view at the start of that file. Otherwise, the ID is located
- using `org-id-find'.
-:hlines When t, insert a hline before each item. When a number, insert
- a hline before each level <= that number.
-:vlines When t, make each column a colgroup to enforce vertical lines.
-:maxlevel When set to a number, don't capture headlines below this level.
-:skip-empty-rows
- When t, skip rows where all specifiers other than ITEM are empty."
- (let ((pos (move-marker (make-marker) (point)))
- (hlines (plist-get params :hlines))
- (vlines (plist-get params :vlines))
- (maxlevel (plist-get params :maxlevel))
- (content-lines (org-split-string (plist-get params :content) "\n"))
- (skip-empty-rows (plist-get params :skip-empty-rows))
- tbl id idpos nfields tmp recalc line
- id-as-string view-file view-pos)
- (when (setq id (plist-get params :id))
- (setq id-as-string (cond ((numberp id) (number-to-string id))
- ((symbolp id) (symbol-name id))
- ((stringp id) id)
- (t "")))
- (cond ((not id) nil)
- ((eq id 'global) (setq view-pos (point-min)))
- ((eq id 'local))
- ((string-match "^file:\\(.*\\)" id-as-string)
- (setq view-file (match-string 1 id-as-string)
- view-pos 1)
- (unless (file-exists-p view-file)
- (error "No such file: \"%s\"" id-as-string)))
- ((setq idpos (org-find-entry-with-id id))
- (setq view-pos idpos))
- ((setq idpos (org-id-find id))
- (setq view-file (car idpos))
- (setq view-pos (cdr idpos)))
- (t (error "Cannot find entry with :ID: %s" id))))
- (with-current-buffer (if view-file
- (get-file-buffer view-file)
- (current-buffer))
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (or view-pos (point)))
- (org-columns)
- (setq tbl (org-columns-capture-view maxlevel skip-empty-rows))
- (setq nfields (length (car tbl)))
- (org-columns-quit))))
- (goto-char pos)
- (move-marker pos nil)
- (when tbl
- (when (plist-get params :hlines)
- (setq tmp nil)
- (while tbl
- (if (eq (car tbl) 'hline)
- (push (pop tbl) tmp)
- (if (string-match "\\` *\\(\\*+\\)" (caar tbl))
- (if (and (not (eq (car tmp) 'hline))
- (or (eq hlines t)
- (and (numberp hlines)
- (<= (- (match-end 1) (match-beginning 1))
- hlines))))
- (push 'hline tmp)))
- (push (pop tbl) tmp)))
- (setq tbl (nreverse tmp)))
- (when vlines
- (setq tbl (mapcar (lambda (x)
- (if (eq 'hline x) x (cons "" x)))
- tbl))
- (setq tbl (append tbl (list (cons "/" (make-list nfields "<>"))))))
- (setq pos (point))
- (when content-lines
- (while (string-match "^#" (car content-lines))
- (insert (pop content-lines) "\n")))
- (insert (org-listtable-to-string tbl))
- (when (plist-get params :width)
- (insert "\n|" (mapconcat (lambda (x) (format "<%d>" (max 3 x)))
- org-columns-current-widths "|")))
- (while (setq line (pop content-lines))
- (when (string-match "^#" line)
- (insert "\n" line)
- (when (string-match "^[ \t]*#\\+TBLFM" line)
- (setq recalc t))))
- (if recalc
- (progn (goto-char pos) (org-table-recalculate 'all))
- (goto-char pos)
- (org-table-align)))))
-
-(defun org-listtable-to-string (tbl)
- "Convert a listtable TBL to a string that contains the Org-mode table.
-The table still need to be aligned. The resulting string has no leading
-and tailing newline characters."
- (mapconcat
- (lambda (x)
- (cond
- ((listp x)
- (concat "|" (mapconcat 'identity x "|") "|"))
- ((eq x 'hline) "|-|")
- (t (error "Garbage in listtable: %s" x))))
- tbl "\n"))
-
-(defun org-insert-columns-dblock ()
- "Create a dynamic block capturing a column view table."
- (interactive)
- (when (featurep 'xemacs) (org-columns-quit))
- (let ((defaults '(:name "columnview" :hlines 1))
- (id (org-icompleting-read
- "Capture columns (local, global, entry with :ID: property) [local]: "
- (append '(("global") ("local"))
- (mapcar 'list (org-property-values "ID"))))))
- (if (equal id "") (setq id 'local))
- (if (equal id "global") (setq id 'global))
- (setq defaults (append defaults (list :id id)))
- (org-create-dblock defaults)
- (org-update-dblock)))
-
-;;; Column view in the agenda
-
-(defvar org-agenda-view-columns-initially nil
- "When set, switch to columns view immediately after creating the agenda.")
-
-(defvar org-agenda-columns-show-summaries) ; defined in org-agenda.el
-(defvar org-agenda-columns-compute-summary-properties); defined in org-agenda.el
-(defvar org-agenda-columns-add-appointments-to-effort-sum); as well
-
-(defun org-agenda-columns ()
- "Turn on or update column view in the agenda."
- (interactive)
- (org-verify-version 'columns)
- (org-columns-remove-overlays)
- (move-marker org-columns-begin-marker (point))
- (let ((org-columns-time (time-to-number-of-days (current-time)))
- cache maxwidths m p a d fmt)
- (cond
- ((and (boundp 'org-agenda-overriding-columns-format)
- org-agenda-overriding-columns-format)
- (setq fmt org-agenda-overriding-columns-format)
- (org-set-local 'org-agenda-overriding-columns-format fmt))
- ((setq m (org-get-at-bol 'org-hd-marker))
- (setq fmt (or (org-entry-get m "COLUMNS" t)
- (with-current-buffer (marker-buffer m)
- org-columns-default-format))))
- ((and (boundp 'org-columns-current-fmt)
- (local-variable-p 'org-columns-current-fmt (current-buffer))
- org-columns-current-fmt)
- (setq fmt org-columns-current-fmt))
- ((setq m (next-single-property-change (point-min) 'org-hd-marker))
- (setq m (get-text-property m 'org-hd-marker))
- (setq fmt (or (org-entry-get m "COLUMNS" t)
- (with-current-buffer (marker-buffer m)
- org-columns-default-format)))))
- (setq fmt (or fmt org-columns-default-format))
- (org-set-local 'org-columns-current-fmt fmt)
- (org-columns-compile-format fmt)
- (when org-agenda-columns-compute-summary-properties
- (org-agenda-colview-compute org-columns-current-fmt-compiled))
- (save-excursion
- ;; Get and cache the properties
- (goto-char (point-min))
- (while (not (eobp))
- (when (setq m (or (org-get-at-bol 'org-hd-marker)
- (org-get-at-bol 'org-marker)))
- (setq p (org-entry-properties m))
-
- (when (or (not (setq a (assoc org-effort-property p)))
- (not (string-match "\\S-" (or (cdr a) ""))))
- ;; OK, the property is not defined. Use appointment duration?
- (when (and org-agenda-columns-add-appointments-to-effort-sum
- (setq d (get-text-property (point) 'duration)))
- (setq d (org-minutes-to-hh:mm-string d))
- (put-text-property 0 (length d) 'face 'org-warning d)
- (push (cons org-effort-property d) p)))
- (push (cons (org-current-line) p) cache))
- (beginning-of-line 2))
- (when cache
- (setq maxwidths (org-columns-get-autowidth-alist fmt cache))
- (org-set-local 'org-columns-current-maxwidths maxwidths)
- (org-columns-display-here-title)
- (mapc (lambda (x)
- (org-goto-line (car x))
- (org-columns-display-here (cdr x)))
- cache)
- (when org-agenda-columns-show-summaries
- (org-agenda-colview-summarize cache))))))
-
-(defun org-agenda-colview-summarize (cache)
- "Summarize the summarizable columns in column view in the agenda.
-This will add overlays to the date lines, to show the summary for each day."
- (let* ((fmt (mapcar (lambda (x)
- (if (equal (car x) "CLOCKSUM")
- (list "CLOCKSUM" (nth 2 x) nil 'add_times nil '+ 'identity)
- (cdr x)))
- org-columns-current-fmt-compiled))
- line c c1 stype calc sumfunc props lsum entries prop v)
- (catch 'exit
- (when (delq nil (mapcar 'cadr fmt))
- ;; OK, at least one summation column, it makes sense to try this
- (goto-char (point-max))
- (while t
- (when (or (get-text-property (point) 'org-date-line)
- (eq (get-text-property (point) 'face)
- 'org-agenda-structure))
- ;; OK, this is a date line that should be used
- (setq line (org-current-line))
- (setq entries nil c cache cache nil)
- (while (setq c1 (pop c))
- (if (> (car c1) line)
- (push c1 entries)
- (push c1 cache)))
- ;; now ENTRIES are the ones we want to use, CACHE is the rest
- ;; Compute the summaries for the properties we want,
- ;; set nil properties for the rest.
- (when (setq entries (mapcar 'cdr entries))
- (setq props
- (mapcar
- (lambda (f)
- (setq prop (car f)
- stype (nth 3 f)
- sumfunc (nth 5 f)
- calc (or (nth 6 f) 'identity))
- (cond
- ((equal prop "ITEM")
- (cons prop (buffer-substring (point-at-bol)
- (point-at-eol))))
- ((not stype) (cons prop ""))
- (t ;; do the summary
- (setq lsum nil)
- (dolist (x entries)
- (setq v (cdr (assoc prop x)))
- (if v
- (push
- (funcall
- (if (not (get-text-property 0 'org-computed v))
- calc
- 'identity)
- (org-columns-string-to-number
- v stype))
- lsum)))
- (setq lsum (remove nil lsum))
- (setq lsum
- (cond ((> (length lsum) 1)
- (org-columns-number-to-string
- (apply sumfunc lsum) stype))
- ((eq (length lsum) 1)
- (org-columns-number-to-string
- (car lsum) stype))
- (t "")))
- (put-text-property 0 (length lsum) 'face 'bold lsum)
- (unless (eq calc 'identity)
- (put-text-property 0 (length lsum) 'org-computed t lsum))
- (cons prop lsum))))
- fmt))
- (org-columns-display-here props)
- (org-set-local 'org-agenda-columns-active t)))
- (if (bobp) (throw 'exit t))
- (beginning-of-line 0))))))
-
-(defun org-agenda-colview-compute (fmt)
- "Compute the relevant columns in the contributing source buffers."
- (let ((files org-agenda-contributing-files)
- (org-columns-begin-marker (make-marker))
- (org-columns-top-level-marker (make-marker))
- f fm a b)
- (while (setq f (pop files))
- (setq b (find-buffer-visiting f))
- (with-current-buffer (or (buffer-base-buffer b) b)
- (save-excursion
- (save-restriction
- (widen)
- (org-unmodified
- (remove-text-properties (point-min) (point-max)
- '(org-summaries t)))
- (goto-char (point-min))
- (org-columns-get-format-and-top-level)
- (while (setq fm (pop fmt))
- (if (equal (car fm) "CLOCKSUM")
- (org-clock-sum)
- (when (and (nth 4 fm)
- (setq a (assoc (car fm)
- org-columns-current-fmt-compiled))
- (equal (nth 4 a) (nth 4 fm)))
- (org-columns-compute (car fm)))))))))))
-
-(defun org-format-time-period (interval)
- "Convert time in fractional days to days/hours/minutes/seconds."
- (if (numberp interval)
- (let* ((days (floor interval))
- (frac-hours (* 24 (- interval days)))
- (hours (floor frac-hours))
- (minutes (floor (* 60 (- frac-hours hours))))
- (seconds (floor (* 60 (- (* 60 (- frac-hours hours)) minutes)))))
- (format "%dd %02dh %02dm %02ds" days hours minutes seconds))
- ""))
-
-(defun org-estimate-mean-and-var (v)
- "Return the mean and variance of an estimate."
- (let* ((low (float (car v)))
- (high (float (cadr v)))
- (mean (/ (+ low high) 2.0))
- (var (/ (+ (expt (- mean low) 2.0) (expt (- high mean) 2.0)) 2.0)))
- (list mean var)))
-
-(defun org-estimate-combine (&rest el)
- "Combine a list of estimates, using mean and variance.
-The mean and variance of the result will be the sum of the means
-and variances (respectively) of the individual estimates."
- (let ((mean 0)
- (var 0))
- (mapc (lambda (e)
- (let ((stats (org-estimate-mean-and-var e)))
- (setq mean (+ mean (car stats)))
- (setq var (+ var (cadr stats)))))
- el)
- (let ((stdev (sqrt var)))
- (list (- mean stdev) (+ mean stdev)))))
-
-(defun org-estimate-print (e &optional fmt)
- "Prepare a string representation of an estimate.
-This formats these numbers as two numbers with a \"-\" between them."
- (if (null fmt) (set 'fmt "%.0f"))
- (format "%s" (mapconcat (lambda (n) (format fmt n)) e "-")))
-
-(defun org-string-to-estimate (s)
- "Convert a string to an estimate.
-The string should be two numbers joined with a \"-\"."
- (if (string-match "\\(.*\\)-\\(.*\\)" s)
- (list (string-to-number (match-string 1 s))
- (string-to-number(match-string 2 s)))
- (list (string-to-number s) (string-to-number s))))
-
-(provide 'org-colview)
-(provide 'org-colview-xemacs)
-
-;;; org-colview-xemacs.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-colview-xemacs.elc b/.emacs.d/org-7.4/lisp/org-colview-xemacs.elc
deleted file mode 100644
index d4efe65..0000000
--- a/.emacs.d/org-7.4/lisp/org-colview-xemacs.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-colview.el b/.emacs.d/org-7.4/lisp/org-colview.el
deleted file mode 100644
index c4f18c7..0000000
--- a/.emacs.d/org-7.4/lisp/org-colview.el
+++ /dev/null
@@ -1,1542 +0,0 @@
-;;; org-colview.el --- Column View in Org-mode
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file contains the column view for Org.
-
-;;; Code:
-
-(eval-when-compile (require 'cl))
-(require 'org)
-
-(declare-function org-agenda-redo "org-agenda" ())
-(declare-function org-agenda-do-context-action "org-agenda" ())
-
-(when (featurep 'xemacs)
- (error "Do not load this file into XEmacs, use 'org-colview-xemacs.el'."))
-
-;;; Column View
-
-(defvar org-columns-overlays nil
- "Holds the list of current column overlays.")
-
-(defvar org-columns-current-fmt nil
- "Local variable, holds the currently active column format.")
-(make-variable-buffer-local 'org-columns-current-fmt)
-(defvar org-columns-current-fmt-compiled nil
- "Local variable, holds the currently active column format.
-This is the compiled version of the format.")
-(make-variable-buffer-local 'org-columns-current-fmt-compiled)
-(defvar org-columns-current-widths nil
- "Loval variable, holds the currently widths of fields.")
-(make-variable-buffer-local 'org-columns-current-widths)
-(defvar org-columns-current-maxwidths nil
- "Loval variable, holds the currently active maximum column widths.")
-(make-variable-buffer-local 'org-columns-current-maxwidths)
-(defvar org-columns-begin-marker (make-marker)
- "Points to the position where last a column creation command was called.")
-(defvar org-columns-top-level-marker (make-marker)
- "Points to the position where current columns region starts.")
-
-(defvar org-columns-map (make-sparse-keymap)
- "The keymap valid in column display.")
-
-(defun org-columns-content ()
- "Switch to contents view while in columns view."
- (interactive)
- (org-overview)
- (org-content))
-
-(org-defkey org-columns-map "c" 'org-columns-content)
-(org-defkey org-columns-map "o" 'org-overview)
-(org-defkey org-columns-map "e" 'org-columns-edit-value)
-(org-defkey org-columns-map "\C-c\C-t" 'org-columns-todo)
-(org-defkey org-columns-map "\C-c\C-c" 'org-columns-set-tags-or-toggle)
-(org-defkey org-columns-map "\C-c\C-o" 'org-columns-open-link)
-(org-defkey org-columns-map "v" 'org-columns-show-value)
-(org-defkey org-columns-map "q" 'org-columns-quit)
-(org-defkey org-columns-map "r" 'org-columns-redo)
-(org-defkey org-columns-map "g" 'org-columns-redo)
-(org-defkey org-columns-map [left] 'backward-char)
-(org-defkey org-columns-map "\M-b" 'backward-char)
-(org-defkey org-columns-map "a" 'org-columns-edit-allowed)
-(org-defkey org-columns-map "s" 'org-columns-edit-attributes)
-(org-defkey org-columns-map "\M-f"
- (lambda () (interactive) (goto-char (1+ (point)))))
-(org-defkey org-columns-map [right]
- (lambda () (interactive) (goto-char (1+ (point)))))
-(org-defkey org-columns-map [down]
- (lambda () (interactive)
- (let ((col (current-column)))
- (beginning-of-line 2)
- (while (and (org-invisible-p2) (not (eobp)))
- (beginning-of-line 2))
- (move-to-column col)
- (if (eq major-mode 'org-agenda-mode)
- (org-agenda-do-context-action)))))
-(org-defkey org-columns-map [up]
- (lambda () (interactive)
- (let ((col (current-column)))
- (beginning-of-line 0)
- (while (and (org-invisible-p2) (not (bobp)))
- (beginning-of-line 0))
- (move-to-column col)
- (if (eq major-mode 'org-agenda-mode)
- (org-agenda-do-context-action)))))
-(org-defkey org-columns-map [(shift right)] 'org-columns-next-allowed-value)
-(org-defkey org-columns-map "n" 'org-columns-next-allowed-value)
-(org-defkey org-columns-map [(shift left)] 'org-columns-previous-allowed-value)
-(org-defkey org-columns-map "p" 'org-columns-previous-allowed-value)
-(org-defkey org-columns-map "<" 'org-columns-narrow)
-(org-defkey org-columns-map ">" 'org-columns-widen)
-(org-defkey org-columns-map [(meta right)] 'org-columns-move-right)
-(org-defkey org-columns-map [(meta left)] 'org-columns-move-left)
-(org-defkey org-columns-map [(shift meta right)] 'org-columns-new)
-(org-defkey org-columns-map [(shift meta left)] 'org-columns-delete)
-(dotimes (i 10)
- (org-defkey org-columns-map (number-to-string i)
- `(lambda () (interactive)
- (org-columns-next-allowed-value nil ,i))))
-
-(easy-menu-define org-columns-menu org-columns-map "Org Column Menu"
- '("Column"
- ["Edit property" org-columns-edit-value t]
- ["Next allowed value" org-columns-next-allowed-value t]
- ["Previous allowed value" org-columns-previous-allowed-value t]
- ["Show full value" org-columns-show-value t]
- ["Edit allowed values" org-columns-edit-allowed t]
- "--"
- ["Edit column attributes" org-columns-edit-attributes t]
- ["Increase column width" org-columns-widen t]
- ["Decrease column width" org-columns-narrow t]
- "--"
- ["Move column right" org-columns-move-right t]
- ["Move column left" org-columns-move-left t]
- ["Add column" org-columns-new t]
- ["Delete column" org-columns-delete t]
- "--"
- ["CONTENTS" org-columns-content t]
- ["OVERVIEW" org-overview t]
- ["Refresh columns display" org-columns-redo t]
- "--"
- ["Open link" org-columns-open-link t]
- "--"
- ["Quit" org-columns-quit t]))
-
-(defun org-columns-new-overlay (beg end &optional string face)
- "Create a new column overlay and add it to the list."
- (let ((ov (make-overlay beg end)))
- (overlay-put ov 'face (or face 'secondary-selection))
- (org-overlay-display ov string face)
- (push ov org-columns-overlays)
- ov))
-
-(defun org-columns-display-here (&optional props dateline)
- "Overlay the current line with column display."
- (interactive)
- (let* ((fmt org-columns-current-fmt-compiled)
- (beg (point-at-bol))
- (level-face (save-excursion
- (beginning-of-line 1)
- (and (looking-at "\\(\\**\\)\\(\\* \\)")
- (org-get-level-face 2))))
- (ref-face (or level-face
- (and (eq major-mode 'org-agenda-mode)
- (get-text-property (point-at-bol) 'face))
- 'default))
- (color (list :foreground (face-attribute ref-face :foreground)))
- (face (list color 'org-column ref-face))
- (face1 (list color 'org-agenda-column-dateline ref-face))
- (pl (or (get-text-property (point-at-bol) 'prefix-length) 0))
- (cphr (get-text-property (point-at-bol) 'org-complex-heading-regexp))
- pom property ass width f string ov column val modval s2 title calc)
- ;; Check if the entry is in another buffer.
- (unless props
- (if (eq major-mode 'org-agenda-mode)
- (setq pom (or (org-get-at-bol 'org-hd-marker)
- (org-get-at-bol 'org-marker))
- props (if pom (org-entry-properties pom) nil))
- (setq props (org-entry-properties nil))))
- ;; Walk the format
- (while (setq column (pop fmt))
- (setq property (car column)
- title (nth 1 column)
- ass (if (equal property "ITEM")
- (cons "ITEM"
- (save-match-data
- (org-no-properties
- (org-remove-tabs
- (buffer-substring-no-properties
- (point-at-bol) (point-at-eol))))))
- (assoc property props))
- width (or (cdr (assoc property org-columns-current-maxwidths))
- (nth 2 column)
- (length property))
- f (format "%%-%d.%ds | " width width)
- calc (nth 7 column)
- val (or (cdr ass) "")
- modval (cond ((and org-columns-modify-value-for-display-function
- (functionp
- org-columns-modify-value-for-display-function))
- (funcall org-columns-modify-value-for-display-function
- title val))
- ((equal property "ITEM")
- (if (org-mode-p)
- (org-columns-cleanup-item
- val org-columns-current-fmt-compiled)
- (org-agenda-columns-cleanup-item
- val pl cphr org-columns-current-fmt-compiled)))
- ((and calc (functionp calc)
- (not (string= val ""))
- (not (get-text-property 0 'org-computed val)))
- (org-columns-number-to-string
- (funcall calc (org-columns-string-to-number
- val (nth 4 column)))
- (nth 4 column)))))
- (setq s2 (org-columns-add-ellipses (or modval val) width))
- (setq string (format f s2))
- ;; Create the overlay
- (org-unmodified
- (setq ov (org-columns-new-overlay
- beg (setq beg (1+ beg)) string (if dateline face1 face)))
- (overlay-put ov 'keymap org-columns-map)
- (overlay-put ov 'org-columns-key property)
- (overlay-put ov 'org-columns-value (cdr ass))
- (overlay-put ov 'org-columns-value-modified modval)
- (overlay-put ov 'org-columns-pom pom)
- (overlay-put ov 'org-columns-format f)
- (overlay-put ov 'line-prefix "")
- (overlay-put ov 'wrap-prefix ""))
- (if (or (not (char-after beg))
- (equal (char-after beg) ?\n))
- (let ((inhibit-read-only t))
- (save-excursion
- (goto-char beg)
- (org-unmodified (insert " ")))))) ;; FIXME: add props and remove later?
- ;; Make the rest of the line disappear.
- (org-unmodified
- (setq ov (org-columns-new-overlay beg (point-at-eol)))
- (overlay-put ov 'invisible t)
- (overlay-put ov 'keymap org-columns-map)
- (overlay-put ov 'intangible t)
- (overlay-put ov 'line-prefix "")
- (overlay-put ov 'wrap-prefix "")
- (push ov org-columns-overlays)
- (setq ov (make-overlay (1- (point-at-eol)) (1+ (point-at-eol))))
- (overlay-put ov 'keymap org-columns-map)
- (push ov org-columns-overlays)
- (let ((inhibit-read-only t))
- (put-text-property (max (point-min) (1- (point-at-bol)))
- (min (point-max) (1+ (point-at-eol)))
- 'read-only "Type `e' to edit property")))))
-
-(defun org-columns-add-ellipses (string width)
- "Truncate STRING with WIDTH characters, with ellipses."
- (cond
- ((<= (length string) width) string)
- ((<= width (length org-columns-ellipses))
- (substring org-columns-ellipses 0 width))
- (t (concat (substring string 0 (- width (length org-columns-ellipses)))
- org-columns-ellipses))))
-
-(defvar org-columns-full-header-line-format nil
- "The full header line format, will be shifted by horizontal scrolling." )
-(defvar org-previous-header-line-format nil
- "The header line format before column view was turned on.")
-(defvar org-columns-inhibit-recalculation nil
- "Inhibit recomputing of columns on column view startup.")
-(defvar org-columns-flyspell-was-active nil
- "Remember the state of `flyspell-mode' before column view.
-Flyspell-mode can cause problems in columns view, so it is turned off
-for the duration of the command.")
-
-(defvar header-line-format)
-(defvar org-columns-previous-hscroll 0)
-
-(defun org-columns-display-here-title ()
- "Overlay the newline before the current line with the table title."
- (interactive)
- (let ((fmt org-columns-current-fmt-compiled)
- string (title "")
- property width f column str widths)
- (while (setq column (pop fmt))
- (setq property (car column)
- str (or (nth 1 column) property)
- width (or (cdr (assoc property org-columns-current-maxwidths))
- (nth 2 column)
- (length str))
- widths (push width widths)
- f (format "%%-%d.%ds | " width width)
- string (format f str)
- title (concat title string)))
- (setq title (concat
- (org-add-props " " nil 'display '(space :align-to 0))
- ;;(org-add-props title nil 'face '(:weight bold :underline t :inherit default))))
- (org-add-props title nil 'face 'org-column-title)))
- (org-set-local 'org-previous-header-line-format header-line-format)
- (org-set-local 'org-columns-current-widths (nreverse widths))
- (setq org-columns-full-header-line-format title)
- (setq org-columns-previous-hscroll -1)
-; (org-columns-hscoll-title)
- (org-add-hook 'post-command-hook 'org-columns-hscoll-title nil 'local)))
-
-(defun org-columns-hscoll-title ()
- "Set the `header-line-format' so that it scrolls along with the table."
- (sit-for .0001) ; need to force a redisplay to update window-hscroll
- (when (not (= (window-hscroll) org-columns-previous-hscroll))
- (setq header-line-format
- (concat (substring org-columns-full-header-line-format 0 1)
- (substring org-columns-full-header-line-format
- (1+ (window-hscroll))))
- org-columns-previous-hscroll (window-hscroll))
- (force-mode-line-update)))
-
-(defvar org-colview-initial-truncate-line-value nil
- "Remember the value of `truncate-lines' across colview.")
-
-(defun org-columns-remove-overlays ()
- "Remove all currently active column overlays."
- (interactive)
- (when (marker-buffer org-columns-begin-marker)
- (with-current-buffer (marker-buffer org-columns-begin-marker)
- (when (local-variable-p 'org-previous-header-line-format)
- (setq header-line-format org-previous-header-line-format)
- (kill-local-variable 'org-previous-header-line-format)
- (remove-hook 'post-command-hook 'org-columns-hscoll-title 'local))
- (move-marker org-columns-begin-marker nil)
- (move-marker org-columns-top-level-marker nil)
- (org-unmodified
- (mapc 'delete-overlay org-columns-overlays)
- (setq org-columns-overlays nil)
- (let ((inhibit-read-only t))
- (remove-text-properties (point-min) (point-max) '(read-only t))))
- (when org-columns-flyspell-was-active
- (flyspell-mode 1))
- (when (local-variable-p 'org-colview-initial-truncate-line-value)
- (setq truncate-lines org-colview-initial-truncate-line-value)))))
-
-(defun org-columns-cleanup-item (item fmt)
- "Remove from ITEM what is a column in the format FMT."
- (if (not org-complex-heading-regexp)
- item
- (when (string-match org-complex-heading-regexp item)
- (setq item
- (concat
- (org-add-props (match-string 1 item) nil
- 'org-whitespace (* 2 (1- (org-reduced-level (- (match-end 1) (match-beginning 1))))))
- (and (match-end 2) (not (assoc "TODO" fmt)) (concat " " (match-string 2 item)))
- (and (match-end 3) (not (assoc "PRIORITY" fmt)) (concat " " (match-string 3 item)))
- " " (save-match-data (org-columns-compact-links (match-string 4 item)))
- (and (match-end 5) (not (assoc "TAGS" fmt)) (concat " " (match-string 5 item)))))
- (add-text-properties
- 0 (1+ (match-end 1))
- (list 'org-whitespace (* 2 (1- (org-reduced-level (- (match-end 1) (match-beginning 1))))))
- item)
- item)))
-
-(defun org-columns-compact-links (s)
- "Replace [[link][desc]] with [desc] or [link]."
- (while (string-match org-bracket-link-regexp s)
- (setq s (replace-match
- (concat "[" (match-string (if (match-end 3) 3 1) s) "]")
- t t s)))
- s)
-
-(defvar org-agenda-columns-remove-prefix-from-item)
-
-(defun org-agenda-columns-cleanup-item (item pl cphr fmt)
- "Cleanup the time property for agenda column view.
-See also the variable `org-agenda-columns-remove-prefix-from-item'."
- (let* ((org-complex-heading-regexp cphr)
- (prefix (substring item 0 pl))
- (rest (substring item pl))
- (fake (concat "* " rest))
- (cleaned (org-trim (substring (org-columns-cleanup-item fake fmt) 1))))
- (if org-agenda-columns-remove-prefix-from-item
- cleaned
- (concat prefix cleaned))))
-
-(defun org-columns-show-value ()
- "Show the full value of the property."
- (interactive)
- (let ((value (get-char-property (point) 'org-columns-value)))
- (message "Value is: %s" (or value ""))))
-
-(defvar org-agenda-columns-active) ;; defined in org-agenda.el
-
-(defun org-columns-quit ()
- "Remove the column overlays and in this way exit column editing."
- (interactive)
- (org-unmodified
- (org-columns-remove-overlays)
- (let ((inhibit-read-only t))
- (remove-text-properties (point-min) (point-max) '(read-only t))))
- (when (eq major-mode 'org-agenda-mode)
- (setq org-agenda-columns-active nil)
- (message
- "Modification not yet reflected in Agenda buffer, use `r' to refresh")))
-
-(defun org-columns-check-computed ()
- "Check if this column value is computed.
-If yes, throw an error indicating that changing it does not make sense."
- (let ((val (get-char-property (point) 'org-columns-value)))
- (when (and (stringp val)
- (get-char-property 0 'org-computed val))
- (error "This value is computed from the entry's children"))))
-
-(defun org-columns-todo (&optional arg)
- "Change the TODO state during column view."
- (interactive "P")
- (org-columns-edit-value "TODO"))
-
-(defun org-columns-set-tags-or-toggle (&optional arg)
- "Toggle checkbox at point, or set tags for current headline."
- (interactive "P")
- (if (string-match "\\`\\[[ xX-]\\]\\'"
- (get-char-property (point) 'org-columns-value))
- (org-columns-next-allowed-value)
- (org-columns-edit-value "TAGS")))
-
-(defun org-columns-edit-value (&optional key)
- "Edit the value of the property at point in column view.
-Where possible, use the standard interface for changing this line."
- (interactive)
- (org-columns-check-computed)
- (let* ((col (current-column))
- (key (or key (get-char-property (point) 'org-columns-key)))
- (value (get-char-property (point) 'org-columns-value))
- (bol (point-at-bol)) (eol (point-at-eol))
- (pom (or (get-text-property bol 'org-hd-marker)
- (point))) ; keep despite of compiler waring
- (line-overlays
- (delq nil (mapcar (lambda (x)
- (and (eq (overlay-buffer x) (current-buffer))
- (>= (overlay-start x) bol)
- (<= (overlay-start x) eol)
- x))
- org-columns-overlays)))
- (org-columns-time (time-to-number-of-days (current-time)))
- nval eval allowed)
- (cond
- ((equal key "CLOCKSUM")
- (error "This special column cannot be edited"))
- ((equal key "ITEM")
- (setq eval '(org-with-point-at pom
- (org-edit-headline))))
- ((equal key "TODO")
- (setq eval '(org-with-point-at
- pom
- (call-interactively 'org-todo))))
- ((equal key "PRIORITY")
- (setq eval '(org-with-point-at pom
- (call-interactively 'org-priority))))
- ((equal key "TAGS")
- (setq eval '(org-with-point-at pom
- (let ((org-fast-tag-selection-single-key
- (if (eq org-fast-tag-selection-single-key 'expert)
- t org-fast-tag-selection-single-key)))
- (call-interactively 'org-set-tags)))))
- ((equal key "DEADLINE")
- (setq eval '(org-with-point-at pom
- (call-interactively 'org-deadline))))
- ((equal key "SCHEDULED")
- (setq eval '(org-with-point-at pom
- (call-interactively 'org-schedule))))
- ((equal key "BEAMER_env")
- (setq eval '(org-with-point-at pom
- (call-interactively 'org-beamer-select-environment))))
- (t
- (setq allowed (org-property-get-allowed-values pom key 'table))
- (if allowed
- (setq nval (org-icompleting-read
- "Value: " allowed nil
- (not (get-text-property 0 'org-unrestricted
- (caar allowed)))))
- (setq nval (read-string "Edit: " value)))
- (setq nval (org-trim nval))
- (when (not (equal nval value))
- (setq eval '(org-entry-put pom key nval)))))
- (when eval
-
- (cond
- ((equal major-mode 'org-agenda-mode)
- (org-columns-eval eval)
- ;; The following let preserves the current format, and makes sure
- ;; that in only a single file things need to be upated.
- (let* ((org-agenda-overriding-columns-format org-columns-current-fmt)
- (buffer (marker-buffer pom))
- (org-agenda-contributing-files
- (list (with-current-buffer buffer
- (buffer-file-name (buffer-base-buffer))))))
- (org-agenda-columns)))
- (t
- (let ((inhibit-read-only t))
- (org-unmodified
- (remove-text-properties
- (max (point-min) (1- bol)) eol '(read-only t)))
- (unwind-protect
- (progn
- (setq org-columns-overlays
- (org-delete-all line-overlays org-columns-overlays))
- (mapc 'delete-overlay line-overlays)
- (org-columns-eval eval))
- (org-columns-display-here)))
- (org-move-to-column col)
- (if (and (org-mode-p)
- (nth 3 (assoc key org-columns-current-fmt-compiled)))
- (org-columns-update key)))))))
-
-(defun org-edit-headline () ; FIXME: this is not columns specific. Make interactive????? Use from agenda????
- "Edit the current headline, the part without TODO keyword, TAGS."
- (org-back-to-heading)
- (when (looking-at org-todo-line-regexp)
- (let ((pos (point))
- (pre (buffer-substring (match-beginning 0) (match-beginning 3)))
- (txt (match-string 3))
- (post "")
- txt2)
- (if (string-match (org-re "[ \t]+:[[:alnum:]:_@#%]+:[ \t]*$") txt)
- (setq post (match-string 0 txt)
- txt (substring txt 0 (match-beginning 0))))
- (setq txt2 (read-string "Edit: " txt))
- (when (not (equal txt txt2))
- (goto-char pos)
- (insert pre txt2 post)
- (delete-region (point) (point-at-eol))
- (org-set-tags nil t)))))
-
-(defun org-columns-edit-allowed ()
- "Edit the list of allowed values for the current property."
- (interactive)
- (let* ((pom (or (org-get-at-bol 'org-marker)
- (org-get-at-bol 'org-hd-marker)
- (point)))
- (key (get-char-property (point) 'org-columns-key))
- (key1 (concat key "_ALL"))
- (allowed (org-entry-get pom key1 t))
- nval)
- ;; FIXME: Cover editing TODO, TAGS etc in-buffer settings.????
- ;; FIXME: Write back to #+PROPERTY setting if that is needed.
- (setq nval (read-string "Allowed: " allowed))
- (org-entry-put
- (cond ((marker-position org-entry-property-inherited-from)
- org-entry-property-inherited-from)
- ((marker-position org-columns-top-level-marker)
- org-columns-top-level-marker)
- (t pom))
- key1 nval)))
-
-(defun org-columns-eval (form)
- (let (hidep)
- (save-excursion
- (beginning-of-line 1)
- ;; `next-line' is needed here, because it skips invisible line.
- (condition-case nil (org-no-warnings (next-line 1)) (error nil))
- (setq hidep (org-on-heading-p 1)))
- (eval form)
- (and hidep (hide-entry))))
-
-(defun org-columns-previous-allowed-value ()
- "Switch to the previous allowed value for this column."
- (interactive)
- (org-columns-next-allowed-value t))
-
-(defun org-columns-next-allowed-value (&optional previous nth)
- "Switch to the next allowed value for this column.
-When PREVIOUS is set, go to the previous value. When NTH is
-an integer, select that value."
- (interactive)
- (org-columns-check-computed)
- (let* ((col (current-column))
- (key (get-char-property (point) 'org-columns-key))
- (value (get-char-property (point) 'org-columns-value))
- (bol (point-at-bol)) (eol (point-at-eol))
- (pom (or (get-text-property bol 'org-hd-marker)
- (point))) ; keep despite of compiler waring
- (line-overlays
- (delq nil (mapcar (lambda (x)
- (and (eq (overlay-buffer x) (current-buffer))
- (>= (overlay-start x) bol)
- (<= (overlay-start x) eol)
- x))
- org-columns-overlays)))
- (allowed (or (org-property-get-allowed-values pom key)
- (and (memq
- (nth 4 (assoc key org-columns-current-fmt-compiled))
- '(checkbox checkbox-n-of-m checkbox-percent))
- '("[ ]" "[X]"))
- (org-colview-construct-allowed-dates value)))
- nval)
- (when (integerp nth)
- (setq nth (1- nth))
- (if (= nth -1) (setq nth 9)))
- (when (equal key "ITEM")
- (error "Cannot edit item headline from here"))
- (unless (or allowed (member key '("SCHEDULED" "DEADLINE")))
- (error "Allowed values for this property have not been defined"))
- (if (member key '("SCHEDULED" "DEADLINE"))
- (setq nval (if previous 'earlier 'later))
- (if previous (setq allowed (reverse allowed)))
- (cond
- (nth
- (setq nval (nth nth allowed))
- (if (not nval)
- (error "There are only %d allowed values for property `%s'"
- (length allowed) key)))
- ((member value allowed)
- (setq nval (or (car (cdr (member value allowed)))
- (car allowed)))
- (if (equal nval value)
- (error "Only one allowed value for this property")))
- (t (setq nval (car allowed)))))
- (cond
- ((equal major-mode 'org-agenda-mode)
- (org-columns-eval '(org-entry-put pom key nval))
- ;; The following let preserves the current format, and makes sure
- ;; that in only a single file things need to be upated.
- (let* ((org-agenda-overriding-columns-format org-columns-current-fmt)
- (buffer (marker-buffer pom))
- (org-agenda-contributing-files
- (list (with-current-buffer buffer
- (buffer-file-name (buffer-base-buffer))))))
- (org-agenda-columns)))
- (t
- (let ((inhibit-read-only t))
- (remove-text-properties (1- bol) eol '(read-only t))
- (unwind-protect
- (progn
- (setq org-columns-overlays
- (org-delete-all line-overlays org-columns-overlays))
- (mapc 'delete-overlay line-overlays)
- (org-columns-eval '(org-entry-put pom key nval)))
- (org-columns-display-here)))
- (org-move-to-column col)
- (and (nth 3 (assoc key org-columns-current-fmt-compiled))
- (org-columns-update key))))))
-
-(defun org-colview-construct-allowed-dates (s)
- "Construct a list of three dates around the date in S.
-This respects the format of the time stamp in S, active or non-active,
-and also including time or not. S must be just a time stamp, no text
-around it."
- (when (and s (string-match (concat "^" org-ts-regexp3 "$") s))
- (let* ((time (org-parse-time-string s 'nodefaults))
- (active (equal (string-to-char s) ?<))
- (fmt (funcall (if (nth 1 time) 'cdr 'car) org-time-stamp-formats))
- time-before time-after)
- (unless active (setq fmt (concat "[" (substring fmt 1 -1) "]")))
- (setf (car time) (or (car time) 0))
- (setf (nth 1 time) (or (nth 1 time) 0))
- (setf (nth 2 time) (or (nth 2 time) 0))
- (setq time-before (copy-sequence time))
- (setq time-after (copy-sequence time))
- (setf (nth 3 time-before) (1- (nth 3 time)))
- (setf (nth 3 time-after) (1+ (nth 3 time)))
- (mapcar (lambda (x) (format-time-string fmt (apply 'encode-time x)))
- (list time-before time time-after)))))
-
-(defun org-verify-version (task)
- (cond
- ((eq task 'columns)
- (if (or (featurep 'xemacs)
- (< emacs-major-version 22))
- (error "Emacs 22 is required for the columns feature")))))
-
-(defun org-columns-open-link (&optional arg)
- (interactive "P")
- (let ((value (get-char-property (point) 'org-columns-value)))
- (org-open-link-from-string value arg)))
-
-(defun org-columns-get-format-and-top-level ()
- (let (fmt)
- (when (condition-case nil (org-back-to-heading) (error nil))
- (setq fmt (org-entry-get nil "COLUMNS" t)))
- (setq fmt (or fmt org-columns-default-format))
- (org-set-local 'org-columns-current-fmt fmt)
- (org-columns-compile-format fmt)
- (if (marker-position org-entry-property-inherited-from)
- (move-marker org-columns-top-level-marker
- org-entry-property-inherited-from)
- (move-marker org-columns-top-level-marker (point)))
- fmt))
-
-(defun org-columns ()
- "Turn on column view on an org-mode file."
- (interactive)
- (org-verify-version 'columns)
- (org-columns-remove-overlays)
- (move-marker org-columns-begin-marker (point))
- (let ((org-columns-time (time-to-number-of-days (current-time)))
- beg end fmt cache maxwidths)
- (setq fmt (org-columns-get-format-and-top-level))
- (save-excursion
- (goto-char org-columns-top-level-marker)
- (setq beg (point))
- (unless org-columns-inhibit-recalculation
- (org-columns-compute-all))
- (setq end (or (condition-case nil (org-end-of-subtree t t) (error nil))
- (point-max)))
- ;; Get and cache the properties
- (goto-char beg)
- (when (assoc "CLOCKSUM" org-columns-current-fmt-compiled)
- (save-excursion
- (save-restriction
- (narrow-to-region beg end)
- (org-clock-sum))))
- (while (re-search-forward (concat "^" outline-regexp) end t)
- (if (and org-columns-skip-archived-trees
- (looking-at (concat ".*:" org-archive-tag ":")))
- (org-end-of-subtree t)
- (push (cons (org-current-line) (org-entry-properties)) cache)))
- (when cache
- (setq maxwidths (org-columns-get-autowidth-alist fmt cache))
- (org-set-local 'org-columns-current-maxwidths maxwidths)
- (org-columns-display-here-title)
- (when (org-set-local 'org-columns-flyspell-was-active
- (org-bound-and-true-p flyspell-mode))
- (flyspell-mode 0))
- (unless (local-variable-p 'org-colview-initial-truncate-line-value)
- (org-set-local 'org-colview-initial-truncate-line-value
- truncate-lines))
- (setq truncate-lines t)
- (mapc (lambda (x)
- (org-goto-line (car x))
- (org-columns-display-here (cdr x)))
- cache)))))
-
-(eval-when-compile (defvar org-columns-time))
-
-(defvar org-columns-compile-map
- '(("none" none +)
- (":" add_times +)
- ("+" add_numbers +)
- ("$" currency +)
- ("X" checkbox +)
- ("X/" checkbox-n-of-m +)
- ("X%" checkbox-percent +)
- ("max" max_numbers max)
- ("min" min_numbers min)
- ("mean" mean_numbers
- (lambda (&rest x) (/ (apply '+ x) (float (length x)))))
- (":max" max_times max)
- (":min" min_times min)
- (":mean" mean_times
- (lambda (&rest x) (/ (apply '+ x) (float (length x)))))
- ("@min" min_age min (lambda (x) (- org-columns-time x)))
- ("@max" max_age max (lambda (x) (- org-columns-time x)))
- ("@mean" mean_age
- (lambda (&rest x) (/ (apply '+ x) (float (length x))))
- (lambda (x) (- org-columns-time x)))
- ("est+" estimate org-estimate-combine))
- "Operator <-> format,function,calc map.
-Used to compile/uncompile columns format and completing read in
-interactive function `org-columns-new'.
-
-operator string used in #+COLUMNS definition describing the
- summary type
-format symbol describing summary type selected interactively in
- `org-columns-new' and internally in
- `org-columns-number-to-string' and
- `org-columns-string-to-number'
-function called with a list of values as argument to calculate
- the summary value
-calc function called on every element before summarizing. This is
- optional and should only be specified if needed")
-
-(defun org-columns-new (&optional prop title width op fmt fun &rest rest)
- "Insert a new column, to the left of the current column."
- (interactive)
- (let ((editp (and prop (assoc prop org-columns-current-fmt-compiled)))
- cell)
- (setq prop (org-icompleting-read
- "Property: " (mapcar 'list (org-buffer-property-keys t nil t))
- nil nil prop))
- (setq title (read-string (concat "Column title [" prop "]: ") (or title prop)))
- (setq width (read-string "Column width: " (if width (number-to-string width))))
- (if (string-match "\\S-" width)
- (setq width (string-to-number width))
- (setq width nil))
- (setq fmt (org-icompleting-read
- "Summary [none]: "
- (mapcar (lambda (x) (list (symbol-name (cadr x))))
- org-columns-compile-map)
- nil t))
- (setq fmt (intern fmt)
- fun (cdr (assoc fmt (mapcar 'cdr org-columns-compile-map))))
- (if (eq fmt 'none) (setq fmt nil))
- (if editp
- (progn
- (setcar editp prop)
- (setcdr editp (list title width nil fmt nil fun)))
- (setq cell (nthcdr (1- (current-column))
- org-columns-current-fmt-compiled))
- (setcdr cell (cons (list prop title width nil fmt nil
- (car fun) (cadr fun))
- (cdr cell))))
- (org-columns-store-format)
- (org-columns-redo)))
-
-(defun org-columns-delete ()
- "Delete the column at point from columns view."
- (interactive)
- (let* ((n (current-column))
- (title (nth 1 (nth n org-columns-current-fmt-compiled))))
- (when (y-or-n-p
- (format "Are you sure you want to remove column \"%s\"? " title))
- (setq org-columns-current-fmt-compiled
- (delq (nth n org-columns-current-fmt-compiled)
- org-columns-current-fmt-compiled))
- (org-columns-store-format)
- (org-columns-redo)
- (if (>= (current-column) (length org-columns-current-fmt-compiled))
- (backward-char 1)))))
-
-(defun org-columns-edit-attributes ()
- "Edit the attributes of the current column."
- (interactive)
- (let* ((n (current-column))
- (info (nth n org-columns-current-fmt-compiled)))
- (apply 'org-columns-new info)))
-
-(defun org-columns-widen (arg)
- "Make the column wider by ARG characters."
- (interactive "p")
- (let* ((n (current-column))
- (entry (nth n org-columns-current-fmt-compiled))
- (width (or (nth 2 entry)
- (cdr (assoc (car entry) org-columns-current-maxwidths)))))
- (setq width (max 1 (+ width arg)))
- (setcar (nthcdr 2 entry) width)
- (org-columns-store-format)
- (org-columns-redo)))
-
-(defun org-columns-narrow (arg)
- "Make the column narrower by ARG characters."
- (interactive "p")
- (org-columns-widen (- arg)))
-
-(defun org-columns-move-right ()
- "Swap this column with the one to the right."
- (interactive)
- (let* ((n (current-column))
- (cell (nthcdr n org-columns-current-fmt-compiled))
- e)
- (when (>= n (1- (length org-columns-current-fmt-compiled)))
- (error "Cannot shift this column further to the right"))
- (setq e (car cell))
- (setcar cell (car (cdr cell)))
- (setcdr cell (cons e (cdr (cdr cell))))
- (org-columns-store-format)
- (org-columns-redo)
- (forward-char 1)))
-
-(defun org-columns-move-left ()
- "Swap this column with the one to the left."
- (interactive)
- (let* ((n (current-column)))
- (when (= n 0)
- (error "Cannot shift this column further to the left"))
- (backward-char 1)
- (org-columns-move-right)
- (backward-char 1)))
-
-(defun org-columns-store-format ()
- "Store the text version of the current columns format in appropriate place.
-This is either in the COLUMNS property of the node starting the current column
-display, or in the #+COLUMNS line of the current buffer."
- (let (fmt (cnt 0))
- (setq fmt (org-columns-uncompile-format org-columns-current-fmt-compiled))
- (org-set-local 'org-columns-current-fmt fmt)
- (if (marker-position org-columns-top-level-marker)
- (save-excursion
- (goto-char org-columns-top-level-marker)
- (if (and (org-at-heading-p)
- (org-entry-get nil "COLUMNS"))
- (org-entry-put nil "COLUMNS" fmt)
- (goto-char (point-min))
- ;; Overwrite all #+COLUMNS lines....
- (while (re-search-forward "^#\\+COLUMNS:.*" nil t)
- (setq cnt (1+ cnt))
- (replace-match (concat "#+COLUMNS: " fmt) t t))
- (unless (> cnt 0)
- (goto-char (point-min))
- (or (org-on-heading-p t) (outline-next-heading))
- (let ((inhibit-read-only t))
- (insert-before-markers "#+COLUMNS: " fmt "\n")))
- (org-set-local 'org-columns-default-format fmt))))))
-
-(defvar org-agenda-overriding-columns-format nil
- "When set, overrides any other format definition for the agenda.
-Don't set this, this is meant for dynamic scoping.")
-
-(defun org-columns-get-autowidth-alist (s cache)
- "Derive the maximum column widths from the format and the cache."
- (let ((start 0) rtn)
- (while (string-match (org-re "%\\([[:alpha:]][[:alnum:]_-]*\\)") s start)
- (push (cons (match-string 1 s) 1) rtn)
- (setq start (match-end 0)))
- (mapc (lambda (x)
- (setcdr x (apply 'max
- (mapcar
- (lambda (y)
- (length (or (cdr (assoc (car x) (cdr y))) " ")))
- cache))))
- rtn)
- rtn))
-
-(defun org-columns-compute-all ()
- "Compute all columns that have operators defined."
- (org-unmodified
- (remove-text-properties (point-min) (point-max) '(org-summaries t)))
- (let ((columns org-columns-current-fmt-compiled)
- (org-columns-time (time-to-number-of-days (current-time)))
- col)
- (while (setq col (pop columns))
- (when (nth 3 col)
- (save-excursion
- (org-columns-compute (car col)))))))
-
-(defun org-columns-update (property)
- "Recompute PROPERTY, and update the columns display for it."
- (org-columns-compute property)
- (let (fmt val pos)
- (save-excursion
- (mapc (lambda (ov)
- (when (equal (overlay-get ov 'org-columns-key) property)
- (setq pos (overlay-start ov))
- (goto-char pos)
- (when (setq val (cdr (assoc property
- (get-text-property
- (point-at-bol) 'org-summaries))))
- (setq fmt (overlay-get ov 'org-columns-format))
- (overlay-put ov 'org-columns-value val)
- (overlay-put ov 'display (format fmt val)))))
- org-columns-overlays))))
-
-(defun org-columns-compute (property)
- "Sum the values of property PROPERTY hierarchically, for the entire buffer."
- (interactive)
- (let* ((re (concat "^" outline-regexp))
- (lmax 30) ; Does anyone use deeper levels???
- (lvals (make-vector lmax nil))
- (lflag (make-vector lmax nil))
- (level 0)
- (ass (assoc property org-columns-current-fmt-compiled))
- (format (nth 4 ass))
- (printf (nth 5 ass))
- (fun (nth 6 ass))
- (calc (or (nth 7 ass) 'identity))
- (beg org-columns-top-level-marker)
- last-level val valflag flag end sumpos sum-alist sum str str1 useval)
- (save-excursion
- ;; Find the region to compute
- (goto-char beg)
- (setq end (condition-case nil (org-end-of-subtree t) (error (point-max))))
- (goto-char end)
- ;; Walk the tree from the back and do the computations
- (while (re-search-backward re beg t)
- (setq sumpos (match-beginning 0)
- last-level level
- level (org-outline-level)
- val (org-entry-get nil property)
- valflag (and val (string-match "\\S-" val)))
- (cond
- ((< level last-level)
- ;; put the sum of lower levels here as a property
- (setq sum (when (aref lvals last-level)
- (apply fun (aref lvals last-level)))
- flag (aref lflag last-level) ; any valid entries from children?
- str (org-columns-number-to-string sum format printf)
- str1 (org-add-props (copy-sequence str) nil 'org-computed t 'face 'bold)
- useval (if flag str1 (if valflag val ""))
- sum-alist (get-text-property sumpos 'org-summaries))
- (if (assoc property sum-alist)
- (setcdr (assoc property sum-alist) useval)
- (push (cons property useval) sum-alist)
- (org-unmodified
- (add-text-properties sumpos (1+ sumpos)
- (list 'org-summaries sum-alist))))
- (when (and val (not (equal val (if flag str val))))
- (org-entry-put nil property (if flag str val)))
- ;; add current to current level accumulator
- (when (or flag valflag)
- (push (if flag
- sum
- (funcall calc (org-columns-string-to-number
- (if flag str val) format)))
- (aref lvals level))
- (aset lflag level t))
- ;; clear accumulators for deeper levels
- (loop for l from (1+ level) to (1- lmax) do
- (aset lvals l nil)
- (aset lflag l nil)))
- ((>= level last-level)
- ;; add what we have here to the accumulator for this level
- (when valflag
- (push (funcall calc (org-columns-string-to-number val format))
- (aref lvals level))
- (aset lflag level t)))
- (t (error "This should not happen")))))))
-
-(defun org-columns-redo ()
- "Construct the column display again."
- (interactive)
- (message "Recomputing columns...")
- (let ((line (org-current-line))
- (col (current-column)))
- (save-excursion
- (if (marker-position org-columns-begin-marker)
- (goto-char org-columns-begin-marker))
- (org-columns-remove-overlays)
- (if (org-mode-p)
- (call-interactively 'org-columns)
- (org-agenda-redo)
- (call-interactively 'org-agenda-columns)))
- (org-goto-line line)
- (move-to-column col))
- (message "Recomputing columns...done"))
-
-(defun org-columns-not-in-agenda ()
- (if (eq major-mode 'org-agenda-mode)
- (error "This command is only allowed in Org-mode buffers")))
-
-(defun org-string-to-number (s)
- "Convert string to number, and interpret hh:mm:ss."
- (if (not (string-match ":" s))
- (string-to-number s)
- (let ((l (nreverse (org-split-string s ":"))) (sum 0.0))
- (while l
- (setq sum (+ (string-to-number (pop l)) (/ sum 60))))
- sum)))
-
-(defun org-columns-number-to-string (n fmt &optional printf)
- "Convert a computed column number to a string value, according to FMT."
- (cond
- ((memq fmt '(estimate)) (org-estimate-print n printf))
- ((not (numberp n)) "")
- ((memq fmt '(add_times max_times min_times mean_times))
- (let* ((h (floor n)) (m (floor (+ 0.5 (* 60 (- n h))))))
- (format org-time-clocksum-format h m)))
- ((eq fmt 'checkbox)
- (cond ((= n (floor n)) "[X]")
- ((> n 1.) "[-]")
- (t "[ ]")))
- ((memq fmt '(checkbox-n-of-m checkbox-percent))
- (let* ((n1 (floor n)) (n2 (floor (+ .5 (* 1000000 (- n n1))))))
- (org-nofm-to-completion n1 (+ n2 n1) (eq fmt 'checkbox-percent))))
- (printf (format printf n))
- ((eq fmt 'currency)
- (format "%.2f" n))
- ((memq fmt '(min_age max_age mean_age))
- (org-format-time-period n))
- (t (number-to-string n))))
-
-(defun org-nofm-to-completion (n m &optional percent)
- (if (not percent)
- (format "[%d/%d]" n m)
- (format "[%d%%]"(floor (+ 0.5 (* 100. (/ (* 1.0 n) m)))))))
-
-
-(defun org-columns-string-to-number (s fmt)
- "Convert a column value to a number that can be used for column computing."
- (if s
- (cond
- ((memq fmt '(min_age max_age mean_age))
- (cond ((string= s "") org-columns-time)
- ((string-match
- "\\([0-9]+\\)d \\([0-9]+\\)h \\([0-9]+\\)m \\([0-9]+\\)s"
- s)
- (+ (* 60 (+ (* 60 (+ (* 24 (string-to-number (match-string 1 s)))
- (string-to-number (match-string 2 s))))
- (string-to-number (match-string 3 s))))
- (string-to-number (match-string 4 s))))
- (t (time-to-number-of-days (apply 'encode-time
- (org-parse-time-string s t))))))
- ((string-match ":" s)
- (let ((l (nreverse (org-split-string s ":"))) (sum 0.0))
- (while l
- (setq sum (+ (string-to-number (pop l)) (/ sum 60))))
- sum))
- ((memq fmt '(checkbox checkbox-n-of-m checkbox-percent))
- (if (equal s "[X]") 1. 0.000001))
- ((memq fmt '(estimate)) (org-string-to-estimate s))
- (t (string-to-number s)))))
-
-(defun org-columns-uncompile-format (cfmt)
- "Turn the compiled columns format back into a string representation."
- (let ((rtn "") e s prop title op op-match width fmt printf fun calc)
- (while (setq e (pop cfmt))
- (setq prop (car e)
- title (nth 1 e)
- width (nth 2 e)
- op (nth 3 e)
- fmt (nth 4 e)
- printf (nth 5 e)
- fun (nth 6 e)
- calc (nth 7 e))
- (when (setq op-match (rassoc (list fmt fun calc) org-columns-compile-map))
- (setq op (car op-match)))
- (if (and op printf) (setq op (concat op ";" printf)))
- (if (equal title prop) (setq title nil))
- (setq s (concat "%" (if width (number-to-string width))
- prop
- (if title (concat "(" title ")"))
- (if op (concat "{" op "}"))))
- (setq rtn (concat rtn " " s)))
- (org-trim rtn)))
-
-(defun org-columns-compile-format (fmt)
- "Turn a column format string into an alist of specifications.
-The alist has one entry for each column in the format. The elements of
-that list are:
-property the property
-title the title field for the columns
-width the column width in characters, can be nil for automatic
-operator the operator if any
-format the output format for computed results, derived from operator
-printf a printf format for computed values
-fun the lisp function to compute summary values, derived from operator
-calc function to get values from base elements"
- (let ((start 0) width prop title op op-match f printf fun calc)
- (setq org-columns-current-fmt-compiled nil)
- (while (string-match
- (org-re "%\\([0-9]+\\)?\\([[:alnum:]_-]+\\)\\(?:(\\([^)]+\\))\\)?\\(?:{\\([^}]+\\)}\\)?\\s-*")
- fmt start)
- (setq start (match-end 0)
- width (match-string 1 fmt)
- prop (match-string 2 fmt)
- title (or (match-string 3 fmt) prop)
- op (match-string 4 fmt)
- f nil
- printf nil
- fun '+
- calc nil)
- (if width (setq width (string-to-number width)))
- (when (and op (string-match ";" op))
- (setq printf (substring op (match-end 0))
- op (substring op 0 (match-beginning 0))))
- (when (setq op-match (assoc op org-columns-compile-map))
- (setq f (cadr op-match)
- fun (caddr op-match)
- calc (cadddr op-match)))
- (push (list prop title width op f printf fun calc)
- org-columns-current-fmt-compiled))
- (setq org-columns-current-fmt-compiled
- (nreverse org-columns-current-fmt-compiled))))
-
-
-;;; Dynamic block for Column view
-
-(defun org-columns-capture-view (&optional maxlevel skip-empty-rows)
- "Get the column view of the current buffer or subtree.
-The first optional argument MAXLEVEL sets the level limit. A
-second optional argument SKIP-EMPTY-ROWS tells whether to skip
-empty rows, an empty row being one where all the column view
-specifiers except ITEM are empty. This function returns a list
-containing the title row and all other rows. Each row is a list
-of fields."
- (save-excursion
- (let* ((title (mapcar 'cadr org-columns-current-fmt-compiled))
- (re-comment (concat "\\*+[ \t]+" org-comment-string "\\>"))
- (re-archive (concat ".*:" org-archive-tag ":"))
- (n (length title)) row tbl)
- (goto-char (point-min))
- (while (re-search-forward "^\\(\\*+\\) " nil t)
- (catch 'next
- (when (and (or (null maxlevel)
- (>= maxlevel
- (if org-odd-levels-only
- (/ (1+ (length (match-string 1))) 2)
- (length (match-string 1)))))
- (get-char-property (match-beginning 0) 'org-columns-key))
- (when (save-excursion
- (goto-char (point-at-bol))
- (or (looking-at re-comment)
- (looking-at re-archive)))
- (org-end-of-subtree t)
- (throw 'next t))
- (setq row nil)
- (loop for i from 0 to (1- n) do
- (push
- (org-quote-vert
- (or (get-char-property (+ (match-beginning 0) i) 'org-columns-value-modified)
- (get-char-property (+ (match-beginning 0) i) 'org-columns-value)
- ""))
- row))
- (setq row (nreverse row))
- (unless (and skip-empty-rows
- (eq 1 (length (delete "" (delete-dups (copy-sequence row))))))
- (push row tbl)))))
- (append (list title 'hline) (nreverse tbl)))))
-
-(defun org-dblock-write:columnview (params)
- "Write the column view table.
-PARAMS is a property list of parameters:
-
-:width enforce same column widths with <N> specifiers.
-:id the :ID: property of the entry where the columns view
- should be built. When the symbol `local', call locally.
- When `global' call column view with the cursor at the beginning
- of the buffer (usually this means that the whole buffer switches
- to column view). When \"file:path/to/file.org\", invoke column
- view at the start of that file. Otherwise, the ID is located
- using `org-id-find'.
-:hlines When t, insert a hline before each item. When a number, insert
- a hline before each level <= that number.
-:vlines When t, make each column a colgroup to enforce vertical lines.
-:maxlevel When set to a number, don't capture headlines below this level.
-:skip-empty-rows
- When t, skip rows where all specifiers other than ITEM are empty."
- (let ((pos (move-marker (make-marker) (point)))
- (hlines (plist-get params :hlines))
- (vlines (plist-get params :vlines))
- (maxlevel (plist-get params :maxlevel))
- (content-lines (org-split-string (plist-get params :content) "\n"))
- (skip-empty-rows (plist-get params :skip-empty-rows))
- tbl id idpos nfields tmp recalc line
- id-as-string view-file view-pos)
- (when (setq id (plist-get params :id))
- (setq id-as-string (cond ((numberp id) (number-to-string id))
- ((symbolp id) (symbol-name id))
- ((stringp id) id)
- (t "")))
- (cond ((not id) nil)
- ((eq id 'global) (setq view-pos (point-min)))
- ((eq id 'local))
- ((string-match "^file:\\(.*\\)" id-as-string)
- (setq view-file (match-string 1 id-as-string)
- view-pos 1)
- (unless (file-exists-p view-file)
- (error "No such file: \"%s\"" id-as-string)))
- ((setq idpos (org-find-entry-with-id id))
- (setq view-pos idpos))
- ((setq idpos (org-id-find id))
- (setq view-file (car idpos))
- (setq view-pos (cdr idpos)))
- (t (error "Cannot find entry with :ID: %s" id))))
- (with-current-buffer (if view-file
- (get-file-buffer view-file)
- (current-buffer))
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (or view-pos (point)))
- (org-columns)
- (setq tbl (org-columns-capture-view maxlevel skip-empty-rows))
- (setq nfields (length (car tbl)))
- (org-columns-quit))))
- (goto-char pos)
- (move-marker pos nil)
- (when tbl
- (when (plist-get params :hlines)
- (setq tmp nil)
- (while tbl
- (if (eq (car tbl) 'hline)
- (push (pop tbl) tmp)
- (if (string-match "\\` *\\(\\*+\\)" (caar tbl))
- (if (and (not (eq (car tmp) 'hline))
- (or (eq hlines t)
- (and (numberp hlines)
- (<= (- (match-end 1) (match-beginning 1))
- hlines))))
- (push 'hline tmp)))
- (push (pop tbl) tmp)))
- (setq tbl (nreverse tmp)))
- (when vlines
- (setq tbl (mapcar (lambda (x)
- (if (eq 'hline x) x (cons "" x)))
- tbl))
- (setq tbl (append tbl (list (cons "/" (make-list nfields "<>"))))))
- (setq pos (point))
- (when content-lines
- (while (string-match "^#" (car content-lines))
- (insert (pop content-lines) "\n")))
- (insert (org-listtable-to-string tbl))
- (when (plist-get params :width)
- (insert "\n|" (mapconcat (lambda (x) (format "<%d>" (max 3 x)))
- org-columns-current-widths "|")))
- (while (setq line (pop content-lines))
- (when (string-match "^#" line)
- (insert "\n" line)
- (when (string-match "^[ \t]*#\\+TBLFM" line)
- (setq recalc t))))
- (if recalc
- (progn (goto-char pos) (org-table-recalculate 'all))
- (goto-char pos)
- (org-table-align)))))
-
-(defun org-listtable-to-string (tbl)
- "Convert a listtable TBL to a string that contains the Org-mode table.
-The table still need to be aligned. The resulting string has no leading
-and tailing newline characters."
- (mapconcat
- (lambda (x)
- (cond
- ((listp x)
- (concat "|" (mapconcat 'identity x "|") "|"))
- ((eq x 'hline) "|-|")
- (t (error "Garbage in listtable: %s" x))))
- tbl "\n"))
-
-(defun org-insert-columns-dblock ()
- "Create a dynamic block capturing a column view table."
- (interactive)
- (let ((defaults '(:name "columnview" :hlines 1))
- (id (org-icompleting-read
- "Capture columns (local, global, entry with :ID: property) [local]: "
- (append '(("global") ("local"))
- (mapcar 'list (org-property-values "ID"))))))
- (if (equal id "") (setq id 'local))
- (if (equal id "global") (setq id 'global))
- (setq defaults (append defaults (list :id id)))
- (org-create-dblock defaults)
- (org-update-dblock)))
-
-;;; Column view in the agenda
-
-(defvar org-agenda-view-columns-initially nil
- "When set, switch to columns view immediately after creating the agenda.")
-
-(defvar org-agenda-columns-show-summaries) ; defined in org-agenda.el
-(defvar org-agenda-columns-compute-summary-properties); defined in org-agenda.el
-(defvar org-agenda-columns-add-appointments-to-effort-sum); as well
-
-(defun org-agenda-columns ()
- "Turn on or update column view in the agenda."
- (interactive)
- (org-verify-version 'columns)
- (org-columns-remove-overlays)
- (move-marker org-columns-begin-marker (point))
- (let ((org-columns-time (time-to-number-of-days (current-time)))
- cache maxwidths m p a d fmt)
- (cond
- ((and (boundp 'org-agenda-overriding-columns-format)
- org-agenda-overriding-columns-format)
- (setq fmt org-agenda-overriding-columns-format)
- (org-set-local 'org-agenda-overriding-columns-format fmt))
- ((setq m (org-get-at-bol 'org-hd-marker))
- (setq fmt (or (org-entry-get m "COLUMNS" t)
- (with-current-buffer (marker-buffer m)
- org-columns-default-format))))
- ((and (boundp 'org-columns-current-fmt)
- (local-variable-p 'org-columns-current-fmt)
- org-columns-current-fmt)
- (setq fmt org-columns-current-fmt))
- ((setq m (next-single-property-change (point-min) 'org-hd-marker))
- (setq m (get-text-property m 'org-hd-marker))
- (setq fmt (or (org-entry-get m "COLUMNS" t)
- (with-current-buffer (marker-buffer m)
- org-columns-default-format)))))
- (setq fmt (or fmt org-columns-default-format))
- (org-set-local 'org-columns-current-fmt fmt)
- (org-columns-compile-format fmt)
- (when org-agenda-columns-compute-summary-properties
- (org-agenda-colview-compute org-columns-current-fmt-compiled))
- (save-excursion
- ;; Get and cache the properties
- (goto-char (point-min))
- (while (not (eobp))
- (when (setq m (or (org-get-at-bol 'org-hd-marker)
- (org-get-at-bol 'org-marker)))
- (setq p (org-entry-properties m))
-
- (when (or (not (setq a (assoc org-effort-property p)))
- (not (string-match "\\S-" (or (cdr a) ""))))
- ;; OK, the property is not defined. Use appointment duration?
- (when (and org-agenda-columns-add-appointments-to-effort-sum
- (setq d (get-text-property (point) 'duration)))
- (setq d (org-minutes-to-hh:mm-string d))
- (put-text-property 0 (length d) 'face 'org-warning d)
- (push (cons org-effort-property d) p)))
- (push (cons (org-current-line) p) cache))
- (beginning-of-line 2))
- (when cache
- (setq maxwidths (org-columns-get-autowidth-alist fmt cache))
- (org-set-local 'org-columns-current-maxwidths maxwidths)
- (org-columns-display-here-title)
- (when (org-set-local 'org-columns-flyspell-was-active
- (org-bound-and-true-p flyspell-mode))
- (flyspell-mode 0))
- (mapc (lambda (x)
- (org-goto-line (car x))
- (org-columns-display-here (cdr x)))
- cache)
- (when org-agenda-columns-show-summaries
- (org-agenda-colview-summarize cache))))))
-
-(defun org-agenda-colview-summarize (cache)
- "Summarize the summarizable columns in column view in the agenda.
-This will add overlays to the date lines, to show the summary for each day."
- (let* ((fmt (mapcar (lambda (x)
- (if (equal (car x) "CLOCKSUM")
- (list "CLOCKSUM" (nth 1 x) (nth 2 x) ":" 'add_times
- nil '+ nil)
- x))
- org-columns-current-fmt-compiled))
- line c c1 stype calc sumfunc props lsum entries prop v title)
- (catch 'exit
- (when (delq nil (mapcar 'cadr fmt))
- ;; OK, at least one summation column, it makes sense to try this
- (goto-char (point-max))
- (while t
- (when (or (get-text-property (point) 'org-date-line)
- (eq (get-text-property (point) 'face)
- 'org-agenda-structure))
- ;; OK, this is a date line that should be used
- (setq line (org-current-line))
- (setq entries nil c cache cache nil)
- (while (setq c1 (pop c))
- (if (> (car c1) line)
- (push c1 entries)
- (push c1 cache)))
- ;; now ENTRIES are the ones we want to use, CACHE is the rest
- ;; Compute the summaries for the properties we want,
- ;; set nil properties for the rest.
- (when (setq entries (mapcar 'cdr entries))
- (setq props
- (mapcar
- (lambda (f)
- (setq prop (car f)
- title (nth 1 f)
- stype (nth 4 f)
- sumfunc (nth 6 f)
- calc (or (nth 7 f) 'identity))
- (cond
- ((equal prop "ITEM")
- (cons prop (buffer-substring (point-at-bol)
- (point-at-eol))))
- ((not stype) (cons prop ""))
- (t ;; do the summary
- (setq lsum nil)
- (dolist (x entries)
- (setq v (cdr (assoc prop x)))
- (if v
- (push
- (funcall
- (if (not (get-text-property 0 'org-computed v))
- calc
- 'identity)
- (org-columns-string-to-number
- v stype))
- lsum)))
- (setq lsum (remove nil lsum))
- (setq lsum
- (cond ((> (length lsum) 1)
- (org-columns-number-to-string
- (apply sumfunc lsum) stype))
- ((eq (length lsum) 1)
- (org-columns-number-to-string
- (car lsum) stype))
- (t "")))
- (put-text-property 0 (length lsum) 'face 'bold lsum)
- (unless (eq calc 'identity)
- (put-text-property 0 (length lsum) 'org-computed t lsum))
- (cons prop lsum))))
- fmt))
- (org-columns-display-here props 'dateline)
- (org-set-local 'org-agenda-columns-active t)))
- (if (bobp) (throw 'exit t))
- (beginning-of-line 0))))))
-
-(defun org-agenda-colview-compute (fmt)
- "Compute the relevant columns in the contributing source buffers."
- (let ((files org-agenda-contributing-files)
- (org-columns-begin-marker (make-marker))
- (org-columns-top-level-marker (make-marker))
- f fm a b)
- (while (setq f (pop files))
- (setq b (find-buffer-visiting f))
- (with-current-buffer (or (buffer-base-buffer b) b)
- (save-excursion
- (save-restriction
- (widen)
- (org-unmodified
- (remove-text-properties (point-min) (point-max)
- '(org-summaries t)))
- (goto-char (point-min))
- (org-columns-get-format-and-top-level)
- (while (setq fm (pop fmt))
- (if (equal (car fm) "CLOCKSUM")
- (org-clock-sum)
- (when (and (nth 4 fm)
- (setq a (assoc (car fm)
- org-columns-current-fmt-compiled))
- (equal (nth 4 a) (nth 4 fm)))
- (org-columns-compute (car fm)))))))))))
-
-(defun org-format-time-period (interval)
- "Convert time in fractional days to days/hours/minutes/seconds."
- (if (numberp interval)
- (let* ((days (floor interval))
- (frac-hours (* 24 (- interval days)))
- (hours (floor frac-hours))
- (minutes (floor (* 60 (- frac-hours hours))))
- (seconds (floor (* 60 (- (* 60 (- frac-hours hours)) minutes)))))
- (format "%dd %02dh %02dm %02ds" days hours minutes seconds))
- ""))
-
-(defun org-estimate-mean-and-var (v)
- "Return the mean and variance of an estimate."
- (let* ((low (float (car v)))
- (high (float (cadr v)))
- (mean (/ (+ low high) 2.0))
- (var (/ (+ (expt (- mean low) 2.0) (expt (- high mean) 2.0)) 2.0)))
- (list mean var)))
-
-(defun org-estimate-combine (&rest el)
- "Combine a list of estimates, using mean and variance.
-The mean and variance of the result will be the sum of the means
-and variances (respectively) of the individual estimates."
- (let ((mean 0)
- (var 0))
- (mapc (lambda (e)
- (let ((stats (org-estimate-mean-and-var e)))
- (setq mean (+ mean (car stats)))
- (setq var (+ var (cadr stats)))))
- el)
- (let ((stdev (sqrt var)))
- (list (- mean stdev) (+ mean stdev)))))
-
-(defun org-estimate-print (e &optional fmt)
- "Prepare a string representation of an estimate.
-This formats these numbers as two numbers with a \"-\" between them."
- (if (null fmt) (set 'fmt "%.0f"))
- (format "%s" (mapconcat (lambda (n) (format fmt n)) e "-")))
-
-(defun org-string-to-estimate (s)
- "Convert a string to an estimate.
-The string should be two numbers joined with a \"-\"."
- (if (string-match "\\(.*\\)-\\(.*\\)" s)
- (list (string-to-number (match-string 1 s))
- (string-to-number(match-string 2 s)))
- (list (string-to-number s) (string-to-number s))))
-
-(provide 'org-colview)
-
-;; arch-tag: 61f5128d-747c-4983-9479-e3871fa3d73c
-
-;;; org-colview.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-colview.elc b/.emacs.d/org-7.4/lisp/org-colview.elc
deleted file mode 100644
index d92c944..0000000
--- a/.emacs.d/org-7.4/lisp/org-colview.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-compat.el b/.emacs.d/org-7.4/lisp/org-compat.el
deleted file mode 100644
index 452a261..0000000
--- a/.emacs.d/org-7.4/lisp/org-compat.el
+++ /dev/null
@@ -1,431 +0,0 @@
-;;; org-compat.el --- Compatibility code for Org-mode
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file contains code needed for compatibility with XEmacs and older
-;; versions of GNU Emacs.
-
-;;; Code:
-
-(eval-when-compile
- (require 'cl))
-
-(require 'org-macs)
-
-(declare-function find-library-name "find-func" (library))
-(declare-function w32-focus-frame "term/w32-win" (frame))
-
-;; The following constant is for backward compatibility. We do not use
-;; it in org-mode, because the Byte compiler evaluates (featurep 'xemacs)
-;; at compilation time and can therefore optimize code better.
-(defconst org-xemacs-p (featurep 'xemacs))
-(defconst org-format-transports-properties-p
- (let ((x "a"))
- (add-text-properties 0 1 '(test t) x)
- (get-text-property 0 'test (format "%s" x)))
- "Does format transport text properties?")
-
-(defun org-compatible-face (inherits specs)
- "Make a compatible face specification.
-If INHERITS is an existing face and if the Emacs version supports it,
-just inherit the face. If INHERITS is set and the Emacs version does
-not support it, copy the face specification from the inheritance face.
-If INHERITS is not given and SPECS is, use SPECS to define the face.
-XEmacs and Emacs 21 do not know about the `min-colors' attribute.
-For them we convert a (min-colors 8) entry to a `tty' entry and move it
-to the top of the list. The `min-colors' attribute will be removed from
-any other entries, and any resulting duplicates will be removed entirely."
- (when (and inherits (facep inherits) (not specs))
- (setq specs (or specs
- (get inherits 'saved-face)
- (get inherits 'face-defface-spec))))
- (cond
- ((and inherits (facep inherits)
- (not (featurep 'xemacs))
- (>= emacs-major-version 22)
- ;; do not inherit outline faces before Emacs 23
- (or (>= emacs-major-version 23)
- (not (string-match "\\`outline-[0-9]+"
- (symbol-name inherits)))))
- (list (list t :inherit inherits)))
- ((or (featurep 'xemacs) (< emacs-major-version 22))
- ;; These do not understand the `min-colors' attribute.
- (let (r e a)
- (while (setq e (pop specs))
- (cond
- ((memq (car e) '(t default)) (push e r))
- ((setq a (member '(min-colors 8) (car e)))
- (nconc r (list (cons (cons '(type tty) (delq (car a) (car e)))
- (cdr e)))))
- ((setq a (assq 'min-colors (car e)))
- (setq e (cons (delq a (car e)) (cdr e)))
- (or (assoc (car e) r) (push e r)))
- (t (or (assoc (car e) r) (push e r)))))
- (nreverse r)))
- (t specs)))
-(put 'org-compatible-face 'lisp-indent-function 1)
-
-(defun org-version-check (version feature level)
- (let* ((v1 (mapcar 'string-to-number (split-string version "[.]")))
- (v2 (mapcar 'string-to-number (split-string emacs-version "[.]")))
- (rmaj (or (nth 0 v1) 99))
- (rmin (or (nth 1 v1) 99))
- (rbld (or (nth 2 v1) 99))
- (maj (or (nth 0 v2) 0))
- (min (or (nth 1 v2) 0))
- (bld (or (nth 2 v2) 0)))
- (if (or (< maj rmaj)
- (and (= maj rmaj)
- (< min rmin))
- (and (= maj rmaj)
- (= min rmin)
- (< bld rbld)))
- (if (eq level :predicate)
- ;; just return if we have the version
- nil
- (let ((msg (format "Emacs %s or greater is recommended for %s"
- version feature)))
- (display-warning 'org msg level)
- t))
- t)))
-
-;;;; Emacs/XEmacs compatibility
-
-;; Keys
-(defconst org-xemacs-key-equivalents
- '(([mouse-1] . [button1])
- ([mouse-2] . [button2])
- ([mouse-3] . [button3])
- ([C-mouse-4] . [(control mouse-4)])
- ([C-mouse-5] . [(control mouse-5)]))
- "Translation alist for a couple of keys.")
-
-;; Overlay compatibility functions
-(defun org-detach-overlay (ovl)
- (if (featurep 'xemacs) (detach-extent ovl) (delete-overlay ovl)))
-(defun org-overlay-display (ovl text &optional face evap)
- "Make overlay OVL display TEXT with face FACE."
- (if (featurep 'xemacs)
- (let ((gl (make-glyph text)))
- (and face (set-glyph-face gl face))
- (set-extent-property ovl 'invisible t)
- (set-extent-property ovl 'end-glyph gl))
- (overlay-put ovl 'display text)
- (if face (overlay-put ovl 'face face))
- (if evap (overlay-put ovl 'evaporate t))))
-(defun org-overlay-before-string (ovl text &optional face evap)
- "Make overlay OVL display TEXT with face FACE."
- (if (featurep 'xemacs)
- (let ((gl (make-glyph text)))
- (and face (set-glyph-face gl face))
- (set-extent-property ovl 'begin-glyph gl))
- (if face (org-add-props text nil 'face face))
- (overlay-put ovl 'before-string text)
- (if evap (overlay-put ovl 'evaporate t))))
-(defun org-find-overlays (prop &optional pos delete)
- "Find all overlays specifying PROP at POS or point.
-If DELETE is non-nil, delete all those overlays."
- (let ((overlays (overlays-at (or pos (point))))
- ov found)
- (while (setq ov (pop overlays))
- (if (overlay-get ov prop)
- (if delete (delete-overlay ov) (push ov found))))
- found))
-
-(defun org-get-x-clipboard (value)
- "Get the value of the x clipboard, compatible with XEmacs, and GNU Emacs 21."
- (if (eq window-system 'x)
- (let ((x (org-get-x-clipboard-compat value)))
- (if x (org-no-properties x)))))
-
-(defsubst org-decompose-region (beg end)
- "Decompose from BEG to END."
- (if (featurep 'xemacs)
- (let ((modified-p (buffer-modified-p))
- (buffer-read-only nil))
- (remove-text-properties beg end '(composition nil))
- (set-buffer-modified-p modified-p))
- (decompose-region beg end)))
-
-;; Miscellaneous functions
-
-(defun org-add-hook (hook function &optional append local)
- "Add-hook, compatible with both Emacsen."
- (if (and local (featurep 'xemacs))
- (add-local-hook hook function append)
- (add-hook hook function append local)))
-
-(defun org-add-props (string plist &rest props)
- "Add text properties to entire string, from beginning to end.
-PLIST may be a list of properties, PROPS are individual properties and values
-that will be added to PLIST. Returns the string that was modified."
- (add-text-properties
- 0 (length string) (if props (append plist props) plist) string)
- string)
-(put 'org-add-props 'lisp-indent-function 2)
-
-(defun org-fit-window-to-buffer (&optional window max-height min-height
- shrink-only)
- "Fit WINDOW to the buffer, but only if it is not a side-by-side window.
-WINDOW defaults to the selected window. MAX-HEIGHT and MIN-HEIGHT are
-passed through to `fit-window-to-buffer'. If SHRINK-ONLY is set, call
-`shrink-window-if-larger-than-buffer' instead, the height limit is
-ignored in this case."
- (cond ((if (fboundp 'window-full-width-p)
- (not (window-full-width-p window))
- (> (frame-width) (window-width window)))
- ;; do nothing if another window would suffer
- )
- ((and (fboundp 'fit-window-to-buffer) (not shrink-only))
- (fit-window-to-buffer window max-height min-height))
- ((fboundp 'shrink-window-if-larger-than-buffer)
- (shrink-window-if-larger-than-buffer window)))
- (or window (selected-window)))
-
-(defun org-number-sequence (from &optional to inc)
- "Call `number-sequence or emulate it."
- (if (fboundp 'number-sequence)
- (number-sequence from to inc)
- (if (or (not to) (= from to))
- (list from)
- (or inc (setq inc 1))
- (when (zerop inc) (error "The increment can not be zero"))
- (let (seq (n 0) (next from))
- (if (> inc 0)
- (while (<= next to)
- (setq seq (cons next seq)
- n (1+ n)
- next (+ from (* n inc))))
- (while (>= next to)
- (setq seq (cons next seq)
- n (1+ n)
- next (+ from (* n inc)))))
- (nreverse seq)))))
-
-;; Region compatibility
-
-(defvar org-ignore-region nil
- "To temporarily disable the active region.")
-
-(defun org-region-active-p ()
- "Is `transient-mark-mode' on and the region active?
-Works on both Emacs and XEmacs."
- (if org-ignore-region
- nil
- (if (featurep 'xemacs)
- (and zmacs-regions (region-active-p))
- (if (fboundp 'use-region-p)
- (use-region-p)
- (and transient-mark-mode mark-active))))) ; Emacs 22 and before
-
-(defun org-cursor-to-region-beginning ()
- (when (and (org-region-active-p)
- (> (point) (region-beginning)))
- (exchange-point-and-mark)))
-
-;; Invisibility compatibility
-
-(defun org-remove-from-invisibility-spec (arg)
- "Remove elements from `buffer-invisibility-spec'."
- (if (fboundp 'remove-from-invisibility-spec)
- (remove-from-invisibility-spec arg)
- (if (consp buffer-invisibility-spec)
- (setq buffer-invisibility-spec
- (delete arg buffer-invisibility-spec)))))
-
-(defun org-in-invisibility-spec-p (arg)
- "Is ARG a member of `buffer-invisibility-spec'?"
- (if (consp buffer-invisibility-spec)
- (member arg buffer-invisibility-spec)
- nil))
-
-(defmacro org-xemacs-without-invisibility (&rest body)
- "Turn off exents with invisibility while executing BODY."
- `(let ((ext-inv (extent-list nil (point-at-bol) (point-at-eol)
- 'all-extents-closed-open 'invisible))
- ext-inv-specs)
- (dolist (ext ext-inv)
- (when (extent-property ext 'invisible)
- (add-to-list 'ext-inv-specs (list ext (extent-property
- ext 'invisible)))
- (set-extent-property ext 'invisible nil)))
- ,@body
- (dolist (ext-inv-spec ext-inv-specs)
- (set-extent-property (car ext-inv-spec) 'invisible
- (cadr ext-inv-spec)))))
-
-(defun org-indent-to-column (column &optional minimum buffer)
- "Work around a bug with extents with invisibility in XEmacs."
- (if (featurep 'xemacs)
- (org-xemacs-without-invisibility (indent-to-column column minimum buffer))
- (indent-to-column column minimum)))
-
-(defun org-indent-line-to (column)
- "Work around a bug with extents with invisibility in XEmacs."
- (if (featurep 'xemacs)
- (org-xemacs-without-invisibility (indent-line-to column))
- (indent-line-to column)))
-
-(defun org-move-to-column (column &optional force buffer)
- (if (featurep 'xemacs)
- (org-xemacs-without-invisibility (move-to-column column force buffer))
- (move-to-column column force)))
-
-(defun org-get-x-clipboard-compat (value)
- "Get the clipboard value on XEmacs or Emacs 21."
- (cond ((featurep 'xemacs)
- (org-no-warnings (get-selection-no-error value)))
- ((fboundp 'x-get-selection)
- (condition-case nil
- (or (x-get-selection value 'UTF8_STRING)
- (x-get-selection value 'COMPOUND_TEXT)
- (x-get-selection value 'STRING)
- (x-get-selection value 'TEXT))
- (error nil)))))
-
-(defun org-propertize (string &rest properties)
- (if (featurep 'xemacs)
- (progn
- (add-text-properties 0 (length string) properties string)
- string)
- (apply 'propertize string properties)))
-
-(defun org-substring-no-properties (string &optional from to)
- (if (featurep 'xemacs)
- (org-no-properties (substring string (or from 0) to))
- (substring-no-properties string from to)))
-
-(defun org-find-library-name (library)
- (if (fboundp 'find-library-name)
- (file-name-directory (find-library-name library))
- ; XEmacs does not have `find-library-name'
- (flet ((find-library-name-helper (filename ignored-codesys)
- filename)
- (find-library-name (library)
- (find-library library nil 'find-library-name-helper)))
- (file-name-directory (find-library-name library)))))
-
-(defun org-count-lines (s)
- "How many lines in string S?"
- (let ((start 0) (n 1))
- (while (string-match "\n" s start)
- (setq start (match-end 0) n (1+ n)))
- (if (and (> (length s) 0) (= (aref s (1- (length s))) ?\n))
- (setq n (1- n)))
- n))
-
-(defun org-kill-new (string &rest args)
- (remove-text-properties 0 (length string) '(line-prefix t wrap-prefix t)
- string)
- (apply 'kill-new string args))
-
-(defun org-select-frame-set-input-focus (frame)
- "Select FRAME, raise it, and set input focus, if possible."
- (cond ((featurep 'xemacs)
- (if (fboundp 'select-frame-set-input-focus)
- (select-frame-set-input-focus frame)
- (raise-frame frame)
- (select-frame frame)
- (focus-frame frame)))
- ;; `select-frame-set-input-focus' defined in Emacs 21 will not
- ;; set the input focus.
- ((>= emacs-major-version 22)
- (select-frame-set-input-focus frame))
- (t
- (raise-frame frame)
- (select-frame frame)
- (cond ((memq window-system '(x ns mac))
- (x-focus-frame frame))
- ((eq window-system 'w32)
- (w32-focus-frame frame)))
- (when focus-follows-mouse
- (set-mouse-position frame (1- (frame-width frame)) 0)))))
-
-(defun org-float-time (&optional time)
- "Convert time value TIME to a floating point number.
-TIME defaults to the current time."
- (if (featurep 'xemacs)
- (time-to-seconds (or time (current-time)))
- (float-time time)))
-
-(if (fboundp 'string-match-p)
- (defalias 'org-string-match-p 'string-match-p)
- (defun org-string-match-p (regexp string &optional start)
- (save-match-data
- (funcall 'string-match regexp string start))))
-
-(if (fboundp 'looking-at-p)
- (defalias 'org-looking-at-p 'looking-at-p)
- (defun org-looking-at-p (&rest args)
- (save-match-data
- (apply 'looking-at args))))
-
-; XEmacs does not have `looking-back'.
-(if (fboundp 'looking-back)
- (defalias 'org-looking-back 'looking-back)
- (defun org-looking-back (regexp &optional limit greedy)
- "Return non-nil if text before point matches regular expression REGEXP.
-Like `looking-at' except matches before point, and is slower.
-LIMIT if non-nil speeds up the search by specifying a minimum
-starting position, to avoid checking matches that would start
-before LIMIT.
-
-If GREEDY is non-nil, extend the match backwards as far as
-possible, stopping when a single additional previous character
-cannot be part of a match for REGEXP. When the match is
-extended, its starting position is allowed to occur before
-LIMIT."
- (let ((start (point))
- (pos
- (save-excursion
- (and (re-search-backward (concat "\\(?:" regexp "\\)\\=") limit t)
- (point)))))
- (if (and greedy pos)
- (save-restriction
- (narrow-to-region (point-min) start)
- (while (and (> pos (point-min))
- (save-excursion
- (goto-char pos)
- (backward-char 1)
- (looking-at (concat "\\(?:" regexp "\\)\\'"))))
- (setq pos (1- pos)))
- (save-excursion
- (goto-char pos)
- (looking-at (concat "\\(?:" regexp "\\)\\'")))))
- (not (null pos)))))
-
-(defun org-floor* (x &optional y)
- "Return a list of the floor of X and the fractional part of X.
-With two arguments, return floor and remainder of their quotient."
- (let ((q (floor x y)))
- (list q (- x (if y (* y q) q)))))
-
-(provide 'org-compat)
-
-;; arch-tag: a0a0579f-e68c-4bdf-9e55-93768b846bbe
-
-;;; org-compat.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-compat.elc b/.emacs.d/org-7.4/lisp/org-compat.elc
deleted file mode 100644
index 18bd678..0000000
--- a/.emacs.d/org-7.4/lisp/org-compat.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-complete.el b/.emacs.d/org-7.4/lisp/org-complete.el
deleted file mode 100644
index 2eb1f4c..0000000
--- a/.emacs.d/org-7.4/lisp/org-complete.el
+++ /dev/null
@@ -1,279 +0,0 @@
-;;; org-complete.el --- In-buffer completion code
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-;;
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; John Wiegley <johnw at gnu dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Code:
-
-;;;; Require other packages
-
-(eval-when-compile
- (require 'cl))
-
-(require 'org-macs)
-(require 'pcomplete)
-
-(declare-function org-split-string "org" (string &optional separators))
-(declare-function org-get-current-options "org-exp" ())
-(declare-function org-make-org-heading-search-string "org"
- (&optional string heading))
-(declare-function org-get-buffer-tags "org" ())
-(declare-function org-get-tags "org" ())
-(declare-function org-buffer-property-keys "org"
- (&optional include-specials include-defaults include-columns))
-(declare-function org-entry-properties "org" (&optional pom which specific))
-
-;;;; Customization variables
-
-(defgroup org-complete nil
- "Outline-based notes management and organizer."
- :tag "Org"
- :group 'org)
-
-(defun org-thing-at-point ()
- "Examine the thing at point and let the caller know what it is.
-The return value is a string naming the thing at point."
- (let ((beg1 (save-excursion
- (skip-chars-backward (org-re "[:alnum:]_@"))
- (point)))
- (beg (save-excursion
- (skip-chars-backward "a-zA-Z0-9_:$")
- (point)))
- (line-to-here (buffer-substring (point-at-bol) (point))))
- (cond
- ((string-match "\\`[ \t]*#\\+begin: clocktable[ \t]+" line-to-here)
- (cons "block-option" "clocktable"))
- ((string-match "\\`[ \t]*#\\+begin_src[ \t]+" line-to-here)
- (cons "block-option" "src"))
- ((save-excursion
- (re-search-backward "^[ \t]*#\\+\\([A-Z_]+\\):.*"
- (line-beginning-position) t))
- (cons "file-option" (match-string-no-properties 1)))
- ((string-match "\\`[ \t]*#\\+[a-zA-Z]*\\'" line-to-here)
- (cons "file-option" nil))
- ((equal (char-before beg) ?\[)
- (cons "link" nil))
- ((equal (char-before beg) ?\\)
- (cons "tex" nil))
- ((string-match "\\`\\*+[ \t]+\\'"
- (buffer-substring (point-at-bol) beg))
- (cons "todo" nil))
- ((equal (char-before beg) ?*)
- (cons "searchhead" nil))
- ((and (equal (char-before beg1) ?:)
- (equal (char-after (point-at-bol)) ?*))
- (cons "tag" nil))
- ((and (equal (char-before beg1) ?:)
- (not (equal (char-after (point-at-bol)) ?*)))
- (cons "prop" nil))
- (t nil))))
-
-(defun org-command-at-point ()
- "Return the qualified name of the Org completion entity at point.
-When completing for #+STARTUP, for example, this function returns
-\"file-option/startup\"."
- (let ((thing (org-thing-at-point)))
- (cond
- ((string= "file-option" (car thing))
- (concat (car thing) "/" (downcase (cdr thing))))
- ((string= "block-option" (car thing))
- (concat (car thing) "/" (downcase (cdr thing))))
- (t
- (car thing)))))
-
-(defun org-parse-arguments ()
- "Parse whitespace separated arguments in the current region."
- (let ((begin (line-beginning-position))
- (end (line-end-position))
- begins args)
- (save-restriction
- (narrow-to-region begin end)
- (save-excursion
- (goto-char (point-min))
- (while (not (eobp))
- (skip-chars-forward " \t\n[")
- (setq begins (cons (point) begins))
- (skip-chars-forward "^ \t\n[")
- (setq args (cons (buffer-substring-no-properties
- (car begins) (point))
- args)))
- (cons (reverse args) (reverse begins))))))
-
-
-(defun org-complete-initial ()
- "Calls the right completion function for first argument completions."
- (ignore
- (funcall (or (pcomplete-find-completion-function
- (car (org-thing-at-point)))
- pcomplete-default-completion-function))))
-
-(defvar org-additional-option-like-keywords)
-(defun pcomplete/org-mode/file-option ()
- "Complete against all valid file options."
- (require 'org-exp)
- (pcomplete-here
- (org-complete-case-double
- (mapcar (lambda (x)
- (if (= ?: (aref x (1- (length x))))
- (concat x " ")
- x))
- (delq nil
- (pcomplete-uniqify-list
- (append
- (mapcar (lambda (x)
- (if (string-match "^#\\+\\([A-Z_]+:?\\)" x)
- (match-string 1 x)))
- (org-split-string (org-get-current-options) "\n"))
- org-additional-option-like-keywords)))))
- (substring pcomplete-stub 2)))
-
-(defvar org-startup-options)
-(defun pcomplete/org-mode/file-option/startup ()
- "Complete arguments for the #+STARTUP file option."
- (while (pcomplete-here
- (let ((opts (pcomplete-uniqify-list
- (mapcar 'car org-startup-options))))
- ;; Some options are mutually exclusive, and shouldn't be completed
- ;; against if certain other options have already been seen.
- (dolist (arg pcomplete-args)
- (cond
- ((string= arg "hidestars")
- (setq opts (delete "showstars" opts)))))
- opts))))
-
-(defun pcomplete/org-mode/file-option/bind ()
- "Complete arguments for the #+BIND file option, which are variable names"
- (let (vars)
- (mapatoms
- (lambda (a) (if (boundp a) (setq vars (cons (symbol-name a) vars)))))
- (pcomplete-here vars)))
-
-(defvar org-link-abbrev-alist-local)
-(defvar org-link-abbrev-alist)
-(defun pcomplete/org-mode/link ()
- "Complete against defined #+LINK patterns."
- (pcomplete-here
- (pcomplete-uniqify-list (append (mapcar 'car org-link-abbrev-alist-local)
- (mapcar 'car org-link-abbrev-alist)))))
-
-(defvar org-entities)
-(defun pcomplete/org-mode/tex ()
- "Complete against TeX-style HTML entity names."
- (require 'org-entities)
- (while (pcomplete-here
- (pcomplete-uniqify-list (remove nil (mapcar 'car-safe org-entities)))
- (substring pcomplete-stub 1))))
-
-(defvar org-todo-keywords-1)
-(defun pcomplete/org-mode/todo ()
- "Complete against known TODO keywords."
- (pcomplete-here (pcomplete-uniqify-list org-todo-keywords-1)))
-
-(defvar org-todo-line-regexp)
-(defun pcomplete/org-mode/searchhead ()
- "Complete against all headings.
-This needs more work, to handle headings with lots of spaces in them."
- (while
- (pcomplete-here
- (save-excursion
- (goto-char (point-min))
- (let (tbl)
- (while (re-search-forward org-todo-line-regexp nil t)
- (push (org-make-org-heading-search-string
- (match-string-no-properties 3) t)
- tbl))
- (pcomplete-uniqify-list tbl)))
- (substring pcomplete-stub 1))))
-
-(defvar org-tag-alist)
-(defun pcomplete/org-mode/tag ()
- "Complete a tag name. Omit tags already set."
- (while (pcomplete-here
- (mapcar (lambda (x)
- (concat x ":"))
- (let ((lst (pcomplete-uniqify-list
- (or (remove
- nil
- (mapcar (lambda (x)
- (and (stringp (car x)) (car x)))
- org-tag-alist))
- (mapcar 'car (org-get-buffer-tags))))))
- (dolist (tag (org-get-tags))
- (setq lst (delete tag lst)))
- lst))
- (and (string-match ".*:" pcomplete-stub)
- (substring pcomplete-stub (match-end 0))))))
-
-(defun pcomplete/org-mode/prop ()
- "Complete a property name. Omit properties already set."
- (pcomplete-here
- (mapcar (lambda (x)
- (concat x ": "))
- (let ((lst (pcomplete-uniqify-list
- (org-buffer-property-keys nil t t))))
- (dolist (prop (org-entry-properties))
- (setq lst (delete (car prop) lst)))
- lst))
- (substring pcomplete-stub 1)))
-
-(defun pcomplete/org-mode/block-option/src ()
- "Complete the arguments of a begin_src block.
-Complete a language in the first field, the header arguments and switches."
- (pcomplete-here
- (mapcar
- (lambda(x) (symbol-name (nth 3 x)))
- (cdr (car (cdr (memq :key-type (plist-get
- (symbol-plist
- 'org-babel-load-languages)
- 'custom-type)))))))
- (while (pcomplete-here
- '("-n" "-r" "-l"
- ":cache" ":colnames" ":comments" ":dir" ":eval" ":exports"
- ":file" ":hlines" ":no-expand" ":noweb" ":results" ":rownames"
- ":session" ":shebang" ":tangle" ":var"))))
-
-(defun pcomplete/org-mode/block-option/clocktable ()
- "Complete keywords in a clocktable line"
- (while (pcomplete-here '(":maxlevel" ":scope"
- ":tstart" ":tend" ":block" ":step"
- ":stepskip0" ":fileskip0"
- ":emphasize" ":link" ":narrow" ":indent"
- ":tcolumns" ":level" ":compact" ":timestamp"
- ":formula" ":formatter"))))
-
-(defun org-complete-case-double (list)
- "Return list with both upcase and downcase version of all strings in LIST."
- (let (e res)
- (while (setq e (pop list))
- (setq res (cons (downcase e) (cons (upcase e) res))))
- (nreverse res)))
-
-;;;; Finish up
-
-(provide 'org-complete)
-
-;; arch-tag:
-
-;;; org-complete.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-complete.elc b/.emacs.d/org-7.4/lisp/org-complete.elc
deleted file mode 100644
index 10df9cb..0000000
--- a/.emacs.d/org-7.4/lisp/org-complete.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-crypt.el b/.emacs.d/org-7.4/lisp/org-crypt.el
deleted file mode 100644
index 1d76104..0000000
--- a/.emacs.d/org-7.4/lisp/org-crypt.el
+++ /dev/null
@@ -1,187 +0,0 @@
-;;; org-crypt.el --- Public key encryption for org-mode entries
-
-;; Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
-
-;; Emacs Lisp Archive Entry
-;; Filename: org-crypt.el
-;; Version: 7.4
-;; Keywords: org-mode
-;; Author: John Wiegley <johnw@gnu.org>
-;; Maintainer: Peter Jones <pjones@pmade.com>
-;; Description: Adds public key encryption to org-mode buffers
-;; URL: http://www.newartisans.com/software/emacs.html
-;; Compatibility: Emacs22
-
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Right now this is just a set of functions to play with. It depends
-;; on the epg library. Here's how you would use it:
-;;
-;; 1. To mark an entry for encryption, tag the heading with "crypt".
-;; You can change the tag to any complex tag matching string by
-;; setting the `org-crypt-tag-matcher' variable.
-;;
-;; 2. Set the encryption key to use in the `org-crypt-key' variable,
-;; or use `M-x org-set-property' to set the property CRYPTKEY to
-;; any address in your public keyring. The text of the entry (but
-;; not its properties or headline) will be encrypted for this user.
-;; For them to read it, the corresponding secret key must be
-;; located in the secret key ring of the account where you try to
-;; decrypt it. This makes it possible to leave secure notes that
-;; only the intended recipient can read in a shared-org-mode-files
-;; scenario.
-;; If the key is not set, org-crypt will default to symmetric encryption.
-;;
-;; 3. To later decrypt an entry, use `org-decrypt-entries' or
-;; `org-decrypt-entry'. It might be useful to bind this to a key,
-;; like C-c C-/. I hope that in the future, C-c C-r can be might
-;; overloaded to also decrypt an entry if it's encrypted, since
-;; that fits nicely with the meaning of "reveal".
-;;
-;; 4. To automatically encrypt all necessary entries when saving a
-;; file, call `org-crypt-use-before-save-magic' after loading
-;; org-crypt.el.
-;;
-;; TODO:
-;; - Allow symmetric encryption as well
-
-;;; Thanks:
-
-;; - Carsten Dominik
-;; - Vitaly Ostanin
-
-(require 'org)
-
-;;; Code:
-
-(declare-function epg-decrypt-string "epg" (context cipher))
-(declare-function epg-list-keys "epg" (context &optional name mode))
-(declare-function epg-make-context "epg"
- (&optional protocol armor textmode include-certs
- cipher-algorithm digest-algorithm
- compress-algorithm))
-(declare-function epg-encrypt-string "epg"
- (context plain recipients &optional sign always-trust))
-
-(defgroup org-crypt nil
- "Org Crypt"
- :tag "Org Crypt" :group 'org)
-
-(defcustom org-crypt-tag-matcher "crypt"
- "The tag matcher used to find headings whose contents should be encrypted.
-
-See the \"Match syntax\" section of the org manual for more details."
- :type 'string :group 'org-crypt)
-
-(defcustom org-crypt-key nil
- "The default key to use when encrypting the contents of a heading.
-
-This setting can also be overridden in the CRYPTKEY property."
- :type 'string :group 'org-crypt)
-
-(defun org-crypt-key-for-heading ()
- "Return the encryption key for the current heading."
- (save-excursion
- (org-back-to-heading t)
- (or (org-entry-get nil "CRYPTKEY" 'selective)
- org-crypt-key
- (and (boundp 'epa-file-encrypt-to) epa-file-encrypt-to)
- (message "No crypt key set, using symmetric encryption."))))
-
-(defun org-encrypt-entry ()
- "Encrypt the content of the current headline."
- (interactive)
- (require 'epg)
- (save-excursion
- (org-back-to-heading t)
- (let ((start-heading (point)))
- (forward-line)
- (when (not (looking-at "-----BEGIN PGP MESSAGE-----"))
- (let ((folded (org-invisible-p))
- (epg-context (epg-make-context nil t t))
- (crypt-key (org-crypt-key-for-heading))
- (beg (point))
- end encrypted-text)
- (goto-char start-heading)
- (org-end-of-subtree t t)
- (org-back-over-empty-lines)
- (setq end (point)
- encrypted-text
- (epg-encrypt-string
- epg-context
- (buffer-substring-no-properties beg end)
- (epg-list-keys epg-context crypt-key)))
- (delete-region beg end)
- (insert encrypted-text)
- (when folded
- (goto-char start-heading)
- (hide-subtree))
- nil)))))
-
-(defun org-decrypt-entry ()
- "Decrypt the content of the current headline."
- (interactive)
- (require 'epg)
- (unless (org-before-first-heading-p)
- (save-excursion
- (org-back-to-heading t)
- (forward-line)
- (when (looking-at "-----BEGIN PGP MESSAGE-----")
- (let* ((beg (point))
- (end (save-excursion
- (search-forward "-----END PGP MESSAGE-----")
- (forward-line)
- (point)))
- (epg-context (epg-make-context nil t t))
- (decrypted-text
- (decode-coding-string
- (epg-decrypt-string
- epg-context
- (buffer-substring-no-properties beg end))
- 'utf-8)))
- (delete-region beg end)
- (insert decrypted-text)
- nil)))))
-
-(defun org-encrypt-entries ()
- "Encrypt all top-level entries in the current buffer."
- (interactive)
- (org-scan-tags
- 'org-encrypt-entry
- (cdr (org-make-tags-matcher org-crypt-tag-matcher))))
-
-(defun org-decrypt-entries ()
- "Decrypt all entries in the current buffer."
- (interactive)
- (org-scan-tags
- 'org-decrypt-entry
- (cdr (org-make-tags-matcher org-crypt-tag-matcher))))
-
-(defun org-crypt-use-before-save-magic ()
- "Add a hook to automatically encrypt entries before a file is saved to disk."
- (add-hook
- 'org-mode-hook
- (lambda () (add-hook 'before-save-hook 'org-encrypt-entries nil t))))
-
-(add-hook 'org-reveal-start-hook 'org-decrypt-entry)
-
-(provide 'org-crypt)
-
-;; arch-tag: 8202ed2c-221e-4001-9e4b-54674a7e846e
-
-;;; org-crypt.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-crypt.elc b/.emacs.d/org-7.4/lisp/org-crypt.elc
deleted file mode 100644
index 049ba01..0000000
--- a/.emacs.d/org-7.4/lisp/org-crypt.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-ctags.el b/.emacs.d/org-7.4/lisp/org-ctags.el
deleted file mode 100644
index f2c631a..0000000
--- a/.emacs.d/org-7.4/lisp/org-ctags.el
+++ /dev/null
@@ -1,541 +0,0 @@
-;;; org-ctags.el - Integrate Emacs "tags" facility with org mode.
-;;
-;; Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Paul Sexton <eeeickythump@gmail.com>
-;; Version: 7.4
-
-;; Keywords: org, wp
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;
-;; Synopsis
-;; ========
-;;
-;; Allows org-mode to make use of the Emacs `etags' system. Defines tag
-;; destinations in org-mode files as any text between <<double angled
-;; brackets>>. This allows the tags-generation program `exuberant ctags' to
-;; parse these files and create tag tables that record where these
-;; destinations are found. Plain [[links]] in org mode files which do not have
-;; <<matching destinations>> within the same file will then be interpreted as
-;; links to these 'tagged' destinations, allowing seamless navigation between
-;; multiple org-mode files. Topics can be created in any org mode file and
-;; will always be found by plain links from other files. Other file types
-;; recognised by ctags (source code files, latex files, etc) will also be
-;; available as destinations for plain links, and similarly, org-mode links
-;; will be available as tags from source files. Finally, the function
-;; `org-ctags-find-tag-interactive' lets you choose any known tag, using
-;; autocompletion, and quickly jump to it.
-;;
-;; Installation
-;; ============
-;;
-;; Install org mode
-;; Ensure org-ctags.el is somewhere in your emacs load path.
-;; Download and install Exuberant ctags -- "http://ctags.sourceforge.net/"
-;; Edit your .emacs file (see next section) and load emacs.
-
-;; To put in your init file (.emacs):
-;; ==================================
-;;
-;; Assuming you already have org mode installed and set up:
-;;
-;; (setq org-ctags-path-to-ctags "/path/to/ctags/executable")
-;; (add-hook 'org-mode-hook
-;; (lambda ()
-;; (define-key org-mode-map "\C-co" 'org-ctags-find-tag-interactive)))
-;;
-;; By default, with org-ctags loaded, org will first try and visit the tag
-;; with the same name as the link; then, if unsuccessful, ask the user if
-;; he/she wants to rebuild the 'TAGS' database and try again; then ask if
-;; the user wishes to append 'tag' as a new toplevel heading at the end of
-;; the buffer; and finally, defer to org's default behaviour which is to
-;; search the entire text of the current buffer for 'tag'.
-;;
-;; This behaviour can be modified by changing the value of
-;; ORG-CTAGS-OPEN-LINK-FUNCTIONS. For example I have the following in my
-;; .emacs, which describes the same behaviour as the above paragraph with
-;; one difference:
-;;
-;; (setq org-ctags-open-link-functions
-;; '(org-ctags-find-tag
-;; org-ctags-ask-rebuild-tags-file-then-find-tag
-;; org-ctags-ask-append-topic
-;; org-ctags-fail-silently)) ; <-- prevents org default behaviour
-;;
-;;
-;; Usage
-;; =====
-;;
-;; When you click on a link "[[foo]]" and org cannot find a matching "<<foo>>"
-;; in the current buffer, the tags facility will take over. The file TAGS in
-;; the active directory is examined to see if the tags facility knows about
-;; "<<foo>>" in any other files. If it does, the matching file will be opened
-;; and the cursor will jump to the position of "<<foo>>" in that file.
-;;
-;; User-visible functions:
-;; - `org-ctags-find-tag-interactive': type a tag (plain link) name and visit
-;; it. With autocompletion. Bound to ctrl-O in the above setup.
-;; - All the etags functions should work. These include:
-;;
-;; M-. `find-tag' -- finds the tag at point
-;;
-;; C-M-. find-tag based on regular expression
-;;
-;; M-x tags-search RET -- like C-M-. but searches through ENTIRE TEXT
-;; of ALL the files referenced in the TAGS file. A quick way to
-;; search through an entire 'project'.
-;;
-;; M-* "go back" from a tag jump. Like `org-mark-ring-goto'.
-;; You may need to bind this key yourself with (eg)
-;; (global-set-key (kbd "<M-kp-multiply>") 'pop-tag-mark)
-;;
-;; (see etags chapter in Emacs manual for more)
-;;
-;;
-;; Keeping the TAGS file up to date
-;; ================================
-;;
-;; Tags mode has no way of knowing that you have created new tags by typing in
-;; your org-mode buffer. New tags make it into the TAGS file in 3 ways:
-;;
-;; 1. You re-run (org-ctags-create-tags "directory") to rebuild the file.
-;; 2. You put the function `org-ctags-ask-rebuild-tags-file-then-find-tag' in
-;; your `org-open-link-functions' list, as is done in the setup
-;; above. This will cause the TAGS file to be rebuilt whenever a link
-;; cannot be found. This may be slow with large file collections however.
-;; 3. You run the following from the command line (all 1 line):
-;;
-;; ctags --langdef=orgmode --langmap=orgmode:.org
-;; --regex-orgmode="/<<([^>]+)>>/\1/d,definition/"
-;; -f /your/path/TAGS -e -R /your/path/*.org
-;;
-;; If you are paranoid, you might want to run (org-ctags-create-tags
-;; "/path/to/org/files") at startup, by including the following toplevel form
-;; in .emacs. However this can cause a pause of several seconds if ctags has
-;; to scan lots of files.
-;;
-;; (progn
-;; (message "-- rebuilding tags tables...")
-;; (mapc 'org-create-tags tags-table-list))
-
-;;; Code:
-
-(eval-when-compile (require 'cl))
-
-(require 'org)
-
-(defgroup org-ctags nil
- "Options concerning use of ctags within org mode."
- :tag "Org-Ctags"
- :group 'org-link)
-
-(defvar org-ctags-enabled-p t
- "Activate ctags support in org mode?")
-
-(defvar org-ctags-tag-regexp "/<<([^>]+)>>/\\1/d,definition/"
- "Regexp expression used by ctags external program.
-The regexp matches tag destinations in org-mode files.
-Format is: /REGEXP/TAGNAME/FLAGS,TAGTYPE/
-See the ctags documentation for more information.")
-
-(defcustom org-ctags-path-to-ctags
- (case system-type
- (windows-nt "ctags.exe")
- (darwin "ctags-exuberant")
- (t "ctags-exuberant"))
- "Full path to the ctags executable file."
- :group 'org-ctags
- :type 'file)
-
-(defcustom org-ctags-open-link-functions
- '(org-ctags-find-tag
- org-ctags-ask-rebuild-tags-file-then-find-tag
- org-ctags-ask-append-topic)
- "List of functions to be prepended to ORG-OPEN-LINK-FUNCTIONS when ORG-CTAGS is active."
- :group 'org-ctags
- :type 'hook
- :options '(org-ctags-find-tag
- org-ctags-ask-rebuild-tags-file-then-find-tag
- org-ctags-rebuild-tags-file-then-find-tag
- org-ctags-ask-append-topic
- org-ctags-append-topic
- org-ctags-ask-visit-buffer-or-file
- org-ctags-visit-buffer-or-file
- org-ctags-fail-silently))
-
-
-(defvar org-ctags-tag-list nil
- "List of all tags in the active TAGS file.
-Created as a local variable in each buffer.")
-
-(defcustom org-ctags-new-topic-template
- "* <<%t>>\n\n\n\n\n\n"
- "Text to insert when creating a new org file via opening a hyperlink.
-The following patterns are replaced in the string:
- `%t' - replaced with the capitalized title of the hyperlink"
- :group 'org-ctags
- :type 'string)
-
-
-(add-hook 'org-mode-hook
- (lambda ()
- (when (and org-ctags-enabled-p
- (buffer-file-name))
- ;; Make sure this file's directory is added to default
- ;; directories in which to search for tags.
- (let ((tags-filename
- (expand-file-name
- (concat (file-name-directory (buffer-file-name))
- "/TAGS"))))
- (when (file-exists-p tags-filename)
- (visit-tags-table tags-filename))))))
-
-
-(defadvice visit-tags-table (after org-ctags-load-tag-list activate compile)
- (when (and org-ctags-enabled-p tags-file-name)
- (set (make-local-variable 'org-ctags-tag-list)
- (org-ctags-all-tags-in-current-tags-table))))
-
-
-(defun org-ctags-enable ()
- (put 'org-mode 'find-tag-default-function 'org-ctags-find-tag-at-point)
- (setq org-ctags-enabled-p t)
- (dolist (fn org-ctags-open-link-functions)
- (add-hook 'org-open-link-functions fn t)))
-
-
-;;; General utility functions. ===============================================
-;; These work outside org-ctags mode.
-
-(defun org-ctags-get-filename-for-tag (tag)
- "TAG is a string. Search the active TAGS file for a matching tag.
-If the tag is found, return a list containing the filename, line number, and
-buffer position where the tag is found."
- (interactive "sTag: ")
- (unless tags-file-name
- (call-interactively (visit-tags-table)))
- (save-excursion
- (visit-tags-table-buffer 'same)
- (when tags-file-name
- (with-current-buffer (get-file-buffer tags-file-name)
- (goto-char (point-min))
- (cond
- ((re-search-forward (format "^.*%s\\([0-9]+\\),\\([0-9]+\\)$"
- (regexp-quote tag)) nil t)
- (let ((line (string-to-number (match-string 1)))
- (pos (string-to-number (match-string 2))))
- (cond
- ((re-search-backward " \n\\(.*\\),[0-9]+\n")
- (list (match-string 1) line pos))
- (t ; can't find a file name preceding the matched
- ; tag??
- (error "Malformed TAGS file: %s" (buffer-name))))))
- (t ; tag not found
- nil))))))
-
-
-(defun org-ctags-all-tags-in-current-tags-table ()
- "Read all tags defined in the active TAGS file, into a list of strings.
-Return the list."
- (interactive)
- (let ((taglist nil))
- (unless tags-file-name
- (call-interactively (visit-tags-table)))
- (save-excursion
- (visit-tags-table-buffer 'same)
- (with-current-buffer (get-file-buffer tags-file-name)
- (goto-char (point-min))
- (while (re-search-forward "^.*\\(.*\\)\\([0-9]+\\),\\([0-9]+\\)$"
- nil t)
- (push (substring-no-properties (match-string 1)) taglist)))
- taglist)))
-
-
-(defun org-ctags-string-search-and-replace (search replace string)
- "Replace all instances of SEARCH with REPLACE in STRING."
- (replace-regexp-in-string (regexp-quote search) replace string t t))
-
-
-(defun y-or-n-minibuffer (prompt)
- (let ((use-dialog-box nil))
- (y-or-n-p prompt)))
-
-
-;;; Internal functions =======================================================
-
-
-(defun org-ctags-open-file (name &optional title)
- "Visit or create a file called `NAME.org', and insert a new topic.
-The new topic will be titled NAME (or TITLE if supplied)."
- (interactive "sFile name: ")
- (let ((filename (substitute-in-file-name (expand-file-name name))))
- (condition-case v
- (progn
- (org-open-file name t)
- (message "Opened file OK")
- (goto-char (point-max))
- (insert (org-ctags-string-search-and-replace
- "%t" (capitalize (or title name))
- org-ctags-new-topic-template))
- (message "Inserted new file text OK")
- (org-mode-restart))
- (error (error "Error %S in org-ctags-open-file" v)))))
-
-
-;;;; Misc interoperability with etags system =================================
-
-
-(defadvice find-tag (before org-ctags-set-org-mark-before-finding-tag
- activate compile)
- "Before trying to find a tag, save our current position on org mark ring."
- (save-excursion
- (if (and (org-mode-p) org-ctags-enabled-p)
- (org-mark-ring-push))))
-
-
-
-(defun org-ctags-find-tag-at-point ()
- "Determine default tag to search for, based on text at point.
-If there is no plausible default, return nil."
- (let (from to bound)
- (when (or (ignore-errors
- ;; Look for hyperlink around `point'.
- (save-excursion
- (search-backward "[[") (setq from (+ 2 (point))))
- (save-excursion
- (goto-char from)
- (search-forward "]") (setq to (- (point) 1)))
- (and (> to from) (>= (point) from) (<= (point) to)))
- (progn
- ;; Look at text around `point'.
- (save-excursion
- (skip-syntax-backward "w_") (setq from (point)))
- (save-excursion
- (skip-syntax-forward "w_") (setq to (point)))
- (> to from))
- ;; Look between `line-beginning-position' and `point'.
- (save-excursion
- (and (setq bound (line-beginning-position))
- (skip-syntax-backward "^w_" bound)
- (> (setq to (point)) bound)
- (skip-syntax-backward "w_")
- (setq from (point))))
- ;; Look between `point' and `line-end-position'.
- (save-excursion
- (and (setq bound (line-end-position))
- (skip-syntax-forward "^w_" bound)
- (< (setq from (point)) bound)
- (skip-syntax-forward "w_")
- (setq to (point)))))
- (buffer-substring-no-properties from to))))
-
-
-;;; Functions for use with 'org-open-link-functions' hook =================
-
-
-(defun org-ctags-find-tag (name)
- "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
-Look for a tag called `NAME' in the current TAGS table. If it is found,
-visit the file and location where the tag is found."
- (interactive "sTag: ")
- (let ((old-buf (current-buffer))
- (old-pnt (point-marker))
- (old-mark (copy-marker (mark-marker))))
- (condition-case nil
- (progn (find-tag name)
- t)
- (error
- ;; only restore old location if find-tag raises error
- (set-buffer old-buf)
- (goto-char old-pnt)
- (set-marker (mark-marker) old-mark)
- nil))))
-
-
-(defun org-ctags-visit-buffer-or-file (name &optional create)
- "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
-Visit buffer named `NAME.org'. If there is no such buffer, visit the file
-with the same name if it exists. If the file does not exist, then behavior
-depends on the value of CREATE.
-
-If CREATE is nil (default), then return nil. Do not create a new file.
-If CREATE is t, create the new file and visit it.
-If CREATE is the symbol `ask', then ask the user if they wish to create
-the new file."
- (interactive)
- (let ((filename (concat (substitute-in-file-name
- (expand-file-name name))
- ".org")))
- (cond
- ((get-buffer (concat name ".org"))
- ;; Buffer is already open
- (switch-to-buffer (get-buffer (concat name ".org"))))
- ((file-exists-p filename)
- ;; File exists but is not open --> open it
- (message "Opening existing org file `%S'..."
- filename)
- (org-open-file filename t))
- ((or (eql create t)
- (and (eql create 'ask)
- (y-or-n-p (format "File `%s.org' not found; create?" name))))
- (org-ctags-open-file filename name))
- (t ;; File does not exist, and we don't want to create it.
- nil))))
-
-
-(defun org-ctags-ask-visit-buffer-or-file (name)
- "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
-Wrapper for org-ctags-visit-buffer-or-file, which ensures the user is
-asked before creating a new file."
- (org-ctags-visit-buffer-or-file name 'ask))
-
-
-(defun org-ctags-append-topic (name &optional narrowp)
- "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
-Append a new toplevel heading to the end of the current buffer. The
-heading contains NAME surrounded by <<angular brackets>>, thus making
-the heading a destination for the tag `NAME'."
- (interactive "sTopic: ")
- (widen)
- (goto-char (point-max))
- (newline 2)
- (message "Adding topic in buffer %s" (buffer-name))
- (insert (org-ctags-string-search-and-replace
- "%t" (capitalize name) org-ctags-new-topic-template))
- (backward-char 4)
- (org-update-radio-target-regexp)
- (end-of-line)
- (forward-line 2)
- (when narrowp
- ;;(org-tree-to-indirect-buffer 1) ;; opens new frame
- (org-narrow-to-subtree))
- t)
-
-
-(defun org-ctags-ask-append-topic (name &optional narrowp)
- "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
-Wrapper for org-ctags-append-topic, which first asks the user if they want
-to append a new topic."
- (if (y-or-n-p (format "Topic `%s' not found; append to end of buffer?"
- name))
- (org-ctags-append-topic name narrowp)
- nil))
-
-
-(defun org-ctags-rebuild-tags-file-then-find-tag (name)
- "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
-Like ORG-CTAGS-FIND-TAG, but calls the external ctags program first,
-to rebuild (update) the TAGS file."
- (unless tags-file-name
- (call-interactively (visit-tags-table)))
- (when (buffer-file-name)
- (org-ctags-create-tags))
- (org-ctags-find-tag name))
-
-
-(defun org-ctags-ask-rebuild-tags-file-then-find-tag (name)
- "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
-Wrapper for org-ctags-rebuild-tags-file-then-find-tag."
- (if (and (buffer-file-name)
- (y-or-n-p
- (format
- "Tag `%s' not found. Rebuild table `%s/TAGS' and look again?"
- name
- (file-name-directory (buffer-file-name)))))
- (org-ctags-rebuild-tags-file-then-find-tag name)
- nil))
-
-
-(defun org-ctags-fail-silently (name)
- "This function is intended to be used in ORG-OPEN-LINK-FUNCTIONS.
-Put as the last function in the list if you want to prevent org's default
-behavior of free text search."
- t)
-
-
-;;; User-visible functions ===================================================
-
-
-(defun org-ctags-create-tags (&optional directory-name)
- "(Re)create tags file in the directory of the active buffer.
-The file will contain tag definitions for all the files in the
-directory and its subdirectories which are recognized by ctags.
-This will include files ending in `.org' as well as most other
-source files (.C, .H, .EL, .LISP, etc). All the resulting tags
-end up in one file, called TAGS, located in the directory. This
-function may take several seconds to finish if the directory or
-its subdirectories contain large numbers of taggable files."
- (interactive)
- (assert (buffer-file-name))
- (let ((dir-name (or directory-name
- (file-name-directory (buffer-file-name))))
- (exitcode nil))
- (save-excursion
- (setq exitcode
- (shell-command
- (format (concat "%s --langdef=orgmode --langmap=orgmode:.org "
- "--regex-orgmode=\"%s\" -f \"%s\" -e -R \"%s\"")
- org-ctags-path-to-ctags
- org-ctags-tag-regexp
- (expand-file-name (concat dir-name "/TAGS"))
- (expand-file-name (concat dir-name "/*")))))
- (cond
- ((eql 0 exitcode)
- (set (make-local-variable 'org-ctags-tag-list)
- (org-ctags-all-tags-in-current-tags-table)))
- (t
- ;; This seems to behave differently on Linux, so just ignore
- ;; error codes for now
- ;;(error "Calling ctags executable resulted in error code: %s"
- ;; exitcode)
- nil)))))
-
-
-(defvar org-ctags-find-tag-history nil
- "History of tags visited by org-ctags-find-tag-interactive.")
-
-(defun org-ctags-find-tag-interactive ()
- "Prompt for the name of a tag, with autocompletion, then visit the named tag.
-Uses `ido-mode' if available.
-If the user enters a string that does not match an existing tag, create
-a new topic."
- (interactive)
- (let* ((completing-read-fn (if (fboundp 'ido-completing-read)
- 'ido-completing-read
- 'completing-read))
- (tag (funcall completing-read-fn "Topic: " org-ctags-tag-list
- nil 'confirm nil 'org-ctags-find-tag-history)))
- (when tag
- (cond
- ((member tag org-ctags-tag-list)
- ;; Existing tag
- (push tag org-ctags-find-tag-history)
- (find-tag tag))
- (t
- ;; New tag
- (run-hook-with-args-until-success
- 'org-open-link-functions tag))))))
-
-
-(org-ctags-enable)
-
-(provide 'org-ctags)
-
-;; arch-tag: 4b1ddd5a-8529-4b17-bcde-96a922d26343
-;;; org-ctags.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-ctags.elc b/.emacs.d/org-7.4/lisp/org-ctags.elc
deleted file mode 100644
index fdaa19f..0000000
--- a/.emacs.d/org-7.4/lisp/org-ctags.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-datetree.el b/.emacs.d/org-7.4/lisp/org-datetree.el
deleted file mode 100644
index 8014f8f..0000000
--- a/.emacs.d/org-7.4/lisp/org-datetree.el
+++ /dev/null
@@ -1,200 +0,0 @@
-;;; org-datetree.el --- Create date entries in a tree
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file contains code to create entries in a tree where the top-level
-;; nodes represent years, the level 2 nodes represent the months, and the
-;; level 1 entries days.
-
-;;; Code:
-
-(require 'org)
-
-(defvar org-datetree-base-level 1
- "The level at which years should be placed in the date tree.
-This is normally one, but if the buffer has an entry with a DATE_TREE
-property (any value), the date tree will become a subtree under that entry,
-so the base level will be properly adjusted.")
-
-;;;###autoload
-(defun org-datetree-find-date-create (date &optional keep-restriction)
- "Find or create an entry for DATE.
-If KEEP-RESTRICTION is non-nil, do not widen the buffer.
-When it is nil, the buffer will be widened to make sure an existing date
-tree can be found."
- (let ((year (nth 2 date))
- (month (car date))
- (day (nth 1 date)))
- (org-set-local 'org-datetree-base-level 1)
- (or keep-restriction (widen))
- (goto-char (point-min))
- (save-restriction
- (when (re-search-forward "^[ \t]*:DATE_TREE:[ \t]+\\S-" nil t)
- (org-back-to-heading t)
- (org-set-local 'org-datetree-base-level
- (org-get-valid-level (funcall outline-level) 1))
- (org-narrow-to-subtree))
- (goto-char (point-min))
- (org-datetree-find-year-create year)
- (org-datetree-find-month-create year month)
- (org-datetree-find-day-create year month day)
- (goto-char (prog1 (point) (widen))))))
-
-(defun org-datetree-find-year-create (year)
- (let ((re "^\\*+[ \t]+\\([12][0-9][0-9][0-9]\\)[ \t\n]")
- match)
- (goto-char (point-min))
- (while (and (setq match (re-search-forward re nil t))
- (goto-char (match-beginning 1))
- (< (string-to-number (match-string 1)) year)))
- (cond
- ((not match)
- (goto-char (point-max))
- (or (bolp) (newline))
- (org-datetree-insert-line year))
- ((= (string-to-number (match-string 1)) year)
- (goto-char (point-at-bol)))
- (t
- (beginning-of-line 1)
- (org-datetree-insert-line year)))))
-
-(defun org-datetree-find-month-create (year month)
- (org-narrow-to-subtree)
- (let ((re (format "^\\*+[ \t]+%d-\\([01][0-9]\\)[ \t\n]" year))
- match)
- (goto-char (point-min))
- (while (and (setq match (re-search-forward re nil t))
- (goto-char (match-beginning 1))
- (< (string-to-number (match-string 1)) month)))
- (cond
- ((not match)
- (goto-char (point-max))
- (or (bolp) (newline))
- (org-datetree-insert-line year month))
- ((= (string-to-number (match-string 1)) month)
- (goto-char (point-at-bol)))
- (t
- (beginning-of-line 1)
- (org-datetree-insert-line year month)))))
-
-(defun org-datetree-find-day-create (year month day)
- (org-narrow-to-subtree)
- (let ((re (format "^\\*+[ \t]+%d-%02d-\\([0123][0-9]\\)[ \t\n]" year month))
- match)
- (goto-char (point-min))
- (while (and (setq match (re-search-forward re nil t))
- (goto-char (match-beginning 1))
- (< (string-to-number (match-string 1)) day)))
- (cond
- ((not match)
- (goto-char (point-max))
- (or (bolp) (newline))
- (org-datetree-insert-line year month day))
- ((= (string-to-number (match-string 1)) day)
- (goto-char (point-at-bol)))
- (t
- (beginning-of-line 1)
- (org-datetree-insert-line year month day)))))
-
-(defun org-datetree-insert-line (year &optional month day)
- (let ((pos (point)))
- (skip-chars-backward " \t\n")
- (delete-region (point) pos)
- (insert "\n" (make-string org-datetree-base-level ?*) " \n")
- (backward-char 1)
- (if month (org-do-demote))
- (if day (org-do-demote))
- (insert (format "%d" year))
- (when month
- (insert (format "-%02d" month))
- (if day
- (insert (format "-%02d %s"
- day (format-time-string
- "%A" (encode-time 0 0 0 day month year))))
- (insert (format " %s"
- (format-time-string
- "%B" (encode-time 0 0 0 1 month year))))))
- (beginning-of-line 1)))
-
-(defun org-datetree-file-entry-under (txt date)
- "Insert a node TXT into the date tree under DATE."
- (org-datetree-find-date-create date)
- (let ((level (org-get-valid-level (funcall outline-level) 1)))
- (org-end-of-subtree t t)
- (org-back-over-empty-lines)
- (org-paste-subtree level txt)))
-
-(defun org-datetree-cleanup ()
- "Make sure all entries in the current tree are under the correct date.
-It may be useful to restrict the buffer to the applicable portion
-before running this command, even though the command tries to be smart."
- (interactive)
- (goto-char (point-min))
- (let ((dre (concat "\\<" org-deadline-string "\\>[ \t]*\\'"))
- (sre (concat "\\<" org-scheduled-string "\\>[ \t]*\\'"))
- dct ts tmp date year month day pos hdl-pos)
- (while (re-search-forward org-ts-regexp nil t)
- (catch 'next
- (setq ts (match-string 0))
- (setq tmp (buffer-substring
- (max (point-at-bol) (- (match-beginning 0)
- org-ds-keyword-length))
- (match-beginning 0)))
- (if (or (string-match "-\\'" tmp)
- (string-match dre tmp)
- (string-match sre tmp))
- (throw 'next nil))
- (setq dct (decode-time (org-time-string-to-time (match-string 0)))
- date (list (nth 4 dct) (nth 3 dct) (nth 5 dct))
- year (nth 2 date)
- month (car date)
- day (nth 1 date)
- pos (point))
- (org-back-to-heading t)
- (setq hdl-pos (point))
- (unless (org-up-heading-safe)
- ;; No parent, we are not in a date tree
- (goto-char pos)
- (throw 'next nil))
- (unless (looking-at "\\*+[ \t]+[0-9]+-[0-1][0-9]-[0-3][0-9]")
- ;; Parent looks wrong, we are not in a date tree
- (goto-char pos)
- (throw 'next nil))
- (when (looking-at (format "\\*+[ \t]+%d-%02d-%02d" year month day))
- ;; At correct date already, do nothing
- (progn (goto-char pos) (throw 'next nil)))
- ;; OK, we need to refile this entry
- (goto-char hdl-pos)
- (org-cut-subtree)
- (save-excursion
- (save-restriction
- (org-datetree-file-entry-under (current-kill 0) date)))))))
-
-(provide 'org-datetree)
-
-;; arch-tag: 1daea962-fd08-448b-9f98-6e8b511b3601
-
-;;; org-datetree.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-datetree.elc b/.emacs.d/org-7.4/lisp/org-datetree.elc
deleted file mode 100644
index 1404b1c..0000000
--- a/.emacs.d/org-7.4/lisp/org-datetree.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-docbook.el b/.emacs.d/org-7.4/lisp/org-docbook.el
deleted file mode 100644
index 91ebb97..0000000
--- a/.emacs.d/org-7.4/lisp/org-docbook.el
+++ /dev/null
@@ -1,1444 +0,0 @@
-;;; org-docbook.el --- DocBook exporter for org-mode
-;;
-;; Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-;;
-;; Emacs Lisp Archive Entry
-;; Filename: org-docbook.el
-;; Version: 7.4
-;; Author: Baoqiu Cui <cbaoqiu AT yahoo DOT com>
-;; Maintainer: Baoqiu Cui <cbaoqiu AT yahoo DOT com>
-;; Keywords: org, wp, docbook
-;; Description: Converts an org-mode buffer into DocBook
-;; URL:
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-;;
-;; This library implements a DocBook exporter for org-mode. The basic
-;; idea and design is very similar to what `org-export-as-html' has.
-;; Code prototype was also started with `org-export-as-html'.
-;;
-;; Put this file into your load-path and the following line into your
-;; ~/.emacs:
-;;
-;; (require 'org-docbook)
-;;
-;; The interactive functions are similar to those of the HTML and LaTeX
-;; exporters:
-;;
-;; M-x `org-export-as-docbook'
-;; M-x `org-export-as-docbook-pdf'
-;; M-x `org-export-as-docbook-pdf-and-open'
-;; M-x `org-export-as-docbook-batch'
-;; M-x `org-export-as-docbook-to-buffer'
-;; M-x `org-export-region-as-docbook'
-;; M-x `org-replace-region-by-docbook'
-;;
-;; Note that, in order to generate PDF files using the DocBook XML files
-;; created by DocBook exporter, the following two variables have to be
-;; set based on what DocBook tools you use for XSLT processor and XSL-FO
-;; processor:
-;;
-;; org-export-docbook-xslt-proc-command
-;; org-export-docbook-xsl-fo-proc-command
-;;
-;; Check the document of these two variables to see examples of how they
-;; can be set.
-;;
-;; If the Org file to be exported contains special characters written in
-;; TeX-like syntax, like \alpha and \beta, you need to include the right
-;; entity file(s) in the DOCTYPE declaration for the DocBook XML file.
-;; This is required to make the DocBook XML file valid. The DOCTYPE
-;; declaration string can be set using the following variable:
-;;
-;; org-export-docbook-doctype
-;;
-;;; Code:
-
-(eval-when-compile
- (require 'cl))
-
-(require 'footnote)
-(require 'org)
-(require 'org-exp)
-(require 'org-html)
-(require 'format-spec)
-
-;;; Variables:
-
-(defvar org-docbook-para-open nil)
-(defvar org-export-docbook-inline-images t)
-(defvar org-export-docbook-link-org-files-as-docbook nil)
-
-(declare-function org-id-find-id-file "org-id" (id))
-
-;;; User variables:
-
-(defgroup org-export-docbook nil
- "Options for exporting Org-mode files to DocBook."
- :tag "Org Export DocBook"
- :group 'org-export)
-
-(defcustom org-export-docbook-extension ".xml"
- "Extension of DocBook XML files."
- :group 'org-export-docbook
- :type 'string)
-
-(defcustom org-export-docbook-header "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
- "Header of DocBook XML files."
- :group 'org-export-docbook
- :type 'string)
-
-(defcustom org-export-docbook-doctype nil
- "DOCTYPE declaration string for DocBook XML files.
-This can be used to include entities that are needed to handle
-special characters in Org files.
-
-For example, if the Org file to be exported contains XHTML
-entities, you can set this variable to:
-
-\"<!DOCTYPE article [
-<!ENTITY % xhtml1-symbol PUBLIC
-\"-//W3C//ENTITIES Symbol for HTML//EN//XML\"
-\"http://www.w3.org/2003/entities/2007/xhtml1-symbol.ent\"
->
-%xhtml1-symbol;
-]>
-\"
-
-If you want to process DocBook documents without an Internet
-connection, it is suggested that you download the required entity
-file(s) and use system identifier(s) (external files) in the
-DOCTYPE declaration."
- :group 'org-export-docbook
- :type 'string)
-
-(defcustom org-export-docbook-article-header "<article xmlns=\"http://docbook.org/ns/docbook\"
- xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"5.0\" xml:lang=\"en\">"
- "Article header of DocBook XML files."
- :group 'org-export-docbook
- :type 'string)
-
-(defcustom org-export-docbook-section-id-prefix "sec-"
- "Prefix of section IDs used during exporting.
-This can be set before exporting to avoid same set of section IDs
-being used again and again, which can be a problem when multiple
-people work on the same document."
- :group 'org-export-docbook
- :type 'string)
-
-(defcustom org-export-docbook-footnote-id-prefix "fn-"
- "The prefix of footnote IDs used during exporting.
-Like `org-export-docbook-section-id-prefix', this variable can help
-avoid same set of footnote IDs being used multiple times."
- :group 'org-export-docbook
- :type 'string)
-
-(defcustom org-export-docbook-emphasis-alist
- `(("*" "<emphasis role=\"bold\">" "</emphasis>")
- ("/" "<emphasis>" "</emphasis>")
- ("_" "<emphasis role=\"underline\">" "</emphasis>")
- ("=" "<code>" "</code>")
- ("~" "<literal>" "</literal>")
- ("+" "<emphasis role=\"strikethrough\">" "</emphasis>"))
- "A list of DocBook expressions to convert emphasis fontifiers.
-Each element of the list is a list of three elements.
-The first element is the character used as a marker for fontification.
-The second element is a formatting string to wrap fontified text with.
-The third element decides whether to protect converted text from other
-conversions."
- :group 'org-export-docbook
- :type 'alist)
-
-(defcustom org-export-docbook-default-image-attributes
- `(("align" . "\"center\"")
- ("valign". "\"middle\""))
- "Alist of default DocBook image attributes.
-These attributes will be inserted into element <imagedata> by
-default, but users can override them using `#+ATTR_DocBook:'."
- :group 'org-export-docbook
- :type 'alist)
-
-(defcustom org-export-docbook-inline-image-extensions
- '("jpeg" "jpg" "png" "gif" "svg")
- "Extensions of image files that can be inlined into DocBook."
- :group 'org-export-docbook
- :type '(repeat (string :tag "Extension")))
-
-(defcustom org-export-docbook-coding-system nil
- "Coding system for DocBook XML files."
- :group 'org-export-docbook
- :type 'coding-system)
-
-(defcustom org-export-docbook-xslt-stylesheet nil
- "File name of the XSLT stylesheet used by DocBook exporter.
-This XSLT stylesheet is used by
-`org-export-docbook-xslt-proc-command' to generate the Formatting
-Object (FO) files. You can use either `fo/docbook.xsl' that
-comes with DocBook, or any customization layer you may have."
- :group 'org-export-docbook
- :type 'string)
-
-(defcustom org-export-docbook-xslt-proc-command nil
- "Format of XSLT processor command used by DocBook exporter.
-This command is used to process a DocBook XML file to generate
-the Formatting Object (FO) file.
-
-The value of this variable should be a format control string that
-includes three arguments: `%i', `%o', and `%s'. During exporting
-time, `%i' is replaced by the input DocBook XML file name, `%o'
-is replaced by the output FO file name, and `%s' is replaced by
-`org-export-docbook-xslt-stylesheet' (or the #+XSLT option if it
-is specified in the Org file).
-
-For example, if you use Saxon as the XSLT processor, you may want
-to set the variable to
-
- \"java com.icl.saxon.StyleSheet -o %o %i %s\"
-
-If you use Xalan, you can set it to
-
- \"java org.apache.xalan.xslt.Process -out %o -in %i -xsl %s\"
-
-For xsltproc, the following string should work:
-
- \"xsltproc --output %o %s %i\"
-
-You can include additional stylesheet parameters in this command.
-Just make sure that they meet the syntax requirement of each
-processor."
- :group 'org-export-docbook
- :type 'string)
-
-(defcustom org-export-docbook-xsl-fo-proc-command nil
- "Format of XSL-FO processor command used by DocBook exporter.
-This command is used to process a Formatting Object (FO) file to
-generate the PDF file.
-
-The value of this variable should be a format control string that
-includes two arguments: `%i' and `%o'. During exporting time,
-`%i' is replaced by the input FO file name, and `%o' is replaced
-by the output PDF file name.
-
-For example, if you use FOP as the XSL-FO processor, you can set
-the variable to
-
- \"fop %i %o\""
- :group 'org-export-docbook
- :type 'string)
-
-(defcustom org-export-docbook-keywords-markup "<literal>%s</literal>"
- "A printf format string to be applied to keywords by DocBook exporter."
- :group 'org-export-docbook
- :type 'string)
-
-(defcustom org-export-docbook-timestamp-markup "<emphasis>%s</emphasis>"
- "A printf format string to be applied to time stamps by DocBook exporter."
- :group 'org-export-docbook
- :type 'string)
-
-;;; Hooks
-
-(defvar org-export-docbook-final-hook nil
- "Hook run at the end of DocBook export, in the new buffer.")
-
-;;; Autoload functions:
-
-;;;###autoload
-(defun org-export-as-docbook-batch ()
- "Call `org-export-as-docbook' in batch style.
-This function can be used in batch processing.
-
-For example:
-
-$ emacs --batch
- --load=$HOME/lib/emacs/org.el
- --visit=MyOrgFile.org --funcall org-export-as-docbook-batch"
- (org-export-as-docbook 'hidden))
-
-;;;###autoload
-(defun org-export-as-docbook-to-buffer ()
- "Call `org-export-as-docbook' with output to a temporary buffer.
-No file is created."
- (interactive)
- (org-export-as-docbook nil nil "*Org DocBook Export*")
- (when org-export-show-temporary-export-buffer
- (switch-to-buffer-other-window "*Org DocBook Export*")))
-
-;;;###autoload
-(defun org-replace-region-by-docbook (beg end)
- "Replace the region from BEG to END with its DocBook export.
-It assumes the region has `org-mode' syntax, and then convert it to
-DocBook. This can be used in any buffer. For example, you could
-write an itemized list in `org-mode' syntax in an DocBook buffer and
-then use this command to convert it."
- (interactive "r")
- (let (reg docbook buf)
- (save-window-excursion
- (if (org-mode-p)
- (setq docbook (org-export-region-as-docbook
- beg end t 'string))
- (setq reg (buffer-substring beg end)
- buf (get-buffer-create "*Org tmp*"))
- (with-current-buffer buf
- (erase-buffer)
- (insert reg)
- (org-mode)
- (setq docbook (org-export-region-as-docbook
- (point-min) (point-max) t 'string)))
- (kill-buffer buf)))
- (delete-region beg end)
- (insert docbook)))
-
-;;;###autoload
-(defun org-export-region-as-docbook (beg end &optional body-only buffer)
- "Convert region from BEG to END in `org-mode' buffer to DocBook.
-If prefix arg BODY-ONLY is set, omit file header and footer and
-only produce the region of converted text, useful for
-cut-and-paste operations. If BUFFER is a buffer or a string,
-use/create that buffer as a target of the converted DocBook. If
-BUFFER is the symbol `string', return the produced DocBook as a
-string and leave not buffer behind. For example, a Lisp program
-could call this function in the following way:
-
- (setq docbook (org-export-region-as-docbook beg end t 'string))
-
-When called interactively, the output buffer is selected, and shown
-in a window. A non-interactive call will only return the buffer."
- (interactive "r\nP")
- (when (interactive-p)
- (setq buffer "*Org DocBook Export*"))
- (let ((transient-mark-mode t)
- (zmacs-regions t)
- rtn)
- (goto-char end)
- (set-mark (point)) ;; To activate the region
- (goto-char beg)
- (setq rtn (org-export-as-docbook
- nil nil
- buffer body-only))
- (if (fboundp 'deactivate-mark) (deactivate-mark))
- (if (and (interactive-p) (bufferp rtn))
- (switch-to-buffer-other-window rtn)
- rtn)))
-
-;;;###autoload
-(defun org-export-as-docbook-pdf (&optional hidden ext-plist
- to-buffer body-only pub-dir)
- "Export as DocBook XML file, and generate PDF file."
- (interactive "P")
- (if (or (not org-export-docbook-xslt-proc-command)
- (not (string-match "%[ios].+%[ios].+%[ios]" org-export-docbook-xslt-proc-command)))
- (error "XSLT processor command is not set correctly"))
- (if (or (not org-export-docbook-xsl-fo-proc-command)
- (not (string-match "%[io].+%[io]" org-export-docbook-xsl-fo-proc-command)))
- (error "XSL-FO processor command is not set correctly"))
- (message "Exporting to PDF...")
- (let* ((wconfig (current-window-configuration))
- (opt-plist
- (org-export-process-option-filters
- (org-combine-plists (org-default-export-plist)
- ext-plist
- (org-infile-export-plist))))
- (docbook-buf (org-export-as-docbook hidden ext-plist
- to-buffer body-only pub-dir))
- (filename (buffer-file-name docbook-buf))
- (base (file-name-sans-extension filename))
- (fofile (concat base ".fo"))
- (pdffile (concat base ".pdf")))
- (and (file-exists-p pdffile) (delete-file pdffile))
- (message "Processing DocBook XML file...")
- (shell-command (format-spec org-export-docbook-xslt-proc-command
- (format-spec-make
- ?i (shell-quote-argument filename)
- ?o (shell-quote-argument fofile)
- ?s (shell-quote-argument
- (or (plist-get opt-plist :xslt)
- org-export-docbook-xslt-stylesheet)))))
- (shell-command (format-spec org-export-docbook-xsl-fo-proc-command
- (format-spec-make
- ?i (shell-quote-argument fofile)
- ?o (shell-quote-argument pdffile))))
- (message "Processing DocBook file...done")
- (if (not (file-exists-p pdffile))
- (error "PDF file was not produced")
- (set-window-configuration wconfig)
- (message "Exporting to PDF...done")
- pdffile)))
-
-;;;###autoload
-(defun org-export-as-docbook-pdf-and-open ()
- "Export as DocBook XML file, generate PDF file, and open it."
- (interactive)
- (let ((pdffile (org-export-as-docbook-pdf)))
- (if pdffile
- (org-open-file pdffile)
- (error "PDF file was not produced"))))
-
-;;;###autoload
-(defun org-export-as-docbook (&optional hidden ext-plist
- to-buffer body-only pub-dir)
- "Export the current buffer as a DocBook file.
-If there is an active region, export only the region. When
-HIDDEN is obsolete and does nothing. EXT-PLIST is a
-property list with external parameters overriding org-mode's
-default settings, but still inferior to file-local settings.
-When TO-BUFFER is non-nil, create a buffer with that name and
-export to that buffer. If TO-BUFFER is the symbol `string',
-don't leave any buffer behind but just return the resulting HTML
-as a string. When BODY-ONLY is set, don't produce the file
-header and footer, simply return the content of the document (all
-top-level sections). When PUB-DIR is set, use this as the
-publishing directory."
- (interactive "P")
- (run-hooks 'org-export-first-hook)
-
- ;; Make sure we have a file name when we need it.
- (when (and (not (or to-buffer body-only))
- (not buffer-file-name))
- (if (buffer-base-buffer)
- (org-set-local 'buffer-file-name
- (with-current-buffer (buffer-base-buffer)
- buffer-file-name))
- (error "Need a file name to be able to export")))
-
- (message "Exporting...")
- (setq-default org-todo-line-regexp org-todo-line-regexp)
- (setq-default org-deadline-line-regexp org-deadline-line-regexp)
- (setq-default org-done-keywords org-done-keywords)
- (setq-default org-maybe-keyword-time-regexp org-maybe-keyword-time-regexp)
- (let* ((opt-plist
- (org-export-process-option-filters
- (org-combine-plists (org-default-export-plist)
- ext-plist
- (org-infile-export-plist))))
- (link-validate (plist-get opt-plist :link-validation-function))
- valid
- (odd org-odd-levels-only)
- (region-p (org-region-active-p))
- (rbeg (and region-p (region-beginning)))
- (rend (and region-p (region-end)))
- (subtree-p
- (if (plist-get opt-plist :ignore-subtree-p)
- nil
- (when region-p
- (save-excursion
- (goto-char rbeg)
- (and (org-at-heading-p)
- (>= (org-end-of-subtree t t) rend))))))
- (level-offset (if subtree-p
- (save-excursion
- (goto-char rbeg)
- (+ (funcall outline-level)
- (if org-odd-levels-only 1 0)))
- 0))
- (opt-plist (setq org-export-opt-plist
- (if subtree-p
- (org-export-add-subtree-options opt-plist rbeg)
- opt-plist)))
- ;; The following two are dynamically scoped into other
- ;; routines below.
- (org-current-export-dir
- (or pub-dir (org-export-directory :docbook opt-plist)))
- (org-current-export-file buffer-file-name)
- (level 0) (line "") (origline "") txt todo
- (filename (if to-buffer nil
- (expand-file-name
- (concat
- (file-name-sans-extension
- (or (and subtree-p
- (org-entry-get (region-beginning)
- "EXPORT_FILE_NAME" t))
- (file-name-nondirectory buffer-file-name)))
- org-export-docbook-extension)
- (file-name-as-directory
- (or pub-dir (org-export-directory :docbook opt-plist))))))
- (current-dir (if buffer-file-name
- (file-name-directory buffer-file-name)
- default-directory))
- (buffer (if to-buffer
- (cond
- ((eq to-buffer 'string) (get-buffer-create "*Org DocBook Export*"))
- (t (get-buffer-create to-buffer)))
- (find-file-noselect filename)))
- ;; org-levels-open is a global variable
- (org-levels-open (make-vector org-level-max nil))
- (date (plist-get opt-plist :date))
- (author (or (plist-get opt-plist :author)
- user-full-name))
- (email (plist-get opt-plist :email))
- firstname othername surname
- (title (or (and subtree-p (org-export-get-title-from-subtree))
- (plist-get opt-plist :title)
- (and (not
- (plist-get opt-plist :skip-before-1st-heading))
- (org-export-grab-title-from-buffer))
- (and buffer-file-name
- (file-name-sans-extension
- (file-name-nondirectory buffer-file-name)))
- "UNTITLED"))
- ;; We will use HTML table formatter to export tables to DocBook
- ;; format, so need to set html-table-tag here.
- (html-table-tag (plist-get opt-plist :html-table-tag))
- (quote-re0 (concat "^[ \t]*" org-quote-string "\\>"))
- (quote-re (concat "^\\(\\*+\\)\\([ \t]+" org-quote-string "\\>\\)"))
- (inquote nil)
- (infixed nil)
- (inverse nil)
- (in-local-list nil)
- (local-list-type nil)
- (local-list-indent nil)
- (llt org-plain-list-ordered-item-terminator)
- (email (plist-get opt-plist :email))
- (language (plist-get opt-plist :language))
- (lang-words nil)
- cnt
- (start 0)
- (coding-system (and (boundp 'buffer-file-coding-system)
- buffer-file-coding-system))
- (coding-system-for-write (or org-export-docbook-coding-system
- coding-system))
- (save-buffer-coding-system (or org-export-docbook-coding-system
- coding-system))
- (charset (and coding-system-for-write
- (fboundp 'coding-system-get)
- (coding-system-get coding-system-for-write
- 'mime-charset)))
- (region
- (buffer-substring
- (if region-p (region-beginning) (point-min))
- (if region-p (region-end) (point-max))))
- (lines
- (org-split-string
- (org-export-preprocess-string
- region
- :emph-multiline t
- :for-docbook t
- :skip-before-1st-heading
- (plist-get opt-plist :skip-before-1st-heading)
- :drawers (plist-get opt-plist :drawers)
- :todo-keywords (plist-get opt-plist :todo-keywords)
- :tags (plist-get opt-plist :tags)
- :priority (plist-get opt-plist :priority)
- :footnotes (plist-get opt-plist :footnotes)
- :timestamps (plist-get opt-plist :timestamps)
- :archived-trees
- (plist-get opt-plist :archived-trees)
- :select-tags (plist-get opt-plist :select-tags)
- :exclude-tags (plist-get opt-plist :exclude-tags)
- :add-text
- (plist-get opt-plist :text)
- :LaTeX-fragments
- (plist-get opt-plist :LaTeX-fragments))
- "[\r\n]"))
- ;; Use literal output to show check boxes.
- (checkbox-start
- (nth 1 (assoc "=" org-export-docbook-emphasis-alist)))
- (checkbox-end
- (nth 2 (assoc "=" org-export-docbook-emphasis-alist)))
- table-open type
- table-buffer table-orig-buffer
- ind item-type starter
- rpl path attr caption label desc descp desc1 desc2 link
- fnc item-tag item-number
- footref-seen footnote-list
- id-file
- )
-
- ;; Fine detailed info about author name.
- (if (string-match "\\([^ ]+\\) \\(.+ \\)?\\([^ ]+\\)" author)
- (progn
- (setq firstname (match-string 1 author)
- othername (or (match-string 2 author) "")
- surname (match-string 3 author))))
-
- ;; Get all footnote text.
- (setq footnote-list
- (org-export-docbook-get-footnotes lines))
-
- (let ((inhibit-read-only t))
- (org-unmodified
- (remove-text-properties (point-min) (point-max)
- '(:org-license-to-kill t))))
-
- (setq org-min-level (org-get-min-level lines level-offset))
- (setq org-last-level org-min-level)
- (org-init-section-numbers)
-
- ;; Get and save the date.
- (cond
- ((and date (string-match "%" date))
- (setq date (format-time-string date)))
- (date)
- (t (setq date (format-time-string "%Y-%m-%d %T %Z"))))
-
- ;; Get the language-dependent settings
- (setq lang-words (or (assoc language org-export-language-setup)
- (assoc "en" org-export-language-setup)))
-
- ;; Switch to the output buffer. Use fundamental-mode for now. We
- ;; could turn on nXML mode later and do some indentation.
- (set-buffer buffer)
- (let ((inhibit-read-only t)) (erase-buffer))
- (fundamental-mode)
- (org-install-letbind)
-
- (and (fboundp 'set-buffer-file-coding-system)
- (set-buffer-file-coding-system coding-system-for-write))
-
- ;; The main body...
- (let ((case-fold-search nil)
- (org-odd-levels-only odd))
-
- ;; Create local variables for all options, to make sure all called
- ;; functions get the correct information
- (mapc (lambda (x)
- (set (make-local-variable (nth 2 x))
- (plist-get opt-plist (car x))))
- org-export-plist-vars)
-
- ;; Insert DocBook file header, title, and author info.
- (unless body-only
- (insert org-export-docbook-header)
- (if org-export-docbook-doctype
- (insert org-export-docbook-doctype))
- (insert "<!-- Date: " date " -->\n")
- (insert (format "<!-- DocBook XML file generated by Org-mode %s Emacs %s -->\n"
- org-version emacs-major-version))
- (insert org-export-docbook-article-header)
- (insert (format
- "\n <title>%s</title>
- <info>
- <author>
- <personname>
- <firstname>%s</firstname> <othername>%s</othername> <surname>%s</surname>
- </personname>
- %s
- </author>
- </info>\n"
- (org-docbook-expand title)
- firstname othername surname
- (if (and org-export-email-info
- email (string-match "\\S-" email))
- (concat "<email>" email "</email>") "")
- )))
-
- (org-init-section-numbers)
-
- (org-export-docbook-open-para)
-
- ;; Loop over all the lines...
- (while (setq line (pop lines) origline line)
- (catch 'nextline
-
- ;; End of quote section?
- (when (and inquote (string-match "^\\*+ " line))
- (insert "]]></programlisting>\n")
- (org-export-docbook-open-para)
- (setq inquote nil))
- ;; Inside a quote section?
- (when inquote
- (insert (org-docbook-protect line) "\n")
- (throw 'nextline nil))
-
- ;; Fixed-width, verbatim lines (examples)
- (when (and org-export-with-fixed-width
- (string-match "^[ \t]*:\\(\\([ \t]\\|$\\)\\(.*\\)\\)" line))
- (when (not infixed)
- (setq infixed t)
- (org-export-docbook-close-para-maybe)
- (insert "<programlisting><![CDATA["))
- (insert (match-string 3 line) "\n")
- (when (or (not lines)
- (not (string-match "^[ \t]*\\(:.*\\)"
- (car lines))))
- (setq infixed nil)
- (insert "]]></programlisting>\n")
- (org-export-docbook-open-para))
- (throw 'nextline nil))
-
- ;; List ender: close every open list.
- (when (equal "ORG-LIST-END" line)
- (while local-list-type
- (let ((listtype (car local-list-type)))
- (org-export-docbook-close-li listtype)
- (insert (cond
- ((equal listtype "o") "</orderedlist>\n")
- ((equal listtype "u") "</itemizedlist>\n")
- ((equal listtype "d") "</variablelist>\n"))))
- (pop local-list-type))
- ;; We did close a list, normal text follows: need <para>
- (org-export-docbook-open-para)
- (setq local-list-indent nil
- in-local-list nil)
- (throw 'nextline nil))
-
- ;; Protected HTML
- (when (get-text-property 0 'org-protected line)
- (let (par (ind (get-text-property 0 'original-indentation line)))
- (when (re-search-backward
- "\\(<para>\\)\\([ \t\r\n]*\\)\\=" (- (point) 100) t)
- (setq par (match-string 1))
- (replace-match "\\2\n"))
- (insert line "\n")
- (while (and lines
- (or (= (length (car lines)) 0)
- (not ind)
- (equal ind (get-text-property 0 'original-indentation (car lines))))
- (or (= (length (car lines)) 0)
- (get-text-property 0 'org-protected (car lines))))
- (insert (pop lines) "\n"))
- (and par (insert "<para>\n")))
- (throw 'nextline nil))
-
- ;; Start of block quotes and verses
- (when (or (equal "ORG-BLOCKQUOTE-START" line)
- (and (equal "ORG-VERSE-START" line)
- (setq inverse t)))
- (org-export-docbook-close-para-maybe)
- (insert "<blockquote>")
- ;; Check whether attribution for this blockquote exists.
- (let (tmp1
- attribution
- (end (if inverse "ORG-VERSE-END" "ORG-BLOCKQUOTE-END"))
- (quote-lines nil))
- (while (and (setq tmp1 (pop lines))
- (not (equal end tmp1)))
- (push tmp1 quote-lines))
- (push tmp1 lines) ; Put back quote end mark
- ;; Check the last line in the quote to see if it contains
- ;; the attribution.
- (setq tmp1 (pop quote-lines))
- (if (string-match "\\(^.*\\)\\(--[ \t]+\\)\\(.+\\)$" tmp1)
- (progn
- (setq attribution (match-string 3 tmp1))
- (when (save-match-data
- (string-match "[^ \t]" (match-string 1 tmp1)))
- (push (match-string 1 tmp1) lines)))
- (push tmp1 lines))
- (while (setq tmp1 (pop quote-lines))
- (push tmp1 lines))
- (when attribution
- (insert "<attribution>" attribution "</attribution>")))
- ;; Insert <literallayout> for verse.
- (if inverse
- (insert "\n<literallayout>")
- (org-export-docbook-open-para))
- (throw 'nextline nil))
-
- ;; End of block quotes
- (when (equal "ORG-BLOCKQUOTE-END" line)
- (org-export-docbook-close-para-maybe)
- (insert "</blockquote>\n")
- (org-export-docbook-open-para)
- (throw 'nextline nil))
-
- ;; End of verses
- (when (equal "ORG-VERSE-END" line)
- (insert "</literallayout>\n</blockquote>\n")
- (org-export-docbook-open-para)
- (setq inverse nil)
- (throw 'nextline nil))
-
- ;; Text centering. Element <para role="centered"> does not
- ;; seem to work with FOP, so for now we use <informaltable> to
- ;; center the text, which can contain multiple paragraphs.
- (when (equal "ORG-CENTER-START" line)
- (org-export-docbook-close-para-maybe)
- (insert "<informaltable frame=\"none\" colsep=\"0\" rowsep=\"0\">\n"
- "<tgroup align=\"center\" cols=\"1\">\n"
- "<tbody><row><entry>\n")
- (org-export-docbook-open-para)
- (throw 'nextline nil))
-
- (when (equal "ORG-CENTER-END" line)
- (org-export-docbook-close-para-maybe)
- (insert "</entry></row></tbody>\n"
- "</tgroup>\n</informaltable>\n")
- (org-export-docbook-open-para)
- (throw 'nextline nil))
-
- ;; Make targets to anchors. Note that currently FOP does not
- ;; seem to support <anchor> tags when generating PDF output,
- ;; but this can be used in DocBook --> HTML conversion.
- (setq start 0)
- (while (string-match
- "<<<?\\([^<>]*\\)>>>?\\((INVISIBLE)\\)?[ \t]*\n?" line start)
- (cond
- ((get-text-property (match-beginning 1) 'org-protected line)
- (setq start (match-end 1)))
- ((match-end 2)
- (setq line (replace-match
- (format "@<anchor xml:id=\"%s\"/>"
- (org-solidify-link-text (match-string 1 line)))
- t t line)))
- (t
- (setq line (replace-match
- (format "@<anchor xml:id=\"%s\"/>"
- (org-solidify-link-text (match-string 1 line)))
- t t line)))))
-
- ;; Put time stamps and related keywords into special mark-up
- ;; elements.
- (setq line (org-export-docbook-handle-time-stamps line))
-
- ;; Replace "&", "<" and ">" by "&amp;", "&lt;" and "&gt;".
- ;; Handle @<..> HTML tags (replace "@&gt;..&lt;" by "<..>").
- ;; Also handle sub_superscripts and check boxes.
- (or (string-match org-table-hline-regexp line)
- (setq line (org-docbook-expand line)))
-
- ;; Format the links
- (setq start 0)
- (while (string-match org-bracket-link-analytic-regexp++ line start)
- (setq start (match-beginning 0))
- (setq path (save-match-data (org-link-unescape
- (match-string 3 line))))
- (setq type (cond
- ((match-end 2) (match-string 2 line))
- ((save-match-data
- (or (file-name-absolute-p path)
- (string-match "^\\.\\.?/" path)))
- "file")
- (t "internal")))
- (setq path (org-extract-attributes (org-link-unescape path)))
- (setq attr (get-text-property 0 'org-attributes path)
- caption (get-text-property 0 'org-caption path)
- label (get-text-property 0 'org-label path))
- (setq desc1 (if (match-end 5) (match-string 5 line))
- desc2 (if (match-end 2) (concat type ":" path) path)
- descp (and desc1 (not (equal desc1 desc2)))
- desc (or desc1 desc2))
- ;; Make an image out of the description if that is so wanted
- (when (and descp (org-file-image-p
- desc org-export-docbook-inline-image-extensions))
- (save-match-data
- (if (string-match "^file:" desc)
- (setq desc (substring desc (match-end 0))))))
- ;; FIXME: do we need to unescape here somewhere?
- (cond
- ((equal type "internal")
- (setq rpl (format "<link linkend=\"%s\">%s</link>"
- (org-solidify-link-text
- (save-match-data (org-link-unescape path)) nil)
- (org-export-docbook-format-desc desc))))
- ((and (equal type "id")
- (setq id-file (org-id-find-id-file path)))
- ;; This is an id: link to another file (if it was the same file,
- ;; it would have become an internal link...)
- (save-match-data
- (setq id-file (file-relative-name
- id-file (file-name-directory org-current-export-file)))
- (setq id-file (concat (file-name-sans-extension id-file)
- org-export-docbook-extension))
- (setq rpl (format "<link xlink:href=\"%s#%s\">%s</link>"
- id-file path (org-export-docbook-format-desc desc)))))
- ((member type '("http" "https"))
- ;; Standard URL, just check if we need to inline an image
- (if (and (or (eq t org-export-docbook-inline-images)
- (and org-export-docbook-inline-images (not descp)))
- (org-file-image-p
- path org-export-docbook-inline-image-extensions))
- (setq rpl (org-export-docbook-format-image
- (concat type ":" path)))
- (setq link (concat type ":" path))
- (setq rpl (format "<link xlink:href=\"%s\">%s</link>"
- (org-export-html-format-href link)
- (org-export-docbook-format-desc desc)))
- ))
- ((member type '("ftp" "mailto" "news"))
- ;; Standard URL
- (setq link (concat type ":" path))
- (setq rpl (format "<link xlink:href=\"%s\">%s</link>"
- (org-export-html-format-href link)
- (org-export-docbook-format-desc desc))))
- ((string= type "coderef")
- (setq rpl (format (org-export-get-coderef-format path (and descp desc))
- (cdr (assoc path org-export-code-refs)))))
- ((functionp (setq fnc (nth 2 (assoc type org-link-protocols))))
- ;; The link protocol has a function for format the link
- (setq rpl
- (save-match-data
- (funcall fnc (org-link-unescape path) desc1 'html))))
-
- ((string= type "file")
- ;; FILE link
- (let* ((filename path)
- (abs-p (file-name-absolute-p filename))
- thefile file-is-image-p search)
- (save-match-data
- (if (string-match "::\\(.*\\)" filename)
- (setq search (match-string 1 filename)
- filename (replace-match "" t nil filename)))
- (setq valid
- (if (functionp link-validate)
- (funcall link-validate filename current-dir)
- t))
- (setq file-is-image-p
- (org-file-image-p
- filename org-export-docbook-inline-image-extensions))
- (setq thefile (if abs-p (expand-file-name filename) filename))
- ;; Carry over the properties (expand-file-name will
- ;; discard the properties of filename)
- (add-text-properties 0 (1- (length thefile))
- (list 'org-caption caption
- 'org-attributes attr
- 'org-label label)
- thefile)
- (when (and org-export-docbook-link-org-files-as-docbook
- (string-match "\\.org$" thefile))
- (setq thefile (concat (substring thefile 0
- (match-beginning 0))
- org-export-docbook-extension))
- (if (and search
- ;; make sure this is can be used as target search
- (not (string-match "^[0-9]*$" search))
- (not (string-match "^\\*" search))
- (not (string-match "^/.*/$" search)))
- (setq thefile (concat thefile "#"
- (org-solidify-link-text
- (org-link-unescape search)))))
- (when (string-match "^file:" desc)
- (setq desc (replace-match "" t t desc))
- (if (string-match "\\.org$" desc)
- (setq desc (replace-match "" t t desc))))))
- (setq rpl (if (and file-is-image-p
- (or (eq t org-export-docbook-inline-images)
- (and org-export-docbook-inline-images
- (not descp))))
- (progn
- (message "image %s %s" thefile org-docbook-para-open)
- (org-export-docbook-format-image thefile))
- (format "<link xlink:href=\"%s\">%s</link>"
- thefile (org-export-docbook-format-desc desc))))
- (if (not valid) (setq rpl desc))))
-
- (t
- ;; Just publish the path, as default
- (setq rpl (concat "&lt;" type ":"
- (save-match-data (org-link-unescape path))
- "&gt;"))))
- (setq line (replace-match rpl t t line)
- start (+ start (length rpl))))
-
- ;; TODO items: can we do something better?!
- (if (and (string-match org-todo-line-regexp line)
- (match-beginning 2))
- (setq line
- (concat (substring line 0 (match-beginning 2))
- "[" (match-string 2 line) "]"
- (substring line (match-end 2)))))
-
- ;; Does this contain a reference to a footnote?
- (when org-export-with-footnotes
- (setq start 0)
- (while (string-match "\\([^* \t].*?\\)\\[\\([0-9]+\\)\\]" line start)
- (if (get-text-property (match-beginning 2) 'org-protected line)
- (setq start (match-end 2))
- (let* ((num (match-string 2 line))
- (footnote-def (assoc num footnote-list)))
- (if (assoc num footref-seen)
- (setq line (replace-match
- (format "%s<footnoteref linkend=\"%s%s\"/>"
- (match-string 1 line)
- org-export-docbook-footnote-id-prefix num)
- t t line))
- (setq line (replace-match
- (format "%s<footnote xml:id=\"%s%s\"><para>%s</para></footnote>"
- (match-string 1 line)
- org-export-docbook-footnote-id-prefix
- num
- (if footnote-def
- (save-match-data
- (org-docbook-expand (cdr footnote-def)))
- (format "FOOTNOTE DEFINITION NOT FOUND: %s" num)))
- t t line))
- (push (cons num 1) footref-seen))))))
-
- (cond
- ((string-match "^\\(\\*+\\)[ \t]+\\(.*\\)" line)
- ;; This is a headline
- (setq level (org-tr-level (- (match-end 1) (match-beginning 1)
- level-offset))
- txt (match-string 2 line))
- (if (string-match quote-re0 txt)
- (setq txt (replace-match "" t t txt)))
- (org-export-docbook-level-start level txt)
- ;; QUOTES
- (when (string-match quote-re line)
- (org-export-docbook-close-para-maybe)
- (insert "<programlisting><![CDATA[")
- (setq inquote t)))
-
- ;; Tables: since version 4.3 of DocBook DTD, HTML tables are
- ;; supported. We can use existing HTML table exporter code
- ;; here.
- ((and org-export-with-tables
- (string-match "^\\([ \t]*\\)\\(|\\|\\+-+\\+\\)" line))
- (if (not table-open)
- ;; New table starts
- (setq table-open t
- table-buffer nil
- table-orig-buffer nil))
- ;; Accumulate lines
- (setq table-buffer (cons line table-buffer)
- table-orig-buffer (cons origline table-orig-buffer))
- (when (or (not lines)
- (not (string-match "^\\([ \t]*\\)\\(|\\|\\+-+\\+\\)"
- (car lines))))
- (setq table-open nil
- table-buffer (nreverse table-buffer)
- table-orig-buffer (nreverse table-orig-buffer))
- (org-export-docbook-close-para-maybe)
- (insert (org-export-docbook-finalize-table
- (org-format-table-html table-buffer table-orig-buffer
- 'no-css)))))
-
- (t
- ;; Normal lines
- (when (string-match
- (cond
- ((eq llt t) "^\\([ \t]*\\)\\(\\([-+*] \\)\\|\\([0-9]+[.)]\\) \\)?\\( *[^ \t\n\r]\\|[ \t]*$\\)")
- ((= llt ?.) "^\\([ \t]*\\)\\(\\([-+*] \\)\\|\\([0-9]+\\.\\) \\)?\\( *[^ \t\n\r]\\|[ \t]*$\\)")
- ((= llt ?\)) "^\\([ \t]*\\)\\(\\([-+*] \\)\\|\\([0-9]+)\\) \\)?\\( *[^ \t\n\r]\\|[ \t]*$\\)")
- (t (error "Invalid value of `org-plain-list-ordered-item-terminator'")))
- line)
- (setq ind (or (get-text-property 0 'original-indentation line)
- (org-get-string-indentation line))
- item-type (if (match-beginning 4) "o" "u")
- starter (if (match-beginning 2)
- (substring (match-string 2 line) 0 -1))
- line (substring line (match-beginning 5))
- item-tag nil
- item-number nil)
- (if (string-match "\\[@\\(?:start:\\)?\\([0-9]+\\)\\][ \t]?" line)
- (setq item-number (match-string 1 line)
- line (replace-match "" t t line)))
- (if (and starter (string-match "\\(.*?\\) ::[ \t]*" line))
- (setq item-type "d"
- item-tag (match-string 1 line)
- line (substring line (match-end 0))))
- (cond
- ((and starter
- (or (not in-local-list)
- (> ind (car local-list-indent))))
- ;; Start new (level of) list
- (org-export-docbook-close-para-maybe)
- (insert (cond
- ((equal item-type "u") "<itemizedlist>\n<listitem>\n")
- ((and (equal item-type "o") item-number)
- ;; Check for a specific start number. If it
- ;; is specified, we use the ``override''
- ;; attribute of element <listitem> to pass the
- ;; info to DocBook. We could also use the
- ;; ``startingnumber'' attribute of element
- ;; <orderedlist>, but the former works on both
- ;; DocBook 5.0 and prior versions.
- (format "<orderedlist>\n<listitem override=\"%s\">\n" item-number))
- ((equal item-type "o") "<orderedlist>\n<listitem>\n")
- ((equal item-type "d")
- (format "<variablelist>\n<varlistentry><term>%s</term><listitem>\n" item-tag))))
- ;; For DocBook, we need to open a para right after tag
- ;; <listitem>.
- (org-export-docbook-open-para)
- (push item-type local-list-type)
- (push ind local-list-indent)
- (setq in-local-list t))
- ;; Continue current list
- (starter
- ;; terminate any previous sublist but first ensure
- ;; list is not ill-formed
- (let ((min-ind (apply 'min local-list-indent)))
- (when (< ind min-ind) (setq ind min-ind)))
- (while (< ind (car local-list-indent))
- (let ((listtype (car local-list-type)))
- (org-export-docbook-close-li listtype)
- (insert (cond
- ((equal listtype "o") "</orderedlist>\n")
- ((equal listtype "u") "</itemizedlist>\n")
- ((equal listtype "d") "</variablelist>\n"))))
- (pop local-list-type) (pop local-list-indent)
- (setq in-local-list local-list-indent))
- ;; insert new item
- (let ((listtype (car local-list-type)))
- (org-export-docbook-close-li listtype)
- (insert (cond
- ((and (equal listtype "o") item-number)
- (format "<listitem override=\"%s\">" item-number))
- ((equal listtype "o") "<listitem>")
- ((equal listtype "u") "<listitem>")
- ((equal listtype "d") (format
- "<varlistentry><term>%s</term><listitem>"
- (or item-tag
- "???"))))))
- ;; For DocBook, we need to open a para right after tag
- ;; <listitem>.
- (org-export-docbook-open-para)))
- ;; Checkboxes.
- (if (string-match "^[ \t]*\\(\\[[X -]\\]\\)" line)
- (setq line
- (replace-match (concat checkbox-start
- (match-string 1 line)
- checkbox-end)
- t t line))))
-
- ;; Empty lines start a new paragraph. If hand-formatted lists
- ;; are not fully interpreted, lines starting with "-", "+", "*"
- ;; also start a new paragraph.
- (if (and (string-match "^ [-+*]-\\|^[ \t]*$" line)
- (not inverse))
- (org-export-docbook-open-para))
-
- ;; Is this the start of a footnote?
- (when org-export-with-footnotes
- (when (and (boundp 'footnote-section-tag-regexp)
- (string-match (concat "^" footnote-section-tag-regexp)
- line))
- ;; ignore this line
- (throw 'nextline nil))
- ;; These footnote lines have been read and saved before,
- ;; ignore them at this time.
- (when (string-match "^[ \t]*\\[\\([0-9]+\\)\\]" line)
- (org-export-docbook-close-para-maybe)
- (throw 'nextline nil)))
-
- ;; FIXME: It might be a good idea to add an option to
- ;; support line break processing instruction <?linebreak?>.
- ;; Org-mode supports line break "\\" in HTML exporter, and
- ;; some DocBook users may also want to force line breaks
- ;; even though DocBook only supports that in
- ;; <literallayout>.
-
- (insert line "\n")))))
-
- ;; Properly close all local lists and other lists
- (when inquote
- (insert "]]></programlisting>\n")
- (org-export-docbook-open-para))
-
- ;; Close all open sections.
- (org-export-docbook-level-start 1 nil)
-
- (unless (plist-get opt-plist :buffer-will-be-killed)
- (normal-mode)
- (if (eq major-mode (default-value 'major-mode))
- (nxml-mode)))
-
- ;; Remove empty paragraphs and lists. Replace them with a
- ;; newline.
- (goto-char (point-min))
- (while (re-search-forward
- "[ \r\n\t]*\\(<para>\\)[ \r\n\t]*</para>[ \r\n\t]*" nil t)
- (when (not (get-text-property (match-beginning 1) 'org-protected))
- (replace-match "\n")
- ;; Avoid empty <listitem></listitem> caused by inline tasks.
- ;; We should add an empty para to make everything valid.
- (when (and (looking-at "</listitem>")
- (save-excursion
- (backward-char (length "<listitem>\n"))
- (looking-at "<listitem>")))
- (insert "<para></para>"))
- (backward-char 1)))
- ;; Fill empty sections with <para></para>. This is to make sure
- ;; that the DocBook document generated is valid and well-formed.
- (goto-char (point-min))
- (while (re-search-forward
- "</title>\\([ \r\n\t]*\\)</section>" nil t)
- (when (not (get-text-property (match-beginning 0) 'org-protected))
- (replace-match "\n<para></para>\n" nil nil nil 1)))
- ;; Insert the last closing tag.
- (goto-char (point-max))
- (unless body-only
- (insert "</article>"))
- (run-hooks 'org-export-docbook-final-hook)
- (or to-buffer (save-buffer))
- (goto-char (point-min))
- (or (org-export-push-to-kill-ring "DocBook")
- (message "Exporting... done"))
- (if (eq to-buffer 'string)
- (prog1 (buffer-substring (point-min) (point-max))
- (kill-buffer (current-buffer)))
- (current-buffer)))))
-
-(defun org-export-docbook-open-para ()
- "Insert <para>, but first close previous paragraph if any."
- (org-export-docbook-close-para-maybe)
- (insert "\n<para>")
- (setq org-docbook-para-open t))
-
-(defun org-export-docbook-close-para-maybe ()
- "Close DocBook paragraph if there is one open."
- (when org-docbook-para-open
- (insert "</para>\n")
- (setq org-docbook-para-open nil)))
-
-(defun org-export-docbook-close-li (&optional type)
- "Close list if necessary."
- (org-export-docbook-close-para-maybe)
- (if (equal type "d")
- (insert "</listitem></varlistentry>\n")
- (insert "</listitem>\n")))
-
-(defvar in-local-list)
-(defvar local-list-indent)
-(defvar local-list-type)
-
-(defun org-export-docbook-level-start (level title)
- "Insert a new level in DocBook export.
-When TITLE is nil, just close all open levels."
- (org-export-docbook-close-para-maybe)
- (let* ((target (and title (org-get-text-property-any 0 'target title)))
- (l org-level-max)
- section-number)
- (while (>= l level)
- (if (aref org-levels-open (1- l))
- (progn
- (insert "</section>\n")
- (aset org-levels-open (1- l) nil)))
- (setq l (1- l)))
- (when title
- ;; If title is nil, this means this function is called to close
- ;; all levels, so the rest is done only if title is given.
- ;;
- ;; Format tags: put them into a superscript like format.
- (when (string-match (org-re "\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$") title)
- (setq title
- (replace-match
- (if org-export-with-tags
- (save-match-data
- (concat
- "<superscript>"
- (match-string 1 title)
- "</superscript>"))
- "")
- t t title)))
- (aset org-levels-open (1- level) t)
- (setq section-number (org-section-number level))
- (insert (format "\n<section xml:id=\"%s%s\">\n<title>%s</title>"
- org-export-docbook-section-id-prefix
- (replace-regexp-in-string "\\." "_" section-number)
- title))
- (org-export-docbook-open-para))))
-
-(defun org-docbook-expand (string)
- "Prepare STRING for DocBook export.
-Applies all active conversions. If there are links in the
-string, don't modify these."
- (let* ((re (concat org-bracket-link-regexp "\\|"
- (org-re "[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$")))
- m s l res)
- (while (setq m (string-match re string))
- (setq s (substring string 0 m)
- l (match-string 0 string)
- string (substring string (match-end 0)))
- (push (org-docbook-do-expand s) res)
- (push l res))
- (push (org-docbook-do-expand string) res)
- (apply 'concat (nreverse res))))
-
-(defun org-docbook-do-expand (s)
- "Apply all active conversions to translate special ASCII to DocBook."
- (setq s (org-html-protect s))
- (while (string-match "@&lt;\\([^&]*\\)&gt;" s)
- (setq s (replace-match "<\\1>" t nil s)))
- (if org-export-with-emphasize
- (setq s (org-export-docbook-convert-emphasize s)))
- (if org-export-with-special-strings
- (setq s (org-export-docbook-convert-special-strings s)))
- (if org-export-with-sub-superscripts
- (setq s (org-export-docbook-convert-sub-super s)))
- (if org-export-with-TeX-macros
- (let ((start 0) wd rep)
- (while (setq start (string-match "\\\\\\([a-zA-Z]+\\)\\({}\\)?"
- s start))
- (if (get-text-property (match-beginning 0) 'org-protected s)
- (setq start (match-end 0))
- (setq wd (match-string 1 s))
- (if (setq rep (org-entity-get-representation wd 'html))
- (setq s (replace-match rep t t s))
- (setq start (+ start (length wd))))))))
- s)
-
-(defun org-export-docbook-format-desc (desc)
- "Make sure DESC is valid as a description in a link."
- (save-match-data
- (org-docbook-do-expand desc)))
-
-(defun org-export-docbook-convert-emphasize (string)
- "Apply emphasis for DocBook exporting."
- (let ((s 0) rpl)
- (while (string-match org-emph-re string s)
- (if (not (equal
- (substring string (match-beginning 3) (1+ (match-beginning 3)))
- (substring string (match-beginning 4) (1+ (match-beginning 4)))))
- (setq s (match-beginning 0)
- rpl
- (concat
- (match-string 1 string)
- (nth 1 (assoc (match-string 3 string)
- org-export-docbook-emphasis-alist))
- (match-string 4 string)
- (nth 2 (assoc (match-string 3 string)
- org-export-docbook-emphasis-alist))
- (match-string 5 string))
- string (replace-match rpl t t string)
- s (+ s (- (length rpl) 2)))
- (setq s (1+ s))))
- string))
-
-(defun org-docbook-protect (string)
- (org-html-protect string))
-
-;; For now, simply return string as it is.
-(defun org-export-docbook-convert-special-strings (string)
- "Convert special characters in STRING to DocBook."
- string)
-
-(defun org-export-docbook-get-footnotes (lines)
- "Given a list of LINES, return a list of alist footnotes."
- (let ((list nil) line)
- (while (setq line (pop lines))
- (if (string-match "^[ \t]*\\[\\([0-9]+\\)\\] \\(.+\\)" line)
- (push (cons (match-string 1 line) (match-string 2 line))
- list)))
- list))
-
-(defun org-export-docbook-format-image (src)
- "Create image element in DocBook."
- (save-match-data
- (let* ((caption (org-find-text-property-in-string 'org-caption src))
- (attr (or (org-find-text-property-in-string 'org-attributes src)
- ""))
- (label (org-find-text-property-in-string 'org-label src))
- (default-attr org-export-docbook-default-image-attributes)
- tmp)
- (setq caption (and caption (org-html-do-expand caption)))
- (while (setq tmp (pop default-attr))
- (if (not (string-match (concat (car tmp) "=") attr))
- (setq attr (concat attr " " (car tmp) "=" (cdr tmp)))))
- (format "<mediaobject%s>
-<imageobject>\n<imagedata fileref=\"%s\" %s/>\n</imageobject>
-%s</mediaobject>"
- (if label (concat " xml:id=\"" label "\"") "")
- src attr
- (if caption
- (concat "<caption>\n<para>"
- caption
- "</para>\n</caption>\n")
- "")
- ))))
-
-(defun org-export-docbook-preprocess (parameters)
- "Extra preprocessing work for DocBook export."
- ;; Merge lines starting with "\par" to one line. Such lines are
- ;; regarded as the continuation of a long footnote.
- (goto-char (point-min))
- (while (re-search-forward "\n\\(\\\\par\\>\\)" nil t)
- (if (not (get-text-property (match-beginning 1) 'org-protected))
- (replace-match ""))))
-
-(defun org-export-docbook-finalize-table (table)
- "Clean up TABLE and turn it into DocBook format.
-This function adds a label to the table if it is available, and
-also changes TABLE to informaltable if caption does not exist.
-TABLE is a string containing the HTML code generated by
-`org-format-table-html' for a table in Org-mode buffer."
- (let (table-with-label)
- ;; Get the label if it exists, and move it into the <table> element.
- (setq table-with-label
- (if (string-match
- "^<table \\(\\(.\\|\n\\)+\\)<a name=\"\\(.+\\)\" id=\".+\"></a>\n\\(\\(.\\|\n\\)+\\)</table>"
- table)
- (replace-match (concat "<table xml:id=\"" (match-string 3 table) "\" "
- (match-string 1 table)
- (match-string 4 table)
- "</table>")
- nil nil table)
- table))
- ;; Change <table> into <informaltable> if caption does not exist.
- (if (string-match
- "^<table \\(\\(.\\|\n\\)+\\)<caption></caption>\n\\(\\(.\\|\n\\)+\\)</table>"
- table-with-label)
- (replace-match (concat "<informaltable "
- (match-string 1 table-with-label)
- (match-string 3 table-with-label)
- "</informaltable>")
- nil nil table-with-label)
- table-with-label)))
-
-;; Note: This function is very similar to
-;; org-export-html-convert-sub-super. They can be merged in the future.
-(defun org-export-docbook-convert-sub-super (string)
- "Convert sub- and superscripts in STRING for DocBook."
- (let (key c (s 0) (requireb (eq org-export-with-sub-superscripts '{})))
- (while (string-match org-match-substring-regexp string s)
- (cond
- ((and requireb (match-end 8)) (setq s (match-end 2)))
- ((get-text-property (match-beginning 2) 'org-protected string)
- (setq s (match-end 2)))
- (t
- (setq s (match-end 1)
- key (if (string= (match-string 2 string) "_")
- "subscript"
- "superscript")
- c (or (match-string 8 string)
- (match-string 6 string)
- (match-string 5 string))
- string (replace-match
- (concat (match-string 1 string)
- "<" key ">" c "</" key ">")
- t t string)))))
- (while (string-match "\\\\\\([_^]\\)" string)
- (setq string (replace-match (match-string 1 string) t t string)))
- string))
-
-(defun org-export-docbook-protect-tags (string)
- "Change ``<...>'' in string STRING into ``@<...>''.
-This is normally needed when STRING contains DocBook elements
-that need to be preserved in later phase of DocBook exporting."
- (let ((start 0))
- (while (string-match "<\\([^>]*\\)>" string start)
- (setq string (replace-match
- "@<\\1>" t nil string)
- start (match-end 0)))
- string))
-
-(defun org-export-docbook-handle-time-stamps (line)
- "Format time stamps in string LINE."
- (let (replaced
- (kw-markup (org-export-docbook-protect-tags
- org-export-docbook-keywords-markup))
- (ts-markup (org-export-docbook-protect-tags
- org-export-docbook-timestamp-markup)))
- (while (string-match org-maybe-keyword-time-regexp line)
- (setq replaced
- (concat replaced
- (substring line 0 (match-beginning 0))
- (if (match-end 1)
- (format kw-markup
- (match-string 1 line)))
- " "
- (format ts-markup
- (substring (org-translate-time
- (match-string 3 line)) 1 -1)))
- line (substring line (match-end 0))))
- (concat replaced line)))
-
-(provide 'org-docbook)
-
-;; arch-tag: a24a127c-d365-4c2a-9e9b-f7dcb0ebfdc3
-;;; org-docbook.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-docbook.elc b/.emacs.d/org-7.4/lisp/org-docbook.elc
deleted file mode 100644
index 5c8c867..0000000
--- a/.emacs.d/org-7.4/lisp/org-docbook.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-docview.el b/.emacs.d/org-7.4/lisp/org-docview.el
deleted file mode 100644
index cb0f241..0000000
--- a/.emacs.d/org-7.4/lisp/org-docview.el
+++ /dev/null
@@ -1,93 +0,0 @@
-;;; org-docview.el --- support for links to doc-view-mode buffers
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Jan Böcker <jan.boecker at jboecker dot de>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file implements links to open files in doc-view-mode.
-;; Org-mode loads this module by default - if this is not what you want,
-;; configure the variable `org-modules'.
-
-;; The links take the form
-;;
-;; docview:<file path>::<page number>
-;;
-;; for example: [[docview:~/.elisp/org/doc/org.pdf::1][Org-Mode Manual]]
-;;
-;; Autocompletion for inserting links is supported; you will be
-;; prompted for a file and a page number.
-;;
-;; If you use org-store-link in a doc-view mode buffer, the stored
-;; link will point to the current page.
-
-;;; Code:
-
-
-(require 'org)
-
-(declare-function doc-view-goto-page "ext:doc-view" (page))
-(declare-function image-mode-window-get "ext:image-mode"
- (prop &optional winprops))
-
-(autoload 'doc-view-goto-page "doc-view")
-
-(org-add-link-type "docview" 'org-docview-open)
-(add-hook 'org-store-link-functions 'org-docview-store-link)
-
-(defun org-docview-open (link)
- (when (string-match "\\(.*\\)::\\([0-9]+\\)$" link)
- (let* ((path (match-string 1 link))
- (page (string-to-number (match-string 2 link))))
- (org-open-file path 1) ;; let org-mode open the file (in-emacs = 1)
- ;; to ensure org-link-frame-setup is respected
- (doc-view-goto-page page)
- )))
-
-(defun org-docview-store-link ()
- "Store a link to a docview buffer."
- (when (eq major-mode 'doc-view-mode)
- ;; This buffer is in doc-view-mode
- (let* ((path buffer-file-name)
- (page (image-mode-window-get 'page))
- (link (concat "docview:" path "::" (number-to-string page)))
- (description ""))
- (org-store-link-props
- :type "docview"
- :link link
- :description path))))
-
-(defun org-docview-complete-link ()
- "Use the existing file name completion for file.
-Links to get the file name, then ask the user for the page number
-and append it."
- (concat (replace-regexp-in-string "^file:" "docview:" (org-file-complete-link))
- "::"
- (read-from-minibuffer "Page:" "1")))
-
-
-(provide 'org-docview)
-
-;; arch-tag: dd147a78-cce1-481b-b40a-15869417debe
-
-;;; org-docview.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-docview.elc b/.emacs.d/org-7.4/lisp/org-docview.elc
deleted file mode 100644
index e51e7fb..0000000
--- a/.emacs.d/org-7.4/lisp/org-docview.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-entities.el b/.emacs.d/org-7.4/lisp/org-entities.el
deleted file mode 100644
index 1c99b9e..0000000
--- a/.emacs.d/org-7.4/lisp/org-entities.el
+++ /dev/null
@@ -1,573 +0,0 @@
-;;; org-entities.el --- Support for special entities in Org-mode
-
-;; Copyright (C) 2010 Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>,
-;; Ulf Stegemann <ulf at zeitform dot de>
-;; Keywords: outlines, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;;; Code:
-
-(require 'org-macs)
-
-(declare-function org-table-align "org-table" ())
-
-(eval-when-compile
- (require 'cl))
-
-(defgroup org-entities nil
- "Options concerning entities in Org-mode."
- :tag "Org Entities"
- :group 'org)
-
-(defcustom org-entities-ascii-explanatory nil
- "Non-nil means replace special entities in ASCII.
-For example, this will replace \"\\nsup\" with \"[not a superset of]\"
-in backends where the corresponding character is not available."
- :group 'org-entities
- :type 'boolean)
-
-(defcustom org-entities-user nil
- "User-defined entities used in Org-mode to produce special characters.
-Each entry in this list is a list of strings. It associates the name
-of the entity that can be inserted into an Org file as \\name with the
-appropriate replacements for the different export backends. The order
-of the fields is the following
-
-name As a string, without the leading backslash
-LaTeX replacement In ready LaTeX, no further processing will take place
-LaTeX mathp A Boolean, either t or nil. t if this entity needs
- to be in math mode.
-HTML replacement In ready HTML, no further processing will take place.
- Usually this will be an &...; entity.
-ASCII replacement Plain ASCII, no extensions. Symbols that cannot be
- represented will be left as they are, but see the.
- variable `org-entities-ascii-explanatory'.
-Latin1 replacement Use the special characters available in latin1.
-utf-8 replacement Use the special characters available in utf-8.
-
-If you define new entities here that require specific LaTeX packages to be
-loaded, add these packages to `org-export-latex-packages-alist'."
- :group 'org-entities
- :type '(repeat
- (list
- (string :tag "name ")
- (string :tag "LaTeX ")
- (boolean :tag "Require LaTeX math?")
- (string :tag "HTML ")
- (string :tag "ASCII ")
- (string :tag "Latin1")
- (string :tag "utf-8 "))))
-
-(defconst org-entities
- '(
- "* Letters"
- "** Latin"
- ("Agrave" "\\`{A}" nil "&Agrave;" "A" "À" "À")
- ("agrave" "\\`{a}" nil "&agrave;" "a" "à" "à")
- ("Aacute" "\\'{A}" nil "&Aacute;" "A" "Ã" "Ã")
- ("aacute" "\\'{a}" nil "&aacute;" "a" "á" "á")
- ("Acirc" "\\^{A}" nil "&Acirc;" "A" "Â" "Â")
- ("acirc" "\\^{a}" nil "&acirc;" "a" "â" "â")
- ("Atilde" "\\~{A}" nil "&Atilde;" "A" "Ã" "Ã")
- ("atilde" "\\~{a}" nil "&atilde;" "a" "ã" "ã")
- ("Auml" "\\\"{A}" nil "&Auml;" "Ae" "Ä" "Ä")
- ("auml" "\\\"{a}" nil "&auml;" "ae" "ä" "ä")
- ("Aring" "\\AA{}" nil "&Aring;" "A" "Ã…" "Ã…")
- ("AA" "\\AA{}" nil "&Aring;" "A" "Ã…" "Ã…")
- ("aring" "\\aa{}" nil "&aring;" "a" "Ã¥" "Ã¥")
- ("AElig" "\\AE{}" nil "&AElig;" "AE" "Æ" "Æ")
- ("aelig" "\\ae{}" nil "&aelig;" "ae" "æ" "æ")
- ("Ccedil" "\\c{C}" nil "&Ccedil;" "C" "Ç" "Ç")
- ("ccedil" "\\c{c}" nil "&ccedil;" "c" "ç" "ç")
- ("Egrave" "\\`{E}" nil "&Egrave;" "E" "È" "È")
- ("egrave" "\\`{e}" nil "&egrave;" "e" "è" "è")
- ("Eacute" "\\'{E}" nil "&Eacute;" "E" "É" "É")
- ("eacute" "\\'{e}" nil "&eacute;" "e" "é" "é")
- ("Ecirc" "\\^{E}" nil "&Ecirc;" "E" "Ê" "Ê")
- ("ecirc" "\\^{e}" nil "&ecirc;" "e" "ê" "ê")
- ("Euml" "\\\"{E}" nil "&Euml;" "E" "Ë" "Ë")
- ("euml" "\\\"{e}" nil "&euml;" "e" "ë" "ë")
- ("Igrave" "\\`{I}" nil "&Igrave;" "I" "Ì" "Ì")
- ("igrave" "\\`{i}" nil "&igrave;" "i" "ì" "ì")
- ("Iacute" "\\'{I}" nil "&Iacute;" "I" "Ã" "Ã")
- ("iacute" "\\'{i}" nil "&iacute;" "i" "í" "í")
- ("Icirc" "\\^{I}" nil "&Icirc;" "I" "ÃŽ" "ÃŽ")
- ("icirc" "\\^{i}" nil "&icirc;" "i" "î" "î")
- ("Iuml" "\\\"{I}" nil "&Iuml;" "I" "Ã" "Ã")
- ("iuml" "\\\"{i}" nil "&iuml;" "i" "ï" "ï")
- ("Ntilde" "\\~{N}" nil "&Ntilde;" "N" "Ñ" "Ñ")
- ("ntilde" "\\~{n}" nil "&ntilde;" "n" "ñ" "ñ")
- ("Ograve" "\\`{O}" nil "&Ograve;" "O" "Ã’" "Ã’")
- ("ograve" "\\`{o}" nil "&ograve;" "o" "ò" "ò")
- ("Oacute" "\\'{O}" nil "&Oacute;" "O" "Ó" "Ó")
- ("oacute" "\\'{o}" nil "&oacute;" "o" "ó" "ó")
- ("Ocirc" "\\^{O}" nil "&Ocirc;" "O" "Ô" "Ô")
- ("ocirc" "\\^{o}" nil "&ocirc;" "o" "ô" "ô")
- ("Otilde" "\\~{O}" nil "&Otilde;" "O" "Õ" "Õ")
- ("otilde" "\\~{o}" nil "&otilde;" "o" "õ" "õ")
- ("Ouml" "\\\"{O}" nil "&Ouml;" "Oe" "Ö" "Ö")
- ("ouml" "\\\"{o}" nil "&ouml;" "oe" "ö" "ö")
- ("Oslash" "\\O" nil "&Oslash;" "O" "Ø" "Ø")
- ("oslash" "\\o{}" nil "&oslash;" "o" "ø" "ø")
- ("OElig" "\\OE{}" nil "&OElig;" "OE" "OE" "Å’")
- ("oelig" "\\oe{}" nil "&oelig;" "oe" "oe" "Å“")
- ("Scaron" "\\v{S}" nil "&Scaron;" "S" "S" "Å ")
- ("scaron" "\\v{s}" nil "&scaron;" "s" "s" "Å¡")
- ("szlig" "\\ss{}" nil "&szlig;" "ss" "ß" "ß")
- ("Ugrave" "\\`{U}" nil "&Ugrave;" "U" "Ù" "Ù")
- ("ugrave" "\\`{u}" nil "&ugrave;" "u" "ù" "ù")
- ("Uacute" "\\'{U}" nil "&Uacute;" "U" "Ú" "Ú")
- ("uacute" "\\'{u}" nil "&uacute;" "u" "ú" "ú")
- ("Ucirc" "\\^{U}" nil "&Ucirc;" "U" "Û" "Û")
- ("ucirc" "\\^{u}" nil "&ucirc;" "u" "û" "û")
- ("Uuml" "\\\"{U}" nil "&Uuml;" "Ue" "Ü" "Ü")
- ("uuml" "\\\"{u}" nil "&uuml;" "ue" "ü" "ü")
- ("Yacute" "\\'{Y}" nil "&Yacute;" "Y" "Ã" "Ã")
- ("yacute" "\\'{y}" nil "&yacute;" "y" "ý" "ý")
- ("Yuml" "\\\"{Y}" nil "&Yuml;" "Y" "Y" "Ÿ")
- ("yuml" "\\\"{y}" nil "&yuml;" "y" "ÿ" "ÿ")
-
- "** Latin (special face)"
- ("fnof" "\\textit{f}" nil "&fnof;" "f" "f" "Æ’")
- ("real" "\\Re" t "&real;" "R" "R" "ℜ")
- ("image" "\\Im" t "&image;" "I" "I" "â„‘")
- ("weierp" "\\wp" t "&weierp;" "P" "P" "℘")
-
- "** Greek"
- ("Alpha" "A" nil "&Alpha;" "Alpha" "Alpha" "Α")
- ("alpha" "\\alpha" t "&alpha;" "alpha" "alpha" "α")
- ("Beta" "B" nil "&Beta;" "Beta" "Beta" "Î’")
- ("beta" "\\beta" t "&beta;" "beta" "beta" "β")
- ("Gamma" "\\Gamma" t "&Gamma;" "Gamma" "Gamma" "Γ")
- ("gamma" "\\gamma" t "&gamma;" "gamma" "gamma" "γ")
- ("Delta" "\\Delta" t "&Delta;" "Delta" "Gamma" "Δ")
- ("delta" "\\delta" t "&delta;" "delta" "delta" "δ")
- ("Epsilon" "E" nil "&Epsilon;" "Epsilon" "Epsilon" "Ε")
- ("epsilon" "\\epsilon" t "&epsilon;" "epsilon" "epsilon" "ε")
- ("varepsilon" "\\varepsilon" t "&epsilon;" "varepsilon" "varepsilon" "ε")
- ("Zeta" "Z" nil "&Zeta;" "Zeta" "Zeta" "Ζ")
- ("zeta" "\\zeta" t "&zeta;" "zeta" "zeta" "ζ")
- ("Eta" "H" nil "&Eta;" "Eta" "Eta" "Η")
- ("eta" "\\eta" t "&eta;" "eta" "eta" "η")
- ("Theta" "\\Theta" t "&Theta;" "Theta" "Theta" "Θ")
- ("theta" "\\theta" t "&theta;" "theta" "theta" "θ")
- ("thetasym" "\\vartheta" t "&thetasym;" "theta" "theta" "Ï‘")
- ("vartheta" "\\vartheta" t "&thetasym;" "theta" "theta" "Ï‘")
- ("Iota" "I" nil "&Iota;" "Iota" "Iota" "Ι")
- ("iota" "\\iota" t "&iota;" "iota" "iota" "ι")
- ("Kappa" "K" nil "&Kappa;" "Kappa" "Kappa" "Κ")
- ("kappa" "\\kappa" t "&kappa;" "kappa" "kappa" "κ")
- ("Lambda" "\\Lambda" t "&Lambda;" "Lambda" "Lambda" "Λ")
- ("lambda" "\\lambda" t "&lambda;" "lambda" "lambda" "λ")
- ("Mu" "M" nil "&Mu;" "Mu" "Mu" "Μ")
- ("mu" "\\mu" t "&mu;" "mu" "mu" "μ")
- ("nu" "\\nu" t "&nu;" "nu" "nu" "ν")
- ("Nu" "N" nil "&Nu;" "Nu" "Nu" "Î")
- ("Xi" "\\Xi" t "&Xi;" "Xi" "Xi" "Ξ")
- ("xi" "\\xi" t "&xi;" "xi" "xi" "ξ")
- ("Omicron" "O" nil "&Omicron;" "Omicron" "Omicron" "Ο")
- ("omicron" "\\textit{o}" nil "&omicron;" "omicron" "omicron" "ο")
- ("Pi" "\\Pi" t "&Pi;" "Pi" "Pi" "Π")
- ("pi" "\\pi" t "&pi;" "pi" "pi" "Ï€")
- ("Rho" "P" nil "&Rho;" "Rho" "Rho" "Ρ")
- ("rho" "\\rho" t "&rho;" "rho" "rho" "Ï")
- ("Sigma" "\\Sigma" t "&Sigma;" "Sigma" "Sigma" "Σ")
- ("sigma" "\\sigma" t "&sigma;" "sigma" "sigma" "σ")
- ("sigmaf" "\\varsigma" t "&sigmaf;" "sigmaf" "sigmaf" "Ï‚")
- ("varsigma" "\\varsigma" t "&sigmaf;" "varsigma" "varsigma" "Ï‚")
- ("Tau" "T" nil "&Tau;" "Tau" "Tau" "Τ")
- ("Upsilon" "\\Upsilon" t "&Upsilon;" "Upsilon" "Upsilon" "Î¥")
- ("upsih" "\\Upsilon" t "&upsih;" "upsilon" "upsilon" "Ï’")
- ("upsilon" "\\upsilon" t "&upsilon;" "upsilon" "upsilon" "Ï…")
- ("Phi" "\\Phi" t "&Phi;" "Phi" "Phi" "Φ")
- ("phi" "\\phi" t "&phi;" "phi" "phi" "φ")
- ("Chi" "X" nil "&Chi;" "Chi" "Chi" "Χ")
- ("chi" "\\chi" t "&chi;" "chi" "chi" "χ")
- ("acutex" "\\acute x" t "&acute;x" "'x" "'x" "ð‘¥Ì")
- ("Psi" "\\Psi" t "&Psi;" "Psi" "Psi" "Ψ")
- ("psi" "\\psi" t "&psi;" "psi" "psi" "ψ")
- ("tau" "\\tau" t "&tau;" "tau" "tau" "Ï„")
- ("Omega" "\\Omega" t "&Omega;" "Omega" "Omega" "Ω")
- ("omega" "\\omega" t "&omega;" "omega" "omega" "ω")
- ("piv" "\\varpi" t "&piv;" "omega-pi" "omega-pi" "Ï–")
- ("partial" "\\partial" t "&part;" "[partial differential]" "[partial differential]" "∂")
-
- "** Hebrew"
- ("alefsym" "\\aleph" t "&alefsym;" "aleph" "aleph" "ℵ")
-
- "** Dead languages"
- ("ETH" "\\DH{}" nil "&ETH;" "D" "Ã" "Ã")
- ("eth" "\\dh{}" nil "&eth;" "dh" "ð" "ð")
- ("THORN" "\\TH{}" nil "&THORN;" "TH" "Þ" "Þ")
- ("thorn" "\\th{}" nil "&thorn;" "th" "þ" "þ")
-
- "* Punctuation"
- "** Dots and Marks"
- ("dots" "\\dots{}" nil "&hellip;" "..." "..." "…")
- ("hellip" "\\dots{}" nil "&hellip;" "..." "..." "…")
- ("middot" "\\textperiodcentered{}" nil "&middot;" "." "·" "·")
- ("iexcl" "!`" nil "&iexcl;" "!" "¡" "¡")
- ("iquest" "?`" nil "&iquest;" "?" "¿" "¿")
-
- "** Dash-like"
- ("shy" "\\-" nil "&shy;" "" "" "")
- ("ndash" "--" nil "&ndash;" "-" "-" "–")
- ("mdash" "---" nil "&mdash;" "--" "--" "—")
-
- "** Quotations"
- ("quot" "\\textquotedbl{}" nil "&quot;" "\"" "\"" "\"")
- ("acute" "\\textasciiacute{}" nil "&acute;" "'" "´" "´")
- ("ldquo" "\\textquotedblleft{}" nil "&ldquo;" "\"" "\"" "“")
- ("rdquo" "\\textquotedblright{}" nil "&rdquo;" "\"" "\"" "â€")
- ("bdquo" "\\quotedblbase{}" nil "&bdquo;" "\"" "\"" "„")
- ("lsquo" "\\textquoteleft{}" nil "&lsquo;" "`" "`" "‘")
- ("rsquo" "\\textquoteright{}" nil "&rsquo;" "'" "'" "’")
- ("sbquo" "\\quotesinglbase{}" nil "&sbquo;" "," "," "‚")
- ("laquo" "\\guillemotleft{}" nil "&laquo;" "<<" "«" "«")
- ("raquo" "\\guillemotright{}" nil "&raquo;" ">>" "»" "»")
- ("lsaquo" "\\guilsinglleft{}" nil "&lsaquo;" "<" "<" "‹")
- ("rsaquo" "\\guilsinglright{}" nil "&rsaquo;" ">" ">" "›")
-
- "* Other"
- "** Misc. (often used)"
- ("circ" "\\circ" t "&circ;" "^" "^" "ˆ")
- ("vert" "\\vert{}" t "&#124;" "|" "|" "|")
- ("brvbar" "\\textbrokenbar{}" nil "&brvbar;" "|" "¦" "¦")
- ("sect" "\\S" nil "&sect;" "paragraph" "§" "§")
- ("amp" "\\&" nil "&amp;" "&" "&" "&")
- ("lt" "\\textless{}" nil "&lt;" "<" "<" "<")
- ("gt" "\\textgreater{}" nil "&gt;" ">" ">" ">")
- ("tilde" "\\~{}" nil "&tilde;" "~" "~" "~")
- ("dagger" "\\textdagger{}" nil "&dagger;" "[dagger]" "[dagger]" "†")
- ("Dagger" "\\textdaggerdbl{}" nil "&Dagger;" "[doubledagger]" "[doubledagger]" "‡")
-
- "** Whitespace"
- ("nbsp" "~" nil "&nbsp;" " " " " " ")
- ("ensp" "\\hspace*{.5em}" nil "&ensp;" " " " " " ")
- ("emsp" "\\hspace*{1em}" nil "&emsp;" " " " " " ")
- ("thinsp" "\\hspace*{.2em}" nil "&thinsp;" " " " " " ")
-
- "** Currency"
- ("curren" "\\textcurrency{}" nil "&curren;" "curr." "¤" "¤")
- ("cent" "\\textcent{}" nil "&cent;" "cent" "¢" "¢")
- ("pound" "\\pounds{}" nil "&pound;" "pound" "£" "£")
- ("yen" "\\textyen{}" nil "&yen;" "yen" "Â¥" "Â¥")
- ("euro" "\\texteuro{}" nil "&euro;" "EUR" "EUR" "€")
- ("EUR" "\\EUR{}" nil "&euro;" "EUR" "EUR" "€")
- ("EURdig" "\\EURdig{}" nil "&euro;" "EUR" "EUR" "€")
- ("EURhv" "\\EURhv{}" nil "&euro;" "EUR" "EUR" "€")
- ("EURcr" "\\EURcr{}" nil "&euro;" "EUR" "EUR" "€")
- ("EURtm" "\\EURtm{}" nil "&euro;" "EUR" "EUR" "€")
-
- "** Property Marks"
- ("copy" "\\textcopyright{}" nil "&copy;" "(c)" "©" "©")
- ("reg" "\\textregistered{}" nil "&reg;" "(r)" "®" "®")
- ("trade" "\\texttrademark{}" nil "&trade;" "TM" "TM" "â„¢")
-
- "** Science et al."
- ("minus" "\\minus" t "&minus;" "-" "-" "−")
- ("pm" "\\textpm{}" nil "&plusmn;" "+-" "±" "±")
- ("plusmn" "\\textpm{}" nil "&plusmn;" "+-" "±" "±")
- ("times" "\\texttimes{}" nil "&times;" "*" "×" "×")
- ("frasl" "/" nil "&frasl;" "/" "/" "â„")
- ("div" "\\textdiv{}" nil "&divide;" "/" "÷" "÷")
- ("frac12" "\\textonehalf{}" nil "&frac12;" "1/2" "½" "½")
- ("frac14" "\\textonequarter{}" nil "&frac14;" "1/4" "¼" "¼")
- ("frac34" "\\textthreequarters{}" nil "&frac34;" "3/4" "¾" "¾")
- ("permil" "\\textperthousand{}" nil "&permil;" "per thousand" "per thousand" "‰")
- ("sup1" "\\textonesuperior{}" nil "&sup1;" "^1" "¹" "¹")
- ("sup2" "\\texttwosuperior{}" nil "&sup2;" "^2" "²" "²")
- ("sup3" "\\textthreesuperior{}" nil "&sup3;" "^3" "³" "³")
- ("radic" "\\sqrt{\\,}" t "&radic;" "[square root]" "[square root]" "√")
- ("sum" "\\sum" t "&sum;" "[sum]" "[sum]" "∑")
- ("prod" "\\prod" t "&prod;" "[product]" "[n-ary product]" "âˆ")
- ("micro" "\\textmu{}" nil "&micro;" "micro" "µ" "µ")
- ("macr" "\\textasciimacron{}" nil "&macr;" "[macron]" "¯" "¯")
- ("deg" "\\textdegree{}" nil "deg" "degree" "°" "°")
- ("prime" "\\prime" t "&prime;" "'" "'" "′")
- ("Prime" "\\prime{}\\prime" t "&Prime;" "''" "''" "″")
- ("infin" "\\propto" t "&infin;" "[infinity]" "[infinity]" "∞")
- ("infty" "\\infty" t "&infin;" "[infinity]" "[infinity]" "∞")
- ("prop" "\\propto" t "&prop;" "[proportional to]" "[proportional to]" "âˆ")
- ("proptp" "\\propto" t "&prop;" "[proportional to]" "[proportional to]" "âˆ")
- ("not" "\\textlnot{}" nil "&not;" "[angled dash]" "¬" "¬")
- ("land" "\\land" t "&and;" "[logical and]" "[logical and]" "∧")
- ("wedge" "\\wedge" t "&and;" "[logical and]" "[logical and]" "∧")
- ("lor" "\\lor" t "&or;" "[logical or]" "[logical or]" "∨")
- ("vee" "\\vee" t "&or;" "[logical or]" "[logical or]" "∨")
- ("cap" "\\cap" t "&cap;" "[intersection]" "[intersection]" "∩")
- ("cup" "\\cup" t "&cup;" "[union]" "[union]" "∪")
- ("int" "\\int" t "&int;" "[integral]" "[integral]" "∫")
- ("there4" "\\therefore" t "&there4;" "[therefore]" "[therefore]" "∴")
- ("sim" "\\sim" t "&sim;" "~" "~" "∼")
- ("cong" "\\cong" t "&cong;" "[approx. equal to]" "[approx. equal to]" "≅")
- ("simeq" "\\simeq" t "&cong;" "[approx. equal to]" "[approx. equal to]" "≅")
- ("asymp" "\\asymp" t "&asymp;" "[almost equal to]" "[almost equal to]" "≈")
- ("approx" "\\approx" t "&asymp;" "[almost equal to]" "[almost equal to]" "≈")
- ("ne" "\\ne" t "&ne;" "[not equal to]" "[not equal to]" "≠")
- ("neq" "\\neq" t "&ne;" "[not equal to]" "[not equal to]" "≠")
- ("equiv" "\\equiv" t "&equiv;" "[identical to]" "[identical to]" "≡")
- ("le" "\\le" t "&le;" "<=" "<=" "≤")
- ("ge" "\\ge" t "&ge;" ">=" ">=" "≥")
- ("sub" "\\subset" t "&sub;" "[subset of]" "[subset of]" "⊂")
- ("subset" "\\subset" t "&sub;" "[subset of]" "[subset of]" "⊂")
- ("sup" "\\supset" t "&sup;" "[superset of]" "[superset of]" "⊃")
- ("supset" "\\supset" t "&sup;" "[superset of]" "[superset of]" "⊃")
- ("nsub" "\\not\\subset" t "&nsub;" "[not a subset of]" "[not a subset of" "⊄")
- ("sube" "\\subseteq" t "&sube;" "[subset of or equal to]" "[subset of or equal to]" "⊆")
- ("nsup" "\\not\\supset" t "&nsup;" "[not a superset of]" "[not a superset of]" "⊅")
- ("supe" "\\supseteq" t "&supe;" "[superset of or equal to]" "[superset of or equal to]" "⊇")
- ("forall" "\\forall" t "&forall;" "[for all]" "[for all]" "∀")
- ("exist" "\\exists" t "&exist;" "[there exists]" "[there exists]" "∃")
- ("exists" "\\exists" t "&exist;" "[there exists]" "[there exists]" "∃")
- ("empty" "\\empty" t "&empty;" "[empty set]" "[empty set]" "∅")
- ("emptyset" "\\emptyset" t "&empty;" "[empty set]" "[empty set]" "∅")
- ("isin" "\\in" t "&isin;" "[element of]" "[element of]" "∈")
- ("in" "\\in" t "&isin;" "[element of]" "[element of]" "∈")
- ("notin" "\\notin" t "&notin;" "[not an element of]" "[not an element of]" "∉")
- ("ni" "\\ni" t "&ni;" "[contains as member]" "[contains as member]" "∋")
- ("nabla" "\\nabla" t "&nabla;" "[nabla]" "[nabla]" "∇")
- ("ang" "\\angle" t "&ang;" "[angle]" "[angle]" "∠")
- ("angle" "\\angle" t "&ang;" "[angle]" "[angle]" "∠")
- ("perp" "\\perp" t "&perp;" "[up tack]" "[up tack]" "⊥")
- ("sdot" "\\cdot" t "&sdot;" "[dot]" "[dot]" "â‹…")
- ("cdot" "\\cdot" t "&sdot;" "[dot]" "[dot]" "â‹…")
- ("lceil" "\\lceil" t "&lceil;" "[left ceiling]" "[left ceiling]" "⌈")
- ("rceil" "\\rceil" t "&rceil;" "[right ceiling]" "[right ceiling]" "⌉")
- ("lfloor" "\\lfloor" t "&lfloor;" "[left floor]" "[left floor]" "⌊")
- ("rfloor" "\\rfloor" t "&rfloor;" "[right floor]" "[right floor]" "⌋")
- ("lang" "\\langle" t "&lang;" "<" "<" "⟨")
- ("rang" "\\rangle" t "&rang;" ">" ">" "⟩")
-
- "** Arrows"
- ("larr" "\\leftarrow" t "&larr;" "<-" "<-" "â†")
- ("leftarrow" "\\leftarrow" t "&larr;" "<-" "<-" "â†")
- ("gets" "\\gets" t "&larr;" "<-" "<-" "â†")
- ("lArr" "\\Leftarrow" t "&lArr;" "<=" "<=" "â‡")
- ("Leftarrow" "\\Leftarrow" t "&lArr;" "<=" "<=" "â‡")
- ("uarr" "\\uparrow" t "&uarr;" "[uparrow]" "[uparrow]" "↑")
- ("uparrow" "\\uparrow" t "&uarr;" "[uparrow]" "[uparrow]" "↑")
- ("uArr" "\\Uparrow" t "&uArr;" "[dbluparrow]" "[dbluparrow]" "⇑")
- ("Uparrow" "\\Uparrow" t "&uArr;" "[dbluparrow]" "[dbluparrow]" "⇑")
- ("rarr" "\\rightarrow" t "&rarr;" "->" "->" "→")
- ("to" "\\to" t "&rarr;" "->" "->" "→")
- ("rightarrow" "\\rightarrow" t "&rarr;" "->" "->" "→")
- ("rArr" "\\Rightarrow" t "&rArr;" "=>" "=>" "⇒")
- ("Rightarrow" "\\Rightarrow" t "&rArr;" "=>" "=>" "⇒")
- ("darr" "\\downarrow" t "&darr;" "[downarrow]" "[downarrow]" "↓")
- ("downarrow" "\\downarrow" t "&darr;" "[downarrow]" "[downarrow]" "↓")
- ("dArr" "\\Downarrow" t "&dArr;" "[dbldownarrow]" "[dbldownarrow]" "⇓")
- ("Downarrow" "\\Downarrow" t "&dArr;" "[dbldownarrow]" "[dbldownarrow]" "⇓")
- ("harr" "\\leftrightarrow" t "&harr;" "<->" "<->" "↔")
- ("leftrightarrow" "\\leftrightarrow" t "&harr;" "<->" "<->" "↔")
- ("hArr" "\\Leftrightarrow" t "&hArr;" "<=>" "<=>" "⇔")
- ("Leftrightarrow" "\\Leftrightarrow" t "&hArr;" "<=>" "<=>" "⇔")
- ("crarr" "\\hookleftarrow" t "&crarr;" "<-'" "<-'" "↵")
- ("hookleftarrow" "\\hookleftarrow" t "&crarr;" "<-'" "<-'" "↵")
-
- "** Function names"
- ("arccos" "\\arccos" t "arccos" "arccos" "arccos" "arccos")
- ("arcsin" "\\arcsin" t "arcsin" "arcsin" "arcsin" "arcsin")
- ("arctan" "\\arctan" t "arctan" "arctan" "arctan" "arctan")
- ("arg" "\\arg" t "arg" "arg" "arg" "arg")
- ("cos" "\\cos" t "cos" "cos" "cos" "cos")
- ("cosh" "\\cosh" t "cosh" "cosh" "cosh" "cosh")
- ("cot" "\\cot" t "cot" "cot" "cot" "cot")
- ("coth" "\\coth" t "coth" "coth" "coth" "coth")
- ("csc" "\\csc" t "csc" "csc" "csc" "csc")
- ("deg" "\\deg" t "&deg;" "deg" "deg" "deg")
- ("det" "\\det" t "det" "det" "det" "det")
- ("dim" "\\dim" t "dim" "dim" "dim" "dim")
- ("exp" "\\exp" t "exp" "exp" "exp" "exp")
- ("gcd" "\\gcd" t "gcd" "gcd" "gcd" "gcd")
- ("hom" "\\hom" t "hom" "hom" "hom" "hom")
- ("inf" "\\inf" t "inf" "inf" "inf" "inf")
- ("ker" "\\ker" t "ker" "ker" "ker" "ker")
- ("lg" "\\lg" t "lg" "lg" "lg" "lg")
- ("lim" "\\lim" t "lim" "lim" "lim" "lim")
- ("liminf" "\\liminf" t "liminf" "liminf" "liminf" "liminf")
- ("limsup" "\\limsup" t "limsup" "limsup" "limsup" "limsup")
- ("ln" "\\ln" t "ln" "ln" "ln" "ln")
- ("log" "\\log" t "log" "log" "log" "log")
- ("max" "\\max" t "max" "max" "max" "max")
- ("min" "\\min" t "min" "min" "min" "min")
- ("Pr" "\\Pr" t "Pr" "Pr" "Pr" "Pr")
- ("sec" "\\sec" t "sec" "sec" "sec" "sec")
- ("sin" "\\sin" t "sin" "sin" "sin" "sin")
- ("sinh" "\\sinh" t "sinh" "sinh" "sinh" "sinh")
- ("sup" "\\sup" t "&sup;" "sup" "sup" "sup")
- ("tan" "\\tan" t "tan" "tan" "tan" "tan")
- ("tanh" "\\tanh" t "tanh" "tanh" "tanh" "tanh")
-
- "** Signs & Symbols"
- ("bull" "\\textbullet{}" nil "&bull;" "*" "*" "•")
- ("bullet" "\\textbullet{}" nil "&bull;" "*" "*" "•")
- ("star" "\\star" t "*" "*" "*" "⋆")
- ("lowast" "\\ast" t "&lowast;" "*" "*" "∗")
- ("ast" "\\ast" t "&lowast;" "*" "*" "*")
- ("odot" "\\odot" t "o" "[circled dot]" "[circled dot]" "ʘ")
- ("oplus" "\\oplus" t "&oplus;" "[circled plus]" "[circled plus]" "⊕")
- ("otimes" "\\otimes" t "&otimes;" "[circled times]" "[circled times]" "⊗")
- ("checkmark" "\\checkmark" t "&#10003;" "[checkmark]" "[checkmark]" "✓")
-
- "** Miscellaneous (seldom used)"
- ("para" "\\P{}" nil "&para;" "[pilcrow]" "¶" "¶")
- ("ordf" "\\textordfeminine{}" nil "&ordf;" "_a_" "ª" "ª")
- ("ordm" "\\textordmasculine{}" nil "&ordm;" "_o_" "º" "º")
- ("cedil" "\\c{}" nil "&cedil;" "[cedilla]" "¸" "¸")
- ("oline" "\\overline{~}" t "&oline;" "[overline]" "¯" "‾")
- ("uml" "\\textasciidieresis{}" nil "&uml;" "[diaeresis]" "¨" "¨")
- ("zwnj" "\\/{}" nil "&zwnj;" "" "" "‌")
- ("zwj" "" nil "&zwj;" "" "" "â€")
- ("lrm" "" nil "&lrm;" "" "" "‎")
- ("rlm" "" nil "&rlm;" "" "" "â€")
-
- "** Smilies"
- ("smile" "\\smile" t "&#9786;" ":-)" ":-)" "⌣")
- ("smiley" "\\smiley{}" nil "&#9786;" ":-)" ":-)" "☺")
- ("blacksmile" "\\blacksmiley{}" nil "&#9787;" ":-)" ":-)" "☻")
- ("sad" "\\frownie{}" nil "&#9785;" ":-(" ":-(" "☹")
-
- "** Suits"
- ("clubs" "\\clubsuit" t "&clubs;" "[clubs]" "[clubs]" "♣")
- ("clubsuit" "\\clubsuit" t "&clubs;" "[clubs]" "[clubs]" "♣")
- ("spades" "\\spadesuit" t "&spades;" "[spades]" "[spades]" "â™ ")
- ("spadesuit" "\\spadesuit" t "&spades;" "[spades]" "[spades]" "â™ ")
- ("hearts" "\\heartsuit" t "&hearts;" "[hearts]" "[hearts]" "♥")
- ("heartsuit" "\\heartsuit" t "&heartsuit;" "[hearts]" "[hearts]" "♥")
- ("diams" "\\diamondsuit" t "&diams;" "[diamonds]" "[diamonds]" "♦")
- ("diamondsuit" "\\diamondsuit" t "&diams;" "[diamonds]" "[diamonds]" "♦")
- ("Diamond" "\\diamond" t "&diamond;" "[diamond]" "[diamond]" "â‹„")
- ("loz" "\\diamond" t "&loz;" "[lozenge]" "[lozenge]" "â—Š")
- )
- "Default entities used in Org-mode to produce special characters.
-For details see `org-entities-user'.")
-
-(defsubst org-entity-get (name)
- "Get the proper association for NAME from the entity lists.
-This first checks the user list, then the built-in list."
- (or (assoc name org-entities-user)
- (assoc name org-entities)))
-
-(defun org-entity-get-representation (name kind)
- "Get the correct representation of entity NAME for export type KIND.
-Kind can be any of `latex', `html', `ascii', `latin1', or `utf8'."
- (let* ((e (org-entity-get name))
- (n (cdr (assq kind '((latex . 1) (html . 3) (ascii . 4)
- (latin1 . 5) (utf8 . 6)))))
- (r (and e n (nth n e))))
- (if (and e r
- (not org-entities-ascii-explanatory)
- (memq kind '(ascii latin1 utf8))
- (= (string-to-char r) ?\[))
- (concat "\\" name)
- r)))
-
-(defsubst org-entity-latex-math-p (name)
- "Does entity NAME require math mode in LaTeX?"
- (nth 2 (org-entity-get name)))
-
-;; Helpfunctions to create a table for orgmode.org/worg/org-symbols.org
-
-(defun org-entities-create-table ()
- "Create an org-mode table with all entities."
- (interactive)
- (let ((ll org-entities)
- (pos (point))
- e latex mathp html latin utf8 name ascii)
- (insert "|Name|LaTeX code|LaTeX|HTML code |HTML|ASCII|Latin1|UTF-8\n|-\n")
- (while ll
- (when (listp e)
- (setq e (pop ll))
- (setq name (car e)
- latex (nth 1 e)
- mathp (nth 2 e)
- html (nth 3 e)
- ascii (nth 4 e)
- latin (nth 5 e)
- utf8 (nth 6 e))
- (if (equal ascii "|") (setq ascii "\\vert"))
- (if (equal latin "|") (setq latin "\\vert"))
- (if (equal utf8 "|") (setq utf8 "\\vert"))
- (if (equal ascii "=>") (setq ascii "= >"))
- (if (equal latin "=>") (setq latin "= >"))
- (insert "|" name
- "|" (format "=%s=" latex)
- "|" (format (if mathp "$%s$" "$\\mbox{%s}$")
- latex)
- "|" (format "=%s=" html) "|" html
- "|" ascii "|" latin "|" utf8
- "|\n")))
- (goto-char pos)
- (org-table-align)))
-
-(defun org-entities-help ()
- "Create a Help buffer with all available entities."
- (interactive)
- (with-output-to-temp-buffer "*Org Entity Help*"
- (princ "Org-mode entities\n=================\n\n")
- (let ((ll (append '("* User-defined additions (variable org-entities-user)")
- org-entities-user
- org-entities))
- e latex mathp html latin utf8 name ascii
- (lastwasstring t)
- (head (concat
- "\n"
- " Symbol Org entity LaTeX code HTML code\n"
- " -----------------------------------------------------------\n")))
- (while ll
- (setq e (pop ll))
- (if (stringp e)
- (progn
- (princ e)
- (princ "\n")
- (setq lastwasstring t))
- (if lastwasstring (princ head))
- (setq lastwasstring nil)
- (setq name (car e)
- latex (nth 1 e)
- html (nth 3 e)
- utf8 (nth 6 e))
- (princ (format " %-8s \\%-16s %-22s %-13s\n"
- utf8 name latex html))))))
- (with-current-buffer "*Org Entity Help*"
- (org-mode))
- (select-window (get-buffer-window "*Org Entity Help*")))
-
-
-(defun replace-amp ()
- "Postprocess HTML file to unescape the ampersand."
- (interactive)
- (while (re-search-forward "<td>&amp;\\([^<;]+;\\)" nil t)
- (replace-match (concat "<td>&" (match-string 1)) t t)))
-
-(provide 'org-entities)
-
-;; Local variables:
-;; coding: utf-8
-;; End:
-
-;; arch-tag: e6bd163f-7419-4009-9c93-a74623016424
-
-;;; org-entities.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-entities.elc b/.emacs.d/org-7.4/lisp/org-entities.elc
deleted file mode 100644
index cfd0609..0000000
--- a/.emacs.d/org-7.4/lisp/org-entities.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-exp-blocks.el b/.emacs.d/org-7.4/lisp/org-exp-blocks.el
deleted file mode 100644
index 57087e1..0000000
--- a/.emacs.d/org-7.4/lisp/org-exp-blocks.el
+++ /dev/null
@@ -1,356 +0,0 @@
-;;; org-exp-blocks.el --- pre-process blocks when exporting org files
-
-;; Copyright (C) 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Eric Schulte
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-;;
-;; This is a utility for pre-processing blocks in org files before
-;; export using the `org-export-preprocess-hook'. It can be used for
-;; exporting new types of blocks from org-mode files and also for
-;; changing the default export behavior of existing org-mode blocks.
-;; The `org-export-blocks' and `org-export-interblocks' variables can
-;; be used to control how blocks and the spaces between blocks
-;; respectively are processed upon export.
-;;
-;; The type of a block is defined as the string following =#+begin_=,
-;; so for example the following block would be of type ditaa. Note
-;; that both upper or lower case are allowed in =#+BEGIN_= and
-;; =#+END_=.
-;;
-;; #+begin_ditaa blue.png -r -S
-;; +---------+
-;; | cBLU |
-;; | |
-;; | +----+
-;; | |cPNK|
-;; | | |
-;; +----+----+
-;; #+end_ditaa
-;;
-;;; Currently Implemented Block Types
-;;
-;; ditaa :: Convert ascii pictures to actual images using ditaa
-;; http://ditaa.sourceforge.net/. To use this set
-;; `org-ditaa-jar-path' to the path to ditaa.jar on your
-;; system (should be set automatically in most cases) .
-;;
-;; dot :: Convert graphs defined using the dot graphing language to
-;; images using the dot utility. For information on dot see
-;; http://www.graphviz.org/
-;;
-;; comment :: Wrap comments with titles and author information, in
-;; their own divs with author-specific ids allowing for css
-;; coloring of comments based on the author.
-;;
-;;; Adding new blocks
-;;
-;; When adding a new block type first define a formatting function
-;; along the same lines as `org-export-blocks-format-dot' and then use
-;; `org-export-blocks-add-block' to add your block type to
-;; `org-export-blocks'.
-
-;;; Code:
-
-(eval-when-compile
- (require 'cl))
-(require 'org)
-
-(defvar htmlp)
-(defvar latexp)
-(defvar docbookp)
-(defvar asciip)
-
-(defun org-export-blocks-set (var value)
- "Set the value of `org-export-blocks' and install fontification."
- (set var value)
- (mapc (lambda (spec)
- (if (nth 2 spec)
- (setq org-protecting-blocks
- (delete (symbol-name (car spec))
- org-protecting-blocks))
- (add-to-list 'org-protecting-blocks
- (symbol-name (car spec)))))
- value))
-
-(defcustom org-export-blocks
- '((comment org-export-blocks-format-comment t)
- (ditaa org-export-blocks-format-ditaa nil)
- (dot org-export-blocks-format-dot nil))
- "Use this alist to associate block types with block exporting functions.
-The type of a block is determined by the text immediately
-following the '#+BEGIN_' portion of the block header. Each block
-export function should accept three arguments."
- :group 'org-export-general
- :type '(repeat
- (list
- (symbol :tag "Block name")
- (function :tag "Block formatter")
- (boolean :tag "Fontify content as Org syntax")))
- :set 'org-export-blocks-set)
-
-(defun org-export-blocks-add-block (block-spec)
- "Add a new block type to `org-export-blocks'.
-BLOCK-SPEC should be a three element list the first element of
-which should indicate the name of the block, the second element
-should be the formatting function called by
-`org-export-blocks-preprocess' and the third element a flag
-indicating whether these types of blocks should be fontified in
-org-mode buffers (see `org-protecting-blocks'). For example the
-BLOCK-SPEC for ditaa blocks is as follows.
-
- (ditaa org-export-blocks-format-ditaa nil)"
- (unless (member block-spec org-export-blocks)
- (setq org-export-blocks (cons block-spec org-export-blocks))
- (org-export-blocks-set 'org-export-blocks org-export-blocks)))
-
-(defcustom org-export-interblocks
- '()
- "Use this a-list to associate block types with block exporting functions.
-The type of a block is determined by the text immediately
-following the '#+BEGIN_' portion of the block header. Each block
-export function should accept three arguments."
- :group 'org-export-general
- :type 'alist)
-
-(defcustom org-export-blocks-witheld
- '(hidden)
- "List of block types (see `org-export-blocks') which should not be exported."
- :group 'org-export-general
- :type 'list)
-
-(defcustom org-export-blocks-postblock-hook nil
- "Run after blocks have been processed with `org-export-blocks-preprocess'."
- :group 'org-export-general
- :type 'hook)
-
-(defun org-export-blocks-html-quote (body &optional open close)
- "Protect BODY from org html export.
-The optional OPEN and CLOSE tags will be inserted around BODY."
-
- (concat
- "\n#+BEGIN_HTML\n"
- (or open "")
- body (if (string-match "\n$" body) "" "\n")
- (or close "")
- "#+END_HTML\n"))
-
-(defun org-export-blocks-latex-quote (body &optional open close)
- "Protect BODY from org latex export.
-The optional OPEN and CLOSE tags will be inserted around BODY."
- (concat
- "\n#+BEGIN_LaTeX\n"
- (or open "")
- body (if (string-match "\n$" body) "" "\n")
- (or close "")
- "#+END_LaTeX\n"))
-
-(defun org-export-blocks-preprocess ()
- "Export all blocks according to the `org-export-blocks' block export alist.
-Does not export block types specified in specified in BLOCKS
-which defaults to the value of `org-export-blocks-witheld'."
- (interactive)
- (save-window-excursion
- (let ((case-fold-search t)
- (types '())
- indentation type func start body headers preserve-indent progress-marker)
- (flet ((interblock (start end)
- (mapcar (lambda (pair) (funcall (second pair) start end))
- org-export-interblocks)))
- (goto-char (point-min))
- (setq start (point))
- (while (re-search-forward
- "^\\([ \t]*\\)#\\+begin_\\(\\S-+\\)[ \t]*\\(.*\\)?[\r\n]\\([^\000]*?\\)[\r\n][ \t]*#\\+end_\\S-+.*[\r\n]?" nil t)
- (setq indentation (length (match-string 1)))
- (setq type (intern (downcase (match-string 2))))
- (setq headers (save-match-data (org-split-string (match-string 3) "[ \t]+")))
- (setq body (match-string 4))
- (setq preserve-indent (or org-src-preserve-indentation (member "-i" headers)))
- (unless preserve-indent
- (setq body (save-match-data (org-remove-indentation body))))
- (unless (memq type types) (setq types (cons type types)))
- (save-match-data (interblock start (match-beginning 0)))
- (when (setq func (cadr (assoc type org-export-blocks)))
- (let ((replacement (save-match-data
- (if (memq type org-export-blocks-witheld) ""
- (apply func body headers)))))
- (when replacement
- (replace-match replacement t t)
- (unless preserve-indent
- (indent-code-rigidly
- (match-beginning 0) (match-end 0) indentation)))))
- (setq start (match-end 0)))
- (interblock start (point-max))
- (run-hooks 'org-export-blocks-postblock-hook)))))
-
-;;================================================================================
-;; type specific functions
-
-;;--------------------------------------------------------------------------------
-;; ditaa: create images from ASCII art using the ditaa utility
-(defvar org-ditaa-jar-path (expand-file-name
- "ditaa.jar"
- (file-name-as-directory
- (expand-file-name
- "scripts"
- (file-name-as-directory
- (expand-file-name
- "../contrib"
- (file-name-directory (or load-file-name buffer-file-name)))))))
- "Path to the ditaa jar executable.")
-
-(defun org-export-blocks-format-ditaa (body &rest headers)
- "Pass block BODY to the ditaa utility creating an image.
-Specify the path at which the image should be saved as the first
-element of headers, any additional elements of headers will be
-passed to the ditaa utility as command line arguments."
- (message "ditaa-formatting...")
- (let* ((args (if (cdr headers) (mapconcat 'identity (cdr headers) " ")))
- (data-file (make-temp-file "org-ditaa"))
- (hash (progn
- (set-text-properties 0 (length body) nil body)
- (sha1 (prin1-to-string (list body args)))))
- (raw-out-file (if headers (car headers)))
- (out-file-parts (if (string-match "\\(.+\\)\\.\\([^\\.]+\\)$" raw-out-file)
- (cons (match-string 1 raw-out-file)
- (match-string 2 raw-out-file))
- (cons raw-out-file "png")))
- (out-file (concat (car out-file-parts) "_" hash "." (cdr out-file-parts))))
- (unless (file-exists-p org-ditaa-jar-path)
- (error (format "Could not find ditaa.jar at %s" org-ditaa-jar-path)))
- (setq body (if (string-match "^\\([^:\\|:[^ ]\\)" body)
- body
- (mapconcat (lambda (x) (substring x (if (> (length x) 1) 2 1)))
- (org-split-string body "\n")
- "\n")))
- (cond
- ((or htmlp latexp docbookp)
- (unless (file-exists-p out-file)
- (mapc ;; remove old hashed versions of this file
- (lambda (file)
- (when (and (string-match (concat (regexp-quote (car out-file-parts))
- "_\\([[:alnum:]]+\\)\\."
- (regexp-quote (cdr out-file-parts)))
- file)
- (= (length (match-string 1 out-file)) 40))
- (delete-file (expand-file-name file
- (file-name-directory out-file)))))
- (directory-files (or (file-name-directory out-file)
- default-directory)))
- (with-temp-file data-file (insert body))
- (message (concat "java -jar " org-ditaa-jar-path " " args " " data-file " " out-file))
- (shell-command (concat "java -jar " org-ditaa-jar-path " " args " " data-file " " out-file)))
- (format "\n[[file:%s]]\n" out-file))
- (t (concat
- "\n#+BEGIN_EXAMPLE\n"
- body (if (string-match "\n$" body) "" "\n")
- "#+END_EXAMPLE\n")))))
-
-;;--------------------------------------------------------------------------------
-;; dot: create graphs using the dot graphing language
-;; (require the dot executable to be in your path)
-(defun org-export-blocks-format-dot (body &rest headers)
- "Pass block BODY to the dot graphing utility creating an image.
-Specify the path at which the image should be saved as the first
-element of headers, any additional elements of headers will be
-passed to the dot utility as command line arguments. Don't
-forget to specify the output type for the dot command, so if you
-are exporting to a file with a name like 'image.png' you should
-include a '-Tpng' argument, and your block should look like the
-following.
-
-#+begin_dot models.png -Tpng
-digraph data_relationships {
- \"data_requirement\" [shape=Mrecord, label=\"{DataRequirement|description\lformat\l}\"]
- \"data_product\" [shape=Mrecord, label=\"{DataProduct|name\lversion\lpoc\lformat\l}\"]
- \"data_requirement\" -> \"data_product\"
-}
-#+end_dot"
- (message "dot-formatting...")
- (let* ((args (if (cdr headers) (mapconcat 'identity (cdr headers) " ")))
- (data-file (make-temp-file "org-ditaa"))
- (hash (progn
- (set-text-properties 0 (length body) nil body)
- (sha1 (prin1-to-string (list body args)))))
- (raw-out-file (if headers (car headers)))
- (out-file-parts (if (string-match "\\(.+\\)\\.\\([^\\.]+\\)$" raw-out-file)
- (cons (match-string 1 raw-out-file)
- (match-string 2 raw-out-file))
- (cons raw-out-file "png")))
- (out-file (concat (car out-file-parts) "_" hash "." (cdr out-file-parts))))
- (cond
- ((or htmlp latexp docbookp)
- (unless (file-exists-p out-file)
- (mapc ;; remove old hashed versions of this file
- (lambda (file)
- (when (and (string-match (concat (regexp-quote (car out-file-parts))
- "_\\([[:alnum:]]+\\)\\."
- (regexp-quote (cdr out-file-parts)))
- file)
- (= (length (match-string 1 out-file)) 40))
- (delete-file (expand-file-name file
- (file-name-directory out-file)))))
- (directory-files (or (file-name-directory out-file)
- default-directory)))
- (with-temp-file data-file (insert body))
- (message (concat "dot " data-file " " args " -o " out-file))
- (shell-command (concat "dot " data-file " " args " -o " out-file)))
- (format "\n[[file:%s]]\n" out-file))
- (t (concat
- "\n#+BEGIN_EXAMPLE\n"
- body (if (string-match "\n$" body) "" "\n")
- "#+END_EXAMPLE\n")))))
-
-;;--------------------------------------------------------------------------------
-;; comment: export comments in author-specific css-stylable divs
-(defun org-export-blocks-format-comment (body &rest headers)
- "Format comment BODY by OWNER and return it formatted for export.
-Currently, this only does something for HTML export, for all
-other backends, it converts the comment into an EXAMPLE segment."
- (let ((owner (if headers (car headers)))
- (title (if (cdr headers) (mapconcat 'identity (cdr headers) " "))))
- (cond
- (htmlp ;; We are exporting to HTML
- (concat "#+BEGIN_HTML\n"
- "<div class=\"org-comment\""
- (if owner (format " id=\"org-comment-%s\" " owner))
- ">\n"
- (if owner (concat "<b>" owner "</b> ") "")
- (if (and title (> (length title) 0)) (concat " -- " title "</br>\n") "</br>\n")
- "<p>\n"
- "#+END_HTML\n"
- body
- "#+BEGIN_HTML\n"
- "</p>\n"
- "</div>\n"
- "#+END_HTML\n"))
- (t ;; This is not HTML, so just make it an example.
- (concat "#+BEGIN_EXAMPLE\n"
- (if title (concat "Title:" title "\n") "")
- (if owner (concat "By:" owner "\n") "")
- body
- (if (string-match "\n\\'" body) "" "\n")
- "#+END_EXAMPLE\n")))))
-
-(provide 'org-exp-blocks)
-
-;; arch-tag: 1c365fe9-8808-4f72-bb15-0b00f36d8024
-;;; org-exp-blocks.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-exp-blocks.elc b/.emacs.d/org-7.4/lisp/org-exp-blocks.elc
deleted file mode 100644
index 52d982e..0000000
--- a/.emacs.d/org-7.4/lisp/org-exp-blocks.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-exp.el b/.emacs.d/org-7.4/lisp/org-exp.el
deleted file mode 100644
index d45ef9c..0000000
--- a/.emacs.d/org-7.4/lisp/org-exp.el
+++ /dev/null
@@ -1,2968 +0,0 @@
-;;; org-exp.el --- ASCII, HTML, XOXO and iCalendar export for Org-mode
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;;; Code:
-
-(require 'org)
-(require 'org-macs)
-(require 'org-agenda)
-(require 'org-exp-blocks)
-(require 'ob-exp)
-(require 'org-src)
-
-(eval-when-compile
- (require 'cl))
-
-(declare-function org-export-latex-preprocess "org-latex" (parameters))
-(declare-function org-export-ascii-preprocess "org-ascii" (parameters))
-(declare-function org-export-html-preprocess "org-html" (parameters))
-(declare-function org-export-docbook-preprocess "org-docbook" (parameters))
-(declare-function org-infojs-options-inbuffer-template "org-jsinfo" ())
-(declare-function org-export-htmlize-region-for-paste "org-html" (beg end))
-(declare-function htmlize-buffer "ext:htmlize" (&optional buffer))
-(declare-function org-inlinetask-remove-END-maybe "org-inlinetask" ())
-(declare-function org-table-cookie-line-p "org-table" (line))
-(declare-function org-table-colgroup-line-p "org-table" (line))
-(autoload 'org-export-generic "org-export-generic" "Export using the generic exporter" t)
-(defgroup org-export nil
- "Options for exporting org-listings."
- :tag "Org Export"
- :group 'org)
-
-(defgroup org-export-general nil
- "General options for exporting Org-mode files."
- :tag "Org Export General"
- :group 'org-export)
-
-(defcustom org-export-allow-BIND 'confirm
- "Non-nil means allow #+BIND to define local variable values for export.
-This is a potential security risk, which is why the user must confirm the
-use of these lines."
- :group 'org-export-general
- :type '(choice
- (const :tag "Never" nil)
- (const :tag "Always" t)
- (const :tag "Make the user confirm for each file" confirm)))
-
-;; FIXME
-(defvar org-export-publishing-directory nil)
-
-(defcustom org-export-show-temporary-export-buffer t
- "Non-nil means show buffer after exporting to temp buffer.
-When Org exports to a file, the buffer visiting that file is ever
-shown, but remains buried. However, when exporting to a temporary
-buffer, that buffer is popped up in a second window. When this variable
-is nil, the buffer remains buried also in these cases."
- :group 'org-export-general
- :type 'boolean)
-
-(defcustom org-export-copy-to-kill-ring t
- "Non-nil means exported stuff will also be pushed onto the kill ring."
- :group 'org-export-general
- :type 'boolean)
-
-(defcustom org-export-kill-product-buffer-when-displayed nil
- "Non-nil means kill the product buffer if it is displayed immediately.
-This applied to the commands `org-export-html-and-open' and
-`org-export-as-pdf-and-open'."
- :group 'org-export-general
- :type 'boolean)
-
-(defcustom org-export-run-in-background nil
- "Non-nil means export and publishing commands will run in background.
-This works by starting up a separate Emacs process visiting the same file
-and doing the export from there.
-Not all export commands are affected by this - only the ones which
-actually write to a file, and that do not depend on the buffer state.
-\\<org-mode-map>
-If this option is nil, you can still get background export by calling
-`org-export' with a double prefix arg: \
-\\[universal-argument] \\[universal-argument] \\[org-export].
-
-If this option is t, the double prefix can be used to exceptionally
-force an export command into the current process."
- :group 'org-export-general
- :type 'boolean)
-
-(defcustom org-export-select-tags '("export")
- "Tags that select a tree for export.
-If any such tag is found in a buffer, all trees that do not carry one
-of these tags will be deleted before export.
-Inside trees that are selected like this, you can still deselect a
-subtree by tagging it with one of the `org-export-exclude-tags'."
- :group 'org-export-general
- :type '(repeat (string :tag "Tag")))
-
-(defcustom org-export-exclude-tags '("noexport")
- "Tags that exclude a tree from export.
-All trees carrying any of these tags will be excluded from export.
-This is without condition, so even subtrees inside that carry one of the
-`org-export-select-tags' will be removed."
- :group 'org-export-general
- :type '(repeat (string :tag "Tag")))
-
-;; FIXME: rename, this is a general variable
-(defcustom org-export-html-expand t
- "Non-nil means for HTML export, treat @<...> as HTML tag.
-When nil, these tags will be exported as plain text and therefore
-not be interpreted by a browser.
-
-This option can also be set with the +OPTIONS line, e.g. \"@:nil\"."
- :group 'org-export-html
- :group 'org-export-general
- :type 'boolean)
-
-(defcustom org-export-with-special-strings t
- "Non-nil means interpret \"\-\", \"--\" and \"---\" for export.
-When this option is turned on, these strings will be exported as:
-
- Org HTML LaTeX
- -----+----------+--------
- \\- &shy; \\-
- -- &ndash; --
- --- &mdash; ---
- ... &hellip; \ldots
-
-This option can also be set with the +OPTIONS line, e.g. \"-:nil\"."
- :group 'org-export-translation
- :type 'boolean)
-
-(defcustom org-export-html-link-up ""
- "Where should the \"UP\" link of exported HTML pages lead?"
- :group 'org-export-html
- :group 'org-export-general
- :type '(string :tag "File or URL"))
-
-(defcustom org-export-html-link-home ""
- "Where should the \"HOME\" link of exported HTML pages lead?"
- :group 'org-export-html
- :group 'org-export-general
- :type '(string :tag "File or URL"))
-
-(defcustom org-export-language-setup
- '(("en" "Author" "Date" "Table of Contents" "Footnotes")
- ("ca" "Autor" "Data" "&Iacute;ndex" "Peus de p&agrave;gina")
- ("cs" "Autor" "Datum" "Obsah" "Pozn\xe1mky pod carou")
- ("da" "Ophavsmand" "Dato" "Indhold" "Fodnoter")
- ("de" "Autor" "Datum" "Inhaltsverzeichnis" "Fu&szlig;noten")
- ("eo" "A&#365;toro" "Dato" "Enhavo" "Piednotoj")
- ("es" "Autor" "Fecha" "&Iacute;ndice" "Pies de p&aacute;gina")
- ("fi" "Tekij&auml;" "P&auml;iv&auml;m&auml;&auml;r&auml;" "Sis&auml;llysluettelo" "Alaviitteet")
- ("fr" "Auteur" "Date" "Table des mati&egrave;res" "Notes de bas de page")
- ("hu" "Szerz&otilde;" "D&aacute;tum" "Tartalomjegyz&eacute;k" "L&aacute;bjegyzet")
- ("is" "H&ouml;fundur" "Dagsetning" "Efnisyfirlit" "Aftanm&aacute;lsgreinar")
- ("it" "Autore" "Data" "Indice" "Note a pi&egrave; di pagina")
- ("nl" "Auteur" "Datum" "Inhoudsopgave" "Voetnoten")
- ("no" "Forfatter" "Dato" "Innhold" "Fotnoter")
- ("nb" "Forfatter" "Dato" "Innhold" "Fotnoter") ;; nb = Norsk (bokm.l)
- ("nn" "Forfattar" "Dato" "Innhald" "Fotnotar") ;; nn = Norsk (nynorsk)
- ("pl" "Autor" "Data" "Spis tre&#x015b;ci" "Przypis")
- ("sv" "F&ouml;rfattare" "Datum" "Inneh&aring;ll" "Fotnoter"))
- "Terms used in export text, translated to different languages.
-Use the variable `org-export-default-language' to set the language,
-or use the +OPTION lines for a per-file setting."
- :group 'org-export-general
- :type '(repeat
- (list
- (string :tag "HTML language tag")
- (string :tag "Author")
- (string :tag "Date")
- (string :tag "Table of Contents")
- (string :tag "Footnotes"))))
-
-(defcustom org-export-default-language "en"
- "The default language of HTML export, as a string.
-This should have an association in `org-export-language-setup'."
- :group 'org-export-general
- :type 'string)
-
-(defvar org-export-page-description ""
- "The page description, for the XHTML meta tag.
-This is best set with the #+DESCRIPTION line in a file, it does not make
-sense to set this globally.")
-
-(defvar org-export-page-keywords ""
- "The page description, for the XHTML meta tag.
-This is best set with the #+KEYWORDS line in a file, it does not make
-sense to set this globally.")
-
-(defcustom org-export-skip-text-before-1st-heading nil
- "Non-nil means skip all text before the first headline when exporting.
-When nil, that text is exported as well."
- :group 'org-export-general
- :type 'boolean)
-
-(defcustom org-export-headline-levels 3
- "The last level which is still exported as a headline.
-Inferior levels will produce itemize lists when exported.
-Note that a numeric prefix argument to an exporter function overrides
-this setting.
-
-This option can also be set with the +OPTIONS line, e.g. \"H:2\"."
- :group 'org-export-general
- :type 'integer)
-
-(defcustom org-export-with-section-numbers t
- "Non-nil means add section numbers to headlines when exporting.
-
-This option can also be set with the +OPTIONS line, e.g. \"num:t\"."
- :group 'org-export-general
- :type 'boolean)
-
-(defcustom org-export-section-number-format '((("1" ".")) . "")
- "Format of section numbers for export.
-The variable has two components.
-1. A list of lists, each indicating a counter type and a separator.
- The counter type can be any of \"1\", \"A\", \"a\", \"I\", or \"i\".
- It causes causes numeric, alphabetic, or roman counters, respectively.
- The separator is only used if another counter for a subsection is being
- added.
- If there are more numbered section levels than entries in this lists,
- then the last entry will be reused.
-2. A terminator string that will be added after the entire
- section number."
- :group 'org-export-general
- :type '(cons
- (repeat
- (list
- (string :tag "Counter Type")
- (string :tag "Separator ")))
- (string :tag "Terminator")))
-
-(defcustom org-export-with-toc t
- "Non-nil means create a table of contents in exported files.
-The TOC contains headlines with levels up to`org-export-headline-levels'.
-When an integer, include levels up to N in the toc, this may then be
-different from `org-export-headline-levels', but it will not be allowed
-to be larger than the number of headline levels.
-When nil, no table of contents is made.
-
-Headlines which contain any TODO items will be marked with \"(*)\" in
-ASCII export, and with red color in HTML output, if the option
-`org-export-mark-todo-in-toc' is set.
-
-In HTML output, the TOC will be clickable.
-
-This option can also be set with the +OPTIONS line, e.g. \"toc:nil\"
-or \"toc:3\"."
- :group 'org-export-general
- :type '(choice
- (const :tag "No Table of Contents" nil)
- (const :tag "Full Table of Contents" t)
- (integer :tag "TOC to level")))
-
-(defcustom org-export-mark-todo-in-toc nil
- "Non-nil means mark TOC lines that contain any open TODO items."
- :group 'org-export-general
- :type 'boolean)
-
-(defcustom org-export-with-todo-keywords t
- "Non-nil means include TODO keywords in export.
-When nil, remove all these keywords from the export."
- :group 'org-export-general
- :type 'boolean)
-
-(defcustom org-export-with-priority nil
- "Non-nil means include priority cookies in export.
-When nil, remove priority cookies for export."
- :group 'org-export-general
- :type 'boolean)
-
-(defcustom org-export-preserve-breaks nil
- "Non-nil means preserve all line breaks when exporting.
-Normally, in HTML output paragraphs will be reformatted. In ASCII
-export, line breaks will always be preserved, regardless of this variable.
-
-This option can also be set with the +OPTIONS line, e.g. \"\\n:t\"."
- :group 'org-export-general
- :type 'boolean)
-
-(defcustom org-export-with-archived-trees 'headline
- "Whether subtrees with the ARCHIVE tag should be exported.
-This can have three different values
-nil Do not export, pretend this tree is not present
-t Do export the entire tree
-headline Only export the headline, but skip the tree below it."
- :group 'org-export-general
- :group 'org-archive
- :type '(choice
- (const :tag "not at all" nil)
- (const :tag "headline only" 'headline)
- (const :tag "entirely" t)))
-
-(defcustom org-export-author-info t
- "Non-nil means insert author name and email into the exported file.
-
-This option can also be set with the +OPTIONS line,
-e.g. \"author:nil\"."
- :group 'org-export-general
- :type 'boolean)
-
-(defcustom org-export-email-info nil
- "Non-nil means insert author name and email into the exported file.
-
-This option can also be set with the +OPTIONS line,
-e.g. \"email:t\"."
- :group 'org-export-general
- :type 'boolean)
-
-(defcustom org-export-creator-info t
- "Non-nil means the postamble should contain a creator sentence.
-This sentence is \"HTML generated by org-mode XX in emacs XXX\"."
- :group 'org-export-general
- :type 'boolean)
-
-(defcustom org-export-time-stamp-file t
- "Non-nil means insert a time stamp into the exported file.
-The time stamp shows when the file was created.
-
-This option can also be set with the +OPTIONS line,
-e.g. \"timestamp:nil\"."
- :group 'org-export-general
- :type 'boolean)
-
-(defcustom org-export-with-timestamps t
- "If nil, do not export time stamps and associated keywords."
- :group 'org-export-general
- :type 'boolean)
-
-(defcustom org-export-remove-timestamps-from-toc t
- "If t, remove timestamps from the table of contents entries."
- :group 'org-export-general
- :type 'boolean)
-
-(defcustom org-export-with-tags 'not-in-toc
- "If nil, do not export tags, just remove them from headlines.
-If this is the symbol `not-in-toc', tags will be removed from table of
-contents entries, but still be shown in the headlines of the document.
-
-This option can also be set with the +OPTIONS line, e.g. \"tags:nil\"."
- :group 'org-export-general
- :type '(choice
- (const :tag "Off" nil)
- (const :tag "Not in TOC" not-in-toc)
- (const :tag "On" t)))
-
-(defcustom org-export-with-drawers nil
- "Non-nil means export with drawers like the property drawer.
-When t, all drawers are exported. This may also be a list of
-drawer names to export."
- :group 'org-export-general
- :type '(choice
- (const :tag "All drawers" t)
- (const :tag "None" nil)
- (repeat :tag "Selected drawers"
- (string :tag "Drawer name"))))
-
-(defvar org-export-first-hook nil
- "Hook called as the first thing in each exporter.
-Point will be still in the original buffer.
-Good for general initialization")
-
-(defvar org-export-preprocess-hook nil
- "Hook for preprocessing an export buffer.
-Pretty much the first thing when exporting is running this hook.
-Point will be in a temporary buffer that contains a copy of
-the original buffer, or of the section that is being export.
-All the other hooks in the org-export-preprocess... category
-also work in that temporary buffer, already modified by various
-stages of the processing.")
-
-(defvar org-export-preprocess-after-include-files-hook nil
- "Hook for preprocessing an export buffer.
-This is run after the contents of included files have been inserted.")
-
-(defvar org-export-preprocess-after-tree-selection-hook nil
- "Hook for preprocessing an export buffer.
-This is run after selection of trees to be exported has happened.
-This selection includes tags-based selection, as well as removal
-of commented and archived trees.")
-
-(defvar org-export-preprocess-after-headline-targets-hook nil
- "Hook for preprocessing export buffer.
-This is run just after the headline targets have been defined and
-the target-alist has been set up.")
-
-(defvar org-export-preprocess-before-selecting-backend-code-hook nil
- "Hook for preprocessing an export buffer.
-This is run just before backend-specific blocks get selected.")
-
-(defvar org-export-preprocess-after-blockquote-hook nil
- "Hook for preprocessing an export buffer.
-This is run after blockquote/quote/verse/center have been marked
-with cookies.")
-
-(defvar org-export-preprocess-after-radio-targets-hook nil
- "Hook for preprocessing an export buffer.
-This is run after radio target processing.")
-
-(defvar org-export-preprocess-before-normalizing-links-hook nil
- "Hook for preprocessing an export buffer.
-This hook is run before links are normalized.")
-
-(defvar org-export-preprocess-before-backend-specifics-hook nil
- "Hook run before backend-specific functions are called during preprocessing.")
-
-(defvar org-export-preprocess-final-hook nil
- "Hook for preprocessing an export buffer.
-This is run as the last thing in the preprocessing buffer, just before
-returning the buffer string to the backend.")
-
-(defgroup org-export-translation nil
- "Options for translating special ascii sequences for the export backends."
- :tag "Org Export Translation"
- :group 'org-export)
-
-(defcustom org-export-with-emphasize t
- "Non-nil means interpret *word*, /word/, and _word_ as emphasized text.
-If the export target supports emphasizing text, the word will be
-typeset in bold, italic, or underlined, respectively. Works only for
-single words, but you can say: I *really* *mean* *this*.
-Not all export backends support this.
-
-This option can also be set with the +OPTIONS line, e.g. \"*:nil\"."
- :group 'org-export-translation
- :type 'boolean)
-
-(defcustom org-export-with-footnotes t
- "If nil, export [1] as a footnote marker.
-Lines starting with [1] will be formatted as footnotes.
-
-This option can also be set with the +OPTIONS line, e.g. \"f:nil\"."
- :group 'org-export-translation
- :type 'boolean)
-
-(defcustom org-export-with-TeX-macros t
- "Non-nil means interpret simple TeX-like macros when exporting.
-For example, HTML export converts \\alpha to &alpha; and \\AA to &Aring;.
-Not only real TeX macros will work here, but the standard HTML entities
-for math can be used as macro names as well. For a list of supported
-names in HTML export, see the constant `org-entities' and the user option
-`org-entities-user'.
-Not all export backends support this.
-
-This option can also be set with the +OPTIONS line, e.g. \"TeX:nil\"."
- :group 'org-export-translation
- :group 'org-export-latex
- :type 'boolean)
-
-(defcustom org-export-with-LaTeX-fragments t
- "Non-nil means process LaTeX math fragments for HTML display.
-When set, the exporter will find and process LaTeX environments if the
-\\begin line is the first non-white thing on a line. It will also find
-and process the math delimiters like $a=b$ and \\( a=b \\) for inline math,
-$$a=b$$ and \\[ a=b \\] for display math.
-
-This option can also be set with the +OPTIONS line, e.g. \"LaTeX:mathjax\".
-
-Allowed values are:
-
-nil Don't do anything.
-verbatim Keep eveything in verbatim
-dvipng Process the LaTeX fragments to images.
- This will also include processing of non-math environments.
-t Do MathJax preprocessing if there is at least on math snippet,
- and arrange for MathJax.js to be loaded.
-
-The default is nil, because this option needs the `dvipng' program which
-is not available on all systems."
- :group 'org-export-translation
- :group 'org-export-latex
- :type '(choice
- (const :tag "Do not process math in any way" nil)
- (const :tag "Obsolete, use dvipng setting" t)
- (const :tag "Use dvipng to make images" dvipng)
- (const :tag "Use MathJax to display math" mathjax)
- (const :tag "Leave math verbatim" verbatim)))
-
-(defcustom org-export-with-fixed-width t
- "Non-nil means lines starting with \":\" will be in fixed width font.
-This can be used to have pre-formatted text, fragments of code etc. For
-example:
- : ;; Some Lisp examples
- : (while (defc cnt)
- : (ding))
-will be looking just like this in also HTML. See also the QUOTE keyword.
-Not all export backends support this.
-
-This option can also be set with the +OPTIONS line, e.g. \"::nil\"."
- :group 'org-export-translation
- :type 'boolean)
-
-(defgroup org-export-tables nil
- "Options for exporting tables in Org-mode."
- :tag "Org Export Tables"
- :group 'org-export)
-
-(defcustom org-export-with-tables t
- "If non-nil, lines starting with \"|\" define a table.
-For example:
-
- | Name | Address | Birthday |
- |-------------+----------+-----------|
- | Arthur Dent | England | 29.2.2100 |
-
-Not all export backends support this.
-
-This option can also be set with the +OPTIONS line, e.g. \"|:nil\"."
- :group 'org-export-tables
- :type 'boolean)
-
-(defcustom org-export-highlight-first-table-line t
- "Non-nil means highlight the first table line.
-In HTML export, this means use <th> instead of <td>.
-In tables created with table.el, this applies to the first table line.
-In Org-mode tables, all lines before the first horizontal separator
-line will be formatted with <th> tags."
- :group 'org-export-tables
- :type 'boolean)
-
-(defcustom org-export-table-remove-special-lines t
- "Remove special lines and marking characters in calculating tables.
-This removes the special marking character column from tables that are set
-up for spreadsheet calculations. It also removes the entire lines
-marked with `!', `_', or `^'. The lines with `$' are kept, because
-the values of constants may be useful to have."
- :group 'org-export-tables
- :type 'boolean)
-
-(defcustom org-export-prefer-native-exporter-for-tables nil
- "Non-nil means always export tables created with table.el natively.
-Natively means use the HTML code generator in table.el.
-When nil, Org-mode's own HTML generator is used when possible (i.e. if
-the table does not use row- or column-spanning). This has the
-advantage, that the automatic HTML conversions for math symbols and
-sub/superscripts can be applied. Org-mode's HTML generator is also
-much faster. The LaTeX exporter always use the native exporter for
-table.el tables."
- :group 'org-export-tables
- :type 'boolean)
-
-
-(defgroup org-export-xml nil
- "Options specific for XML export of Org-mode files."
- :tag "Org Export XML"
- :group 'org-export)
-
-;;;; Exporting
-
-;;; Variables, constants, and parameter plists
-
-(defconst org-level-max 20)
-
-(defvar org-current-export-file nil) ; dynamically scoped parameter
-(defvar org-current-export-dir nil) ; dynamically scoped parameter
-(defvar org-export-opt-plist nil
- "Contains the current option plist.")
-(defvar org-last-level nil) ; dynamically scoped variable
-(defvar org-min-level nil) ; dynamically scoped variable
-(defvar org-levels-open nil) ; dynamically scoped parameter
-
-(defconst org-export-plist-vars
- '((:link-up nil org-export-html-link-up)
- (:link-home nil org-export-html-link-home)
- (:language nil org-export-default-language)
- (:keywords nil org-export-page-keywords)
- (:description nil org-export-page-description)
- (:customtime nil org-display-custom-times)
- (:headline-levels "H" org-export-headline-levels)
- (:section-numbers "num" org-export-with-section-numbers)
- (:section-number-format nil org-export-section-number-format)
- (:table-of-contents "toc" org-export-with-toc)
- (:preserve-breaks "\\n" org-export-preserve-breaks)
- (:archived-trees nil org-export-with-archived-trees)
- (:emphasize "*" org-export-with-emphasize)
- (:sub-superscript "^" org-export-with-sub-superscripts)
- (:special-strings "-" org-export-with-special-strings)
- (:footnotes "f" org-export-with-footnotes)
- (:drawers "d" org-export-with-drawers)
- (:tags "tags" org-export-with-tags)
- (:todo-keywords "todo" org-export-with-todo-keywords)
- (:priority "pri" org-export-with-priority)
- (:TeX-macros "TeX" org-export-with-TeX-macros)
- (:LaTeX-fragments "LaTeX" org-export-with-LaTeX-fragments)
- (:latex-listings nil org-export-latex-listings)
- (:skip-before-1st-heading "skip" org-export-skip-text-before-1st-heading)
- (:fixed-width ":" org-export-with-fixed-width)
- (:timestamps "<" org-export-with-timestamps)
- (:author-info "author" org-export-author-info)
- (:email-info "email" org-export-email-info)
- (:creator-info "creator" org-export-creator-info)
- (:time-stamp-file "timestamp" org-export-time-stamp-file)
- (:tables "|" org-export-with-tables)
- (:table-auto-headline nil org-export-highlight-first-table-line)
- (:style-include-default nil org-export-html-style-include-default)
- (:style-include-scripts nil org-export-html-style-include-scripts)
- (:style nil org-export-html-style)
- (:style-extra nil org-export-html-style-extra)
- (:agenda-style nil org-agenda-export-html-style)
- (:convert-org-links nil org-export-html-link-org-files-as-html)
- (:inline-images nil org-export-html-inline-images)
- (:html-extension nil org-export-html-extension)
- (:xml-declaration nil org-export-html-xml-declaration)
- (:html-table-tag nil org-export-html-table-tag)
- (:expand-quoted-html "@" org-export-html-expand)
- (:timestamp nil org-export-html-with-timestamp)
- (:publishing-directory nil org-export-publishing-directory)
- (:preamble nil org-export-html-preamble)
- (:postamble nil org-export-html-postamble)
- (:auto-preamble nil org-export-html-auto-preamble)
- (:auto-postamble nil org-export-html-auto-postamble)
- (:author nil user-full-name)
- (:email nil user-mail-address)
- (:select-tags nil org-export-select-tags)
- (:exclude-tags nil org-export-exclude-tags)
-
- (:latex-image-options nil org-export-latex-image-default-option))
- "List of properties that represent export/publishing variables.
-Each element is a list of 3 items:
-1. The property that is used internally, and also for org-publish-project-alist
-2. The string that can be used in the OPTION lines to set this option,
- or nil if this option cannot be changed in this way
-3. The customization variable that sets the default for this option."
-)
-
-(defun org-default-export-plist ()
- "Return the property list with default settings for the export variables."
- (let* ((infile (org-infile-export-plist))
- (letbind (plist-get infile :let-bind))
- (l org-export-plist-vars) rtn e s v)
- (while (setq e (pop l))
- (setq s (nth 2 e)
- v (cond
- ((assq s letbind) (nth 1 (assq s letbind)))
- ((boundp s) (symbol-value s))
- (t nil))
- rtn (cons (car e) (cons v rtn))))
- rtn))
-
-(defvar org-export-inbuffer-options-extra nil
- "List of additional in-buffer options that should be detected.
-Just before export, the buffer is scanned for options like #+TITLE, #+EMAIL,
-etc. Extensions can add to this list to get their options detected, and they
-can then add a function to `org-export-options-filters' to process these
-options.
-Each element in this list must be a list, with the in-buffer keyword as car,
-and a property (a symbol) as the next element. All occurrences of the
-keyword will be found, the values concatenated with a space character
-in between, and the result stored in the export options property list.")
-
-(defvar org-export-options-filters nil
- "Functions to be called to finalize the export/publishing options.
-All these options are stored in a property list, and each of the functions
-in this hook gets a chance to modify this property list. Each function
-must accept the property list as an argument, and must return the (possibly
-modified) list.")
-
-;; FIXME: should we fold case here?
-(defun org-infile-export-plist ()
- "Return the property list with file-local settings for export."
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (let ((re (org-make-options-regexp
- (append
- '("TITLE" "AUTHOR" "DATE" "EMAIL" "TEXT" "OPTIONS" "LANGUAGE"
- "MATHJAX"
- "LINK_UP" "LINK_HOME" "SETUPFILE" "STYLE"
- "LATEX_HEADER" "LATEX_CLASS"
- "EXPORT_SELECT_TAGS" "EXPORT_EXCLUDE_TAGS"
- "KEYWORDS" "DESCRIPTION" "MACRO" "BIND" "XSLT")
- (mapcar 'car org-export-inbuffer-options-extra))))
- (case-fold-search t)
- p key val text options mathjax a pr style
- latex-header latex-class macros letbind
- ext-setup-or-nil setup-contents (start 0))
- (while (or (and ext-setup-or-nil
- (string-match re ext-setup-or-nil start)
- (setq start (match-end 0)))
- (and (setq ext-setup-or-nil nil start 0)
- (re-search-forward re nil t)))
- (setq key (upcase (org-match-string-no-properties 1 ext-setup-or-nil))
- val (org-match-string-no-properties 2 ext-setup-or-nil))
- (cond
- ((setq a (assoc key org-export-inbuffer-options-extra))
- (setq pr (nth 1 a))
- (setq p (plist-put p pr (concat (plist-get p pr) " " val))))
- ((string-equal key "TITLE") (setq p (plist-put p :title val)))
- ((string-equal key "AUTHOR")(setq p (plist-put p :author val)))
- ((string-equal key "EMAIL") (setq p (plist-put p :email val)))
- ((string-equal key "DATE") (setq p (plist-put p :date val)))
- ((string-equal key "KEYWORDS") (setq p (plist-put p :keywords val)))
- ((string-equal key "DESCRIPTION")
- (setq p (plist-put p :description val)))
- ((string-equal key "LANGUAGE") (setq p (plist-put p :language val)))
- ((string-equal key "STYLE")
- (setq style (concat style "\n" val)))
- ((string-equal key "LATEX_HEADER")
- (setq latex-header (concat latex-header "\n" val)))
- ((string-equal key "LATEX_CLASS")
- (setq latex-class val))
- ((string-equal key "TEXT")
- (setq text (if text (concat text "\n" val) val)))
- ((string-equal key "OPTIONS")
- (setq options (concat val " " options)))
- ((string-equal key "MATHJAX")
- (setq mathjax (concat val " " mathjax)))
- ((string-equal key "BIND")
- (push (read (concat "(" val ")")) letbind))
- ((string-equal key "XSLT")
- (setq p (plist-put p :xslt val)))
- ((string-equal key "LINK_UP")
- (setq p (plist-put p :link-up val)))
- ((string-equal key "LINK_HOME")
- (setq p (plist-put p :link-home val)))
- ((string-equal key "EXPORT_SELECT_TAGS")
- (setq p (plist-put p :select-tags (org-split-string val))))
- ((string-equal key "EXPORT_EXCLUDE_TAGS")
- (setq p (plist-put p :exclude-tags (org-split-string val))))
- ((string-equal key "MACRO")
- (push val macros))
- ((equal key "SETUPFILE")
- (setq setup-contents (org-file-contents
- (expand-file-name
- (org-remove-double-quotes
- (org-trim val)))
- 'noerror))
- (if (not ext-setup-or-nil)
- (setq ext-setup-or-nil setup-contents start 0)
- (setq ext-setup-or-nil
- (concat (substring ext-setup-or-nil 0 start)
- "\n" setup-contents "\n"
- (substring ext-setup-or-nil start)))))))
- (setq p (plist-put p :text text))
- (when (and letbind (org-export-confirm-letbind))
- (setq p (plist-put p :let-bind letbind)))
- (when style (setq p (plist-put p :style-extra style)))
- (when latex-header
- (setq p (plist-put p :latex-header-extra (substring latex-header 1))))
- (when latex-class
- (setq p (plist-put p :latex-class latex-class)))
- (when options
- (setq p (org-export-add-options-to-plist p options)))
- (when mathjax
- (setq p (plist-put p :mathjax mathjax)))
- ;; Add macro definitions
- (setq p (plist-put p :macro-date "(eval (format-time-string \"$1\"))"))
- (setq p (plist-put p :macro-time "(eval (format-time-string \"$1\"))"))
- (setq p (plist-put p :macro-property "(eval (org-entry-get nil \"$1\" 'selective))"))
- (setq p (plist-put
- p :macro-modification-time
- (and (buffer-file-name)
- (file-exists-p (buffer-file-name))
- (concat
- "(eval (format-time-string \"$1\" '"
- (prin1-to-string (nth 5 (file-attributes
- (buffer-file-name))))
- "))"))))
- (setq p (plist-put p :macro-input-file (and (buffer-file-name)
- (file-name-nondirectory
- (buffer-file-name)))))
- (while (setq val (pop macros))
- (when (string-match "^\\([-a-zA-Z0-9_]+\\)[ \t]+\\(.*?[ \t]*$\\)" val)
- (setq p (plist-put
- p (intern
- (concat ":macro-" (downcase (match-string 1 val))))
- (org-export-interpolate-newlines (match-string 2 val))))))
- p))))
-
-(defun org-export-interpolate-newlines (s)
- (while (string-match "\\\\n" s)
- (setq s (replace-match "\n" t t s)))
- s)
-
-(defvar org-export-allow-BIND-local nil)
-(defun org-export-confirm-letbind ()
- "Can we use #+BIND values during export?
-By default this will ask fro confirmation by the user, to divert possible
-security risks."
- (cond
- ((not org-export-allow-BIND) nil)
- ((eq org-export-allow-BIND t) t)
- ((local-variable-p 'org-export-allow-BIND-local (current-buffer))
- org-export-allow-BIND-local)
- (t (org-set-local 'org-export-allow-BIND-local
- (yes-or-no-p "Allow BIND values in this buffer? ")))))
-
-(defun org-install-letbind ()
- "Install the values from #+BIND lines as local variables."
- (let ((letbind (plist-get org-export-opt-plist :let-bind))
- pair)
- (while (setq pair (pop letbind))
- (org-set-local (car pair) (nth 1 pair)))))
-
-(defun org-export-add-options-to-plist (p options)
- "Parse an OPTIONS line and set values in the property list P."
- (let (o)
- (when options
- (let ((op org-export-plist-vars))
- (while (setq o (pop op))
- (if (and (nth 1 o)
- (string-match (concat (regexp-quote (nth 1 o))
- ":\\([^ \t\n\r;,.]*\\)")
- options))
- (setq p (plist-put p (car o)
- (car (read-from-string
- (match-string 1 options))))))))))
- p)
-
-(defun org-export-add-subtree-options (p pos)
- "Add options in subtree at position POS to property list P."
- (save-excursion
- (goto-char pos)
- (when (org-at-heading-p)
- (let (a)
- ;; This is actually read in `org-export-get-title-from-subtree'
- ;; (when (setq a (org-entry-get pos "EXPORT_TITLE"))
- ;; (setq p (plist-put p :title a)))
- (when (setq a (org-entry-get pos "EXPORT_TEXT"))
- (setq p (plist-put p :text a)))
- (when (setq a (org-entry-get pos "EXPORT_AUTHOR"))
- (setq p (plist-put p :author a)))
- (when (setq a (org-entry-get pos "EXPORT_DATE"))
- (setq p (plist-put p :date a)))
- (when (setq a (org-entry-get pos "EXPORT_OPTIONS"))
- (setq p (org-export-add-options-to-plist p a)))))
- p))
-
-(defun org-export-directory (type plist)
- (let* ((val (plist-get plist :publishing-directory))
- (dir (if (listp val)
- (or (cdr (assoc type val)) ".")
- val)))
- dir))
-
-(defun org-export-process-option-filters (plist)
- (let ((functions org-export-options-filters) f)
- (while (setq f (pop functions))
- (setq plist (funcall f plist))))
- plist)
-
-;;;###autoload
-(defun org-export (&optional arg)
- "Export dispatcher for Org-mode.
-When `org-export-run-in-background' is non-nil, try to run the command
-in the background. This will be done only for commands that write
-to a file. For details see the docstring of `org-export-run-in-background'.
-
-The prefix argument ARG will be passed to the exporter. However, if
-ARG is a double universal prefix \\[universal-argument] \\[universal-argument], \
-that means to inverse the
-value of `org-export-run-in-background'."
- (interactive "P")
- (let* ((bg (org-xor (equal arg '(16)) org-export-run-in-background))
- subtree-p
- (help "[t] insert the export option template
-\[v] limit export to visible part of outline tree
-\[1] only export the current subtree
-\[SPC] publish enclosing subtree (with LaTeX_CLASS or EXPORT_FILE_NAME prop)
-
-\[a/n/u] export as ASCII/Latin-1/UTF-8 [A/N/U] to temporary buffer
-
-\[h] export as HTML [H] to temporary buffer [R] export region
-\[b] export as HTML and open in browser
-
-\[l] export as LaTeX [L] to temporary buffer
-\[p] export as LaTeX and process to PDF [d] ... and open PDF file
-
-\[D] export as DocBook [V] export as DocBook, process to PDF, and open
-
-\[j] export as TaskJuggler [J] ... and open
-
-\[m] export as Freemind mind map
-\[x] export as XOXO
-\[g] export using Wes Hardaker's generic exporter
-
-\[i] export current file as iCalendar file
-\[I] export all agenda files as iCalendar files [c] ...as one combined file
-
-\[F] publish current file [P] publish current project
-\[X] publish a project... [E] publish every projects")
- (cmds
- '((?t org-insert-export-options-template nil)
- (?v org-export-visible nil)
- (?a org-export-as-ascii t)
- (?A org-export-as-ascii-to-buffer t)
- (?n org-export-as-latin1 t)
- (?N org-export-as-latin1-to-buffer t)
- (?u org-export-as-utf8 t)
- (?U org-export-as-utf8-to-buffer t)
- (?h org-export-as-html t)
- (?b org-export-as-html-and-open t)
- (?H org-export-as-html-to-buffer nil)
- (?R org-export-region-as-html nil)
- (?x org-export-as-xoxo t)
- (?g org-export-generic t)
- (?D org-export-as-docbook t)
- (?V org-export-as-docbook-pdf-and-open t)
- (?j org-export-as-taskjuggler t)
- (?J org-export-as-taskjuggler-and-open t)
- (?m org-export-as-freemind t)
- (?l org-export-as-latex t)
- (?p org-export-as-pdf t)
- (?d org-export-as-pdf-and-open t)
- (?L org-export-as-latex-to-buffer nil)
- (?i org-export-icalendar-this-file t)
- (?I org-export-icalendar-all-agenda-files t)
- (?c org-export-icalendar-combine-agenda-files t)
- (?F org-publish-current-file t)
- (?P org-publish-current-project t)
- (?X org-publish t)
- (?E org-publish-all t)))
- r1 r2 ass
- (cpos (point)) (cbuf (current-buffer)) bpos)
- (save-excursion
- (save-window-excursion
- (delete-other-windows)
- (with-output-to-temp-buffer "*Org Export/Publishing Help*"
- (princ help))
- (org-fit-window-to-buffer (get-buffer-window
- "*Org Export/Publishing Help*"))
- (message "Select command: ")
- (setq r1 (read-char-exclusive))
- (when (eq r1 ?1)
- (setq subtree-p t)
- (message "Select command (for subtree): ")
- (setq r1 (read-char-exclusive)))
- (when (eq r1 ?\ )
- (let ((case-fold-search t))
- (if (re-search-backward
- "^[ \t]+\\(:latex_class:\\|:export_title:\\)[ \t]+\\S-"
- nil t)
- (progn
- (org-back-to-heading t)
- (setq subtree-p t)
- (setq bpos (point))
- (message "Select command (for subtree): ")
- (setq r1 (read-char-exclusive)))
- (error "No enclosing node with LaTeX_CLASS or EXPORT_FILE_NAME")
- )))))
- (and bpos (goto-char bpos))
- (setq r2 (if (< r1 27) (+ r1 96) r1))
- (unless (setq ass (assq r2 cmds))
- (error "No command associated with key %c" r1))
- (if (and bg (nth 2 ass)
- (not (buffer-base-buffer))
- (not (org-region-active-p)))
- ;; execute in background
- (let ((p (start-process
- (concat "Exporting " (file-name-nondirectory (buffer-file-name)))
- "*Org Processes*"
- (expand-file-name invocation-name invocation-directory)
- "-batch"
- "-l" user-init-file
- "--eval" "(require 'org-exp)"
- "--eval" "(setq org-wait .2)"
- (buffer-file-name)
- "-f" (symbol-name (nth 1 ass)))))
- (set-process-sentinel p 'org-export-process-sentinel)
- (message "Background process \"%s\": started" p))
- ;; background processing not requested, or not possible
- (if subtree-p (progn (org-mark-subtree) (activate-mark)))
- (call-interactively (nth 1 ass))
- (when (and bpos (get-buffer-window cbuf))
- (let ((cw (selected-window)))
- (select-window (get-buffer-window cbuf))
- (goto-char cpos)
- (deactivate-mark)
- (select-window cw))))))
-
-(defun org-export-process-sentinel (process status)
- (if (string-match "\n+\\'" status)
- (setq status (substring status 0 -1)))
- (message "Background process \"%s\": %s" process status))
-
-;;; General functions for all backends
-
-(defvar org-export-target-aliases nil
- "Alist of targets with invisible aliases.")
-(defvar org-export-preferred-target-alist nil
- "Alist of section id's with preferred aliases.")
-(defvar org-export-id-target-alist nil
- "Alist of section id's with preferred aliases.")
-(defvar org-export-code-refs nil
- "Alist of code references and line numbers.")
-
-(defun org-export-preprocess-string (string &rest parameters)
- "Cleanup STRING so that that the true exported has a more consistent source.
-This function takes STRING, which should be a buffer-string of an org-file
-to export. It then creates a temporary buffer where it does its job.
-The result is then again returned as a string, and the exporter works
-on this string to produce the exported version."
- (interactive)
- (let* ((htmlp (plist-get parameters :for-html))
- (asciip (plist-get parameters :for-ascii))
- (latexp (plist-get parameters :for-LaTeX))
- (docbookp (plist-get parameters :for-docbook))
- (backend (cond (htmlp 'html)
- (latexp 'latex)
- (asciip 'ascii)
- (docbookp 'docbook)))
- (archived-trees (plist-get parameters :archived-trees))
- (inhibit-read-only t)
- (drawers org-drawers)
- (outline-regexp "\\*+ ")
- target-alist rtn)
-
- (setq org-export-target-aliases nil
- org-export-preferred-target-alist nil
- org-export-id-target-alist nil
- org-export-code-refs nil)
-
- (with-current-buffer (get-buffer-create " org-mode-tmp")
- (erase-buffer)
- (insert string)
- (setq case-fold-search t)
-
- (let ((inhibit-read-only t))
- (remove-text-properties (point-min) (point-max)
- '(read-only t)))
-
- ;; Remove license-to-kill stuff
- ;; The caller marks some stuff for killing, stuff that has been
- ;; used to create the page title, for example.
- (org-export-kill-licensed-text)
-
- (let ((org-inhibit-startup t)) (org-mode))
- (setq case-fold-search t)
- (org-install-letbind)
-
- ;; Call the hook
- (run-hooks 'org-export-preprocess-hook)
-
- ;; Process the macros
- (org-export-preprocess-apply-macros)
- (run-hooks 'org-export-preprocess-after-macros-hook)
-
- (untabify (point-min) (point-max))
-
- ;; Handle include files, and call a hook
- (org-export-handle-include-files-recurse)
- (run-hooks 'org-export-preprocess-after-include-files-hook)
-
- ;; Get rid of archived trees
- (org-export-remove-archived-trees archived-trees)
-
- ;; Remove comment environment and comment subtrees
- (org-export-remove-comment-blocks-and-subtrees)
-
- ;; Get rid of excluded trees, and call a hook
- (org-export-handle-export-tags (plist-get parameters :select-tags)
- (plist-get parameters :exclude-tags))
- (run-hooks 'org-export-preprocess-after-tree-selection-hook)
-
- ;; Mark end of lists
- (org-export-mark-list-ending backend)
-
- ;; Export code blocks
- (org-export-blocks-preprocess)
-
- ;; Handle source code snippets
- (org-export-replace-src-segments-and-examples backend)
-
- ;; Protect short examples marked by a leading colon
- (org-export-protect-colon-examples)
-
- ;; Protected spaces
- (org-export-convert-protected-spaces backend)
-
- ;; Normalize footnotes
- (when (plist-get parameters :footnotes)
- (org-footnote-normalize nil t))
-
- ;; Find all headings and compute the targets for them
- (setq target-alist (org-export-define-heading-targets target-alist))
-
- (run-hooks 'org-export-preprocess-after-headline-targets-hook)
-
- ;; Find HTML special classes for headlines
- (org-export-remember-html-container-classes)
-
- ;; Get rid of drawers
- (org-export-remove-or-extract-drawers
- drawers (plist-get parameters :drawers) backend)
-
- ;; Get the correct stuff before the first headline
- (when (plist-get parameters :skip-before-1st-heading)
- (goto-char (point-min))
- (when (re-search-forward "^\\(#.*\n\\)?\\*+[ \t]" nil t)
- (delete-region (point-min) (match-beginning 0))
- (goto-char (point-min))
- (insert "\n")))
- (when (plist-get parameters :add-text)
- (goto-char (point-min))
- (insert (plist-get parameters :add-text) "\n"))
-
- ;; Remove todo-keywords before exporting, if the user has requested so
- (org-export-remove-headline-metadata parameters)
-
- ;; Find targets in comments and move them out of comments,
- ;; but mark them as targets that should be invisible
- (setq target-alist (org-export-handle-invisible-targets target-alist))
-
- ;; Select and protect backend specific stuff, throw away stuff
- ;; that is specific for other backends
- (run-hooks 'org-export-preprocess-before-selecting-backend-code-hook)
- (org-export-select-backend-specific-text backend)
-
- ;; Protect quoted subtrees
- (org-export-protect-quoted-subtrees)
-
- ;; Remove clock lines
- (org-export-remove-clock-lines)
-
- ;; Protect verbatim elements
- (org-export-protect-verbatim)
-
- ;; Blockquotes, verse, and center
- (org-export-mark-blockquote-verse-center)
- (run-hooks 'org-export-preprocess-after-blockquote-hook)
-
- ;; Remove timestamps, if the user has requested so
- (unless (plist-get parameters :timestamps)
- (org-export-remove-timestamps))
-
- ;; Attach captions to the correct object
- (setq target-alist (org-export-attach-captions-and-attributes
- backend target-alist))
-
- ;; Find matches for radio targets and turn them into internal links
- (org-export-mark-radio-links)
- (run-hooks 'org-export-preprocess-after-radio-targets-hook)
-
- ;; Find all links that contain a newline and put them into a single line
- (org-export-concatenate-multiline-links)
-
- ;; Normalize links: Convert angle and plain links into bracket links
- ;; and expand link abbreviations
- (run-hooks 'org-export-preprocess-before-normalizing-links-hook)
- (org-export-normalize-links)
-
- ;; Find all internal links. If they have a fuzzy match (i.e. not
- ;; a *dedicated* target match, let the link point to the
- ;; corresponding section.
- (org-export-target-internal-links target-alist)
-
- ;; Find multiline emphasis and put them into single line
- (when (plist-get parameters :emph-multiline)
- (org-export-concatenate-multiline-emphasis))
-
- ;; Remove special table lines, and store alignment information
- (org-store-forced-table-alignment)
- (when org-export-table-remove-special-lines
- (org-export-remove-special-table-lines))
-
- ;; Another hook
- (run-hooks 'org-export-preprocess-before-backend-specifics-hook)
-
- ;; LaTeX-specific preprocessing
- (when latexp
- (require 'org-latex nil)
- (org-export-latex-preprocess parameters))
-
- ;; ASCII-specific preprocessing
- (when asciip
- (org-export-ascii-preprocess parameters))
-
- ;; HTML-specific preprocessing
- (when htmlp
- (org-export-html-preprocess parameters))
-
- ;; DocBook-specific preprocessing
- (when docbookp
- (require 'org-docbook nil)
- (org-export-docbook-preprocess parameters))
-
- ;; Remove or replace comments
- (org-export-handle-comments (plist-get parameters :comments))
-
- ;; Remove #+TBLFM and #+TBLNAME lines
- (org-export-handle-table-metalines)
-
- ;; Run the final hook
- (run-hooks 'org-export-preprocess-final-hook)
-
- (setq rtn (buffer-string)))
- (kill-buffer " org-mode-tmp")
- rtn))
-
-(defun org-export-kill-licensed-text ()
- "Remove all text that is marked with a :org-license-to-kill property."
- (let (p)
- (while (setq p (text-property-any (point-min) (point-max)
- :org-license-to-kill t))
- (delete-region
- p (or (next-single-property-change p :org-license-to-kill)
- (point-max))))))
-
-(defvar org-export-define-heading-targets-headline-hook nil
- "Hook that is run when a headline was matched during target search.
-This is part of the preprocessing for export.")
-
-(defun org-export-define-heading-targets (target-alist)
- "Find all headings and define the targets for them.
-The new targets are added to TARGET-ALIST, which is also returned.
-Also find all ID and CUSTOM_ID properties and store them."
- (goto-char (point-min))
- (org-init-section-numbers)
- (let ((re (concat "^" org-outline-regexp
- "\\|"
- "^[ \t]*:\\(ID\\|CUSTOM_ID\\):[ \t]*\\([^ \t\r\n]+\\)"))
- level target last-section-target a id)
- (while (re-search-forward re nil t)
- (org-if-unprotected-at (match-beginning 0)
- (if (match-end 2)
- (progn
- (setq id (org-match-string-no-properties 2))
- (push (cons id target) target-alist)
- (setq a (or (assoc last-section-target org-export-target-aliases)
- (progn
- (push (list last-section-target)
- org-export-target-aliases)
- (car org-export-target-aliases))))
- (push (caar target-alist) (cdr a))
- (when (equal (match-string 1) "CUSTOM_ID")
- (if (not (assoc last-section-target
- org-export-preferred-target-alist))
- (push (cons last-section-target id)
- org-export-preferred-target-alist)))
- (when (equal (match-string 1) "ID")
- (if (not (assoc last-section-target
- org-export-id-target-alist))
- (push (cons last-section-target (concat "ID-" id))
- org-export-id-target-alist))))
- (setq level (org-reduced-level
- (save-excursion (goto-char (point-at-bol))
- (org-outline-level))))
- (setq target (org-solidify-link-text
- (format "sec-%s" (replace-regexp-in-string
- "\\." "_"
- (org-section-number level)))))
- (setq last-section-target target)
- (push (cons target target) target-alist)
- (add-text-properties
- (point-at-bol) (point-at-eol)
- (list 'target target))
- (run-hooks 'org-export-define-heading-targets-headline-hook)))))
- target-alist)
-
-(defun org-export-handle-invisible-targets (target-alist)
- "Find targets in comments and move them out of comments.
-Mark them as invisible targets."
- (let (target tmp a)
- (goto-char (point-min))
- (while (re-search-forward "^#.*?\\(<<<?\\([^>\r\n]+\\)>>>?\\).*" nil t)
- ;; Check if the line before or after is a headline with a target
- (if (setq target (or (get-text-property (point-at-bol 0) 'target)
- (get-text-property (point-at-bol 2) 'target)))
- (progn
- ;; use the existing target in a neighboring line
- (setq tmp (match-string 2))
- (replace-match "")
- (and (looking-at "\n") (delete-char 1))
- (push (cons (setq tmp (org-solidify-link-text tmp)) target)
- target-alist)
- (setq a (or (assoc target org-export-target-aliases)
- (progn
- (push (list target) org-export-target-aliases)
- (car org-export-target-aliases))))
- (push tmp (cdr a)))
- ;; Make an invisible target
- (replace-match "\\1(INVISIBLE)"))))
- target-alist)
-
-(defun org-export-target-internal-links (target-alist)
- "Find all internal links and assign targets to them.
-If a link has a fuzzy match (i.e. not a *dedicated* target match),
-let the link point to the corresponding section.
-This function also handles the id links, if they have a match in
-the current file."
- (goto-char (point-min))
- (while (re-search-forward org-bracket-link-regexp nil t)
- (org-if-unprotected-at (1+ (match-beginning 0))
- (let* ((md (match-data))
- (desc (match-end 2))
- (link (org-link-unescape (match-string 1)))
- (slink (org-solidify-link-text link))
- found props pos cref
- (target
- (cond
- ((= (string-to-char link) ?#)
- ;; user wants exactly this link
- link)
- ((cdr (assoc slink target-alist))
- (or (cdr (assoc (assoc slink target-alist)
- org-export-preferred-target-alist))
- (cdr (assoc slink target-alist))))
- ((and (string-match "^id:" link)
- (cdr (assoc (substring link 3) target-alist))))
- ((string-match "^(\\(.*\\))$" link)
- (setq cref (match-string 1 link))
- (concat "coderef:" cref))
- ((string-match org-link-types-re link) nil)
- ((or (file-name-absolute-p link)
- (string-match "^\\." link))
- nil)
- (t
- (let ((org-link-search-inhibit-query t))
- (save-excursion
- (setq found (condition-case nil (org-link-search link)
- (error nil)))
- (when (and found
- (or (org-on-heading-p)
- (not (eq found 'dedicated))))
- (or (get-text-property (point) 'target)
- (get-text-property
- (max (point-min)
- (1- (or (previous-single-property-change
- (point) 'target) 0)))
- 'target)))))))))
- (when target
- (set-match-data md)
- (goto-char (match-beginning 1))
- (setq props (text-properties-at (point)))
- (delete-region (match-beginning 1) (match-end 1))
- (setq pos (point))
- (insert target)
- (unless desc (insert "][" link))
- (add-text-properties pos (point) props))))))
-
-(defun org-export-remember-html-container-classes ()
- "Store the HTML_CONTAINER_CLASS properties in a text property."
- (goto-char (point-min))
- (let (class)
- (while (re-search-forward
- "^[ \t]*:HTML_CONTAINER_CLASS:[ \t]+\\(.+\\)$" nil t)
- (setq class (match-string 1))
- (save-excursion
- (org-back-to-heading t)
- (put-text-property (point-at-bol) (point-at-eol) 'html-container-class class)))))
-
-(defvar org-export-format-drawer-function nil
- "Function to be called to format the contents of a drawer.
-The function must accept three parameters:
- NAME the drawer name, like \"PROPERTIES\"
- CONTENT the content of the drawer.
- BACKEND one of the symbols html, docbook, latex, ascii, xoxo
-The function should return the text to be inserted into the buffer.
-If this is nil, `org-export-format-drawer' is used as a default.")
-
-(defun org-export-remove-or-extract-drawers (all-drawers exp-drawers backend)
- "Remove drawers, or extract and format the content.
-ALL-DRAWERS is a list of all drawer names valid in the current buffer.
-EXP-DRAWERS can be t to keep all drawer contents, or a list of drawers
-whose content to keep. Any drawers that are in ALL-DRAWERS but not in
-EXP-DRAWERS will be removed.
-BACKEND is the current export backend."
- (goto-char (point-min))
- (let ((re (concat "^[ \t]*:\\("
- (mapconcat 'identity all-drawers "\\|")
- "\\):[ \t]*$"))
- name beg beg-content eol content)
- (while (re-search-forward re nil t)
- (org-if-unprotected
- (setq name (match-string 1))
- (setq beg (match-beginning 0)
- beg-content (1+ (point-at-eol))
- eol (point-at-eol))
- (if (not (and (re-search-forward
- "^\\([ \t]*:END:[ \t]*\n?\\)\\|^\\*+[ \t]" nil t)
- (match-end 1)))
- (goto-char eol)
- (goto-char (match-beginning 0))
- (and (looking-at ".*\n?") (replace-match ""))
- (setq content (buffer-substring beg-content (point)))
- (delete-region beg (point))
- (when (or (eq exp-drawers t)
- (member name exp-drawers))
- (setq content (funcall (or org-export-format-drawer-function
- 'org-export-format-drawer)
- name content backend))
- (insert content)))))))
-
-(defun org-export-format-drawer (name content backend)
- "Format the content of a drawer as a colon example."
- (if (string-match "[ \t]+\\'" content)
- (setq content (substring content (match-beginning 0))))
- (while (string-match "\\`[ \t]*\n" content)
- (setq content (substring content (match-end 0))))
- (setq content (org-remove-indentation content))
- (setq content (concat ": " (mapconcat 'identity
- (org-split-string content "\n")
- "\n: ")
- "\n"))
- (setq content (concat " : " (upcase name) "\n" content))
- (org-add-props content nil 'org-protected t))
-
-(defun org-export-handle-export-tags (select-tags exclude-tags)
- "Modify the buffer, honoring SELECT-TAGS and EXCLUDE-TAGS.
-Both arguments are lists of tags.
-If any of SELECT-TAGS is found, all trees not marked by a SELECT-TAG
-will be removed.
-After that, all subtrees that are marked by EXCLUDE-TAGS will be
-removed as well."
- (remove-text-properties (point-min) (point-max) '(:org-delete t))
- (let* ((re-sel (concat ":\\(" (mapconcat 'regexp-quote
- select-tags "\\|")
- "\\):"))
- (re-excl (concat ":\\(" (mapconcat 'regexp-quote
- exclude-tags "\\|")
- "\\):"))
- beg end cont)
- (goto-char (point-min))
- (when (and select-tags
- (re-search-forward
- (concat "^\\*+[ \t].*" re-sel "[^ \t\n]*[ \t]*$") nil t))
- ;; At least one tree is marked for export, this means
- ;; all the unmarked stuff needs to go.
- ;; Dig out the trees that should be exported
- (goto-char (point-min))
- (outline-next-heading)
- (setq beg (point))
- (put-text-property beg (point-max) :org-delete t)
- (while (re-search-forward re-sel nil t)
- (when (org-on-heading-p)
- (org-back-to-heading)
- (remove-text-properties
- (max (1- (point)) (point-min))
- (setq cont (save-excursion (org-end-of-subtree t t)))
- '(:org-delete t))
- (while (and (org-up-heading-safe)
- (get-text-property (point) :org-delete))
- (remove-text-properties (max (1- (point)) (point-min))
- (point-at-eol) '(:org-delete t)))
- (goto-char cont))))
- ;; Remove the trees explicitly marked for noexport
- (when exclude-tags
- (goto-char (point-min))
- (while (re-search-forward re-excl nil t)
- (when (org-at-heading-p)
- (org-back-to-heading t)
- (setq beg (point))
- (org-end-of-subtree t t)
- (delete-region beg (point))
- (when (featurep 'org-inlinetask)
- (org-inlinetask-remove-END-maybe)))))
- ;; Remove everything that is now still marked for deletion
- (goto-char (point-min))
- (while (setq beg (text-property-any (point-min) (point-max) :org-delete t))
- (setq end (or (next-single-property-change beg :org-delete)
- (point-max)))
- (delete-region beg end))))
-
-(defun org-export-remove-archived-trees (export-archived-trees)
- "Remove archived trees.
-When EXPORT-ARCHIVED-TREES is `headline;, only the headline will be exported.
-When it is t, the entire archived tree will be exported.
-When it is nil the entire tree including the headline will be removed
-from the buffer."
- (let ((re-archive (concat ":" org-archive-tag ":"))
- a b)
- (when (not (eq export-archived-trees t))
- (goto-char (point-min))
- (while (re-search-forward re-archive nil t)
- (if (not (org-on-heading-p t))
- (goto-char (point-at-eol))
- (beginning-of-line 1)
- (setq a (if export-archived-trees
- (1+ (point-at-eol)) (point))
- b (org-end-of-subtree t))
- (if (> b a) (delete-region a b)))))))
-
-(defun org-export-remove-headline-metadata (opts)
- "Remove meta data from the headline, according to user options."
- (let ((re org-complex-heading-regexp)
- (todo (plist-get opts :todo-keywords))
- (tags (plist-get opts :tags))
- (pri (plist-get opts :priority))
- (elts '(1 2 3 4 5))
- rpl)
- (setq elts (delq nil (list 1 (if todo 2) (if pri 3) 4 (if tags 5))))
- (when (or (not todo) (not tags) (not pri))
- (goto-char (point-min))
- (while (re-search-forward re nil t)
- (org-if-unprotected
- (setq rpl (mapconcat (lambda (i) (if (match-end i) (match-string i) ""))
- elts " "))
- (replace-match rpl t t))))))
-
-(defun org-export-remove-timestamps ()
- "Remove timestamps and keywords for export."
- (goto-char (point-min))
- (while (re-search-forward org-maybe-keyword-time-regexp nil t)
- (backward-char 1)
- (org-if-unprotected
- (unless (save-match-data (org-at-table-p))
- (replace-match "")
- (beginning-of-line 1)
- (if (looking-at "[- \t]*\\(=>[- \t0-9:]*\\)?[ \t]*\n")
- (replace-match ""))))))
-
-(defun org-export-remove-clock-lines ()
- "Remove clock lines for export."
- (goto-char (point-min))
- (let ((re (concat "^[ \t]*" org-clock-string ".*\n?")))
- (while (re-search-forward re nil t)
- (org-if-unprotected
- (replace-match "")))))
-
-(defun org-export-protect-quoted-subtrees ()
- "Mark quoted subtrees with the protection property."
- (let ((re-quote (concat "^\\*+[ \t]+" org-quote-string "\\>")))
- (goto-char (point-min))
- (while (re-search-forward re-quote nil t)
- (goto-char (match-beginning 0))
- (end-of-line 1)
- (add-text-properties (point) (org-end-of-subtree t)
- '(org-protected t)))))
-
-(defun org-export-convert-protected-spaces (backend)
- "Convert strings like \\____ to protected spaces in all backends."
- (goto-char (point-min))
- (while (re-search-forward "\\\\__+" nil t)
- (org-if-unprotected-1
- (replace-match
- (org-add-props
- (cond
- ((eq backend 'latex)
- (format "\\hspace{%dex}" (- (match-end 0) (match-beginning 0))))
- ((eq backend 'html)
- (org-add-props (match-string 0) nil
- 'org-whitespace (- (match-end 0) (match-beginning 0))))
- ;; ((eq backend 'docbook))
- ((eq backend 'ascii)
- (org-add-props (match-string 0) '(org-whitespace t)))
- (t (make-string (- (match-end 0) (match-beginning 0)) ?\ )))
- '(org-protected t))
- t t))))
-
-(defun org-export-protect-verbatim ()
- "Mark verbatim snippets with the protection property."
- (goto-char (point-min))
- (while (re-search-forward org-verbatim-re nil t)
- (org-if-unprotected
- (add-text-properties (match-beginning 4) (match-end 4)
- '(org-protected t org-verbatim-emph t))
- (goto-char (1+ (match-end 4))))))
-
-(defun org-export-protect-colon-examples ()
- "Protect lines starting with a colon."
- (goto-char (point-min))
- (let ((re "^[ \t]*:\\([ \t]\\|$\\)") beg)
- (while (re-search-forward re nil t)
- (beginning-of-line 1)
- (setq beg (point))
- (while (looking-at re)
- (end-of-line 1)
- (or (eobp) (forward-char 1)))
- (add-text-properties beg (if (bolp) (1- (point)) (point))
- '(org-protected t)))))
-
-(defun org-export-select-backend-specific-text (backend)
- (let ((formatters
- '((docbook "DOCBOOK" "BEGIN_DOCBOOK" "END_DOCBOOK")
- (html "HTML" "BEGIN_HTML" "END_HTML")
- (beamer "BEAMER" "BEGIN_BEAMER" "END_BEAMER")
- (ascii "ASCII" "BEGIN_ASCII" "END_ASCII")
- (latex "LaTeX" "BEGIN_LaTeX" "END_LaTeX")))
- (case-fold-search t)
- fmt beg beg-content end end-content)
-
- (while formatters
- (setq fmt (pop formatters))
- ;; Handle #+Backend: stuff
- (goto-char (point-min))
- (while (re-search-forward (concat "^\\([ \t]*\\)#\\+" (cadr fmt)
- ":[ \t]*\\(.*\\)") nil t)
- (if (not (eq (car fmt) backend))
- (delete-region (point-at-bol) (min (1+ (point-at-eol)) (point-max)))
- (replace-match "\\1\\2" t)
- (add-text-properties
- (point-at-bol) (min (1+ (point-at-eol)) (point-max))
- '(org-protected t))))
- ;; Delete #+attr_Backend: stuff of another backend. Those
- ;; matching the current backend will be taken care of by
- ;; `org-export-attach-captions-and-attributes'
- (goto-char (point-min))
- (while (re-search-forward (concat "^\\([ \t]*\\)#\\+attr_" (cadr fmt)
- ":[ \t]*\\(.*\\)") nil t)
- (when (not (eq (car fmt) backend))
- (delete-region (point-at-bol) (min (1+ (point-at-eol)) (point-max)))))
- ;; Handle #+begin_Backend and #+end_Backend stuff
- (goto-char (point-min))
- (while (re-search-forward (concat "^[ \t]*#\\+" (caddr fmt) "\\>.*\n?")
- nil t)
- (setq beg (match-beginning 0) beg-content (match-end 0))
- (when (re-search-forward (concat "^[ \t]*#\\+" (cadddr fmt) "\\>.*\n?")
- nil t)
- (setq end (match-end 0) end-content (match-beginning 0))
- (if (eq (car fmt) backend)
- ;; yes, keep this
- (progn
- (add-text-properties beg-content end-content '(org-protected t))
- (delete-region (match-beginning 0) (match-end 0))
- (save-excursion
- (goto-char beg)
- (delete-region (point) (1+ (point-at-eol)))))
- ;; No, this is for a different backend, kill it
- (delete-region beg end)))))))
-
-(defun org-export-mark-blockquote-verse-center ()
- "Mark block quote and verse environments with special cookies.
-These special cookies will later be interpreted by the backend."
- ;; Blockquotes
- (let (type t1 ind beg end beg1 end1 content)
- (goto-char (point-min))
- (while (re-search-forward
- "^\\([ \t]*\\)#\\+\\(begin_\\(\\(block\\)?quote\\|verse\\|center\\)\\>.*\\)"
- nil t)
- (setq ind (length (match-string 1))
- type (downcase (match-string 3))
- t1 (if (equal type "quote") "blockquote" type))
- (setq beg (match-beginning 0)
- beg1 (1+ (match-end 0)))
- (when (re-search-forward (concat "^[ \t]*#\\+end_" type "\\>.*") nil t)
- (setq end1 (1- (match-beginning 0))
- end (+ (point-at-eol) (if (looking-at "\n$") 1 0)))
- (setq content (org-remove-indentation (buffer-substring beg1 end1)))
- (setq content (concat "ORG-" (upcase t1) "-START\n"
- content "\n"
- "ORG-" (upcase t1) "-END\n"))
- (delete-region beg end)
- (insert (org-add-props content nil 'original-indentation ind))))))
-
-(defun org-export-mark-list-ending (backend)
- "Mark list endings with special cookies.
-These special cookies will later be interpreted by the backend.
-`org-list-end-re' is replaced by a blank line in the process."
- (let ((process-buffer
- (lambda (end-list-marker)
- (goto-char (point-min))
- (while (org-search-forward-unenclosed org-item-beginning-re nil t)
- (goto-char (org-list-bottom-point))
- (when (and (not (eq org-list-ending-method 'indent))
- (looking-at (org-list-end-re)))
- (replace-match "\n"))
- (insert end-list-marker)))))
- ;; We need to divide backends into 3 categories.
- (cond
- ;; 1. Backends using `org-list-parse-list' do not need markers.
- ((memq backend '(latex))
- nil)
- ;; 2. Line-processing backends need to be told where lists end.
- ((memq backend '(html docbook))
- (funcall process-buffer "ORG-LIST-END\n"))
- ;; 3. Others backends do not need to know this: clean list enders.
- (t
- (funcall process-buffer "")))))
-
-(defun org-export-attach-captions-and-attributes (backend target-alist)
- "Move #+CAPTION, #+ATTR_BACKEND, and #+LABEL text into text properties.
-If the next thing following is a table, add the text properties to the first
-table line. If it is a link, add it to the line containing the link."
- (goto-char (point-min))
- (remove-text-properties (point-min) (point-max)
- '(org-caption nil org-attributes nil))
- (let ((case-fold-search t)
- (re (concat "^[ \t]*#\\+caption:[ \t]+\\(.*\\)"
- "\\|"
- "^[ \t]*#\\+attr_" (symbol-name backend) ":[ \t]+\\(.*\\)"
- "\\|"
- "^[ \t]*#\\+label:[ \t]+\\(.*\\)"
- "\\|"
- "^[ \t]*\\(|[^-]\\)"
- "\\|"
- "^[ \t]*\\[\\[.*\\]\\][ \t]*$"))
- cap shortn attr label end)
- (while (re-search-forward re nil t)
- (cond
- ((match-end 1)
- (progn
- (setq cap (concat cap (if cap " " "") (org-trim (match-string 1))))
- (when (string-match "\\[\\(.*\\)\\]{\\(.*\\)}" cap)
- (setq shortn (match-string 1 cap)
- cap (match-string 2 cap)))
- (delete-region (point-at-bol) (min (1+ (point-at-eol)) (point-max)))))
- ((match-end 2)
- (progn
- (setq attr (concat attr (if attr " " "") (org-trim (match-string 2))))
- (delete-region (point-at-bol) (min (1+ (point-at-eol)) (point-max)))))
- ((match-end 3)
- (progn
- (setq label (org-trim (match-string 3)))
- (delete-region (point-at-bol) (min (1+ (point-at-eol)) (point-max)))))
- (t
- (setq end (if (match-end 4)
- (let ((ee (org-table-end)))
- (prog1 (1- (marker-position ee)) (move-marker ee nil)))
- (point-at-eol)))
- (add-text-properties (point-at-bol) end
- (list 'org-caption cap
- 'org-caption-shortn shortn
- 'org-attributes attr
- 'org-label label))
- (if label (push (cons label label) target-alist))
- (goto-char end)
- (setq cap nil attr nil label nil)))))
- target-alist)
-
-(defun org-export-remove-comment-blocks-and-subtrees ()
- "Remove the comment environment, and also commented subtrees."
- (let ((re-commented (concat "^\\*+[ \t]+" org-comment-string "\\>"))
- case-fold-search)
- ;; Remove comment environment
- (goto-char (point-min))
- (setq case-fold-search t)
- (while (re-search-forward
- "^#\\+begin_comment[ \t]*\n[^\000]*?^#\\+end_comment\\>.*" nil t)
- (replace-match "" t t))
- ;; Remove subtrees that are commented
- (goto-char (point-min))
- (setq case-fold-search nil)
- (while (re-search-forward re-commented nil t)
- (goto-char (match-beginning 0))
- (delete-region (point) (org-end-of-subtree t)))))
-
-(defun org-export-handle-comments (commentsp)
- "Remove comments, or convert to backend-specific format.
-COMMENTSP can be a format string for publishing comments.
-When it is nil, all comments will be removed."
- (let ((re "^\\(#\\|[ \t]*#\\+ \\)\\(.*\n?\\)")
- pos)
- (goto-char (point-min))
- (while (or (looking-at re)
- (re-search-forward re nil t))
- (setq pos (match-beginning 0))
- (if (get-text-property pos 'org-protected)
- (goto-char (1+ pos))
- (if (and commentsp
- (not (equal (char-before (match-end 1)) ?+)))
- (progn (add-text-properties
- (match-beginning 0) (match-end 0) '(org-protected t))
- (replace-match (format commentsp (match-string 2)) t t))
- (goto-char (1+ pos))
- (replace-match "")
- (goto-char (max (point-min) (1- pos))))))))
-
-(defun org-export-handle-table-metalines ()
- "Remove table specific metalines #+TBLNAME: and #+TBLFM:."
- (let ((re "^[ \t]*#\\+TBL\\(NAME\\|FM\\):\\(.*\n?\\)")
- pos)
- (goto-char (point-min))
- (while (or (looking-at re)
- (re-search-forward re nil t))
- (setq pos (match-beginning 0))
- (if (get-text-property (match-beginning 1) 'org-protected)
- (goto-char (1+ pos))
- (goto-char (1+ pos))
- (replace-match "")
- (goto-char (max (point-min) (1- pos)))))))
-
-(defun org-export-mark-radio-links ()
- "Find all matches for radio targets and turn them into internal links."
- (let ((re-radio (and org-target-link-regexp
- (concat "\\([^<]\\)\\(" org-target-link-regexp "\\)"))))
- (goto-char (point-min))
- (when re-radio
- (while (re-search-forward re-radio nil t)
- (unless
- (save-match-data
- (or (org-in-regexp org-bracket-link-regexp)
- (org-in-regexp org-plain-link-re)
- (org-in-regexp "<<[^<>]+>>")))
- (org-if-unprotected
- (replace-match "\\1[[\\2]]")))))))
-
-(defun org-store-forced-table-alignment ()
- "Find table lines which force alignment, store the results in properties."
- (let (line cnt aligns)
- (goto-char (point-min))
- (while (re-search-forward "|[ \t]*<[lrc][0-9]*>[ \t]*|" nil t)
- ;; OK, this looks like a table line with an alignment cookie
- (org-if-unprotected
- (setq line (buffer-substring (point-at-bol) (point-at-eol)))
- (when (and (org-at-table-p)
- (org-table-cookie-line-p line))
- (setq cnt 0 aligns nil)
- (mapc
- (lambda (x)
- (setq cnt (1+ cnt))
- (if (string-match "\\`<\\([lrc]\\)" x)
- (push (cons cnt (downcase (match-string 1 x))) aligns)))
- (org-split-string line "[ \t]*|[ \t]*"))
- (add-text-properties (org-table-begin) (org-table-end)
- (list 'org-forced-aligns aligns))))
- (goto-char (point-at-eol)))))
-
-(defun org-export-remove-special-table-lines ()
- "Remove tables lines that are used for internal purposes.
-Also, store forcedalignment information found in such lines."
- (goto-char (point-min))
- (while (re-search-forward "^[ \t]*|" nil t)
- (org-if-unprotected-at (1- (point))
- (beginning-of-line 1)
- (if (or (looking-at "[ \t]*| *[!_^] *|")
- (not
- (memq
- nil
- (mapcar
- (lambda (f)
- (or (= (length f) 0)
- (string-match
- "\\`<\\([0-9]\\|[lrc]\\|[lrc][0-9]+\\)>\\'" f)))
- (org-split-string ;; FIXME, can't we do without splitting???
- (buffer-substring (point-at-bol) (point-at-eol))
- "[ \t]*|[ \t]*")))))
- (delete-region (max (point-min) (1- (point-at-bol)))
- (point-at-eol))
- (end-of-line 1)))))
-
-(defun org-export-protect-sub-super (s)
- (save-match-data
- (while (string-match "\\([^\\\\]\\)\\([_^]\\)" s)
- (setq s (replace-match "\\1\\\\\\2" nil nil s)))
- s))
-
-(defun org-export-normalize-links ()
- "Convert all links to bracket links, and expand link abbreviations."
- (let ((re-plain-link (concat "\\([^[<]\\)" org-plain-link-re))
- (re-angle-link (concat "\\([^[]\\)" org-angle-link-re))
- nodesc)
- (goto-char (point-min))
- (while (re-search-forward re-plain-link nil t)
- (unless (org-string-match-p
- "\\[\\[\\S+:\\S-*?\\<"
- (buffer-substring (point-at-bol) (match-beginning 0)))
- (goto-char (1- (match-end 0)))
- (org-if-unprotected-at (1+ (match-beginning 0))
- (let* ((s (concat (match-string 1)
- "[[" (match-string 2) ":" (match-string 3)
- "][" (match-string 2) ":" (org-export-protect-sub-super
- (match-string 3))
- "]]")))
- ;; added 'org-link face to links
- (put-text-property 0 (length s) 'face 'org-link s)
- (replace-match s t t)))))
- (goto-char (point-min))
- (while (re-search-forward re-angle-link nil t)
- (goto-char (1- (match-end 0)))
- (org-if-unprotected
- (let* ((s (concat (match-string 1)
- "[[" (match-string 2) ":" (match-string 3)
- "][" (match-string 2) ":" (org-export-protect-sub-super
- (match-string 3))
- "]]")))
- (put-text-property 0 (length s) 'face 'org-link s)
- (replace-match s t t))))
- (goto-char (point-min))
- (while (re-search-forward org-bracket-link-regexp nil t)
- (goto-char (1- (match-end 0)))
- (setq nodesc (not (match-end 3)))
- (org-if-unprotected
- (let* ((xx (save-match-data
- (org-translate-link
- (org-link-expand-abbrev (match-string 1)))))
- (s (concat
- "[[" (org-add-props (copy-sequence xx)
- nil 'org-protected t 'org-no-description nodesc)
- "]"
- (if (match-end 3)
- (match-string 2)
- (concat "[" (copy-sequence xx)
- "]"))
- "]")))
- (put-text-property 0 (length s) 'face 'org-link s)
- (replace-match s t t))))))
-
-(defun org-export-concatenate-multiline-links ()
- "Find multi-line links and put it all into a single line.
-This is to make sure that the line-processing export backends
-can work correctly."
- (goto-char (point-min))
- (while (re-search-forward "\\(\\(\\[\\|\\]\\)\\[[^]]*?\\)[ \t]*\n[ \t]*\\([^]]*\\]\\(\\[\\|\\]\\)\\)" nil t)
- (org-if-unprotected-at (match-beginning 1)
- (replace-match "\\1 \\3")
- (goto-char (match-beginning 0)))))
-
-(defun org-export-concatenate-multiline-emphasis ()
- "Find multi-line emphasis and put it all into a single line.
-This is to make sure that the line-processing export backends
-can work correctly."
- (goto-char (point-min))
- (while (re-search-forward org-emph-re nil t)
- (if (and (not (= (char-after (match-beginning 3))
- (char-after (match-beginning 4))))
- (save-excursion (goto-char (match-beginning 0))
- (save-match-data
- (and (not (org-at-table-p))
- (not (org-at-heading-p))))))
- (org-if-unprotected
- (subst-char-in-region (match-beginning 0) (match-end 0)
- ?\n ?\ t)
- (goto-char (1- (match-end 0))))
- (goto-char (1+ (match-beginning 0))))))
-
-(defun org-export-grab-title-from-buffer ()
- "Get a title for the current document, from looking at the buffer."
- (let ((inhibit-read-only t))
- (save-excursion
- (goto-char (point-min))
- (let ((end (if (looking-at org-outline-regexp)
- (point)
- (save-excursion (outline-next-heading) (point)))))
- (when (re-search-forward "^[ \t]*[^|# \t\r\n].*\n" end t)
- ;; Mark the line so that it will not be exported as normal text.
- (org-unmodified
- (add-text-properties (match-beginning 0) (match-end 0)
- (list :org-license-to-kill t)))
- ;; Return the title string
- (org-trim (match-string 0)))))))
-
-(defun org-export-get-title-from-subtree ()
- "Return subtree title and exclude it from export."
- (let (title (rbeg (region-beginning)) (rend (region-end)))
- (save-excursion
- (goto-char rbeg)
- (when (and (org-at-heading-p)
- (>= (org-end-of-subtree t t) rend))
- ;; This is a subtree, we take the title from the first heading
- (goto-char rbeg)
- (looking-at org-todo-line-regexp)
- (setq title (match-string 3))
- (org-unmodified
- (add-text-properties (point) (1+ (point-at-eol))
- (list :org-license-to-kill t)))
- (setq title (or (org-entry-get nil "EXPORT_TITLE") title))))
- title))
-
-(defun org-solidify-link-text (s &optional alist)
- "Take link text and make a safe target out of it."
- (save-match-data
- (let* ((rtn
- (mapconcat
- 'identity
- (org-split-string s "[ \t\r\n]+") "=="))
- (a (assoc rtn alist)))
- (or (cdr a) rtn))))
-
-(defun org-get-min-level (lines &optional offset)
- "Get the minimum level in LINES."
- (let ((re "^\\(\\*+\\) ") l)
- (catch 'exit
- (while (setq l (pop lines))
- (if (string-match re l)
- (throw 'exit (org-tr-level (- (length (match-string 1 l))
- (or offset 0))))))
- 1)))
-
-;; Variable holding the vector with section numbers
-(defvar org-section-numbers (make-vector org-level-max 0))
-
-(defun org-init-section-numbers ()
- "Initialize the vector for the section numbers."
- (let* ((level -1)
- (numbers (nreverse (org-split-string "" "\\.")))
- (depth (1- (length org-section-numbers)))
- (i depth) number-string)
- (while (>= i 0)
- (if (> i level)
- (aset org-section-numbers i 0)
- (setq number-string (or (car numbers) "0"))
- (if (string-match "\\`[A-Z]\\'" number-string)
- (aset org-section-numbers i
- (- (string-to-char number-string) ?A -1))
- (aset org-section-numbers i (string-to-number number-string)))
- (pop numbers))
- (setq i (1- i)))))
-
-(defun org-section-number (&optional level)
- "Return a string with the current section number.
-When LEVEL is non-nil, increase section numbers on that level."
- (let* ((depth (1- (length org-section-numbers)))
- (string "")
- (fmts (car org-export-section-number-format))
- (term (cdr org-export-section-number-format))
- (sep "")
- ctype fmt idx n)
- (when level
- (when (> level -1)
- (aset org-section-numbers
- level (1+ (aref org-section-numbers level))))
- (setq idx (1+ level))
- (while (<= idx depth)
- (if (not (= idx 1))
- (aset org-section-numbers idx 0))
- (setq idx (1+ idx))))
- (setq idx 0)
- (while (<= idx depth)
- (when (> (aref org-section-numbers idx) 0)
- (setq fmt (or (pop fmts) fmt)
- ctype (car fmt)
- n (aref org-section-numbers idx)
- string (if (> n 0)
- (concat string sep (org-number-to-counter n ctype))
- (concat string ".0"))
- sep (nth 1 fmt)))
- (setq idx (1+ idx)))
- (save-match-data
- (if (string-match "\\`\\([@0]\\.\\)+" string)
- (setq string (replace-match "" t nil string)))
- (if (string-match "\\(\\.0\\)+\\'" string)
- (setq string (replace-match "" t nil string))))
- (concat string term)))
-
-(defun org-number-to-counter (n type)
- "Concert number N to a string counter, according to TYPE.
-TYPE must be a string, any of:
- 1 number
- A A,B,....
- a a,b,....
- I upper case roman numeral
- i lower case roman numeral"
- (cond
- ((equal type "1") (number-to-string n))
- ((equal type "A") (char-to-string (+ ?A n -1)))
- ((equal type "a") (char-to-string (+ ?a n -1)))
- ((equal type "I") (org-number-to-roman n))
- ((equal type "i") (downcase (org-number-to-roman n)))
- (t (error "Invalid counter type `%s'" type))))
-
-(defun org-number-to-roman (n)
- "Convert integer N into a roman numeral."
- (let ((roman '((1000 . "M") (900 . "CM") (500 . "D") (400 . "CD")
- ( 100 . "C") ( 90 . "XC") ( 50 . "L") ( 40 . "XL")
- ( 10 . "X") ( 9 . "IX") ( 5 . "V") ( 4 . "IV")
- ( 1 . "I")))
- (res ""))
- (if (<= n 0)
- (number-to-string n)
- (while roman
- (if (>= n (caar roman))
- (setq n (- n (caar roman))
- res (concat res (cdar roman)))
- (pop roman)))
- res)))
-
-;;; Macros
-
-(defun org-export-preprocess-apply-macros ()
- "Replace macro references."
- (goto-char (point-min))
- (let (sy val key args args2 s n)
- (while (re-search-forward
- "{{{\\([a-zA-Z][-a-zA-Z0-9_]*\\)\\(([ \t\n]*\\([^\000]*?\\))\\)?}}}"
- nil t)
- (unless (save-match-data
- (save-excursion
- (goto-char (point-at-bol))
- (looking-at "[ \t]*#\\+macro")))
- (setq key (downcase (match-string 1))
- args (match-string 3))
- (when (setq val (or (plist-get org-export-opt-plist
- (intern (concat ":macro-" key)))
- (plist-get org-export-opt-plist
- (intern (concat ":" key)))))
- (save-match-data
- (when args
- (setq args (org-split-string args ",") args2 nil)
- (while args
- (while (string-match "\\\\\\'" (car args))
- ;; repair bad splits
- (setcar (cdr args) (concat (substring (car args) 0 -1)
- "," (nth 1 args)))
- (pop args))
- (push (pop args) args2))
- (setq args (mapcar 'org-trim (nreverse args2)))
- (setq s 0)
- (while (string-match "\\$\\([0-9]+\\)" val s)
- (setq s (1+ (match-beginning 0))
- n (string-to-number (match-string 1 val)))
- (and (>= (length args) n)
- (setq val (replace-match (nth (1- n) args) t t val)))))
- (when (string-match "\\`(eval\\>" val)
- (setq val (eval (read val))))
- (if (and val (not (stringp val)))
- (setq val (format "%s" val))))
- (and (stringp val)
- (prog1 (replace-match val t t)
- (goto-char (match-beginning 0)))))))))
-
-(defun org-export-apply-macros-in-string (s)
- "Apply the macros in string S."
- (when s
- (with-temp-buffer
- (insert s)
- (org-export-preprocess-apply-macros)
- (buffer-string))))
-
-;;; Include files
-
-(defun org-export-handle-include-files ()
- "Include the contents of include files, with proper formatting."
- (let ((case-fold-search t)
- params file markup lang start end prefix prefix1 switches all minlevel)
- (goto-char (point-min))
- (while (re-search-forward "^#\\+INCLUDE:?[ \t]+\\(.*\\)" nil t)
- (setq params (read (concat "(" (match-string 1) ")"))
- prefix (org-get-and-remove-property 'params :prefix)
- prefix1 (org-get-and-remove-property 'params :prefix1)
- minlevel (org-get-and-remove-property 'params :minlevel)
- file (org-symname-or-string (pop params))
- markup (org-symname-or-string (pop params))
- lang (and (member markup '("src" "SRC"))
- (org-symname-or-string (pop params)))
- switches (mapconcat '(lambda (x) (format "%s" x)) params " ")
- start nil end nil)
- (delete-region (match-beginning 0) (match-end 0))
- (if (or (not file)
- (not (file-exists-p file))
- (not (file-readable-p file)))
- (insert (format "CANNOT INCLUDE FILE %s" file))
- (setq all (cons file all))
- (when markup
- (if (equal (downcase markup) "src")
- (setq start (format "#+begin_src %s %s\n"
- (or lang "fundamental")
- (or switches ""))
- end "#+end_src")
- (setq start (format "#+begin_%s %s\n" markup switches)
- end (format "#+end_%s" markup))))
- (insert (or start ""))
- (insert (org-get-file-contents (expand-file-name file)
- prefix prefix1 markup minlevel))
- (or (bolp) (newline))
- (insert (or end ""))))
- all))
-
-(defun org-export-handle-include-files-recurse ()
- "Recursively include files aborting on circular inclusion."
- (let ((now (list org-current-export-file)) all)
- (while now
- (setq all (append now all))
- (setq now (org-export-handle-include-files))
- (let ((intersection
- (delq nil
- (mapcar (lambda (el) (when (member el all) el)) now))))
- (when intersection
- (error "Recursive #+INCLUDE: %S" intersection))))))
-
-(defun org-get-file-contents (file &optional prefix prefix1 markup minlevel)
- "Get the contents of FILE and return them as a string.
-If PREFIX is a string, prepend it to each line. If PREFIX1
-is a string, prepend it to the first line instead of PREFIX.
-If MARKUP, don't protect org-like lines, the exporter will
-take care of the block they are in."
- (if (stringp markup) (setq markup (downcase markup)))
- (with-temp-buffer
- (insert-file-contents file)
- (when (or prefix prefix1)
- (goto-char (point-min))
- (while (not (eobp))
- (insert (or prefix1 prefix))
- (setq prefix1 "")
- (beginning-of-line 2)))
- (buffer-string)
- (when (member markup '("src" "example"))
- (goto-char (point-min))
- (while (re-search-forward "^\\([*#]\\|[ \t]*#\\+\\)" nil t)
- (goto-char (match-beginning 0))
- (insert ",")
- (end-of-line 1)))
- (when minlevel
- (dotimes (lvl minlevel)
- (org-map-region 'org-demote (point-min) (point-max))))
- (buffer-string)))
-
-(defun org-get-and-remove-property (listvar prop)
- "Check if the value of LISTVAR contains PROP as a property.
-If yes, return the value of that property (i.e. the element following
-in the list) and remove property and value from the list in LISTVAR."
- (let ((list (symbol-value listvar)) m v)
- (when (setq m (member prop list))
- (setq v (nth 1 m))
- (if (equal (car list) prop)
- (set listvar (cddr list))
- (setcdr (nthcdr (- (length list) (length m) 1) list)
- (cddr m))
- (set listvar list)))
- v))
-
-(defun org-symname-or-string (s)
- (if (symbolp s)
- (if s (symbol-name s) s)
- s))
-
-;;; Fontification and line numbers for code examples
-
-(defvar org-export-last-code-line-counter-value 0)
-
-(defun org-export-replace-src-segments-and-examples (backend)
- "Replace source code segments with special code for export."
- (setq org-export-last-code-line-counter-value 0)
- (let ((case-fold-search t)
- lang code trans opts indent caption)
- (goto-char (point-min))
- (while (re-search-forward
- "\\(^\\([ \t]*\\)#\\+BEGIN_SRC:?\\([ \t]+\\([^ \t\n]+\\)\\)?\\(.*\\)\n\\([^\000]+?\n\\)[ \t]*#\\+END_SRC.*\n?\\)\\|\\(^\\([ \t]*\\)#\\+BEGIN_EXAMPLE:?\\(?:[ \t]+\\(.*\\)\\)?\n\\([^\000]+?\n\\)[ \t]*#\\+END_EXAMPLE.*\n?\\)"
- nil t)
- (if (match-end 1)
- (if (not (match-string 4))
- (error "Source block missing language specification: %s"
- (let* ((body (match-string 6))
- (nothing (message "body:%s" body))
- (preview (or (and (string-match
- "^[ \t]*\\([^\n\r]*\\)" body)
- (match-string 1 body)) body)))
- (if (> (length preview) 35)
- (concat (substring preview 0 32) "...")
- preview)))
- ;; src segments
- (setq lang (match-string 4)
- opts (match-string 5)
- code (match-string 6)
- indent (length (match-string 2))
- caption (get-text-property 0 'org-caption (match-string 0))))
- (setq lang nil
- opts (match-string 9)
- code (match-string 10)
- indent (length (match-string 8))
- caption (get-text-property 0 'org-caption (match-string 0))))
-
- (setq trans (org-export-format-source-code-or-example
- backend lang code opts indent caption))
- (replace-match trans t t))))
-
-(defvar htmlp) ;; dynamically scoped
-(defvar latexp) ;; dynamically scoped
-(defvar org-export-latex-verbatim-wrap) ;; defined in org-latex.el
-(defvar org-export-latex-listings) ;; defined in org-latex.el
-(defvar org-export-latex-listings-langs) ;; defined in org-latex.el
-(defvar org-export-latex-listings-w-names) ;; defined in org-latex.el
-(defvar org-export-latex-minted-langs) ;; defined in org-latex.el
-(defun org-export-format-source-code-or-example
- (backend lang code &optional opts indent caption)
- "Format CODE from language LANG and return it formatted for export.
-If LANG is nil, do not add any fontification.
-OPTS contains formatting options, like `-n' for triggering numbering lines,
-and `+n' for continuing previous numbering.
-Code formatting according to language currently only works for HTML.
-Numbering lines works for all three major backends (html, latex, and ascii).
-INDENT was the original indentation of the block."
- (save-match-data
- (let (num cont rtn rpllbl keepp textareap preserve-indentp cols rows fmt)
- (setq opts (or opts "")
- num (string-match "[-+]n\\>" opts)
- cont (string-match "\\+n\\>" opts)
- rpllbl (string-match "-r\\>" opts)
- keepp (string-match "-k\\>" opts)
- textareap (string-match "-t\\>" opts)
- preserve-indentp (or org-src-preserve-indentation
- (string-match "-i\\>" opts))
- cols (if (string-match "-w[ \t]+\\([0-9]+\\)" opts)
- (string-to-number (match-string 1 opts))
- 80)
- rows (if (string-match "-h[ \t]+\\([0-9]+\\)" opts)
- (string-to-number (match-string 1 opts))
- (org-count-lines code))
- fmt (if (string-match "-l[ \t]+\"\\([^\"\n]+\\)\"" opts)
- (match-string 1 opts)))
- (when (and textareap (eq backend 'html))
- ;; we cannot use numbering or highlighting.
- (setq num nil cont nil lang nil))
- (if keepp (setq rpllbl 'keep))
- (setq rtn (if preserve-indentp code (org-remove-indentation code)))
- (when (string-match "^," rtn)
- (setq rtn (with-temp-buffer
- (insert rtn)
- ;; Free up the protected lines
- (goto-char (point-min))
- (while (re-search-forward "^," nil t)
- (if (or (equal lang "org")
- (save-match-data
- (looking-at "\\([*#]\\|[ \t]*#\\+\\)")))
- (replace-match ""))
- (end-of-line 1))
- (buffer-string))))
- ;; Now backend-specific coding
- (setq rtn
- (cond
- ((eq backend 'docbook)
- (setq rtn (org-export-number-lines rtn 'docbook 0 0 num cont rpllbl fmt))
- (concat "\n#+BEGIN_DOCBOOK\n"
- (org-add-props (concat "<programlisting><![CDATA["
- rtn
- "]]></programlisting>\n")
- '(org-protected t org-example t))
- "#+END_DOCBOOK\n"))
- ((eq backend 'html)
- ;; We are exporting to HTML
- (when lang
- (if (featurep 'xemacs)
- (require 'htmlize)
- (require 'htmlize nil t))
- (when (not (fboundp 'htmlize-region-for-paste))
- ;; we do not have htmlize.el, or an old version of it
- (setq lang nil)
- (message
- "htmlize.el 1.34 or later is needed for source code formatting")))
-
- (if lang
- (let* ((lang-m (when lang
- (or (cdr (assoc lang org-src-lang-modes))
- lang)))
- (mode (and lang-m (intern
- (concat
- (if (symbolp lang-m)
- (symbol-name lang-m)
- lang-m)
- "-mode"))))
- (org-inhibit-startup t)
- (org-startup-folded nil))
- (setq rtn
- (with-temp-buffer
- (insert rtn)
- (if (functionp mode)
- (funcall mode)
- (fundamental-mode))
- (font-lock-fontify-buffer)
- (org-src-mode)
- (set-buffer-modified-p nil)
- (org-export-htmlize-region-for-paste
- (point-min) (point-max))))
- (if (string-match "<pre\\([^>]*\\)>\n*" rtn)
- (setq rtn
- (concat
- (if caption
- (concat
- "<div class=\"org-src-container\">"
- (format
- "<label class=\"org-src-name\">%s</label>"
- caption))
- "")
- (replace-match
- (format "<pre class=\"src src-%s\">\n" lang)
- t t rtn)
- (if caption "</div>" "")))))
- (if textareap
- (setq rtn (concat
- (format "<p>\n<textarea cols=\"%d\" rows=\"%d\">"
- cols rows)
- rtn "</textarea>\n</p>\n"))
- (with-temp-buffer
- (insert rtn)
- (goto-char (point-min))
- (while (re-search-forward "[<>&]" nil t)
- (replace-match (cdr (assq (char-before)
- '((?&."&amp;")(?<."&lt;")(?>."&gt;"))))
- t t))
- (setq rtn (buffer-string)))
- (setq rtn (concat "<pre class=\"example\">\n" rtn "</pre>\n"))))
- (unless textareap
- (setq rtn (org-export-number-lines rtn 'html 1 1 num
- cont rpllbl fmt)))
- (if (string-match "\\(\\`<[^>]*>\\)\n" rtn)
- (setq rtn (replace-match "\\1" t nil rtn)))
- (concat "\n#+BEGIN_HTML\n" (org-add-props rtn '(org-protected t org-example t)) "\n#+END_HTML\n\n"))
- ((eq backend 'latex)
- (setq rtn (org-export-number-lines rtn 'latex 0 0 num cont rpllbl fmt))
- (concat "#+BEGIN_LaTeX\n"
- (org-add-props
- (cond
- ((and org-export-latex-listings
- (not (eq org-export-latex-listings 'minted)))
- (concat
- (if lang
- (let*
- ((lang-sym (intern lang))
- (lstlang
- (or (cadr
- (assq
- lang-sym
- org-export-latex-listings-langs))
- lang)))
- (format "\\lstset{language=%s}\n" lstlang))
- "\n")
- (when (and caption
- org-export-latex-listings-w-names)
- (format "\n%s $\\equiv$ \n"
- (replace-regexp-in-string
- "_" "\\\\_" caption)))
- "\\begin{lstlisting}\n"
- rtn "\\end{lstlisting}\n"))
- ((eq org-export-latex-listings 'minted)
- (if lang
- (let*
- ((lang-sym (intern lang))
- (minted-lang
- (or (cadr
- (assq
- lang-sym
- org-export-latex-minted-langs))
- (downcase lang))))
- (concat
- (when (and caption
- org-export-latex-listings-w-names)
- (format "\n%s $\\equiv$ \n"
- (replace-regexp-in-string
- "_" "\\\\_" caption)))
- (format "\\begin{minted}{%s}\n" minted-lang)
- rtn "\\end{minted}\n"))))
- (t (concat (car org-export-latex-verbatim-wrap)
- rtn (cdr org-export-latex-verbatim-wrap))))
- '(org-protected t org-example t))
- "#+END_LaTeX\n"))
- ((eq backend 'ascii)
- ;; This is not HTML or LaTeX, so just make it an example.
- (setq rtn (org-export-number-lines rtn 'ascii 0 0 num cont rpllbl fmt))
- (concat caption "\n"
- "#+BEGIN_ASCII\n"
- (org-add-props
- (concat
- (mapconcat
- (lambda (l) (concat " " l))
- (org-split-string rtn "\n")
- "\n")
- "\n")
- '(org-protected t org-example t))
- "#+END_ASCII\n"))))
- (org-add-props rtn nil 'original-indentation indent))))
-
-(defun org-export-number-lines (text backend
- &optional skip1 skip2 number cont
- replace-labels label-format)
- (setq skip1 (or skip1 0) skip2 (or skip2 0))
- (if (not cont) (setq org-export-last-code-line-counter-value 0))
- (with-temp-buffer
- (insert text)
- (goto-char (point-max))
- (skip-chars-backward " \t\n\r")
- (delete-region (point) (point-max))
- (beginning-of-line (- 1 skip2))
- (let* ((last (org-current-line))
- (n org-export-last-code-line-counter-value)
- (nmax (+ n (- last skip1)))
- (fmt (format "%%%dd: " (length (number-to-string nmax))))
- (fm
- (cond
- ((eq backend 'html) (format "<span class=\"linenr\">%s</span>"
- fmt))
- ((eq backend 'ascii) fmt)
- ((eq backend 'latex) fmt)
- ((eq backend 'docbook) fmt)
- (t "")))
- (label-format (or label-format org-coderef-label-format))
- (label-pre (if (string-match "%s" label-format)
- (substring label-format 0 (match-beginning 0))
- label-format))
- (label-post (if (string-match "%s" label-format)
- (substring label-format (match-end 0))
- ""))
- (lbl-re
- (concat
- ".*?\\S-.*?\\([ \t]*\\("
- (regexp-quote label-pre)
- "\\([-a-zA-Z0-9_ ]+\\)"
- (regexp-quote label-post)
- "\\)\\)"))
- ref)
-
- (org-goto-line (1+ skip1))
- (while (and (re-search-forward "^" nil t) (not (eobp)) (< n nmax))
- (if number
- (insert (format fm (incf n)))
- (forward-char 1))
- (when (looking-at lbl-re)
- (setq ref (match-string 3))
- (cond ((numberp replace-labels)
- ;; remove labels; use numbers for references when lines
- ;; are numbered, use labels otherwise
- (delete-region (match-beginning 1) (match-end 1))
- (push (cons ref (if (> n 0) n ref)) org-export-code-refs))
- ((eq replace-labels 'keep)
- ;; don't remove labels; use numbers for references when
- ;; lines are numbered, use labels otherwise
- (goto-char (match-beginning 2))
- (delete-region (match-beginning 2) (match-end 2))
- (insert "(" ref ")")
- (push (cons ref (if (> n 0) n (concat "(" ref ")")))
- org-export-code-refs))
- (t
- ;; don't remove labels and don't use numbers for
- ;; references
- (goto-char (match-beginning 2))
- (delete-region (match-beginning 2) (match-end 2))
- (insert "(" ref ")")
- (push (cons ref (concat "(" ref ")")) org-export-code-refs)))
- (when (eq backend 'html)
- (save-excursion
- (beginning-of-line 1)
- (insert (format "<span id=\"coderef-%s\" class=\"coderef-off\">"
- ref))
- (end-of-line 1)
- (insert "</span>")))))
- (setq org-export-last-code-line-counter-value n)
- (goto-char (point-max))
- (newline)
- (buffer-string))))
-
-(defun org-search-todo-below (line lines level)
- "Search the subtree below LINE for any TODO entries."
- (let ((rest (cdr (memq line lines)))
- (re org-todo-line-regexp)
- line lv todo)
- (catch 'exit
- (while (setq line (pop rest))
- (if (string-match re line)
- (progn
- (setq lv (- (match-end 1) (match-beginning 1))
- todo (and (match-beginning 2)
- (not (member (match-string 2 line)
- org-done-keywords))))
- ; TODO, not DONE
- (if (<= lv level) (throw 'exit nil))
- (if todo (throw 'exit t))))))))
-
-;;;###autoload
-(defun org-export-visible (type arg)
- "Create a copy of the visible part of the current buffer, and export it.
-The copy is created in a temporary buffer and removed after use.
-TYPE is the final key (as a string) that also selects the export command in
-the \\<org-mode-map>\\[org-export] export dispatcher.
-As a special case, if the you type SPC at the prompt, the temporary
-org-mode file will not be removed but presented to you so that you can
-continue to use it. The prefix arg ARG is passed through to the exporting
-command."
- (interactive
- (list (progn
- (message "Export visible: [a]SCII [h]tml [b]rowse HTML [H/R]buffer with HTML [D]ocBook [l]atex [p]df [d]view pdf [L]atex buffer [x]OXO [ ]keep buffer")
- (read-char-exclusive))
- current-prefix-arg))
- (if (not (member type '(?a ?n ?u ?\C-a ?b ?\C-b ?h ?D ?x ?\ ?l ?p ?d ?L)))
- (error "Invalid export key"))
- (let* ((binding (cdr (assoc type
- '(
- (?a . org-export-as-ascii)
- (?A . org-export-as-ascii-to-buffer)
- (?n . org-export-as-latin1)
- (?N . org-export-as-latin1-to-buffer)
- (?u . org-export-as-utf8)
- (?U . org-export-as-utf8-to-buffer)
- (?\C-a . org-export-as-ascii)
- (?b . org-export-as-html-and-open)
- (?\C-b . org-export-as-html-and-open)
- (?h . org-export-as-html)
- (?H . org-export-as-html-to-buffer)
- (?R . org-export-region-as-html)
- (?D . org-export-as-docbook)
-
- (?l . org-export-as-latex)
- (?p . org-export-as-pdf)
- (?d . org-export-as-pdf-and-open)
- (?L . org-export-as-latex-to-buffer)
-
- (?x . org-export-as-xoxo)))))
- (keepp (equal type ?\ ))
- (file buffer-file-name)
- (buffer (get-buffer-create "*Org Export Visible*"))
- s e)
- ;; Need to hack the drawers here.
- (save-excursion
- (goto-char (point-min))
- (while (re-search-forward org-drawer-regexp nil t)
- (goto-char (match-beginning 1))
- (or (org-invisible-p) (org-flag-drawer nil))))
- (with-current-buffer buffer (erase-buffer))
- (save-excursion
- (setq s (goto-char (point-min)))
- (while (not (= (point) (point-max)))
- (goto-char (org-find-invisible))
- (append-to-buffer buffer s (point))
- (setq s (goto-char (org-find-visible))))
- (org-cycle-hide-drawers 'all)
- (goto-char (point-min))
- (unless keepp
- ;; Copy all comment lines to the end, to make sure #+ settings are
- ;; still available for the second export step. Kind of a hack, but
- ;; does do the trick.
- (if (looking-at "#[^\r\n]*")
- (append-to-buffer buffer (match-beginning 0) (1+ (match-end 0))))
- (when (re-search-forward "^\\*+[ \t]+" nil t)
- (while (re-search-backward "[\n\r]#[^\n\r]*" nil t)
- (append-to-buffer buffer (1+ (match-beginning 0))
- (min (point-max) (1+ (match-end 0)))))))
- (set-buffer buffer)
- (let ((buffer-file-name file)
- (org-inhibit-startup t))
- (org-mode)
- (show-all)
- (unless keepp (funcall binding arg))))
- (if (not keepp)
- (kill-buffer buffer)
- (switch-to-buffer-other-window buffer)
- (goto-char (point-min)))))
-
-(defun org-find-visible ()
- (let ((s (point)))
- (while (and (not (= (point-max) (setq s (next-overlay-change s))))
- (get-char-property s 'invisible)))
- s))
-(defun org-find-invisible ()
- (let ((s (point)))
- (while (and (not (= (point-max) (setq s (next-overlay-change s))))
- (not (get-char-property s 'invisible))))
- s))
-
-(defvar org-export-htmlized-org-css-url) ;; defined in org-html.el
-
-(defun org-export-string (string fmt &optional dir)
- "Export STRING to FMT using existing export facilities.
-During export STRING is saved to a temporary file whose location
-could vary. Optional argument DIR can be used to force the
-directory in which the temporary file is created during export
-which can be useful for resolving relative paths. Dir defaults
-to the value of `temporary-file-directory'."
- (let ((temporary-file-directory (or dir temporary-file-directory))
- (tmp-file (make-temp-file "org-")))
- (unwind-protect
- (with-temp-buffer
- (insert string)
- (write-file tmp-file)
- (org-load-modules-maybe)
- (unless org-local-vars
- (setq org-local-vars (org-get-local-variables)))
- (eval ;; convert to fmt -- mimicing `org-run-like-in-org-mode'
- (list 'let org-local-vars
- (list (intern (concat "org-export-as-" fmt))
- nil nil nil ''string t))))
- (delete-file tmp-file))))
-
-;;;###autoload
-(defun org-export-as-org (arg &optional hidden ext-plist
- to-buffer body-only pub-dir)
- "Make a copy with not-exporting stuff removed.
-The purpose of this function is to provide a way to export the source
-Org file of a webpage in Org format, but with sensitive and/or irrelevant
-stuff removed. This command will remove the following:
-
-- archived trees (if the variable `org-export-with-archived-trees' is nil)
-- comment blocks and trees starting with the COMMENT keyword
-- only trees that are consistent with `org-export-select-tags'
- and `org-export-exclude-tags'.
-
-The only arguments that will be used are EXT-PLIST and PUB-DIR,
-all the others will be ignored (but are present so that the general
-mechanism to call publishing functions will work).
-
-EXT-PLIST is a property list with external parameters overriding
-org-mode's default settings, but still inferior to file-local
-settings. When PUB-DIR is set, use this as the publishing
-directory."
- (interactive "P")
- (let* ((opt-plist (org-combine-plists (org-default-export-plist)
- ext-plist
- (org-infile-export-plist)))
- (bfname (buffer-file-name (or (buffer-base-buffer) (current-buffer))))
- (filename (concat (file-name-as-directory
- (or pub-dir
- (org-export-directory :org opt-plist)))
- (file-name-sans-extension
- (file-name-nondirectory bfname))
- ".org"))
- (filename (and filename
- (if (equal (file-truename filename)
- (file-truename bfname))
- (concat (file-name-sans-extension filename)
- "-source."
- (file-name-extension filename))
- filename)))
- (backup-inhibited t)
- (buffer (find-file-noselect filename))
- (region (buffer-string))
- str-ret)
- (save-excursion
- (switch-to-buffer buffer)
- (erase-buffer)
- (insert region)
- (let ((org-inhibit-startup t)) (org-mode))
- (org-install-letbind)
-
- ;; Get rid of archived trees
- (org-export-remove-archived-trees (plist-get opt-plist :archived-trees))
-
- ;; Remove comment environment and comment subtrees
- (org-export-remove-comment-blocks-and-subtrees)
-
- ;; Get rid of excluded trees
- (org-export-handle-export-tags (plist-get opt-plist :select-tags)
- (plist-get opt-plist :exclude-tags))
-
- (when (or (plist-get opt-plist :plain-source)
- (not (or (plist-get opt-plist :plain-source)
- (plist-get opt-plist :htmlized-source))))
- ;; Either nothing special is requested (default call)
- ;; or the plain source is explicitly requested
- ;; so: save it
- (save-buffer))
- (when (plist-get opt-plist :htmlized-source)
- ;; Make the htmlized version
- (require 'htmlize)
- (require 'org-html)
- (font-lock-fontify-buffer)
- (let* ((htmlize-output-type 'css)
- (newbuf (htmlize-buffer)))
- (with-current-buffer newbuf
- (when org-export-htmlized-org-css-url
- (goto-char (point-min))
- (and (re-search-forward
- "<style type=\"text/css\">[^\000]*?\n[ \t]*</style>.*"
- nil t)
- (replace-match
- (format
- "<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\">"
- org-export-htmlized-org-css-url)
- t t)))
- (write-file (concat filename ".html")))
- (kill-buffer newbuf)))
- (set-buffer-modified-p nil)
- (if (equal to-buffer 'string)
- (progn (setq str-ret (buffer-string))
- (kill-buffer (current-buffer))
- str-ret)
- (kill-buffer (current-buffer))))))
-
-(defvar org-archive-location) ;; gets loaded with the org-archive require.
-(defun org-get-current-options ()
- "Return a string with current options as keyword options.
-Does include HTML export options as well as TODO and CATEGORY stuff."
- (require 'org-archive)
- (format
- "#+TITLE: %s
-#+AUTHOR: %s
-#+EMAIL: %s
-#+DATE: %s
-#+DESCRIPTION:
-#+KEYWORDS:
-#+LANGUAGE: %s
-#+OPTIONS: H:%d num:%s toc:%s \\n:%s @:%s ::%s |:%s ^:%s -:%s f:%s *:%s <:%s
-#+OPTIONS: TeX:%s LaTeX:%s skip:%s d:%s todo:%s pri:%s tags:%s
-%s
-#+EXPORT_SELECT_TAGS: %s
-#+EXPORT_EXCLUDE_TAGS: %s
-#+LINK_UP: %s
-#+LINK_HOME: %s
-#+XSLT:
-#+CATEGORY: %s
-#+SEQ_TODO: %s
-#+TYP_TODO: %s
-#+PRIORITIES: %c %c %c
-#+DRAWERS: %s
-#+STARTUP: %s %s %s %s %s
-#+TAGS: %s
-#+FILETAGS: %s
-#+ARCHIVE: %s
-#+LINK: %s
-"
- (buffer-name) (user-full-name) user-mail-address
- (format-time-string (substring (car org-time-stamp-formats) 1 -1))
- org-export-default-language
- org-export-headline-levels
- org-export-with-section-numbers
- org-export-with-toc
- org-export-preserve-breaks
- org-export-html-expand
- org-export-with-fixed-width
- org-export-with-tables
- org-export-with-sub-superscripts
- org-export-with-special-strings
- org-export-with-footnotes
- org-export-with-emphasize
- org-export-with-timestamps
- org-export-with-TeX-macros
- org-export-with-LaTeX-fragments
- org-export-skip-text-before-1st-heading
- org-export-with-drawers
- org-export-with-todo-keywords
- org-export-with-priority
- org-export-with-tags
- (if (featurep 'org-jsinfo) (org-infojs-options-inbuffer-template) "")
- (mapconcat 'identity org-export-select-tags " ")
- (mapconcat 'identity org-export-exclude-tags " ")
- org-export-html-link-up
- org-export-html-link-home
- (or (ignore-errors
- (file-name-sans-extension
- (file-name-nondirectory (buffer-file-name (buffer-base-buffer)))))
- "NOFILENAME")
- "TODO FEEDBACK VERIFY DONE"
- "Me Jason Marie DONE"
- org-highest-priority org-lowest-priority org-default-priority
- (mapconcat 'identity org-drawers " ")
- (cdr (assoc org-startup-folded
- '((nil . "showall") (t . "overview") (content . "content"))))
- (if org-odd-levels-only "odd" "oddeven")
- (if org-hide-leading-stars "hidestars" "showstars")
- (if org-startup-align-all-tables "align" "noalign")
- (cond ((eq org-log-done t) "logdone")
- ((equal org-log-done 'note) "lognotedone")
- ((not org-log-done) "nologdone"))
- (or (mapconcat (lambda (x)
- (cond
- ((equal :startgroup (car x)) "{")
- ((equal :endgroup (car x)) "}")
- ((equal :newline (car x)) "")
- ((cdr x) (format "%s(%c)" (car x) (cdr x)))
- (t (car x))))
- (or org-tag-alist (org-get-buffer-tags)) " ") "")
- (mapconcat 'identity org-file-tags " ")
- org-archive-location
- "org file:~/org/%s.org"
- ))
-
-;;;###autoload
-(defun org-insert-export-options-template ()
- "Insert into the buffer a template with information for exporting."
- (interactive)
- (if (not (bolp)) (newline))
- (let ((s (org-get-current-options)))
- (and (string-match "#\\+CATEGORY" s)
- (setq s (substring s 0 (match-beginning 0))))
- (insert s)))
-
-(defvar org-table-colgroup-info nil)
-
-(defun org-table-clean-before-export (lines &optional maybe-quoted)
- "Check if the table has a marking column.
-If yes remove the column and the special lines."
- (setq org-table-colgroup-info nil)
- (if (memq nil
- (mapcar
- (lambda (x) (or (string-match "^[ \t]*|-" x)
- (string-match
- (if maybe-quoted
- "^[ \t]*| *\\\\?\\([\#!$*_^ /]\\) *|"
- "^[ \t]*| *\\([\#!$*_^ /]\\) *|")
- x)))
- lines))
- ;; No special marking column
- (progn
- (setq org-table-clean-did-remove-column nil)
- (delq nil
- (mapcar
- (lambda (x)
- (cond
- ((org-table-colgroup-line-p x)
- ;; This line contains colgroup info, extract it
- ;; and then discard the line
- (setq org-table-colgroup-info
- (mapcar (lambda (x)
- (cond ((member x '("<" "&lt;")) :start)
- ((member x '(">" "&gt;")) :end)
- ((member x '("<>" "&lt;&gt;")) :startend)
- (t nil)))
- (org-split-string x "[ \t]*|[ \t]*")))
- nil)
- ((org-table-cookie-line-p x)
- ;; This line contains formatting cookies, discard it
- nil)
- (t x)))
- lines)))
- ;; there is a special marking column
- (setq org-table-clean-did-remove-column t)
- (delq nil
- (mapcar
- (lambda (x)
- (cond
- ((org-table-colgroup-line-p x)
- ;; This line contains colgroup info, extract it
- ;; and then discard the line
- (setq org-table-colgroup-info
- (mapcar (lambda (x)
- (cond ((member x '("<" "&lt;")) :start)
- ((member x '(">" "&gt;")) :end)
- ((member x '("<>" "&lt;&gt;")) :startend)
- (t nil)))
- (cdr (org-split-string x "[ \t]*|[ \t]*"))))
- nil)
- ((org-table-cookie-line-p x)
- ;; This line contains formatting cookies, discard it
- nil)
- ((string-match "^[ \t]*| *[!_^/] *|" x)
- ;; ignore this line
- nil)
- ((or (string-match "^\\([ \t]*\\)|-+\\+" x)
- (string-match "^\\([ \t]*\\)|[^|]*|" x))
- ;; remove the first column
- (replace-match "\\1|" t nil x))))
- lines))))
-
-(defun org-export-cleanup-toc-line (s)
- "Remove tags and timestamps from lines going into the toc."
- (when (memq org-export-with-tags '(not-in-toc nil))
- (if (string-match (org-re " +:[[:alnum:]_@#%:]+: *$") s)
- (setq s (replace-match "" t t s))))
- (when org-export-remove-timestamps-from-toc
- (while (string-match org-maybe-keyword-time-regexp s)
- (setq s (replace-match "" t t s))))
- (while (string-match org-bracket-link-regexp s)
- (setq s (replace-match (match-string (if (match-end 3) 3 1) s)
- t t s)))
- (while (string-match "\\[\\([0-9]\\|fn:[^]]*\\)\\]" s)
- (setq s (replace-match "" t t s)))
- s)
-
-
-(defun org-get-text-property-any (pos prop &optional object)
- (or (get-text-property pos prop object)
- (and (setq pos (next-single-property-change pos prop object))
- (get-text-property pos prop object))))
-
-(defun org-export-get-coderef-format (path desc)
- (save-match-data
- (if (and desc (string-match
- (regexp-quote (concat "(" path ")"))
- desc))
- (replace-match "%s" t t desc)
- (or desc "%s"))))
-
-(defun org-export-push-to-kill-ring (format)
- "Push buffer content to kill ring.
-The depends on the variable `org-export-copy-to-kill'."
- (when org-export-copy-to-kill-ring
- (org-kill-new (buffer-string))
- (when (fboundp 'x-set-selection)
- (ignore-errors (x-set-selection 'PRIMARY (buffer-string)))
- (ignore-errors (x-set-selection 'CLIPBOARD (buffer-string))))
- (message "%s export done, pushed to kill ring and clipboard" format)))
-
-(provide 'org-exp)
-
-;; arch-tag: 65985fe9-095c-49c7-a7b6-cb4ee15c0a95
-
-;;; org-exp.el ends here
-
diff --git a/.emacs.d/org-7.4/lisp/org-exp.elc b/.emacs.d/org-7.4/lisp/org-exp.elc
deleted file mode 100644
index 3d4c686..0000000
--- a/.emacs.d/org-7.4/lisp/org-exp.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-faces.el b/.emacs.d/org-7.4/lisp/org-faces.el
deleted file mode 100644
index 3f82457..0000000
--- a/.emacs.d/org-7.4/lisp/org-faces.el
+++ /dev/null
@@ -1,723 +0,0 @@
-;;; org-faces.el --- Face definitions for Org-mode.
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file contains the face definitions for Org.
-
-;;; Code:
-
-(require 'org-macs)
-(require 'org-compat)
-
-(defun org-copy-face (old-face new-face docstring &rest attributes)
- (unless (facep new-face)
- (if (fboundp 'set-face-attribute)
- (progn
- (make-face new-face)
- (set-face-attribute new-face nil :inherit old-face)
- (apply 'set-face-attribute new-face nil attributes)
- (set-face-doc-string new-face docstring))
- (copy-face old-face new-face)
- (if (fboundp 'set-face-doc-string)
- (set-face-doc-string new-face docstring)))))
-(put 'org-copy-face 'lisp-indent-function 2)
-
-(defgroup org-faces nil
- "Faces in Org-mode."
- :tag "Org Faces"
- :group 'org-appearance)
-
-(defface org-hide
- '((((background light)) (:foreground "white"))
- (((background dark)) (:foreground "black")))
- "Face used to hide leading stars in headlines.
-The foreground color of this face should be equal to the background
-color of the frame."
- :group 'org-faces)
-
-(defface org-level-1 ;; originally copied from font-lock-function-name-face
- (org-compatible-face 'outline-1
- '((((class color) (min-colors 88) (background light)) (:foreground "Blue1"))
- (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
- (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
- (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
- (((class color) (min-colors 8)) (:foreground "blue" :bold t))
- (t (:bold t))))
- "Face used for level 1 headlines."
- :group 'org-faces)
-
-(defface org-level-2 ;; originally copied from font-lock-variable-name-face
- (org-compatible-face 'outline-2
- '((((class color) (min-colors 16) (background light)) (:foreground "DarkGoldenrod"))
- (((class color) (min-colors 16) (background dark)) (:foreground "LightGoldenrod"))
- (((class color) (min-colors 8) (background light)) (:foreground "yellow"))
- (((class color) (min-colors 8) (background dark)) (:foreground "yellow" :bold t))
- (t (:bold t))))
- "Face used for level 2 headlines."
- :group 'org-faces)
-
-(defface org-level-3 ;; originally copied from font-lock-keyword-face
- (org-compatible-face 'outline-3
- '((((class color) (min-colors 88) (background light)) (:foreground "Purple"))
- (((class color) (min-colors 88) (background dark)) (:foreground "Cyan1"))
- (((class color) (min-colors 16) (background light)) (:foreground "Purple"))
- (((class color) (min-colors 16) (background dark)) (:foreground "Cyan"))
- (((class color) (min-colors 8) (background light)) (:foreground "purple" :bold t))
- (((class color) (min-colors 8) (background dark)) (:foreground "cyan" :bold t))
- (t (:bold t))))
- "Face used for level 3 headlines."
- :group 'org-faces)
-
-(defface org-level-4 ;; originally copied from font-lock-comment-face
- (org-compatible-face 'outline-4
- '((((class color) (min-colors 88) (background light)) (:foreground "Firebrick"))
- (((class color) (min-colors 88) (background dark)) (:foreground "chocolate1"))
- (((class color) (min-colors 16) (background light)) (:foreground "red"))
- (((class color) (min-colors 16) (background dark)) (:foreground "red1"))
- (((class color) (min-colors 8) (background light)) (:foreground "red" :bold t))
- (((class color) (min-colors 8) (background dark)) (:foreground "red" :bold t))
- (t (:bold t))))
- "Face used for level 4 headlines."
- :group 'org-faces)
-
-(defface org-level-5 ;; originally copied from font-lock-type-face
- (org-compatible-face 'outline-5
- '((((class color) (min-colors 16) (background light)) (:foreground "ForestGreen"))
- (((class color) (min-colors 16) (background dark)) (:foreground "PaleGreen"))
- (((class color) (min-colors 8)) (:foreground "green"))))
- "Face used for level 5 headlines."
- :group 'org-faces)
-
-(defface org-level-6 ;; originally copied from font-lock-constant-face
- (org-compatible-face 'outline-6
- '((((class color) (min-colors 16) (background light)) (:foreground "CadetBlue"))
- (((class color) (min-colors 16) (background dark)) (:foreground "Aquamarine"))
- (((class color) (min-colors 8)) (:foreground "magenta"))))
- "Face used for level 6 headlines."
- :group 'org-faces)
-
-(defface org-level-7 ;; originally copied from font-lock-builtin-face
- (org-compatible-face 'outline-7
- '((((class color) (min-colors 16) (background light)) (:foreground "Orchid"))
- (((class color) (min-colors 16) (background dark)) (:foreground "LightSteelBlue"))
- (((class color) (min-colors 8)) (:foreground "blue"))))
- "Face used for level 7 headlines."
- :group 'org-faces)
-
-(defface org-level-8 ;; originally copied from font-lock-string-face
- (org-compatible-face 'outline-8
- '((((class color) (min-colors 16) (background light)) (:foreground "RosyBrown"))
- (((class color) (min-colors 16) (background dark)) (:foreground "LightSalmon"))
- (((class color) (min-colors 8)) (:foreground "green"))))
- "Face used for level 8 headlines."
- :group 'org-faces)
-
-(defface org-special-keyword ;; originally copied from font-lock-string-face
- (org-compatible-face nil
- '((((class color) (min-colors 16) (background light)) (:foreground "RosyBrown"))
- (((class color) (min-colors 16) (background dark)) (:foreground "LightSalmon"))
- (t (:italic t))))
- "Face used for special keywords."
- :group 'org-faces)
-
-(defface org-drawer ;; originally copied from font-lock-function-name-face
- (org-compatible-face nil
- '((((class color) (min-colors 88) (background light)) (:foreground "Blue1"))
- (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
- (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
- (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
- (((class color) (min-colors 8)) (:foreground "blue" :bold t))
- (t (:bold t))))
- "Face used for drawers."
- :group 'org-faces)
-
-(defface org-property-value nil
- "Face used for the value of a property."
- :group 'org-faces)
-
-(defface org-column
- (org-compatible-face nil
- '((((class color) (min-colors 16) (background light))
- (:background "grey90" :weight normal :slant normal :strike-through nil
- :underline nil))
- (((class color) (min-colors 16) (background dark))
- (:background "grey30" :weight normal :slant normal :strike-through nil
- :underline nil))
- (((class color) (min-colors 8))
- (:background "cyan" :foreground "black"
- :weight normal :slant normal :strike-through nil
- :underline nil))
- (t (:inverse-video t))))
- "Face for column display of entry properties.
-This is actually only part of the face definition for the text in column view.
-The following faces apply, with this priority.
-
-1. The color of the reference face. This is normally the level fact that
- is used in the outline. In agenda-mode, it will be the face of the
- first character in the line. The color is explicitly retained to
- make sure that the column line still looks a bit like the structure
- line it is masking.
-
-2. The `org-column' face.
-
-3. The remaining properties of the reference face.
-
-Since column view works by putting overlays with a display property
-over individual characters in the buffer, the face of the underlining
-character (this might for example be the a TODO keyword) might still
-shine through in some properties. So when your column view looks
-funny, with \"random\" colors, weight, strike-through, try to explicitly
-set the properties in the `org-column' face. For example, set
-:underline to nil, or the :slant to `normal'.
-
-Under XEmacs, the rules are simpler, because the XEmacs version of
-column view defines special faces for each outline level. See the file
-`org-colview-xemacs.el' for details."
- :group 'org-faces)
-
-(defface org-column-title
- (org-compatible-face nil
- '((((class color) (min-colors 16) (background light))
- (:background "grey90" :underline t :weight bold))
- (((class color) (min-colors 16) (background dark))
- (:background "grey30" :underline t :weight bold))
- (((class color) (min-colors 8))
- (:background "cyan" :foreground "black" :underline t :weight bold))
- (t (:inverse-video t))))
- "Face for column display of entry properties."
- :group 'org-faces)
-
-(when (fboundp 'set-face-attribute)
- ;; Make sure that a fixed-width face is used when we have a column table.
- (set-face-attribute 'org-column nil
- :height (face-attribute 'default :height)
- :family (face-attribute 'default :family)))
-
-(defface org-agenda-column-dateline
- (org-compatible-face 'org-column
- '((t nil)))
- "Face used in agenda column view for datelines with summaries."
- :group 'org-faces)
-
-(defface org-warning
- (org-compatible-face 'font-lock-warning-face
- '((((class color) (min-colors 16) (background light)) (:foreground "Red1" :bold t))
- (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :bold t))
- (((class color) (min-colors 8) (background light)) (:foreground "red" :bold t))
- (((class color) (min-colors 8) (background dark)) (:foreground "red" :bold t))
- (t (:bold t))))
- "Face for deadlines and TODO keywords."
- :group 'org-faces)
-
-(defface org-archived ; similar to shadow
- (org-compatible-face 'shadow
- '((((class color grayscale) (min-colors 88) (background light))
- (:foreground "grey50"))
- (((class color grayscale) (min-colors 88) (background dark))
- (:foreground "grey70"))
- (((class color) (min-colors 8) (background light))
- (:foreground "green"))
- (((class color) (min-colors 8) (background dark))
- (:foreground "yellow"))))
- "Face for headline with the ARCHIVE tag."
- :group 'org-faces)
-
-(defface org-link
- '((((class color) (background light)) (:foreground "Purple" :underline t))
- (((class color) (background dark)) (:foreground "Cyan" :underline t))
- (t (:underline t)))
- "Face for links."
- :group 'org-faces)
-
-(defface org-footnote
- '((((class color) (background light)) (:foreground "Purple" :underline t))
- (((class color) (background dark)) (:foreground "Cyan" :underline t))
- (t (:underline t)))
- "Face for links."
- :group 'org-faces)
-
-(defface org-ellipsis
- '((((class color) (background light)) (:foreground "DarkGoldenrod" :underline t))
- (((class color) (background dark)) (:foreground "LightGoldenrod" :underline t))
- (t (:strike-through t)))
- "Face for the ellipsis in folded text."
- :group 'org-faces)
-
-(defface org-target
- '((((class color) (background light)) (:underline t))
- (((class color) (background dark)) (:underline t))
- (t (:underline t)))
- "Face for link targets."
- :group 'org-faces)
-
-(defface org-date
- '((((class color) (background light)) (:foreground "Purple" :underline t))
- (((class color) (background dark)) (:foreground "Cyan" :underline t))
- (t (:underline t)))
- "Face for date/time stamps."
- :group 'org-faces)
-
-(defface org-sexp-date
- '((((class color) (background light)) (:foreground "Purple"))
- (((class color) (background dark)) (:foreground "Cyan"))
- (t (:underline t)))
- "Face for diary-like sexp date specifications."
- :group 'org-faces)
-
-(defface org-tag
- '((t (:bold t)))
- "Default face for tags.
-Note that the variable `org-tag-faces' can be used to overrule this face for
-specific tags."
- :group 'org-faces)
-
-(defface org-todo ; font-lock-warning-face
- (org-compatible-face nil
- '((((class color) (min-colors 16) (background light)) (:foreground "Red1" :bold t))
- (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :bold t))
- (((class color) (min-colors 8) (background light)) (:foreground "red" :bold t))
- (((class color) (min-colors 8) (background dark)) (:foreground "red" :bold t))
- (t (:inverse-video t :bold t))))
- "Face for TODO keywords."
- :group 'org-faces)
-
-(defface org-done ;; originally copied from font-lock-type-face
- (org-compatible-face nil
- '((((class color) (min-colors 16) (background light)) (:foreground "ForestGreen" :bold t))
- (((class color) (min-colors 16) (background dark)) (:foreground "PaleGreen" :bold t))
- (((class color) (min-colors 8)) (:foreground "green"))
- (t (:bold t))))
- "Face used for todo keywords that indicate DONE items."
- :group 'org-faces)
-
-(defface org-agenda-done ;; originally copied from font-lock-type-face
- (org-compatible-face nil
- '((((class color) (min-colors 16) (background light)) (:foreground "ForestGreen"))
- (((class color) (min-colors 16) (background dark)) (:foreground "PaleGreen"))
- (((class color) (min-colors 8)) (:foreground "green"))
- (t (:bold nil))))
- "Face used in agenda, to indicate lines switched to DONE.
-This face is used to de-emphasize items that where brightly colord in the
-agenda because they were things to do, or overdue. The DONE state itself
-is of course immediately visible, but for example a passed deadline is
-\(by default) very bright read. This face could be simply the default face
-of the frame, for example."
- :group 'org-faces)
-
-(defface org-headline-done ;; originally copied from font-lock-string-face
- (org-compatible-face nil
- '((((class color) (min-colors 16) (background light)) (:foreground "RosyBrown"))
- (((class color) (min-colors 16) (background dark)) (:foreground "LightSalmon"))
- (((class color) (min-colors 8) (background light)) (:bold nil))))
- "Face used to indicate that a headline is DONE.
-This face is only used if `org-fontify-done-headline' is set. If applies
-to the part of the headline after the DONE keyword."
- :group 'org-faces)
-
-(defcustom org-faces-easy-properties
- '((todo . :foreground) (tag . :foreground) (priority . :foreground))
- "The property changes by easy faces.
-This is an alist, the keys show the area of application, the values
-can be `:foreground' or `:background'. A color string for special
-keywords will then be interpreted as either foreground or background
-color."
- :group 'org-faces
- :group 'org-todo
- :type '(repeat
- (cons (choice (const todo) (const tag) (const priority))
- (choice (const :foreground) (const :background)))))
-
-(defcustom org-todo-keyword-faces nil
- "Faces for specific TODO keywords.
-This is a list of cons cells, with TODO keywords in the car
-and faces in the cdr. The face can be a symbol, a color
-as a string (in which case the rest is inherited from the `org-todo' face),
-or a property list of attributes, like
- (:foreground \"blue\" :weight bold :underline t).
-If it is a color string, the variable `org-faces-easy-properties'
-determines if it is a foreground or a background color."
- :group 'org-faces
- :group 'org-todo
- :type '(repeat
- (cons
- (string :tag "Keyword")
- (choice :tag "Face "
- (string :tag "Color")
- (sexp :tag "Face")))))
-
-(defcustom org-priority-faces nil
- "Faces for specific Priorities.
-This is a list of cons cells, with priority character in the car
-and faces in the cdr. The face can be a symbol, a color as
-as a string, or a property list of attributes, like
- (:foreground \"blue\" :weight bold :underline t).
-If it is a color string, the variable `org-faces-easy-properties'
-determines if it is a foreground or a background color."
- :group 'org-faces
- :group 'org-todo
- :type '(repeat
- (cons
- (character :tag "Priority")
- (choice :tag "Face "
- (string :tag "Color")
- (sexp :tag "Face")))))
-
-(defvar org-tags-special-faces-re nil)
-(defun org-set-tag-faces (var value)
- (set var value)
- (if (not value)
- (setq org-tags-special-faces-re nil)
- (setq org-tags-special-faces-re
- (concat ":\\(" (mapconcat 'car value "\\|") "\\):"))))
-
-(defface org-checkbox
- (org-compatible-face 'bold
- '((t (:bold t))))
- "Face for checkboxes"
- :group 'org-faces)
-
-
-(org-copy-face 'org-todo 'org-checkbox-statistics-todo
- "Face used for unfinished checkbox statistics.")
-
-(org-copy-face 'org-done 'org-checkbox-statistics-done
- "Face used for finished checkbox statistics.")
-
-(defcustom org-tag-faces nil
- "Faces for specific tags.
-This is a list of cons cells, with tags in the car and faces in the cdr.
-The face can be a symbol, a foreground color (in which case the rest is
-inherited from the `org-tag' face) or a property list of attributes,
-like (:foreground \"blue\" :weight bold :underline t).
-If you set this variable through customize, it will immediately be effective
-in new buffers and in modified lines.
-If you set it with Lisp, a restart of Emacs is required to activate the
-changes."
- :group 'org-faces
- :group 'org-tags
- :set 'org-set-tag-faces
- :type '(repeat
- (cons
- (string :tag "Tag ")
- (choice :tag "Face"
- (string :tag "Foreground color")
- (sexp :tag "Face")))))
-
-(defface org-table ;; originally copied from font-lock-function-name-face
- (org-compatible-face nil
- '((((class color) (min-colors 88) (background light)) (:foreground "Blue1"))
- (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
- (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
- (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
- (((class color) (min-colors 8) (background light)) (:foreground "blue"))
- (((class color) (min-colors 8) (background dark)))))
- "Face used for tables."
- :group 'org-faces)
-
-(defface org-formula
- (org-compatible-face nil
- '((((class color) (min-colors 88) (background light)) (:foreground "Firebrick"))
- (((class color) (min-colors 88) (background dark)) (:foreground "chocolate1"))
- (((class color) (min-colors 8) (background light)) (:foreground "red"))
- (((class color) (min-colors 8) (background dark)) (:foreground "red"))
- (t (:bold t :italic t))))
- "Face for formulas."
- :group 'org-faces)
-
-(defface org-code
- (org-compatible-face 'shadow
- '((((class color grayscale) (min-colors 88) (background light))
- (:foreground "grey50"))
- (((class color grayscale) (min-colors 88) (background dark))
- (:foreground "grey70"))
- (((class color) (min-colors 8) (background light))
- (:foreground "green"))
- (((class color) (min-colors 8) (background dark))
- (:foreground "yellow"))))
- "Face for fixed-width text like code snippets."
- :group 'org-faces
- :version "22.1")
-
-(defface org-meta-line
- (org-compatible-face 'font-lock-comment-face nil)
- "Face for meta lines startin with \"#+\"."
- :group 'org-faces
- :version "22.1")
-
-(defface org-document-title
- '((((class color) (background light)) (:foreground "midnight blue" :weight bold :height 1.44))
- (((class color) (background dark)) (:foreground "pale turquoise" :weight bold :height 1.44))
- (t (:weight bold :height 1.44)))
- "Face for document title, i.e. that which follows the #+TITLE: keyword."
- :group 'org-faces)
-
-(defface org-document-info
- '((((class color) (background light)) (:foreground "midnight blue"))
- (((class color) (background dark)) (:foreground "pale turquoise"))
- (t nil))
- "Face for document date, author and email; i.e. that which
-follows a #+DATE:, #+AUTHOR: or #+EMAIL: keyword."
- :group 'org-faces)
-
-(defface org-document-info-keyword
- (org-compatible-face 'shadow
- '((((class color grayscale) (min-colors 88) (background light))
- (:foreground "grey50"))
- (((class color grayscale) (min-colors 88) (background dark))
- (:foreground "grey70"))
- (((class color) (min-colors 8) (background light))
- (:foreground "green"))
- (((class color) (min-colors 8) (background dark))
- (:foreground "yellow"))))
- "Face for #+TITLE:, #+AUTHOR:, #+EMAIL: and #+DATE: keywords."
- :group 'org-faces)
-
-(defface org-block
- (org-compatible-face 'shadow
- '((((class color grayscale) (min-colors 88) (background light))
- (:foreground "grey50"))
- (((class color grayscale) (min-colors 88) (background dark))
- (:foreground "grey70"))
- (((class color) (min-colors 8) (background light))
- (:foreground "green"))
- (((class color) (min-colors 8) (background dark))
- (:foreground "yellow"))))
- "Face text in #+begin ... #+end blocks."
- :group 'org-faces
- :version "22.1")
-
-(defface org-verbatim
- (org-compatible-face 'shadow
- '((((class color grayscale) (min-colors 88) (background light))
- (:foreground "grey50" :underline t))
- (((class color grayscale) (min-colors 88) (background dark))
- (:foreground "grey70" :underline t))
- (((class color) (min-colors 8) (background light))
- (:foreground "green" :underline t))
- (((class color) (min-colors 8) (background dark))
- (:foreground "yellow" :underline t))))
- "Face for fixed-with text like code snippets."
- :group 'org-faces
- :version "22.1")
-
-(org-copy-face 'org-block 'org-quote
- "Face for #+BEGIN_QUOTE ... #+END_QUOTE blocks.")
-(org-copy-face 'org-block 'org-verse
- "Face for #+BEGIN_VERSE ... #+END_VERSE blocks.")
-
-(defcustom org-fontify-quote-and-verse-blocks nil
- "Non-nil means, add a special face to #+begin_quote and #+begin_verse block.
-When nil, format these as normal Org. This is the default, because the
-content of these blocks will still be treated as Org syntax."
- :group 'org-faces
- :type 'boolean)
-
-(defface org-clock-overlay ;; copied from secondary-selection
- (org-compatible-face nil
- '((((class color) (min-colors 88) (background light))
- (:background "yellow1"))
- (((class color) (min-colors 88) (background dark))
- (:background "SkyBlue4"))
- (((class color) (min-colors 16) (background light))
- (:background "yellow"))
- (((class color) (min-colors 16) (background dark))
- (:background "SkyBlue4"))
- (((class color) (min-colors 8))
- (:background "cyan" :foreground "black"))
- (t (:inverse-video t))))
- "Basic face for displaying the secondary selection."
- :group 'org-faces)
-
-(defface org-agenda-structure ;; originally copied from font-lock-function-name-face
- (org-compatible-face nil
- '((((class color) (min-colors 88) (background light)) (:foreground "Blue1"))
- (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
- (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
- (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
- (((class color) (min-colors 8)) (:foreground "blue" :bold t))
- (t (:bold t))))
- "Face used in agenda for captions and dates."
- :group 'org-faces)
-
-(org-copy-face 'org-agenda-structure 'org-agenda-date
- "Face used in agenda for normal days.")
-
-(org-copy-face 'org-agenda-date 'org-agenda-date-today
- "Face used in agenda for today."
- :weight 'bold :italic 't)
-
-(org-copy-face 'secondary-selection 'org-agenda-clocking
- "Face marking the current clock item in the agenda.")
-
-(org-copy-face 'org-agenda-date 'org-agenda-date-weekend
- "Face used in agenda for weekend days.
-See the variable `org-agenda-weekend-days' for a definition of which days
-belong to the weekend."
- :weight 'bold)
-
-(defface org-scheduled
- (org-compatible-face nil
- '((((class color) (min-colors 88) (background light)) (:foreground "DarkGreen"))
- (((class color) (min-colors 88) (background dark)) (:foreground "PaleGreen"))
- (((class color) (min-colors 8)) (:foreground "green"))
- (t (:bold t :italic t))))
- "Face for items scheduled for a certain day."
- :group 'org-faces)
-
-(defface org-scheduled-today
- (org-compatible-face nil
- '((((class color) (min-colors 88) (background light)) (:foreground "DarkGreen"))
- (((class color) (min-colors 88) (background dark)) (:foreground "PaleGreen"))
- (((class color) (min-colors 8)) (:foreground "green"))
- (t (:bold t :italic t))))
- "Face for items scheduled for a certain day."
- :group 'org-faces)
-
-(defface org-agenda-dimmed-todo-face
- '((((background light)) (:foreground "grey50"))
- (((background dark)) (:foreground "grey50")))
- "Face used to dim blocked tasks in the agenda."
- :group 'org-faces)
-
-(defface org-scheduled-previously
- (org-compatible-face nil
- '((((class color) (min-colors 88) (background light)) (:foreground "Firebrick"))
- (((class color) (min-colors 88) (background dark)) (:foreground "chocolate1"))
- (((class color) (min-colors 8) (background light)) (:foreground "red"))
- (((class color) (min-colors 8) (background dark)) (:foreground "red" :bold t))
- (t (:bold t))))
- "Face for items scheduled previously, and not yet done."
- :group 'org-faces)
-
-(defface org-upcoming-deadline
- (org-compatible-face nil
- '((((class color) (min-colors 88) (background light)) (:foreground "Firebrick"))
- (((class color) (min-colors 88) (background dark)) (:foreground "chocolate1"))
- (((class color) (min-colors 8) (background light)) (:foreground "red"))
- (((class color) (min-colors 8) (background dark)) (:foreground "red" :bold t))
- (t (:bold t))))
- "Face for items scheduled previously, and not yet done."
- :group 'org-faces)
-
-(defcustom org-agenda-deadline-faces
- '((1.0 . org-warning)
- (0.5 . org-upcoming-deadline)
- (0.0 . default))
- "Faces for showing deadlines in the agenda.
-This is a list of cons cells. The cdr of each cell is a face to be used,
-and it can also just be like '(:foreground \"yellow\").
-Each car is a fraction of the head-warning time that must have passed for
-this the face in the cdr to be used for display. The numbers must be
-given in descending order. The head-warning time is normally taken
-from `org-deadline-warning-days', but can also be specified in the deadline
-timestamp itself, like this:
-
- DEADLINE: <2007-08-13 Mon -8d>
-
-You may use d for days, w for weeks, m for months and y for years. Months
-and years will only be treated in an approximate fashion (30.4 days for a
-month and 365.24 days for a year)."
- :group 'org-faces
- :group 'org-agenda-daily/weekly
- :type '(repeat
- (cons
- (number :tag "Fraction of head-warning time passed")
- (sexp :tag "Face"))))
-
-(defface org-agenda-restriction-lock
- (org-compatible-face nil
- '((((class color) (min-colors 88) (background light)) (:background "yellow1"))
- (((class color) (min-colors 88) (background dark)) (:background "skyblue4"))
- (((class color) (min-colors 16) (background light)) (:background "yellow1"))
- (((class color) (min-colors 16) (background dark)) (:background "skyblue4"))
- (((class color) (min-colors 8)) (:background "cyan" :foreground "black"))
- (t (:inverse-video t))))
- "Face for showing the agenda restriction lock."
- :group 'org-faces)
-
-(defface org-time-grid ;; originally copied from font-lock-variable-name-face
- (org-compatible-face nil
- '((((class color) (min-colors 16) (background light)) (:foreground "DarkGoldenrod"))
- (((class color) (min-colors 16) (background dark)) (:foreground "LightGoldenrod"))
- (((class color) (min-colors 8)) (:foreground "yellow" :weight light))))
- "Face used for time grids."
- :group 'org-faces)
-
-(defface org-agenda-diary
- (org-compatible-face 'default
- nil)
- "Face used for agenda entries that come from the Emacs diary."
- :group 'org-faces)
-
-(defconst org-level-faces
- '(org-level-1 org-level-2 org-level-3 org-level-4
- org-level-5 org-level-6 org-level-7 org-level-8
- ))
-
-(defcustom org-n-level-faces (length org-level-faces)
- "The number of different faces to be used for headlines.
-Org-mode defines 8 different headline faces, so this can be at most 8.
-If it is less than 8, the level-1 face gets re-used for level N+1 etc."
- :type 'integer
- :group 'org-faces)
-
-(defcustom org-cycle-level-faces t
- "Non-nil means level styles cycle after level `org-n-level-faces'.
-Then so level org-n-level-faces+1 is styled like level 1.
-If nil, then all levels >=org-n-level-faces are styled like
-level org-n-level-faces"
- :group 'org-appearance
- :group 'org-faces
- :type 'boolean)
-
-(defface org-latex-and-export-specials
- (let ((font (cond ((assq :inherit custom-face-attributes)
- '(:inherit underline))
- (t '(:underline t)))))
- `((((class grayscale) (background light))
- (:foreground "DimGray" ,@font))
- (((class grayscale) (background dark))
- (:foreground "LightGray" ,@font))
- (((class color) (background light))
- (:foreground "SaddleBrown"))
- (((class color) (background dark))
- (:foreground "burlywood"))
- (t (,@font))))
- "Face used to highlight math latex and other special exporter stuff."
- :group 'org-faces)
-
-(org-copy-face 'modeline 'org-mode-line-clock
- "Face used for clock display in mode line.")
-(org-copy-face 'modeline 'org-mode-line-clock-overrun
- "Face used for clock display for overrun tasks in mode line."
- :background "red")
-
-(provide 'org-faces)
-
-;; arch-tag: 9dab5f91-c4b9-4d6f-bac3-1f6211ad0a04
-
-;;; org-faces.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-faces.elc b/.emacs.d/org-7.4/lisp/org-faces.elc
deleted file mode 100644
index 8a5d614..0000000
--- a/.emacs.d/org-7.4/lisp/org-faces.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-feed.el b/.emacs.d/org-7.4/lisp/org-feed.el
deleted file mode 100644
index 32da49b..0000000
--- a/.emacs.d/org-7.4/lisp/org-feed.el
+++ /dev/null
@@ -1,678 +0,0 @@
-;;; org-feed.el --- Add RSS feed items to Org files
-;;
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-;;
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-;;
-;; This module allows to create and change entries in an Org-mode
-;; file triggered by items in an RSS feed. The basic functionality is
-;; geared toward simply adding new items found in a feed as outline nodes
-;; to an Org file. Using hooks, arbitrary actions can be triggered for
-;; new or changed items.
-;;
-;; Selecting feeds and target locations
-;; ------------------------------------
-;;
-;; This module is configured through a single variable, `org-feed-alist'.
-;; Here is an example, using a notes/tasks feed from reQall.com.
-;;
-;; (setq org-feed-alist
-;; '(("ReQall"
-;; "http://www.reqall.com/user/feeds/rss/a1b2c3....."
-;; "~/org/feeds.org" "ReQall Entries")
-;;
-;; With this setup, the command `M-x org-feed-update-all' will
-;; collect new entries in the feed at the given URL and create
-;; entries as subheadings under the "ReQall Entries" heading in the
-;; file "~/org/feeds.org". Each feed should normally have its own
-;; heading - however see the `:drawer' parameter.
-;;
-;; Besides these standard elements that need to be specified for each
-;; feed, keyword-value pairs can set additional options. For example,
-;; to de-select transitional entries with a title containing
-;;
-;; "reQall is typing what you said",
-;;
-;; you could use the `:filter' argument:
-;;
-;; (setq org-feed-alist
-;; '(("ReQall"
-;; "http://www.reqall.com/user/feeds/rss/a1b2c3....."
-;; "~/org/feeds.org" "ReQall Entries"
-;; :filter my-reqall-filter)))
-;;
-;; (defun my-reqall-filter (e)
-;; (if (string-match "reQall is typing what you said"
-;; (plist-get e :title))
-;; nil
-;; e))
-;;
-;; See the docstring for `org-feed-alist' for more details.
-;;
-;;
-;; Keeping track of previously added entries
-;; -----------------------------------------
-;;
-;; Since Org allows you to delete, archive, or move outline nodes,
-;; org-feed.el needs to keep track of which feed items have been handled
-;; before, so that they will not be handled again. For this, org-feed.el
-;; stores information in a special drawer, FEEDSTATUS, under the heading
-;; that received the input of the feed. You should add FEEDSTATUS
-;; to your list of drawers in the files that receive feed input:
-;;
-;; #+DRAWERS: PROPERTIES LOGBOOK FEEDSTATUS
-;;
-;; Acknowledgments
-;; ---------------
-;;
-;; org-feed.el is based on ideas by Brad Bozarth who implemented a
-;; similar mechanism using shell and awk scripts.
-
-;;; Code:
-
-(require 'org)
-(require 'sha1)
-
-(declare-function url-retrieve-synchronously "url" (url))
-(declare-function xml-node-children "xml" (node))
-(declare-function xml-get-children "xml" (node child-name))
-(declare-function xml-get-attribute "xml" (node attribute))
-(declare-function xml-get-attribute-or-nil "xml" (node attribute))
-(declare-function xml-substitute-special "xml" (string))
-
-(defgroup org-feed nil
- "Options concerning RSS feeds as inputs for Org files."
- :tag "Org Feed"
- :group 'org)
-
-(defcustom org-feed-alist nil
- "Alist specifying RSS feeds that should create inputs for Org.
-Each entry in this list specified an RSS feed tat should be queried
-to create inbox items in Org. Each entry is a list with the following items:
-
-name a custom name for this feed
-URL the Feed URL
-file the target Org file where entries should be listed
-headline the headline under which entries should be listed
-
-Additional arguments can be given using keyword-value pairs. Many of these
-specify functions that receive one or a list of \"entries\" as their single
-argument. An entry is a property list that describes a feed item. The
-property list has properties for each field in the item, for example `:title'
-for the `<title>' field and `:pubDate' for the publication date. In addition,
-it contains the following properties:
-
-`:item-full-text' the full text in the <item> tag
-`:guid-permalink' t when the guid property is a permalink
-
-Here are the keyword-value pair allows in `org-feed-alist'.
-
-:drawer drawer-name
- The name of the drawer for storing feed information. The default is
- \"FEEDSTATUS\". Using different drawers for different feeds allows
- several feeds to target the same inbox heading.
-
-:filter filter-function
- A function to select interesting entries in the feed. It gets a single
- entry as parameter. It should return the entry if it is relevant, or
- nil if it is not.
-
-:template template-string
- The default action on new items in the feed is to add them as children
- under the headline for the feed. The template describes how the entry
- should be formatted. If not given, it defaults to
- `org-feed-default-template'.
-
-:formatter formatter-function
- Instead of relying on a template, you may specify a function to format
- the outline node to be inserted as a child. This function gets passed
- a property list describing a single feed item, and it should return a
- string that is a properly formatted Org outline node of level 1.
-
-:new-handler function
- If adding new items as children to the outline is not what you want
- to do with new items, define a handler function that is called with
- a list of all new items in the feed, each one represented as a property
- list. The handler should do what needs to be done, and org-feed will
- mark all items given to this handler as \"handled\", i.e. they will not
- be passed to this handler again in future readings of the feed.
- When the handler is called, point will be at the feed headline.
-
-:changed-handler function
- This function gets passed a list of all entries that have been
- handled before, but are now still in the feed and have *changed*
- since last handled (as evidenced by a different sha1 hash).
- When the handler is called, point will be at the feed headline.
-
-:parse-feed function
- This function gets passed a buffer, and should return a list
- of entries, each being a property list containing the
- `:guid' and `:item-full-text' keys. The default is
- `org-feed-parse-rss-feed'; `org-feed-parse-atom-feed' is an
- alternative.
-
-:parse-entry function
- This function gets passed an entry as returned by the parse-feed
- function, and should return the entry with interesting properties added.
- The default is `org-feed-parse-rss-entry'; `org-feed-parse-atom-entry'
- is an alternative."
- :group 'org-feed
- :type '(repeat
- (list :value ("" "http://" "" "")
- (string :tag "Name")
- (string :tag "Feed URL")
- (file :tag "File for inbox")
- (string :tag "Headline for inbox")
- (repeat :inline t
- (choice
- (list :inline t :tag "Filter"
- (const :filter)
- (symbol :tag "Filter Function"))
- (list :inline t :tag "Template"
- (const :template)
- (string :tag "Template"))
- (list :inline t :tag "Formatter"
- (const :formatter)
- (symbol :tag "Formatter Function"))
- (list :inline t :tag "New items handler"
- (const :new-handler)
- (symbol :tag "Handler Function"))
- (list :inline t :tag "Changed items"
- (const :changed-handler)
- (symbol :tag "Handler Function"))
- (list :inline t :tag "Parse Feed"
- (const :parse-feed)
- (symbol :tag "Parse Feed Function"))
- (list :inline t :tag "Parse Entry"
- (const :parse-entry)
- (symbol :tag "Parse Entry Function"))
- )))))
-
-(defcustom org-feed-drawer "FEEDSTATUS"
- "The name of the drawer for feed status information.
-Each feed may also specify its own drawer name using the `:drawer'
-parameter in `org-feed-alist'.
-Note that in order to make these drawers behave like drawers, they must
-be added to the variable `org-drawers' or configured with a #+DRAWERS
-line."
- :group 'org-feed
- :type '(string :tag "Drawer Name"))
-
-(defcustom org-feed-default-template "\n* %h\n %U\n %description\n %a\n"
- "Template for the Org node created from RSS feed items.
-This is just the default, each feed can specify its own.
-Any fields from the feed item can be interpolated into the template with
-%name, for example %title, %description, %pubDate etc. In addition, the
-following special escapes are valid as well:
-
-%h the title, or the first line of the description
-%t the date as a stamp, either from <pubDate> (if present), or
- the current date.
-%T date and time
-%u,%U like %t,%T, but inactive time stamps
-%a A link, from <guid> if that is a permalink, else from <link>"
- :group 'org-feed
- :type '(string :tag "Template"))
-
-(defcustom org-feed-save-after-adding t
- "Non-nil means save buffer after adding new feed items."
- :group 'org-feed
- :type 'boolean)
-
-(defcustom org-feed-retrieve-method 'url-retrieve-synchronously
- "The method to be used to retrieve a feed URL.
-This can be `curl' or `wget' to call these external programs, or it can be
-an Emacs Lisp function that will return a buffer containing the content
-of the file pointed to by the URL."
- :group 'org-feed
- :type '(choice
- (const :tag "Internally with url.el" url-retrieve-synchronously)
- (const :tag "Externally with curl" curl)
- (const :tag "Externally with wget" wget)
- (function :tag "Function")))
-
- (defcustom org-feed-before-adding-hook nil
- "Hook that is run before adding new feed items to a file.
-You might want to commit the file in its current state to version control,
-for example."
- :group 'org-feed
- :type 'hook)
-
-(defcustom org-feed-after-adding-hook nil
- "Hook that is run after new items have been added to a file.
-Depending on `org-feed-save-after-adding', the buffer will already
-have been saved."
- :group 'org-feed
- :type 'hook)
-
-(defvar org-feed-buffer "*Org feed*"
- "The buffer used to retrieve a feed.")
-
-;;;###autoload
-(defun org-feed-update-all ()
- "Get inbox items from all feeds in `org-feed-alist'."
- (interactive)
- (let ((nfeeds (length org-feed-alist))
- (nnew (apply '+ (mapcar 'org-feed-update org-feed-alist))))
- (message "%s from %d %s"
- (cond ((= nnew 0) "No new entries")
- ((= nnew 1) "1 new entry")
- (t (format "%d new entries" nnew)))
- nfeeds
- (if (= nfeeds 1) "feed" "feeds"))))
-
-;;;###autoload
-(defun org-feed-update (feed &optional retrieve-only)
- "Get inbox items from FEED.
-FEED can be a string with an association in `org-feed-alist', or
-it can be a list structured like an entry in `org-feed-alist'."
- (interactive (list (org-completing-read "Feed name: " org-feed-alist)))
- (if (stringp feed) (setq feed (assoc feed org-feed-alist)))
- (unless feed
- (error "No such feed in `org-feed-alist"))
- (catch 'exit
- (let ((name (car feed))
- (url (nth 1 feed))
- (file (nth 2 feed))
- (headline (nth 3 feed))
- (filter (nth 1 (memq :filter feed)))
- (formatter (nth 1 (memq :formatter feed)))
- (new-handler (nth 1 (memq :new-handler feed)))
- (changed-handler (nth 1 (memq :changed-handler feed)))
- (template (or (nth 1 (memq :template feed))
- org-feed-default-template))
- (drawer (or (nth 1 (memq :drawer feed))
- org-feed-drawer))
- (parse-feed (or (nth 1 (memq :parse-feed feed))
- 'org-feed-parse-rss-feed))
- (parse-entry (or (nth 1 (memq :parse-entry feed))
- 'org-feed-parse-rss-entry))
- feed-buffer inbox-pos new-formatted
- entries old-status status new changed guid-alist e guid olds)
- (setq feed-buffer (org-feed-get-feed url))
- (unless (and feed-buffer (bufferp (get-buffer feed-buffer)))
- (error "Cannot get feed %s" name))
- (when retrieve-only
- (throw 'exit feed-buffer))
- (setq entries (funcall parse-feed feed-buffer))
- (ignore-errors (kill-buffer feed-buffer))
- (save-excursion
- (save-window-excursion
- (setq inbox-pos (org-feed-goto-inbox-internal file headline))
- (setq old-status (org-feed-read-previous-status inbox-pos drawer))
- ;; Add the "handled" status to the appropriate entries
- (setq entries (mapcar (lambda (e)
- (setq e
- (plist-put e :handled
- (nth 1 (assoc
- (plist-get e :guid)
- old-status)))))
- entries))
- ;; Find out which entries are new and which are changed
- (dolist (e entries)
- (if (not (plist-get e :handled))
- (push e new)
- (setq olds (nth 2 (assoc (plist-get e :guid) old-status)))
- (if (and olds
- (not (string= (sha1
- (plist-get e :item-full-text))
- olds)))
- (push e changed))))
-
- ;; Parse the relevant entries fully
- (setq new (mapcar parse-entry new)
- changed (mapcar parse-entry changed))
-
- ;; Run the filter
- (when filter
- (setq new (delq nil (mapcar filter new))
- changed (delq nil (mapcar filter new))))
-
- (when (not (or new changed))
- (message "No new items in feed %s" name)
- (throw 'exit 0))
-
- ;; Get alist based on guid, to look up entries
- (setq guid-alist
- (append
- (mapcar (lambda (e) (list (plist-get e :guid) e)) new)
- (mapcar (lambda (e) (list (plist-get e :guid) e)) changed)))
-
- ;; Construct the new status
- (setq status
- (mapcar
- (lambda (e)
- (setq guid (plist-get e :guid))
- (list guid
- ;; things count as handled if we handle them now,
- ;; or if they were handled previously
- (if (assoc guid guid-alist) t (plist-get e :handled))
- ;; A hash, to detect changes
- (sha1 (plist-get e :item-full-text))))
- entries))
-
- ;; Handle new items in the feed
- (when new
- (if new-handler
- (progn
- (goto-char inbox-pos)
- (funcall new-handler new))
- ;; No custom handler, do the default adding
- ;; Format the new entries into an alist with GUIDs in the car
- (setq new-formatted
- (mapcar
- (lambda (e) (org-feed-format-entry e template formatter))
- new)))
-
- ;; Insert the new items
- (org-feed-add-items inbox-pos new-formatted))
-
- ;; Handle changed items in the feed
- (when (and changed-handler changed)
- (goto-char inbox-pos)
- (funcall changed-handler changed))
-
- ;; Write the new status
- ;; We do this only now, in case something goes wrong above, so
- ;; that would would end up with a status that does not reflect
- ;; which items truely have been handled
- (org-feed-write-status inbox-pos drawer status)
-
- ;; Normalize the visibility of the inbox tree
- (goto-char inbox-pos)
- (hide-subtree)
- (show-children)
- (org-cycle-hide-drawers 'children)
-
- ;; Hooks and messages
- (when org-feed-save-after-adding (save-buffer))
- (message "Added %d new item%s from feed %s to file %s, heading %s"
- (length new) (if (> (length new) 1) "s" "")
- name
- (file-name-nondirectory file) headline)
- (run-hooks 'org-feed-after-adding-hook)
- (length new))))))
-
-;;;###autoload
-(defun org-feed-goto-inbox (feed)
- "Go to the inbox that captures the feed named FEED."
- (interactive
- (list (if (= (length org-feed-alist) 1)
- (car org-feed-alist)
- (org-completing-read "Feed name: " org-feed-alist))))
- (if (stringp feed) (setq feed (assoc feed org-feed-alist)))
- (unless feed
- (error "No such feed in `org-feed-alist"))
- (org-feed-goto-inbox-internal (nth 2 feed) (nth 3 feed)))
-
-;;;###autoload
-(defun org-feed-show-raw-feed (feed)
- "Show the raw feed buffer of a feed."
- (interactive
- (list (if (= (length org-feed-alist) 1)
- (car org-feed-alist)
- (org-completing-read "Feed name: " org-feed-alist))))
- (if (stringp feed) (setq feed (assoc feed org-feed-alist)))
- (unless feed
- (error "No such feed in `org-feed-alist"))
- (switch-to-buffer
- (org-feed-update feed 'retrieve-only))
- (goto-char (point-min)))
-
-(defun org-feed-goto-inbox-internal (file heading)
- "Find or create HEADING in FILE.
-Switch to that buffer, and return the position of that headline."
- (find-file file)
- (widen)
- (goto-char (point-min))
- (if (re-search-forward
- (concat "^\\*+[ \t]+" heading "[ \t]*\\(:.*?:[ \t]*\\)?$")
- nil t)
- (goto-char (match-beginning 0))
- (goto-char (point-max))
- (insert "\n\n* " heading "\n\n")
- (org-back-to-heading t))
- (point))
-
-(defun org-feed-read-previous-status (pos drawer)
- "Get the alist of old GUIDs from the entry at POS.
-This will find DRAWER and extract the alist."
- (save-excursion
- (goto-char pos)
- (let ((end (save-excursion (org-end-of-subtree t t))))
- (if (re-search-forward
- (concat "^[ \t]*:" drawer ":[ \t]*\n\\([^\000]*?\\)\n[ \t]*:END:")
- end t)
- (read (match-string 1))
- nil))))
-
-(defun org-feed-write-status (pos drawer status)
- "Write the feed STATUS to DRAWER in entry at POS."
- (save-excursion
- (goto-char pos)
- (let ((end (save-excursion (org-end-of-subtree t t)))
- guid)
- (if (re-search-forward (concat "^[ \t]*:" drawer ":[ \t]*\n")
- end t)
- (progn
- (goto-char (match-end 0))
- (delete-region (point)
- (save-excursion
- (and (re-search-forward "^[ \t]*:END:" nil t)
- (match-beginning 0)))))
- (outline-next-heading)
- (insert " :" drawer ":\n :END:\n")
- (beginning-of-line 0))
- (insert (pp-to-string status)))))
-
-(defun org-feed-add-items (pos entries)
- "Add the formatted items to the headline as POS."
- (let (entry level)
- (save-excursion
- (goto-char pos)
- (unless (looking-at org-complex-heading-regexp)
- (error "Wrong position"))
- (setq level (org-get-valid-level (length (match-string 1)) 1))
- (org-end-of-subtree t t)
- (skip-chars-backward " \t\n")
- (beginning-of-line 2)
- (setq pos (point))
- (while (setq entry (pop entries))
- (org-paste-subtree level entry 'yank))
- (org-mark-ring-push pos))))
-
-(defun org-feed-format-entry (entry template formatter)
- "Format ENTRY so that it can be inserted into an Org file.
-ENTRY is a property list. This function adds a `:formatted-for-org' property
-and returns the full property list.
-If that property is already present, nothing changes."
- (if formatter
- (funcall formatter entry)
- (let (dlines fmt tmp indent time name
- v-h v-t v-T v-u v-U v-a)
- (setq dlines (org-split-string (or (plist-get entry :description) "???")
- "\n")
- v-h (or (plist-get entry :title) (car dlines) "???")
- time (or (if (plist-get entry :pubDate)
- (org-read-date t t (plist-get entry :pubDate)))
- (current-time))
- v-t (format-time-string (org-time-stamp-format nil nil) time)
- v-T (format-time-string (org-time-stamp-format t nil) time)
- v-u (format-time-string (org-time-stamp-format nil t) time)
- v-U (format-time-string (org-time-stamp-format t t) time)
- v-a (if (setq tmp (or (and (plist-get entry :guid-permalink)
- (plist-get entry :guid))
- (plist-get entry :link)))
- (concat "[[" tmp "]]\n")
- ""))
- (with-temp-buffer
- (insert template)
- (goto-char (point-min))
- (while (re-search-forward "%\\([a-zA-Z]+\\)" nil t)
- (setq name (match-string 1))
- (cond
- ((member name '("h" "t" "T" "u" "U" "a"))
- (replace-match (symbol-value (intern (concat "v-" name))) t t))
- ((setq tmp (plist-get entry (intern (concat ":" name))))
- (save-excursion
- (save-match-data
- (beginning-of-line 1)
- (when (looking-at (concat "^\\([ \t]*\\)%" name "[ \t]*$"))
- (setq tmp (org-feed-make-indented-block
- tmp (org-get-indentation))))))
- (replace-match tmp t t))))
- (decode-coding-string
- (buffer-string) (detect-coding-region (point-min) (point-max) t))))))
-
-(defun org-feed-make-indented-block (s n)
- "Add indentation of N spaces to a multiline string S."
- (if (not (string-match "\n" s))
- s
- (mapconcat 'identity
- (org-split-string s "\n")
- (concat "\n" (make-string n ?\ )))))
-
-(defun org-feed-skip-http-headers (buffer)
- "Remove HTTP headers from BUFFER, and return it.
-Assumes headers are indeed present!"
- (with-current-buffer buffer
- (widen)
- (goto-char (point-min))
- (search-forward "\n\n")
- (delete-region (point-min) (point))
- buffer))
-
-(defun org-feed-get-feed (url)
- "Get the RSS feed file at URL and return the buffer."
- (cond
- ((eq org-feed-retrieve-method 'url-retrieve-synchronously)
- (org-feed-skip-http-headers (url-retrieve-synchronously url)))
- ((eq org-feed-retrieve-method 'curl)
- (ignore-errors (kill-buffer org-feed-buffer))
- (call-process "curl" nil org-feed-buffer nil "--silent" url)
- org-feed-buffer)
- ((eq org-feed-retrieve-method 'wget)
- (ignore-errors (kill-buffer org-feed-buffer))
- (call-process "wget" nil org-feed-buffer nil "-q" "-O" "-" url)
- org-feed-buffer)
- ((functionp org-feed-retrieve-method)
- (funcall org-feed-retrieve-method url))))
-
-(defun org-feed-parse-rss-feed (buffer)
- "Parse BUFFER for RSS feed entries.
-Returns a list of entries, with each entry a property list,
-containing the properties `:guid' and `:item-full-text'."
- (let ((case-fold-search t)
- entries beg end item guid entry)
- (with-current-buffer buffer
- (widen)
- (goto-char (point-min))
- (while (re-search-forward "<item\\>.*?>" nil t)
- (setq beg (point)
- end (and (re-search-forward "</item>" nil t)
- (match-beginning 0)))
- (setq item (buffer-substring beg end)
- guid (if (string-match "<guid\\>.*?>\\(.*?\\)</guid>" item)
- (org-match-string-no-properties 1 item)))
- (setq entry (list :guid guid :item-full-text item))
- (push entry entries)
- (widen)
- (goto-char end))
- (nreverse entries))))
-
-(defun org-feed-parse-rss-entry (entry)
- "Parse the `:item-full-text' field for xml tags and create new properties."
- (require 'xml)
- (with-temp-buffer
- (insert (plist-get entry :item-full-text))
- (goto-char (point-min))
- (while (re-search-forward "<\\([a-zA-Z]+\\>\\).*?>\\([^\000]*?\\)</\\1>"
- nil t)
- (setq entry (plist-put entry
- (intern (concat ":" (match-string 1)))
- (xml-substitute-special (match-string 2)))))
- (goto-char (point-min))
- (unless (re-search-forward "isPermaLink[ \t]*=[ \t]*\"false\"" nil t)
- (setq entry (plist-put entry :guid-permalink t))))
- entry)
-
-(defun org-feed-parse-atom-feed (buffer)
- "Parse BUFFER for Atom feed entries.
-Returns a list of entries, with each entry a property list,
-containing the properties `:guid' and `:item-full-text'.
-
-The `:item-full-text' property actually contains the sexp
-formatted as a string, not the original XML data."
- (require 'xml)
- (with-current-buffer buffer
- (widen)
- (let ((feed (car (xml-parse-region (point-min) (point-max)))))
- (mapcar
- (lambda (entry)
- (list
- :guid (car (xml-node-children (car (xml-get-children entry 'id))))
- :item-full-text (prin1-to-string entry)))
- (xml-get-children feed 'entry)))))
-
-(defun org-feed-parse-atom-entry (entry)
- "Parse the `:item-full-text' as a sexp and create new properties."
- (let ((xml (car (read-from-string (plist-get entry :item-full-text)))))
- ;; Get first <link href='foo'/>.
- (setq entry (plist-put entry :link
- (xml-get-attribute
- (car (xml-get-children xml 'link))
- 'href)))
- ;; Add <title/> as :title.
- (setq entry (plist-put entry :title
- (xml-substitute-special
- (car (xml-node-children
- (car (xml-get-children xml 'title)))))))
- (let* ((content (car (xml-get-children xml 'content)))
- (type (xml-get-attribute-or-nil content 'type)))
- (when content
- (cond
- ((string= type "text")
- ;; We like plain text.
- (setq entry (plist-put entry :description
- (xml-substitute-special
- (car (xml-node-children content))))))
- ((string= type "html")
- ;; TODO: convert HTML to Org markup.
- (setq entry (plist-put entry :description
- (xml-substitute-special
- (car (xml-node-children content))))))
- ((string= type "xhtml")
- ;; TODO: convert XHTML to Org markup.
- (setq entry (plist-put entry :description
- (prin1-to-string
- (xml-node-children content)))))
- (t
- (setq entry (plist-put entry :description
- (format "Unknown '%s' content." type)))))))
- entry))
-
-(provide 'org-feed)
-
-;; arch-tag: 0929b557-9bc4-47f4-9633-30a12dbb5ae2
-;;; org-feed.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-feed.elc b/.emacs.d/org-7.4/lisp/org-feed.elc
deleted file mode 100644
index a1d96d0..0000000
--- a/.emacs.d/org-7.4/lisp/org-feed.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-footnote.el b/.emacs.d/org-7.4/lisp/org-footnote.el
deleted file mode 100644
index 88ffd6e..0000000
--- a/.emacs.d/org-7.4/lisp/org-footnote.el
+++ /dev/null
@@ -1,590 +0,0 @@
-;;; org-footnote.el --- Footnote support in Org and elsewhere
-;;
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-;;
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file contains the code dealing with footnotes in Org-mode.
-;; The code can also be used in arbitrary text modes to provide
-;; footnotes. Compared to Steven L Baur's footnote.el it provides
-;; better support for resuming editing. It is less configurable than
-;; Steve's code, though.
-
-;;; Code:
-
-(eval-when-compile
- (require 'cl))
-(require 'org-macs)
-(require 'org-compat)
-
-(declare-function org-in-commented-line "org" ())
-(declare-function org-in-regexp "org" (re &optional nlines visually))
-(declare-function org-mark-ring-push "org" (&optional pos buffer))
-(declare-function outline-next-heading "outline")
-(declare-function org-trim "org" (s))
-(declare-function org-show-context "org" (&optional key))
-(declare-function org-back-to-heading "org" (&optional invisible-ok))
-(declare-function org-end-of-subtree "org" (&optional invisible-ok to-heading))
-(declare-function org-in-verbatim-emphasis "org" ())
-(declare-function org-inside-latex-macro-p "org" ())
-(defvar org-odd-levels-only) ;; defined in org.el
-(defvar message-signature-separator) ;; defined in message.el
-
-(defconst org-footnote-re
- (concat "[^][\n]" ; to make sure it is not at the beginning of a line
- "\\["
- "\\(?:"
- "\\([0-9]+\\)"
- "\\|"
- (org-re "\\(fn:\\([-_[:word:]]+?\\)?\\)\\(?::\\([^\]]*?\\)\\)?")
- "\\)"
- "\\]")
- "Regular expression for matching footnotes.")
-
-(defconst org-footnote-definition-re
- (org-re "^\\(\\[\\([0-9]+\\|fn:[-_[:word:]]+\\)\\]\\)")
- "Regular expression matching the definition of a footnote.")
-
-(defgroup org-footnote nil
- "Footnotes in Org-mode."
- :tag "Org Footnote"
- :group 'org)
-
-(defcustom org-footnote-section "Footnotes"
- "Outline heading containing footnote definitions before export.
-This can be nil, to place footnotes locally at the end of the current
-outline node. If can also be the name of a special outline heading
-under which footnotes should be put.
-This variable defines the place where Org puts the definition
-automatically, i.e. when creating the footnote, and when sorting the notes.
-However, by hand you may place definitions *anywhere*.
-If this is a string, during export, all subtrees starting with this
-heading will be removed after extracting footnote definitions."
- :group 'org-footnote
- :type '(choice
- (string :tag "Collect footnotes under heading")
- (const :tag "Define footnotes locally" nil)))
-
-(defcustom org-footnote-tag-for-non-org-mode-files "Footnotes:"
- "Tag marking the beginning of footnote section.
-The Org-mode footnote engine can be used in arbitrary text files as well
-as in Org-mode. Outside Org-mode, new footnotes are always placed at
-the end of the file. When you normalize the notes, any line containing
-only this tag will be removed, a new one will be inserted at the end
-of the file, followed by the collected and normalized footnotes."
- :group 'org-footnote
- :type 'string)
-
-(defcustom org-footnote-define-inline nil
- "Non-nil means define footnotes inline, at reference location.
-When nil, footnotes will be defined in a special section near
-the end of the document. When t, the [fn:label:definition] notation
-will be used to define the footnote at the reference position."
- :group 'org-footnote
- :type 'boolean)
-
-(defcustom org-footnote-auto-label t
- "Non-nil means define automatically new labels for footnotes.
-Possible values are:
-
-nil prompt the user for each label
-t create unique labels of the form [fn:1], [fn:2], ...
-confirm like t, but let the user edit the created value. In particular,
- the label can be removed from the minibuffer, to create
- an anonymous footnote.
-plain Automatically create plain number labels like [1]"
- :group 'org-footnote
- :type '(choice
- (const :tag "Prompt for label" nil)
- (const :tag "Create automatic [fn:N]" t)
- (const :tag "Offer automatic [fn:N] for editing" confirm)
- (const :tag "Create automatic [N]" plain)))
-
-(defcustom org-footnote-auto-adjust nil
- "Non-nil means automatically adjust footnotes after insert/delete.
-When this is t, after each insertion or deletion of a footnote,
-simple fn:N footnotes will be renumbered, and all footnotes will be sorted.
-If you want to have just sorting or just renumbering, set this variable
-to `sort' or `renumber'.
-
-The main values of this variable can be set with in-buffer options:
-
-#+STARTUP: fnadjust
-#+STARTUP: nofnadjust"
- :group 'org-footnote
- :type '(choice
- (const :tag "Renumber" renumber)
- (const :tag "Sort" sort)
- (const :tag "Renumber and Sort" t)))
-
-(defcustom org-footnote-fill-after-inline-note-extraction nil
- "Non-nil means fill paragraphs after extracting footnotes.
-When extracting inline footnotes, the lengths of lines can change a lot.
-When this option is set, paragraphs from which an inline footnote has been
-extracted will be filled again."
- :group 'org-footnote
- :type 'boolean)
-
-(defun org-footnote-at-reference-p ()
- "Is the cursor at a footnote reference?
-If yes, return the beginning position, the label, and the definition, if local."
- (when (org-in-regexp org-footnote-re 15)
- (list (match-beginning 0)
- (or (match-string 1)
- (if (equal (match-string 2) "fn:") nil (match-string 2)))
- (match-string 4))))
-
-(defun org-footnote-at-definition-p ()
- "Is the cursor at a footnote definition.
-This matches only pure definitions like [1] or [fn:name] at the beginning
-of a line. It does not a references like [fn:name:definition], where the
-footnote text is included and defined locally.
-The return value will be nil if not at a footnote definition, and a list
-with start and label of the footnote if there is a definition at point."
- (save-excursion
- (end-of-line 1)
- (let ((lim (save-excursion (re-search-backward "^\\*+ \\|^[ \t]*$" nil t))))
- (when (re-search-backward org-footnote-definition-re lim t)
- (list (match-beginning 0) (match-string 2))))))
-
-(defun org-footnote-goto-definition (label)
- "Find the definition of the footnote with label LABEL."
- (interactive "sLabel: ")
- (org-mark-ring-push)
- (setq label (org-footnote-normalize-label label))
- (let ((re (format "^\\[%s\\]\\|.\\[%s:" label label))
- pos)
- (save-excursion
- (setq pos (or (re-search-forward re nil t)
- (and (goto-char (point-min))
- (re-search-forward re nil t))
- (and (progn (widen) t)
- (goto-char (point-min))
- (re-search-forward re nil t)))))
- (if (not pos)
- (error "Cannot find definition of footnote %s" label)
- (goto-char pos)
- (org-show-context 'link-search)
- (message "Edit definition and go back with `C-c &' or, if unique, with `C-c C-c'."))))
-
-(defun org-footnote-goto-previous-reference (label)
- "Find the first closest (to point) reference of footnote with label LABEL."
- (interactive "sLabel: ")
- (org-mark-ring-push)
- (setq label (org-footnote-normalize-label label))
- (let ((re (format ".\\[%s[]:]" label))
- (p0 (point)) pos)
- (save-excursion
- (setq pos (or (re-search-backward re nil t)
- (and (goto-char (point-max))
- (re-search-backward re nil t))
- (and (progn (widen) t)
- (goto-char p0)
- (re-search-backward re nil t))
- (and (goto-char (point-max))
- (re-search-forward re nil t)))))
- (if pos
- (progn
- (goto-char (match-end 0))
- (org-show-context 'link-search))
- (error "Cannot find reference of footnote %s" label))))
-
-(defun org-footnote-normalize-label (label)
- (if (numberp label) (setq label (number-to-string label)))
- (if (not (string-match "^[0-9]+$\\|^$\\|^fn:" label))
- (setq label (concat "fn:" label)))
- label)
-
-(defun org-footnote-all-labels ()
- "Return list with all defined foot labels used in the buffer."
- (let (rtn l)
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (while (re-search-forward org-footnote-definition-re nil t)
- (setq l (org-match-string-no-properties 2))
- (and l (add-to-list 'rtn l)))
- (goto-char (point-min))
- (while (re-search-forward org-footnote-re nil t)
- (setq l (or (org-match-string-no-properties 1)
- (org-match-string-no-properties 2)))
- (and l (not (equal l "fn:")) (add-to-list 'rtn l)))))
- rtn))
-
-(defun org-footnote-unique-label (&optional current)
- "Return a new unique footnote label.
-The returns the firsts fn:N labels that is currently not used."
- (unless current (setq current (org-footnote-all-labels)))
- (let ((fmt (if (eq org-footnote-auto-label 'plain) "%d" "fn:%d"))
- (cnt 1))
- (while (member (format fmt cnt) current)
- (incf cnt))
- (format fmt cnt)))
-
-(defvar org-footnote-label-history nil
- "History of footnote labels entered in current buffer.")
-(make-variable-buffer-local 'org-footnote-label-history)
-
-(defun org-footnote-new ()
- "Insert a new footnote.
-This command prompts for a label. If this is a label referencing an
-existing label, only insert the label. If the footnote label is empty
-or new, let the user edit the definition of the footnote."
- (interactive)
- (let* ((labels (org-footnote-all-labels))
- (propose (org-footnote-unique-label labels))
- (label
- (if (member org-footnote-auto-label '(t plain))
- propose
- (completing-read
- "Label (leave empty for anonymous): "
- (mapcar 'list labels) nil nil
- (if (eq org-footnote-auto-label 'confirm) propose nil)
- 'org-footnote-label-history))))
- (setq label (org-footnote-normalize-label label))
- (cond
- ((equal label "")
- (insert "[fn:: ]")
- (backward-char 1))
- ((member label labels)
- (insert "[" label "]")
- (message "New reference to existing note"))
- (org-footnote-define-inline
- (insert "[" label ": ]")
- (backward-char 1)
- (org-footnote-auto-adjust-maybe))
- (t
- (insert "[" label "]")
- (org-footnote-create-definition label)
- (org-footnote-auto-adjust-maybe)))))
-
-(defun org-footnote-create-definition (label)
- "Start the definition of a footnote with label LABEL."
- (interactive "sLabel: ")
- (setq label (org-footnote-normalize-label label))
- (let (re)
- (cond
- ((org-mode-p)
- (if (not org-footnote-section)
- ;; No section, put footnote into the current outline node
- nil
- ;; Try to find or make the special node
- (setq re (concat "^\\*+[ \t]+" org-footnote-section "[ \t]*$"))
- (unless (or (re-search-forward re nil t)
- (and (progn (widen) t)
- (re-search-forward re nil t)))
- (goto-char (point-max))
- (insert "\n\n* " org-footnote-section "\n")))
- ;; Now go to the end of this entry and insert there.
- (org-footnote-goto-local-insertion-point)
- (org-show-context 'link-search))
- (t
- (setq re (concat "^" org-footnote-tag-for-non-org-mode-files "[ \t]*$"))
- (unless (re-search-forward re nil t)
- (let ((max (if (and (derived-mode-p 'message-mode)
- (re-search-forward message-signature-separator nil t))
- (progn (beginning-of-line) (point))
- (goto-char (point-max)))))
- (skip-chars-backward " \t\r\n")
- (delete-region (point) max)
- (insert "\n\n")
- (insert org-footnote-tag-for-non-org-mode-files "\n")))))
- ;; Skip existing footnotes
- (while (re-search-forward "^[[:space:]]*\\[[^]]+\\] " nil t)
- (forward-line))
- (insert "[" label "] \n")
- (goto-char (1- (point)))
- (message "Edit definition and go back with `C-c &' or, if unique, with `C-c C-c'.")))
-
-;;;###autoload
-(defun org-footnote-action (&optional special)
- "Do the right thing for footnotes.
-When at a footnote reference, jump to the definition. When at a definition,
-jump to the references. When neither at definition or reference,
-create a new footnote, interactively.
-With prefix arg SPECIAL, offer additional commands in a menu."
- (interactive "P")
- (let (tmp c)
- (cond
- (special
- (message "Footnotes: [s]ort | [r]enumber fn:N | [S]=r+s |->[n]umeric | [d]elete")
- (setq c (read-char-exclusive))
- (cond
- ((equal c ?s)
- (org-footnote-normalize 'sort))
- ((equal c ?r)
- (org-footnote-renumber-fn:N))
- ((equal c ?S)
- (org-footnote-renumber-fn:N)
- (org-footnote-normalize 'sort))
- ((equal c ?n)
- (org-footnote-normalize))
- ((equal c ?d)
- (org-footnote-delete))
- (t (error "No such footnote command %c" c))))
- ((setq tmp (org-footnote-at-reference-p))
- (if (nth 1 tmp)
- (org-footnote-goto-definition (nth 1 tmp))
- (goto-char (match-beginning 4))))
- ((setq tmp (org-footnote-at-definition-p))
- (org-footnote-goto-previous-reference (nth 1 tmp)))
- (t (org-footnote-new)))))
-
-;;;###autoload
-(defun org-footnote-normalize (&optional sort-only for-preprocessor)
- "Collect the footnotes in various formats and normalize them.
-This finds the different sorts of footnotes allowed in Org, and
-normalizes them to the usual [N] format that is understood by the
-Org-mode exporters.
-When SORT-ONLY is set, only sort the footnote definitions into the
-referenced sequence."
- ;; This is based on Paul's function, but rewritten.
- (let* ((limit-level
- (and (boundp 'org-inlinetask-min-level)
- org-inlinetask-min-level
- (1- org-inlinetask-min-level)))
- (nstars (and limit-level
- (if org-odd-levels-only
- (and limit-level (1- (* limit-level 2)))
- limit-level)))
- (outline-regexp
- (concat "\\*" (if nstars (format "\\{1,%d\\} " nstars) "+ ")))
- (count 0)
- ref def idef ref-table beg beg1 marker a before ins-point)
- (save-excursion
- ;; Now find footnote references, and extract the definitions
- (goto-char (point-min))
- (while (re-search-forward org-footnote-re nil t)
- (unless (or (org-in-commented-line) (org-in-verbatim-emphasis)
- (org-inside-latex-macro-p))
- (org-if-unprotected
- (setq def (match-string 4)
- idef def
- ref (or (match-string 1) (match-string 2))
- before (char-to-string (char-after (match-beginning 0))))
- (if (equal ref "fn:") (setq ref nil))
- (if (and ref (setq a (assoc ref ref-table)))
- (progn
- (setq marker (nth 1 a))
- (unless (nth 2 a) (setf (caddr a) def)))
- (setq marker (number-to-string (incf count))))
- (save-match-data
- (if def
- (setq def (org-trim def))
- (save-excursion
- (goto-char (point-min))
- (if (not (re-search-forward (concat "^\\[" (regexp-quote ref)
- "\\]") nil t))
- (setq def nil)
- (setq beg (match-beginning 0))
- (setq beg1 (match-end 0))
- (re-search-forward
- (org-re "^[ \t]*$\\|^\\*+ \\|^\\[\\([0-9]+\\|fn:[-_[:word:]]+\\)\\]")
- nil 'move)
- (setq def (buffer-substring beg1 (or (match-beginning 0)
- (point-max))))
- (goto-char beg)
- (skip-chars-backward " \t\n\t")
- (delete-region (1+ (point)) (match-beginning 0))))))
- (unless sort-only
- (replace-match (concat before "[" marker "]") t t)
- (and idef
- org-footnote-fill-after-inline-note-extraction
- (fill-paragraph)))
- (if (not a) (push (list ref marker def (if idef t nil))
- ref-table)))))
-
- ;; First find and remove the footnote section
- (goto-char (point-min))
- (cond
- ((org-mode-p)
- (if (and org-footnote-section
- (re-search-forward
- (concat "^\\*[ \t]+" (regexp-quote org-footnote-section)
- "[ \t]*$")
- nil t))
- (if (or for-preprocessor (not org-footnote-section))
- (replace-match "")
- (org-back-to-heading t)
- (forward-line 1)
- (setq ins-point (point))
- (delete-region (point) (org-end-of-subtree t)))
- (goto-char (point-max))
- (unless for-preprocessor
- (when org-footnote-section
- (or (bolp) (insert "\n"))
- (insert "* " org-footnote-section "\n")
- (setq ins-point (point))))))
- (t
- (if (re-search-forward
- (concat "^"
- (regexp-quote org-footnote-tag-for-non-org-mode-files)
- "[ \t]*$")
- nil t)
- (replace-match ""))
- (goto-char (point-max))
- (skip-chars-backward " \t\n\r")
- (delete-region (point) (point-max))
- (insert "\n\n" org-footnote-tag-for-non-org-mode-files "\n")
- (setq ins-point (point))))
-
- ;; Insert the footnotes again
- (goto-char (or ins-point (point-max)))
- (setq ref-table (reverse ref-table))
- (when sort-only
- ;; remove anonymous and inline footnotes from the list
- (setq ref-table
- (delq nil (mapcar
- (lambda (x) (and (car x)
- (not (equal (car x) "fn:"))
- (not (nth 3 x))
- x))
- ref-table))))
- ;; Make sure each footnote has a description, or an error message.
- (setq ref-table
- (mapcar
- (lambda (x)
- (if (not (nth 2 x))
- (setcar (cddr x)
- (format "FOOTNOTE DEFINITION NOT FOUND: %s" (car x)))
- (setcar (cddr x) (org-trim (nth 2 x))))
- x)
- ref-table))
-
- (if (or (not (org-mode-p)) ; not an Org file
- org-footnote-section ; we do not use a footnote section
- (not sort-only) ; this is normalization
- for-preprocessor) ; the is the preprocessor
- ;; Insert the footnotes together in one place
- (progn
- (setq def
- (mapconcat
- (lambda (x)
- (format "[%s] %s" (nth (if sort-only 0 1) x)
- (org-trim (nth 2 x))))
- ref-table "\n\n"))
- (if ref-table (insert "\n" def "\n\n")))
- ;; Insert each footnote near the first reference
- ;; Happens only in Org files with no special footnote section,
- ;; and only when doing sorting
- (mapc 'org-insert-footnote-reference-near-definition
- ref-table)))))
-
-(defun org-insert-footnote-reference-near-definition (entry)
- "Find first reference of footnote ENTRY and insert the definition there.
-ENTRY is (fn-label num-mark definition)."
- (when (car entry)
- (goto-char (point-min))
- (when (re-search-forward (format ".\\[%s[]:]" (regexp-quote (car entry)))
- nil t)
- (org-footnote-goto-local-insertion-point)
- (insert (format "\n\n[%s] %s" (car entry) (nth 2 entry))))))
-
-(defun org-footnote-goto-local-insertion-point ()
- "Find insertion point for footnote, just before next outline heading."
- (org-with-limited-levels (outline-next-heading))
- (or (bolp) (newline))
- (beginning-of-line 0)
- (while (and (not (bobp)) (= (char-after) ?#))
- (beginning-of-line 0))
- (if (looking-at "[ \t]*#\\+TBLFM:") (beginning-of-line 2))
- (end-of-line 1)
- (skip-chars-backward "\n\r\t ")
- (forward-line))
-
-(defun org-footnote-delete (&optional label)
- "Delete the footnote at point.
-This will remove the definition (even multiple definitions if they exist)
-and all references of a footnote label."
- (catch 'done
- (let (x label l beg def-re (nref 0) (ndef 0))
- (unless label
- (when (setq x (org-footnote-at-reference-p))
- (setq label (nth 1 x))
- (when (or (not label) (equal "fn:" label))
- (delete-region (1+ (match-beginning 0)) (match-end 0))
- (message "Anonymous footnote removed")
- (throw 'done t)))
- (when (and (not label) (setq x (org-footnote-at-definition-p)))
- (setq label (nth 1 x)))
- (unless label (error "Don't know which footnote to remove")))
- (save-excursion
- (save-restriction
- (goto-char (point-min))
- (while (re-search-forward org-footnote-re nil t)
- (setq l (or (match-string 1) (match-string 2)))
- (when (equal l label)
- (delete-region (1+ (match-beginning 0)) (match-end 0))
- (incf nref)))
- (goto-char (point-min))
- (setq def-re (concat "^\\[" (regexp-quote label) "\\]"))
- (while (re-search-forward def-re nil t)
- (setq beg (match-beginning 0))
- (if (re-search-forward "^\\[\\|^[ \t]*$\\|^\\*+ " nil t)
- (goto-char (match-beginning 0))
- (goto-char (point-max)))
- (delete-region beg (point))
- (incf ndef))))
- (org-footnote-auto-adjust-maybe)
- (message "%d definition(s) of and %d reference(s) of footnote %s removed"
- ndef nref label))))
-
-(defun org-footnote-renumber-fn:N ()
- "Renumber the simple footnotes like fn:17 into a sequence in the document."
- (interactive)
- (let (map i (n 0))
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (while (re-search-forward "\\[fn:\\([0-9]+\\)[]:]" nil t)
- (setq i (string-to-number (match-string 1)))
- (when (and (string-match "\\S-" (buffer-substring
- (point-at-bol) (match-beginning 0)))
- (not (assq i map)))
- (push (cons i (number-to-string (incf n))) map)))
- (goto-char (point-min))
- (while (re-search-forward "\\(\\[fn:\\)\\([0-9]+\\)\\([]:]\\)" nil t)
- (replace-match (concat "\\1" (cdr (assq (string-to-number (match-string 2)) map)) "\\3")))))))
-
-(defun org-footnote-auto-adjust-maybe ()
- "Renumber and/or sort footnotes according to user settings."
- (when (memq org-footnote-auto-adjust '(t renumber))
- (org-footnote-renumber-fn:N))
- (when (memq org-footnote-auto-adjust '(t sort))
- (let ((label (nth 1 (org-footnote-at-definition-p))))
- (org-footnote-normalize 'sort)
- (when label
- (goto-char (point-min))
- (and (re-search-forward (concat "^\\[" (regexp-quote label) "\\]")
- nil t)
- (progn (insert " ")
- (just-one-space)))))))
-
-(provide 'org-footnote)
-
-;; arch-tag: 1b5954df-fb5d-4da5-8709-78d944dbfc37
-
-;;; org-footnote.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-footnote.elc b/.emacs.d/org-7.4/lisp/org-footnote.elc
deleted file mode 100644
index 0f98d19..0000000
--- a/.emacs.d/org-7.4/lisp/org-footnote.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-freemind.el b/.emacs.d/org-7.4/lisp/org-freemind.el
deleted file mode 100644
index d9486af..0000000
--- a/.emacs.d/org-7.4/lisp/org-freemind.el
+++ /dev/null
@@ -1,1243 +0,0 @@
-;;; org-freemind.el --- Export Org files to freemind
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Lennart Borgman (lennart O borgman A gmail O com)
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;; --------------------------------------------------------------------
-;; Features that might be required by this library:
-;;
-;; `backquote', `bytecomp', `cl', `easymenu', `font-lock',
-;; `noutline', `org', `org-compat', `org-faces', `org-footnote',
-;; `org-list', `org-macs', `org-src', `outline', `syntax',
-;; `time-date', `xml'.
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-;;
-;; This file tries to implement some functions useful for
-;; transformation between org-mode and FreeMind files.
-;;
-;; Here are the commands you can use:
-;;
-;; M-x `org-freemind-from-org-mode'
-;; M-x `org-freemind-from-org-mode-node'
-;; M-x `org-freemind-from-org-sparse-tree'
-;;
-;; M-x `org-freemind-to-org-mode'
-;;
-;; M-x `org-freemind-show'
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Change log:
-;;
-;; 2009-02-15: Added check for next level=current+1
-;; 2009-02-21: Fixed bug in `org-freemind-to-org-mode'.
-;; 2009-10-25: Added support for `org-odd-levels-only'.
-;; Added y/n question before showing in FreeMind.
-;; 2009-11-04: Added support for #+BEGIN_HTML.
-;;
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; This program is free software; you can redistribute it and/or
-;; modify it under the terms of the GNU General Public License as
-;; published by the Free Software Foundation; either version 2, or
-;; (at your option) any later version.
-;;
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-;; General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with this program; see the file COPYING. If not, write to
-;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth
-;; Floor, Boston, MA 02110-1301, USA.
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Code:
-
-(require 'xml)
-(require 'org)
-;(require 'rx)
-(require 'org-exp)
-(eval-when-compile (require 'cl))
-
-(defgroup org-freemind nil
- "Customization group for org-freemind export/import."
- :group 'org)
-
-;; Fix-me: I am not sure these are useful:
-;;
-;; (defcustom org-freemind-main-fgcolor "black"
-;; "Color of main node's text."
-;; :type 'color
-;; :group 'org-freemind)
-
-;; (defcustom org-freemind-main-color "black"
-;; "Background color of main node."
-;; :type 'color
-;; :group 'org-freemind)
-
-;; (defcustom org-freemind-child-fgcolor "black"
-;; "Color of child nodes' text."
-;; :type 'color
-;; :group 'org-freemind)
-
-;; (defcustom org-freemind-child-color "black"
-;; "Background color of child nodes."
-;; :type 'color
-;; :group 'org-freemind)
-
-(defvar org-freemind-node-style nil "Internal use.")
-
-(defcustom org-freemind-node-styles nil
- "Styles to apply to node.
-NOT READY YET."
- :type '(repeat
- (list :tag "Node styles for file"
- (regexp :tag "File name")
- (repeat
- (list :tag "Node"
- (regexp :tag "Node name regexp")
- (set :tag "Node properties"
- (list :format "%v" (const :format "" node-style)
- (choice :tag "Style"
- :value bubble
- (const bubble)
- (const fork)))
- (list :format "%v" (const :format "" color)
- (color :tag "Color" :value "red"))
- (list :format "%v" (const :format "" background-color)
- (color :tag "Background color" :value "yellow"))
- (list :format "%v" (const :format "" edge-color)
- (color :tag "Edge color" :value "green"))
- (list :format "%v" (const :format "" edge-style)
- (choice :tag "Edge style" :value bezier
- (const :tag "Linear" linear)
- (const :tag "Bezier" bezier)
- (const :tag "Sharp Linear" sharp-linear)
- (const :tag "Sharp Bezier" sharp-bezier)))
- (list :format "%v" (const :format "" edge-width)
- (choice :tag "Edge width" :value thin
- (const :tag "Parent" parent)
- (const :tag "Thin" thin)
- (const 1)
- (const 2)
- (const 4)
- (const 8)))
- (list :format "%v" (const :format "" italic)
- (const :tag "Italic font" t))
- (list :format "%v" (const :format "" bold)
- (const :tag "Bold font" t))
- (list :format "%v" (const :format "" font-name)
- (string :tag "Font name" :value "SansSerif"))
- (list :format "%v" (const :format "" font-size)
- (integer :tag "Font size" :value 12)))))))
- :group 'org-freemind)
-
-;;;###autoload
-(defun org-export-as-freemind (&optional hidden ext-plist
- to-buffer body-only pub-dir)
- "Export the current buffer as a Freemind file.
-If there is an active region, export only the region. HIDDEN is
-obsolete and does nothing. EXT-PLIST is a property list with
-external parameters overriding org-mode's default settings, but
-still inferior to file-local settings. When TO-BUFFER is
-non-nil, create a buffer with that name and export to that
-buffer. If TO-BUFFER is the symbol `string', don't leave any
-buffer behind but just return the resulting HTML as a string.
-When BODY-ONLY is set, don't produce the file header and footer,
-simply return the content of the document (all top level
-sections). When PUB-DIR is set, use this as the publishing
-directory.
-
-See `org-freemind-from-org-mode' for more information."
- (interactive "P")
- (let* ((opt-plist (org-combine-plists (org-default-export-plist)
- ext-plist
- (org-infile-export-plist)))
- (region-p (org-region-active-p))
- (rbeg (and region-p (region-beginning)))
- (rend (and region-p (region-end)))
- (subtree-p
- (if (plist-get opt-plist :ignore-subtree-p)
- nil
- (when region-p
- (save-excursion
- (goto-char rbeg)
- (and (org-at-heading-p)
- (>= (org-end-of-subtree t t) rend))))))
- (opt-plist (setq org-export-opt-plist
- (if subtree-p
- (org-export-add-subtree-options opt-plist rbeg)
- opt-plist)))
- (bfname (buffer-file-name (or (buffer-base-buffer) (current-buffer))))
- (filename (concat (file-name-as-directory
- (or pub-dir
- (org-export-directory :ascii opt-plist)))
- (file-name-sans-extension
- (or (and subtree-p
- (org-entry-get (region-beginning)
- "EXPORT_FILE_NAME" t))
- (file-name-nondirectory bfname)))
- ".mm")))
- (when (file-exists-p filename)
- (delete-file filename))
- (cond
- (subtree-p
- (org-freemind-from-org-mode-node (line-number-at-pos rbeg)
- filename))
- (t (org-freemind-from-org-mode bfname filename)))))
-
-;;;###autoload
-(defun org-freemind-show (mm-file)
- "Show file MM-FILE in Freemind."
- (interactive
- (list
- (save-match-data
- (let ((name (read-file-name "FreeMind file: "
- nil nil nil
- (if (buffer-file-name)
- (let* ((name-ext (file-name-nondirectory (buffer-file-name)))
- (name (file-name-sans-extension name-ext))
- (ext (file-name-extension name-ext)))
- (cond
- ((string= "mm" ext)
- name-ext)
- ((string= "org" ext)
- (let ((name-mm (concat name ".mm")))
- (if (file-exists-p name-mm)
- name-mm
- (message "Not exported to Freemind format yet")
- "")))
- (t
- "")))
- "")
- ;; Fix-me: Is this an Emacs bug?
- ;; This predicate function is never
- ;; called.
- (lambda (fn)
- (string-match "^mm$" (file-name-extension fn))))))
- (setq name (expand-file-name name))
- name))))
- (org-open-file mm-file))
-
-(defconst org-freemind-org-nfix "--org-mode: ")
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Format converters
-
-(defun org-freemind-escape-str-from-org (org-str)
- "Do some html-escaping of ORG-STR and return the result.
-The characters \"&<> will be escaped."
- (let ((chars (append org-str nil))
- (fm-str ""))
- (dolist (cc chars)
- (setq fm-str
- (concat fm-str
- (if (< cc 160)
- (cond
- ((= cc ?\") "&quot;")
- ((= cc ?\&) "&amp;")
- ((= cc ?\<) "&lt;")
- ((= cc ?\>) "&gt;")
- (t (char-to-string cc)))
- ;; Formatting as &#number; is maybe needed
- ;; according to a bug report from kazuo
- ;; fujimoto, but I have now instead added a xml
- ;; processing instruction saying that the mm
- ;; file is utf-8:
- ;;
- ;; (format "&#x%x;" (- cc ;; ?\x800))
- (format "&#x%x;" (encode-char cc 'ucs))
- ))))
- fm-str))
-
-;;(org-freemind-unescape-str-to-org "&#x6d;A&#x224C;B&lt;C&#x3C;&#x3D;")
-;;(org-freemind-unescape-str-to-org "&#x3C;&lt;")
-(defun org-freemind-unescape-str-to-org (fm-str)
- "Do some html-unescaping of FM-STR and return the result.
-This is the opposite of `org-freemind-escape-str-from-org' but it
-will also unescape &#nn;."
- (let ((org-str fm-str))
- (setq org-str (replace-regexp-in-string "&quot;" "\"" org-str))
- (setq org-str (replace-regexp-in-string "&amp;" "&" org-str))
- (setq org-str (replace-regexp-in-string "&lt;" "<" org-str))
- (setq org-str (replace-regexp-in-string "&gt;" ">" org-str))
- (setq org-str (replace-regexp-in-string
- "&#x\\([a-f0-9]\\{2,4\\}\\);"
- (lambda (m)
- (char-to-string
- (+ (string-to-number (match-string 1 m) 16)
- 0 ;?\x800 ;; What is this for? Encoding?
- )))
- org-str))))
-
-;; (let* ((str1 "a quote: \", an amp: &, lt: <; over 256: öåäÖÅÄ")
-;; (str2 (org-freemind-escape-str-from-org str1))
-;; (str3 (org-freemind-unescape-str-to-org str2)))
-;; (unless (string= str1 str3)
-;; (error "Error str3=%s" str3)))
-
-(defun org-freemind-convert-links-helper (matched)
- "Helper for `org-freemind-convert-links-from-org'.
-MATCHED is the link just matched."
- (let* ((link (match-string 1 matched))
- (text (match-string 2 matched))
- (ext (file-name-extension link))
- (col-pos (string-match-p ":" link))
- (is-img (and (image-type-from-file-name link)
- (let ((url-type (substring link 0 col-pos)))
- (member url-type '("file" "http" "https")))))
- )
- (if is-img
- ;; Fix-me: I can't find a way to get the border to "shrink
- ;; wrap" around the image using <div>.
- ;;
- ;; (concat "<div style=\"border: solid 1px #ddd; width:auto;\">"
- ;; "<img src=\"" link "\" alt=\"" text "\" />"
- ;; "<br />"
- ;; "<i>" text "</i>"
- ;; "</div>")
- (concat "<table border=\"0\" style=\"border: solid 1px #ddd;\"><tr><td>"
- "<img src=\"" link "\" alt=\"" text "\" />"
- "<br />"
- "<i>" text "</i>"
- "</td></tr></table>")
- (concat "<a href=\"" link "\">" text "</a>"))))
-
-(defun org-freemind-convert-links-from-org (org-str)
- "Convert org links in ORG-STR to freemind links and return the result."
- (let ((fm-str (replace-regexp-in-string
- ;;(rx (not (any "[\""))
- ;; (submatch
- ;; "http"
- ;; (opt ?\s)
- ;; "://"
- ;; (1+
- ;; (any "-%.?@a-zA-Z0-9()_/:~=&#"))))
- "[^\"[]\\(http ?://[--:#%&()=?-Z_a-z~]+\\)"
- "[[\\1][\\1]]"
- org-str
- nil ;; fixedcase
- nil ;; literal
- 1 ;; subexp
- )))
- (replace-regexp-in-string
- ;;(rx "[["
- ;; (submatch (*? nonl))
- ;; "]["
- ;; (submatch (*? nonl))
- ;; "]]")
- "\\[\\[\\(.*?\\)]\\[\\(.*?\\)]]"
- ;;"<a href=\"\\1\">\\2</a>"
- 'org-freemind-convert-links-helper
- fm-str)))
-
-;;(org-freemind-convert-links-to-org "<a href=\"http://www.somewhere/\">link-text</a>")
-(defun org-freemind-convert-links-to-org (fm-str)
- "Convert freemind links in FM-STR to org links and return the result."
- (let ((org-str (replace-regexp-in-string
- ;;(rx "<a"
- ;; space
- ;; (0+
- ;; (0+ (not (any ">")))
- ;; space)
- ;; "href=\""
- ;; (submatch (0+ (not (any "\""))))
- ;; "\""
- ;; (0+ (not (any ">")))
- ;; ">"
- ;; (submatch (0+ (not (any "<"))))
- ;; "</a>")
- "<a[[:space:]]\\(?:[^>]*[[:space:]]\\)*href=\"\\([^\"]*\\)\"[^>]*>\\([^<]*\\)</a>"
- "[[\\1][\\2]]"
- fm-str)))
- org-str))
-
-;; Fix-me:
-;;(defun org-freemind-convert-drawers-from-org (text)
-;; )
-
-;; (let* ((str1 "[[http://www.somewhere/][link-text]")
-;; (str2 (org-freemind-convert-links-from-org str1))
-;; (str3 (org-freemind-convert-links-to-org str2)))
-;; (unless (string= str1 str3)
-;; (error "Error str3=%s" str3)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Org => FreeMind
-
-(defvar org-freemind-bol-helper-base-indent nil)
-
-(defun org-freemind-bol-helper (matched)
- "Helper for `org-freemind-convert-text-p'.
-MATCHED is the link just matched."
- (let ((res "")
- (bi org-freemind-bol-helper-base-indent))
- (dolist (cc (append matched nil))
- (if (= 32 cc)
- ;;(setq res (concat res "&nbsp;"))
- ;; We need to use the numerical version. Otherwise Freemind
- ;; ver 0.9.0 RC9 can not export to html/javascript.
- (progn
- (if (< 0 bi)
- (setq bi (1- bi))
- (setq res (concat res "&#160;"))))
- (setq res (concat res (char-to-string cc)))))
- res))
-;; (setq x (replace-regexp-in-string "\n +" 'org-freemind-bol-nbsp-helper "\n "))
-
-(defun org-freemind-convert-text-p (text)
- "Convert TEXT to html with <p> paragraphs."
- ;; (string-match-p "[^ ]" " a")
- (setq org-freemind-bol-helper-base-indent (string-match-p "[^ ]" text))
- (setq text (org-freemind-escape-str-from-org text))
-
- (setq text (replace-regexp-in-string "\\([[:space:]]\\)\\(/\\)\\([^/]+\\)\\(/\\)\\([[:space:]]\\)" "\\1<i>\\3</i>\\5" text))
- (setq text (replace-regexp-in-string "\\([[:space:]]\\)\\(\*\\)\\([^*]+\\)\\(\*\\)\\([[:space:]]\\)" "\\1<b>\\3</b>\\5" text))
-
- (setq text (concat "<p>" text))
- (setq text (replace-regexp-in-string "\n[[:blank:]]*\n" "</p><p>" text))
- (setq text (replace-regexp-in-string "\\(?:<p>\\|\n\\) +" 'org-freemind-bol-helper text))
- (setq text (replace-regexp-in-string "\n" "<br />" text))
- (setq text (concat text "</p>"))
-
- (org-freemind-convert-links-from-org text))
-
-(defcustom org-freemind-node-css-style
- "p { margin-top: 3px; margin-bottom: 3px; }"
- "CSS style for Freemind nodes."
- ;; Fix-me: I do not understand this. It worked to export from Freemind
- ;; with this setting now, but not before??? Was this perhaps a java
- ;; bug or is it a windows xp bug (some resource gets exhausted if you
- ;; use sticky keys which I do).
- :group 'org-freemind)
-
-(defun org-freemind-org-text-to-freemind-subnode/note (node-name start end drawers-regexp)
- "Convert text part of org node to freemind subnode or note.
-Convert the text part of the org node named NODE-NAME. The text
-is in the current buffer between START and END. Drawers matching
-DRAWERS-REGEXP are converted to freemind notes."
- ;; fix-me: doc
- (let ((text (buffer-substring-no-properties start end))
- (node-res "")
- (note-res ""))
- (save-match-data
- ;;(setq text (org-freemind-escape-str-from-org text))
- ;; First see if there is something that should be moved to the
- ;; note part:
- (let (drawers)
- (while (string-match drawers-regexp text)
- (setq drawers (cons (match-string 0 text) drawers))
- (setq text
- (concat (substring text 0 (match-beginning 0))
- (substring text (match-end 0))))
- )
- (when drawers
- (dolist (drawer drawers)
- (let ((lines (split-string drawer "\n")))
- (dolist (line lines)
- (setq note-res (concat
- note-res
- org-freemind-org-nfix line "<br />\n")))
- ))))
-
- (when (> (length note-res) 0)
- (setq note-res (concat
- "<richcontent TYPE=\"NOTE\"><html>\n"
- "<head>\n"
- "</head>\n"
- "<body>\n"
- note-res
- "</body>\n"
- "</html>\n"
- "</richcontent>\n"))
- )
-
- ;; There is always an LF char:
- (when (> (length text) 1)
- (setq node-res (concat
- "<node style=\"bubble\" background_color=\"#eeee00\">\n"
- "<richcontent TYPE=\"NODE\"><html>\n"
- "<head>\n"
- (if (= 0 (length org-freemind-node-css-style))
- ""
- (concat
- "<style type=\"text/css\">\n"
- "<!--\n"
- org-freemind-node-css-style
- "-->\n"
- "</style>\n"))
- "</head>\n"
- "<body>\n"))
- (let ((begin-html-mark (regexp-quote "#+BEGIN_HTML"))
- (end-html-mark (regexp-quote "#+END_HTML"))
- head
- end-pos
- end-pos-match
- )
- ;; Take care of #+BEGIN_HTML - #+END_HTML
- (while (string-match begin-html-mark text)
- (setq head (substring text 0 (match-beginning 0)))
- (setq end-pos-match (match-end 0))
- (setq node-res (concat node-res
- (org-freemind-convert-text-p head)))
- (setq text (substring text end-pos-match))
- (setq end-pos (string-match end-html-mark text))
- (if end-pos
- (setq end-pos-match (match-end 0))
- (message "org-freemind: Missing #+END_HTML")
- (setq end-pos (length text))
- (setq end-pos-match end-pos))
- (setq node-res (concat node-res
- (substring text 0 end-pos)))
- (setq text (substring text end-pos-match)))
- (setq node-res (concat node-res
- (org-freemind-convert-text-p text))))
- (setq node-res (concat
- node-res
- "</body>\n"
- "</html>\n"
- "</richcontent>\n"
- ;; Put a note that this is for the parent node
- ;; "<richcontent TYPE=\"NOTE\"><html>"
- ;; "<head>"
- ;; "</head>"
- ;; "<body>"
- ;; "<p>"
- ;; "-- This is more about \"" node-name "\" --"
- ;; "</p>"
- ;; "</body>"
- ;; "</html>"
- ;; "</richcontent>\n"
- note-res
- "</node>\n" ;; ok
- )))
- (list node-res note-res))))
-
-(defun org-freemind-write-node (mm-buffer drawers-regexp
- num-left-nodes base-level
- current-level next-level this-m2
- this-node-end
- this-children-visible
- next-node-start
- next-has-some-visible-child)
- (let* (this-icons
- this-bg-color
- this-m2-escaped
- this-rich-node
- this-rich-note
- )
- (when (string-match "TODO" this-m2)
- (setq this-m2 (replace-match "" nil nil this-m2))
- (add-to-list 'this-icons "button_cancel")
- (setq this-bg-color "#ffff88")
- (when (string-match "\\[#\\(.\\)\\]" this-m2)
- (let ((prior (string-to-char (match-string 1 this-m2))))
- (setq this-m2 (replace-match "" nil nil this-m2))
- (cond
- ((= prior ?A)
- (add-to-list 'this-icons "full-1")
- (setq this-bg-color "#ff0000"))
- ((= prior ?B)
- (add-to-list 'this-icons "full-2")
- (setq this-bg-color "#ffaa00"))
- ((= prior ?C)
- (add-to-list 'this-icons "full-3")
- (setq this-bg-color "#ffdd00"))
- ((= prior ?D)
- (add-to-list 'this-icons "full-4")
- (setq this-bg-color "#ffff00"))
- ((= prior ?E)
- (add-to-list 'this-icons "full-5"))
- ((= prior ?F)
- (add-to-list 'this-icons "full-6"))
- ((= prior ?G)
- (add-to-list 'this-icons "full-7"))
- ))))
- (setq this-m2 (org-trim this-m2))
- (setq this-m2-escaped (org-freemind-escape-str-from-org this-m2))
- (let ((node-notes (org-freemind-org-text-to-freemind-subnode/note
- this-m2-escaped
- this-node-end
- (1- next-node-start)
- drawers-regexp)))
- (setq this-rich-node (nth 0 node-notes))
- (setq this-rich-note (nth 1 node-notes)))
- (with-current-buffer mm-buffer
- (insert "<node text=\"" this-m2-escaped "\"")
- (org-freemind-get-node-style this-m2)
- (when (> next-level current-level)
- (unless (or this-children-visible
- next-has-some-visible-child)
- (insert " folded=\"true\"")))
- (when (and (= current-level (1+ base-level))
- (> num-left-nodes 0))
- (setq num-left-nodes (1- num-left-nodes))
- (insert " position=\"left\""))
- (when this-bg-color
- (insert " background_color=\"" this-bg-color "\""))
- (insert ">\n")
- (when this-icons
- (dolist (icon this-icons)
- (insert "<icon builtin=\"" icon "\"/>\n")))
- )
- (with-current-buffer mm-buffer
- ;;(when this-rich-note (insert this-rich-note))
- (when this-rich-node (insert this-rich-node))))
- num-left-nodes)
-
-(defun org-freemind-check-overwrite (file interactively)
- "Check if file FILE already exists.
-If FILE does not exists return t.
-
-If INTERACTIVELY is non-nil ask if the file should be replaced
-and return t/nil if it should/should not be replaced.
-
-Otherwise give an error say the file exists."
- (if (file-exists-p file)
- (if interactively
- (y-or-n-p (format "File %s exists, replace it? " file))
- (error "File %s already exists" file))
- t))
-
-(defvar org-freemind-node-pattern
- ;;(rx bol
- ;; (submatch (1+ "*"))
- ;; (1+ space)
- ;; (submatch (*? nonl))
- ;; eol)
- "^\\(\\*+\\)[[:space:]]+\\(.*?\\)$")
-
-(defun org-freemind-look-for-visible-child (node-level)
- (save-excursion
- (save-match-data
- (let ((found-visible-child nil))
- (while (and (not found-visible-child)
- (re-search-forward org-freemind-node-pattern nil t))
- (let* ((m1 (match-string-no-properties 1))
- (level (length m1)))
- (if (>= node-level level)
- (setq found-visible-child 'none)
- (unless (get-char-property (line-beginning-position) 'invisible)
- (setq found-visible-child 'found)))))
- (eq found-visible-child 'found)
- ))))
-
-(defun org-freemind-goto-line (line)
- "Go to line number LINE."
- (save-restriction
- (widen)
- (goto-char (point-min))
- (forward-line (1- line))))
-
-(defun org-freemind-write-mm-buffer (org-buffer mm-buffer node-at-line)
- (with-current-buffer org-buffer
- (dolist (node-style org-freemind-node-styles)
- (when (string-match-p (car node-style) buffer-file-name)
- (setq org-freemind-node-style (cadr node-style))))
- ;;(message "org-freemind-node-style =%s" org-freemind-node-style)
- (save-match-data
- (let* ((drawers (copy-sequence org-drawers))
- drawers-regexp
- (num-top1-nodes 0)
- (num-top2-nodes 0)
- num-left-nodes
- (unclosed-nodes 0)
- (odd-only org-odd-levels-only)
- (first-time t)
- (current-level 1)
- base-level
- prev-node-end
- rich-text
- unfinished-tag
- node-at-line-level
- node-at-line-last)
- (with-current-buffer mm-buffer
- (erase-buffer)
- (setq buffer-file-coding-system 'utf-8)
- ;; Fix-me: Currentl Freemind (ver 0.9.0 RC9) does not support this:
- ;;(insert "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n")
- (insert "<map version=\"0.9.0\">\n")
- (insert "<!-- To view this file, download free mind mapping software FreeMind from http://freemind.sourceforge.net -->\n"))
- (save-excursion
- ;; Get special buffer vars:
- (goto-char (point-min))
- (message "Writing Freemind file...")
- (while (re-search-forward "^#\\+DRAWERS:" nil t)
- (let ((dr-txt (buffer-substring-no-properties (match-end 0) (line-end-position))))
- (setq drawers (append drawers (split-string dr-txt) nil))))
- (setq drawers-regexp
- (concat "^[[:blank:]]*:"
- (regexp-opt drawers)
- ;;(rx ":" (0+ blank)
- ;; "\n"
- ;; (*? anything)
- ;; "\n"
- ;; (0+ blank)
- ;; ":END:"
- ;; (0+ blank)
- ;; eol)
- ":[[:blank:]]*\n\\(?:.\\|\n\\)*?\n[[:blank:]]*:END:[[:blank:]]*$"
- ))
-
- (if node-at-line
- ;; Get number of top nodes and last line for this node
- (progn
- (org-freemind-goto-line node-at-line)
- (unless (looking-at org-freemind-node-pattern)
- (error "No node at line %s" node-at-line))
- (setq node-at-line-level (length (match-string-no-properties 1)))
- (forward-line)
- (setq node-at-line-last
- (catch 'last-line
- (while (re-search-forward org-freemind-node-pattern nil t)
- (let* ((m1 (match-string-no-properties 1))
- (level (length m1)))
- (if (<= level node-at-line-level)
- (progn
- (beginning-of-line)
- (throw 'last-line (1- (point))))
- (if (= level (1+ node-at-line-level))
- (setq num-top2-nodes (1+ num-top2-nodes))))))))
- (setq current-level node-at-line-level)
- (setq num-top1-nodes 1)
- (org-freemind-goto-line node-at-line))
-
- ;; First get number of top nodes
- (goto-char (point-min))
- (while (re-search-forward org-freemind-node-pattern nil t)
- (let* ((m1 (match-string-no-properties 1))
- (level (length m1)))
- (if (= level 1)
- (setq num-top1-nodes (1+ num-top1-nodes))
- (if (= level 2)
- (setq num-top2-nodes (1+ num-top2-nodes))))))
- ;; If there is more than one top node we need to insert a node
- ;; to keep them together.
- (goto-char (point-min))
- (when (> num-top1-nodes 1)
- (setq num-top2-nodes num-top1-nodes)
- (setq current-level 0)
- (let ((orig-name (if buffer-file-name
- (file-name-nondirectory (buffer-file-name))
- (buffer-name))))
- (with-current-buffer mm-buffer
- (insert "<node text=\"" orig-name "\" background_color=\"#00bfff\">\n"
- ;; Put a note that this is for the parent node
- "<richcontent TYPE=\"NOTE\"><html>"
- "<head>"
- "</head>"
- "<body>"
- "<p>"
- org-freemind-org-nfix "WHOLE FILE"
- "</p>"
- "</body>"
- "</html>"
- "</richcontent>\n")))))
-
- (setq num-left-nodes (floor num-top2-nodes 2))
- (setq base-level current-level)
- (let (this-m2
- this-node-end
- this-children-visible
- next-m2
- next-node-start
- next-level
- next-has-some-visible-child
- next-children-visible
- )
- (while (and
- (re-search-forward org-freemind-node-pattern nil t)
- (if node-at-line-last (<= (point) node-at-line-last) t)
- )
- (let* ((next-m1 (match-string-no-properties 1))
- (next-node-end (match-end 0))
- )
- (setq next-node-start (match-beginning 0))
- (setq next-m2 (match-string-no-properties 2))
- (setq next-level (length next-m1))
- (setq next-children-visible
- (not (eq 'outline
- (get-char-property (line-end-position) 'invisible))))
- (setq next-has-some-visible-child
- (if next-children-visible t
- (org-freemind-look-for-visible-child next-level)))
- (when this-m2
- (setq num-left-nodes (org-freemind-write-node mm-buffer drawers-regexp num-left-nodes base-level current-level next-level this-m2 this-node-end this-children-visible next-node-start next-has-some-visible-child)))
- (when (if (= num-top1-nodes 1) (> current-level base-level) t)
- (while (>= current-level next-level)
- (with-current-buffer mm-buffer
- (insert "</node>\n")
- (setq current-level
- (- current-level (if odd-only 2 1))))))
- (setq this-node-end (1+ next-node-end))
- (setq this-m2 next-m2)
- (setq current-level next-level)
- (setq this-children-visible next-children-visible)
- (forward-char)
- ))
-;;; (unless (if node-at-line-last
-;;; (>= (point) node-at-line-last)
-;;; nil)
- ;; Write last node:
- (setq this-m2 next-m2)
- (setq current-level next-level)
- (setq next-node-start (if node-at-line-last
- (1+ node-at-line-last)
- (point-max)))
- (setq num-left-nodes (org-freemind-write-node mm-buffer drawers-regexp num-left-nodes base-level current-level next-level this-m2 this-node-end this-children-visible next-node-start next-has-some-visible-child))
- (with-current-buffer mm-buffer (insert "</node>\n"))
- ;)
- )
- (with-current-buffer mm-buffer
- (while (> current-level base-level)
- (insert "</node>\n")
- (setq current-level
- (- current-level (if odd-only 2 1)))
- ))
- (with-current-buffer mm-buffer
- (insert "</map>")
- (delete-trailing-whitespace)
- (goto-char (point-min))
- ))))))
-
-(defun org-freemind-get-node-style (node-name)
- "NOT READY YET."
- ;;<node BACKGROUND_COLOR="#eeee00" CREATED="1234668815593" MODIFIED="1234668815593" STYLE="bubble">
- ;;<font BOLD="true" NAME="SansSerif" SIZE="12"/>
- (let (node-styles
- node-style)
- (dolist (style-list org-freemind-node-style)
- (let ((node-regexp (car style-list)))
- (message "node-regexp=%s node-name=%s" node-regexp node-name)
- (when (string-match-p node-regexp node-name)
- ;;(setq node-style (org-freemind-do-apply-node-style style-list))
- (setq node-style (cadr style-list))
- (when node-style
- (message "node-style=%s" node-style)
- (setq node-styles (append node-styles node-style)))
- )))))
-
-(defun org-freemind-do-apply-node-style (style-list)
- (message "style-list=%S" style-list)
- (let ((node-style 'fork)
- (color "red")
- (background-color "yellow")
- (edge-color "green")
- (edge-style 'bezier)
- (edge-width 'thin)
- (italic t)
- (bold t)
- (font-name "SansSerif")
- (font-size 12))
- (dolist (style (cadr style-list))
- (message " style=%s" style)
- (let ((what (car style)))
- (cond
- ((eq what 'node-style)
- (setq node-style (cadr style)))
- ((eq what 'color)
- (setq color (cadr style)))
- ((eq what 'background-color)
- (setq background-color (cadr style)))
-
- ((eq what 'edge-color)
- (setq edge-color (cadr style)))
-
- ((eq what 'edge-style)
- (setq edge-style (cadr style)))
-
- ((eq what 'edge-width)
- (setq edge-width (cadr style)))
-
- ((eq what 'italic)
- (setq italic (cadr style)))
-
- ((eq what 'bold)
- (setq bold (cadr style)))
-
- ((eq what 'font-name)
- (setq font-name (cadr style)))
-
- ((eq what 'font-size)
- (setq font-size (cadr style)))
- )
- (insert (format " style=\"%s\"" node-style))
- (insert (format " color=\"%s\"" color))
- (insert (format " background_color=\"%s\"" background-color))
- (insert ">\n")
- (insert "<edge")
- (insert (format " color=\"%s\"" edge-color))
- (insert (format " style=\"%s\"" edge-style))
- (insert (format " width=\"%s\"" edge-width))
- (insert "/>\n")
- (insert "<font")
- (insert (format " italic=\"%s\"" italic))
- (insert (format " bold=\"%s\"" bold))
- (insert (format " name=\"%s\"" font-name))
- (insert (format " size=\"%s\"" font-size))
- ))))
-
-;;;###autoload
-(defun org-freemind-from-org-mode-node (node-line mm-file)
- "Convert node at line NODE-LINE to the FreeMind file MM-FILE.
-See `org-freemind-from-org-mode' for more information."
- (interactive
- (progn
- (unless (org-back-to-heading nil)
- (error "Can't find org-mode node start"))
- (let* ((line (line-number-at-pos))
- (default-mm-file (concat (if buffer-file-name
- (file-name-nondirectory buffer-file-name)
- "nofile")
- "-line-" (number-to-string line)
- ".mm"))
- (mm-file (read-file-name "Output FreeMind file: " nil nil nil default-mm-file)))
- (list line mm-file))))
- (when (org-freemind-check-overwrite mm-file (org-called-interactively-p 'any))
- (let ((org-buffer (current-buffer))
- (mm-buffer (find-file-noselect mm-file)))
- (org-freemind-write-mm-buffer org-buffer mm-buffer node-line)
- (with-current-buffer mm-buffer
- (basic-save-buffer)
- (when (org-called-interactively-p 'any)
- (switch-to-buffer-other-window mm-buffer)
- (when (y-or-n-p "Show in FreeMind? ")
- (org-freemind-show buffer-file-name)))))))
-
-;;;###autoload
-(defun org-freemind-from-org-mode (org-file mm-file)
- "Convert the `org-mode' file ORG-FILE to the FreeMind file MM-FILE.
-All the nodes will be opened or closed in Freemind just as you
-have them in `org-mode'.
-
-Note that exporting to Freemind also gives you an alternative way
-to export from `org-mode' to html. You can create a dynamic html
-version of the your org file, by first exporting to Freemind and
-then exporting from Freemind to html. The 'As
-XHTML (JavaScript)' version in Freemind works very well \(and you
-can use a CSS stylesheet to style it)."
- ;; Fix-me: better doc, include recommendations etc.
- (interactive
- (let* ((org-file buffer-file-name)
- (default-mm-file (concat
- (if org-file
- (file-name-nondirectory org-file)
- "nofile")
- ".mm"))
- (mm-file (read-file-name "Output FreeMind file: " nil nil nil default-mm-file)))
- (list org-file mm-file)))
- (when (org-freemind-check-overwrite mm-file (org-called-interactively-p 'any))
- (let ((org-buffer (if org-file (find-file-noselect org-file) (current-buffer)))
- (mm-buffer (find-file-noselect mm-file)))
- (org-freemind-write-mm-buffer org-buffer mm-buffer nil)
- (with-current-buffer mm-buffer
- (basic-save-buffer)
- (when (org-called-interactively-p 'any)
- (switch-to-buffer-other-window mm-buffer)
- (when (y-or-n-p "Show in FreeMind? ")
- (org-freemind-show buffer-file-name)))))))
-
-;;;###autoload
-(defun org-freemind-from-org-sparse-tree (org-buffer mm-file)
- "Convert visible part of buffer ORG-BUFFER to FreeMind file MM-FILE."
- (interactive
- (let* ((org-file buffer-file-name)
- (default-mm-file (concat
- (if org-file
- (file-name-nondirectory org-file)
- "nofile")
- "-sparse.mm"))
- (mm-file (read-file-name "Output FreeMind file: " nil nil nil default-mm-file)))
- (list (current-buffer) mm-file)))
- (when (org-freemind-check-overwrite mm-file (org-called-interactively-p 'any))
- (let (org-buffer
- (mm-buffer (find-file-noselect mm-file)))
- (save-window-excursion
- (org-export-visible ?\ nil)
- (setq org-buffer (current-buffer)))
- (org-freemind-write-mm-buffer org-buffer mm-buffer nil)
- (with-current-buffer mm-buffer
- (basic-save-buffer)
- (when (org-called-interactively-p 'any)
- (switch-to-buffer-other-window mm-buffer)
- (when (y-or-n-p "Show in FreeMind? ")
- (org-freemind-show buffer-file-name)))))))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; FreeMind => Org
-
-;; (sort '(b a c) 'org-freemind-lt-symbols)
-(defun org-freemind-lt-symbols (sym-a sym-b)
- (string< (symbol-name sym-a) (symbol-name sym-b)))
-;; (sort '((b . 1) (a . 2) (c . 3)) 'org-freemind-lt-xml-attrs)
-(defun org-freemind-lt-xml-attrs (attr-a attr-b)
- (string< (symbol-name (car attr-a)) (symbol-name (car attr-b))))
-
-;; xml-parse-region gives things like
-;; ((p nil "\n"
-;; (a
-;; ((href . "link"))
-;; "text")
-;; "\n"
-;; (b nil "hej")
-;; "\n"))
-
-;; '(a . nil)
-
-;; (org-freemind-symbols= 'a (car '(A B)))
-(defsubst org-freemind-symbols= (sym-a sym-b)
- "Return t if downcased names of SYM-A and SYM-B are equal.
-SYM-A and SYM-B should be symbols."
- (or (eq sym-a sym-b)
- (string= (downcase (symbol-name sym-a))
- (downcase (symbol-name sym-b)))))
-
-(defun org-freemind-get-children (parent path)
- "Find children node to PARENT from PATH.
-PATH should be a list of steps, where each step has the form
-
- '(NODE-NAME (ATTR-NAME . ATTR-VALUE))"
- ;; Fix-me: maybe implement op? step: Name, number, attr, attr op val
- ;; Fix-me: case insensitive version for children?
- (let* ((children (if (not (listp (car parent)))
- (cddr parent)
- (let (cs)
- (dolist (p parent)
- (dolist (c (cddr p))
- (add-to-list 'cs c)))
- cs)
- ))
- (step (car path))
- (step-node (if (listp step) (car step) step))
- (step-attr-list (when (listp step) (sort (cdr step) 'org-freemind-lt-xml-attrs)))
- (path-tail (cdr path))
- path-children)
- (dolist (child children)
- ;; skip xml.el formatting nodes
- (unless (stringp child)
- ;; compare node name
- (when (if (not step-node)
- t ;; any node name
- (org-freemind-symbols= step-node (car child)))
- (if (not step-attr-list)
- ;;(throw 'path-child child) ;; no attr to care about
- (add-to-list 'path-children child)
- (let* ((child-attr-list (cadr child))
- (step-attr-copy (copy-sequence step-attr-list)))
- (dolist (child-attr child-attr-list)
- ;; Compare attr names:
- (when (org-freemind-symbols= (caar step-attr-copy) (car child-attr))
- ;; Compare values:
- (let ((step-val (cdar step-attr-copy))
- (child-val (cdr child-attr)))
- (when (if (not step-val)
- t ;; any value
- (string= step-val child-val))
- (setq step-attr-copy (cdr step-attr-copy))))))
- ;; Did we find all?
- (unless step-attr-copy
- ;;(throw 'path-child child)
- (add-to-list 'path-children child)
- ))))))
- (if path-tail
- (org-freemind-get-children path-children path-tail)
- path-children)))
-
-(defun org-freemind-get-richcontent-node (node)
- (let ((rc-nodes
- (org-freemind-get-children node '((richcontent (type . "NODE")) html body))))
- (when (> (length rc-nodes) 1)
- (lwarn t :warning "Unexpected structure: several <richcontent type=\"NODE\" ...>"))
- (car rc-nodes)))
-
-(defun org-freemind-get-richcontent-note (node)
- (let ((rc-notes
- (org-freemind-get-children node '((richcontent (type . "NOTE")) html body))))
- (when (> (length rc-notes) 1)
- (lwarn t :warning "Unexpected structure: several <richcontent type=\"NOTE\" ...>"))
- (car rc-notes)))
-
-(defun org-freemind-test-get-tree-text ()
- (let ((node '(p nil "\n"
- (a
- ((href . "link"))
- "text")
- "\n"
- (b nil "hej")
- "\n")))
- (org-freemind-get-tree-text node)))
-;; (org-freemind-test-get-tree-text)
-
-(defun org-freemind-get-tree-text (node)
- (when node
- (let ((ntxt "")
- (link nil)
- (lf-after nil))
- (dolist (n node)
- (case n
- ;;(a (setq is-link t) )
- ((h1 h2 h3 h4 h5 h6 p)
- ;;(setq ntxt (concat "\n" ntxt))
- (setq lf-after 2)
- )
- (br
- (setq lf-after 1)
- )
- (t
- (cond
- ((stringp n)
- (when (string= n "\n") (setq n ""))
- (if link
- (setq ntxt (concat ntxt
- "[[" link "][" n "]]"))
- (setq ntxt (concat ntxt n))))
- ((and n (listp n))
- (if (symbolp (car n))
- (setq ntxt (concat ntxt (org-freemind-get-tree-text n)))
- ;; This should be the attributes:
- (dolist (att-val n)
- (let ((att (car att-val))
- (val (cdr att-val)))
- (when (eq att 'href)
- (setq link val)))))
- )))))
- (if lf-after
- (setq ntxt (concat ntxt (make-string lf-after ?\n)))
- (setq ntxt (concat ntxt " ")))
- ;;(setq ntxt (concat ntxt (format "{%s}" n)))
- ntxt)))
-
-(defun org-freemind-get-richcontent-node-text (node)
- "Get the node text as from the richcontent node NODE."
- (save-match-data
- (let* ((rc (org-freemind-get-richcontent-node node))
- (txt (org-freemind-get-tree-text rc)))
- ;;(when txt (setq txt (replace-regexp-in-string "[[:space:]]+" " " txt)))
- txt
- )))
-
-(defun org-freemind-get-richcontent-note-text (node)
- "Get the node text as from the richcontent note NODE."
- (save-match-data
- (let* ((rc (org-freemind-get-richcontent-note node))
- (txt (when rc (org-freemind-get-tree-text rc))))
- ;;(when txt (setq txt (replace-regexp-in-string "[[:space:]]+" " " txt)))
- txt
- )))
-
-(defun org-freemind-get-icon-names (node)
- (let* ((icon-nodes (org-freemind-get-children node '((icon ))))
- names)
- (dolist (icn icon-nodes)
- (setq names (cons (cdr (assq 'builtin (cadr icn))) names)))
- ;; (icon (builtin . "full-1"))
- names))
-
-(defun org-freemind-node-to-org (node level skip-levels)
- (let ((qname (car node))
- (attributes (cadr node))
- text
- ;; Fix-me: note is never inserted
- (note (org-freemind-get-richcontent-note-text node))
- (mark "-- This is more about ")
- (icons (org-freemind-get-icon-names node))
- (children (cddr node)))
- (when (< 0 (- level skip-levels))
- (dolist (attrib attributes)
- (case (car attrib)
- ('TEXT (setq text (cdr attrib)))
- ('text (setq text (cdr attrib)))))
- (unless text
- ;; There should be a richcontent node holding the text:
- (setq text (org-freemind-get-richcontent-node-text node)))
- (when icons
- (when (member "full-1" icons) (setq text (concat "[#A] " text)))
- (when (member "full-2" icons) (setq text (concat "[#B] " text)))
- (when (member "full-3" icons) (setq text (concat "[#C] " text)))
- (when (member "full-4" icons) (setq text (concat "[#D] " text)))
- (when (member "full-5" icons) (setq text (concat "[#E] " text)))
- (when (member "full-6" icons) (setq text (concat "[#F] " text)))
- (when (member "full-7" icons) (setq text (concat "[#G] " text)))
- (when (member "button_cancel" icons) (setq text (concat "TODO " text)))
- )
- (if (and note
- (string= mark (substring note 0 (length mark))))
- (progn
- (setq text (replace-regexp-in-string "\n $" "" text))
- (insert text))
- (case qname
- ('node
- (insert (make-string (- level skip-levels) ?*) " " text "\n")
- (when note
- (insert ":COMMENT:\n" note "\n:END:\n"))
- ))))
- (dolist (child children)
- (unless (or (null child)
- (stringp child))
- (org-freemind-node-to-org child (1+ level) skip-levels)))))
-
-;; Fix-me: put back special things, like drawers that are stored in
-;; the notes. Should maybe all notes contents be put in drawers?
-;;;###autoload
-(defun org-freemind-to-org-mode (mm-file org-file)
- "Convert FreeMind file MM-FILE to `org-mode' file ORG-FILE."
- (interactive
- (save-match-data
- (let* ((mm-file (buffer-file-name))
- (default-org-file (concat (file-name-nondirectory mm-file) ".org"))
- (org-file (read-file-name "Output org-mode file: " nil nil nil default-org-file)))
- (list mm-file org-file))))
- (when (org-freemind-check-overwrite org-file (org-called-interactively-p 'any))
- (let ((mm-buffer (find-file-noselect mm-file))
- (org-buffer (find-file-noselect org-file)))
- (with-current-buffer mm-buffer
- (let* ((xml-list (xml-parse-file mm-file))
- (top-node (cadr (cddar xml-list)))
- (note (org-freemind-get-richcontent-note-text top-node))
- (skip-levels
- (if (and note
- (string-match "^--org-mode: WHOLE FILE$" note))
- 1
- 0)))
- (with-current-buffer org-buffer
- (erase-buffer)
- (org-freemind-node-to-org top-node 1 skip-levels)
- (goto-char (point-min))
- (org-set-tags t t) ;; Align all tags
- )
- (switch-to-buffer-other-window org-buffer)
- )))))
-
-(provide 'org-freemind)
-
-;; arch-tag: e7b0d776-94fd-404a-b35e-0f855fae3627
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; org-freemind.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-freemind.elc b/.emacs.d/org-7.4/lisp/org-freemind.elc
deleted file mode 100644
index 3cf0ab2..0000000
--- a/.emacs.d/org-7.4/lisp/org-freemind.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-gnus.el b/.emacs.d/org-7.4/lisp/org-gnus.el
deleted file mode 100644
index fccd3e9..0000000
--- a/.emacs.d/org-7.4/lisp/org-gnus.el
+++ /dev/null
@@ -1,263 +0,0 @@
-;;; org-gnus.el --- Support for links to Gnus groups and messages from within Org-mode
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Tassilo Horn <tassilo at member dot fsf dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file implements links to Gnus groups and messages from within Org-mode.
-;; Org-mode loads this module by default - if this is not what you want,
-;; configure the variable `org-modules'.
-
-;;; Code:
-
-(require 'org)
-(eval-when-compile (require 'gnus-sum))
-
-;; Declare external functions and variables
-(declare-function message-fetch-field "message" (header &optional not-all))
-(declare-function message-narrow-to-head-1 "message" nil)
-(declare-function nnimap-group-overview-filename "nnimap" (group server))
-;; The following line suppresses a compiler warning stemming from gnus-sum.el
-(declare-function gnus-summary-last-subject "gnus-sum" nil)
-;; Customization variables
-
-(when (fboundp 'defvaralias)
- (defvaralias 'org-usenet-links-prefer-google 'org-gnus-prefer-web-links))
-
-(defcustom org-gnus-prefer-web-links nil
- "If non-nil, `org-store-link' creates web links to Google groups or Gmane.
-When nil, Gnus will be used for such links.
-Using a prefix arg to the command \\[org-store-link] (`org-store-link')
-negates this setting for the duration of the command."
- :group 'org-link-store
- :type 'boolean)
-
-(defcustom org-gnus-nnimap-query-article-no-from-file nil
- "If non-nil, `org-gnus-follow-link' will try to translate
-Message-Ids to article numbers by querying the .overview file.
-Normally, this translation is done by querying the IMAP server,
-which is usually very fast. Unfortunately, some (maybe badly
-configured) IMAP servers don't support this operation quickly.
-So if following a link to a Gnus article takes ages, try setting
-this variable to `t'."
- :group 'org-link-store
- :type 'boolean)
-
-
-;; Install the link type
-(org-add-link-type "gnus" 'org-gnus-open)
-(add-hook 'org-store-link-functions 'org-gnus-store-link)
-
-;; Implementation
-
-(defun org-gnus-nnimap-cached-article-number (group server message-id)
- "Return cached article number (uid) of message in GROUP on SERVER.
-MESSAGE-ID is the message-id header field that identifies the
-message. If the uid is not cached, return nil."
- (with-temp-buffer
- (let ((nov (nnimap-group-overview-filename group server)))
- (when (file-exists-p nov)
- (mm-insert-file-contents nov)
- (set-buffer-modified-p nil)
- (goto-char (point-min))
- (catch 'found
- (while (search-forward message-id nil t)
- (let ((hdr (split-string (thing-at-point 'line) "\t")))
- (if (string= (nth 4 hdr) message-id)
- (throw 'found (nth 0 hdr))))))))))
-
-(defun org-gnus-group-link (group)
- "Create a link to the Gnus group GROUP.
-If GROUP is a newsgroup and `org-gnus-prefer-web-links' is
-non-nil, create a link to groups.google.com or gmane.org.
-Otherwise create a link to the group inside Gnus.
-
-If `org-store-link' was called with a prefix arg the meaning of
-`org-gnus-prefer-web-links' is reversed."
- (let ((unprefixed-group (replace-regexp-in-string "^[^:]+:" "" group)))
- (if (and (string-match "^nntp" group) ;; Only for nntp groups
- (org-xor current-prefix-arg
- org-gnus-prefer-web-links))
- (org-make-link (if (string-match "gmane" unprefixed-group)
- "http://news.gmane.org/"
- "http://groups.google.com/group/")
- unprefixed-group)
- (org-make-link "gnus:" group))))
-
-(defun org-gnus-article-link (group newsgroups message-id x-no-archive)
- "Create a link to a Gnus article.
-The article is specified by its MESSAGE-ID. Additional
-parameters are the Gnus GROUP, the NEWSGROUPS the article was
-posted to and the X-NO-ARCHIVE header value of that article.
-
-If GROUP is a newsgroup and `org-gnus-prefer-web-links' is
-non-nil, create a link to groups.google.com or gmane.org.
-Otherwise create a link to the article inside Gnus.
-
-If `org-store-link' was called with a prefix arg the meaning of
-`org-gnus-prefer-web-links' is reversed."
- (if (and (org-xor current-prefix-arg org-gnus-prefer-web-links)
- newsgroups ;; Make web links only for nntp groups
- (not x-no-archive)) ;; and if X-No-Archive isn't set.
- (format (if (string-match "gmane\\." newsgroups)
- "http://mid.gmane.org/%s"
- "http://groups.google.com/groups/search?as_umsgid=%s")
- (org-fixup-message-id-for-http message-id))
- (org-make-link "gnus:" group "#" message-id)))
-
-(defun org-gnus-store-link ()
- "Store a link to a Gnus folder or message."
- (cond
- ((eq major-mode 'gnus-group-mode)
- (let* ((group (cond ((fboundp 'gnus-group-group-name) ; depending on Gnus
- (gnus-group-group-name)) ; version
- ((fboundp 'gnus-group-name)
- (gnus-group-name))
- (t "???")))
- desc link)
- (when group
- (org-store-link-props :type "gnus" :group group)
- (setq desc (org-gnus-group-link group)
- link desc)
- (org-add-link-props :link link :description desc)
- link)))
-
- ((memq major-mode '(gnus-summary-mode gnus-article-mode))
- (let* ((group gnus-newsgroup-name)
- (header (with-current-buffer gnus-summary-buffer
- (gnus-summary-article-header)))
- (from (mail-header-from header))
- (message-id (org-remove-angle-brackets (mail-header-id header)))
- (date (mail-header-date header))
- (date-ts (and date (format-time-string
- (org-time-stamp-format t) (date-to-time date))))
- (date-ts-ia (and date (format-time-string
- (org-time-stamp-format t t)
- (date-to-time date))))
- (subject (copy-sequence (mail-header-subject header)))
- (to (cdr (assq 'To (mail-header-extra header))))
- newsgroups x-no-archive desc link)
- ;; Remove text properties of subject string to avoid Emacs bug
- ;; #3506
- (set-text-properties 0 (length subject) nil subject)
-
- ;; Fetching an article is an expensive operation; newsgroup and
- ;; x-no-archive are only needed for web links.
- (when (org-xor current-prefix-arg org-gnus-prefer-web-links)
- ;; Make sure the original article buffer is up-to-date
- (save-window-excursion (gnus-summary-select-article))
- (setq to (or to (gnus-fetch-original-field "To"))
- newsgroups (gnus-fetch-original-field "Newsgroups")
- x-no-archive (gnus-fetch-original-field "x-no-archive")))
- (org-store-link-props :type "gnus" :from from :subject subject
- :message-id message-id :group group :to to)
- (when date
- (org-add-link-props :date date :date-timestamp date-ts
- :date-timestamp-inactive date-ts-ia))
- (setq desc (org-email-link-description)
- link (org-gnus-article-link
- group newsgroups message-id x-no-archive))
- (org-add-link-props :link link :description desc)
- link))))
-
-(defun org-gnus-open-nntp (path)
- "Follow the nntp: link specified by PATH."
- (let* ((spec (split-string path "/"))
- (server (split-string (nth 2 spec) "@"))
- (group (nth 3 spec))
- (article (nth 4 spec)))
- (org-gnus-follow-link
- (format "nntp+%s:%s" (or (cdr server) (car server)) group)
- article)))
-
-(defun org-gnus-open (path)
- "Follow the Gnus message or folder link specified by PATH."
- (let (group article)
- (if (not (string-match "\\`\\([^#]+\\)\\(#\\(.*\\)\\)?" path))
- (error "Error in Gnus link"))
- (setq group (match-string 1 path)
- article (match-string 3 path))
- (when group
- (setq group (org-substring-no-properties group)))
- (when article
- (setq article (org-substring-no-properties article)))
- (org-gnus-follow-link group article)))
-
-(defun org-gnus-follow-link (&optional group article)
- "Follow a Gnus link to GROUP and ARTICLE."
- (require 'gnus)
- (funcall (cdr (assq 'gnus org-link-frame-setup)))
- (if gnus-other-frame-object (select-frame gnus-other-frame-object))
- (when group
- (setq group (org-substring-no-properties group)))
- (when article
- (setq article (org-substring-no-properties article)))
- (cond ((and group article)
- (gnus-activate-group group t)
- (condition-case nil
- (let* ((method (gnus-find-method-for-group group))
- (backend (car method))
- (server (cadr method)))
- (cond
- ((eq backend 'nndoc)
- (if (gnus-group-read-group t nil group)
- (gnus-summary-goto-article article nil t)
- (message "Couldn't follow gnus link. %s"
- "The summary couldn't be opened.")))
- (t
- (let ((articles 1)
- group-opened)
- (when (and (eq backend 'nnimap)
- org-gnus-nnimap-query-article-no-from-file)
- (setq article
- (or (org-gnus-nnimap-cached-article-number
- (nth 1 (split-string group ":"))
- server (concat "<" article ">")) article)))
- (while (and (not group-opened)
- ;; stop on integer overflows
- (> articles 0))
- (setq group-opened (gnus-group-read-group
- articles nil group)
- articles (if (< articles 16)
- (1+ articles)
- (* articles 2))))
- (if group-opened
- (gnus-summary-goto-article article nil t)
- (message "Couldn't follow gnus link. %s"
- "The summary couldn't be opened."))))))
- (quit (message "Couldn't follow gnus link. %s"
- "The linked group is empty."))))
- (group (gnus-group-jump-to-group group))))
-
-(defun org-gnus-no-new-news ()
- "Like `M-x gnus' but doesn't check for new news."
- (if (not (gnus-alive-p)) (gnus)))
-
-(provide 'org-gnus)
-
-;; arch-tag: 512e0840-58fa-45b3-b456-71e10fa2376d
-
-;;; org-gnus.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-gnus.elc b/.emacs.d/org-7.4/lisp/org-gnus.elc
deleted file mode 100644
index 9191171..0000000
--- a/.emacs.d/org-7.4/lisp/org-gnus.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-habit.el b/.emacs.d/org-7.4/lisp/org-habit.el
deleted file mode 100644
index b174a1f..0000000
--- a/.emacs.d/org-7.4/lisp/org-habit.el
+++ /dev/null
@@ -1,355 +0,0 @@
-;;; org-habit.el --- The habit tracking code for Org-mode
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: John Wiegley <johnw at gnu dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file contains the habit tracking code for Org-mode
-
-;;; Code:
-
-(require 'org)
-(require 'org-agenda)
-
-(eval-when-compile
- (require 'cl))
-
-(defgroup org-habit nil
- "Options concerning habit tracking in Org-mode."
- :tag "Org Habit"
- :group 'org-progress)
-
-(defcustom org-habit-graph-column 40
- "The absolute column at which to insert habit consistency graphs.
-Note that consistency graphs will overwrite anything else in the buffer."
- :group 'org-habit
- :type 'integer)
-
-(defcustom org-habit-preceding-days 21
- "Number of days before today to appear in consistency graphs."
- :group 'org-habit
- :type 'integer)
-
-(defcustom org-habit-following-days 7
- "Number of days after today to appear in consistency graphs."
- :group 'org-habit
- :type 'integer)
-
-(defcustom org-habit-show-habits t
- "If non-nil, show habits in agenda buffers."
- :group 'org-habit
- :type 'boolean)
-
-(defcustom org-habit-show-habits-only-for-today t
- "If non-nil, only show habits on today's agenda, and not for future days.
-Note that even when shown for future days, the graph is always
-relative to the current effective date."
- :group 'org-habit
- :type 'boolean)
-
-(defface org-habit-clear-face
- '((((background light)) (:background "#8270f9"))
- (((background dark)) (:background "blue")))
- "Face for days on which a task shouldn't be done yet."
- :group 'org-habit
- :group 'org-faces)
-(defface org-habit-clear-future-face
- '((((background light)) (:background "#d6e4fc"))
- (((background dark)) (:background "midnightblue")))
- "Face for future days on which a task shouldn't be done yet."
- :group 'org-habit
- :group 'org-faces)
-
-(defface org-habit-ready-face
- '((((background light)) (:background "#4df946"))
- (((background dark)) (:background "forestgreen")))
- "Face for days on which a task should start to be done."
- :group 'org-habit
- :group 'org-faces)
-(defface org-habit-ready-future-face
- '((((background light)) (:background "#acfca9"))
- (((background dark)) (:background "darkgreen")))
- "Face for days on which a task should start to be done."
- :group 'org-habit
- :group 'org-faces)
-
-(defface org-habit-alert-face
- '((((background light)) (:background "#f5f946"))
- (((background dark)) (:background "gold")))
- "Face for days on which a task is due."
- :group 'org-habit
- :group 'org-faces)
-(defface org-habit-alert-future-face
- '((((background light)) (:background "#fafca9"))
- (((background dark)) (:background "darkgoldenrod")))
- "Face for days on which a task is due."
- :group 'org-habit
- :group 'org-faces)
-
-(defface org-habit-overdue-face
- '((((background light)) (:background "#f9372d"))
- (((background dark)) (:background "firebrick")))
- "Face for days on which a task is overdue."
- :group 'org-habit
- :group 'org-faces)
-(defface org-habit-overdue-future-face
- '((((background light)) (:background "#fc9590"))
- (((background dark)) (:background "darkred")))
- "Face for days on which a task is overdue."
- :group 'org-habit
- :group 'org-faces)
-
-(defun org-habit-duration-to-days (ts)
- (if (string-match "\\([0-9]+\\)\\([dwmy]\\)" ts)
- ;; lead time is specified.
- (floor (* (string-to-number (match-string 1 ts))
- (cdr (assoc (match-string 2 ts)
- '(("d" . 1) ("w" . 7)
- ("m" . 30.4) ("y" . 365.25))))))
- (error "Invalid duration string: %s" ts)))
-
-(defun org-is-habit-p (&optional pom)
- "Is the task at POM or point a habit?"
- (string= "habit" (org-entry-get (or pom (point)) "STYLE")))
-
-(defun org-habit-parse-todo (&optional pom)
- "Parse the TODO surrounding point for its habit-related data.
-Returns a list with the following elements:
-
- 0: Scheduled date for the habit (may be in the past)
- 1: \".+\"-style repeater for the schedule, in days
- 2: Optional deadline (nil if not present)
- 3: If deadline, the repeater for the deadline, otherwise nil
- 4: A list of all the past dates this todo was mark closed
-
-This list represents a \"habit\" for the rest of this module."
- (save-excursion
- (if pom (goto-char pom))
- (assert (org-is-habit-p (point)))
- (let* ((scheduled (org-get-scheduled-time (point)))
- (scheduled-repeat (org-get-repeat org-scheduled-string))
- (end (org-entry-end-position))
- (habit-entry (org-no-properties (nth 4 (org-heading-components))))
- closed-dates deadline dr-days sr-days)
- (if scheduled
- (setq scheduled (time-to-days scheduled))
- (error "Habit %s has no scheduled date" habit-entry))
- (unless scheduled-repeat
- (error
- "Habit '%s' has no scheduled repeat period or has an incorrect one"
- habit-entry))
- (setq sr-days (org-habit-duration-to-days scheduled-repeat))
- (unless (> sr-days 0)
- (error "Habit %s scheduled repeat period is less than 1d" habit-entry))
- (when (string-match "/\\([0-9]+[dwmy]\\)" scheduled-repeat)
- (setq dr-days (org-habit-duration-to-days
- (match-string-no-properties 1 scheduled-repeat)))
- (if (<= dr-days sr-days)
- (error "Habit %s deadline repeat period is less than or equal to scheduled (%s)"
- habit-entry scheduled-repeat))
- (setq deadline (+ scheduled (- dr-days sr-days))))
- (org-back-to-heading t)
- (while (re-search-forward "- State \"DONE\".*\\[\\([^]]+\\)\\]" end t)
- (push (time-to-days
- (org-time-string-to-time (match-string-no-properties 1)))
- closed-dates))
- (list scheduled sr-days deadline dr-days closed-dates))))
-
-(defsubst org-habit-scheduled (habit)
- (nth 0 habit))
-(defsubst org-habit-scheduled-repeat (habit)
- (nth 1 habit))
-(defsubst org-habit-deadline (habit)
- (let ((deadline (nth 2 habit)))
- (or deadline
- (if (nth 3 habit)
- (+ (org-habit-scheduled habit)
- (1- (org-habit-scheduled-repeat habit)))
- (org-habit-scheduled habit)))))
-(defsubst org-habit-deadline-repeat (habit)
- (or (nth 3 habit)
- (org-habit-scheduled-repeat habit)))
-(defsubst org-habit-done-dates (habit)
- (nth 4 habit))
-
-(defsubst org-habit-get-priority (habit &optional moment)
- "Determine the relative priority of a habit.
-This must take into account not just urgency, but consistency as well."
- (let ((pri 1000)
- (now (if moment (time-to-days moment) (org-today)))
- (scheduled (org-habit-scheduled habit))
- (deadline (org-habit-deadline habit)))
- ;; add 10 for every day past the scheduled date, and subtract for every
- ;; day before it
- (setq pri (+ pri (* (- now scheduled) 10)))
- ;; add 50 if the deadline is today
- (if (and (/= scheduled deadline)
- (= now deadline))
- (setq pri (+ pri 50)))
- ;; add 100 for every day beyond the deadline date, and subtract 10 for
- ;; every day before it
- (let ((slip (- now (1- deadline))))
- (if (> slip 0)
- (setq pri (+ pri (* slip 100)))
- (setq pri (+ pri (* slip 10)))))
- pri))
-
-(defun org-habit-get-faces (habit &optional now-days scheduled-days donep)
- "Return faces for HABIT relative to NOW-DAYS and SCHEDULED-DAYS.
-NOW-DAYS defaults to the current time's days-past-the-epoch if nil.
-SCHEDULED-DAYS defaults to the habit's actual scheduled days if nil.
-
-Habits are assigned colors on the following basis:
- Blue Task is before the scheduled date.
- Green Task is on or after scheduled date, but before the
- end of the schedule's repeat period.
- Yellow If the task has a deadline, then it is after schedule's
- repeat period, but before the deadline.
- Orange The task has reached the deadline day, or if there is
- no deadline, the end of the schedule's repeat period.
- Red The task has gone beyond the deadline day or the
- schedule's repeat period."
- (let* ((scheduled (or scheduled-days (org-habit-scheduled habit)))
- (s-repeat (org-habit-scheduled-repeat habit))
- (scheduled-end (+ scheduled (1- s-repeat)))
- (d-repeat (org-habit-deadline-repeat habit))
- (deadline (if scheduled-days
- (+ scheduled-days (- d-repeat s-repeat))
- (org-habit-deadline habit)))
- (m-days (or now-days (time-to-days (current-time)))))
- (cond
- ((< m-days scheduled)
- '(org-habit-clear-face . org-habit-clear-future-face))
- ((< m-days deadline)
- '(org-habit-ready-face . org-habit-ready-future-face))
- ((= m-days deadline)
- (if donep
- '(org-habit-ready-face . org-habit-ready-future-face)
- '(org-habit-alert-face . org-habit-alert-future-face)))
- (t
- '(org-habit-overdue-face . org-habit-overdue-future-face)))))
-
-(defun org-habit-build-graph (habit starting current ending)
- "Build a graph for the given HABIT, from STARTING to ENDING.
-CURRENT gives the current time between STARTING and ENDING, for
-the purpose of drawing the graph. It need not be the actual
-current time."
- (let* ((done-dates (sort (org-habit-done-dates habit) '<))
- (scheduled (org-habit-scheduled habit))
- (s-repeat (org-habit-scheduled-repeat habit))
- (start (time-to-days starting))
- (now (time-to-days current))
- (end (time-to-days ending))
- (graph (make-string (1+ (- end start)) ?\ ))
- (index 0)
- last-done-date)
- (while (and done-dates (< (car done-dates) start))
- (setq last-done-date (car done-dates)
- done-dates (cdr done-dates)))
- (while (< start end)
- (let* ((in-the-past-p (< start now))
- (todayp (= start now))
- (donep (and done-dates
- (= start (car done-dates))))
- (faces (if (and in-the-past-p
- (not last-done-date)
- (not (< scheduled now)))
- '(org-habit-clear-face . org-habit-clear-future-face)
- (org-habit-get-faces
- habit start (and in-the-past-p
- (if last-done-date
- (+ last-done-date s-repeat)
- scheduled))
- donep)))
- markedp face)
- (if donep
- (let ((done-time (time-add
- starting
- (days-to-time
- (- start (time-to-days starting))))))
-
- (aset graph index ?*)
- (setq markedp t)
- (put-text-property
- index (1+ index) 'help-echo
- (format-time-string (org-time-stamp-format) done-time) graph)
- (while (and done-dates
- (= start (car done-dates)))
- (setq last-done-date (car done-dates)
- done-dates (cdr done-dates))))
- (if todayp
- (aset graph index ?!)))
- (setq face (if (or in-the-past-p todayp)
- (car faces)
- (cdr faces)))
- (if (and in-the-past-p
- (not (eq face 'org-habit-overdue-face))
- (not markedp))
- (setq face (cdr faces)))
- (put-text-property index (1+ index) 'face face graph))
- (setq start (1+ start)
- index (1+ index)))
- graph))
-
-(defun org-habit-insert-consistency-graphs (&optional line)
- "Insert consistency graph for any habitual tasks."
- (let ((inhibit-read-only t) l c
- (buffer-invisibility-spec '(org-link))
- (moment (time-subtract (current-time)
- (list 0 (* 3600 org-extend-today-until) 0))))
- (save-excursion
- (goto-char (if line (point-at-bol) (point-min)))
- (while (not (eobp))
- (let ((habit (get-text-property (point) 'org-habit-p)))
- (when habit
- (move-to-column org-habit-graph-column t)
- (delete-char (min (+ 1 org-habit-preceding-days
- org-habit-following-days)
- (- (line-end-position) (point))))
- (insert (org-habit-build-graph
- habit
- (time-subtract moment
- (days-to-time org-habit-preceding-days))
- moment
- (time-add moment
- (days-to-time org-habit-following-days))))))
- (forward-line)))))
-
-(defun org-habit-toggle-habits ()
- "Toggle display of habits in an agenda buffer."
- (interactive)
- (org-agenda-check-type t 'agenda)
- (setq org-habit-show-habits (not org-habit-show-habits))
- (org-agenda-redo)
- (org-agenda-set-mode-name)
- (message "Habits turned %s"
- (if org-habit-show-habits "on" "off")))
-
-(org-defkey org-agenda-mode-map "K" 'org-habit-toggle-habits)
-
-(provide 'org-habit)
-
-;; arch-tag: 64e070d9-bd09-4917-bd44-44465f5ed348
-
-;;; org-habit.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-habit.elc b/.emacs.d/org-7.4/lisp/org-habit.elc
deleted file mode 100644
index 248fd1c..0000000
--- a/.emacs.d/org-7.4/lisp/org-habit.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-html.el b/.emacs.d/org-7.4/lisp/org-html.el
deleted file mode 100644
index 47e8231..0000000
--- a/.emacs.d/org-7.4/lisp/org-html.el
+++ /dev/null
@@ -1,2419 +0,0 @@
-;;; org-html.el --- HTML export for Org-mode
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;;; Code:
-
-(require 'org-exp)
-
-(eval-when-compile (require 'cl))
-
-(declare-function org-id-find-id-file "org-id" (id))
-(declare-function htmlize-region "ext:htmlize" (beg end))
-
-(defgroup org-export-html nil
- "Options specific for HTML export of Org-mode files."
- :tag "Org Export HTML"
- :group 'org-export)
-
-(defcustom org-export-html-footnotes-section "<div id=\"footnotes\">
-<h2 class=\"footnotes\">%s: </h2>
-<div id=\"text-footnotes\">
-%s
-</div>
-</div>"
- "Format for the footnotes section.
-Should contain a two instances of %s. The first will be replaced with the
-language-specific word for \"Footnotes\", the second one will be replaced
-by the footnotes themselves."
- :group 'org-export-html
- :type 'string)
-
-(defcustom org-export-html-footnote-format "<sup>%s</sup>"
- "The format for the footnote reference.
-%s will be replaced by the footnote reference itself."
- :group 'org-export-html
- :type 'string)
-
-(defcustom org-export-html-coding-system nil
- "Coding system for HTML export, defaults to `buffer-file-coding-system'."
- :group 'org-export-html
- :type 'coding-system)
-
-(defcustom org-export-html-extension "html"
- "The extension for exported HTML files."
- :group 'org-export-html
- :type 'string)
-
-(defcustom org-export-html-xml-declaration
- '(("html" . "<?xml version=\"1.0\" encoding=\"%s\"?>")
- ("php" . "<?php echo \"<?xml version=\\\"1.0\\\" encoding=\\\"%s\\\" ?>\"; ?>"))
- "The extension for exported HTML files.
-%s will be replaced with the charset of the exported file.
-This may be a string, or an alist with export extensions
-and corresponding declarations."
- :group 'org-export-html
- :type '(choice
- (string :tag "Single declaration")
- (repeat :tag "Dependent on extension"
- (cons (string :tag "Extension")
- (string :tag "Declaration")))))
-
-(defcustom org-export-html-style-include-scripts t
- "Non-nil means include the JavaScript snippets in exported HTML files.
-The actual script is defined in `org-export-html-scripts' and should
-not be modified."
- :group 'org-export-html
- :type 'boolean)
-
-(defconst org-export-html-scripts
-"<script type=\"text/javascript\">
-<!--/*--><![CDATA[/*><!--*/
- function CodeHighlightOn(elem, id)
- {
- var target = document.getElementById(id);
- if(null != target) {
- elem.cacheClassElem = elem.className;
- elem.cacheClassTarget = target.className;
- target.className = \"code-highlighted\";
- elem.className = \"code-highlighted\";
- }
- }
- function CodeHighlightOff(elem, id)
- {
- var target = document.getElementById(id);
- if(elem.cacheClassElem)
- elem.className = elem.cacheClassElem;
- if(elem.cacheClassTarget)
- target.className = elem.cacheClassTarget;
- }
-/*]]>*///-->
-</script>"
-"Basic JavaScript that is needed by HTML files produced by Org-mode.")
-
-(defconst org-export-html-style-default
-"<style type=\"text/css\">
- <!--/*--><![CDATA[/*><!--*/
- html { font-family: Times, serif; font-size: 12pt; }
- .title { text-align: center; }
- .todo { color: red; }
- .done { color: green; }
- .tag { background-color: #add8e6; font-weight:normal }
- .target { }
- .timestamp { color: #bebebe; }
- .timestamp-kwd { color: #5f9ea0; }
- .right {margin-left:auto; margin-right:0px; text-align:right;}
- .left {margin-left:0px; margin-right:auto; text-align:left;}
- .center {margin-left:auto; margin-right:auto; text-align:center;}
- p.verse { margin-left: 3% }
- pre {
- border: 1pt solid #AEBDCC;
- background-color: #F3F5F7;
- padding: 5pt;
- font-family: courier, monospace;
- font-size: 90%;
- overflow:auto;
- }
- table { border-collapse: collapse; }
- td, th { vertical-align: top; }
- th.right { text-align:center; }
- th.left { text-align:center; }
- th.center { text-align:center; }
- td.right { text-align:right; }
- td.left { text-align:left; }
- td.center { text-align:center; }
- dt { font-weight: bold; }
- div.figure { padding: 0.5em; }
- div.figure p { text-align: center; }
- textarea { overflow-x: auto; }
- .linenr { font-size:smaller }
- .code-highlighted {background-color:#ffff00;}
- .org-info-js_info-navigation { border-style:none; }
- #org-info-js_console-label { font-size:10px; font-weight:bold;
- white-space:nowrap; }
- .org-info-js_search-highlight {background-color:#ffff00; color:#000000;
- font-weight:bold; }
- /*]]>*/-->
-</style>"
- "The default style specification for exported HTML files.
-Please use the variables `org-export-html-style' and
-`org-export-html-style-extra' to add to this style. If you wish to not
-have the default style included, customize the variable
-`org-export-html-style-include-default'.")
-
-(defcustom org-export-html-style-include-default t
- "Non-nil means include the default style in exported HTML files.
-The actual style is defined in `org-export-html-style-default' and should
-not be modified. Use the variables `org-export-html-style' to add
-your own style information."
- :group 'org-export-html
- :type 'boolean)
-;;;###autoload
-(put 'org-export-html-style-include-default 'safe-local-variable 'booleanp)
-
-(defcustom org-export-html-style ""
- "Org-wide style definitions for exported HTML files.
-
-This variable needs to contain the full HTML structure to provide a style,
-including the surrounding HTML tags. If you set the value of this variable,
-you should consider to include definitions for the following classes:
- title, todo, done, timestamp, timestamp-kwd, tag, target.
-
-For example, a valid value would be:
-
- <style type=\"text/css\">
- <![CDATA[
- p { font-weight: normal; color: gray; }
- h1 { color: black; }
- .title { text-align: center; }
- .todo, .timestamp-kwd { color: red; }
- .done { color: green; }
- ]]>
- </style>
-
-If you'd like to refer to en external style file, use something like
-
- <link rel=\"stylesheet\" type=\"text/css\" href=\"mystyles.css\">
-
-As the value of this option simply gets inserted into the HTML <head> header,
-you can \"misuse\" it to add arbitrary text to the header.
-See also the variable `org-export-html-style-extra'."
- :group 'org-export-html
- :type 'string)
-;;;###autoload
-(put 'org-export-html-style 'safe-local-variable 'stringp)
-
-(defcustom org-export-html-style-extra ""
- "Additional style information for HTML export.
-The value of this variable is inserted into the HTML buffer right after
-the value of `org-export-html-style'. Use this variable for per-file
-settings of style information, and do not forget to surround the style
-settings with <style>...</style> tags."
- :group 'org-export-html
- :type 'string)
-;;;###autoload
-(put 'org-export-html-style-extra 'safe-local-variable 'stringp)
-
-(defcustom org-export-html-mathjax-options
- '((path "http://orgmode.org/mathjax/MathJax.js")
- (scale "100")
- (align "center")
- (indent "2em")
- (mathml nil))
- "Options for MathJax setup.
-
-path The path where to find MathJax
-scale Scaling for the HTML-CSS backend, usually between 100 and 133
-align How to align display math: left, center, or right
-indent If align is not center, how far from the left/right side?
-mathml Should a MathML player be used if available?
- This is faster and reduces bandwidth use, but currently
- sometimes has lower spacing quality. Therefore, the default is
- nil. When browsers get better, this switch can be flipped.
-
-You can also customize this for each buffer, using something like
-
-#+MATHJAX: scale:\"133\" align:\"right\" mathml:t path:\"/MathJax/\""
- :group 'org-export-html
- :type '(list :greedy t
- (list :tag "path (the path from where to load MathJax.js)"
- (const :format " " path) (string))
- (list :tag "scale (scaling for the displayed math)"
- (const :format " " scale) (string))
- (list :tag "align (alignment of displayed equations)"
- (const :format " " align) (string))
- (list :tag "indent (indentation with left or right alignment)"
- (const :format " " indent) (string))
- (list :tag "mathml (should MathML display be used is possible)"
- (const :format " " mathml) (boolean))))
-
-(defun org-export-html-mathjax-config (template options in-buffer)
- "Insert the user setup into the matchjax template."
- (let (name val (yes " ") (no "// ") x)
- (mapc
- (lambda (e)
- (setq name (car e) val (nth 1 e))
- (if (string-match (concat "\\<" (symbol-name name) ":") in-buffer)
- (setq val (car (read-from-string
- (substring in-buffer (match-end 0))))))
- (if (not (stringp val)) (setq val (format "%s" val)))
- (if (string-match (concat "%" (upcase (symbol-name name))) template)
- (setq template (replace-match val t t template))))
- options)
- (setq val (nth 1 (assq 'mathml options)))
- (if (string-match (concat "\\<mathml:") in-buffer)
- (setq val (car (read-from-string
- (substring in-buffer (match-end 0))))))
- ;; Exchange prefixes depending on mathml setting
- (if (not val) (setq x yes yes no no x))
- ;; Replace cookies to turn on or off the config/jax lines
- (if (string-match ":MMLYES:" template)
- (setq template (replace-match yes t t template)))
- (if (string-match ":MMLNO:" template)
- (setq template (replace-match no t t template)))
- ;; Return the modified template
- template))
-
-(defcustom org-export-html-mathjax-template
- "<script type=\"text/javascript\" src=\"%PATH\">
-<!--/*--><![CDATA[/*><!--*/
- MathJax.Hub.Config({
- // Only one of the two following lines, depending on user settings
- // First allows browser-native MathML display, second forces HTML/CSS
- :MMLYES: config: [\"MMLorHTML.js\"], jax: [\"input/TeX\"],
- :MMLNO: jax: [\"input/TeX\", \"output/HTML-CSS\"],
- extensions: [\"tex2jax.js\",\"TeX/AMSmath.js\",\"TeX/AMSsymbols.js\",
- \"TeX/noUndefined.js\"],
- tex2jax: {
- inlineMath: [ [\"\\\\(\",\"\\\\)\"] ],
- displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"] ],
- skipTags: [\"script\",\"noscript\",\"style\",\"textarea\",\"pre\",\"code\"],
- ignoreClass: \"tex2jax_ignore\",
- processEscapes: false,
- processEnvironments: true,
- preview: \"TeX\"
- },
- showProcessingMessages: true,
- displayAlign: \"%ALIGN\",
- displayIndent: \"%INDENT\",
-
- \"HTML-CSS\": {
- scale: %SCALE,
- availableFonts: [\"STIX\",\"TeX\"],
- preferredFont: \"TeX\",
- webFont: \"TeX\",
- imageFont: \"TeX\",
- showMathMenu: true,
- },
- MMLorHTML: {
- prefer: {
- MSIE: \"MML\",
- Firefox: \"MML\",
- Opera: \"HTML\",
- other: \"HTML\"
- }
- }
- });
-/*]]>*///-->
-</script>"
- "The MathJax setup for XHTML files."
- :group 'org-export-html
- :type 'string)
-
-(defcustom org-export-html-tag-class-prefix ""
- "Prefix to class names for TODO keywords.
-Each tag gets a class given by the tag itself, with this prefix.
-The default prefix is empty because it is nice to just use the keyword
-as a class name. But if you get into conflicts with other, existing
-CSS classes, then this prefix can be very useful."
- :group 'org-export-html
- :type 'string)
-
-(defcustom org-export-html-todo-kwd-class-prefix ""
- "Prefix to class names for TODO keywords.
-Each TODO keyword gets a class given by the keyword itself, with this prefix.
-The default prefix is empty because it is nice to just use the keyword
-as a class name. But if you get into conflicts with other, existing
-CSS classes, then this prefix can be very useful."
- :group 'org-export-html
- :type 'string)
-
-(defcustom org-export-html-title-format "<h1 class=\"title\">%s</h1>\n"
- "Format for typesetting the document title in HTML export."
- :group 'org-export-html
- :type 'string)
-
-(defcustom org-export-html-home/up-format
- "<div id=\"org-div-home-and-up\" style=\"text-align:right;font-size:70%%;white-space:nowrap;\">
- <a accesskey=\"h\" href=\"%s\"> UP </a>
- |
- <a accesskey=\"H\" href=\"%s\"> HOME </a>
-</div>"
- "Snippet used to insert the HOME and UP links.
-This is a format string, the first %s will receive the UP link,
-the second the HOME link. If both `org-export-html-link-up' and
-`org-export-html-link-home' are empty, the entire snippet will be
-ignored."
- :group 'org-export-html
- :type 'string)
-
-(defcustom org-export-html-toplevel-hlevel 2
- "The <H> level for level 1 headings in HTML export.
-This is also important for the classes that will be wrapped around headlines
-and outline structure. If this variable is 1, the top-level headlines will
-be <h1>, and the corresponding classes will be outline-1, section-number-1,
-and outline-text-1. If this is 2, all of these will get a 2 instead.
-The default for this variable is 2, because we use <h1> for formatting the
-document title."
- :group 'org-export-html
- :type 'string)
-
-(defcustom org-export-html-link-org-files-as-html t
- "Non-nil means make file links to `file.org' point to `file.html'.
-When org-mode is exporting an org-mode file to HTML, links to
-non-html files are directly put into a href tag in HTML.
-However, links to other Org-mode files (recognized by the
-extension `.org.) should become links to the corresponding html
-file, assuming that the linked org-mode file will also be
-converted to HTML.
-When nil, the links still point to the plain `.org' file."
- :group 'org-export-html
- :type 'boolean)
-
-(defcustom org-export-html-inline-images 'maybe
- "Non-nil means inline images into exported HTML pages.
-This is done using an <img> tag. When nil, an anchor with href is used to
-link to the image. If this option is `maybe', then images in links with
-an empty description will be inlined, while images with a description will
-be linked only."
- :group 'org-export-html
- :type '(choice (const :tag "Never" nil)
- (const :tag "Always" t)
- (const :tag "When there is no description" maybe)))
-
-(defcustom org-export-html-inline-image-extensions
- '("png" "jpeg" "jpg" "gif" "svg")
- "Extensions of image files that can be inlined into HTML."
- :group 'org-export-html
- :type '(repeat (string :tag "Extension")))
-
-(defcustom org-export-html-table-tag
- "<table border=\"2\" cellspacing=\"0\" cellpadding=\"6\" rules=\"groups\" frame=\"hsides\">"
- "The HTML tag that is used to start a table.
-This must be a <table> tag, but you may change the options like
-borders and spacing."
- :group 'org-export-html
- :type 'string)
-
-(defcustom org-export-table-header-tags '("<th scope=\"%s\"%s>" . "</th>")
- "The opening tag for table header fields.
-This is customizable so that alignment options can be specified.
-The first %s will be filled with the scope of the field, either row or col.
-The second %s will be replaced by a style entry to align the field.
-See also the variable `org-export-html-table-use-header-tags-for-first-column'.
-See also the variable `org-export-html-table-align-individual-fields'."
- :group 'org-export-tables
- :type '(cons (string :tag "Opening tag") (string :tag "Closing tag")))
-
-(defcustom org-export-table-data-tags '("<td%s>" . "</td>")
- "The opening tag for table data fields.
-This is customizable so that alignment options can be specified.
-The first %s will be filled with the scope of the field, either row or col.
-The second %s will be replaced by a style entry to align the field.
-See also the variable `org-export-html-table-align-individual-fields'."
- :group 'org-export-tables
- :type '(cons (string :tag "Opening tag") (string :tag "Closing tag")))
-
-(defcustom org-export-table-row-tags '("<tr>" . "</tr>")
- "The opening tag for table data fields.
-This is customizable so that alignment options can be specified.
-Instead of strings, these can be Lisp forms that will be evaluated
-for each row in order to construct the table row tags. During evaluation,
-the variable `head' will be true when this is a header line, nil when this
-is a body line. And the variable `nline' will contain the line number,
-starting from 1 in the first header line. For example
-
- (setq org-export-table-row-tags
- (cons '(if head
- \"<tr>\"
- (if (= (mod nline 2) 1)
- \"<tr class=\\\"tr-odd\\\">\"
- \"<tr class=\\\"tr-even\\\">\"))
- \"</tr>\"))
-
-will give even lines the class \"tr-even\" and odd lines the class \"tr-odd\"."
- :group 'org-export-tables
- :type '(cons
- (choice :tag "Opening tag"
- (string :tag "Specify")
- (sexp))
- (choice :tag "Closing tag"
- (string :tag "Specify")
- (sexp))))
-
-(defcustom org-export-html-table-align-individual-fields t
- "Non-nil means attach style attributes for alignment to each table field.
-When nil, alignment will only be specified in the column tags, but this
-is ignored by some browsers (like Firefox, Safari). Opera does it right
-though."
- :group 'org-export-tables
- :type 'boolean)
-
-(defcustom org-export-html-table-use-header-tags-for-first-column nil
- "Non-nil means format column one in tables with header tags.
-When nil, also column one will use data tags."
- :group 'org-export-tables
- :type 'boolean)
-
-(defcustom org-export-html-validation-link nil
- "Non-nil means add validation link to postamble of HTML exported files."
- :group 'org-export-html
- :type '(choice
- (const :tag "Nothing" nil)
- (const :tag "XHTML 1.0" "<p class=\"xhtml-validation\"><a href=\"http://validator.w3.org/check?uri=referer\">Validate XHTML 1.0</a></p>")
- (string :tag "Specify full HTML")))
-
-
-(defcustom org-export-html-with-timestamp nil
- "If non-nil, write timestamp into the exported HTML text.
-If non-nil Write `org-export-html-html-helper-timestamp' into the
-exported HTML text. Otherwise, the buffer will just be saved to
-a file."
- :group 'org-export-html
- :type 'boolean)
-
-(defcustom org-export-html-html-helper-timestamp
- "<br/><br/><hr><p><!-- hhmts start --> <!-- hhmts end --></p>\n"
- "The HTML tag used as timestamp delimiter for HTML-helper-mode."
- :group 'org-export-html
- :type 'string)
-
-(defgroup org-export-htmlize nil
- "Options for processing examples with htmlize.el."
- :tag "Org Export Htmlize"
- :group 'org-export-html)
-
-(defcustom org-export-htmlize-output-type 'inline-css
- "Output type to be used by htmlize when formatting code snippets.
-We use as default `inline-css', in order to make the resulting
-HTML self-containing.
-However, this will fail when using Emacs in batch mode for export, because
-then no rich font definitions are in place. It will also not be good if
-people with different Emacs setup contribute HTML files to a website,
-because the fonts will represent the individual setups. In these cases,
-it is much better to let Org/Htmlize assign classes only, and to use
-a style file to define the look of these classes.
-To get a start for your css file, start Emacs session and make sure that
-all the faces you are interested in are defined, for example by loading files
-in all modes you want. Then, use the command
-\\[org-export-htmlize-generate-css] to extract class definitions."
- :group 'org-export-htmlize
- :type '(choice (const css) (const inline-css)))
-
-(defcustom org-export-htmlize-css-font-prefix "org-"
- "The prefix for CSS class names for htmlize font specifications."
- :group 'org-export-htmlize
- :type 'string)
-
-(defcustom org-export-htmlized-org-css-url nil
- "URL pointing to a CSS file defining text colors for htmlized Emacs buffers.
-Normally when creating an htmlized version of an Org buffer, htmlize will
-create CSS to define the font colors. However, this does not work when
-converting in batch mode, and it also can look bad if different people
-with different fontification setup work on the same website.
-When this variable is non-nil, creating an htmlized version of an Org buffer
-using `org-export-as-org' will remove the internal CSS section and replace it
-with a link to this URL."
- :group 'org-export-htmlize
- :type '(choice
- (const :tag "Keep internal css" nil)
- (string :tag "URL or local href")))
-
-;;; Variables, constants, and parameter plists
-
-(defvar org-export-html-preamble nil
- "Preamble, to be inserted just after <body>. Set by publishing functions.
-This may also be a function, building and inserting the preamble.")
-(defvar org-export-html-postamble nil
- "Postamble, to be inserted just before </body>. Set by publishing functions.
-This may also be a function, building and inserting the postamble.")
-(defvar org-export-html-auto-preamble t
- "Should default preamble be inserted? Set by publishing functions.")
-(defvar org-export-html-auto-postamble t
- "Should default postamble be inserted? Set by publishing functions.")
-
-;;; Hooks
-
-(defvar org-export-html-after-blockquotes-hook nil
- "Hook run during HTML export, after blockquote, verse, center are done.")
-
-(defvar org-export-html-final-hook nil
- "Hook run at the end of HTML export, in the new buffer.")
-
-;;; HTML export
-
-(defun org-export-html-preprocess (parameters)
- "Convert LaTeX fragments to images."
- (when (and org-current-export-file
- (plist-get parameters :LaTeX-fragments))
- (org-format-latex
- (concat "ltxpng/" (file-name-sans-extension
- (file-name-nondirectory
- org-current-export-file)))
- org-current-export-dir nil "Creating LaTeX image %s"
- nil nil
- (cond
- ((eq (plist-get parameters :LaTeX-fragments) 'verbatim) 'verbatim)
- ((eq (plist-get parameters :LaTeX-fragments) 'mathjax ) 'mathjax)
- ((eq (plist-get parameters :LaTeX-fragments) t ) 'mathjax)
- ((eq (plist-get parameters :LaTeX-fragments) 'dvipng ) 'dvipng)
- (t nil))))
- (goto-char (point-min))
- (let (label l1)
- (while (re-search-forward "\\\\ref{\\([^{}\n]+\\)}" nil t)
- (org-if-unprotected-at (match-beginning 1)
- (setq label (match-string 1))
- (save-match-data
- (if (string-match "\\`[a-z]\\{1,10\\}:\\(.+\\)" label)
- (setq l1 (substring label (match-beginning 1)))
- (setq l1 label)))
- (replace-match (format "[[#%s][%s]]" label l1) t t)))))
-
-;;;###autoload
-(defun org-export-as-html-and-open (arg)
- "Export the outline as HTML and immediately open it with a browser.
-If there is an active region, export only the region.
-The prefix ARG specifies how many levels of the outline should become
-headlines. The default is 3. Lower levels will become bulleted lists."
- (interactive "P")
- (org-export-as-html arg 'hidden)
- (org-open-file buffer-file-name)
- (when org-export-kill-product-buffer-when-displayed
- (kill-buffer (current-buffer))))
-
-;;;###autoload
-(defun org-export-as-html-batch ()
- "Call the function `org-export-as-html'.
-This function can be used in batch processing as:
-emacs --batch
- --load=$HOME/lib/emacs/org.el
- --eval \"(setq org-export-headline-levels 2)\"
- --visit=MyFile --funcall org-export-as-html-batch"
- (org-export-as-html org-export-headline-levels 'hidden))
-
-;;;###autoload
-(defun org-export-as-html-to-buffer (arg)
- "Call `org-export-as-html` with output to a temporary buffer.
-No file is created. The prefix ARG is passed through to `org-export-as-html'."
- (interactive "P")
- (org-export-as-html arg nil nil "*Org HTML Export*")
- (when org-export-show-temporary-export-buffer
- (switch-to-buffer-other-window "*Org HTML Export*")))
-
-;;;###autoload
-(defun org-replace-region-by-html (beg end)
- "Assume the current region has org-mode syntax, and convert it to HTML.
-This can be used in any buffer. For example, you could write an
-itemized list in org-mode syntax in an HTML buffer and then use this
-command to convert it."
- (interactive "r")
- (let (reg html buf pop-up-frames)
- (save-window-excursion
- (if (org-mode-p)
- (setq html (org-export-region-as-html
- beg end t 'string))
- (setq reg (buffer-substring beg end)
- buf (get-buffer-create "*Org tmp*"))
- (with-current-buffer buf
- (erase-buffer)
- (insert reg)
- (org-mode)
- (setq html (org-export-region-as-html
- (point-min) (point-max) t 'string)))
- (kill-buffer buf)))
- (delete-region beg end)
- (insert html)))
-
-;;;###autoload
-(defun org-export-region-as-html (beg end &optional body-only buffer)
- "Convert region from BEG to END in org-mode buffer to HTML.
-If prefix arg BODY-ONLY is set, omit file header, footer, and table of
-contents, and only produce the region of converted text, useful for
-cut-and-paste operations.
-If BUFFER is a buffer or a string, use/create that buffer as a target
-of the converted HTML. If BUFFER is the symbol `string', return the
-produced HTML as a string and leave not buffer behind. For example,
-a Lisp program could call this function in the following way:
-
- (setq html (org-export-region-as-html beg end t 'string))
-
-When called interactively, the output buffer is selected, and shown
-in a window. A non-interactive call will only return the buffer."
- (interactive "r\nP")
- (when (interactive-p)
- (setq buffer "*Org HTML Export*"))
- (let ((transient-mark-mode t) (zmacs-regions t)
- ext-plist rtn)
- (setq ext-plist (plist-put ext-plist :ignore-subtree-p t))
- (goto-char end)
- (set-mark (point)) ;; to activate the region
- (goto-char beg)
- (setq rtn (org-export-as-html
- nil nil ext-plist
- buffer body-only))
- (if (fboundp 'deactivate-mark) (deactivate-mark))
- (if (and (interactive-p) (bufferp rtn))
- (switch-to-buffer-other-window rtn)
- rtn)))
-
-(defvar html-table-tag nil) ; dynamically scoped into this.
-(defvar org-par-open nil)
-
-;;; org-html-cvt-link-fn
-(defconst org-html-cvt-link-fn
- nil
- "Function to convert link URLs to exportable URLs.
-Takes two arguments, TYPE and PATH.
-Returns exportable url as (TYPE PATH), or nil to signal that it
-didn't handle this case.
-Intended to be locally bound around a call to `org-export-as-html'." )
-
-(defun org-html-cvt-org-as-html (opt-plist type path)
- "Convert an org filename to an equivalent html filename.
-If TYPE is not file, just return `nil'.
-See variable `org-export-html-link-org-files-as-html'"
-
- (save-match-data
- (and
- org-export-html-link-org-files-as-html
- (string= type "file")
- (string-match "\\.org$" path)
- (progn
- (list
- "file"
- (concat
- (substring path 0 (match-beginning 0))
- "."
- (plist-get opt-plist :html-extension)))))))
-
-
-;;; org-html-should-inline-p
-(defun org-html-should-inline-p (filename descp)
- "Return non-nil if link FILENAME should be inlined.
-The decision to inline the FILENAME link is based on the current
-settings. DESCP is the boolean of whether there was a link
-description. See variables `org-export-html-inline-images' and
-`org-export-html-inline-image-extensions'."
- (declare (special
- org-export-html-inline-images
- org-export-html-inline-image-extensions))
- (and (or (eq t org-export-html-inline-images)
- (and org-export-html-inline-images (not descp)))
- (org-file-image-p
- filename org-export-html-inline-image-extensions)))
-
-;;; org-html-make-link
-(defun org-html-make-link (opt-plist type path fragment desc attr
- may-inline-p)
- "Make an HTML link.
-OPT-PLIST is an options list.
-TYPE is the device-type of the link (THIS://foo.html)
-PATH is the path of the link (http://THIS#locationx)
-FRAGMENT is the fragment part of the link, if any (foo.html#THIS)
-DESC is the link description, if any.
-ATTR is a string of other attributes of the a element.
-MAY-INLINE-P allows inlining it as an image."
-
- (declare (special org-par-open))
- (save-match-data
- (let* ((filename path)
- ;;First pass. Just sanity stuff.
- (components-1
- (cond
- ((string= type "file")
- (list
- type
- ;;Substitute just if original path was absolute.
- ;;(Otherwise path must remain relative)
- (if (file-name-absolute-p path)
- (concat "file://" (expand-file-name path))
- path)))
- ((string= type "")
- (list nil path))
- (t (list type path))))
-
- ;;Second pass. Components converted so they can refer
- ;;to a remote site.
- (components-2
- (or
- (and org-html-cvt-link-fn
- (apply org-html-cvt-link-fn
- opt-plist components-1))
- (apply #'org-html-cvt-org-as-html
- opt-plist components-1)
- components-1))
- (type (first components-2))
- (thefile (second components-2)))
-
-
- ;;Third pass. Build final link except for leading type
- ;;spec.
- (cond
- ((or
- (not type)
- (string= type "http")
- (string= type "https")
- (string= type "file"))
- (if fragment
- (setq thefile (concat thefile "#" fragment))))
-
- (t))
-
- ;;Final URL-build, for all types.
- (setq thefile
- (let
- ((str (org-export-html-format-href thefile)))
- (if (and type (not (string= "file" type)))
- (concat type ":" str)
- str)))
-
- (if (and
- may-inline-p
- ;;Can't inline a URL with a fragment.
- (not fragment))
- (progn
- (message "image %s %s" thefile org-par-open)
- (org-export-html-format-image thefile org-par-open))
- (concat
- "<a href=\"" thefile "\"" attr ">"
- (org-export-html-format-desc desc)
- "</a>")))))
-
-;;; org-export-as-html
-;;;###autoload
-(defun org-export-as-html (arg &optional hidden ext-plist
- to-buffer body-only pub-dir)
- "Export the outline as a pretty HTML file.
-If there is an active region, export only the region. The prefix
-ARG specifies how many levels of the outline should become
-headlines. The default is 3. Lower levels will become bulleted
-lists. HIDDEN is obsolete and does nothing.
-EXT-PLIST is a property list with external parameters overriding
-org-mode's default settings, but still inferior to file-local
-settings. When TO-BUFFER is non-nil, create a buffer with that
-name and export to that buffer. If TO-BUFFER is the symbol
-`string', don't leave any buffer behind but just return the
-resulting HTML as a string. When BODY-ONLY is set, don't produce
-the file header and footer, simply return the content of
-<body>...</body>, without even the body tags themselves. When
-PUB-DIR is set, use this as the publishing directory."
- (interactive "P")
- (run-hooks 'org-export-first-hook)
-
- ;; Make sure we have a file name when we need it.
- (when (and (not (or to-buffer body-only))
- (not buffer-file-name))
- (if (buffer-base-buffer)
- (org-set-local 'buffer-file-name
- (with-current-buffer (buffer-base-buffer)
- buffer-file-name))
- (error "Need a file name to be able to export")))
-
- (message "Exporting...")
- (setq-default org-todo-line-regexp org-todo-line-regexp)
- (setq-default org-deadline-line-regexp org-deadline-line-regexp)
- (setq-default org-done-keywords org-done-keywords)
- (setq-default org-maybe-keyword-time-regexp org-maybe-keyword-time-regexp)
- (let* ((opt-plist
- (org-export-process-option-filters
- (org-combine-plists (org-default-export-plist)
- ext-plist
- (org-infile-export-plist))))
- (body-only (or body-only (plist-get opt-plist :body-only)))
- (style (concat (if (plist-get opt-plist :style-include-default)
- org-export-html-style-default)
- (plist-get opt-plist :style)
- (plist-get opt-plist :style-extra)
- "\n"
- (if (plist-get opt-plist :style-include-scripts)
- org-export-html-scripts)))
- (html-extension (plist-get opt-plist :html-extension))
- (link-validate (plist-get opt-plist :link-validation-function))
- valid thetoc have-headings first-heading-pos
- (odd org-odd-levels-only)
- (region-p (org-region-active-p))
- (rbeg (and region-p (region-beginning)))
- (rend (and region-p (region-end)))
- (subtree-p
- (if (plist-get opt-plist :ignore-subtree-p)
- nil
- (when region-p
- (save-excursion
- (goto-char rbeg)
- (and (org-at-heading-p)
- (>= (org-end-of-subtree t t) rend))))))
- (level-offset (if subtree-p
- (save-excursion
- (goto-char rbeg)
- (+ (funcall outline-level)
- (if org-odd-levels-only 1 0)))
- 0))
- (opt-plist (setq org-export-opt-plist
- (if subtree-p
- (org-export-add-subtree-options opt-plist rbeg)
- opt-plist)))
- ;; The following two are dynamically scoped into other
- ;; routines below.
- (org-current-export-dir
- (or pub-dir (org-export-directory :html opt-plist)))
- (org-current-export-file buffer-file-name)
- (level 0) (line "") (origline "") txt todo
- (umax nil)
- (umax-toc nil)
- (filename (if to-buffer nil
- (expand-file-name
- (concat
- (file-name-sans-extension
- (or (and subtree-p
- (org-entry-get (region-beginning)
- "EXPORT_FILE_NAME" t))
- (file-name-nondirectory buffer-file-name)))
- "." html-extension)
- (file-name-as-directory
- (or pub-dir (org-export-directory :html opt-plist))))))
- (current-dir (if buffer-file-name
- (file-name-directory buffer-file-name)
- default-directory))
- (buffer (if to-buffer
- (cond
- ((eq to-buffer 'string) (get-buffer-create "*Org HTML Export*"))
- (t (get-buffer-create to-buffer)))
- (find-file-noselect filename)))
- (org-levels-open (make-vector org-level-max nil))
- (date (plist-get opt-plist :date))
- (author (plist-get opt-plist :author))
- (title (or (and subtree-p (org-export-get-title-from-subtree))
- (plist-get opt-plist :title)
- (and (not body-only)
- (not
- (plist-get opt-plist :skip-before-1st-heading))
- (org-export-grab-title-from-buffer))
- (and buffer-file-name
- (file-name-sans-extension
- (file-name-nondirectory buffer-file-name)))
- "UNTITLED"))
- (link-up (and (plist-get opt-plist :link-up)
- (string-match "\\S-" (plist-get opt-plist :link-up))
- (plist-get opt-plist :link-up)))
- (link-home (and (plist-get opt-plist :link-home)
- (string-match "\\S-" (plist-get opt-plist :link-home))
- (plist-get opt-plist :link-home)))
- (dummy (setq opt-plist (plist-put opt-plist :title title)))
- (html-table-tag (plist-get opt-plist :html-table-tag))
- (quote-re0 (concat "^[ \t]*" org-quote-string "\\>"))
- (quote-re (concat "^\\(\\*+\\)\\([ \t]+" org-quote-string "\\>\\)"))
- (inquote nil)
- (infixed nil)
- (inverse nil)
- (in-local-list nil)
- (local-list-type nil)
- (local-list-indent nil)
- (llt org-plain-list-ordered-item-terminator)
- (email (plist-get opt-plist :email))
- (language (plist-get opt-plist :language))
- (keywords (plist-get opt-plist :keywords))
- (description (plist-get opt-plist :description))
- (lang-words nil)
- (head-count 0) cnt
- (start 0)
- (coding-system (and (boundp 'buffer-file-coding-system)
- buffer-file-coding-system))
- (coding-system-for-write (or org-export-html-coding-system
- coding-system))
- (save-buffer-coding-system (or org-export-html-coding-system
- coding-system))
- (charset (and coding-system-for-write
- (fboundp 'coding-system-get)
- (coding-system-get coding-system-for-write
- 'mime-charset)))
- (region
- (buffer-substring
- (if region-p (region-beginning) (point-min))
- (if region-p (region-end) (point-max))))
- (org-export-have-math nil)
- (lines
- (org-split-string
- (org-export-preprocess-string
- region
- :emph-multiline t
- :for-html t
- :skip-before-1st-heading
- (plist-get opt-plist :skip-before-1st-heading)
- :drawers (plist-get opt-plist :drawers)
- :todo-keywords (plist-get opt-plist :todo-keywords)
- :tags (plist-get opt-plist :tags)
- :priority (plist-get opt-plist :priority)
- :footnotes (plist-get opt-plist :footnotes)
- :timestamps (plist-get opt-plist :timestamps)
- :archived-trees
- (plist-get opt-plist :archived-trees)
- :select-tags (plist-get opt-plist :select-tags)
- :exclude-tags (plist-get opt-plist :exclude-tags)
- :add-text
- (plist-get opt-plist :text)
- :LaTeX-fragments
- (plist-get opt-plist :LaTeX-fragments))
- "[\r\n]"))
- (mathjax
- (if (or (eq (plist-get opt-plist :LaTeX-fragments) 'mathjax)
- (and org-export-have-math
- (eq (plist-get opt-plist :LaTeX-fragments) t)))
-
- (org-export-html-mathjax-config
- org-export-html-mathjax-template
- org-export-html-mathjax-options
- (or (plist-get opt-plist :mathjax) ""))
- ""))
- table-open type
- table-buffer table-orig-buffer
- ind item-type starter
- rpl path attr desc descp desc1 desc2 link
- snumber fnc item-tag item-number
- footnotes footref-seen
- id-file href
- )
-
- (let ((inhibit-read-only t))
- (org-unmodified
- (remove-text-properties (point-min) (point-max)
- '(:org-license-to-kill t))))
-
- (message "Exporting...")
-
- (setq org-min-level (org-get-min-level lines level-offset))
- (setq org-last-level org-min-level)
- (org-init-section-numbers)
-
- (cond
- ((and date (string-match "%" date))
- (setq date (format-time-string date)))
- (date)
- (t (setq date (format-time-string "%Y-%m-%d %T %Z"))))
-
- ;; Get the language-dependent settings
- (setq lang-words (or (assoc language org-export-language-setup)
- (assoc "en" org-export-language-setup)))
-
- ;; Switch to the output buffer
- (set-buffer buffer)
- (let ((inhibit-read-only t)) (erase-buffer))
- (fundamental-mode)
- (org-install-letbind)
-
- (and (fboundp 'set-buffer-file-coding-system)
- (set-buffer-file-coding-system coding-system-for-write))
-
- (let ((case-fold-search nil)
- (org-odd-levels-only odd))
- ;; create local variables for all options, to make sure all called
- ;; functions get the correct information
- (mapc (lambda (x)
- (set (make-local-variable (nth 2 x))
- (plist-get opt-plist (car x))))
- org-export-plist-vars)
- (setq umax (if arg (prefix-numeric-value arg)
- org-export-headline-levels))
- (setq umax-toc (if (integerp org-export-with-toc)
- (min org-export-with-toc umax)
- umax))
- (unless body-only
- ;; File header
- (insert (format
- "%s
-<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
- \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
-<html xmlns=\"http://www.w3.org/1999/xhtml\"
-lang=\"%s\" xml:lang=\"%s\">
-<head>
-<title>%s</title>
-<meta http-equiv=\"Content-Type\" content=\"text/html;charset=%s\"/>
-<meta name=\"generator\" content=\"Org-mode\"/>
-<meta name=\"generated\" content=\"%s\"/>
-<meta name=\"author\" content=\"%s\"/>
-<meta name=\"description\" content=\"%s\"/>
-<meta name=\"keywords\" content=\"%s\"/>
-%s
-%s
-</head>
-<body>
-<div id=\"content\">
-%s
-"
- (format
- (or (and (stringp org-export-html-xml-declaration)
- org-export-html-xml-declaration)
- (cdr (assoc html-extension org-export-html-xml-declaration))
- (cdr (assoc "html" org-export-html-xml-declaration))
-
- "")
- (or charset "iso-8859-1"))
- language language
- title
- (or charset "iso-8859-1")
- date author description keywords
- style
- mathjax
- (if (or link-up link-home)
- (concat
- (format org-export-html-home/up-format
- (or link-up link-home)
- (or link-home link-up))
- "\n")
- "")))
-
- (org-export-html-insert-plist-item opt-plist :preamble opt-plist)
-
- (when (plist-get opt-plist :auto-preamble)
- (if title (insert (format org-export-html-title-format
- (org-html-expand title))))))
-
- (if (and org-export-with-toc (not body-only))
- (progn
- (push (format "<h%d>%s</h%d>\n"
- org-export-html-toplevel-hlevel
- (nth 3 lang-words)
- org-export-html-toplevel-hlevel)
- thetoc)
- (push "<div id=\"text-table-of-contents\">\n" thetoc)
- (push "<ul>\n<li>" thetoc)
- (setq lines
- (mapcar '(lambda (line)
- (if (and (string-match org-todo-line-regexp line)
- (not (get-text-property 0 'org-protected line)))
- ;; This is a headline
- (progn
- (setq have-headings t)
- (setq level (- (match-end 1) (match-beginning 1)
- level-offset)
- level (org-tr-level level)
- txt (save-match-data
- (org-html-expand
- (org-export-cleanup-toc-line
- (match-string 3 line))))
- todo
- (or (and org-export-mark-todo-in-toc
- (match-beginning 2)
- (not (member (match-string 2 line)
- org-done-keywords)))
- ; TODO, not DONE
- (and org-export-mark-todo-in-toc
- (= level umax-toc)
- (org-search-todo-below
- line lines level))))
- (if (string-match
- (org-re "[ \t]+:\\([[:alnum:]_@:]+\\):[ \t]*$") txt)
- (setq txt (replace-match "&nbsp;&nbsp;&nbsp;<span class=\"tag\"> \\1</span>" t nil txt)))
- (if (string-match quote-re0 txt)
- (setq txt (replace-match "" t t txt)))
- (setq snumber (org-section-number level))
- (if org-export-with-section-numbers
- (setq txt (concat snumber " " txt)))
- (if (<= level (max umax umax-toc))
- (setq head-count (+ head-count 1)))
- (if (<= level umax-toc)
- (progn
- (if (> level org-last-level)
- (progn
- (setq cnt (- level org-last-level))
- (while (>= (setq cnt (1- cnt)) 0)
- (push "\n<ul>\n<li>" thetoc))
- (push "\n" thetoc)))
- (if (< level org-last-level)
- (progn
- (setq cnt (- org-last-level level))
- (while (>= (setq cnt (1- cnt)) 0)
- (push "</li>\n</ul>" thetoc))
- (push "\n" thetoc)))
- ;; Check for targets
- (while (string-match org-any-target-regexp line)
- (setq line (replace-match
- (concat "@<span class=\"target\">" (match-string 1 line) "@</span> ")
- t t line)))
- (while (string-match "&lt;\\(&lt;\\)+\\|&gt;\\(&gt;\\)+" txt)
- (setq txt (replace-match "" t t txt)))
- (setq href
- (replace-regexp-in-string
- "\\." "_" (format "sec-%s" snumber)))
- (setq href (or (cdr (assoc href org-export-preferred-target-alist)) href))
- (push
- (format
- (if todo
- "</li>\n<li><a href=\"#%s\"><span class=\"todo\">%s</span></a>"
- "</li>\n<li><a href=\"#%s\">%s</a>")
- href txt) thetoc)
-
- (setq org-last-level level))
- )))
- line)
- lines))
- (while (> org-last-level (1- org-min-level))
- (setq org-last-level (1- org-last-level))
- (push "</li>\n</ul>\n" thetoc))
- (push "</div>\n" thetoc)
- (setq thetoc (if have-headings (nreverse thetoc) nil))))
-
- (setq head-count 0)
- (org-init-section-numbers)
-
- (org-open-par)
-
- (while (setq line (pop lines) origline line)
- (catch 'nextline
-
- ;; end of quote section?
- (when (and inquote (string-match "^\\*+ " line))
- (insert "</pre>\n")
- (org-open-par)
- (setq inquote nil))
- ;; inside a quote section?
- (when inquote
- (insert (org-html-protect line) "\n")
- (throw 'nextline nil))
-
- ;; Fixed-width, verbatim lines (examples)
- (when (and org-export-with-fixed-width
- (string-match "^[ \t]*:\\(\\([ \t]\\|$\\)\\(.*\\)\\)" line))
- (when (not infixed)
- (setq infixed t)
- (org-close-par-maybe)
-
- (insert "<pre class=\"example\">\n"))
- (insert (org-html-protect (match-string 3 line)) "\n")
- (when (or (not lines)
- (not (string-match "^[ \t]*:\\(\\([ \t]\\|$\\)\\(.*\\)\\)"
- (car lines))))
- (setq infixed nil)
- (insert "</pre>\n")
- (org-open-par))
- (throw 'nextline nil))
-
- ;; Explicit list closure
- (when (equal "ORG-LIST-END" line)
- (while local-list-indent
- (org-close-li (car local-list-type))
- (insert (format "</%sl>\n" (car local-list-type)))
- (pop local-list-type)
- (pop local-list-indent))
- (setq in-local-list nil)
- (org-open-par)
- (throw 'nextline nil))
-
- ;; Protected HTML
- (when (and (get-text-property 0 'org-protected line)
- ;; Make sure it is the entire line that is protected
- (not (< (or (next-single-property-change
- 0 'org-protected line) 10000)
- (length line))))
- (let (par (ind (get-text-property 0 'original-indentation line)))
- (when (re-search-backward
- "\\(<p>\\)\\([ \t\r\n]*\\)\\=" (- (point) 100) t)
- (setq par (match-string 1))
- (replace-match "\\2\n"))
- (insert line "\n")
- (while (and lines
- (or (= (length (car lines)) 0)
- (not ind)
- (equal ind (get-text-property 0 'original-indentation (car lines))))
- (or (= (length (car lines)) 0)
- (get-text-property 0 'org-protected (car lines))))
- (insert (pop lines) "\n"))
- (and par (insert "<p>\n")))
- (throw 'nextline nil))
-
- ;; Blockquotes, verse, and center
- (when (equal "ORG-BLOCKQUOTE-START" line)
- (org-close-par-maybe)
- (insert "<blockquote>\n")
- (org-open-par)
- (throw 'nextline nil))
- (when (equal "ORG-BLOCKQUOTE-END" line)
- (org-close-par-maybe)
- (insert "\n</blockquote>\n")
- (org-open-par)
- (throw 'nextline nil))
- (when (equal "ORG-VERSE-START" line)
- (org-close-par-maybe)
- (insert "\n<p class=\"verse\">\n")
- (setq org-par-open t)
- (setq inverse t)
- (throw 'nextline nil))
- (when (equal "ORG-VERSE-END" line)
- (insert "</p>\n")
- (setq org-par-open nil)
- (org-open-par)
- (setq inverse nil)
- (throw 'nextline nil))
- (when (equal "ORG-CENTER-START" line)
- (org-close-par-maybe)
- (insert "\n<div style=\"text-align: center\">")
- (org-open-par)
- (throw 'nextline nil))
- (when (equal "ORG-CENTER-END" line)
- (org-close-par-maybe)
- (insert "\n</div>")
- (org-open-par)
- (throw 'nextline nil))
- (run-hooks 'org-export-html-after-blockquotes-hook)
- (when inverse
- (let ((i (org-get-string-indentation line)))
- (if (> i 0)
- (setq line (concat (mapconcat 'identity
- (make-list (* 2 i) "\\nbsp") "")
- " " (org-trim line))))
- (unless (string-match "\\\\\\\\[ \t]*$" line)
- (setq line (concat line "\\\\")))))
-
- ;; make targets to anchors
- (setq start 0)
- (while (string-match
- "<<<?\\([^<>]*\\)>>>?\\((INVISIBLE)\\)?[ \t]*\n?" line start)
- (cond
- ((get-text-property (match-beginning 1) 'org-protected line)
- (setq start (match-end 1)))
- ((match-end 2)
- (setq line (replace-match
- (format
- "@<a name=\"%s\" id=\"%s\">@</a>"
- (org-solidify-link-text (match-string 1 line))
- (org-solidify-link-text (match-string 1 line)))
- t t line)))
- ((and org-export-with-toc (equal (string-to-char line) ?*))
- ;; FIXME: NOT DEPENDENT on TOC?????????????????????
- (setq line (replace-match
- (concat "@<span class=\"target\">"
- (match-string 1 line) "@</span> ")
- ;; (concat "@<i>" (match-string 1 line) "@</i> ")
- t t line)))
- (t
- (setq line (replace-match
- (concat "@<a name=\""
- (org-solidify-link-text (match-string 1 line))
- "\" class=\"target\">" (match-string 1 line)
- "@</a> ")
- t t line)))))
-
- (setq line (org-html-handle-time-stamps line))
-
- ;; replace "&" by "&amp;", "<" and ">" by "&lt;" and "&gt;"
- ;; handle @<..> HTML tags (replace "@&gt;..&lt;" by "<..>")
- ;; Also handle sub_superscripts and checkboxes
- (or (string-match org-table-hline-regexp line)
- (setq line (org-html-expand line)))
-
- ;; Format the links
- (setq start 0)
- (while (string-match org-bracket-link-analytic-regexp++ line start)
- (setq start (match-beginning 0))
- (setq path (save-match-data (org-link-unescape
- (match-string 3 line))))
- (setq type (cond
- ((match-end 2) (match-string 2 line))
- ((save-match-data
- (or (file-name-absolute-p path)
- (string-match "^\\.\\.?/" path)))
- "file")
- (t "internal")))
- (setq path (org-extract-attributes (org-link-unescape path)))
- (setq attr (get-text-property 0 'org-attributes path))
- (setq desc1 (if (match-end 5) (match-string 5 line))
- desc2 (if (match-end 2) (concat type ":" path) path)
- descp (and desc1 (not (equal desc1 desc2)))
- desc (or desc1 desc2))
- ;; Make an image out of the description if that is so wanted
- (when (and descp (org-file-image-p
- desc org-export-html-inline-image-extensions))
- (save-match-data
- (if (string-match "^file:" desc)
- (setq desc (substring desc (match-end 0)))))
- (setq desc (org-add-props
- (concat "<img src=\"" desc "\"/>")
- '(org-protected t))))
- (cond
- ((equal type "internal")
- (let
- ((frag-0
- (if (= (string-to-char path) ?#)
- (substring path 1)
- path)))
- (setq rpl
- (org-html-make-link
- opt-plist
- ""
- ""
- (org-solidify-link-text
- (save-match-data (org-link-unescape frag-0))
- nil)
- desc attr nil))))
- ((and (equal type "id")
- (setq id-file (org-id-find-id-file path)))
- ;; This is an id: link to another file (if it was the same file,
- ;; it would have become an internal link...)
- (save-match-data
- (setq id-file (file-relative-name
- id-file
- (file-name-directory org-current-export-file)))
- (setq rpl
- (org-html-make-link opt-plist
- "file" id-file
- (concat (if (org-uuidgen-p path) "ID-") path)
- desc
- attr
- nil))))
- ((member type '("http" "https"))
- ;; standard URL, can inline as image
- (setq rpl
- (org-html-make-link opt-plist
- type path nil
- desc
- attr
- (org-html-should-inline-p path descp))))
- ((member type '("ftp" "mailto" "news"))
- ;; standard URL, can't inline as image
- (setq rpl
- (org-html-make-link opt-plist
- type path nil
- desc
- attr
- nil)))
-
- ((string= type "coderef")
- (let*
- ((coderef-str (format "coderef-%s" path))
- (attr-1
- (format "class=\"coderef\" onmouseover=\"CodeHighlightOn(this, '%s');\" onmouseout=\"CodeHighlightOff(this, '%s');\""
- coderef-str coderef-str)))
- (setq rpl
- (org-html-make-link opt-plist
- type "" coderef-str
- (format
- (org-export-get-coderef-format
- path
- (and descp desc))
- (cdr (assoc path org-export-code-refs)))
- attr-1
- nil))))
-
- ((functionp (setq fnc (nth 2 (assoc type org-link-protocols))))
- ;; The link protocol has a function for format the link
- (setq rpl
- (save-match-data
- (funcall fnc (org-link-unescape path) desc1 'html))))
-
- ((string= type "file")
- ;; FILE link
- (save-match-data
- (let*
- ((components
- (if
- (string-match "::\\(.*\\)" path)
- (list
- (replace-match "" t nil path)
- (match-string 1 path))
- (list path nil)))
-
- ;;The proper path, without a fragment
- (path-1
- (first components))
-
- ;;The raw fragment
- (fragment-0
- (second components))
-
- ;;Check the fragment. If it can't be used as
- ;;target fragment we'll pass nil instead.
- (fragment-1
- (if
- (and fragment-0
- (not (string-match "^[0-9]*$" fragment-0))
- (not (string-match "^\\*" fragment-0))
- (not (string-match "^/.*/$" fragment-0)))
- (org-solidify-link-text
- (org-link-unescape fragment-0))
- nil))
- (desc-2
- ;;Description minus "file:" and ".org"
- (if (string-match "^file:" desc)
- (let
- ((desc-1 (replace-match "" t t desc)))
- (if (string-match "\\.org$" desc-1)
- (replace-match "" t t desc-1)
- desc-1))
- desc)))
-
- (setq rpl
- (if
- (and
- (functionp link-validate)
- (not (funcall link-validate path-1 current-dir)))
- desc
- (org-html-make-link opt-plist
- "file" path-1 fragment-1 desc-2 attr
- (org-html-should-inline-p path-1 descp)))))))
-
- (t
- ;; just publish the path, as default
- (setq rpl (concat "<i>&lt;" type ":"
- (save-match-data (org-link-unescape path))
- "&gt;</i>"))))
- (setq line (replace-match rpl t t line)
- start (+ start (length rpl))))
-
- ;; TODO items
- (if (and (string-match org-todo-line-regexp line)
- (match-beginning 2))
-
- (setq line
- (concat (substring line 0 (match-beginning 2))
- "<span class=\""
- (if (member (match-string 2 line)
- org-done-keywords)
- "done" "todo")
- " " (match-string 2 line)
- "\"> " (org-export-html-get-todo-kwd-class-name
- (match-string 2 line))
- "</span>" (substring line (match-end 2)))))
-
- ;; Does this contain a reference to a footnote?
- (when org-export-with-footnotes
- (setq start 0)
- (while (string-match "\\([^* \t].*?\\)\\[\\([0-9]+\\)\\]" line start)
- (if (get-text-property (match-beginning 2) 'org-protected line)
- (setq start (match-end 2))
- (let ((n (match-string 2 line)) extra a)
- (if (setq a (assoc n footref-seen))
- (progn
- (setcdr a (1+ (cdr a)))
- (setq extra (format ".%d" (cdr a))))
- (setq extra "")
- (push (cons n 1) footref-seen))
- (setq line
- (replace-match
- (format
- (concat "%s"
- (format org-export-html-footnote-format
- "<a class=\"footref\" name=\"fnr.%s%s\" href=\"#fn.%s\">%s</a>"))
- (or (match-string 1 line) "") n extra n n)
- t t line))))))
-
- (cond
- ((string-match "^\\(\\*+\\)[ \t]+\\(.*\\)" line)
- ;; This is a headline
- (setq level (org-tr-level (- (match-end 1) (match-beginning 1)
- level-offset))
- txt (match-string 2 line))
- (if (string-match quote-re0 txt)
- (setq txt (replace-match "" t t txt)))
- (if (<= level (max umax umax-toc))
- (setq head-count (+ head-count 1)))
- (setq first-heading-pos (or first-heading-pos (point)))
- (org-html-level-start level txt umax
- (and org-export-with-toc (<= level umax))
- head-count)
-
- ;; QUOTES
- (when (string-match quote-re line)
- (org-close-par-maybe)
- (insert "<pre>")
- (setq inquote t)))
-
- ((and org-export-with-tables
- (string-match "^\\([ \t]*\\)\\(|\\|\\+-+\\+\\)" line))
- (when (not table-open)
- ;; New table starts
- (setq table-open t table-buffer nil table-orig-buffer nil))
-
- ;; Accumulate lines
- (setq table-buffer (cons line table-buffer)
- table-orig-buffer (cons origline table-orig-buffer))
- (when (or (not lines)
- (not (string-match "^\\([ \t]*\\)\\(|\\|\\+-+\\+\\)"
- (car lines))))
- (setq table-open nil
- table-buffer (nreverse table-buffer)
- table-orig-buffer (nreverse table-orig-buffer))
- (org-close-par-maybe)
- (insert (org-format-table-html table-buffer table-orig-buffer))))
- (t
- ;; Normal lines
- (when (string-match
- (cond
- ((eq llt t) "^\\([ \t]*\\)\\(\\([-+*] \\)\\|\\([0-9]+[.)]\\) \\)?\\( *[^ \t\n\r]\\|[ \t]*$\\)")
- ((= llt ?.) "^\\([ \t]*\\)\\(\\([-+*] \\)\\|\\([0-9]+\\.\\) \\)?\\( *[^ \t\n\r]\\|[ \t]*$\\)")
- ((= llt ?\)) "^\\([ \t]*\\)\\(\\([-+*] \\)\\|\\([0-9]+)\\) \\)?\\( *[^ \t\n\r]\\|[ \t]*$\\)")
- (t (error "Invalid value of `org-plain-list-ordered-item-terminator'")))
- line)
- (setq ind (or (get-text-property 0 'original-indentation line)
- (org-get-string-indentation line))
- item-type (if (match-beginning 4) "o" "u")
- starter (if (match-beginning 2)
- (substring (match-string 2 line) 0 -1))
- line (substring line (match-beginning 5))
- item-number nil
- item-tag nil)
- (if (string-match "\\[@\\(?:start:\\)?\\([0-9]+\\)\\][ \t]?" line)
- (setq item-number (match-string 1 line)
- line (replace-match "" t t line)))
- (if (and starter (string-match "\\(.*?\\) ::[ \t]*" line))
- (setq item-type "d"
- item-tag (match-string 1 line)
- line (substring line (match-end 0))))
- (cond
- ((and starter
- (or (not in-local-list)
- (> ind (car local-list-indent))))
- ;; Start new (level of) list
- (org-close-par-maybe)
- (insert (cond
- ((equal item-type "u") "<ul>\n<li>\n")
- ((and (equal item-type "o") item-number)
- (format "<ol>\n<li value=\"%s\">\n" item-number))
- ((equal item-type "o") "<ol>\n<li>\n")
- ((equal item-type "d")
- (format "<dl>\n<dt>%s</dt><dd>\n" item-tag))))
- (push item-type local-list-type)
- (push ind local-list-indent)
- (setq in-local-list t))
- ;; Continue list
- (starter
- ;; terminate any previous sublist but first ensure
- ;; list is not ill-formed.
- (let ((min-ind (apply 'min local-list-indent)))
- (when (< ind min-ind) (setq ind min-ind)))
- (while (< ind (car local-list-indent))
- (org-close-li (car local-list-type))
- (insert (format "</%sl>\n" (car local-list-type)))
- (pop local-list-type) (pop local-list-indent)
- (setq in-local-list local-list-indent))
- ;; insert new item
- (org-close-li (car local-list-type))
- (insert (cond
- ((equal (car local-list-type) "d")
- (format "<dt>%s</dt><dd>\n" (or item-tag "???")))
- ((and (equal item-type "o") item-number)
- (format "<li value=\"%s\">\n" item-number))
- (t "<li>\n")))))
- (if (string-match "^[ \t]*\\[\\([X ]\\)\\]" line)
- (setq line
- (replace-match
- (if (equal (match-string 1 line) "X")
- "<b>[X]</b>"
- "<b>[<span style=\"visibility:hidden;\">X</span>]</b>")
- t t line))))
-
- ;; Horizontal line
- (when (string-match "^[ \t]*-\\{5,\\}[ \t]*$" line)
- (if org-par-open
- (insert "\n</p>\n<hr/>\n<p>\n")
- (insert "\n<hr/>\n"))
- (throw 'nextline nil))
-
- ;; Empty lines start a new paragraph. If hand-formatted lists
- ;; are not fully interpreted, lines starting with "-", "+", "*"
- ;; also start a new paragraph.
- (if (string-match "^ [-+*]-\\|^[ \t]*$" line) (org-open-par))
-
- ;; Is this the start of a footnote?
- (when org-export-with-footnotes
- (when (and (boundp 'footnote-section-tag-regexp)
- (string-match (concat "^" footnote-section-tag-regexp)
- line))
- ;; ignore this line
- (throw 'nextline nil))
- (when (string-match "^[ \t]*\\[\\([0-9]+\\)\\]" line)
- (org-close-par-maybe)
- (let ((n (match-string 1 line)))
- (setq org-par-open t
- line (replace-match
- (format
- (concat "<p class=\"footnote\">"
- (format org-export-html-footnote-format
- "<a class=\"footnum\" name=\"fn.%s\" href=\"#fnr.%s\">%s</a>"))
- n n n) t t line)))))
- ;; Check if the line break needs to be conserved
- (cond
- ((string-match "\\\\\\\\[ \t]*$" line)
- (setq line (replace-match "<br/>" t t line)))
- (org-export-preserve-breaks
- (setq line (concat line "<br/>"))))
-
- ;; Check if a paragraph should be started
- (let ((start 0))
- (while (and org-par-open
- (string-match "\\\\par\\>" line start))
- ;; Leave a space in the </p> so that the footnote matcher
- ;; does not see this.
- (if (not (get-text-property (match-beginning 0)
- 'org-protected line))
- (setq line (replace-match "</p ><p >" t t line)))
- (setq start (match-end 0))))
-
- (insert line "\n")))))
-
- ;; Properly close all local lists and other lists
- (when inquote
- (insert "</pre>\n")
- (org-open-par))
-
- (org-html-level-start 1 nil umax
- (and org-export-with-toc (<= level umax))
- head-count)
- ;; the </div> to close the last text-... div.
- (when (and (> umax 0) first-heading-pos) (insert "</div>\n"))
-
- (save-excursion
- (goto-char (point-min))
- (while (re-search-forward "<p class=\"footnote\">[^\000]*?\\(</p>\\|\\'\\)" nil t)
- (push (match-string 0) footnotes)
- (replace-match "" t t)))
- (when footnotes
- (insert (format org-export-html-footnotes-section
- (nth 4 lang-words)
- (mapconcat 'identity (nreverse footnotes) "\n"))
- "\n"))
- (let ((bib (org-export-html-get-bibliography)))
- (when bib
- (insert "\n" bib "\n")))
- (unless body-only
- (when (plist-get opt-plist :auto-postamble)
- (insert "<div id=\"postamble\">\n")
- (when (and org-export-author-info author)
- (insert "<p class=\"author\"> "
- (nth 1 lang-words) ": " author "\n")
- (when (and org-export-email-info email (string-match "\\S-" email))
- (if (listp (split-string email ",+ *"))
- (mapc (lambda(e)
- (insert "<a href=\"mailto:" e "\">&lt;"
- e "&gt;</a>\n"))
- (split-string email ",+ *"))
- (insert "<a href=\"mailto:" email "\">&lt;"
- email "&gt;</a>\n")))
- (insert "</p>\n"))
- (when (and date org-export-time-stamp-file)
- (insert "<p class=\"date\"> "
- (nth 2 lang-words) ": "
- date "</p>\n"))
- (when org-export-creator-info
- (insert (format "<p class=\"creator\">HTML generated by org-mode %s in emacs %s</p>\n"
- org-version emacs-major-version)))
- (when org-export-html-validation-link
- (insert org-export-html-validation-link "\n"))
- (insert "</div>"))
-
- (if org-export-html-with-timestamp
- (insert org-export-html-html-helper-timestamp))
- (org-export-html-insert-plist-item opt-plist :postamble opt-plist)
- (insert "\n</div>\n</body>\n</html>\n"))
-
- (unless (plist-get opt-plist :buffer-will-be-killed)
- (normal-mode)
- (if (eq major-mode (default-value 'major-mode))
- (html-mode)))
-
- ;; insert the table of contents
- (goto-char (point-min))
- (when thetoc
- (if (or (re-search-forward
- "<p>\\s-*\\[TABLE-OF-CONTENTS\\]\\s-*</p>" nil t)
- (re-search-forward
- "\\[TABLE-OF-CONTENTS\\]" nil t))
- (progn
- (goto-char (match-beginning 0))
- (replace-match ""))
- (goto-char first-heading-pos)
- (when (looking-at "\\s-*</p>")
- (goto-char (match-end 0))
- (insert "\n")))
- (insert "<div id=\"table-of-contents\">\n")
- (mapc 'insert thetoc)
- (insert "</div>\n"))
- ;; remove empty paragraphs and lists
- (goto-char (point-min))
- (while (re-search-forward "<p>[ \r\n\t]*</p>" nil t)
- (replace-match ""))
- (goto-char (point-min))
- (while (re-search-forward "<li>[ \r\n\t]*</li>\n?" nil t)
- (replace-match ""))
- (goto-char (point-min))
- ;; Convert whitespace place holders
- (goto-char (point-min))
- (let (beg end n)
- (while (setq beg (next-single-property-change (point) 'org-whitespace))
- (setq n (get-text-property beg 'org-whitespace)
- end (next-single-property-change beg 'org-whitespace))
- (goto-char beg)
- (delete-region beg end)
- (insert (format "<span style=\"visibility:hidden;\">%s</span>"
- (make-string n ?x)))))
- ;; Remove empty lines at the beginning of the file.
- (goto-char (point-min))
- (when (looking-at "\\s-+\n") (replace-match ""))
- ;; Remove display properties
- (remove-text-properties (point-min) (point-max) '(display t))
- ;; Run the hook
- (run-hooks 'org-export-html-final-hook)
- (or to-buffer (save-buffer))
- (goto-char (point-min))
- (or (org-export-push-to-kill-ring "HTML")
- (message "Exporting... done"))
- (if (eq to-buffer 'string)
- (prog1 (buffer-substring (point-min) (point-max))
- (kill-buffer (current-buffer)))
- (current-buffer)))))
-
-(defun org-export-html-insert-plist-item (plist key &rest args)
- (let ((item (plist-get plist key)))
- (cond ((functionp item)
- (apply item args))
- (item
- (insert item)))))
-
-(defun org-export-html-format-href (s)
- "Make sure the S is valid as a href reference in an XHTML document."
- (save-match-data
- (let ((start 0))
- (while (string-match "&" s start)
- (setq start (+ (match-beginning 0) 3)
- s (replace-match "&amp;" t t s)))))
- s)
-
-(defun org-export-html-format-desc (s)
- "Make sure the S is valid as a description in a link."
- (if (and s (not (get-text-property 1 'org-protected s)))
- (save-match-data
- (org-html-do-expand s))
- s))
-
-(defun org-export-html-format-image (src par-open)
- "Create image tag with source and attributes."
- (save-match-data
- (if (string-match "^ltxpng/" src)
- (format "<img src=\"%s\" alt=\"%s\"/>"
- src (org-find-text-property-in-string 'org-latex-src src))
- (let* ((caption (org-find-text-property-in-string 'org-caption src))
- (attr (org-find-text-property-in-string 'org-attributes src))
- (label (org-find-text-property-in-string 'org-label src)))
- (setq caption (and caption (org-html-do-expand caption)))
- (concat
- (if caption
- (format "%s<div %sclass=\"figure\">
-<p>"
- (if org-par-open "</p>\n" "")
- (if label (format "id=\"%s\" " label) "")))
- (format "<img src=\"%s\"%s />"
- src
- (if (string-match "\\<alt=" (or attr ""))
- (concat " " attr )
- (concat " " attr " alt=\"" src "\"")))
- (if caption
- (format "</p>%s
-</div>%s"
- (concat "\n<p>" caption "</p>")
- (if org-par-open "\n<p>" ""))))))))
-
-(defun org-export-html-get-bibliography ()
- "Find bibliography, cut it out and return it."
- (catch 'exit
- (let (beg end (cnt 1) bib)
- (save-excursion
- (goto-char (point-min))
- (when (re-search-forward "^[ \t]*<div \\(id\\|class\\)=\"bibliography\"" nil t)
- (setq beg (match-beginning 0))
- (while (re-search-forward "</?div\\>" nil t)
- (setq cnt (+ cnt (if (string= (match-string 0) "<div") +1 -1)))
- (when (= cnt 0)
- (and (looking-at ">") (forward-char 1))
- (setq bib (buffer-substring beg (point)))
- (delete-region beg (point))
- (throw 'exit bib))))
- nil))))
-
-(defvar org-table-number-regexp) ; defined in org-table.el
-(defun org-format-table-html (lines olines &optional no-css)
- "Find out which HTML converter to use and return the HTML code.
-NO-CSS is passed to the exporter."
- (if (stringp lines)
- (setq lines (org-split-string lines "\n")))
- (if (string-match "^[ \t]*|" (car lines))
- ;; A normal org table
- (org-format-org-table-html lines nil no-css)
- ;; Table made by table.el - test for spanning
- (let* ((hlines (delq nil (mapcar
- (lambda (x)
- (if (string-match "^[ \t]*\\+-" x) x
- nil))
- lines)))
- (first (car hlines))
- (ll (and (string-match "\\S-+" first)
- (match-string 0 first)))
- (re (concat "^[ \t]*" (regexp-quote ll)))
- (spanning (delq nil (mapcar (lambda (x) (not (string-match re x)))
- hlines))))
- (if (and (not spanning)
- (not org-export-prefer-native-exporter-for-tables))
- ;; We can use my own converter with HTML conversions
- (org-format-table-table-html lines)
- ;; Need to use the code generator in table.el, with the original text.
- (org-format-table-table-html-using-table-generate-source olines)))))
-
-(defvar org-table-number-fraction) ; defined in org-table.el
-(defun org-format-org-table-html (lines &optional splice no-css)
- "Format a table into HTML.
-LINES is a list of lines. Optional argument SPLICE means, do not
-insert header and surrounding <table> tags, just format the lines.
-Optional argument NO-CSS means use XHTML attributes instead of CSS
-for formatting. This is required for the DocBook exporter."
- (require 'org-table)
- ;; Get rid of hlines at beginning and end
- (if (string-match "^[ \t]*|-" (car lines)) (setq lines (cdr lines)))
- (setq lines (nreverse lines))
- (if (string-match "^[ \t]*|-" (car lines)) (setq lines (cdr lines)))
- (setq lines (nreverse lines))
- (when org-export-table-remove-special-lines
- ;; Check if the table has a marking column. If yes remove the
- ;; column and the special lines
- (setq lines (org-table-clean-before-export lines)))
-
- (let* ((caption (org-find-text-property-in-string 'org-caption (car lines)))
- (label (org-find-text-property-in-string 'org-label (car lines)))
- (forced-aligns (org-find-text-property-in-string 'org-forced-aligns
- (car lines)))
- (attributes (org-find-text-property-in-string 'org-attributes
- (car lines)))
- (html-table-tag (org-export-splice-attributes
- html-table-tag attributes))
- (head (and org-export-highlight-first-table-line
- (delq nil (mapcar
- (lambda (x) (string-match "^[ \t]*|-" x))
- (cdr lines)))))
- (nline 0) fnum nfields i (cnt 0)
- tbopen line fields html gr colgropen rowstart rowend
- ali align aligns n)
- (setq caption (and caption (org-html-do-expand caption)))
- (when (and forced-aligns org-table-clean-did-remove-column)
- (setq forced-aligns
- (mapcar (lambda (x) (cons (1- (car x)) (cdr x))) forced-aligns)))
- (if splice (setq head nil))
- (unless splice (push (if head "<thead>" "<tbody>") html))
- (setq tbopen t)
- (while (setq line (pop lines))
- (catch 'next-line
- (if (string-match "^[ \t]*|-" line)
- (progn
- (unless splice
- (push (if head "</thead>" "</tbody>") html)
- (if lines (push "<tbody>" html) (setq tbopen nil)))
- (setq head nil) ;; head ends here, first time around
- ;; ignore this line
- (throw 'next-line t)))
- ;; Break the line into fields
- (setq fields (org-split-string line "[ \t]*|[ \t]*"))
- (unless fnum (setq fnum (make-vector (length fields) 0)
- nfields (length fnum)))
- (setq nline (1+ nline) i -1
- rowstart (eval (car org-export-table-row-tags))
- rowend (eval (cdr org-export-table-row-tags)))
- (push (concat rowstart
- (mapconcat
- (lambda (x)
- (setq i (1+ i) ali (format "@@class%03d@@" i))
- (if (and (< i nfields) ; make sure no rogue line causes an error here
- (string-match org-table-number-regexp x))
- (incf (aref fnum i)))
- (cond
- (head
- (concat
- (format (car org-export-table-header-tags)
- "col" ali)
- x
- (cdr org-export-table-header-tags)))
- ((and (= i 0) org-export-html-table-use-header-tags-for-first-column)
- (concat
- (format (car org-export-table-header-tags)
- "row" ali)
- x
- (cdr org-export-table-header-tags)))
- (t
- (concat (format (car org-export-table-data-tags) ali)
- x
- (cdr org-export-table-data-tags)))))
- fields "")
- rowend)
- html)))
- (unless splice (if tbopen (push "</tbody>" html)))
- (unless splice (push "</table>\n" html))
- (setq html (nreverse html))
- (unless splice
- ;; Put in col tags with the alignment (unfortunately often ignored...)
- (unless (car org-table-colgroup-info)
- (setq org-table-colgroup-info
- (cons :start (cdr org-table-colgroup-info))))
- (setq i 0)
- (push (mapconcat
- (lambda (x)
- (setq gr (pop org-table-colgroup-info)
- i (1+ i)
- align (if (assoc i forced-aligns)
- (cdr (assoc (cdr (assoc i forced-aligns))
- '(("l" . "left") ("r" . "right")
- ("c" . "center"))))
- (if (> (/ (float x) nline)
- org-table-number-fraction)
- "right" "left")))
- (push align aligns)
- (format (if no-css
- "%s<col align=\"%s\" />%s"
- "%s<col class=\"%s\" />%s")
- (if (memq gr '(:start :startend))
- (prog1
- (if colgropen
- "</colgroup>\n<colgroup>"
- "<colgroup>")
- (setq colgropen t))
- "")
- align
- (if (memq gr '(:end :startend))
- (progn (setq colgropen nil) "</colgroup>")
- "")))
- fnum "")
- html)
- (setq aligns (nreverse aligns))
- (if colgropen (setq html (cons (car html)
- (cons "</colgroup>" (cdr html)))))
- ;; Since the output of HTML table formatter can also be used in
- ;; DocBook document, we want to always include the caption to make
- ;; DocBook XML file valid.
- (push (format "<caption>%s</caption>" (or caption "")) html)
- (when label (push (format "<a name=\"%s\" id=\"%s\"></a>" label label)
- html))
- (push html-table-tag html))
- (setq html (mapcar
- (lambda (x)
- (replace-regexp-in-string
- "@@class\\([0-9]+\\)@@"
- (lambda (txt)
- (if (not org-export-html-table-align-individual-fields)
- ""
- (setq n (string-to-number (match-string 1 txt)))
- (format (if no-css " align=\"%s\"" " class=\"%s\"")
- (or (nth n aligns) "left"))))
- x))
- html))
- (concat (mapconcat 'identity html "\n") "\n")))
-
-(defun org-export-splice-attributes (tag attributes)
- "Read attributes in string ATTRIBUTES, add and replace in HTML tag TAG."
- (if (not attributes)
- tag
- (let (oldatt newatt)
- (setq oldatt (org-extract-attributes-from-string tag)
- tag (pop oldatt)
- newatt (cdr (org-extract-attributes-from-string attributes)))
- (while newatt
- (setq oldatt (plist-put oldatt (pop newatt) (pop newatt))))
- (if (string-match ">" tag)
- (setq tag
- (replace-match (concat (org-attributes-to-string oldatt) ">")
- t t tag)))
- tag)))
-
-(defun org-format-table-table-html (lines)
- "Format a table generated by table.el into HTML.
-This conversion does *not* use `table-generate-source' from table.el.
-This has the advantage that Org-mode's HTML conversions can be used.
-But it has the disadvantage, that no cell- or row-spanning is allowed."
- (let (line field-buffer
- (head org-export-highlight-first-table-line)
- fields html empty i)
- (setq html (concat html-table-tag "\n"))
- (while (setq line (pop lines))
- (setq empty "&nbsp;")
- (catch 'next-line
- (if (string-match "^[ \t]*\\+-" line)
- (progn
- (if field-buffer
- (progn
- (setq
- html
- (concat
- html
- "<tr>"
- (mapconcat
- (lambda (x)
- (if (equal x "") (setq x empty))
- (if head
- (concat
- (format (car org-export-table-header-tags) "col" "")
- x
- (cdr org-export-table-header-tags))
- (concat (format (car org-export-table-data-tags) "") x
- (cdr org-export-table-data-tags))))
- field-buffer "\n")
- "</tr>\n"))
- (setq head nil)
- (setq field-buffer nil)))
- ;; Ignore this line
- (throw 'next-line t)))
- ;; Break the line into fields and store the fields
- (setq fields (org-split-string line "[ \t]*|[ \t]*"))
- (if field-buffer
- (setq field-buffer (mapcar
- (lambda (x)
- (concat x "<br/>" (pop fields)))
- field-buffer))
- (setq field-buffer fields))))
- (setq html (concat html "</table>\n"))
- html))
-
-(defun org-format-table-table-html-using-table-generate-source (lines)
- "Format a table into html, using `table-generate-source' from table.el.
-This has the advantage that cell- or row-spanning is allowed.
-But it has the disadvantage, that Org-mode's HTML conversions cannot be used."
- (require 'table)
- (with-current-buffer (get-buffer-create " org-tmp1 ")
- (erase-buffer)
- (insert (mapconcat 'identity lines "\n"))
- (goto-char (point-min))
- (if (not (re-search-forward "|[^+]" nil t))
- (error "Error processing table"))
- (table-recognize-table)
- (with-current-buffer (get-buffer-create " org-tmp2 ") (erase-buffer))
- (table-generate-source 'html " org-tmp2 ")
- (set-buffer " org-tmp2 ")
- (buffer-substring (point-min) (point-max))))
-
-(defun org-export-splice-style (style extra)
- "Splice EXTRA into STYLE, just before \"</style>\"."
- (if (and (stringp extra)
- (string-match "\\S-" extra)
- (string-match "</style>" style))
- (concat (substring style 0 (match-beginning 0))
- "\n" extra "\n"
- (substring style (match-beginning 0)))
- style))
-
-(defun org-html-handle-time-stamps (s)
- "Format time stamps in string S, or remove them."
- (catch 'exit
- (let (r b)
- (while (string-match org-maybe-keyword-time-regexp s)
- (or b (setq b (substring s 0 (match-beginning 0))))
- (setq r (concat
- r (substring s 0 (match-beginning 0))
- " @<span class=\"timestamp-wrapper\">"
- (if (match-end 1)
- (format "@<span class=\"timestamp-kwd\">%s @</span>"
- (match-string 1 s)))
- (format " @<span class=\"timestamp\">%s@</span>"
- (substring
- (org-translate-time (match-string 3 s)) 1 -1))
- "@</span>")
- s (substring s (match-end 0))))
- ;; Line break if line started and ended with time stamp stuff
- (if (not r)
- s
- (setq r (concat r s))
- (unless (string-match "\\S-" (concat b s))
- (setq r (concat r "@<br/>")))
- r))))
-
-(defvar htmlize-buffer-places) ; from htmlize.el
-(defun org-export-htmlize-region-for-paste (beg end)
- "Convert the region to HTML, using htmlize.el.
-This is much like `htmlize-region-for-paste', only that it uses
-the settings define in the org-... variables."
- (let* ((htmlize-output-type org-export-htmlize-output-type)
- (htmlize-css-name-prefix org-export-htmlize-css-font-prefix)
- (htmlbuf (htmlize-region beg end)))
- (unwind-protect
- (with-current-buffer htmlbuf
- (buffer-substring (plist-get htmlize-buffer-places 'content-start)
- (plist-get htmlize-buffer-places 'content-end)))
- (kill-buffer htmlbuf))))
-
-;;;###autoload
-(defun org-export-htmlize-generate-css ()
- "Create the CSS for all font definitions in the current Emacs session.
-Use this to create face definitions in your CSS style file that can then
-be used by code snippets transformed by htmlize.
-This command just produces a buffer that contains class definitions for all
-faces used in the current Emacs session. You can copy and paste the ones you
-need into your CSS file.
-
-If you then set `org-export-htmlize-output-type' to `css', calls to
-the function `org-export-htmlize-region-for-paste' will produce code
-that uses these same face definitions."
- (interactive)
- (require 'htmlize)
- (and (get-buffer "*html*") (kill-buffer "*html*"))
- (with-temp-buffer
- (let ((fl (face-list))
- (htmlize-css-name-prefix "org-")
- (htmlize-output-type 'css)
- f i)
- (while (setq f (pop fl)
- i (and f (face-attribute f :inherit)))
- (when (and (symbolp f) (or (not i) (not (listp i))))
- (insert (org-add-props (copy-sequence "1") nil 'face f))))
- (htmlize-region (point-min) (point-max))))
- (switch-to-buffer "*html*")
- (goto-char (point-min))
- (if (re-search-forward "<style" nil t)
- (delete-region (point-min) (match-beginning 0)))
- (if (re-search-forward "</style>" nil t)
- (delete-region (1+ (match-end 0)) (point-max)))
- (beginning-of-line 1)
- (if (looking-at " +") (replace-match ""))
- (goto-char (point-min)))
-
-(defun org-html-protect (s)
- "convert & to &amp;, < to &lt; and > to &gt;"
- (let ((start 0))
- (while (string-match "&" s start)
- (setq s (replace-match "&amp;" t t s)
- start (1+ (match-beginning 0))))
- (while (string-match "<" s)
- (setq s (replace-match "&lt;" t t s)))
- (while (string-match ">" s)
- (setq s (replace-match "&gt;" t t s)))
-; (while (string-match "\"" s)
-; (setq s (replace-match "&quot;" t t s)))
- )
- s)
-
-(defun org-html-expand (string)
- "Prepare STRING for HTML export. Apply all active conversions.
-If there are links in the string, don't modify these."
- (let* ((re (concat org-bracket-link-regexp "\\|"
- (org-re "[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$")))
- m s l res)
- (if (string-match "^[ \t]*\\+-[-+]*\\+[ \t]*$" string)
- string
- (while (setq m (string-match re string))
- (setq s (substring string 0 m)
- l (match-string 0 string)
- string (substring string (match-end 0)))
- (push (org-html-do-expand s) res)
- (push l res))
- (push (org-html-do-expand string) res)
- (apply 'concat (nreverse res)))))
-
-(defun org-html-do-expand (s)
- "Apply all active conversions to translate special ASCII to HTML."
- (setq s (org-html-protect s))
- (if org-export-html-expand
- (while (string-match "@&lt;\\([^&]*\\)&gt;" s)
- (setq s (replace-match "<\\1>" t nil s))))
- (if org-export-with-emphasize
- (setq s (org-export-html-convert-emphasize s)))
- (if org-export-with-special-strings
- (setq s (org-export-html-convert-special-strings s)))
- (if org-export-with-sub-superscripts
- (setq s (org-export-html-convert-sub-super s)))
- (if org-export-with-TeX-macros
- (let ((start 0) wd rep)
- (while (setq start (string-match "\\\\\\([a-zA-Z]+[0-9]*\\)\\({}\\)?"
- s start))
- (if (get-text-property (match-beginning 0) 'org-protected s)
- (setq start (match-end 0))
- (setq wd (match-string 1 s))
- (if (setq rep (org-entity-get-representation wd 'html))
- (setq s (replace-match rep t t s))
- (setq start (+ start (length wd))))))))
- s)
-
-(defun org-export-html-convert-special-strings (string)
- "Convert special characters in STRING to HTML."
- (let ((all org-export-html-special-string-regexps)
- e a re rpl start)
- (while (setq a (pop all))
- (setq re (car a) rpl (cdr a) start 0)
- (while (string-match re string start)
- (if (get-text-property (match-beginning 0) 'org-protected string)
- (setq start (match-end 0))
- (setq string (replace-match rpl t nil string)))))
- string))
-
-(defun org-export-html-convert-sub-super (string)
- "Convert sub- and superscripts in STRING to HTML."
- (let (key c (s 0) (requireb (eq org-export-with-sub-superscripts '{})))
- (while (string-match org-match-substring-regexp string s)
- (cond
- ((and requireb (match-end 8)) (setq s (match-end 2)))
- ((get-text-property (match-beginning 2) 'org-protected string)
- (setq s (match-end 2)))
- (t
- (setq s (match-end 1)
- key (if (string= (match-string 2 string) "_") "sub" "sup")
- c (or (match-string 8 string)
- (match-string 6 string)
- (match-string 5 string))
- string (replace-match
- (concat (match-string 1 string)
- "<" key ">" c "</" key ">")
- t t string)))))
- (while (string-match "\\\\\\([_^]\\)" string)
- (setq string (replace-match (match-string 1 string) t t string)))
- string))
-
-(defun org-export-html-convert-emphasize (string)
- "Apply emphasis."
- (let ((s 0) rpl)
- (while (string-match org-emph-re string s)
- (if (not (equal
- (substring string (match-beginning 3) (1+ (match-beginning 3)))
- (substring string (match-beginning 4) (1+ (match-beginning 4)))))
- (setq s (match-beginning 0)
- rpl
- (concat
- (match-string 1 string)
- (nth 2 (assoc (match-string 3 string) org-emphasis-alist))
- (match-string 4 string)
- (nth 3 (assoc (match-string 3 string)
- org-emphasis-alist))
- (match-string 5 string))
- string (replace-match rpl t t string)
- s (+ s (- (length rpl) 2)))
- (setq s (1+ s))))
- string))
-
-(defun org-open-par ()
- "Insert <p>, but first close previous paragraph if any."
- (org-close-par-maybe)
- (insert "\n<p>")
- (setq org-par-open t))
-(defun org-close-par-maybe ()
- "Close paragraph if there is one open."
- (when org-par-open
- (insert "</p>")
- (setq org-par-open nil)))
-(defun org-close-li (&optional type)
- "Close <li> if necessary."
- (org-close-par-maybe)
- (insert (if (equal type "d") "</dd>\n" "</li>\n")))
-
-(defvar in-local-list)
-(defvar local-list-indent)
-(defvar local-list-type)
-
-(defvar body-only) ; dynamically scoped into this.
-(defun org-html-level-start (level title umax with-toc head-count)
- "Insert a new level in HTML export.
-When TITLE is nil, just close all open levels."
- (org-close-par-maybe)
- (let* ((target (and title (org-get-text-property-any 0 'target title)))
- (extra-targets (and target
- (assoc target org-export-target-aliases)))
- (extra-class (and title (org-get-text-property-any 0 'html-container-class title)))
- (preferred (and target
- (cdr (assoc target org-export-preferred-target-alist))))
- (l org-level-max)
- snumber snu href suffix)
- (setq extra-targets (remove (or preferred target) extra-targets))
- (setq extra-targets
- (mapconcat (lambda (x)
- (if (org-uuidgen-p x) (setq x (concat "ID-" x)))
- (format "<a name=\"%s\" id=\"%s\"></a>"
- x x))
- extra-targets
- ""))
- (while (>= l level)
- (if (aref org-levels-open (1- l))
- (progn
- (org-html-level-close l umax)
- (aset org-levels-open (1- l) nil)))
- (setq l (1- l)))
- (when title
- ;; If title is nil, this means this function is called to close
- ;; all levels, so the rest is done only if title is given
- (when (string-match (org-re "\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$") title)
- (setq title (replace-match
- (if org-export-with-tags
- (save-match-data
- (concat
- "&nbsp;&nbsp;&nbsp;<span class=\"tag\">"
- (mapconcat
- (lambda (x)
- (format "<span class=\"%s\">%s</span>"
- (org-export-html-get-tag-class-name x)
- x))
- (org-split-string (match-string 1 title) ":")
- "&nbsp;")
- "</span>"))
- "")
- t t title)))
- (if (> level umax)
- (progn
- (if (aref org-levels-open (1- level))
- (progn
- (org-close-li)
- (if target
- (insert (format "<li id=\"%s\">" (or preferred target))
- extra-targets title "<br/>\n")
- (insert "<li>" title "<br/>\n")))
- (aset org-levels-open (1- level) t)
- (org-close-par-maybe)
- (if target
- (insert (format "<ul>\n<li id=\"%s\">" (or preferred target))
- extra-targets title "<br/>\n")
- (insert "<ul>\n<li>" title "<br/>\n"))))
- (aset org-levels-open (1- level) t)
- (setq snumber (org-section-number level)
- snu (replace-regexp-in-string "\\." "_" snumber))
- (setq level (+ level org-export-html-toplevel-hlevel -1))
- (if (and org-export-with-section-numbers (not body-only))
- (setq title (concat
- (format "<span class=\"section-number-%d\">%s</span>"
- level snumber)
- " " title)))
- (unless (= head-count 1) (insert "\n</div>\n"))
- (setq href (cdr (assoc (concat "sec-" snu) org-export-preferred-target-alist)))
- (setq suffix (or href snu))
- (setq href (or href (concat "sec-" snu)))
- (insert (format "\n<div id=\"outline-container-%s\" class=\"outline-%d%s\">\n<h%d id=\"%s\">%s%s</h%d>\n<div class=\"outline-text-%d\" id=\"text-%s\">\n"
- suffix level (if extra-class (concat " " extra-class) "")
- level href
- extra-targets
- title level level suffix))
- (org-open-par)))))
-
-(defun org-export-html-get-tag-class-name (tag)
- "Turn tag into a valid class name.
-Replaces invalid characters with \"_\" and then prepends a prefix."
- (save-match-data
- (while (string-match "[^a-zA-Z0-9_]" tag)
- (setq tag (replace-match "_" t t tag))))
- (concat org-export-html-tag-class-prefix tag))
-
-(defun org-export-html-get-todo-kwd-class-name (kwd)
- "Turn todo keyword into a valid class name.
-Replaces invalid characters with \"_\" and then prepends a prefix."
- (save-match-data
- (while (string-match "[^a-zA-Z0-9_]" kwd)
- (setq kwd (replace-match "_" t t kwd))))
- (concat org-export-html-todo-kwd-class-prefix kwd))
-
-(defun org-html-level-close (level max-outline-level)
- "Terminate one level in HTML export."
- (if (<= level max-outline-level)
- (insert "</div>\n")
- (org-close-li)
- (insert "</ul>\n")))
-
-(provide 'org-html)
-
-;; arch-tag: 8109d84d-eb8f-460b-b1a8-f45f3a6c7ea1
-;;; org-html.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-html.elc b/.emacs.d/org-7.4/lisp/org-html.elc
deleted file mode 100644
index abd5a33..0000000
--- a/.emacs.d/org-7.4/lisp/org-html.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-icalendar.el b/.emacs.d/org-7.4/lisp/org-icalendar.el
deleted file mode 100644
index d4034fe..0000000
--- a/.emacs.d/org-7.4/lisp/org-icalendar.el
+++ /dev/null
@@ -1,655 +0,0 @@
-;;; org-icalendar.el --- iCalendar export for Org-mode
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;;; Code:
-
-(require 'org-exp)
-
-(eval-when-compile
- (require 'cl))
-
-(declare-function org-bbdb-anniv-export-ical "org-bbdb" nil)
-
-(defgroup org-export-icalendar nil
- "Options specific for iCalendar export of Org-mode files."
- :tag "Org Export iCalendar"
- :group 'org-export)
-
-(defcustom org-combined-agenda-icalendar-file "~/org.ics"
- "The file name for the iCalendar file covering all agenda files.
-This file is created with the command \\[org-export-icalendar-all-agenda-files].
-The file name should be absolute, the file will be overwritten without warning."
- :group 'org-export-icalendar
- :type 'file)
-
-(defcustom org-icalendar-alarm-time 0
- "Number of minutes for triggering an alarm for exported timed events.
-A zero value (the default) turns off the definition of an alarm trigger
-for timed events. If non-zero, alarms are created.
-
-- a single alarm per entry is defined
-- The alarm will go off N minutes before the event
-- only a DISPLAY action is defined."
- :group 'org-export-icalendar
- :type 'integer)
-
-(defcustom org-icalendar-combined-name "OrgMode"
- "Calendar name for the combined iCalendar representing all agenda files."
- :group 'org-export-icalendar
- :type 'string)
-
-(defcustom org-icalendar-combined-description nil
- "Calendar description for the combined iCalendar (all agenda files)."
- :group 'org-export-icalendar
- :type 'string)
-
-(defcustom org-icalendar-use-plain-timestamp t
- "Non-nil means make an event from every plain time stamp."
- :group 'org-export-icalendar
- :type 'boolean)
-
-(defcustom org-icalendar-use-deadline '(event-if-not-todo todo-due)
- "Contexts where iCalendar export should use a deadline time stamp.
-This is a list with several symbols in it. Valid symbol are:
-
-event-if-todo Deadlines in TODO entries become calendar events.
-event-if-not-todo Deadlines in non-TODO entries become calendar events.
-todo-due Use deadlines in TODO entries as due-dates"
- :group 'org-export-icalendar
- :type '(set :greedy t
- (const :tag "Deadlines in non-TODO entries become events"
- event-if-not-todo)
- (const :tag "Deadline in TODO entries become events"
- event-if-todo)
- (const :tag "Deadlines in TODO entries become due-dates"
- todo-due)))
-
-(defcustom org-icalendar-use-scheduled '(todo-start)
- "Contexts where iCalendar export should use a scheduling time stamp.
-This is a list with several symbols in it. Valid symbol are:
-
-event-if-todo Scheduling time stamps in TODO entries become an event.
-event-if-not-todo Scheduling time stamps in non-TODO entries become an event.
-todo-start Scheduling time stamps in TODO entries become start date.
- Some calendar applications show TODO entries only after
- that date."
- :group 'org-export-icalendar
- :type '(set :greedy t
- (const :tag
- "SCHEDULED timestamps in non-TODO entries become events"
- event-if-not-todo)
- (const :tag "SCHEDULED timestamps in TODO entries become events"
- event-if-todo)
- (const :tag "SCHEDULED in TODO entries become start date"
- todo-start)))
-
-(defcustom org-icalendar-categories '(local-tags category)
- "Items that should be entered into the categories field.
-This is a list of symbols, the following are valid:
-
-category The Org-mode category of the current file or tree
-todo-state The todo state, if any
-local-tags The tags, defined in the current line
-all-tags All tags, including inherited ones."
- :group 'org-export-icalendar
- :type '(repeat
- (choice
- (const :tag "The file or tree category" category)
- (const :tag "The TODO state" todo-state)
- (const :tag "Tags defined in current line" local-tags)
- (const :tag "All tags, including inherited ones" all-tags))))
-
-(defcustom org-icalendar-include-todo nil
- "Non-nil means export to iCalendar files should also cover TODO items.
-Valid values are:
-nil don't include any TODO items
-t include all TODO items that are not in a DONE state
-unblocked include all TODO items that are not blocked
-all include both done and not done items."
- :group 'org-export-icalendar
- :type '(choice
- (const :tag "None" nil)
- (const :tag "Unfinished" t)
- (const :tag "Unblocked" unblocked)
- (const :tag "All" all)))
-
-(defvar org-icalendar-verify-function nil
- "Function to verify entries for iCalendar export.
-This can be set to a function that will be called at each entry that
-is considered for export to iCalendar. When the function returns nil,
-the entry will be skipped. When it returns a non-nil value, the entry
-will be considered for export.
-This is used internally when an agenda buffer is exported to an ics file,
-to make sure that only entries currently listed in the agenda will end
-up in the ics file. But for normal iCalendar export, you can use this
-for whatever you need.")
-
-(defcustom org-icalendar-include-bbdb-anniversaries nil
- "Non-nil means a combined iCalendar files should include anniversaries.
-The anniversaries are define in the BBDB database."
- :group 'org-export-icalendar
- :type 'boolean)
-
-(defcustom org-icalendar-include-sexps t
- "Non-nil means export to iCalendar files should also cover sexp entries.
-These are entries like in the diary, but directly in an Org-mode file."
- :group 'org-export-icalendar
- :type 'boolean)
-
-(defcustom org-icalendar-include-body 100
- "Amount of text below headline to be included in iCalendar export.
-This is a number of characters that should maximally be included.
-Properties, scheduling and clocking lines will always be removed.
-The text will be inserted into the DESCRIPTION field."
- :group 'org-export-icalendar
- :type '(choice
- (const :tag "Nothing" nil)
- (const :tag "Everything" t)
- (integer :tag "Max characters")))
-
-(defcustom org-icalendar-store-UID nil
- "Non-nil means store any created UIDs in properties.
-The iCalendar standard requires that all entries have a unique identifier.
-Org will create these identifiers as needed. When this variable is non-nil,
-the created UIDs will be stored in the ID property of the entry. Then the
-next time this entry is exported, it will be exported with the same UID,
-superseding the previous form of it. This is essential for
-synchronization services.
-This variable is not turned on by default because we want to avoid creating
-a property drawer in every entry if people are only playing with this feature,
-or if they are only using it locally."
- :group 'org-export-icalendar
- :type 'boolean)
-
-(defcustom org-icalendar-timezone (getenv "TZ")
- "The time zone string for iCalendar export.
-When nil of the empty string, use the abbreviation retrieved from Emacs."
- :group 'org-export-icalendar
- :type '(choice
- (const :tag "Unspecified" nil)
- (string :tag "Time zone")))
-
-(defcustom org-icalendar-use-UTC-date-time ()
- "Non-nil force the use of the universal time for iCalendar DATE-TIME.
-The iCalendar DATE-TIME can be expressed with local time or universal Time,
-universal time could be more compatible with some external tools."
- :group 'org-export-icalendar
- :type 'boolean)
-
-;;; iCalendar export
-
-;;;###autoload
-(defun org-export-icalendar-this-file ()
- "Export current file as an iCalendar file.
-The iCalendar file will be located in the same directory as the Org-mode
-file, but with extension `.ics'."
- (interactive)
- (org-export-icalendar nil buffer-file-name))
-
-;;;###autoload
-(defun org-export-icalendar-all-agenda-files ()
- "Export all files in the variable `org-agenda-files' to iCalendar .ics files.
-Each iCalendar file will be located in the same directory as the Org-mode
-file, but with extension `.ics'."
- (interactive)
- (apply 'org-export-icalendar nil (org-agenda-files t)))
-
-;;;###autoload
-(defun org-export-icalendar-combine-agenda-files ()
- "Export all files in `org-agenda-files' to a single combined iCalendar file.
-The file is stored under the name `org-combined-agenda-icalendar-file'."
- (interactive)
- (apply 'org-export-icalendar t (org-agenda-files t)))
-
-(defun org-export-icalendar (combine &rest files)
- "Create iCalendar files for all elements of FILES.
-If COMBINE is non-nil, combine all calendar entries into a single large
-file and store it under the name `org-combined-agenda-icalendar-file'."
- (save-excursion
- (org-prepare-agenda-buffers files)
- (let* ((dir (org-export-directory
- :ical (list :publishing-directory
- org-export-publishing-directory)))
- file ical-file ical-buffer category started org-agenda-new-buffers)
- (and (get-buffer "*ical-tmp*") (kill-buffer "*ical-tmp*"))
- (when combine
- (setq ical-file
- (if (file-name-absolute-p org-combined-agenda-icalendar-file)
- org-combined-agenda-icalendar-file
- (expand-file-name org-combined-agenda-icalendar-file dir))
- ical-buffer (org-get-agenda-file-buffer ical-file))
- (set-buffer ical-buffer) (erase-buffer))
- (while (setq file (pop files))
- (catch 'nextfile
- (org-check-agenda-file file)
- (set-buffer (org-get-agenda-file-buffer file))
- (unless combine
- (setq ical-file (concat (file-name-as-directory dir)
- (file-name-sans-extension
- (file-name-nondirectory buffer-file-name))
- ".ics"))
- (setq ical-buffer (org-get-agenda-file-buffer ical-file))
- (with-current-buffer ical-buffer (erase-buffer)))
- (setq category (or org-category
- (file-name-sans-extension
- (file-name-nondirectory buffer-file-name))))
- (if (symbolp category) (setq category (symbol-name category)))
- (let ((standard-output ical-buffer))
- (if combine
- (and (not started) (setq started t)
- (org-start-icalendar-file org-icalendar-combined-name))
- (org-start-icalendar-file category))
- (org-print-icalendar-entries combine)
- (when (or (and combine (not files)) (not combine))
- (when (and combine org-icalendar-include-bbdb-anniversaries)
- (require 'org-bbdb)
- (org-bbdb-anniv-export-ical))
- (org-finish-icalendar-file)
- (set-buffer ical-buffer)
- (run-hooks 'org-before-save-iCalendar-file-hook)
- (save-buffer)
- (run-hooks 'org-after-save-iCalendar-file-hook)
- (and (boundp 'org-wait) (numberp org-wait) (sit-for org-wait))
- ))))
- (org-release-buffers org-agenda-new-buffers))))
-
-(defvar org-before-save-iCalendar-file-hook nil
- "Hook run before an iCalendar file has been saved.
-This can be used to modify the result of the export.")
-
-(defvar org-after-save-iCalendar-file-hook nil
- "Hook run after an iCalendar file has been saved.
-The iCalendar buffer is still current when this hook is run.
-A good way to use this is to tell a desktop calendar application to re-read
-the iCalendar file.")
-
-(defvar org-agenda-default-appointment-duration) ; defined in org-agenda.el
-(defun org-print-icalendar-entries (&optional combine)
- "Print iCalendar entries for the current Org-mode file to `standard-output'.
-When COMBINE is non nil, add the category to each line."
- (require 'org-agenda)
- (let ((re1 (concat org-ts-regexp "\\|<%%([^>\n]+>"))
- (re2 (concat "--?-?\\(" org-ts-regexp "\\)"))
- (dts (org-ical-ts-to-string
- (format-time-string (cdr org-time-stamp-formats) (current-time))
- "DTSTART"))
- hd ts ts2 state status (inc t) pos b sexp rrule
- scheduledp deadlinep todo prefix due start
- tmp pri categories location summary desc uid alarm
- (sexp-buffer (get-buffer-create "*ical-tmp*")))
- (org-refresh-category-properties)
- (save-excursion
- (goto-char (point-min))
- (while (re-search-forward re1 nil t)
- (catch :skip
- (org-agenda-skip)
- (when org-icalendar-verify-function
- (unless (save-match-data (funcall org-icalendar-verify-function))
- (outline-next-heading)
- (backward-char 1)
- (throw :skip nil)))
- (setq pos (match-beginning 0)
- ts (match-string 0)
- inc t
- hd (condition-case nil
- (org-icalendar-cleanup-string
- (org-get-heading t))
- (error (throw :skip nil)))
- summary (org-icalendar-cleanup-string
- (org-entry-get nil "SUMMARY"))
- desc (org-icalendar-cleanup-string
- (or (org-entry-get nil "DESCRIPTION")
- (and org-icalendar-include-body (org-get-entry)))
- t org-icalendar-include-body)
- location (org-icalendar-cleanup-string
- (org-entry-get nil "LOCATION" 'selective))
- uid (if org-icalendar-store-UID
- (org-id-get-create)
- (or (org-id-get) (org-id-new)))
- categories (org-export-get-categories)
- alarm ""
- deadlinep nil scheduledp nil)
- (if (looking-at re2)
- (progn
- (goto-char (match-end 0))
- (setq ts2 (match-string 1)
- inc (not (string-match "[0-9]\\{1,2\\}:[0-9][0-9]" ts2))))
- (setq tmp (buffer-substring (max (point-min)
- (- pos org-ds-keyword-length))
- pos)
- ts2 (if (string-match "[0-9]\\{1,2\\}:[0-9][0-9]-\\([0-9]\\{1,2\\}:[0-9][0-9]\\)" ts)
- (progn
- (setq inc nil)
- (replace-match "\\1" t nil ts))
- ts)
- deadlinep (string-match org-deadline-regexp tmp)
- scheduledp (string-match org-scheduled-regexp tmp)
- todo (org-get-todo-state)
- ;; donep (org-entry-is-done-p)
- ))
- (when (and (not org-icalendar-use-plain-timestamp)
- (not deadlinep) (not scheduledp))
- (throw :skip t))
- (when (and
- deadlinep
- (if todo
- (not (memq 'event-if-todo org-icalendar-use-deadline))
- (not (memq 'event-if-not-todo org-icalendar-use-deadline))))
- (throw :skip t))
- (when (and
- scheduledp
- (if todo
- (not (memq 'event-if-todo org-icalendar-use-scheduled))
- (not (memq 'event-if-not-todo org-icalendar-use-scheduled))))
- (throw :skip t))
- (setq prefix (if deadlinep "DL-" (if scheduledp "SC-" "TS-")))
- (if (or (string-match org-tr-regexp hd)
- (string-match org-ts-regexp hd))
- (setq hd (replace-match "" t t hd)))
- (if (string-match "\\+\\([0-9]+\\)\\([dwmy]\\)>" ts)
- (setq rrule
- (concat "\nRRULE:FREQ="
- (cdr (assoc
- (match-string 2 ts)
- '(("d" . "DAILY")("w" . "WEEKLY")
- ("m" . "MONTHLY")("y" . "YEARLY"))))
- ";INTERVAL=" (match-string 1 ts)))
- (setq rrule ""))
- (setq summary (or summary hd))
- ;; create an alarm entry if the entry is timed. this is not very general in that:
- ;; (a) only one alarm per entry is defined,
- ;; (b) only minutes are allowed for the trigger period ahead of the start time, and
- ;; (c) only a DISPLAY action is defined.
- ;; [ESF]
- (let ((t1 (ignore-errors (org-parse-time-string ts 'nodefault))))
- (if (and (> org-icalendar-alarm-time 0)
- (car t1) (nth 1 t1) (nth 2 t1))
- (setq alarm (format "\nBEGIN:VALARM\nACTION:DISPLAY\nDESCRIPTION:%s\nTRIGGER:-P0D0H%dM0S\nEND:VALARM" summary org-icalendar-alarm-time))
- (setq alarm ""))
- )
- (if (string-match org-bracket-link-regexp summary)
- (setq summary
- (replace-match (if (match-end 3)
- (match-string 3 summary)
- (match-string 1 summary))
- t t summary)))
- (if deadlinep (setq summary (concat "DL: " summary)))
- (if scheduledp (setq summary (concat "S: " summary)))
- (if (string-match "\\`<%%" ts)
- (with-current-buffer sexp-buffer
- (insert (substring ts 1 -1) " " summary "\n"))
- (princ (format "BEGIN:VEVENT
-UID: %s
-%s
-%s%s
-SUMMARY:%s%s%s
-CATEGORIES:%s%s
-END:VEVENT\n"
- (concat prefix uid)
- (org-ical-ts-to-string ts "DTSTART")
- (org-ical-ts-to-string ts2 "DTEND" inc)
- rrule summary
- (if (and desc (string-match "\\S-" desc))
- (concat "\nDESCRIPTION: " desc) "")
- (if (and location (string-match "\\S-" location))
- (concat "\nLOCATION: " location) "")
- categories
- alarm)))))
- (when (and org-icalendar-include-sexps
- (condition-case nil (require 'icalendar) (error nil))
- (fboundp 'icalendar-export-region))
- ;; Get all the literal sexps
- (goto-char (point-min))
- (while (re-search-forward "^&?%%(" nil t)
- (catch :skip
- (org-agenda-skip)
- (when org-icalendar-verify-function
- (unless (save-match-data (funcall org-icalendar-verify-function))
- (outline-next-heading)
- (backward-char 1)
- (throw :skip nil)))
- (setq b (match-beginning 0))
- (goto-char (1- (match-end 0)))
- (forward-sexp 1)
- (end-of-line 1)
- (setq sexp (buffer-substring b (point)))
- (with-current-buffer sexp-buffer
- (insert sexp "\n"))))
- (princ (org-diary-to-ical-string sexp-buffer))
- (kill-buffer sexp-buffer))
-
- (when org-icalendar-include-todo
- (setq prefix "TODO-")
- (goto-char (point-min))
- (while (re-search-forward org-complex-heading-regexp nil t)
- (catch :skip
- (org-agenda-skip)
- (when org-icalendar-verify-function
- (unless (save-match-data
- (funcall org-icalendar-verify-function))
- (outline-next-heading)
- (backward-char 1)
- (throw :skip nil)))
- (setq state (match-string 2))
- (setq status (if (member state org-done-keywords)
- "COMPLETED" "NEEDS-ACTION"))
- (when (and state
- (cond
- ;; check if the state is one we should use
- ((eq org-icalendar-include-todo 'all)
- ;; all should be included
- t)
- ((eq org-icalendar-include-todo 'unblocked)
- ;; only undone entries that are not blocked
- (and (member state org-not-done-keywords)
- (or (not org-blocker-hook)
- (save-match-data
- (run-hook-with-args-until-failure
- 'org-blocker-hook
- (list :type 'todo-state-change
- :position (point-at-bol)
- :from 'todo
- :to 'done))))))
- ((eq org-icalendar-include-todo t)
- ;; include everything that is not done
- (member state org-not-done-keywords))))
- (setq hd (match-string 4)
- summary (org-icalendar-cleanup-string
- (org-entry-get nil "SUMMARY"))
- desc (org-icalendar-cleanup-string
- (or (org-entry-get nil "DESCRIPTION")
- (and org-icalendar-include-body (org-get-entry)))
- t org-icalendar-include-body)
- location (org-icalendar-cleanup-string
- (org-entry-get nil "LOCATION" 'selective))
- due (and (member 'todo-due org-icalendar-use-deadline)
- (org-entry-get nil "DEADLINE"))
- start (and (member 'todo-start org-icalendar-use-scheduled)
- (org-entry-get nil "SCHEDULED"))
- categories (org-export-get-categories)
- uid (if org-icalendar-store-UID
- (org-id-get-create)
- (or (org-id-get) (org-id-new))))
- (and due (setq due (org-ical-ts-to-string due "DUE")))
- (and start (setq start (org-ical-ts-to-string start "DTSTART")))
-
- (if (string-match org-bracket-link-regexp hd)
- (setq hd (replace-match (if (match-end 3) (match-string 3 hd)
- (match-string 1 hd))
- t t hd)))
- (if (string-match org-priority-regexp hd)
- (setq pri (string-to-char (match-string 2 hd))
- hd (concat (substring hd 0 (match-beginning 1))
- (substring hd (match-end 1))))
- (setq pri org-default-priority))
- (setq pri (floor (- 9 (* 8. (/ (float (- org-lowest-priority pri))
- (- org-lowest-priority org-highest-priority))))))
-
- (princ (format "BEGIN:VTODO
-UID: %s
-%s
-SUMMARY:%s%s%s%s
-CATEGORIES:%s
-SEQUENCE:1
-PRIORITY:%d
-STATUS:%s
-END:VTODO\n"
- (concat prefix uid)
- (or start dts)
- (or summary hd)
- (if (and location (string-match "\\S-" location))
- (concat "\nLOCATION: " location) "")
- (if (and desc (string-match "\\S-" desc))
- (concat "\nDESCRIPTION: " desc) "")
- (if due (concat "\n" due) "")
- categories
- pri status)))))))))
-
-(defun org-export-get-categories ()
- "Get categories according to `org-icalendar-categories'."
- (let ((cs org-icalendar-categories) c rtn tmp)
- (while (setq c (pop cs))
- (cond
- ((eq c 'category) (push (org-get-category) rtn))
- ((eq c 'todo-state)
- (setq tmp (org-get-todo-state))
- (and tmp (push tmp rtn)))
- ((eq c 'local-tags)
- (setq rtn (append (nreverse (org-get-local-tags-at (point))) rtn)))
- ((eq c 'all-tags)
- (setq rtn (append (nreverse (org-get-tags-at (point))) rtn)))))
- (mapconcat 'identity (nreverse rtn) ",")))
-
-(defun org-icalendar-cleanup-string (s &optional is-body maxlength)
- "Take out stuff and quote what needs to be quoted.
-When IS-BODY is non-nil, assume that this is the body of an item, clean up
-whitespace, newlines, drawers, and timestamps, and cut it down to MAXLENGTH
-characters."
- (if (not s)
- nil
- (if is-body
- (let ((re (concat "\\(" org-drawer-regexp "\\)[^\000]*?:END:.*\n?"))
- (re2 (concat "^[ \t]*" org-keyword-time-regexp ".*\n?")))
- (while (string-match re s) (setq s (replace-match "" t t s)))
- (while (string-match re2 s) (setq s (replace-match "" t t s))))
- (setq s (replace-regexp-in-string "[[:space:]]+" " " s)))
- (let ((start 0))
- (while (string-match "\\([,;]\\)" s start)
- (setq start (+ (match-beginning 0) 2)
- s (replace-match "\\\\\\1" nil nil s))))
- (setq s (org-trim s))
- (when is-body
- (while (string-match "[ \t]*\n[ \t]*" s)
- (setq s (replace-match "\\n" t t s))))
- (if is-body
- (if maxlength
- (if (and (numberp maxlength)
- (> (length s) maxlength))
- (setq s (substring s 0 maxlength)))))
- s))
-
-(defun org-icalendar-cleanup-string-rfc2455 (s &optional is-body maxlength)
- "Take out stuff and quote what needs to be quoted.
-When IS-BODY is non-nil, assume that this is the body of an item, clean up
-whitespace, newlines, drawers, and timestamps, and cut it down to MAXLENGTH
-characters.
-This seems to be more like RFC 2455, but it causes problems, so it is
-not used right now."
- (if (not s)
- nil
- (if is-body
- (let ((re (concat "\\(" org-drawer-regexp "\\)[^\000]*?:END:.*\n?"))
- (re2 (concat "^[ \t]*" org-keyword-time-regexp ".*\n?")))
- (while (string-match re s) (setq s (replace-match "" t t s)))
- (while (string-match re2 s) (setq s (replace-match "" t t s)))
- (setq s (org-trim s))
- (while (string-match "[ \t]*\n[ \t]*" s)
- (setq s (replace-match "\\n" t t s)))
- (if maxlength
- (if (and (numberp maxlength)
- (> (length s) maxlength))
- (setq s (substring s 0 maxlength)))))
- (setq s (org-trim s)))
- (while (string-match "\"" s) (setq s (replace-match "''" t t s)))
- (when (string-match "[;,:]" s) (setq s (concat "\"" s "\"")))
- s))
-
-(defun org-start-icalendar-file (name)
- "Start an iCalendar file by inserting the header."
- (let ((user user-full-name)
- (name (or name "unknown"))
- (timezone (if (> (length org-icalendar-timezone) 0)
- org-icalendar-timezone
- (cadr (current-time-zone))))
- (description org-icalendar-combined-description))
- (princ
- (format "BEGIN:VCALENDAR
-VERSION:2.0
-X-WR-CALNAME:%s
-PRODID:-//%s//Emacs with Org-mode//EN
-X-WR-TIMEZONE:%s
-X-WR-CALDESC:%s
-CALSCALE:GREGORIAN\n" name user timezone description))))
-
-(defun org-finish-icalendar-file ()
- "Finish an iCalendar file by inserting the END statement."
- (princ "END:VCALENDAR\n"))
-
-(defun org-ical-ts-to-string (s keyword &optional inc)
- "Take a time string S and convert it to iCalendar format.
-KEYWORD is added in front, to make a complete line like DTSTART....
-When INC is non-nil, increase the hour by two (if time string contains
-a time), or the day by one (if it does not contain a time)."
- (let ((t1 (ignore-errors (org-parse-time-string s 'nodefault)))
- t2 fmt have-time time)
- (if (not t1)
- ""
- (if (and (car t1) (nth 1 t1) (nth 2 t1))
- (setq t2 t1 have-time t)
- (setq t2 (org-parse-time-string s)))
- (let ((s (car t2)) (mi (nth 1 t2)) (h (nth 2 t2))
- (d (nth 3 t2)) (m (nth 4 t2)) (y (nth 5 t2)))
- (when inc
- (if have-time
- (if org-agenda-default-appointment-duration
- (setq mi (+ org-agenda-default-appointment-duration mi))
- (setq h (+ 2 h)))
- (setq d (1+ d))))
- (setq time (encode-time s mi h d m y)))
- (setq fmt (if have-time (if org-icalendar-use-UTC-date-time
- ":%Y%m%dT%H%M%SZ"
- ":%Y%m%dT%H%M%S")
- ";VALUE=DATE:%Y%m%d"))
- (concat keyword (format-time-string fmt time
- (and org-icalendar-use-UTC-date-time
- have-time))))))
-
-(provide 'org-icalendar)
-
-;; arch-tag: 2dee2b6e-9211-4aee-8a47-a3c7e5bc30cf
-;;; org-icalendar.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-icalendar.elc b/.emacs.d/org-7.4/lisp/org-icalendar.elc
deleted file mode 100644
index 1438753..0000000
--- a/.emacs.d/org-7.4/lisp/org-icalendar.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-id.el b/.emacs.d/org-7.4/lisp/org-id.el
deleted file mode 100644
index a8004af..0000000
--- a/.emacs.d/org-7.4/lisp/org-id.el
+++ /dev/null
@@ -1,647 +0,0 @@
-;;; org-id.el --- Global identifiers for Org-mode entries
-;;
-;; Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
-;;
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file implements globally unique identifiers for Org-mode entries.
-;; Identifiers are stored in the entry as an :ID: property. Functions
-;; are provided that create and retrieve such identifiers, and that find
-;; entries based on the identifier.
-
-;; Identifiers consist of a prefix (default "Org" given by the variable
-;; `org-id-prefix') and a unique part that can be created by a number
-;; of different methods, see the variable `org-id-method'.
-;; Org has a builtin method that uses a compact encoding of the creation
-;; time of the ID, with microsecond accuracy. This virtually
-;; guarantees globally unique identifiers, even if several people are
-;; creating IDs at the same time in files that will eventually be used
-;; together.
-;;
-;; By default Org uses UUIDs as global unique identifiers.
-;;
-;; This file defines the following API:
-;;
-;; org-id-get-create
-;; Create an ID for the entry at point if it does not yet have one.
-;; Returns the ID (old or new). This function can be used
-;; interactively, with prefix argument the creation of a new ID is
-;; forced, even if there was an old one.
-;;
-;; org-id-get
-;; Get the ID property of an entry. Using appropriate arguments
-;; to the function, it can also create the ID for this entry.
-;;
-;; org-id-goto
-;; Command to go to a specific ID, this command can be used
-;; interactively.
-;;
-;; org-id-get-with-outline-path-completion
-;; Retrieve the ID of an entry, using outline path completion.
-;; This function can work for multiple files.
-;;
-;; org-id-get-with-outline-drilling
-;; Retrieve the ID of an entry, using outline path completion.
-;; This function only works for the current file.
-;;
-;; org-id-find
-;; Find the location of an entry with specific id.
-;;
-
-;;; Code:
-
-(require 'org)
-
-(declare-function message-make-fqdn "message" ())
-
-;;; Customization
-
-(defgroup org-id nil
- "Options concerning global entry identifiers in Org-mode."
- :tag "Org ID"
- :group 'org)
-
-(defcustom org-id-uuid-program "uuidgen"
- "The uuidgen program."
- :group 'org-id
- :type 'string)
-
-(defcustom org-id-method 'uuid
- "The method that should be used to create new IDs.
-
-An ID will consist of the optional prefix specified in `org-id-prefix',
-and a unique part created by the method this variable specifies.
-
-Allowed values are:
-
-org Org's own internal method, using an encoding of the current time to
- microsecond accuracy, and optionally the current domain of the
- computer. See the variable `org-id-include-domain'.
-
-uuid Create random (version 4) UUIDs. If the program defined in
- `org-id-uuid-program' is available it is used to create the ID.
- Otherwise an internal functions is used."
- :group 'org-id
- :type '(choice
- (const :tag "Org's internal method" org)
- (const :tag "external: uuidgen" uuid)))
-
-(defcustom org-id-prefix nil
- "The prefix for IDs.
-
-This may be a string, or it can be nil to indicate that no prefix is required.
-When a string, the string should have no space characters as IDs are expected
-to have no space characters in them."
- :group 'org-id
- :type '(choice
- (const :tag "No prefix")
- (string :tag "Prefix")))
-
-(defcustom org-id-include-domain nil
- "Non-nil means add the domain name to new IDs.
-This ensures global uniqueness of IDs, and is also suggested by
-RFC 2445 in combination with RFC 822. This is only relevant if
-`org-id-method' is `org'. When uuidgen is used, the domain will never
-be added.
-The default is to not use this because we have no really good way to get
-the true domain, and Org entries will normally not be shared with enough
-people to make this necessary."
- :group 'org-id
- :type 'boolean)
-
-(defcustom org-id-track-globally t
- "Non-nil means track IDs through files, so that links work globally.
-This work by maintaining a hash table for IDs and writing this table
-to disk when exiting Emacs. Because of this, it works best if you use
-a single Emacs process, not many.
-
-When nil, IDs are not tracked. Links to IDs will still work within
-a buffer, but not if the entry is located in another file.
-IDs can still be used if the entry with the id is in the same file as
-the link."
- :group 'org-id
- :type 'boolean)
-
-(defcustom org-id-locations-file (convert-standard-filename
- "~/.emacs.d/.org-id-locations")
- "The file for remembering in which file an ID was defined.
-This variable is only relevant when `org-id-track-globally' is set."
- :group 'org-id
- :type 'file)
-
-(defvar org-id-locations nil
- "List of files with IDs in those files.
-Depending on `org-id-use-hash' this can also be a hash table mapping IDs
-to files.")
-
-(defvar org-id-files nil
- "List of files that contain IDs.")
-
-(defcustom org-id-extra-files 'org-agenda-text-search-extra-files
- "Files to be searched for IDs, besides the agenda files.
-When Org reparses files to remake the list of files and IDs it is tracking,
-it will normally scan the agenda files, the archives related to agenda files,
-any files that are listed as ID containing in the current register, and
-any Org-mode files currently visited by Emacs.
-You can list additional files here.
-This variable is only relevant when `org-id-track-globally' is set."
- :group 'org-id
- :type
- '(choice
- (symbol :tag "Variable")
- (repeat :tag "List of files"
- (file))))
-
-(defcustom org-id-search-archives t
- "Non-nil means search also the archive files of agenda files for entries.
-This is a possibility to reduce overhead, but it means that entries moved
-to the archives can no longer be found by ID.
-This variable is only relevant when `org-id-track-globally' is set."
- :group 'org-id
- :type 'boolean)
-
-;;; The API functions
-
-;;;###autoload
-(defun org-id-get-create (&optional force)
- "Create an ID for the current entry and return it.
-If the entry already has an ID, just return it.
-With optional argument FORCE, force the creation of a new ID."
- (interactive "P")
- (when force
- (org-entry-put (point) "ID" nil))
- (org-id-get (point) 'create))
-
-;;;###autoload
-(defun org-id-copy ()
- "Copy the ID of the entry at point to the kill ring.
-Create an ID if necessary."
- (interactive)
- (org-kill-new (org-id-get nil 'create)))
-
-;;;###autoload
-(defun org-id-get (&optional pom create prefix)
- "Get the ID property of the entry at point-or-marker POM.
-If POM is nil, refer to the entry at point.
-If the entry does not have an ID, the function returns nil.
-However, when CREATE is non nil, create an ID if none is present already.
-PREFIX will be passed through to `org-id-new'.
-In any case, the ID of the entry is returned."
- (org-with-point-at pom
- (let ((id (org-entry-get nil "ID")))
- (cond
- ((and id (stringp id) (string-match "\\S-" id))
- id)
- (create
- (setq id (org-id-new prefix))
- (org-entry-put pom "ID" id)
- (org-id-add-location id (buffer-file-name (buffer-base-buffer)))
- id)
- (t nil)))))
-
-;;;###autoload
-(defun org-id-get-with-outline-path-completion (&optional targets)
- "Use outline-path-completion to retrieve the ID of an entry.
-TARGETS may be a setting for `org-refile-targets' to define the eligible
-headlines. When omitted, all headlines in all agenda files are
-eligible.
-It returns the ID of the entry. If necessary, the ID is created."
- (let* ((org-refile-targets (or targets '((nil . (:maxlevel . 10)))))
- (org-refile-use-outline-path
- (if (caar org-refile-targets) 'file t))
- (org-refile-target-verify-function nil)
- (spos (org-refile-get-location "Entry: "))
- (pom (and spos (move-marker (make-marker) (nth 3 spos)
- (get-file-buffer (nth 1 spos))))))
- (prog1 (org-id-get pom 'create)
- (move-marker pom nil))))
-
-;;;###autoload
-(defun org-id-get-with-outline-drilling (&optional targets)
- "Use an outline-cycling interface to retrieve the ID of an entry.
-This only finds entries in the current buffer, using `org-get-location'.
-It returns the ID of the entry. If necessary, the ID is created."
- (let* ((spos (org-get-location (current-buffer) org-goto-help))
- (pom (and spos (move-marker (make-marker) (car spos)))))
- (prog1 (org-id-get pom 'create)
- (move-marker pom nil))))
-
-;;;###autoload
-(defun org-id-goto (id)
- "Switch to the buffer containing the entry with id ID.
-Move the cursor to that entry in that buffer."
- (interactive "sID: ")
- (let ((m (org-id-find id 'marker)))
- (unless m
- (error "Cannot find entry with ID \"%s\"" id))
- (switch-to-buffer (marker-buffer m))
- (goto-char m)
- (move-marker m nil)
- (org-show-context)))
-
-;;;###autoload
-(defun org-id-find (id &optional markerp)
- "Return the location of the entry with the id ID.
-The return value is a cons cell (file-name . position), or nil
-if there is no entry with that ID.
-With optional argument MARKERP, return the position as a new marker."
- (cond
- ((symbolp id) (setq id (symbol-name id)))
- ((numberp id) (setq id (number-to-string id))))
- (let ((file (org-id-find-id-file id))
- org-agenda-new-buffers where)
- (when file
- (setq where (org-id-find-id-in-file id file markerp)))
- (unless where
- (org-id-update-id-locations)
- (setq file (org-id-find-id-file id))
- (when file
- (setq where (org-id-find-id-in-file id file markerp))))
- where))
-
-;;; Internal functions
-
-;; Creating new IDs
-
-(defun org-id-new (&optional prefix)
- "Create a new globally unique ID.
-
-An ID consists of two parts separated by a colon:
-- a prefix
-- a unique part that will be created according to `org-id-method'.
-
-PREFIX can specify the prefix, the default is given by the variable
-`org-id-prefix'. However, if PREFIX is the symbol `none', don't use any
-prefix even if `org-id-prefix' specifies one.
-
-So a typical ID could look like \"Org:4nd91V40HI\"."
- (let* ((prefix (if (eq prefix 'none)
- ""
- (concat (or prefix org-id-prefix) ":")))
- unique)
- (if (equal prefix ":") (setq prefix ""))
- (cond
- ((memq org-id-method '(uuidgen uuid))
- (setq unique (org-trim (shell-command-to-string org-id-uuid-program)))
- (unless (org-uuidgen-p unique)
- (setq unique (org-id-uuid))))
- ((eq org-id-method 'org)
- (let* ((etime (org-id-reverse-string (org-id-time-to-b36)))
- (postfix (if org-id-include-domain
- (progn
- (require 'message)
- (concat "@" (message-make-fqdn))))))
- (setq unique (concat etime postfix))))
- (t (error "Invalid `org-id-method'")))
- (concat prefix unique)))
-
-(defun org-id-uuid ()
- "Return string with random (version 4) UUID."
- (let ((rnd (md5 (format "%s%s%s%s%s%s%s"
- (random t)
- (current-time)
- (user-uid)
- (emacs-pid)
- (user-full-name)
- user-mail-address
- (recent-keys)))))
- (format "%s-%s-4%s-%s%s-%s"
- (substring rnd 0 8)
- (substring rnd 8 12)
- (substring rnd 13 16)
- (format "%x"
- (logior
- #b10000000
- (logand
- #b10111111
- (string-to-number
- (substring rnd 16 18) 16))))
- (substring rnd 18 20)
- (substring rnd 20 32))))
-
-(defun org-id-reverse-string (s)
- (mapconcat 'char-to-string (nreverse (string-to-list s)) ""))
-
-(defun org-id-int-to-b36-one-digit (i)
- "Turn an integer between 0 and 61 into a single character 0..9, A..Z, a..z."
- (cond
- ((< i 10) (+ ?0 i))
- ((< i 36) (+ ?a i -10))
- (t (error "Larger that 35"))))
-
-(defun org-id-b36-to-int-one-digit (i)
- "Turn a character 0..9, A..Z, a..z into a number 0..61.
-The input I may be a character, or a single-letter string."
- (and (stringp i) (setq i (string-to-char i)))
- (cond
- ((and (>= i ?0) (<= i ?9)) (- i ?0))
- ((and (>= i ?a) (<= i ?z)) (+ (- i ?a) 10))
- (t (error "Invalid b36 letter"))))
-
-(defun org-id-int-to-b36 (i &optional length)
- "Convert an integer to a base-36 number represented as a string."
- (let ((s ""))
- (while (> i 0)
- (setq s (concat (char-to-string
- (org-id-int-to-b36-one-digit (mod i 36))) s)
- i (/ i 36)))
- (setq length (max 1 (or length 1)))
- (if (< (length s) length)
- (setq s (concat (make-string (- length (length s)) ?0) s)))
- s))
-
-(defun org-id-b36-to-int (s)
- "Convert a base-36 string into the corresponding integer."
- (let ((r 0))
- (mapc (lambda (i) (setq r (+ (* r 36) (org-id-b36-to-int-one-digit i))))
- s)
- r))
-
-(defun org-id-time-to-b36 (&optional time)
- "Encode TIME as a 10-digit string.
-This string holds the time to micro-second accuracy, and can be decoded
-using `org-id-decode'."
- (setq time (or time (current-time)))
- (concat (org-id-int-to-b36 (nth 0 time) 4)
- (org-id-int-to-b36 (nth 1 time) 4)
- (org-id-int-to-b36 (or (nth 2 time) 0) 4)))
-
-(defun org-id-decode (id)
- "Split ID into the prefix and the time value that was used to create it.
-The return value is (prefix . time) where PREFIX is nil or a string,
-and time is the usual three-integer representation of time."
- (let (prefix time parts)
- (setq parts (org-split-string id ":"))
- (if (= 2 (length parts))
- (setq prefix (car parts) time (nth 1 parts))
- (setq prefix nil time (nth 0 parts)))
- (setq time (org-id-reverse-string time))
- (setq time (list (org-id-b36-to-int (substring time 0 4))
- (org-id-b36-to-int (substring time 4 8))
- (org-id-b36-to-int (substring time 8 12))))
- (cons prefix time)))
-
-;; Storing ID locations (files)
-
-(defun org-id-update-id-locations (&optional files)
- "Scan relevant files for IDs.
-Store the relation between files and corresponding IDs.
-This will scan all agenda files, all associated archives, and all
-files currently mentioned in `org-id-locations'.
-When FILES is given, scan these files instead.
-When CHECK is given, prepare detailed information about duplicate IDs."
- (interactive)
- (if (not org-id-track-globally)
- (error "Please turn on `org-id-track-globally' if you want to track IDs")
- (let* ((org-id-search-archives
- (or org-id-search-archives
- (and (symbolp org-id-extra-files)
- (symbol-value org-id-extra-files)
- (member 'agenda-archives org-id-extra-files))))
- (files
- (or files
- (append
- ;; Agenda files and all associated archives
- (org-agenda-files t org-id-search-archives)
- ;; Explicit extra files
- (if (symbolp org-id-extra-files)
- (symbol-value org-id-extra-files)
- org-id-extra-files)
- ;; Files associated with live org-mode buffers
- (delq nil
- (mapcar (lambda (b)
- (with-current-buffer b
- (and (org-mode-p) (buffer-file-name))))
- (buffer-list)))
- ;; All files known to have IDs
- org-id-files)))
- org-agenda-new-buffers
- file nfiles tfile ids reg found id seen (ndup 0))
- (when (member 'agenda-archives files)
- (setq files (delq 'agenda-archives (copy-sequence files))))
- (setq nfiles (length files))
- (while (setq file (pop files))
- (message "Finding ID locations (%d/%d files): %s"
- (- nfiles (length files)) nfiles file)
- (setq tfile (file-truename file))
- (when (and (file-exists-p file) (not (member tfile seen)))
- (push tfile seen)
- (setq ids nil)
- (with-current-buffer (org-get-agenda-file-buffer file)
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (while (re-search-forward "^[ \t]*:ID:[ \t]+\\(\\S-+\\)[ \t]*$"
- nil t)
- (setq id (org-match-string-no-properties 1))
- (if (member id found)
- (progn
- (message "Duplicate ID \"%s\", also in file %s"
- id (or (car (delq
- nil
- (mapcar
- (lambda (x)
- (if (member id (cdr x))
- (car x)))
- reg)))
- (buffer-file-name)))
- (when (= ndup 0)
- (ding)
- (sit-for 2))
- (setq ndup (1+ ndup)))
- (push id found)
- (push id ids)))
- (push (cons (abbreviate-file-name file) ids) reg))))))
- (org-release-buffers org-agenda-new-buffers)
- (setq org-agenda-new-buffers nil)
- (setq org-id-locations reg)
- (setq org-id-files (mapcar 'car org-id-locations))
- (org-id-locations-save) ;; this function can also handle the alist form
- ;; now convert to a hash
- (setq org-id-locations (org-id-alist-to-hash org-id-locations))
- (if (> ndup 0)
- (message "WARNING: %d duplicate IDs found, check *Messages* buffer" ndup)
- (message "%d unique files scanned for IDs" (length org-id-files)))
- org-id-locations)))
-
-(defun org-id-locations-save ()
- "Save `org-id-locations' in `org-id-locations-file'."
- (when (and org-id-track-globally org-id-locations)
- (let ((out (if (hash-table-p org-id-locations)
- (org-id-hash-to-alist org-id-locations)
- org-id-locations)))
- (with-temp-file org-id-locations-file
- (print out (current-buffer))))))
-
-(defun org-id-locations-load ()
- "Read the data from `org-id-locations-file'."
- (setq org-id-locations nil)
- (when org-id-track-globally
- (with-temp-buffer
- (condition-case nil
- (progn
- (insert-file-contents-literally org-id-locations-file)
- (goto-char (point-min))
- (setq org-id-locations (read (current-buffer))))
- (error
- (message "Could not read org-id-values from %s. Setting it to nil."
- org-id-locations-file))))
- (setq org-id-files (mapcar 'car org-id-locations))
- (setq org-id-locations (org-id-alist-to-hash org-id-locations))))
-
-(defun org-id-add-location (id file)
- "Add the ID with location FILE to the database of ID locations."
- ;; Only if global tracking is on, and when the buffer has a file
- (when (and org-id-track-globally id file)
- (unless org-id-locations (org-id-locations-load))
- (puthash id (abbreviate-file-name file) org-id-locations)
- (add-to-list 'org-id-files (abbreviate-file-name file))))
-
-(add-hook 'kill-emacs-hook 'org-id-locations-save)
-
-(defun org-id-hash-to-alist (hash)
- "Turn an org-id hash into an alist, so that it can be written to a file."
- (let (res x)
- (maphash
- (lambda (k v)
- (if (setq x (member v res))
- (setcdr x (cons k (cdr x)))
- (push (list v k) res)))
- hash)
- res))
-
-(defun org-id-alist-to-hash (list)
- "Turn an org-id location list into a hash table."
- (let ((res (make-hash-table
- :test 'equal
- :size (apply '+ (mapcar 'length list))))
- f)
- (mapc
- (lambda (x)
- (setq f (car x))
- (mapc (lambda (i) (puthash i f res)) (cdr x)))
- list)
- res))
-
-(defun org-id-paste-tracker (txt &optional buffer-or-file)
- "Update any IDs in TXT and assign BUFFER-OR-FILE to them."
- (when org-id-track-globally
- (save-match-data
- (setq buffer-or-file (or buffer-or-file (current-buffer)))
- (when (bufferp buffer-or-file)
- (setq buffer-or-file (or (buffer-base-buffer buffer-or-file)
- buffer-or-file))
- (setq buffer-or-file (buffer-file-name buffer-or-file)))
- (when buffer-or-file
- (let ((fname (abbreviate-file-name buffer-or-file))
- (s 0))
- (while (string-match "^[ \t]*:ID:[ \t]+\\([^ \t\n\r]+\\)" txt s)
- (setq s (match-end 0))
- (org-id-add-location (match-string 1 txt) fname)))))))
-
-;; Finding entries with specified id
-
-;;;###autoload
-(defun org-id-find-id-file (id)
- "Query the id database for the file in which this ID is located."
- (unless org-id-locations (org-id-locations-load))
- (or (and org-id-locations
- (hash-table-p org-id-locations)
- (gethash id org-id-locations))
- ;; ball back on current buffer
- (buffer-file-name (or (buffer-base-buffer (current-buffer))
- (current-buffer)))))
-
-(defun org-id-find-id-in-file (id file &optional markerp)
- "Return the position of the entry ID in FILE.
-If that files does not exist, or if it does not contain this ID,
-return nil.
-The position is returned as a cons cell (file-name . position). With
-optional argument MARKERP, return the position as a new marker."
- (let (org-agenda-new-buffers buf pos)
- (cond
- ((not file) nil)
- ((not (file-exists-p file)) nil)
- (t (with-current-buffer (setq buf (org-get-agenda-file-buffer file))
- (setq pos (org-find-entry-with-id id))
- (when pos
- (if markerp
- (move-marker (make-marker) pos buf)
- (cons file pos))))))))
-
-;; id link type
-
-;; Calling the following function is hard-coded into `org-store-link',
-;; so we do have to add it to `org-store-link-functions'.
-
-;;;###autoload
-(defun org-id-store-link ()
- "Store a link to the current entry, using its ID."
- (interactive)
- (when (and (buffer-file-name (buffer-base-buffer)) (org-mode-p))
- (let* ((link (org-make-link "id:" (org-id-get-create)))
- (case-fold-search nil)
- (desc (save-excursion
- (org-back-to-heading t)
- (or (and (looking-at org-complex-heading-regexp)
- (if (match-end 4)
- (match-string 4)
- (match-string 0)))
- link))))
- (org-store-link-props :link link :description desc :type "id")
- link)))
-
-(defun org-id-open (id)
- "Go to the entry with id ID."
- (org-mark-ring-push)
- (let ((m (org-id-find id 'marker))
- cmd)
- (unless m
- (error "Cannot find entry with ID \"%s\"" id))
- ;; Use a buffer-switching command in analogy to finding files
- (setq cmd
- (or
- (cdr
- (assq
- (cdr (assq 'file org-link-frame-setup))
- '((find-file . switch-to-buffer)
- (find-file-other-window . switch-to-buffer-other-window)
- (find-file-other-frame . switch-to-buffer-other-frame))))
- 'switch-to-buffer-other-window))
- (if (not (equal (current-buffer) (marker-buffer m)))
- (funcall cmd (marker-buffer m)))
- (goto-char m)
- (move-marker m nil)
- (org-show-context)))
-
-(org-add-link-type "id" 'org-id-open)
-
-(provide 'org-id)
-
-;;; org-id.el ends here
-
-;; arch-tag: e5abaca4-e16f-4b25-832a-540cfb63a712
-
-
diff --git a/.emacs.d/org-7.4/lisp/org-id.elc b/.emacs.d/org-7.4/lisp/org-id.elc
deleted file mode 100644
index 183b8c0..0000000
--- a/.emacs.d/org-7.4/lisp/org-id.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-indent.el b/.emacs.d/org-7.4/lisp/org-indent.el
deleted file mode 100644
index a177a6f..0000000
--- a/.emacs.d/org-7.4/lisp/org-indent.el
+++ /dev/null
@@ -1,326 +0,0 @@
-;;; org-indent.el --- Dynamic indentation for Org-mode
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-;;
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-;;
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This is an implementation of dynamic virtual indentation. It works
-;; by adding text properties to a buffer to make sure lines are
-;; indented according to outline structure.
-
-;;; Code:
-
-(require 'org-macs)
-(require 'org-compat)
-(require 'org)
-
-(eval-when-compile
- (require 'cl))
-
-(defvar org-inlinetask-min-level)
-(declare-function org-inlinetask-get-task-level "org-inlinetask" ())
-(declare-function org-inlinetask-in-task-p "org-inlinetask" ())
-
-(defgroup org-indent nil
- "Options concerning dynamic virtual outline indentation."
- :tag "Org Indent"
- :group 'org)
-
-(defconst org-indent-max 40
- "Maximum indentation in characters.")
-(defconst org-indent-max-levels 40
- "Maximum indentation in characters.")
-
-(defvar org-indent-strings nil
- "Vector with all indentation strings.
-It will be set in `org-indent-initialize'.")
-(defvar org-indent-stars nil
- "Vector with all indentation star strings.
-It will be set in `org-indent-initialize'.")
-(defvar org-hide-leading-stars-before-indent-mode nil
- "Used locally.")
-
-(defcustom org-indent-boundary-char ?\ ; comment to protect space char
- "The end of the virtual indentation strings, a single-character string.
-The default is just a space, but if you wish, you can use \"|\" or so.
-This can be useful on a terminal window - under a windowing system,
-it may be prettier to customize the org-indent face."
- :group 'org-indent
- :set (lambda (var val)
- (set var val)
- (and org-indent-strings (org-indent-initialize)))
- :type 'character)
-
-(defcustom org-indent-mode-turns-off-org-adapt-indentation t
- "Non-nil means setting the variable `org-indent-mode' will \
-turn off indentation adaptation.
-For details see the variable `org-adapt-indentation'."
- :group 'org-indent
- :type 'boolean)
-
-(defcustom org-indent-mode-turns-on-hiding-stars t
- "Non-nil means setting the variable `org-indent-mode' will \
-turn on `org-hide-leading-stars'."
- :group 'org-indent
- :type 'boolean)
-
-(defcustom org-indent-indentation-per-level 2
- "Indentation per level in number of characters."
- :group 'org-indent
- :type 'integer)
-
-(defcustom org-indent-fix-section-after-idle-time 0.2
- "Seconds of idle time before fixing virtual indentation of section.
-The hooking-in of virtual indentation is not yet perfect. Occasionally,
-a change does not trigger to proper change of indentation. For this we
-have a timer action that fixes indentation in the current section after
-a short amount idle time. If we ever get the integration to work perfectly,
-this variable can be set to nil to get rid of the timer."
- :group 'org-indent
- :type '(choice
- (const "Do not install idle timer" nil)
- (number :tag "Idle time")))
-
-(defun org-indent-initialize ()
- "Initialize the indentation strings and set the idle timer."
- ;; We use an idle timer to "repair" the current section, because the
- ;; redisplay seems to have some problems.
- (unless org-indent-strings
- (when org-indent-fix-section-after-idle-time
- (run-with-idle-timer
- org-indent-fix-section-after-idle-time
- t 'org-indent-refresh-section)))
- ;; Initialize the indentation and star vectors
- (setq org-indent-strings (make-vector (1+ org-indent-max) nil))
- (setq org-indent-stars (make-vector (1+ org-indent-max) nil))
- (aset org-indent-strings 0 nil)
- (aset org-indent-stars 0 nil)
- (loop for i from 1 to org-indent-max do
- (aset org-indent-strings i
- (org-add-props
- (concat (make-string (1- i) ?\ )
- (char-to-string org-indent-boundary-char))
- nil 'face 'org-indent)))
- (loop for i from 1 to org-indent-max-levels do
- (aset org-indent-stars i
- (org-add-props (make-string i ?*)
- nil 'face 'org-hide))))
-
-;;;###autoload
-(define-minor-mode org-indent-mode
- "When active, indent text according to outline structure.
-
-Internally this works by adding `line-prefix' properties to all non-headlines.
-These properties are updated locally in idle time.
-FIXME: How to update when broken?"
- nil " Ind" nil
- (cond
- ((org-bound-and-true-p org-inhibit-startup)
- (setq org-indent-mode nil))
- ((and org-indent-mode (featurep 'xemacs))
- (message "org-indent-mode does not work in XEmacs - refusing to turn it on")
- (setq org-indent-mode nil))
- ((and org-indent-mode
- (not (org-version-check "23.1.50" "Org Indent mode" :predicate)))
- (message "org-indent-mode can crash Emacs 23.1 - refusing to turn it on!")
- (ding)
- (sit-for 1)
- (setq org-indent-mode nil))
- (org-indent-mode
- ;; mode was turned on.
- (org-set-local 'indent-tabs-mode nil)
- (or org-indent-strings (org-indent-initialize))
- (when org-indent-mode-turns-off-org-adapt-indentation
- (org-set-local 'org-adapt-indentation nil))
- (when org-indent-mode-turns-on-hiding-stars
- (org-set-local 'org-hide-leading-stars-before-indent-mode
- org-hide-leading-stars)
- (org-set-local 'org-hide-leading-stars t))
- (make-local-variable 'buffer-substring-filters)
- (add-to-list 'buffer-substring-filters
- 'org-indent-remove-properties-from-string)
- (org-add-hook 'org-after-demote-entry-hook
- 'org-indent-refresh-section nil 'local)
- (org-add-hook 'org-after-promote-entry-hook
- 'org-indent-refresh-section nil 'local)
- (org-add-hook 'org-font-lock-hook
- 'org-indent-refresh-to nil 'local)
- (and font-lock-mode (org-restart-font-lock))
- )
- (t
- ;; mode was turned off (or we refused to turn it on)
- (save-excursion
- (save-restriction
- (org-indent-remove-properties (point-min) (point-max))
- (kill-local-variable 'org-adapt-indentation)
- (when (boundp 'org-hide-leading-stars-before-indent-mode)
- (org-set-local 'org-hide-leading-stars
- org-hide-leading-stars-before-indent-mode))
- (setq buffer-substring-filters
- (delq 'org-indent-remove-properties-from-string
- buffer-substring-filters))
- (remove-hook 'org-after-promote-entry-hook
- 'org-indent-refresh-section 'local)
- (remove-hook 'org-after-demote-entry-hook
- 'org-indent-refresh-section 'local)
- (and font-lock-mode (org-restart-font-lock))
- (redraw-display))))))
-
-
-(defface org-indent
- (org-compatible-face nil nil)
- "Face for outline indentation.
-The default is to make it look like whitespace. But you may find it
-useful to make it ever so slightly different."
- :group 'org-faces)
-
-(defun org-indent-indent-buffer ()
- "Add indentation properties for the whole buffer."
- (interactive)
- (when org-indent-mode
- (save-excursion
- (save-restriction
- (widen)
- (org-indent-remove-properties (point-min) (point-max))
- (org-indent-add-properties (point-min) (point-max))))))
-
-(defun org-indent-remove-properties (beg end)
- "Remove indentations between BEG and END."
- (let ((inhibit-modification-hooks t))
- (with-silent-modifications
- (remove-text-properties beg end '(line-prefix nil wrap-prefix nil)))))
-
-(defun org-indent-remove-properties-from-string (string)
- "Remove indentations between BEG and END."
- (remove-text-properties 0 (length string)
- '(line-prefix nil wrap-prefix nil) string)
- string)
-
-(defvar org-indent-outline-re (concat "^" org-outline-regexp)
- "Outline heading regexp.")
-
-(defun org-indent-add-properties (beg end)
- "Add indentation properties between BEG and END.
-Assumes that BEG is at the beginning of a line."
- (let* ((inhibit-modification-hooks t)
- (inlinetaskp (featurep 'org-inlinetask))
- (get-real-level (lambda (pos lvl)
- (save-excursion
- (goto-char pos)
- (if (and inlinetaskp (org-inlinetask-in-task-p))
- (org-inlinetask-get-task-level)
- lvl))))
- (b beg)
- (e end)
- (level 0)
- (n 0)
- exit nstars)
- (with-silent-modifications
- (save-excursion
- (goto-char beg)
- (while (not exit)
- (setq e end)
- (if (not (re-search-forward org-indent-outline-re nil t))
- (setq e (point-max) exit t)
- (setq e (match-beginning 0))
- (if (>= e end) (setq exit t))
- (unless (and inlinetaskp (org-inlinetask-in-task-p))
- (setq level (- (match-end 0) (match-beginning 0) 1)))
- (setq nstars (* (1- (funcall get-real-level e level))
- (1- org-indent-indentation-per-level)))
- (add-text-properties
- (point-at-bol) (point-at-eol)
- (list 'line-prefix
- (aref org-indent-stars nstars)
- 'wrap-prefix
- (aref org-indent-strings
- (* (funcall get-real-level e level)
- org-indent-indentation-per-level)))))
- (when (> e b)
- (add-text-properties
- b e (list 'line-prefix (aref org-indent-strings n)
- 'wrap-prefix (aref org-indent-strings n))))
- (setq b (1+ (point-at-eol))
- n (* (funcall get-real-level b level)
- org-indent-indentation-per-level)))))))
-
-(defvar org-inlinetask-min-level)
-(defun org-indent-refresh-section ()
- "Refresh indentation properties in the current outline section.
-Point is assumed to be at the beginning of a headline."
- (interactive)
- (when org-indent-mode
- (let (beg end)
- (save-excursion
- (when (ignore-errors (let ((outline-regexp (format "\\*\\{1,%s\\}[ \t]+"
- (if (featurep 'org-inlinetask)
- (1- org-inlinetask-min-level)
- ""))))
- (org-back-to-heading)))
- (setq beg (point))
- (setq end (or (save-excursion (or (outline-next-heading) (point)))))
- (org-indent-remove-properties beg end)
- (org-indent-add-properties beg end))))))
-
-(defun org-indent-refresh-to (limit)
- "Refresh indentation properties in the current outline section.
-Point is assumed to be at the beginning of a headline."
- (interactive)
- (when org-indent-mode
- (let ((beg (point)) (end limit))
- (save-excursion
- (and (ignore-errors (let ((outline-regexp (format "\\*\\{1,%s\\}[ \t]+"
- (if (featurep 'org-inlinetask)
- (1- org-inlinetask-min-level)
- ""))))
- (org-back-to-heading)))
- (setq beg (point))))
- (org-indent-remove-properties beg end)
- (org-indent-add-properties beg end)))
- (goto-char limit))
-
-(defun org-indent-refresh-subtree ()
- "Refresh indentation properties in the current outline subtree.
-Point is assumed to be at the beginning of a headline."
- (interactive)
- (when org-indent-mode
- (save-excursion
- (let (beg end)
- (setq beg (point))
- (setq end (save-excursion (org-end-of-subtree t t)))
- (org-indent-remove-properties beg end)
- (org-indent-add-properties beg end)))))
-
-(defun org-indent-refresh-buffer ()
- "Refresh indentation properties in the current outline subtree.
-Point is assumed to be at the beginning of a headline."
- (interactive)
- (when org-indent-mode
- (org-indent-mode -1)
- (org-indent-mode 1)))
-
-(provide 'org-indent)
-
-;; arch-tag: b76736bc-9f4a-43cd-977c-ecfd6689846a
-;;; org-indent.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-indent.elc b/.emacs.d/org-7.4/lisp/org-indent.elc
deleted file mode 100644
index ce71db5..0000000
--- a/.emacs.d/org-7.4/lisp/org-indent.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-info.el b/.emacs.d/org-7.4/lisp/org-info.el
deleted file mode 100644
index 250f438..0000000
--- a/.emacs.d/org-7.4/lisp/org-info.el
+++ /dev/null
@@ -1,83 +0,0 @@
-;;; org-info.el --- Support for links to Info nodes from within Org-Mode
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file implements links to Info nodes from within Org-mode.
-;; Org-mode loads this module by default - if this is not what you want,
-;; configure the variable `org-modules'.
-
-;;; Code:
-
-(require 'org)
-
-;; Declare external functions and variables
-
-(declare-function Info-find-node "info" (filename nodename
- &optional no-going-back))
-(defvar Info-current-file)
-(defvar Info-current-node)
-
-;; Install the link type
-(org-add-link-type "info" 'org-info-open)
-(add-hook 'org-store-link-functions 'org-info-store-link)
-
-;; Implementation
-(defun org-info-store-link ()
- "Store a link to an Info file and node."
- (when (eq major-mode 'Info-mode)
- (let (link desc)
- (setq link (org-make-link "info:"
- (file-name-nondirectory Info-current-file)
- ":" Info-current-node))
- (setq desc (concat (file-name-nondirectory Info-current-file)
- ":" Info-current-node))
- (org-store-link-props :type "info" :file Info-current-file
- :node Info-current-node
- :link link :desc desc)
- link)))
-
-(defun org-info-open (path)
- "Follow an Info file and node link specified by PATH."
- (org-info-follow-link path))
-
-
-(defun org-info-follow-link (name)
- "Follow an Info file and node link specified by NAME."
- (if (or (string-match "\\(.*\\)::?\\(.*\\)" name)
- (string-match "\\(.*\\)" name))
- (progn
- (require 'info)
- (if (match-string 2 name) ; If there isn't a node, choose "Top"
- (Info-find-node (match-string 1 name) (match-string 2 name))
- (Info-find-node (match-string 1 name) "Top")))
- (message "Could not open: %s" name)))
-
-(provide 'org-info)
-
-;; arch-tag: 1e289f54-7176-487f-b575-dd4854bab15e
-
-;;; org-info.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-info.elc b/.emacs.d/org-7.4/lisp/org-info.elc
deleted file mode 100644
index 1dd0768..0000000
--- a/.emacs.d/org-7.4/lisp/org-info.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-inlinetask.el b/.emacs.d/org-7.4/lisp/org-inlinetask.el
deleted file mode 100644
index 3f2d6fb..0000000
--- a/.emacs.d/org-7.4/lisp/org-inlinetask.el
+++ /dev/null
@@ -1,338 +0,0 @@
-;;; org-inlinetask.el --- Tasks independent of outline hierarchy
-
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-;;
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-;;
-;; This module implements inline tasks in Org-mode. Inline tasks are
-;; tasks that have all the properties of normal outline nodes, including
-;; the ability to store meta data like scheduling dates, TODO state, tags
-;; and properties. However, these nodes are treated specially by the
-;; visibility cycling and export commands.
-;;
-;; Visibility cycling exempts these nodes from cycling. So whenever their
-;; parent is opened, so are these tasks. This will only work with
-;; `org-cycle', so if you are also using other commands to show/hide
-;; entries, you will occasionally find these tasks to behave like
-;; all other outline nodes, seemingly splitting the text of the parent
-;; into children.
-;;
-;; Export commands do not treat these nodes as part of the sectioning
-;; structure, but as a special inline text that is either removed, or
-;; formatted in some special way.
-;;
-;; Special fontification of inline tasks, so that they can be immediately
-;; recognized. From the stars of the headline, only the first and the
-;; last two will be visible, the others will be hidden using the
-;; `org-hide' face.
-;;
-;; An inline task is identified solely by a minimum outline level, given
-;; by the variable `org-inlinetask-min-level', default 15.
-;;
-;; Inline tasks are normally assumed to contain at most a time planning
-;; line (DEADLINE etc) after it, and then any number of drawers, for
-;; example LOGBOOK of PROPERTIES. No empty lines are allowed.
-;; If you need to have normal text as part of an inline task, you
-;; can do so by adding an "END" headline with the same number of stars,
-;; for example
-;;
-;; **************** TODO some small task
-;; DEADLINE: <2009-03-30 Mon>
-;; :PROPERTIES:
-;; :SOMETHING: or other
-;; :END:
-;; And here is some extra text
-;; **************** END
-;;
-;; Also, if you want to use refiling and archiving for inline tasks,
-;; The END line must be present to make things work properly.
-;;
-;; This package installs one new command:
-;;
-;; C-c C-x t Insert a new inline task with END line
-
-;;; Code:
-
-(require 'org)
-
-(defgroup org-inlinetask nil
- "Options concerning inline tasks in Org mode."
- :tag "Org Inline Tasks"
- :group 'org-structure)
-
-(defcustom org-inlinetask-min-level 15
- "Minimum level a headline must have before it is treated as an inline task.
-It is strongly recommended that you set `org-cycle-max-level' not at all,
-or to a number smaller than this one. In fact, when `org-cycle-max-level' is
-not set, it will be assumed to be one less than the value of smaller than
-the value of this variable."
- :group 'org-inlinetask
- :type '(choice
- (const :tag "Off" nil)
- (integer)))
-
-(defcustom org-inlinetask-export t
- "Non-nil means export inline tasks.
-When nil, they will not be exported."
- :group 'org-inlinetask
- :type 'boolean)
-
-(defvar org-inlinetask-export-templates
- '((html "<pre class=\"inlinetask\"><b>%s%s</b><br>%s</pre>"
- '((unless (eq todo "")
- (format "<span class=\"%s %s\">%s%s</span> "
- class todo todo priority))
- heading content))
- (latex "\\begin\{description\}\\item[%s%s]%s\\end\{description\}"
- '((unless (eq todo "") (format "\\textsc\{%s%s\} " todo priority))
- heading content))
- (ascii " -- %s%s%s"
- '((unless (eq todo "") (format "%s%s " todo priority))
- heading
- (unless (eq content "")
- (format "\n ¦ %s"
- (mapconcat 'identity (org-split-string content "\n")
- "\n ¦ ")))))
- (docbook "<variablelist>
-<varlistentry>
-<term>%s%s</term>
-<listitem><para>%s</para></listitem>
-</varlistentry>
-</variablelist>"
- '((unless (eq todo "") (format "%s%s " todo priority))
- heading content)))
- "Templates for inline tasks in various exporters.
-
-This variable is an alist in the shape of (BACKEND STRING OBJECTS).
-
-BACKEND is the name of the backend for the template (ascii, html...).
-
-STRING is a format control string.
-
-OBJECTS is a list of elements to be substituted into the format
-string. They can be of any type, from a string to a form
-returning a value (thus allowing conditional insertion). A nil
-object will be substituted as the empty string. Obviously, there
-must be at least as many objects as %-sequences in the format
-string.
-
-Moreover, the following special keywords are provided: `todo',
-`priority', `heading', `content', `tags'. If some of them are not
-defined in an inline task, their value is the empty string.
-
-As an example, valid associations are:
-
-(html \"<ul><li>%s <p>%s</p></li></ul>\" (heading content))
-
-or, with the additional package \"todonotes\" for LaTeX,
-
-(latex \"\\todo[inline]{\\textbf{\\textsf{%s %s}}\\linebreak{} %s}\"
- '((unless (eq todo \"\")
- (format \"\\textsc{%s%s}\" todo priority))
- heading content)))")
-
-(defvar org-odd-levels-only)
-(defvar org-keyword-time-regexp)
-(defvar org-drawer-regexp)
-(defvar org-complex-heading-regexp)
-(defvar org-property-end-re)
-
-(defcustom org-inlinetask-default-state nil
- "Non-nil means make inline tasks have a TODO keyword initially.
-This should be the state `org-inlinetask-insert-task' should use by
-default, or nil of no state should be assigned."
- :group 'org-inlinetask
- :type '(choice
- (const :tag "No state" nil)
- (string :tag "Specific state")))
-
-(defun org-inlinetask-insert-task (&optional no-state)
- "Insert an inline task.
-If prefix arg NO-STATE is set, ignore `org-inlinetask-default-state'."
- (interactive "P")
- (or (bolp) (newline))
- (let ((indent org-inlinetask-min-level))
- (if org-odd-levels-only
- (setq indent (- (* 2 indent) 1)))
- (insert (make-string indent ?*)
- (if (or no-state (not org-inlinetask-default-state))
- " \n"
- (concat " " org-inlinetask-default-state " \n"))
- (make-string indent ?*) " END\n"))
- (end-of-line -1))
-(define-key org-mode-map "\C-c\C-xt" 'org-inlinetask-insert-task)
-
-(defun org-inlinetask-outline-regexp ()
- "Return string matching an inline task heading.
-The number of levels is controlled by `org-inlinetask-min-level'."
- (let ((nstars (if org-odd-levels-only
- (1- (* org-inlinetask-min-level 2))
- org-inlinetask-min-level)))
- (format "^\\(\\*\\{%d,\\}\\)[ \t]+" nstars)))
-
-(defun org-inlinetask-in-task-p ()
- "Return true if point is inside an inline task."
- (save-excursion
- (let* ((stars-re (org-inlinetask-outline-regexp))
- (task-beg-re (concat stars-re "\\(?:.*\\)"))
- (task-end-re (concat stars-re "\\(?:END\\|end\\)[ \t]*$")))
- (beginning-of-line)
- (or (looking-at task-beg-re)
- (and (re-search-forward "^\\*+[ \t]+" nil t)
- (progn (beginning-of-line) (looking-at task-end-re)))))))
-
-(defun org-inlinetask-goto-beginning ()
- "Go to the beginning of the inline task at point."
- (end-of-line)
- (re-search-backward (org-inlinetask-outline-regexp) nil t)
- (when (org-looking-at-p (concat (org-inlinetask-outline-regexp) "END[ \t]*$"))
- (re-search-backward (org-inlinetask-outline-regexp) nil t)))
-
-(defun org-inlinetask-goto-end ()
- "Go to the end of the inline task at point."
- (beginning-of-line)
- (cond
- ((org-looking-at-p (concat (org-inlinetask-outline-regexp) "END[ \t]*$"))
- (forward-line 1))
- ((org-looking-at-p (org-inlinetask-outline-regexp))
- (forward-line 1)
- (when (org-inlinetask-in-task-p)
- (re-search-forward (org-inlinetask-outline-regexp) nil t)
- (forward-line 1)))
- (t
- (re-search-forward (org-inlinetask-outline-regexp) nil t)
- (forward-line 1))))
-
-(defun org-inlinetask-get-task-level ()
- "Get the level of the inline task around.
-This assumes the point is inside an inline task."
- (save-excursion
- (end-of-line)
- (re-search-backward (org-inlinetask-outline-regexp) nil t)
- (- (match-end 1) (match-beginning 1))))
-
-(defvar backend) ; dynamically scoped into the next function
-(defun org-inlinetask-export-handler ()
- "Handle headlines with level larger or equal to `org-inlinetask-min-level'.
-Either remove headline and meta data, or do special formatting."
- (goto-char (point-min))
- (let* ((nstars (if org-odd-levels-only
- (1- (* 2 (or org-inlinetask-min-level 200)))
- (or org-inlinetask-min-level 200)))
- (re1 (format "^\\(\\*\\{%d,\\}\\) .*\n" nstars))
- (re2 (concat "^[ \t]*" org-keyword-time-regexp))
- headline beg end stars content)
- (while (re-search-forward re1 nil t)
- (setq headline (match-string 0)
- stars (match-string 1)
- content nil)
- (replace-match "")
- (while (looking-at re2)
- (delete-region (point) (1+ (point-at-eol))))
- (while (looking-at org-drawer-regexp)
- (setq beg (point))
- (if (re-search-forward org-property-end-re nil t)
- (delete-region beg (1+ (match-end 0)))))
- (setq beg (point))
- (when (and (re-search-forward "^\\(\\*+\\) " nil t)
- (= (length (match-string 1)) (length stars))
- (progn (goto-char (match-end 0))
- (looking-at "END[ \t]*$")))
- (setq content (buffer-substring beg (1- (point-at-bol))))
- (delete-region beg (1+ (match-end 0))))
- (goto-char beg)
- (when org-inlinetask-export
- ;; content formatting
- (when content
- (if (not (string-match "\\S-" content))
- (setq content nil)
- (if (string-match "[ \t\n]+\\'" content)
- (setq content (substring content 0 (match-beginning 0))))
- (setq content (org-remove-indentation content))))
- (setq content (or content ""))
- ;; grab elements to export
- (when (string-match org-complex-heading-regexp headline)
- (let* ((todo (or (match-string 2 headline) ""))
- (class (or (and (eq "" todo) "")
- (if (member todo org-done-keywords) "done" "todo")))
- (priority (or (match-string 3 headline) ""))
- (heading (or (match-string 4 headline) ""))
- (tags (or (match-string 5 headline) ""))
- (backend-spec (assq backend org-inlinetask-export-templates))
- (format-str (nth 1 backend-spec))
- (tokens (cadr (nth 2 backend-spec)))
- ;; change nil arguments into empty strings
- (nil-to-str (lambda (el) (or (eval el) "")))
- ;; build and protect export string
- (export-str (org-add-props
- (eval (append '(format format-str)
- (mapcar nil-to-str tokens)))
- nil 'org-protected t)))
- ;; eventually insert it
- (insert export-str "\n")))))))
-
-(defun org-inlinetask-get-current-indentation ()
- "Get the indentation of the last non-while line above this one."
- (save-excursion
- (beginning-of-line 1)
- (skip-chars-backward " \t\n")
- (beginning-of-line 1)
- (or (org-at-item-p)
- (looking-at "[ \t]*"))
- (goto-char (match-end 0))
- (current-column)))
-
-(defun org-inlinetask-fontify (limit)
- "Fontify the inline tasks."
- (let* ((nstars (if org-odd-levels-only
- (1- (* 2 (or org-inlinetask-min-level 200)))
- (or org-inlinetask-min-level 200)))
- (re (concat "^\\(\\*\\)\\(\\*\\{"
- (format "%d" (- nstars 3))
- ",\\}\\)\\(\\*\\* .*\\)")))
- (while (re-search-forward re limit t)
- (add-text-properties (match-beginning 1) (match-end 1)
- '(face org-warning font-lock-fontified t))
- (add-text-properties (match-beginning 2) (match-end 2)
- '(face org-hide font-lock-fontified t))
- (add-text-properties (match-beginning 3) (match-end 3)
- '(face shadow font-lock-fontified t)))))
-
-(defun org-inlinetask-remove-END-maybe ()
- "Remove an END line when present."
- (when (looking-at (format "\\([ \t]*\n\\)*\\*\\{%d,\\}[ \t]+END[ \t]*$"
- org-inlinetask-min-level))
- (replace-match "")))
-
-(eval-after-load "org-exp"
- '(add-hook 'org-export-preprocess-after-tree-selection-hook
- 'org-inlinetask-export-handler))
-(eval-after-load "org"
- '(add-hook 'org-font-lock-hook 'org-inlinetask-fontify))
-
-(provide 'org-inlinetask)
-
-;;; org-inlinetask.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-inlinetask.elc b/.emacs.d/org-7.4/lisp/org-inlinetask.elc
deleted file mode 100644
index 2881120..0000000
--- a/.emacs.d/org-7.4/lisp/org-inlinetask.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-install.el b/.emacs.d/org-7.4/lisp/org-install.el
deleted file mode 100644
index e82a017..0000000
--- a/.emacs.d/org-7.4/lisp/org-install.el
+++ /dev/null
@@ -1,1762 +0,0 @@
-
-;;;### (autoloads (org-customize org-reload org-require-autoloaded-modules
-;;;;;; org-submit-bug-report org-cycle-agenda-files org-switchb
-;;;;;; org-map-entries org-open-link-from-string org-open-at-point-global
-;;;;;; org-insert-link-global org-store-link org-run-like-in-org-mode
-;;;;;; turn-on-orgstruct++ turn-on-orgstruct orgstruct-mode org-global-cycle
-;;;;;; org-mode org-babel-do-load-languages) "org" "lisp/org.el"
-;;;;;; (19714 9811))
-;;; Generated autoloads from lisp/org.el
-
-(autoload 'org-babel-do-load-languages "org" "\
-Load the languages defined in `org-babel-load-languages'.
-
-\(fn SYM VALUE)" nil nil)
-
-(autoload 'org-mode "org" "\
-Outline-based notes management and organizer, alias
-\"Carsten's outline-mode for keeping track of everything.\"
-
-Org-mode develops organizational tasks around a NOTES file which
-contains information about projects as plain text. Org-mode is
-implemented on top of outline-mode, which is ideal to keep the content
-of large files well structured. It supports ToDo items, deadlines and
-time stamps, which magically appear in the diary listing of the Emacs
-calendar. Tables are easily created with a built-in table editor.
-Plain text URL-like links connect to websites, emails (VM), Usenet
-messages (Gnus), BBDB entries, and any files related to the project.
-For printing and sharing of notes, an Org-mode file (or a part of it)
-can be exported as a structured ASCII or HTML file.
-
-The following commands are available:
-
-\\{org-mode-map}
-
-\(fn)" t nil)
-
-(defvar org-inlinetask-min-level)
-
-(autoload 'org-global-cycle "org" "\
-Cycle the global visibility. For details see `org-cycle'.
-With \\[universal-argument] prefix arg, switch to startup visibility.
-With a numeric prefix, show all headlines up to that level.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'orgstruct-mode "org" "\
-Toggle the minor mode `orgstruct-mode'.
-This mode is for using Org-mode structure commands in other
-modes. The following keys behave as if Org-mode were active, if
-the cursor is on a headline, or on a plain list item (both as
-defined by Org-mode).
-
-M-up Move entry/item up
-M-down Move entry/item down
-M-left Promote
-M-right Demote
-M-S-up Move entry/item up
-M-S-down Move entry/item down
-M-S-left Promote subtree
-M-S-right Demote subtree
-M-q Fill paragraph and items like in Org-mode
-C-c ^ Sort entries
-C-c - Cycle list bullet
-TAB Cycle item visibility
-M-RET Insert new heading/item
-S-M-RET Insert new TODO heading / Checkbox item
-C-c C-c Set tags / toggle checkbox
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'turn-on-orgstruct "org" "\
-Unconditionally turn on `orgstruct-mode'.
-
-\(fn)" nil nil)
-
-(autoload 'turn-on-orgstruct++ "org" "\
-Unconditionally turn on `orgstruct++-mode'.
-
-\(fn)" nil nil)
-
-(autoload 'org-run-like-in-org-mode "org" "\
-Run a command, pretending that the current buffer is in Org-mode.
-This will temporarily bind local variables that are typically bound in
-Org-mode to the values they have in Org-mode, and then interactively
-call CMD.
-
-\(fn CMD)" nil nil)
-
-(autoload 'org-store-link "org" "\
-\\<org-mode-map>Store an org-link to the current location.
-This link is added to `org-stored-links' and can later be inserted
-into an org-buffer with \\[org-insert-link].
-
-For some link types, a prefix arg is interpreted:
-For links to usenet articles, arg negates `org-gnus-prefer-web-links'.
-For file links, arg negates `org-context-in-file-links'.
-
-\(fn ARG)" t nil)
-
-(autoload 'org-insert-link-global "org" "\
-Insert a link like Org-mode does.
-This command can be called in any mode to insert a link in Org-mode syntax.
-
-\(fn)" t nil)
-
-(autoload 'org-open-at-point-global "org" "\
-Follow a link like Org-mode does.
-This command can be called in any mode to follow a link that has
-Org-mode syntax.
-
-\(fn)" t nil)
-
-(autoload 'org-open-link-from-string "org" "\
-Open a link in the string S, as if it was in Org-mode.
-
-\(fn S &optional ARG REFERENCE-BUFFER)" t nil)
-
-(autoload 'org-map-entries "org" "\
-Call FUNC at each headline selected by MATCH in SCOPE.
-
-FUNC is a function or a lisp form. The function will be called without
-arguments, with the cursor positioned at the beginning of the headline.
-The return values of all calls to the function will be collected and
-returned as a list.
-
-The call to FUNC will be wrapped into a save-excursion form, so FUNC
-does not need to preserve point. After evaluation, the cursor will be
-moved to the end of the line (presumably of the headline of the
-processed entry) and search continues from there. Under some
-circumstances, this may not produce the wanted results. For example,
-if you have removed (e.g. archived) the current (sub)tree it could
-mean that the next entry will be skipped entirely. In such cases, you
-can specify the position from where search should continue by making
-FUNC set the variable `org-map-continue-from' to the desired buffer
-position.
-
-MATCH is a tags/property/todo match as it is used in the agenda tags view.
-Only headlines that are matched by this query will be considered during
-the iteration. When MATCH is nil or t, all headlines will be
-visited by the iteration.
-
-SCOPE determines the scope of this command. It can be any of:
-
-nil The current buffer, respecting the restriction if any
-tree The subtree started with the entry at point
-file The current buffer, without restriction
-file-with-archives
- The current buffer, and any archives associated with it
-agenda All agenda files
-agenda-with-archives
- All agenda files with any archive files associated with them
-\(file1 file2 ...)
- If this is a list, all files in the list will be scanned
-
-The remaining args are treated as settings for the skipping facilities of
-the scanner. The following items can be given here:
-
- archive skip trees with the archive tag.
- comment skip trees with the COMMENT keyword
- function or Emacs Lisp form:
- will be used as value for `org-agenda-skip-function', so whenever
- the function returns t, FUNC will not be called for that
- entry and search will continue from the point where the
- function leaves it.
-
-If your function needs to retrieve the tags including inherited tags
-at the *current* entry, you can use the value of the variable
-`org-scanner-tags' which will be much faster than getting the value
-with `org-get-tags-at'. If your function gets properties with
-`org-entry-properties' at the *current* entry, bind `org-trust-scanner-tags'
-to t around the call to `org-entry-properties' to get the same speedup.
-Note that if your function moves around to retrieve tags and properties at
-a *different* entry, you cannot use these techniques.
-
-\(fn FUNC &optional MATCH SCOPE &rest SKIP)" nil nil)
-
-(autoload 'org-switchb "org" "\
-Switch between Org buffers.
-With a prefix argument, restrict available to files.
-With two prefix arguments, restrict available buffers to agenda files.
-
-Defaults to `iswitchb' for buffer name completion.
-Set `org-completion-use-ido' to make it use ido instead.
-
-\(fn &optional ARG)" t nil)
-
-(defalias 'org-ido-switchb 'org-switchb)
-
-(defalias 'org-iswitchb 'org-switchb)
-
-(autoload 'org-cycle-agenda-files "org" "\
-Cycle through the files in `org-agenda-files'.
-If the current buffer visits an agenda file, find the next one in the list.
-If the current buffer does not, find the first agenda file.
-
-\(fn)" t nil)
-
-(autoload 'org-submit-bug-report "org" "\
-Submit a bug report on Org-mode via mail.
-
-Don't hesitate to report any problems or inaccurate documentation.
-
-If you don't have setup sending mail from (X)Emacs, please copy the
-output buffer into your mail program, as it gives us important
-information about your Org-mode version and configuration.
-
-\(fn)" t nil)
-
-(autoload 'org-require-autoloaded-modules "org" "\
-Not documented
-
-\(fn)" t nil)
-
-(autoload 'org-reload "org" "\
-Reload all org lisp files.
-With prefix arg UNCOMPILED, load the uncompiled versions.
-
-\(fn &optional UNCOMPILED)" t nil)
-
-(autoload 'org-customize "org" "\
-Call the customize function with org as argument.
-
-\(fn)" t nil)
-
-;;;***
-
-;;;### (autoloads (org-agenda-to-appt org-calendar-goto-agenda org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item
-;;;;;; org-diary org-agenda-list-stuck-projects org-tags-view org-todo-list
-;;;;;; org-search-view org-agenda-list org-batch-store-agenda-views
-;;;;;; org-store-agenda-views org-batch-agenda-csv org-batch-agenda
-;;;;;; org-agenda) "org-agenda" "lisp/org-agenda.el" (19708 61313))
-;;; Generated autoloads from lisp/org-agenda.el
-
-(autoload 'org-agenda "org-agenda" "\
-Dispatch agenda commands to collect entries to the agenda buffer.
-Prompts for a command to execute. Any prefix arg will be passed
-on to the selected command. The default selections are:
-
-a Call `org-agenda-list' to display the agenda for current day or week.
-t Call `org-todo-list' to display the global todo list.
-T Call `org-todo-list' to display the global todo list, select only
- entries with a specific TODO keyword (the user gets a prompt).
-m Call `org-tags-view' to display headlines with tags matching
- a condition (the user is prompted for the condition).
-M Like `m', but select only TODO entries, no ordinary headlines.
-L Create a timeline for the current buffer.
-e Export views to associated files.
-s Search entries for keywords.
-/ Multi occur across all agenda files and also files listed
- in `org-agenda-text-search-extra-files'.
-< Restrict agenda commands to buffer, subtree, or region.
- Press several times to get the desired effect.
-> Remove a previous restriction.
-# List \"stuck\" projects.
-! Configure what \"stuck\" means.
-C Configure custom agenda commands.
-
-More commands can be added by configuring the variable
-`org-agenda-custom-commands'. In particular, specific tags and TODO keyword
-searches can be pre-defined in this way.
-
-If the current buffer is in Org-mode and visiting a file, you can also
-first press `<' once to indicate that the agenda should be temporarily
-\(until the next use of \\[org-agenda]) restricted to the current file.
-Pressing `<' twice means to restrict to the current subtree or region
-\(if active).
-
-\(fn &optional ARG KEYS RESTRICTION)" t nil)
-
-(autoload 'org-batch-agenda "org-agenda" "\
-Run an agenda command in batch mode and send the result to STDOUT.
-If CMD-KEY is a string of length 1, it is used as a key in
-`org-agenda-custom-commands' and triggers this command. If it is a
-longer string it is used as a tags/todo match string.
-Parameters are alternating variable names and values that will be bound
-before running the agenda command.
-
-\(fn CMD-KEY &rest PARAMETERS)" nil (quote macro))
-
-(autoload 'org-batch-agenda-csv "org-agenda" "\
-Run an agenda command in batch mode and send the result to STDOUT.
-If CMD-KEY is a string of length 1, it is used as a key in
-`org-agenda-custom-commands' and triggers this command. If it is a
-longer string it is used as a tags/todo match string.
-Parameters are alternating variable names and values that will be bound
-before running the agenda command.
-
-The output gives a line for each selected agenda item. Each
-item is a list of comma-separated values, like this:
-
-category,head,type,todo,tags,date,time,extra,priority-l,priority-n
-
-category The category of the item
-head The headline, without TODO kwd, TAGS and PRIORITY
-type The type of the agenda entry, can be
- todo selected in TODO match
- tagsmatch selected in tags match
- diary imported from diary
- deadline a deadline on given date
- scheduled scheduled on given date
- timestamp entry has timestamp on given date
- closed entry was closed on given date
- upcoming-deadline warning about deadline
- past-scheduled forwarded scheduled item
- block entry has date block including g. date
-todo The todo keyword, if any
-tags All tags including inherited ones, separated by colons
-date The relevant date, like 2007-2-14
-time The time, like 15:00-16:50
-extra Sting with extra planning info
-priority-l The priority letter if any was given
-priority-n The computed numerical priority
-agenda-day The day in the agenda where this is listed
-
-\(fn CMD-KEY &rest PARAMETERS)" nil (quote macro))
-
-(autoload 'org-store-agenda-views "org-agenda" "\
-Not documented
-
-\(fn &rest PARAMETERS)" t nil)
-
-(autoload 'org-batch-store-agenda-views "org-agenda" "\
-Run all custom agenda commands that have a file argument.
-
-\(fn &rest PARAMETERS)" nil (quote macro))
-
-(autoload 'org-agenda-list "org-agenda" "\
-Produce a daily/weekly view from all files in variable `org-agenda-files'.
-The view will be for the current day or week, but from the overview buffer
-you will be able to go to other days/weeks.
-
-With one \\[universal-argument] prefix argument INCLUDE-ALL,
-all unfinished TODO items will also be shown, before the agenda.
-This feature is considered obsolete, please use the TODO list or a block
-agenda instead.
-
-With a numeric prefix argument in an interactive call, the agenda will
-span INCLUDE-ALL days. Lisp programs should instead specify SPAN to change
-the number of days. SPAN defaults to `org-agenda-span'.
-
-START-DAY defaults to TODAY, or to the most recent match for the weekday
-given in `org-agenda-start-on-weekday'.
-
-\(fn &optional INCLUDE-ALL START-DAY SPAN)" t nil)
-
-(autoload 'org-search-view "org-agenda" "\
-Show all entries that contain a phrase or words or regular expressions.
-
-With optional prefix argument TODO-ONLY, only consider entries that are
-TODO entries. The argument STRING can be used to pass a default search
-string into this function. If EDIT-AT is non-nil, it means that the
-user should get a chance to edit this string, with cursor at position
-EDIT-AT.
-
-The search string can be viewed either as a phrase that should be found as
-is, or it can be broken into a number of snippets, each of which must match
-in a Boolean way to select an entry. The default depends on the variable
-`org-agenda-search-view-always-boolean'.
-Even if this is turned off (the default) you can always switch to
-Boolean search dynamically by preceding the first word with \"+\" or \"-\".
-
-The default is a direct search of the whole phrase, where each space in
-the search string can expand to an arbitrary amount of whitespace,
-including newlines.
-
-If using a Boolean search, the search string is split on whitespace and
-each snippet is searched separately, with logical AND to select an entry.
-Words prefixed with a minus must *not* occur in the entry. Words without
-a prefix or prefixed with a plus must occur in the entry. Matching is
-case-insensitive. Words are enclosed by word delimiters (i.e. they must
-match whole words, not parts of a word) if
-`org-agenda-search-view-force-full-words' is set (default is nil).
-
-Boolean search snippets enclosed by curly braces are interpreted as
-regular expressions that must or (when preceded with \"-\") must not
-match in the entry. Snippets enclosed into double quotes will be taken
-as a whole, to include whitespace.
-
-- If the search string starts with an asterisk, search only in headlines.
-- If (possibly after the leading star) the search string starts with an
- exclamation mark, this also means to look at TODO entries only, an effect
- that can also be achieved with a prefix argument.
-- If (possibly after star and exclamation mark) the search string starts
- with a colon, this will mean that the (non-regexp) snippets of the
- Boolean search must match as full words.
-
-This command searches the agenda files, and in addition the files listed
-in `org-agenda-text-search-extra-files'.
-
-\(fn &optional TODO-ONLY STRING EDIT-AT)" t nil)
-
-(autoload 'org-todo-list "org-agenda" "\
-Show all (not done) TODO entries from all agenda file in a single list.
-The prefix arg can be used to select a specific TODO keyword and limit
-the list to these. When using \\[universal-argument], you will be prompted
-for a keyword. A numeric prefix directly selects the Nth keyword in
-`org-todo-keywords-1'.
-
-\(fn ARG)" t nil)
-
-(autoload 'org-tags-view "org-agenda" "\
-Show all headlines for all `org-agenda-files' matching a TAGS criterion.
-The prefix arg TODO-ONLY limits the search to TODO entries.
-
-\(fn &optional TODO-ONLY MATCH)" t nil)
-
-(autoload 'org-agenda-list-stuck-projects "org-agenda" "\
-Create agenda view for projects that are stuck.
-Stuck projects are project that have no next actions. For the definitions
-of what a project is and how to check if it stuck, customize the variable
-`org-stuck-projects'.
-
-\(fn &rest IGNORE)" t nil)
-
-(autoload 'org-diary "org-agenda" "\
-Return diary information from org-files.
-This function can be used in a \"sexp\" diary entry in the Emacs calendar.
-It accesses org files and extracts information from those files to be
-listed in the diary. The function accepts arguments specifying what
-items should be listed. For a list of arguments allowed here, see the
-variable `org-agenda-entry-types'.
-
-The call in the diary file should look like this:
-
- &%%(org-diary) ~/path/to/some/orgfile.org
-
-Use a separate line for each org file to check. Or, if you omit the file name,
-all files listed in `org-agenda-files' will be checked automatically:
-
- &%%(org-diary)
-
-If you don't give any arguments (as in the example above), the default
-arguments (:deadline :scheduled :timestamp :sexp) are used.
-So the example above may also be written as
-
- &%%(org-diary :deadline :timestamp :sexp :scheduled)
-
-The function expects the lisp variables `entry' and `date' to be provided
-by the caller, because this is how the calendar works. Don't use this
-function from a program - use `org-agenda-get-day-entries' instead.
-
-\(fn &rest ARGS)" nil nil)
-
-(autoload 'org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item "org-agenda" "\
-Do we have a reason to ignore this TODO entry because it has a time stamp?
-
-\(fn &optional END)" nil nil)
-
-(autoload 'org-calendar-goto-agenda "org-agenda" "\
-Compute the Org-mode agenda for the calendar date displayed at the cursor.
-This is a command that has to be installed in `calendar-mode-map'.
-
-\(fn)" t nil)
-
-(autoload 'org-agenda-to-appt "org-agenda" "\
-Activate appointments found in `org-agenda-files'.
-With a \\[universal-argument] prefix, refresh the list of
-appointments.
-
-If FILTER is t, interactively prompt the user for a regular
-expression, and filter out entries that don't match it.
-
-If FILTER is a string, use this string as a regular expression
-for filtering entries out.
-
-FILTER can also be an alist with the car of each cell being
-either 'headline or 'category. For example:
-
- '((headline \"IMPORTANT\")
- (category \"Work\"))
-
-will only add headlines containing IMPORTANT or headlines
-belonging to the \"Work\" category.
-
-\(fn &optional REFRESH FILTER)" t nil)
-
-;;;***
-
-;;;### (autoloads (org-export-as-ascii org-export-region-as-ascii
-;;;;;; org-replace-region-by-ascii org-export-as-ascii-to-buffer
-;;;;;; org-export-as-utf8-to-buffer org-export-as-utf8 org-export-as-latin1-to-buffer
-;;;;;; org-export-as-latin1) "org-ascii" "lisp/org-ascii.el" (19683
-;;;;;; 36308))
-;;; Generated autoloads from lisp/org-ascii.el
-
-(autoload 'org-export-as-latin1 "org-ascii" "\
-Like `org-export-as-ascii', use latin1 encoding for special symbols.
-
-\(fn &rest ARGS)" t nil)
-
-(autoload 'org-export-as-latin1-to-buffer "org-ascii" "\
-Like `org-export-as-ascii-to-buffer', use latin1 encoding for symbols.
-
-\(fn &rest ARGS)" t nil)
-
-(autoload 'org-export-as-utf8 "org-ascii" "\
-Like `org-export-as-ascii', use use encoding for special symbols.
-
-\(fn &rest ARGS)" t nil)
-
-(autoload 'org-export-as-utf8-to-buffer "org-ascii" "\
-Like `org-export-as-ascii-to-buffer', use utf8 encoding for symbols.
-
-\(fn &rest ARGS)" t nil)
-
-(autoload 'org-export-as-ascii-to-buffer "org-ascii" "\
-Call `org-export-as-ascii` with output to a temporary buffer.
-No file is created. The prefix ARG is passed through to `org-export-as-ascii'.
-
-\(fn ARG)" t nil)
-
-(autoload 'org-replace-region-by-ascii "org-ascii" "\
-Assume the current region has org-mode syntax, and convert it to plain ASCII.
-This can be used in any buffer. For example, you could write an
-itemized list in org-mode syntax in a Mail buffer and then use this
-command to convert it.
-
-\(fn BEG END)" t nil)
-
-(autoload 'org-export-region-as-ascii "org-ascii" "\
-Convert region from BEG to END in org-mode buffer to plain ASCII.
-If prefix arg BODY-ONLY is set, omit file header, footer, and table of
-contents, and only produce the region of converted text, useful for
-cut-and-paste operations.
-If BUFFER is a buffer or a string, use/create that buffer as a target
-of the converted ASCII. If BUFFER is the symbol `string', return the
-produced ASCII as a string and leave not buffer behind. For example,
-a Lisp program could call this function in the following way:
-
- (setq ascii (org-export-region-as-ascii beg end t 'string))
-
-When called interactively, the output buffer is selected, and shown
-in a window. A non-interactive call will only return the buffer.
-
-\(fn BEG END &optional BODY-ONLY BUFFER)" t nil)
-
-(autoload 'org-export-as-ascii "org-ascii" "\
-Export the outline as a pretty ASCII file.
-If there is an active region, export only the region.
-The prefix ARG specifies how many levels of the outline should become
-underlined headlines, default is 3. Lower levels will become bulleted
-lists. When HIDDEN is non-nil, don't display the ASCII buffer.
-EXT-PLIST is a property list with external parameters overriding
-org-mode's default settings, but still inferior to file-local
-settings. When TO-BUFFER is non-nil, create a buffer with that
-name and export to that buffer. If TO-BUFFER is the symbol
-`string', don't leave any buffer behind but just return the
-resulting ASCII as a string. When BODY-ONLY is set, don't produce
-the file header and footer. When PUB-DIR is set, use this as the
-publishing directory.
-
-\(fn ARG &optional HIDDEN EXT-PLIST TO-BUFFER BODY-ONLY PUB-DIR)" t nil)
-
-;;;***
-
-;;;### (autoloads (org-attach) "org-attach" "lisp/org-attach.el"
-;;;;;; (19683 36308))
-;;; Generated autoloads from lisp/org-attach.el
-
-(autoload 'org-attach "org-attach" "\
-The dispatcher for attachment commands.
-Shows a list of commands and prompts for another key to execute a command.
-
-\(fn)" t nil)
-
-;;;***
-
-;;;### (autoloads (org-archive-subtree-default-with-confirmation
-;;;;;; org-archive-subtree-default) "org-archive" "lisp/org-archive.el"
-;;;;;; (19683 36308))
-;;; Generated autoloads from lisp/org-archive.el
-
-(autoload 'org-archive-subtree-default "org-archive" "\
-Archive the current subtree with the default command.
-This command is set with the variable `org-archive-default-command'.
-
-\(fn)" t nil)
-
-(autoload 'org-archive-subtree-default-with-confirmation "org-archive" "\
-Archive the current subtree with the default command.
-This command is set with the variable `org-archive-default-command'.
-
-\(fn)" t nil)
-
-;;;***
-
-;;;### (autoloads (org-bbdb-anniversaries) "org-bbdb" "lisp/org-bbdb.el"
-;;;;;; (19683 36308))
-;;; Generated autoloads from lisp/org-bbdb.el
-
-(autoload 'org-bbdb-anniversaries "org-bbdb" "\
-Extract anniversaries from BBDB for display in the agenda.
-
-\(fn)" nil nil)
-
-;;;***
-
-;;;### (autoloads (org-capture-import-remember-templates org-capture-insert-template-here
-;;;;;; org-capture) "org-capture" "lisp/org-capture.el" (19708 43444))
-;;; Generated autoloads from lisp/org-capture.el
-
-(autoload 'org-capture "org-capture" "\
-Capture something.
-\\<org-capture-mode-map>
-This will let you select a template from `org-capture-templates', and then
-file the newly captured information. The text is immediately inserted
-at the target location, and an indirect buffer is shown where you can
-edit it. Pressing \\[org-capture-finalize] brings you back to the previous state
-of Emacs, so that you can continue your work.
-
-When called interactively with a \\[universal-argument] prefix argument GOTO, don't capture
-anything, just go to the file/headline where the selected template
-stores its notes. With a double prefix argument \\[universal-argument] \\[universal-argument], go to the last note
-stored.
-
-When called with a `C-0' (zero) prefix, insert a template at point.
-
-Lisp programs can set KEYS to a string associated with a template in
-`org-capture-templates'. In this case, interactive selection will be
-bypassed.
-
-\(fn &optional GOTO KEYS)" t nil)
-
-(autoload 'org-capture-insert-template-here "org-capture" "\
-Not documented
-
-\(fn)" nil nil)
-
-(autoload 'org-capture-import-remember-templates "org-capture" "\
-Set org-capture-templates to be similar to `org-remember-templates'.
-
-\(fn)" t nil)
-
-;;;***
-
-;;;### (autoloads (org-clock-persistence-insinuate org-get-clocktable)
-;;;;;; "org-clock" "lisp/org-clock.el" (19708 43444))
-;;; Generated autoloads from lisp/org-clock.el
-
-(autoload 'org-get-clocktable "org-clock" "\
-Get a formatted clocktable with parameters according to PROPS.
-The table is created in a temporary buffer, fully formatted and
-fontified, and then returned.
-
-\(fn &rest PROPS)" nil nil)
-
-(autoload 'org-clock-persistence-insinuate "org-clock" "\
-Set up hooks for clock persistence.
-
-\(fn)" nil nil)
-
-;;;***
-
-;;;### (autoloads (org-datetree-find-date-create) "org-datetree"
-;;;;;; "lisp/org-datetree.el" (19683 36308))
-;;; Generated autoloads from lisp/org-datetree.el
-
-(autoload 'org-datetree-find-date-create "org-datetree" "\
-Find or create an entry for DATE.
-If KEEP-RESTRICTION is non-nil, do not widen the buffer.
-When it is nil, the buffer will be widened to make sure an existing date
-tree can be found.
-
-\(fn DATE &optional KEEP-RESTRICTION)" nil nil)
-
-;;;***
-
-;;;### (autoloads (org-insert-export-options-template org-export-as-org
-;;;;;; org-export-visible org-export) "org-exp" "lisp/org-exp.el"
-;;;;;; (19714 9624))
-;;; Generated autoloads from lisp/org-exp.el
-
-(autoload 'org-export "org-exp" "\
-Export dispatcher for Org-mode.
-When `org-export-run-in-background' is non-nil, try to run the command
-in the background. This will be done only for commands that write
-to a file. For details see the docstring of `org-export-run-in-background'.
-
-The prefix argument ARG will be passed to the exporter. However, if
-ARG is a double universal prefix \\[universal-argument] \\[universal-argument], that means to inverse the
-value of `org-export-run-in-background'.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'org-export-visible "org-exp" "\
-Create a copy of the visible part of the current buffer, and export it.
-The copy is created in a temporary buffer and removed after use.
-TYPE is the final key (as a string) that also selects the export command in
-the \\<org-mode-map>\\[org-export] export dispatcher.
-As a special case, if the you type SPC at the prompt, the temporary
-org-mode file will not be removed but presented to you so that you can
-continue to use it. The prefix arg ARG is passed through to the exporting
-command.
-
-\(fn TYPE ARG)" t nil)
-
-(autoload 'org-export-as-org "org-exp" "\
-Make a copy with not-exporting stuff removed.
-The purpose of this function is to provide a way to export the source
-Org file of a webpage in Org format, but with sensitive and/or irrelevant
-stuff removed. This command will remove the following:
-
-- archived trees (if the variable `org-export-with-archived-trees' is nil)
-- comment blocks and trees starting with the COMMENT keyword
-- only trees that are consistent with `org-export-select-tags'
- and `org-export-exclude-tags'.
-
-The only arguments that will be used are EXT-PLIST and PUB-DIR,
-all the others will be ignored (but are present so that the general
-mechanism to call publishing functions will work).
-
-EXT-PLIST is a property list with external parameters overriding
-org-mode's default settings, but still inferior to file-local
-settings. When PUB-DIR is set, use this as the publishing
-directory.
-
-\(fn ARG &optional HIDDEN EXT-PLIST TO-BUFFER BODY-ONLY PUB-DIR)" t nil)
-
-(autoload 'org-insert-export-options-template "org-exp" "\
-Insert into the buffer a template with information for exporting.
-
-\(fn)" t nil)
-
-;;;***
-
-;;;### (autoloads (org-export-as-docbook org-export-as-docbook-pdf-and-open
-;;;;;; org-export-as-docbook-pdf org-export-region-as-docbook org-replace-region-by-docbook
-;;;;;; org-export-as-docbook-to-buffer org-export-as-docbook-batch)
-;;;;;; "org-docbook" "lisp/org-docbook.el" (19683 36308))
-;;; Generated autoloads from lisp/org-docbook.el
-
-(autoload 'org-export-as-docbook-batch "org-docbook" "\
-Call `org-export-as-docbook' in batch style.
-This function can be used in batch processing.
-
-For example:
-
-$ emacs --batch
- --load=$HOME/lib/emacs/org.el
- --visit=MyOrgFile.org --funcall org-export-as-docbook-batch
-
-\(fn)" nil nil)
-
-(autoload 'org-export-as-docbook-to-buffer "org-docbook" "\
-Call `org-export-as-docbook' with output to a temporary buffer.
-No file is created.
-
-\(fn)" t nil)
-
-(autoload 'org-replace-region-by-docbook "org-docbook" "\
-Replace the region from BEG to END with its DocBook export.
-It assumes the region has `org-mode' syntax, and then convert it to
-DocBook. This can be used in any buffer. For example, you could
-write an itemized list in `org-mode' syntax in an DocBook buffer and
-then use this command to convert it.
-
-\(fn BEG END)" t nil)
-
-(autoload 'org-export-region-as-docbook "org-docbook" "\
-Convert region from BEG to END in `org-mode' buffer to DocBook.
-If prefix arg BODY-ONLY is set, omit file header and footer and
-only produce the region of converted text, useful for
-cut-and-paste operations. If BUFFER is a buffer or a string,
-use/create that buffer as a target of the converted DocBook. If
-BUFFER is the symbol `string', return the produced DocBook as a
-string and leave not buffer behind. For example, a Lisp program
-could call this function in the following way:
-
- (setq docbook (org-export-region-as-docbook beg end t 'string))
-
-When called interactively, the output buffer is selected, and shown
-in a window. A non-interactive call will only return the buffer.
-
-\(fn BEG END &optional BODY-ONLY BUFFER)" t nil)
-
-(autoload 'org-export-as-docbook-pdf "org-docbook" "\
-Export as DocBook XML file, and generate PDF file.
-
-\(fn &optional HIDDEN EXT-PLIST TO-BUFFER BODY-ONLY PUB-DIR)" t nil)
-
-(autoload 'org-export-as-docbook-pdf-and-open "org-docbook" "\
-Export as DocBook XML file, generate PDF file, and open it.
-
-\(fn)" t nil)
-
-(autoload 'org-export-as-docbook "org-docbook" "\
-Export the current buffer as a DocBook file.
-If there is an active region, export only the region. When
-HIDDEN is obsolete and does nothing. EXT-PLIST is a
-property list with external parameters overriding org-mode's
-default settings, but still inferior to file-local settings.
-When TO-BUFFER is non-nil, create a buffer with that name and
-export to that buffer. If TO-BUFFER is the symbol `string',
-don't leave any buffer behind but just return the resulting HTML
-as a string. When BODY-ONLY is set, don't produce the file
-header and footer, simply return the content of the document (all
-top-level sections). When PUB-DIR is set, use this as the
-publishing directory.
-
-\(fn &optional HIDDEN EXT-PLIST TO-BUFFER BODY-ONLY PUB-DIR)" t nil)
-
-;;;***
-
-;;;### (autoloads (org-feed-show-raw-feed org-feed-goto-inbox org-feed-update
-;;;;;; org-feed-update-all) "org-feed" "lisp/org-feed.el" (19683
-;;;;;; 36308))
-;;; Generated autoloads from lisp/org-feed.el
-
-(autoload 'org-feed-update-all "org-feed" "\
-Get inbox items from all feeds in `org-feed-alist'.
-
-\(fn)" t nil)
-
-(autoload 'org-feed-update "org-feed" "\
-Get inbox items from FEED.
-FEED can be a string with an association in `org-feed-alist', or
-it can be a list structured like an entry in `org-feed-alist'.
-
-\(fn FEED &optional RETRIEVE-ONLY)" t nil)
-
-(autoload 'org-feed-goto-inbox "org-feed" "\
-Go to the inbox that captures the feed named FEED.
-
-\(fn FEED)" t nil)
-
-(autoload 'org-feed-show-raw-feed "org-feed" "\
-Show the raw feed buffer of a feed.
-
-\(fn FEED)" t nil)
-
-;;;***
-
-;;;### (autoloads (org-footnote-normalize org-footnote-action) "org-footnote"
-;;;;;; "lisp/org-footnote.el" (19714 9624))
-;;; Generated autoloads from lisp/org-footnote.el
-
-(autoload 'org-footnote-action "org-footnote" "\
-Do the right thing for footnotes.
-When at a footnote reference, jump to the definition. When at a definition,
-jump to the references. When neither at definition or reference,
-create a new footnote, interactively.
-With prefix arg SPECIAL, offer additional commands in a menu.
-
-\(fn &optional SPECIAL)" t nil)
-
-(autoload 'org-footnote-normalize "org-footnote" "\
-Collect the footnotes in various formats and normalize them.
-This finds the different sorts of footnotes allowed in Org, and
-normalizes them to the usual [N] format that is understood by the
-Org-mode exporters.
-When SORT-ONLY is set, only sort the footnote definitions into the
-referenced sequence.
-
-\(fn &optional SORT-ONLY FOR-PREPROCESSOR)" nil nil)
-
-;;;***
-
-;;;### (autoloads (org-freemind-to-org-mode org-freemind-from-org-sparse-tree
-;;;;;; org-freemind-from-org-mode org-freemind-from-org-mode-node
-;;;;;; org-freemind-show org-export-as-freemind) "org-freemind"
-;;;;;; "lisp/org-freemind.el" (19683 36308))
-;;; Generated autoloads from lisp/org-freemind.el
-
-(autoload 'org-export-as-freemind "org-freemind" "\
-Export the current buffer as a Freemind file.
-If there is an active region, export only the region. HIDDEN is
-obsolete and does nothing. EXT-PLIST is a property list with
-external parameters overriding org-mode's default settings, but
-still inferior to file-local settings. When TO-BUFFER is
-non-nil, create a buffer with that name and export to that
-buffer. If TO-BUFFER is the symbol `string', don't leave any
-buffer behind but just return the resulting HTML as a string.
-When BODY-ONLY is set, don't produce the file header and footer,
-simply return the content of the document (all top level
-sections). When PUB-DIR is set, use this as the publishing
-directory.
-
-See `org-freemind-from-org-mode' for more information.
-
-\(fn &optional HIDDEN EXT-PLIST TO-BUFFER BODY-ONLY PUB-DIR)" t nil)
-
-(autoload 'org-freemind-show "org-freemind" "\
-Show file MM-FILE in Freemind.
-
-\(fn MM-FILE)" t nil)
-
-(autoload 'org-freemind-from-org-mode-node "org-freemind" "\
-Convert node at line NODE-LINE to the FreeMind file MM-FILE.
-See `org-freemind-from-org-mode' for more information.
-
-\(fn NODE-LINE MM-FILE)" t nil)
-
-(autoload 'org-freemind-from-org-mode "org-freemind" "\
-Convert the `org-mode' file ORG-FILE to the FreeMind file MM-FILE.
-All the nodes will be opened or closed in Freemind just as you
-have them in `org-mode'.
-
-Note that exporting to Freemind also gives you an alternative way
-to export from `org-mode' to html. You can create a dynamic html
-version of the your org file, by first exporting to Freemind and
-then exporting from Freemind to html. The 'As
-XHTML (JavaScript)' version in Freemind works very well (and you
-can use a CSS stylesheet to style it).
-
-\(fn ORG-FILE MM-FILE)" t nil)
-
-(autoload 'org-freemind-from-org-sparse-tree "org-freemind" "\
-Convert visible part of buffer ORG-BUFFER to FreeMind file MM-FILE.
-
-\(fn ORG-BUFFER MM-FILE)" t nil)
-
-(autoload 'org-freemind-to-org-mode "org-freemind" "\
-Convert FreeMind file MM-FILE to `org-mode' file ORG-FILE.
-
-\(fn MM-FILE ORG-FILE)" t nil)
-
-;;;***
-
-;;;### (autoloads (org-export-htmlize-generate-css org-export-as-html
-;;;;;; org-export-region-as-html org-replace-region-by-html org-export-as-html-to-buffer
-;;;;;; org-export-as-html-batch org-export-as-html-and-open) "org-html"
-;;;;;; "lisp/org-html.el" (19699 28931))
-;;; Generated autoloads from lisp/org-html.el
-
-(put 'org-export-html-style-include-default 'safe-local-variable 'booleanp)
-
-(put 'org-export-html-style 'safe-local-variable 'stringp)
-
-(put 'org-export-html-style-extra 'safe-local-variable 'stringp)
-
-(autoload 'org-export-as-html-and-open "org-html" "\
-Export the outline as HTML and immediately open it with a browser.
-If there is an active region, export only the region.
-The prefix ARG specifies how many levels of the outline should become
-headlines. The default is 3. Lower levels will become bulleted lists.
-
-\(fn ARG)" t nil)
-
-(autoload 'org-export-as-html-batch "org-html" "\
-Call the function `org-export-as-html'.
-This function can be used in batch processing as:
-emacs --batch
- --load=$HOME/lib/emacs/org.el
- --eval \"(setq org-export-headline-levels 2)\"
- --visit=MyFile --funcall org-export-as-html-batch
-
-\(fn)" nil nil)
-
-(autoload 'org-export-as-html-to-buffer "org-html" "\
-Call `org-export-as-html` with output to a temporary buffer.
-No file is created. The prefix ARG is passed through to `org-export-as-html'.
-
-\(fn ARG)" t nil)
-
-(autoload 'org-replace-region-by-html "org-html" "\
-Assume the current region has org-mode syntax, and convert it to HTML.
-This can be used in any buffer. For example, you could write an
-itemized list in org-mode syntax in an HTML buffer and then use this
-command to convert it.
-
-\(fn BEG END)" t nil)
-
-(autoload 'org-export-region-as-html "org-html" "\
-Convert region from BEG to END in org-mode buffer to HTML.
-If prefix arg BODY-ONLY is set, omit file header, footer, and table of
-contents, and only produce the region of converted text, useful for
-cut-and-paste operations.
-If BUFFER is a buffer or a string, use/create that buffer as a target
-of the converted HTML. If BUFFER is the symbol `string', return the
-produced HTML as a string and leave not buffer behind. For example,
-a Lisp program could call this function in the following way:
-
- (setq html (org-export-region-as-html beg end t 'string))
-
-When called interactively, the output buffer is selected, and shown
-in a window. A non-interactive call will only return the buffer.
-
-\(fn BEG END &optional BODY-ONLY BUFFER)" t nil)
-
-(autoload 'org-export-as-html "org-html" "\
-Export the outline as a pretty HTML file.
-If there is an active region, export only the region. The prefix
-ARG specifies how many levels of the outline should become
-headlines. The default is 3. Lower levels will become bulleted
-lists. HIDDEN is obsolete and does nothing.
-EXT-PLIST is a property list with external parameters overriding
-org-mode's default settings, but still inferior to file-local
-settings. When TO-BUFFER is non-nil, create a buffer with that
-name and export to that buffer. If TO-BUFFER is the symbol
-`string', don't leave any buffer behind but just return the
-resulting HTML as a string. When BODY-ONLY is set, don't produce
-the file header and footer, simply return the content of
-<body>...</body>, without even the body tags themselves. When
-PUB-DIR is set, use this as the publishing directory.
-
-\(fn ARG &optional HIDDEN EXT-PLIST TO-BUFFER BODY-ONLY PUB-DIR)" t nil)
-
-(autoload 'org-export-htmlize-generate-css "org-html" "\
-Create the CSS for all font definitions in the current Emacs session.
-Use this to create face definitions in your CSS style file that can then
-be used by code snippets transformed by htmlize.
-This command just produces a buffer that contains class definitions for all
-faces used in the current Emacs session. You can copy and paste the ones you
-need into your CSS file.
-
-If you then set `org-export-htmlize-output-type' to `css', calls to
-the function `org-export-htmlize-region-for-paste' will produce code
-that uses these same face definitions.
-
-\(fn)" t nil)
-
-;;;***
-
-;;;### (autoloads (org-export-icalendar-combine-agenda-files org-export-icalendar-all-agenda-files
-;;;;;; org-export-icalendar-this-file) "org-icalendar" "lisp/org-icalendar.el"
-;;;;;; (19683 36308))
-;;; Generated autoloads from lisp/org-icalendar.el
-
-(autoload 'org-export-icalendar-this-file "org-icalendar" "\
-Export current file as an iCalendar file.
-The iCalendar file will be located in the same directory as the Org-mode
-file, but with extension `.ics'.
-
-\(fn)" t nil)
-
-(autoload 'org-export-icalendar-all-agenda-files "org-icalendar" "\
-Export all files in the variable `org-agenda-files' to iCalendar .ics files.
-Each iCalendar file will be located in the same directory as the Org-mode
-file, but with extension `.ics'.
-
-\(fn)" t nil)
-
-(autoload 'org-export-icalendar-combine-agenda-files "org-icalendar" "\
-Export all files in `org-agenda-files' to a single combined iCalendar file.
-The file is stored under the name `org-combined-agenda-icalendar-file'.
-
-\(fn)" t nil)
-
-;;;***
-
-;;;### (autoloads (org-id-store-link org-id-find-id-file org-id-find
-;;;;;; org-id-goto org-id-get-with-outline-drilling org-id-get-with-outline-path-completion
-;;;;;; org-id-get org-id-copy org-id-get-create) "org-id" "lisp/org-id.el"
-;;;;;; (19683 36308))
-;;; Generated autoloads from lisp/org-id.el
-
-(autoload 'org-id-get-create "org-id" "\
-Create an ID for the current entry and return it.
-If the entry already has an ID, just return it.
-With optional argument FORCE, force the creation of a new ID.
-
-\(fn &optional FORCE)" t nil)
-
-(autoload 'org-id-copy "org-id" "\
-Copy the ID of the entry at point to the kill ring.
-Create an ID if necessary.
-
-\(fn)" t nil)
-
-(autoload 'org-id-get "org-id" "\
-Get the ID property of the entry at point-or-marker POM.
-If POM is nil, refer to the entry at point.
-If the entry does not have an ID, the function returns nil.
-However, when CREATE is non nil, create an ID if none is present already.
-PREFIX will be passed through to `org-id-new'.
-In any case, the ID of the entry is returned.
-
-\(fn &optional POM CREATE PREFIX)" nil nil)
-
-(autoload 'org-id-get-with-outline-path-completion "org-id" "\
-Use outline-path-completion to retrieve the ID of an entry.
-TARGETS may be a setting for `org-refile-targets' to define the eligible
-headlines. When omitted, all headlines in all agenda files are
-eligible.
-It returns the ID of the entry. If necessary, the ID is created.
-
-\(fn &optional TARGETS)" nil nil)
-
-(autoload 'org-id-get-with-outline-drilling "org-id" "\
-Use an outline-cycling interface to retrieve the ID of an entry.
-This only finds entries in the current buffer, using `org-get-location'.
-It returns the ID of the entry. If necessary, the ID is created.
-
-\(fn &optional TARGETS)" nil nil)
-
-(autoload 'org-id-goto "org-id" "\
-Switch to the buffer containing the entry with id ID.
-Move the cursor to that entry in that buffer.
-
-\(fn ID)" t nil)
-
-(autoload 'org-id-find "org-id" "\
-Return the location of the entry with the id ID.
-The return value is a cons cell (file-name . position), or nil
-if there is no entry with that ID.
-With optional argument MARKERP, return the position as a new marker.
-
-\(fn ID &optional MARKERP)" nil nil)
-
-(autoload 'org-id-find-id-file "org-id" "\
-Query the id database for the file in which this ID is located.
-
-\(fn ID)" nil nil)
-
-(autoload 'org-id-store-link "org-id" "\
-Store a link to the current entry, using its ID.
-
-\(fn)" t nil)
-
-;;;***
-
-;;;### (autoloads (org-indent-mode) "org-indent" "lisp/org-indent.el"
-;;;;;; (19714 9997))
-;;; Generated autoloads from lisp/org-indent.el
-
-(autoload 'org-indent-mode "org-indent" "\
-When active, indent text according to outline structure.
-
-Internally this works by adding `line-prefix' properties to all non-headlines.
-These properties are updated locally in idle time.
-FIXME: How to update when broken?
-
-\(fn &optional ARG)" t nil)
-
-;;;***
-
-;;;### (autoloads (org-irc-store-link) "org-irc" "lisp/org-irc.el"
-;;;;;; (19683 36308))
-;;; Generated autoloads from lisp/org-irc.el
-
-(autoload 'org-irc-store-link "org-irc" "\
-Dispatch to the appropriate function to store a link to an IRC session.
-
-\(fn)" nil nil)
-
-;;;***
-
-;;;### (autoloads (org-export-as-pdf-and-open org-export-as-pdf org-export-as-latex
-;;;;;; org-export-region-as-latex org-replace-region-by-latex org-export-as-latex-to-buffer
-;;;;;; org-export-as-latex-batch) "org-latex" "lisp/org-latex.el"
-;;;;;; (19714 9624))
-;;; Generated autoloads from lisp/org-latex.el
-
-(autoload 'org-export-as-latex-batch "org-latex" "\
-Call `org-export-as-latex', may be used in batch processing.
-For example:
-
-emacs --batch
- --load=$HOME/lib/emacs/org.el
- --eval \"(setq org-export-headline-levels 2)\"
- --visit=MyFile --funcall org-export-as-latex-batch
-
-\(fn)" nil nil)
-
-(autoload 'org-export-as-latex-to-buffer "org-latex" "\
-Call `org-export-as-latex` with output to a temporary buffer.
-No file is created. The prefix ARG is passed through to `org-export-as-latex'.
-
-\(fn ARG)" t nil)
-
-(autoload 'org-replace-region-by-latex "org-latex" "\
-Replace the region from BEG to END with its LaTeX export.
-It assumes the region has `org-mode' syntax, and then convert it to
-LaTeX. This can be used in any buffer. For example, you could
-write an itemized list in `org-mode' syntax in an LaTeX buffer and
-then use this command to convert it.
-
-\(fn BEG END)" t nil)
-
-(autoload 'org-export-region-as-latex "org-latex" "\
-Convert region from BEG to END in `org-mode' buffer to LaTeX.
-If prefix arg BODY-ONLY is set, omit file header, footer, and table of
-contents, and only produce the region of converted text, useful for
-cut-and-paste operations.
-If BUFFER is a buffer or a string, use/create that buffer as a target
-of the converted LaTeX. If BUFFER is the symbol `string', return the
-produced LaTeX as a string and leave no buffer behind. For example,
-a Lisp program could call this function in the following way:
-
- (setq latex (org-export-region-as-latex beg end t 'string))
-
-When called interactively, the output buffer is selected, and shown
-in a window. A non-interactive call will only return the buffer.
-
-\(fn BEG END &optional BODY-ONLY BUFFER)" t nil)
-
-(autoload 'org-export-as-latex "org-latex" "\
-Export current buffer to a LaTeX file.
-If there is an active region, export only the region. The prefix
-ARG specifies how many levels of the outline should become
-headlines. The default is 3. Lower levels will be exported
-depending on `org-export-latex-low-levels'. The default is to
-convert them as description lists.
-HIDDEN is obsolete and does nothing.
-EXT-PLIST is a property list with
-external parameters overriding org-mode's default settings, but
-still inferior to file-local settings. When TO-BUFFER is
-non-nil, create a buffer with that name and export to that
-buffer. If TO-BUFFER is the symbol `string', don't leave any
-buffer behind but just return the resulting LaTeX as a string.
-When BODY-ONLY is set, don't produce the file header and footer,
-simply return the content of \\begin{document}...\\end{document},
-without even the \\begin{document} and \\end{document} commands.
-when PUB-DIR is set, use this as the publishing directory.
-
-\(fn ARG &optional HIDDEN EXT-PLIST TO-BUFFER BODY-ONLY PUB-DIR)" t nil)
-
-(autoload 'org-export-as-pdf "org-latex" "\
-Export as LaTeX, then process through to PDF.
-
-\(fn ARG &optional HIDDEN EXT-PLIST TO-BUFFER BODY-ONLY PUB-DIR)" t nil)
-
-(autoload 'org-export-as-pdf-and-open "org-latex" "\
-Export as LaTeX, then process through to PDF, and open.
-
-\(fn ARG)" t nil)
-
-;;;***
-
-;;;### (autoloads (org-mobile-create-sumo-agenda org-mobile-pull
-;;;;;; org-mobile-push) "org-mobile" "lisp/org-mobile.el" (19683
-;;;;;; 36308))
-;;; Generated autoloads from lisp/org-mobile.el
-
-(autoload 'org-mobile-push "org-mobile" "\
-Push the current state of Org affairs to the WebDAV directory.
-This will create the index file, copy all agenda files there, and also
-create all custom agenda views, for upload to the mobile phone.
-
-\(fn)" t nil)
-
-(autoload 'org-mobile-pull "org-mobile" "\
-Pull the contents of `org-mobile-capture-file' and integrate them.
-Apply all flagged actions, flag entries to be flagged and then call an
-agenda view showing the flagged items.
-
-\(fn)" t nil)
-
-(autoload 'org-mobile-create-sumo-agenda "org-mobile" "\
-Create a file that contains all custom agenda views.
-
-\(fn)" t nil)
-
-;;;***
-
-;;;### (autoloads (org-publish-current-project org-publish-current-file
-;;;;;; org-publish-all org-publish) "org-publish" "lisp/org-publish.el"
-;;;;;; (19683 36308))
-;;; Generated autoloads from lisp/org-publish.el
-
-(defalias 'org-publish-project 'org-publish)
-
-(autoload 'org-publish "org-publish" "\
-Publish PROJECT.
-
-\(fn PROJECT &optional FORCE)" t nil)
-
-(autoload 'org-publish-all "org-publish" "\
-Publish all projects.
-With prefix argument, remove all files in the timestamp
-directory and force publishing all files.
-
-\(fn &optional FORCE)" t nil)
-
-(autoload 'org-publish-current-file "org-publish" "\
-Publish the current file.
-With prefix argument, force publish the file.
-
-\(fn &optional FORCE)" t nil)
-
-(autoload 'org-publish-current-project "org-publish" "\
-Publish the project associated with the current file.
-With a prefix argument, force publishing of all files in
-the project.
-
-\(fn &optional FORCE)" t nil)
-
-;;;***
-
-;;;### (autoloads (org-plot/gnuplot) "org-plot" "lisp/org-plot.el"
-;;;;;; (19683 36308))
-;;; Generated autoloads from lisp/org-plot.el
-
-(autoload 'org-plot/gnuplot "org-plot" "\
-Plot table using gnuplot. Gnuplot options can be specified with PARAMS.
-If not given options will be taken from the +PLOT
-line directly before or after the table.
-
-\(fn &optional PARAMS)" t nil)
-
-;;;***
-
-;;;### (autoloads (org-remember-handler org-remember org-remember-apply-template
-;;;;;; org-remember-annotation org-remember-insinuate) "org-remember"
-;;;;;; "lisp/org-remember.el" (19683 36308))
-;;; Generated autoloads from lisp/org-remember.el
-
-(autoload 'org-remember-insinuate "org-remember" "\
-Setup remember.el for use with Org-mode.
-
-\(fn)" nil nil)
-
-(autoload 'org-remember-annotation "org-remember" "\
-Return a link to the current location as an annotation for remember.el.
-If you are using Org-mode files as target for data storage with
-remember.el, then the annotations should include a link compatible with the
-conventions in Org-mode. This function returns such a link.
-
-\(fn)" nil nil)
-
-(autoload 'org-remember-apply-template "org-remember" "\
-Initialize *remember* buffer with template, invoke `org-mode'.
-This function should be placed into `remember-mode-hook' and in fact requires
-to be run from that hook to function properly.
-
-\(fn &optional USE-CHAR SKIP-INTERACTIVE)" nil nil)
-
-(autoload 'org-remember "org-remember" "\
-Call `remember'. If this is already a remember buffer, re-apply template.
-If there is an active region, make sure remember uses it as initial content
-of the remember buffer.
-
-When called interactively with a \\[universal-argument] prefix argument GOTO, don't remember
-anything, just go to the file/headline where the selected template usually
-stores its notes. With a double prefix argument \\[universal-argument] \\[universal-argument], go to the last
-note stored by remember.
-
-Lisp programs can set ORG-FORCE-REMEMBER-TEMPLATE-CHAR to a character
-associated with a template in `org-remember-templates'.
-
-\(fn &optional GOTO ORG-FORCE-REMEMBER-TEMPLATE-CHAR)" t nil)
-
-(autoload 'org-remember-handler "org-remember" "\
-Store stuff from remember.el into an org file.
-When the template has specified a file and a headline, the entry is filed
-there, or in the location defined by `org-default-notes-file' and
-`org-remember-default-headline'.
-\\<org-remember-mode-map>
-If no defaults have been defined, or if the current prefix argument
-is 1 (using C-1 \\[org-remember-finalize] to exit remember), an interactive
-process is used to select the target location.
-
-When the prefix is 0 (i.e. when remember is exited with C-0 \\[org-remember-finalize]),
-the entry is filed to the same location as the previous note.
-
-When the prefix is 2 (i.e. when remember is exited with C-2 \\[org-remember-finalize]),
-the entry is filed as a subentry of the entry where the clock is
-currently running.
-
-When \\[universal-argument] has been used as prefix argument, the
-note is stored and Emacs moves point to the new location of the
-note, so that editing can be continued there (similar to
-inserting \"%&\" into the template).
-
-Before storing the note, the function ensures that the text has an
-org-mode-style headline, i.e. a first line that starts with
-a \"*\". If not, a headline is constructed from the current date and
-some additional data.
-
-If the variable `org-adapt-indentation' is non-nil, the entire text is
-also indented so that it starts in the same column as the headline
-\(i.e. after the stars).
-
-See also the variable `org-reverse-note-order'.
-
-\(fn)" nil nil)
-
-;;;***
-
-;;;### (autoloads (org-table-to-lisp orgtbl-mode turn-on-orgtbl)
-;;;;;; "org-table" "lisp/org-table.el" (19683 53402))
-;;; Generated autoloads from lisp/org-table.el
-
-(autoload 'turn-on-orgtbl "org-table" "\
-Unconditionally turn on `orgtbl-mode'.
-
-\(fn)" nil nil)
-
-(autoload 'orgtbl-mode "org-table" "\
-The `org-mode' table editor as a minor mode for use in other modes.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'org-table-to-lisp "org-table" "\
-Convert the table at point to a Lisp structure.
-The structure will be a list. Each item is either the symbol `hline'
-for a horizontal separator line, or a list of field values as strings.
-The table is taken from the parameter TXT, or from the buffer at point.
-
-\(fn &optional TXT)" nil nil)
-
-;;;***
-
-;;;### (autoloads (org-export-as-taskjuggler-and-open org-export-as-taskjuggler)
-;;;;;; "org-taskjuggler" "lisp/org-taskjuggler.el" (19683 36308))
-;;; Generated autoloads from lisp/org-taskjuggler.el
-
-(autoload 'org-export-as-taskjuggler "org-taskjuggler" "\
-Export parts of the current buffer as a TaskJuggler file.
-The exporter looks for a tree with tag, property or todo that
-matches `org-export-taskjuggler-project-tag' and takes this as
-the tasks for this project. The first node of this tree defines
-the project properties such as project name and project period.
-If there is a tree with tag, property or todo that matches
-`org-export-taskjuggler-resource-tag' this three is taken as
-resources for the project. If no resources are specified, a
-default resource is created and allocated to the project. Also
-the taskjuggler project will be created with default reports as
-defined in `org-export-taskjuggler-default-reports'.
-
-\(fn)" t nil)
-
-(autoload 'org-export-as-taskjuggler-and-open "org-taskjuggler" "\
-Export the current buffer as a TaskJuggler file and open it
-with the TaskJuggler GUI.
-
-\(fn)" t nil)
-
-;;;***
-
-;;;### (autoloads (org-timer-set-timer org-timer-item org-timer-change-times-in-region
-;;;;;; org-timer org-timer-start) "org-timer" "lisp/org-timer.el"
-;;;;;; (19683 36308))
-;;; Generated autoloads from lisp/org-timer.el
-
-(autoload 'org-timer-start "org-timer" "\
-Set the starting time for the relative timer to now.
-When called with prefix argument OFFSET, prompt the user for an offset time,
-with the default taken from a timer stamp at point, if any.
-If OFFSET is a string or an integer, it is directly taken to be the offset
-without user interaction.
-When called with a double prefix arg, all timer strings in the active
-region will be shifted by a specific amount. You will be prompted for
-the amount, with the default to make the first timer string in
-the region 0:00:00.
-
-\(fn &optional OFFSET)" t nil)
-
-(autoload 'org-timer "org-timer" "\
-Insert a H:MM:SS string from the timer into the buffer.
-The first time this command is used, the timer is started. When used with
-a \\[universal-argument] prefix, force restarting the timer.
-When used with a double prefix argument \\[universal-argument], change all the timer string
-in the region by a fixed amount. This can be used to recalibrate a timer
-that was not started at the correct moment.
-
-If NO-INSERT-P is non-nil, return the string instead of inserting
-it in the buffer.
-
-\(fn &optional RESTART NO-INSERT-P)" t nil)
-
-(autoload 'org-timer-change-times-in-region "org-timer" "\
-Change all h:mm:ss time in region by a DELTA.
-
-\(fn BEG END DELTA)" t nil)
-
-(autoload 'org-timer-item "org-timer" "\
-Insert a description-type item with the current timer value.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'org-timer-set-timer "org-timer" "\
-Prompt for a duration and set a timer.
-
-If `org-timer-default-timer' is not zero, suggest this value as
-the default duration for the timer. If a timer is already set,
-prompt the user if she wants to replace it.
-
-Called with a numeric prefix argument, use this numeric value as
-the duration of the timer.
-
-Called with a `C-u' prefix arguments, use `org-timer-default-timer'
-without prompting the user for a duration.
-
-With two `C-u' prefix arguments, use `org-timer-default-timer'
-without prompting the user for a duration and automatically
-replace any running timer.
-
-\(fn &optional OPT)" t nil)
-
-;;;***
-
-;;;### (autoloads (org-export-as-xoxo) "org-xoxo" "lisp/org-xoxo.el"
-;;;;;; (19683 36308))
-;;; Generated autoloads from lisp/org-xoxo.el
-
-(autoload 'org-export-as-xoxo "org-xoxo" "\
-Export the org buffer as XOXO.
-The XOXO buffer is named *xoxo-<source buffer name>*
-
-\(fn &optional BUFFER)" t nil)
-
-;;;***
-
-;;;### (autoloads (org-babel-mark-block org-babel-previous-src-block
-;;;;;; org-babel-next-src-block org-babel-goto-named-result org-babel-goto-named-src-block
-;;;;;; org-babel-goto-src-block-head org-babel-hide-result-toggle-maybe
-;;;;;; org-babel-sha1-hash org-babel-execute-subtree org-babel-execute-buffer
-;;;;;; org-babel-map-src-blocks org-babel-open-src-block-result
-;;;;;; org-babel-switch-to-session-with-code org-babel-switch-to-session
-;;;;;; org-babel-initiate-session org-babel-load-in-session org-babel-expand-src-block
-;;;;;; org-babel-execute-src-block org-babel-pop-to-session-maybe
-;;;;;; org-babel-load-in-session-maybe org-babel-expand-src-block-maybe
-;;;;;; org-babel-execute-maybe org-babel-execute-safely-maybe) "ob"
-;;;;;; "lisp/ob.el" (19714 9624))
-;;; Generated autoloads from lisp/ob.el
-
-(autoload 'org-babel-execute-safely-maybe "ob" "\
-Not documented
-
-\(fn)" nil nil)
-
-(autoload 'org-babel-execute-maybe "ob" "\
-Not documented
-
-\(fn)" t nil)
-
-(autoload 'org-babel-expand-src-block-maybe "ob" "\
-Conditionally expand a source block.
-Detect if this is context for a org-babel src-block and if so
-then run `org-babel-expand-src-block'.
-
-\(fn)" t nil)
-
-(autoload 'org-babel-load-in-session-maybe "ob" "\
-Conditionally load a source block in a session.
-Detect if this is context for a org-babel src-block and if so
-then run `org-babel-load-in-session'.
-
-\(fn)" t nil)
-
-(autoload 'org-babel-pop-to-session-maybe "ob" "\
-Conditionally pop to a session.
-Detect if this is context for a org-babel src-block and if so
-then run `org-babel-pop-to-session'.
-
-\(fn)" t nil)
-
-(autoload 'org-babel-execute-src-block "ob" "\
-Execute the current source code block.
-Insert the results of execution into the buffer. Source code
-execution and the collection and formatting of results can be
-controlled through a variety of header arguments.
-
-With prefix argument ARG, force re-execution even if a an
-existing result cached in the buffer would otherwise have been
-returned.
-
-Optionally supply a value for INFO in the form returned by
-`org-babel-get-src-block-info'.
-
-Optionally supply a value for PARAMS which will be merged with
-the header arguments specified at the front of the source code
-block.
-
-\(fn &optional ARG INFO PARAMS)" t nil)
-
-(autoload 'org-babel-expand-src-block "ob" "\
-Expand the current source code block.
-Expand according to the source code block's header
-arguments and pop open the results in a preview buffer.
-
-\(fn &optional ARG INFO PARAMS)" t nil)
-
-(autoload 'org-babel-load-in-session "ob" "\
-Load the body of the current source-code block.
-Evaluate the header arguments for the source block before
-entering the session. After loading the body this pops open the
-session.
-
-\(fn &optional ARG INFO)" t nil)
-
-(autoload 'org-babel-initiate-session "ob" "\
-Initiate session for current code block.
-If called with a prefix argument then resolve any variable
-references in the header arguments and assign these variables in
-the session. Copy the body of the code block to the kill ring.
-
-\(fn &optional ARG INFO)" t nil)
-
-(autoload 'org-babel-switch-to-session "ob" "\
-Switch to the session of the current code block.
-Uses `org-babel-initiate-session' to start the session. If called
-with a prefix argument then this is passed on to
-`org-babel-initiate-session'.
-
-\(fn &optional ARG INFO)" t nil)
-
-(autoload 'org-babel-switch-to-session-with-code "ob" "\
-Switch to code buffer and display session.
-
-\(fn &optional ARG INFO)" t nil)
-
-(autoload 'org-babel-open-src-block-result "ob" "\
-If `point' is on a src block then open the results of the
-source code block, otherwise return nil. With optional prefix
-argument RE-RUN the source-code block is evaluated even if
-results already exist.
-
-\(fn &optional RE-RUN)" t nil)
-
-(autoload 'org-babel-map-src-blocks "ob" "\
-Evaluate BODY forms on each source-block in FILE.
-If FILE is nil evaluate BODY forms on source blocks in current
-buffer. During evaluation of BODY the following local variables
-are set relative to the currently matched code block.
-
-full-block ------- string holding the entirety of the code block
-beg-block -------- point at the beginning of the code block
-end-block -------- point at the end of the matched code block
-lang ------------- string holding the language of the code block
-beg-lang --------- point at the beginning of the lang
-end-lang --------- point at the end of the lang
-switches --------- string holding the switches
-beg-switches ----- point at the beginning of the switches
-end-switches ----- point at the end of the switches
-header-args ------ string holding the header-args
-beg-header-args -- point at the beginning of the header-args
-end-header-args -- point at the end of the header-args
-body ------------- string holding the body of the code block
-beg-body --------- point at the beginning of the body
-end-body --------- point at the end of the body
-
-\(fn FILE &rest BODY)" nil (quote macro))
-
-(autoload 'org-babel-execute-buffer "ob" "\
-Execute source code blocks in a buffer.
-Call `org-babel-execute-src-block' on every source block in
-the current buffer.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'org-babel-execute-subtree "ob" "\
-Execute source code blocks in a subtree.
-Call `org-babel-execute-src-block' on every source block in
-the current subtree.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'org-babel-sha1-hash "ob" "\
-Generate an sha1 hash based on the value of info.
-
-\(fn &optional INFO)" t nil)
-
-(autoload 'org-babel-hide-result-toggle-maybe "ob" "\
-Toggle visibility of result at point.
-
-\(fn)" t nil)
-
-(autoload 'org-babel-goto-src-block-head "ob" "\
-Go to the beginning of the current code block.
-
-\(fn)" t nil)
-
-(autoload 'org-babel-goto-named-src-block "ob" "\
-Go to a named source-code block.
-
-\(fn NAME)" t nil)
-
-(autoload 'org-babel-goto-named-result "ob" "\
-Go to a named result.
-
-\(fn NAME)" t nil)
-
-(autoload 'org-babel-next-src-block "ob" "\
-Jump to the next source block.
-With optional prefix argument ARG, jump forward ARG many source blocks.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'org-babel-previous-src-block "ob" "\
-Jump to the previous source block.
-With optional prefix argument ARG, jump backward ARG many source blocks.
-
-\(fn &optional ARG)" t nil)
-
-(autoload 'org-babel-mark-block "ob" "\
-Mark current src block
-
-\(fn)" t nil)
-
-;;;***
-
-;;;### (autoloads (org-babel-lob-get-info org-babel-lob-execute-maybe
-;;;;;; org-babel-lob-ingest) "ob-lob" "lisp/ob-lob.el" (19683 36308))
-;;; Generated autoloads from lisp/ob-lob.el
-
-(autoload 'org-babel-lob-ingest "ob-lob" "\
-Add all named source-blocks defined in FILE to
-`org-babel-library-of-babel'.
-
-\(fn &optional FILE)" t nil)
-
-(autoload 'org-babel-lob-execute-maybe "ob-lob" "\
-Execute a Library of Babel source block, if appropriate.
-Detect if this is context for a Library Of Babel source block and
-if so then run the appropriate source block from the Library.
-
-\(fn)" t nil)
-
-(autoload 'org-babel-lob-get-info "ob-lob" "\
-Return a Library of Babel function call as a string.
-
-\(fn)" nil nil)
-
-;;;***
-
-;;;### (autoloads (org-babel-tangle org-babel-tangle-file org-babel-load-file
-;;;;;; org-babel-tangle-lang-exts) "ob-tangle" "lisp/ob-tangle.el"
-;;;;;; (19699 28931))
-;;; Generated autoloads from lisp/ob-tangle.el
-
-(defvar org-babel-tangle-lang-exts '(("emacs-lisp" . "el")) "\
-Alist mapping languages to their file extensions.
-The key is the language name, the value is the string that should
-be inserted as the extension commonly used to identify files
-written in this language. If no entry is found in this list,
-then the name of the language is used.")
-
-(custom-autoload 'org-babel-tangle-lang-exts "ob-tangle" t)
-
-(autoload 'org-babel-load-file "ob-tangle" "\
-Load Emacs Lisp source code blocks in the Org-mode FILE.
-This function exports the source code using
-`org-babel-tangle' and then loads the resulting file using
-`load-file'.
-
-\(fn FILE)" t nil)
-
-(autoload 'org-babel-tangle-file "ob-tangle" "\
-Extract the bodies of source code blocks in FILE.
-Source code blocks are extracted with `org-babel-tangle'.
-Optional argument TARGET-FILE can be used to specify a default
-export file for all source blocks. Optional argument LANG can be
-used to limit the exported source code blocks by language.
-
-\(fn FILE &optional TARGET-FILE LANG)" t nil)
-
-(autoload 'org-babel-tangle "ob-tangle" "\
-Write code blocks to source-specific files.
-Extract the bodies of all source code blocks from the current
-file into their own source-specific files. Optional argument
-TARGET-FILE can be used to specify a default export file for all
-source blocks. Optional argument LANG can be used to limit the
-exported source code blocks by language.
-
-\(fn &optional TARGET-FILE LANG)" t nil)
-
-;;;***
-
-;;;### (autoloads (org-babel-describe-bindings) "ob-keys" "lisp/ob-keys.el"
-;;;;;; (19683 36308))
-;;; Generated autoloads from lisp/ob-keys.el
-
-(autoload 'org-babel-describe-bindings "ob-keys" "\
-Describe all keybindings behind `org-babel-key-prefix'.
-
-\(fn)" t nil)
-
-;;;***
-
-(provide (quote org-install))
diff --git a/.emacs.d/org-7.4/lisp/org-install.elc b/.emacs.d/org-7.4/lisp/org-install.elc
deleted file mode 100644
index de1ef9e..0000000
--- a/.emacs.d/org-7.4/lisp/org-install.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-irc.el b/.emacs.d/org-7.4/lisp/org-irc.el
deleted file mode 100644
index fba2741..0000000
--- a/.emacs.d/org-7.4/lisp/org-irc.el
+++ /dev/null
@@ -1,256 +0,0 @@
-;;; org-irc.el --- Store links to IRC sessions
-;;
-;; Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
-;;
-;; Author: Philip Jackson <emacs@shellarchive.co.uk>
-;; Keywords: erc, irc, link, org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This file implements links to an IRC session from within Org-mode.
-;; Org-mode loads this module by default - if this is not what you want,
-;; configure the variable `org-modules'.
-;;
-;; Please customize the variable `org-modules' to select
-;; extensions you would like to use, and to deselect those which you don't
-;; want.
-;;
-;; Please note that at the moment only ERC is supported. Other clients
-;; shouldn't be difficult to add though.
-;;
-;; Then set `org-irc-link-to-logs' to non-nil if you would like a
-;; file:/ type link to be created to the current line in the logs or
-;; to t if you would like to create an irc:/ style link.
-;;
-;; Links within an org buffer might look like this:
-;;
-;; [[irc:/irc.freenode.net/#emacs/bob][chat with bob in #emacs on freenode]]
-;; [[irc:/irc.freenode.net/#emacs][#emacs on freenode]]
-;; [[irc:/irc.freenode.net/]]
-;;
-;; If, when the resulting link is visited, there is no connection to a
-;; requested server then one will be created.
-
-;;; Code:
-
-(require 'org)
-
-;; Declare the function form ERC that we use.
-(declare-function erc-current-logfile "erc-log" (&optional buffer))
-(declare-function erc-prompt "erc" ())
-(declare-function erc-default-target "erc" ())
-(declare-function erc-channel-p "erc" (channel))
-(declare-function erc-buffer-filter "erc" (predicate &optional proc))
-(declare-function erc-server-buffer "erc" ())
-(declare-function erc-get-server-nickname-list "erc" ())
-(declare-function erc-cmd-JOIN "erc" (channel &optional key))
-
-(defvar org-irc-client 'erc
- "The IRC client to act on.")
-(defvar org-irc-link-to-logs nil
- "Non-nil will store a link to the logs, nil will store an irc: style link.")
-
-(defvar erc-default-port) ; dynamically scoped from erc.el
-(defvar erc-session-port) ; dynamically scoped form erc-backend.el
-(defvar erc-session-server) ; dynamically scoped form erc-backend.el
-
-;; Generic functions/config (extend these for other clients)
-
-(add-to-list 'org-store-link-functions 'org-irc-store-link)
-
-(org-add-link-type "irc" 'org-irc-visit nil)
-
-(defun org-irc-visit (link)
- "Parse LINK and dispatch to the correct function based on the client found."
- (let ((link (org-irc-parse-link link)))
- (cond
- ((eq org-irc-client 'erc)
- (org-irc-visit-erc link))
- (t
- (error "erc only known client")))))
-
-(defun org-irc-parse-link (link)
- "Parse an IRC LINK and return the attributes found.
-Parse a LINK that looks like server:port/chan/user (port, chan
-and user being optional) and return any of the port, channel or user
-attributes that are found."
- (let* ((parts (split-string link "/" t))
- (len (length parts)))
- (when (or (< len 1) (> len 3))
- (error "Failed to parse link needed 1-3 parts, got %d" len))
- (setcar parts (split-string (car parts) ":" t))
- parts))
-
-;;;###autoload
-(defun org-irc-store-link ()
- "Dispatch to the appropriate function to store a link to an IRC session."
- (cond
- ((eq major-mode 'erc-mode)
- (org-irc-erc-store-link))))
-
-(defun org-irc-elipsify-description (string &optional after)
- "Remove unnecessary white space from STRING and add ellipses if necessary.
-Strip starting and ending white space from STRING and replace any
-chars that the value AFTER with '...'"
- (let* ((after (number-to-string (or after 30)))
- (replace-map (list (cons "^[ \t]*" "")
- (cons "[ \t]*$" "")
- (cons (concat "^\\(.\\{" after
- "\\}\\).*") "\\1..."))))
- (mapc (lambda (x)
- (when (string-match (car x) string)
- (setq string (replace-match (cdr x) nil nil string))))
- replace-map)
- string))
-
-;; ERC specific functions
-
-(defun org-irc-erc-get-line-from-log (erc-line)
- "Find the best line to link to from the ERC logs given ERC-LINE as a start.
-If the user is on the ERC-prompt then search backward for the
-first non-blank line, otherwise return the current line. The
-result is a cons of the filename and search string."
- (erc-save-buffer-in-logs)
- (require 'erc-log)
- (with-current-buffer (find-file-noselect (erc-current-logfile))
- (goto-char (point-max))
- (list
- (abbreviate-file-name buffer-file-name)
- ;; can we get a '::' part?
- (if (string= erc-line (erc-prompt))
- (progn
- (goto-char (point-at-bol))
- (when (search-backward-regexp "^[^ ]" nil t)
- (buffer-substring-no-properties (point-at-bol)
- (point-at-eol))))
- (when (search-backward erc-line nil t)
- (buffer-substring-no-properties (point-at-bol)
- (point-at-eol)))))))
-
-(defun org-irc-erc-store-link ()
- "Store a link to the IRC log file or the session itself.
-Depending on the variable `org-irc-link-to-logs' store either a
-link to the log file for the current session or an irc: link to
-the session itself."
- (require 'erc-log)
- (if org-irc-link-to-logs
- (let* ((erc-line (buffer-substring-no-properties
- (point-at-bol) (point-at-eol)))
- (parsed-line (org-irc-erc-get-line-from-log erc-line)))
- (if (erc-logging-enabled nil)
- (progn
- (org-store-link-props
- :type "file"
- :description (concat "'" (org-irc-elipsify-description
- (cadr parsed-line) 20)
- "' from an IRC conversation")
- :link (concat "file:" (car parsed-line) "::"
- (cadr parsed-line)))
- t)
- (error "This ERC session is not being logged")))
- (let* ((link-text (org-irc-get-erc-link))
- (link (org-irc-parse-link link-text)))
- (if link-text
- (progn
- (org-store-link-props
- :type "irc"
- :link (org-make-link "irc:/" link-text)
- :description (concat "irc session '" link-text "'")
- :server (car (car link))
- :port (or (string-to-number (cadr (pop link))) erc-default-port)
- :nick (pop link))
- t)
- (error "Failed to create ('irc:/' style) ERC link")))))
-
-(defun org-irc-get-erc-link ()
- "Return an org compatible irc:/ link from an ERC buffer."
- (let* ((session-port (if (numberp erc-session-port)
- (number-to-string erc-session-port)
- erc-session-port))
- (link (concat erc-session-server ":" session-port)))
- (concat link "/"
- (if (and (erc-default-target)
- (erc-channel-p (erc-default-target))
- (car (get-text-property (point) 'erc-data)))
- ;; we can get a nick
- (let ((nick (car (get-text-property (point) 'erc-data))))
- (concat (erc-default-target) "/" nick))
- (erc-default-target)))))
-
-(defun org-irc-get-current-erc-port ()
- "Return the current port as a number.
-Return the current port number or, if none is set, return the ERC
-default."
- (cond
- ((stringp erc-session-port)
- (string-to-number erc-session-port))
- ((numberp erc-session-port)
- erc-session-port)
- (t
- erc-default-port)))
-
-(defun org-irc-visit-erc (link)
- "Visit an ERC buffer based on criteria found in LINK."
- (require 'erc)
- (require 'erc-log)
- (let* ((server (car (car link)))
- (port (or (string-to-number (cadr (pop link))) erc-default-port))
- (server-buffer)
- (buffer-list
- (erc-buffer-filter
- (lambda nil
- (let ((tmp-server-buf (erc-server-buffer)))
- (and tmp-server-buf
- (with-current-buffer tmp-server-buf
- (and
- (eq (org-irc-get-current-erc-port) port)
- (string= erc-session-server server)
- (setq server-buffer tmp-server-buf)))))))))
- (if buffer-list
- (let ((chan-name (pop link)))
- ;; if we got a channel name then switch to it or join it
- (if chan-name
- (let ((chan-buf (catch 'found
- (dolist (x buffer-list)
- (if (string= (buffer-name x) chan-name)
- (throw 'found x))))))
- (if chan-buf
- (progn
- (switch-to-buffer chan-buf)
- ;; if we got a nick, and they're in the chan,
- ;; then start a chat with them
- (let ((nick (pop link)))
- (when nick
- (if (member nick (erc-get-server-nickname-list))
- (progn
- (goto-char (point-max))
- (insert (concat nick ": ")))
- (error "%s not found in %s" nick chan-name)))))
- (progn
- (switch-to-buffer server-buffer)
- (erc-cmd-JOIN chan-name))))
- (switch-to-buffer server-buffer)))
- ;; no server match, make new connection
- (erc-select :server server :port port))))
-
-(provide 'org-irc)
-
-;; arch-tag: 018d7dda-53b8-4a35-ba92-6670939e525a
-
-;;; org-irc.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-irc.elc b/.emacs.d/org-7.4/lisp/org-irc.elc
deleted file mode 100644
index 89b01d2..0000000
--- a/.emacs.d/org-7.4/lisp/org-irc.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-jsinfo.el b/.emacs.d/org-7.4/lisp/org-jsinfo.el
deleted file mode 100644
index e5c65b0..0000000
--- a/.emacs.d/org-7.4/lisp/org-jsinfo.el
+++ /dev/null
@@ -1,210 +0,0 @@
-;;; org-jsinfo.el --- Support for org-info.js Javascript in Org HTML export
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file implements the support for Sebastian Rose's JavaScript
-;; org-info.js to display an org-mode file exported to HTML in an
-;; Info-like way, or using folding similar to the outline structure
-;; org org-mode itself.
-
-;; Documentation for using this module is in the Org manual. The script
-;; itself is documented by Sebastian Rose in a file distributed with
-;; the script. FIXME: Accurate pointers!
-
-;; Org-mode loads this module by default - if this is not what you want,
-;; configure the variable `org-modules'.
-
-;;; Code:
-
-(require 'org-exp)
-(require 'org-html)
-
-(add-to-list 'org-export-inbuffer-options-extra '("INFOJS_OPT" :infojs-opt))
-(add-hook 'org-export-options-filters 'org-infojs-handle-options)
-
-(defgroup org-infojs nil
- "Options specific for using org-info.js in HTML export of Org-mode files."
- :tag "Org Export HTML INFOJS"
- :group 'org-export-html)
-
-(defcustom org-export-html-use-infojs 'when-configured
- "Should Sebastian Rose's Java Script org-info.js be linked into HTML files?
-This option can be nil or t to never or always use the script. It can
-also be the symbol `when-configured', meaning that the script will be
-linked into the export file if and only if there is a \"#+INFOJS_OPT:\"
-line in the buffer. See also the variable `org-infojs-options'."
- :group 'org-export-html
- :group 'org-infojs
- :type '(choice
- (const :tag "Never" nil)
- (const :tag "When configured in buffer" when-configured)
- (const :tag "Always" t)))
-
-(defconst org-infojs-opts-table
- '((path PATH "http://orgmode.org/org-info.js")
- (view VIEW "info")
- (toc TOC :table-of-contents)
- (ftoc FIXED_TOC "0")
- (tdepth TOC_DEPTH "max")
- (sdepth SECTION_DEPTH "max")
- (mouse MOUSE_HINT "underline")
- (buttons VIEW_BUTTONS "0")
- (ltoc LOCAL_TOC "1")
- (up LINK_UP :link-up)
- (home LINK_HOME :link-home))
- "JavaScript options, long form for script, default values.")
-
-(defvar org-infojs-options)
-(when (and (boundp 'org-infojs-options)
- (assq 'runs org-infojs-options))
- (setq org-infojs-options (delq (assq 'runs org-infojs-options)
- org-infojs-options)))
-
-(defcustom org-infojs-options
- (mapcar (lambda (x) (cons (car x) (nth 2 x)))
- org-infojs-opts-table)
- "Options settings for the INFOJS JavaScript.
-Each of the options must have an entry in `org-export-html/infojs-opts-table'.
-The value can either be a string that will be passed to the script, or
-a property. This property is then assumed to be a property that is defined
-by the Export/Publishing setup of Org.
-The `sdepth' and `tdepth' parameters can also be set to \"max\", which
-means to use the maximum value consistent with other options."
- :group 'org-infojs
- :type
- `(set :greedy t :inline t
- ,@(mapcar
- (lambda (x)
- (list 'cons (list 'const (car x))
- '(choice
- (symbol :tag "Publishing/Export property")
- (string :tag "Value"))))
- org-infojs-opts-table)))
-
-(defcustom org-infojs-template
- "<script type=\"text/javascript\" src=\"%SCRIPT_PATH\"></script>
-<script type=\"text/javascript\" >
-<!--/*--><![CDATA[/*><!--*/
-%MANAGER_OPTIONS
-org_html_manager.setup(); // activate after the parameters are set
-/*]]>*///-->
-</script>"
- "The template for the export style additions when org-info.js is used.
-Option settings will replace the %MANAGER-OPTIONS cookie."
- :group 'org-infojs
- :type 'string)
-
-(defun org-infojs-handle-options (exp-plist)
- "Analyze JavaScript options in INFO-PLIST and modify EXP-PLIST accordingly."
- (if (or (not org-export-html-use-infojs)
- (and (eq org-export-html-use-infojs 'when-configured)
- (or (not (plist-get exp-plist :infojs-opt))
- (string-match "\\<view:nil\\>"
- (plist-get exp-plist :infojs-opt)))))
- ;; We do not want to use the script
- exp-plist
- ;; We do want to use the script, set it up
- (let ((template org-infojs-template)
- (ptoc (plist-get exp-plist :table-of-contents))
- (hlevels (plist-get exp-plist :headline-levels))
- tdepth sdepth s v e opt var val table default)
- (setq sdepth hlevels
- tdepth hlevels)
- (if (integerp ptoc) (setq tdepth (min ptoc tdepth)))
- (setq v (plist-get exp-plist :infojs-opt)
- table org-infojs-opts-table)
- (while (setq e (pop table))
- (setq opt (car e) var (nth 1 e)
- default (cdr (assoc opt org-infojs-options)))
- (and (symbolp default) (not (memq default '(t nil)))
- (setq default (plist-get exp-plist default)))
- (if (and v (string-match (format " %s:\\(\\S-+\\)" opt) v))
- (setq val (match-string 1 v))
- (setq val default))
- (cond
- ((eq opt 'path)
- (and (string-match "%SCRIPT_PATH" template)
- (setq template (replace-match val t t template))))
- ((eq opt 'sdepth)
- (if (integerp (read val))
- (setq sdepth (min (read val) hlevels))))
- ((eq opt 'tdepth)
- (if (integerp (read val))
- (setq tdepth (min (read val) hlevels))))
- (t
- (setq val
- (cond
- ((or (eq val t) (equal val "t")) "1")
- ((or (eq val nil) (equal val "nil")) "0")
- ((stringp val) val)
- (t (format "%s" val))))
- (push (cons var val) s))))
-
- ;; Now we set the depth of the *generated* TOC to SDEPTH, because the
- ;; toc will actually determine the splitting. How much of the toc will
- ;; actually be displayed is governed by the TDEPTH option.
- (setq exp-plist (plist-put exp-plist :table-of-contents sdepth))
-
- ;; The table of contents should not show more sections then we generate
- (setq tdepth (min tdepth sdepth))
- (push (cons "TOC_DEPTH" tdepth) s)
-
- (setq s (mapconcat
- (lambda (x) (format "org_html_manager.set(\"%s\", \"%s\");"
- (car x) (cdr x)))
- s "\n"))
- (when (and s (> (length s) 0))
- (and (string-match "%MANAGER_OPTIONS" template)
- (setq s (replace-match s t t template))
- (setq exp-plist
- (plist-put
- exp-plist :style-extra
- (concat (or (plist-get exp-plist :style-extra) "") "\n" s)))))
- ;; This script absolutely needs the table of contents, to we change that
- ;; setting
- (if (not (plist-get exp-plist :table-of-contents))
- (setq exp-plist (plist-put exp-plist :table-of-contents t)))
- ;; Return the modified property list
- exp-plist)))
-
-(defun org-infojs-options-inbuffer-template ()
- (format "#+INFOJS_OPT: view:%s toc:%s ltoc:%s mouse:%s buttons:%s path:%s"
- (if (eq t org-export-html-use-infojs) (cdr (assoc 'view org-infojs-options)) nil)
- (let ((a (cdr (assoc 'toc org-infojs-options))))
- (cond ((memq a '(nil t)) a)
- (t (plist-get (org-infile-export-plist) :table-of-contents))))
- (if (equal (cdr (assoc 'ltoc org-infojs-options)) "1") t nil)
- (cdr (assoc 'mouse org-infojs-options))
- (cdr (assoc 'buttons org-infojs-options))
- (cdr (assoc 'path org-infojs-options))))
-
-(provide 'org-infojs)
-(provide 'org-jsinfo)
-
-;; arch-tag: c71d1d85-3337-4817-a066-725e74ac9eac
-
-;;; org-jsinfo.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-jsinfo.elc b/.emacs.d/org-7.4/lisp/org-jsinfo.elc
deleted file mode 100644
index be7086f..0000000
--- a/.emacs.d/org-7.4/lisp/org-jsinfo.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-latex.el b/.emacs.d/org-7.4/lisp/org-latex.el
deleted file mode 100644
index a29c9f3..0000000
--- a/.emacs.d/org-7.4/lisp/org-latex.el
+++ /dev/null
@@ -1,2578 +0,0 @@
-;;; org-latex.el --- LaTeX exporter for org-mode
-;;
-;; Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-;;
-;; Emacs Lisp Archive Entry
-;; Filename: org-latex.el
-;; Version: 7.4
-;; Author: Bastien Guerry <bzg AT altern DOT org>
-;; Maintainer: Carsten Dominik <carsten.dominik AT gmail DOT com>
-;; Keywords: org, wp, tex
-;; Description: Converts an org-mode buffer into LaTeX
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-;;
-;; This library implements a LaTeX exporter for org-mode.
-;;
-;; It is part of Org and will be autoloaded
-;;
-;; The interactive functions are similar to those of the HTML exporter:
-;;
-;; M-x `org-export-as-latex'
-;; M-x `org-export-as-pdf'
-;; M-x `org-export-as-pdf-and-open'
-;; M-x `org-export-as-latex-batch'
-;; M-x `org-export-as-latex-to-buffer'
-;; M-x `org-export-region-as-latex'
-;; M-x `org-replace-region-by-latex'
-;;
-;;; Code:
-
-(eval-when-compile
- (require 'cl))
-
-(require 'footnote)
-(require 'org)
-(require 'org-exp)
-(require 'org-macs)
-(require 'org-beamer)
-
-;;; Variables:
-(defvar org-export-latex-class nil)
-(defvar org-export-latex-class-options nil)
-(defvar org-export-latex-header nil)
-(defvar org-export-latex-append-header nil)
-(defvar org-export-latex-options-plist nil)
-(defvar org-export-latex-todo-keywords-1 nil)
-(defvar org-export-latex-complex-heading-re nil)
-(defvar org-export-latex-not-done-keywords nil)
-(defvar org-export-latex-done-keywords nil)
-(defvar org-export-latex-display-custom-times nil)
-(defvar org-export-latex-all-targets-re nil)
-(defvar org-export-latex-add-level 0)
-(defvar org-export-latex-sectioning "")
-(defvar org-export-latex-sectioning-depth 0)
-(defvar org-export-latex-special-keyword-regexp
- (concat "\\<\\(" org-scheduled-string "\\|"
- org-deadline-string "\\|"
- org-closed-string"\\)")
- "Regexp matching special time planning keywords plus the time after it.")
-
-(defvar latexp) ; dynamically scoped from org.el
-(defvar re-quote) ; dynamically scoped from org.el
-(defvar commentsp) ; dynamically scoped from org.el
-
-;;; User variables:
-
-(defgroup org-export-latex nil
- "Options for exporting Org-mode files to LaTeX."
- :tag "Org Export LaTeX"
- :group 'org-export)
-
-(defcustom org-export-latex-default-class "article"
- "The default LaTeX class."
- :group 'org-export-latex
- :type '(string :tag "LaTeX class"))
-
-(defcustom org-export-latex-classes
- '(("article"
- "\\documentclass[11pt]{article}"
- ("\\section{%s}" . "\\section*{%s}")
- ("\\subsection{%s}" . "\\subsection*{%s}")
- ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
- ("\\paragraph{%s}" . "\\paragraph*{%s}")
- ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
- ("report"
- "\\documentclass[11pt]{report}"
- ("\\part{%s}" . "\\part*{%s}")
- ("\\chapter{%s}" . "\\chapter*{%s}")
- ("\\section{%s}" . "\\section*{%s}")
- ("\\subsection{%s}" . "\\subsection*{%s}")
- ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
- ("book"
- "\\documentclass[11pt]{book}"
- ("\\part{%s}" . "\\part*{%s}")
- ("\\chapter{%s}" . "\\chapter*{%s}")
- ("\\section{%s}" . "\\section*{%s}")
- ("\\subsection{%s}" . "\\subsection*{%s}")
- ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
- ("beamer"
- "\\documentclass{beamer}"
- org-beamer-sectioning
- ))
- "Alist of LaTeX classes and associated header and structure.
-If #+LaTeX_CLASS is set in the buffer, use its value and the
-associated information. Here is the structure of each cell:
-
- \(class-name
- header-string
- (numbered-section . unnumbered-section\)
- ...\)
-
-The header string
------------------
-
-The HEADER-STRING is the header that will be inserted into the LaTeX file.
-It should contain the \\documentclass macro, and anything else that is needed
-for this setup. To this header, the following commands will be added:
-
-- Calls to \\usepackage for all packages mentioned in the variables
- `org-export-latex-default-packages-alist' and
- `org-export-latex-packages-alist'. Thus, your header definitions should
- avoid to also request these packages.
-
-- Lines specified via \"#+LaTeX_HEADER:\"
-
-If you need more control about the sequence in which the header is built
-up, or if you want to exclude one of these building blocks for a particular
-class, you can use the following macro-like placeholders.
-
- [DEFAULT-PACKAGES] \\usepackage statements for default packages
- [NO-DEFAULT-PACKAGES] do not include any of the default packages
- [PACKAGES] \\usepackage statements for packages
- [NO-PACKAGES] do not include the packages
- [EXTRA] the stuff from #+LaTeX_HEADER
- [NO-EXTRA] do not include #+LaTeX_HEADER stuff
- [BEAMER-HEADER-EXTRA] the beamer extra headers
-
-So a header like
-
- \\documentclass{article}
- [NO-DEFAULT-PACKAGES]
- [EXTRA]
- \\providecommand{\\alert}[1]{\\textbf{#1}}
- [PACKAGES]
-
-will omit the default packages, and will include the #+LaTeX_HEADER lines,
-then have a call to \\providecommand, and then place \\usepackage commands
-based on the content of `org-export-latex-packages-alist'.
-
-If your header or `org-export-latex-default-packages-alist' inserts
-\"\\usepackage[AUTO]{inputenc}\", AUTO will automatically be replaced with
-a coding system derived from `buffer-file-coding-system'. See also the
-variable `org-export-latex-inputenc-alist' for a way to influence this
-mechanism.
-
-The sectioning structure
-------------------------
-
-The sectioning structure of the class is given by the elements following
-the header string. For each sectioning level, a number of strings is
-specified. A %s formatter is mandatory in each section string and will
-be replaced by the title of the section.
-
-Instead of a cons cell (numbered . unnumbered), you can also provide a list
-of 2 or 4 elements,
-
- (numbered-open numbered-close)
-
-or
-
- (numbered-open numbered-close unnumbered-open unnumbered-close)
-
-providing opening and closing strings for a LaTeX environment that should
-represent the document section. The opening clause should have a %s
-to represent the section title.
-
-Instead of a list of sectioning commands, you can also specify a
-function name. That function will be called with two parameters,
-the (reduced) level of the headline, and the headline text. The function
-must return a cons cell with the (possibly modified) headline text, and the
-sectioning list in the cdr."
- :group 'org-export-latex
- :type '(repeat
- (list (string :tag "LaTeX class")
- (string :tag "LaTeX header")
- (repeat :tag "Levels" :inline t
- (choice
- (cons :tag "Heading"
- (string :tag " numbered")
- (string :tag "unnumbered"))
- (list :tag "Environment"
- (string :tag "Opening (numbered)")
- (string :tag "Closing (numbered)")
- (string :tag "Opening (unnumbered)")
- (string :tag "Closing (unnumbered)"))
- (function :tag "Hook computing sectioning"))))))
-
-(defcustom org-export-latex-inputenc-alist nil
- "Alist of inputenc coding system names, and what should really be used.
-For example, adding an entry
-
- (\"utf8\" . \"utf8x\")
-
-will cause \\usepackage[utf8x]{inputenc} to be used for buffers that
-are written as utf8 files."
- :group 'org-export-latex
- :type '(repeat
- (cons
- (string :tag "Derived from buffer")
- (string :tag "Use this instead"))))
-
-
-(defcustom org-export-latex-emphasis-alist
- '(("*" "\\textbf{%s}" nil)
- ("/" "\\emph{%s}" nil)
- ("_" "\\underline{%s}" nil)
- ("+" "\\st{%s}" nil)
- ("=" "\\verb" t)
- ("~" "\\verb" t))
- "Alist of LaTeX expressions to convert emphasis fontifiers.
-Each element of the list is a list of three elements.
-The first element is the character used as a marker for fontification.
-The second element is a formatting string to wrap fontified text with.
-If it is \"\\verb\", Org will automatically select a delimiter
-character that is not in the string.
-The third element decides whether to protect converted text from other
-conversions."
- :group 'org-export-latex
- :type 'alist)
-
-(defcustom org-export-latex-title-command "\\maketitle"
- "The command used to insert the title just after \\begin{document}.
-If this string contains the formatting specification \"%s\" then
-it will be used as a formatting string, passing the title as an
-argument."
- :group 'org-export-latex
- :type 'string)
-
-(defcustom org-export-latex-import-inbuffer-stuff nil
- "Non-nil means define TeX macros for Org's inbuffer definitions.
-For example \orgTITLE for #+TITLE."
- :group 'org-export-latex
- :type 'boolean)
-
-(defcustom org-export-latex-date-format
- "%d %B %Y"
- "Format string for \\date{...}."
- :group 'org-export-latex
- :type 'string)
-
-(defcustom org-export-latex-todo-keyword-markup "\\textbf{%s}"
- "Markup for TODO keywords, as a printf format.
-This can be a single format for all keywords, a cons cell with separate
-formats for not-done and done states, or an association list with setup
-for individual keywords. If a keyword shows up for which there is no
-markup defined, the first one in the association list will be used."
- :group 'org-export-latex
- :type '(choice
- (string :tag "Default")
- (cons :tag "Distinguish undone and done"
- (string :tag "Not-DONE states")
- (string :tag "DONE states"))
- (repeat :tag "Per keyword markup"
- (cons
- (string :tag "Keyword")
- (string :tag "Markup")))))
-
-(defcustom org-export-latex-tag-markup "\\textbf{%s}"
- "Markup for tags, as a printf format."
- :group 'org-export-latex
- :type 'string)
-
-(defcustom org-export-latex-timestamp-markup "\\textit{%s}"
- "A printf format string to be applied to time stamps."
- :group 'org-export-latex
- :type 'string)
-
-(defcustom org-export-latex-timestamp-keyword-markup "\\texttt{%s}"
- "A printf format string to be applied to time stamps."
- :group 'org-export-latex
- :type 'string)
-
-(defcustom org-export-latex-href-format "\\href{%s}{%s}"
- "A printf format string to be applied to href links.
-The format must contain two %s instances. The first will be filled with
-the link, the second with the link description."
- :group 'org-export-latex
- :type 'string)
-
-(defcustom org-export-latex-hyperref-format "\\hyperref[%s]{%s}"
- "A printf format string to be applied to hyperref links.
-The format must contain two %s instances. The first will be filled with
-the link, the second with the link description."
- :group 'org-export-latex
- :type 'string)
-
-(defcustom org-export-latex-tables-verbatim nil
- "When non-nil, tables are exported verbatim."
- :group 'org-export-latex
- :type 'boolean)
-
-(defcustom org-export-latex-tables-centered t
- "When non-nil, tables are exported in a center environment."
- :group 'org-export-latex
- :type 'boolean)
-
-(defcustom org-export-latex-tables-column-borders nil
- "When non-nil, grouping columns can cause outer vertical lines in tables.
-When nil, grouping causes only separation lines between groups."
- :group 'org-export-latex
- :type 'boolean)
-
-(defcustom org-export-latex-low-levels 'itemize
- "How to convert sections below the current level of sectioning.
-This is specified by the `org-export-headline-levels' option or the
-value of \"H:\" in Org's #+OPTION line.
-
-This can be either nil (skip the sections), `description', `itemize',
-or `enumerate' (convert the sections as the corresponding list type), or
-a string to be used instead of \\section{%s}. In this latter case,
-the %s stands here for the inserted headline and is mandatory.
-
-It may also be a list of three string to define a user-defined environment
-that should be used. The first string should be the like
-\"\\begin{itemize}\", the second should be like \"\\item %s %s\" with up
-to two occurrences of %s for the title and a label, respectively. The third
-string should be like \"\\end{itemize\"."
- :group 'org-export-latex
- :type '(choice (const :tag "Ignore" nil)
- (const :tag "Convert as descriptive list" description)
- (const :tag "Convert as itemized list" itemize)
- (const :tag "Convert as enumerated list" enumerate)
- (list :tag "User-defined environment"
- :value ("\\begin{itemize}" "\\end{itemize}" "\\item %s")
- (string :tag "Start")
- (string :tag "End")
- (string :tag "item"))
- (string :tag "Use a section string" :value "\\subparagraph{%s}")))
-
-(defcustom org-export-latex-list-parameters
- '(:cbon "$\\boxtimes$" :cboff "$\\Box$")
- "Parameters for the LaTeX list exporter.
-These parameters will be passed on to `org-list-to-latex', which in turn
-will pass them (combined with the LaTeX default list parameters) to
-`org-list-to-generic'."
- :group 'org-export-latex
- :type 'plist)
-
-(defcustom org-export-latex-verbatim-wrap
- '("\\begin{verbatim}\n" . "\\end{verbatim}\n")
- "Environment to be wrapped around a fixed-width section in LaTeX export.
-This is a cons with two strings, to be added before and after the
-fixed-with text.
-
-Defaults to \\begin{verbatim} and \\end{verbatim}."
- :group 'org-export-translation
- :group 'org-export-latex
- :type '(cons (string :tag "Open")
- (string :tag "Close")))
-
-(defcustom org-export-latex-listings nil
- "Non-nil means export source code using the listings package.
-This package will fontify source code, possibly even with color.
-If you want to use this, you also need to make LaTeX use the
-listings package, and if you want to have color, the color
-package. Just add these to `org-export-latex-packages-alist',
-for example using customize, or with something like
-
- (require 'org-latex)
- (add-to-list 'org-export-latex-packages-alist '(\"\" \"listings\"))
- (add-to-list 'org-export-latex-packages-alist '(\"\" \"color\"))
-
-Alternatively,
-
- (setq org-export-latex-listings 'minted)
-
-causes source code to be exported using the minted package as
-opposed to listings. If you want to use minted, you need to add
-the minted package to `org-export-latex-packages-alist', for
-example using customize, or with
-
- (require 'org-latex)
- (add-to-list 'org-export-latex-packages-alist '(\"\" \"minted\"))
-
-In addition, it is neccessary to install
-pygments (http://pygments.org), and to configure
-`org-latex-to-pdf-process' so that the -shell-escape option is
-passed to pdflatex.
-"
- :group 'org-export-latex
- :type 'boolean)
-
-(defcustom org-export-latex-listings-langs
- '((emacs-lisp "Lisp") (lisp "Lisp") (clojure "Lisp")
- (c "C") (cc "C++")
- (fortran "fortran")
- (perl "Perl") (cperl "Perl") (python "Python") (ruby "Ruby")
- (html "HTML") (xml "XML")
- (tex "TeX") (latex "TeX")
- (shell-script "bash")
- (gnuplot "Gnuplot")
- (ocaml "Caml") (caml "Caml")
- (sql "SQL") (sqlite "sql"))
- "Alist mapping languages to their listing language counterpart.
-The key is a symbol, the major mode symbol without the \"-mode\".
-The value is the string that should be inserted as the language parameter
-for the listings package. If the mode name and the listings name are
-the same, the language does not need an entry in this list - but it does not
-hurt if it is present."
- :group 'org-export-latex
- :type '(repeat
- (list
- (symbol :tag "Major mode ")
- (string :tag "Listings language"))))
-
-(defcustom org-export-latex-listings-w-names t
- "Non-nil means export names of named code blocks.
-Code blocks exported with the listings package (controlled by the
-`org-export-latex-listings' variable) can be named in the style
-of noweb."
- :group 'org-export-latex
- :type 'boolean)
-
-(defcustom org-export-latex-minted-langs
- '((emacs-lisp "common-lisp")
- (cc "c++")
- (cperl "perl")
- (shell-script "bash")
- (caml "ocaml"))
- "Alist mapping languages to their minted language counterpart.
-The key is a symbol, the major mode symbol without the \"-mode\".
-The value is the string that should be inserted as the language parameter
-for the minted package. If the mode name and the listings name are
-the same, the language does not need an entry in this list - but it does not
-hurt if it is present.
-
-Note that minted uses all lower case for language identifiers,
-and that the full list of language identifiers can be obtained
-with:
-pygmentize -L lexers
-"
- :group 'org-export-latex
- :type '(repeat
- (list
- (symbol :tag "Major mode ")
- (string :tag "Listings language"))))
-
-(defcustom org-export-latex-remove-from-headlines
- '(:todo nil :priority nil :tags nil)
- "A plist of keywords to remove from headlines. OBSOLETE.
-Non-nil means remove this keyword type from the headline.
-
-Don't remove the keys, just change their values.
-
-Obsolete, this variable is no longer used. Use the separate
-variables `org-export-with-todo-keywords', `org-export-with-priority',
-and `org-export-with-tags' instead."
- :type 'plist
- :group 'org-export-latex)
-
-(defcustom org-export-latex-image-default-option "width=10em"
- "Default option for images."
- :group 'org-export-latex
- :type 'string)
-
-(defcustom org-export-latex-tabular-environment "tabular"
- "Default environment used to build tables."
- :group 'org-export-latex
- :type 'string)
-
-(defcustom org-export-latex-inline-image-extensions
- '("pdf" "jpeg" "jpg" "png" "ps" "eps")
- "Extensions of image files that can be inlined into LaTeX.
-Note that the image extension *actually* allowed depend on the way the
-LaTeX file is processed. When used with pdflatex, pdf, jpg and png images
-are OK. When processing through dvi to Postscript, only ps and eps are
-allowed. The default we use here encompasses both."
- :group 'org-export-latex
- :type '(repeat (string :tag "Extension")))
-
-(defcustom org-export-latex-coding-system nil
- "Coding system for the exported LaTeX file."
- :group 'org-export-latex
- :type 'coding-system)
-
-(defgroup org-export-pdf nil
- "Options for exporting Org-mode files to PDF, via LaTeX."
- :tag "Org Export PDF"
- :group 'org-export-latex
- :group 'org-export)
-
-(defcustom org-latex-to-pdf-process
- '("pdflatex -interaction nonstopmode -output-directory %o %f"
- "pdflatex -interaction nonstopmode -output-directory %o %f"
- "pdflatex -interaction nonstopmode -output-directory %o %f")
- "Commands to process a LaTeX file to a PDF file.
-This is a list of strings, each of them will be given to the shell
-as a command. %f in the command will be replaced by the full file name, %b
-by the file base name (i.e. without extension) and %o by the base directory
-of the file.
-
-The reason why this is a list is that it usually takes several runs of
-`pdflatex', maybe mixed with a call to `bibtex'. Org does not have a clever
-mechanism to detect which of these commands have to be run to get to a stable
-result, and it also does not do any error checking.
-
-By default, Org uses 3 runs of `pdflatex' to do the processing. If you
-have texi2dvi on your system and if that does not cause the infamous
-egrep/locale bug:
-
- http://lists.gnu.org/archive/html/bug-texinfo/2010-03/msg00031.html
-
-then `texi2dvi' is the superior choice. Org does offer it as one
-of the customize options.
-
-Alternatively, this may be a Lisp function that does the processing, so you
-could use this to apply the machinery of AUCTeX or the Emacs LaTeX mode.
-This function should accept the file name as its single argument."
- :group 'org-export-pdf
- :type '(choice
- (repeat :tag "Shell command sequence"
- (string :tag "Shell command"))
- (const :tag "2 runs of pdflatex"
- ("pdflatex -interaction nonstopmode -output-directory %o %f"
- "pdflatex -interaction nonstopmode -output-directory %o %f"))
- (const :tag "3 runs of pdflatex"
- ("pdflatex -interaction nonstopmode -output-directory %o %f"
- "pdflatex -interaction nonstopmode -output-directory %o %f"
- "pdflatex -interaction nonstopmode -output-directory %o %f"))
- (const :tag "pdflatex,bibtex,pdflatex,pdflatex"
- ("pdflatex -interaction nonstopmode -output-directory %o %f"
- "bibtex %b"
- "pdflatex -interaction nonstopmode -output-directory %o %f"
- "pdflatex -interaction nonstopmode -output-directory %o %f"))
- (const :tag "texi2dvi"
- ("texi2dvi -p -b -c -V %f"))
- (const :tag "rubber"
- ("rubber -d --into %o %f"))
- (function)))
-
-(defcustom org-export-pdf-logfiles
- '("aux" "idx" "log" "out" "toc" "nav" "snm" "vrb")
- "The list of file extensions to consider as LaTeX logfiles."
- :group 'org-export-pdf
- :type '(repeat (string :tag "Extension")))
-
-(defcustom org-export-pdf-remove-logfiles t
- "Non-nil means remove the logfiles produced by PDF production.
-These are the .aux, .log, .out, and .toc files."
- :group 'org-export-pdf
- :type 'boolean)
-
-;;; Hooks
-
-(defvar org-export-latex-after-initial-vars-hook nil
- "Hook run before LaTeX export.
-The exact moment is after the initial variables like org-export-latex-class
-have been determined from the environment.")
-
-(defvar org-export-latex-after-blockquotes-hook nil
- "Hook run during LaTeX export, after blockquote, verse, center are done.")
-
-(defvar org-export-latex-final-hook nil
- "Hook run in the finalized LaTeX buffer.")
-
-(defvar org-export-latex-after-save-hook nil
- "Hook run in the finalized LaTeX buffer, after it has been saved.")
-
-;;; Autoload functions:
-
-;;;###autoload
-(defun org-export-as-latex-batch ()
- "Call `org-export-as-latex', may be used in batch processing.
-For example:
-
-emacs --batch
- --load=$HOME/lib/emacs/org.el
- --eval \"(setq org-export-headline-levels 2)\"
- --visit=MyFile --funcall org-export-as-latex-batch"
- (org-export-as-latex org-export-headline-levels 'hidden))
-
-;;;###autoload
-(defun org-export-as-latex-to-buffer (arg)
- "Call `org-export-as-latex` with output to a temporary buffer.
-No file is created. The prefix ARG is passed through to `org-export-as-latex'."
- (interactive "P")
- (org-export-as-latex arg nil nil "*Org LaTeX Export*")
- (when org-export-show-temporary-export-buffer
- (switch-to-buffer-other-window "*Org LaTeX Export*")))
-
-;;;###autoload
-(defun org-replace-region-by-latex (beg end)
- "Replace the region from BEG to END with its LaTeX export.
-It assumes the region has `org-mode' syntax, and then convert it to
-LaTeX. This can be used in any buffer. For example, you could
-write an itemized list in `org-mode' syntax in an LaTeX buffer and
-then use this command to convert it."
- (interactive "r")
- (let (reg latex buf)
- (save-window-excursion
- (if (org-mode-p)
- (setq latex (org-export-region-as-latex
- beg end t 'string))
- (setq reg (buffer-substring beg end)
- buf (get-buffer-create "*Org tmp*"))
- (with-current-buffer buf
- (erase-buffer)
- (insert reg)
- (org-mode)
- (setq latex (org-export-region-as-latex
- (point-min) (point-max) t 'string)))
- (kill-buffer buf)))
- (delete-region beg end)
- (insert latex)))
-
-;;;###autoload
-(defun org-export-region-as-latex (beg end &optional body-only buffer)
- "Convert region from BEG to END in `org-mode' buffer to LaTeX.
-If prefix arg BODY-ONLY is set, omit file header, footer, and table of
-contents, and only produce the region of converted text, useful for
-cut-and-paste operations.
-If BUFFER is a buffer or a string, use/create that buffer as a target
-of the converted LaTeX. If BUFFER is the symbol `string', return the
-produced LaTeX as a string and leave no buffer behind. For example,
-a Lisp program could call this function in the following way:
-
- (setq latex (org-export-region-as-latex beg end t 'string))
-
-When called interactively, the output buffer is selected, and shown
-in a window. A non-interactive call will only return the buffer."
- (interactive "r\nP")
- (when (interactive-p)
- (setq buffer "*Org LaTeX Export*"))
- (let ((transient-mark-mode t) (zmacs-regions t)
- ext-plist rtn)
- (setq ext-plist (plist-put ext-plist :ignore-subtree-p t))
- (goto-char end)
- (set-mark (point)) ;; to activate the region
- (goto-char beg)
- (setq rtn (org-export-as-latex
- nil nil ext-plist
- buffer body-only))
- (if (fboundp 'deactivate-mark) (deactivate-mark))
- (if (and (interactive-p) (bufferp rtn))
- (switch-to-buffer-other-window rtn)
- rtn)))
-
-;;;###autoload
-(defun org-export-as-latex (arg &optional hidden ext-plist
- to-buffer body-only pub-dir)
- "Export current buffer to a LaTeX file.
-If there is an active region, export only the region. The prefix
-ARG specifies how many levels of the outline should become
-headlines. The default is 3. Lower levels will be exported
-depending on `org-export-latex-low-levels'. The default is to
-convert them as description lists.
-HIDDEN is obsolete and does nothing.
-EXT-PLIST is a property list with
-external parameters overriding org-mode's default settings, but
-still inferior to file-local settings. When TO-BUFFER is
-non-nil, create a buffer with that name and export to that
-buffer. If TO-BUFFER is the symbol `string', don't leave any
-buffer behind but just return the resulting LaTeX as a string.
-When BODY-ONLY is set, don't produce the file header and footer,
-simply return the content of \\begin{document}...\\end{document},
-without even the \\begin{document} and \\end{document} commands.
-when PUB-DIR is set, use this as the publishing directory."
- (interactive "P")
- (when (and (not body-only) arg (listp arg)) (setq body-only t))
- (run-hooks 'org-export-first-hook)
-
- ;; Make sure we have a file name when we need it.
- (when (and (not (or to-buffer body-only))
- (not buffer-file-name))
- (if (buffer-base-buffer)
- (org-set-local 'buffer-file-name
- (with-current-buffer (buffer-base-buffer)
- buffer-file-name))
- (error "Need a file name to be able to export")))
-
- (message "Exporting to LaTeX...")
- (org-unmodified
- (let ((inhibit-read-only t))
- (remove-text-properties (point-min) (point-max)
- '(:org-license-to-kill nil))))
- (org-update-radio-target-regexp)
- (org-export-latex-set-initial-vars ext-plist arg)
- (setq org-export-opt-plist org-export-latex-options-plist)
- (org-install-letbind)
- (run-hooks 'org-export-latex-after-initial-vars-hook)
- (let* ((wcf (current-window-configuration))
- (opt-plist org-export-latex-options-plist)
- (region-p (org-region-active-p))
- (rbeg (and region-p (region-beginning)))
- (rend (and region-p (region-end)))
- (subtree-p
- (if (plist-get opt-plist :ignore-subtree-p)
- nil
- (when region-p
- (save-excursion
- (goto-char rbeg)
- (and (org-at-heading-p)
- (>= (org-end-of-subtree t t) rend))))))
- (opt-plist (setq org-export-opt-plist
- (if subtree-p
- (org-export-add-subtree-options opt-plist rbeg)
- opt-plist)))
- ;; Make sure the variable contains the updated values.
- (org-export-latex-options-plist (setq org-export-opt-plist opt-plist))
- ;; The following two are dynamically scoped into other
- ;; routines below.
- (org-current-export-dir
- (or pub-dir (org-export-directory :html opt-plist)))
- (org-current-export-file buffer-file-name)
- (title (or (and subtree-p (org-export-get-title-from-subtree))
- (plist-get opt-plist :title)
- (and (not
- (plist-get opt-plist :skip-before-1st-heading))
- (org-export-grab-title-from-buffer))
- (and buffer-file-name
- (file-name-sans-extension
- (file-name-nondirectory buffer-file-name)))
- "No Title"))
- (filename
- (and (not to-buffer)
- (concat
- (file-name-as-directory
- (or pub-dir
- (org-export-directory :LaTeX ext-plist)))
- (file-name-sans-extension
- (or (and subtree-p
- (org-entry-get rbeg "EXPORT_FILE_NAME" t))
- (file-name-nondirectory ;sans-extension
- (or buffer-file-name
- (error "Don't know which export file to use")))))
- ".tex")))
- (filename
- (and filename
- (if (equal (file-truename filename)
- (file-truename (or buffer-file-name "dummy.org")))
- (concat filename ".tex")
- filename)))
- (buffer (if to-buffer
- (cond
- ((eq to-buffer 'string) (get-buffer-create
- "*Org LaTeX Export*"))
- (t (get-buffer-create to-buffer)))
- (find-file-noselect filename)))
- (odd org-odd-levels-only)
- (header (org-export-latex-make-header title opt-plist))
- (skip (cond (subtree-p nil)
- (region-p nil)
- (t (plist-get opt-plist :skip-before-1st-heading))))
- (text (plist-get opt-plist :text))
- (org-export-preprocess-hook
- (cons
- `(lambda () (org-set-local 'org-complex-heading-regexp
- ,org-export-latex-complex-heading-re))
- org-export-preprocess-hook))
- (first-lines (if skip "" (org-export-latex-first-lines
- opt-plist
- (if subtree-p
- (save-excursion
- (goto-char rbeg)
- (point-at-bol 2))
- rbeg)
- (if region-p rend))))
- (coding-system (and (boundp 'buffer-file-coding-system)
- buffer-file-coding-system))
- (coding-system-for-write (or org-export-latex-coding-system
- coding-system))
- (save-buffer-coding-system (or org-export-latex-coding-system
- coding-system))
- (region (buffer-substring
- (if region-p (region-beginning) (point-min))
- (if region-p (region-end) (point-max))))
- (text
- (and text (string-match "\\S-" text)
- (org-export-preprocess-string
- text
- :emph-multiline t
- :for-LaTeX t
- :comments nil
- :tags (plist-get opt-plist :tags)
- :priority (plist-get opt-plist :priority)
- :footnotes (plist-get opt-plist :footnotes)
- :drawers (plist-get opt-plist :drawers)
- :timestamps (plist-get opt-plist :timestamps)
- :todo-keywords (plist-get opt-plist :todo-keywords)
- :add-text nil
- :skip-before-1st-heading skip
- :select-tags nil
- :exclude-tags nil
- :LaTeX-fragments nil)))
- (string-for-export
- (org-export-preprocess-string
- region
- :emph-multiline t
- :for-LaTeX t
- :comments nil
- :tags (plist-get opt-plist :tags)
- :priority (plist-get opt-plist :priority)
- :footnotes (plist-get opt-plist :footnotes)
- :drawers (plist-get opt-plist :drawers)
- :timestamps (plist-get opt-plist :timestamps)
- :todo-keywords (plist-get opt-plist :todo-keywords)
- :add-text (if (eq to-buffer 'string) nil text)
- :skip-before-1st-heading skip
- :select-tags (plist-get opt-plist :select-tags)
- :exclude-tags (plist-get opt-plist :exclude-tags)
- :LaTeX-fragments nil)))
-
- (set-buffer buffer)
- (erase-buffer)
- (org-install-letbind)
-
- (and (fboundp 'set-buffer-file-coding-system)
- (set-buffer-file-coding-system coding-system-for-write))
-
- ;; insert the header and initial document commands
- (unless (or (eq to-buffer 'string) body-only)
- (insert header))
-
- ;; insert text found in #+TEXT
- (when (and text (not (eq to-buffer 'string)))
- (insert (org-export-latex-content
- text '(lists tables fixed-width keywords))
- "\n\n"))
-
- ;; insert lines before the first headline
- (unless skip
- (insert first-lines))
-
- ;; export the content of headlines
- (org-export-latex-global
- (with-temp-buffer
- (insert string-for-export)
- (goto-char (point-min))
- (when (re-search-forward "^\\(\\*+\\) " nil t)
- (let* ((asters (length (match-string 1)))
- (level (if odd (- asters 2) (- asters 1))))
- (setq org-export-latex-add-level
- (if odd (1- (/ (1+ asters) 2)) (1- asters)))
- (org-export-latex-parse-global level odd)))))
-
- ;; finalization
- (unless body-only (insert "\n\\end{document}"))
-
- ;; Attach description terms to the \item macro
- (goto-char (point-min))
- (while (re-search-forward "^[ \t]*\\\\item\\([ \t]+\\)\\[" nil t)
- (delete-region (match-beginning 1) (match-end 1)))
-
- ;; Relocate the table of contents
- (goto-char (point-min))
- (when (re-search-forward "\\[TABLE-OF-CONTENTS\\]" nil t)
- (goto-char (point-min))
- (while (re-search-forward "\\\\tableofcontents\\>[ \t]*\n?" nil t)
- (replace-match ""))
- (goto-char (point-min))
- (and (re-search-forward "\\[TABLE-OF-CONTENTS\\]" nil t)
- (replace-match "\\tableofcontents" t t)))
-
- ;; Cleanup forced line ends in items where they are not needed
- (goto-char (point-min))
- (while (re-search-forward
- "^[ \t]*\\\\item\\>.*\\(\\\\\\\\\\)[ \t]*\\(\n\\\\label.*\\)*\n\\\\begin"
- nil t)
- (delete-region (match-beginning 1) (match-end 1)))
- (goto-char (point-min))
- (while (re-search-forward
- "^[ \t]*\\\\item\\>.*\\(\\\\\\\\\\)[ \t]*\\(\n\\\\label.*\\)*"
- nil t)
- (if (looking-at "[\n \t]+")
- (replace-match "\n")))
-
- (run-hooks 'org-export-latex-final-hook)
- (if to-buffer
- (unless (eq major-mode 'latex-mode) (latex-mode))
- (save-buffer))
- (org-export-latex-fix-inputenc)
- (run-hooks 'org-export-latex-after-save-hook)
- (goto-char (point-min))
- (or (org-export-push-to-kill-ring "LaTeX")
- (message "Exporting to LaTeX...done"))
- (prog1
- (if (eq to-buffer 'string)
- (prog1 (buffer-substring (point-min) (point-max))
- (kill-buffer (current-buffer)))
- (current-buffer))
- (set-window-configuration wcf))))
-
-;;;###autoload
-(defun org-export-as-pdf (arg &optional hidden ext-plist
- to-buffer body-only pub-dir)
- "Export as LaTeX, then process through to PDF."
- (interactive "P")
- (message "Exporting to PDF...")
- (let* ((wconfig (current-window-configuration))
- (lbuf (org-export-as-latex arg hidden ext-plist
- to-buffer body-only pub-dir))
- (file (buffer-file-name lbuf))
- (base (file-name-sans-extension (buffer-file-name lbuf)))
- (pdffile (concat base ".pdf"))
- (cmds org-latex-to-pdf-process)
- (outbuf (get-buffer-create "*Org PDF LaTeX Output*"))
- (bibtex-p (with-current-buffer lbuf
- (save-excursion
- (goto-char (point-min))
- (re-search-forward "\\\\bibliography{" nil t))))
- cmd output-dir errors)
- (with-current-buffer outbuf (erase-buffer))
- (message (concat "Processing LaTeX file " file "..."))
- (setq output-dir (file-name-directory file))
- (if (and cmds (symbolp cmds))
- (funcall cmds (shell-quote-argument file))
- (while cmds
- (setq cmd (pop cmds))
- (while (string-match "%b" cmd)
- (setq cmd (replace-match
- (save-match-data
- (shell-quote-argument base))
- t t cmd)))
- (while (string-match "%f" cmd)
- (setq cmd (replace-match
- (save-match-data
- (shell-quote-argument file))
- t t cmd)))
- (while (string-match "%o" cmd)
- (setq cmd (replace-match
- (save-match-data
- (shell-quote-argument output-dir))
- t t cmd)))
- (shell-command cmd outbuf)))
- (message (concat "Processing LaTeX file " file "...done"))
- (setq errors (org-export-latex-get-error outbuf))
- (if (not (file-exists-p pdffile))
- (error (concat "PDF file " pdffile " was not produced"
- (if errors (concat ":" errors "") "")))
- (set-window-configuration wconfig)
- (when org-export-pdf-remove-logfiles
- (dolist (ext org-export-pdf-logfiles)
- (setq file (concat base "." ext))
- (and (file-exists-p file) (delete-file file))))
- (message (concat
- "Exporting to PDF...done"
- (if errors
- (concat ", with some errors:" errors)
- "")))
- pdffile)))
-
-(defun org-export-latex-get-error (buf)
- "Collect the kinds of errors that remain in pdflatex processing."
- (with-current-buffer buf
- (save-excursion
- (goto-char (point-max))
- (when (re-search-backward "^[ \t]*This is pdf.*?TeX.*?Version" nil t)
- ;; OK, we are at the location of the final run
- (let ((pos (point)) (errors "") (case-fold-search t))
- (if (re-search-forward "Reference.*?undefined" nil t)
- (setq errors (concat errors " [undefined reference]")))
- (goto-char pos)
- (if (re-search-forward "Citation.*?undefined" nil t)
- (setq errors (concat errors " [undefined citation]")))
- (goto-char pos)
- (if (re-search-forward "Undefined control sequence" nil t)
- (setq errors (concat errors " [undefined control sequence]")))
- (and (org-string-nw-p errors) errors))))))
-
-;;;###autoload
-(defun org-export-as-pdf-and-open (arg)
- "Export as LaTeX, then process through to PDF, and open."
- (interactive "P")
- (let ((pdffile (org-export-as-pdf arg)))
- (if pdffile
- (progn
- (org-open-file pdffile)
- (when org-export-kill-product-buffer-when-displayed
- (kill-buffer (find-buffer-visiting
- (concat (file-name-sans-extension (buffer-file-name))
- ".tex")))))
- (error "PDF file was not produced"))))
-
-;;; Parsing functions:
-
-(defun org-export-latex-parse-global (level odd)
- "Parse the current buffer recursively, starting at LEVEL.
-If ODD is non-nil, assume the buffer only contains odd sections.
-Return a list reflecting the document structure."
- (save-excursion
- (goto-char (point-min))
- (let* ((cnt 0) output
- (depth org-export-latex-sectioning-depth))
- (while (org-re-search-forward-unprotected
- (concat "^\\(\\(?:\\*\\)\\{"
- (number-to-string (+ (if odd 2 1) level))
- "\\}\\) \\(.*\\)$")
- ;; make sure that there is no upper heading
- (when (> level 0)
- (save-excursion
- (save-match-data
- (org-re-search-forward-unprotected
- (concat "^\\(\\(?:\\*\\)\\{"
- (number-to-string level)
- "\\}\\) \\(.*\\)$") nil t)))) t)
- (setq cnt (1+ cnt))
- (let* ((pos (match-beginning 0))
- (heading (match-string 2))
- (nlevel (if odd (/ (+ 3 level) 2) (1+ level))))
- (save-excursion
- (narrow-to-region
- (point)
- (save-match-data
- (if (org-re-search-forward-unprotected
- (concat "^\\(\\(?:\\*\\)\\{"
- (number-to-string (+ (if odd 2 1) level))
- "\\}\\) \\(.*\\)$") nil t)
- (match-beginning 0)
- (point-max))))
- (goto-char (point-min))
- (setq output
- (append output
- (list
- (list
- `(pos . ,pos)
- `(level . ,nlevel)
- `(occur . ,cnt)
- `(heading . ,heading)
- `(content . ,(org-export-latex-parse-content))
- `(subcontent . ,(org-export-latex-parse-subcontent
- level odd)))))))
- (widen)))
- (list output))))
-
-(defun org-export-latex-parse-content ()
- "Extract the content of a section."
- (let ((beg (point))
- (end (if (org-re-search-forward-unprotected "^\\(\\*\\)+ .*$" nil t)
- (progn (beginning-of-line) (point))
- (point-max))))
- (buffer-substring beg end)))
-
-(defun org-export-latex-parse-subcontent (level odd)
- "Extract the subcontent of a section at LEVEL.
-If ODD Is non-nil, assume subcontent only contains odd sections."
- (if (not (org-re-search-forward-unprotected
- (concat "^\\(\\(?:\\*\\)\\{"
- (number-to-string (+ (if odd 4 2) level))
- "\\}\\) \\(.*\\)$")
- nil t))
- nil ; subcontent is nil
- (org-export-latex-parse-global (+ (if odd 2 1) level) odd)))
-
-;;; Rendering functions:
-(defun org-export-latex-global (content)
- "Export CONTENT to LaTeX.
-CONTENT is an element of the list produced by
-`org-export-latex-parse-global'."
- (if (eq (car content) 'subcontent)
- (mapc 'org-export-latex-sub (cdr content))
- (org-export-latex-sub (car content))))
-
-(defun org-export-latex-sub (subcontent)
- "Export the list SUBCONTENT to LaTeX.
-SUBCONTENT is an alist containing information about the headline
-and its content."
- (let ((num (plist-get org-export-latex-options-plist :section-numbers)))
- (mapc (lambda(x) (org-export-latex-subcontent x num)) subcontent)))
-
-(defun org-export-latex-subcontent (subcontent num)
- "Export each cell of SUBCONTENT to LaTeX.
-If NUM, export sections as numerical sections."
- (let* ((heading (cdr (assoc 'heading subcontent)))
- (level (- (cdr (assoc 'level subcontent))
- org-export-latex-add-level))
- (occur (number-to-string (cdr (assoc 'occur subcontent))))
- (content (cdr (assoc 'content subcontent)))
- (subcontent (cadr (assoc 'subcontent subcontent)))
- (label (org-get-text-property-any 0 'target heading))
- (label-list (cons label (cdr (assoc label
- org-export-target-aliases))))
- (sectioning org-export-latex-sectioning)
- (depth org-export-latex-sectioning-depth)
- main-heading sub-heading)
- (when (symbolp (car sectioning))
- (setq sectioning (funcall (car sectioning) level heading))
- (when sectioning
- (setq heading (car sectioning)
- sectioning (cdr sectioning)
- ;; target property migh have changed...
- label (org-get-text-property-any 0 'target heading)
- label-list (cons label (cdr (assoc label
- org-export-target-aliases)))))
- (if sectioning (setq sectioning (make-list 10 sectioning)))
- (setq depth (if sectioning 10000 0)))
- (if (string-match "[ \t]*\\\\\\\\[ \t]*" heading)
- (setq main-heading (substring heading 0 (match-beginning 0))
- sub-heading (substring heading (match-end 0))))
- (setq heading (org-export-latex-fontify-headline heading)
- sub-heading (and sub-heading
- (org-export-latex-fontify-headline sub-heading))
- main-heading (and main-heading
- (org-export-latex-fontify-headline main-heading)))
- (cond
- ;; Normal conversion
- ((<= level depth)
- (let* ((sec (nth (1- level) sectioning))
- start end)
- (if (consp (cdr sec))
- (setq start (nth (if num 0 2) sec)
- end (nth (if num 1 3) sec))
- (setq start (if num (car sec) (cdr sec))))
- (insert (format start (if main-heading main-heading heading)
- (or sub-heading "")))
- (insert "\n")
- (when label
- (insert (mapconcat (lambda (l) (format "\\label{%s}" l))
- label-list "\n") "\n"))
- (insert (org-export-latex-content content))
- (cond ((stringp subcontent) (insert subcontent))
- ((listp subcontent)
- (while (org-looking-back "\n\n") (backward-delete-char 1))
- (org-export-latex-sub subcontent)))
- (when (and end (string-match "[^ \t]" end))
- (let ((hook (org-get-text-property-any 0 'org-insert-hook end)))
- (and (functionp hook) (funcall hook)))
- (insert end "\n"))))
- ;; At a level under the hl option: we can drop this subsection
- ((> level depth)
- (cond ((eq org-export-latex-low-levels 'description)
- (if (string-match "% ends low level$"
- (buffer-substring (point-at-bol 0) (point)))
- (delete-region (point-at-bol 0) (point))
- (insert "\\begin{description}\n"))
- (insert (format "\n\\item[%s]%s~\n"
- heading
- (if label (format "\\label{%s}" label) "")))
- (insert (org-export-latex-content content))
- (cond ((stringp subcontent) (insert subcontent))
- ((listp subcontent) (org-export-latex-sub subcontent)))
- (insert "\\end{description} % ends low level\n"))
- ((memq org-export-latex-low-levels '(itemize enumerate))
- (if (string-match "% ends low level$"
- (buffer-substring (point-at-bol 0) (point)))
- (delete-region (point-at-bol 0) (point))
- (insert (format "\\begin{%s}\n"
- (symbol-name org-export-latex-low-levels))))
- (insert (format "\n\\item %s\\\\\n%s%%"
- heading
- (if label (format "\\label{%s}" label) "")))
- (insert (org-export-latex-content content))
- (cond ((stringp subcontent) (insert subcontent))
- ((listp subcontent) (org-export-latex-sub subcontent)))
- (insert (format "\\end{%s} %% ends low level\n"
- (symbol-name org-export-latex-low-levels))))
-
- ((listp org-export-latex-low-levels)
- (if (string-match "% ends low level$"
- (buffer-substring (point-at-bol 0) (point)))
- (delete-region (point-at-bol 0) (point))
- (insert (car org-export-latex-low-levels) "\n"))
- (insert (format (nth 2 org-export-latex-low-levels)
- heading
- (if label (format "\\label{%s}" label) "")))
- (insert (org-export-latex-content content))
- (cond ((stringp subcontent) (insert subcontent))
- ((listp subcontent) (org-export-latex-sub subcontent)))
- (insert (nth 1 org-export-latex-low-levels)
- " %% ends low level\n"))
-
- ((stringp org-export-latex-low-levels)
- (insert (format org-export-latex-low-levels heading) "\n")
- (when label (insert (format "\\label{%s}\n" label)))
- (insert (org-export-latex-content content))
- (cond ((stringp subcontent) (insert subcontent))
- ((listp subcontent) (org-export-latex-sub subcontent)))))))))
-
-;;; Exporting internals:
-(defun org-export-latex-set-initial-vars (ext-plist level)
- "Store org local variables required for LaTeX export.
-EXT-PLIST is an optional additional plist.
-LEVEL indicates the default depth for export."
- (setq org-export-latex-todo-keywords-1 org-todo-keywords-1
- org-export-latex-done-keywords org-done-keywords
- org-export-latex-not-done-keywords org-not-done-keywords
- org-export-latex-complex-heading-re org-complex-heading-regexp
- org-export-latex-display-custom-times org-display-custom-times
- org-export-latex-all-targets-re
- (org-make-target-link-regexp (org-all-targets))
- org-export-latex-options-plist
- (org-combine-plists (org-default-export-plist) ext-plist
- (org-infile-export-plist))
- org-export-latex-class
- (or (and (org-region-active-p)
- (save-excursion
- (goto-char (region-beginning))
- (and (looking-at org-complex-heading-regexp)
- (org-entry-get nil "LaTeX_CLASS" 'selective))))
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (and (re-search-forward "^#\\+LaTeX_CLASS:[ \t]*\\(-[a-zA-Z]+\\)" nil t)
- (match-string 1))))
- (plist-get org-export-latex-options-plist :latex-class)
- org-export-latex-default-class)
- org-export-latex-class-options
- (or (and (org-region-active-p)
- (save-excursion
- (goto-char (region-beginning))
- (and (looking-at org-complex-heading-regexp)
- (org-entry-get nil "LaTeX_CLASS_OPTIONS" 'selective))))
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (and (re-search-forward "^#\\+LaTeX_CLASS_OPTIONS:[ \t]*\\(.*?\\)[ \t]*$" nil t)
- (match-string 1))))
- (plist-get org-export-latex-options-plist :latex-class-options))
- org-export-latex-class
- (or (car (assoc org-export-latex-class org-export-latex-classes))
- (error "No definition for class `%s' in `org-export-latex-classes'"
- org-export-latex-class))
- org-export-latex-header
- (cadr (assoc org-export-latex-class org-export-latex-classes))
- org-export-latex-sectioning
- (cddr (assoc org-export-latex-class org-export-latex-classes))
- org-export-latex-sectioning-depth
- (or level
- (let ((hl-levels
- (plist-get org-export-latex-options-plist :headline-levels))
- (sec-depth (length org-export-latex-sectioning)))
- (if (> hl-levels sec-depth) sec-depth hl-levels))))
- (when (and org-export-latex-class-options
- (string-match "\\S-" org-export-latex-class-options)
- (string-match "^[ \t]*\\(\\\\documentclass\\)\\(\\[.*?\\]\\)?"
- org-export-latex-header))
- (setq org-export-latex-header
- (concat (substring org-export-latex-header 0 (match-end 1))
- org-export-latex-class-options
- (substring org-export-latex-header (match-end 0))))))
-
-(defvar org-export-latex-format-toc-function
- 'org-export-latex-format-toc-default
- "The function formatting returning the string to create the table of contents.
-The function mus take one parameter, the depth of the table of contents.")
-
-(defun org-export-latex-make-header (title opt-plist)
- "Make the LaTeX header and return it as a string.
-TITLE is the current title from the buffer or region.
-OPT-PLIST is the options plist for current buffer."
- (let ((toc (plist-get opt-plist :table-of-contents))
- (author (org-export-apply-macros-in-string
- (plist-get opt-plist :author))))
- (concat
- (if (plist-get opt-plist :time-stamp-file)
- (format-time-string "%% Created %Y-%m-%d %a %H:%M\n"))
- ;; insert LaTeX custom header and packages from the list
- (org-splice-latex-header
- (org-export-apply-macros-in-string org-export-latex-header)
- org-export-latex-default-packages-alist
- org-export-latex-packages-alist nil
- (org-export-apply-macros-in-string
- (plist-get opt-plist :latex-header-extra)))
- ;; append another special variable
- (org-export-apply-macros-in-string org-export-latex-append-header)
- ;; define alert if not yet defined
- "\n\\providecommand{\\alert}[1]{\\textbf{#1}}"
- ;; beginning of the document
- "\n\\begin{document}\n\n"
- ;; insert the title
- (format
- "\n\n\\title{%s}\n"
- ;; convert the title
- (org-export-latex-fontify-headline title))
- ;; insert author info
- (if (plist-get opt-plist :author-info)
- (format "\\author{%s}\n"
- (org-export-latex-fontify-headline (or author user-full-name)))
- (format "%%\\author{%s}\n"
- (org-export-latex-fontify-headline (or author user-full-name))))
- ;; insert the date
- (format "\\date{%s}\n"
- (format-time-string
- (or (plist-get opt-plist :date)
- org-export-latex-date-format)))
- ;; insert the title command
- (when (string-match "\\S-" title)
- (if (string-match "%s" org-export-latex-title-command)
- (format org-export-latex-title-command title)
- org-export-latex-title-command))
- "\n\n"
- ;; table of contents
- (when (and org-export-with-toc
- (plist-get opt-plist :section-numbers))
- (funcall org-export-latex-format-toc-function
- (cond ((numberp toc)
- (min toc (plist-get opt-plist :headline-levels)))
- (toc (plist-get opt-plist :headline-levels))))))))
-
-(defun org-export-latex-format-toc-default (depth)
- (when depth
- (format "\\setcounter{tocdepth}{%s}\n\\tableofcontents\n\\vspace*{1cm}\n"
- depth)))
-
-(defun org-export-latex-first-lines (opt-plist &optional beg end)
- "Export the first lines before first headline.
-If BEG is non-nil, it is the beginning of the region.
-If END is non-nil, it is the end of the region."
- (save-excursion
- (goto-char (or beg (point-min)))
- (let* ((pt (point))
- (end (if (re-search-forward (org-get-limited-outline-regexp) end t)
- (goto-char (match-beginning 0))
- (goto-char (or end (point-max))))))
- (prog1
- (org-export-latex-content
- (org-export-preprocess-string
- (buffer-substring pt end)
- :for-LaTeX t
- :emph-multiline t
- :add-text nil
- :comments nil
- :skip-before-1st-heading nil
- :LaTeX-fragments nil
- :timestamps (plist-get opt-plist :timestamps)
- :footnotes (plist-get opt-plist :footnotes)))
- (org-unmodified
- (let ((inhibit-read-only t)
- (limit (max pt (1- end))))
- (add-text-properties pt limit
- '(:org-license-to-kill t))
- (save-excursion
- (goto-char pt)
- (while (re-search-forward "^[ \t]*#\\+.*\n?" limit t)
- (let ((case-fold-search t))
- (unless (org-string-match-p
- "^[ \t]*#\\+\\(attr_\\|caption\\>\\|label\\>\\)"
- (match-string 0))
- (remove-text-properties (match-beginning 0) (match-end 0)
- '(:org-license-to-kill t))))))))))))
-
-
-(defvar org-export-latex-header-defs nil
- "The header definitions that might be used in the LaTeX body.")
-(defvar org-export-latex-header-defs-re nil
- "The header definitions that might be used in the LaTeX body.")
-
-(defun org-export-latex-content (content &optional exclude-list)
- "Convert CONTENT string to LaTeX.
-Don't perform conversions that are in EXCLUDE-LIST. Recognized
-conversion types are: quotation-marks, emphasis, sub-superscript,
-links, keywords, lists, tables, fixed-width"
- (with-temp-buffer
- (insert content)
- (unless (memq 'timestamps exclude-list)
- (org-export-latex-time-stamps))
- (unless (memq 'quotation-marks exclude-list)
- (org-export-latex-quotation-marks))
- (unless (memq 'emphasis exclude-list)
- (when (plist-get org-export-latex-options-plist :emphasize)
- (org-export-latex-fontify)))
- (unless (memq 'sub-superscript exclude-list)
- (org-export-latex-special-chars
- (plist-get org-export-latex-options-plist :sub-superscript)))
- (unless (memq 'links exclude-list)
- (org-export-latex-links))
- (unless (memq 'keywords exclude-list)
- (org-export-latex-keywords))
- (unless (memq 'lists exclude-list)
- (org-export-latex-lists))
- (unless (memq 'tables exclude-list)
- (org-export-latex-tables
- (plist-get org-export-latex-options-plist :tables)))
- (unless (memq 'fixed-width exclude-list)
- (org-export-latex-fixed-width
- (plist-get org-export-latex-options-plist :fixed-width)))
- ;; return string
- (buffer-substring (point-min) (point-max))))
-
-(defun org-export-latex-protect-string (s)
- "Add the org-protected property to string S."
- (add-text-properties 0 (length s) '(org-protected t) s) s)
-
-(defun org-export-latex-protect-char-in-string (char-list string)
- "Add org-protected text-property to char from CHAR-LIST in STRING."
- (with-temp-buffer
- (save-match-data
- (insert string)
- (goto-char (point-min))
- (while (re-search-forward (regexp-opt char-list) nil t)
- (add-text-properties (match-beginning 0)
- (match-end 0) '(org-protected t)))
- (buffer-string))))
-
-(defun org-export-latex-keywords-maybe (&optional remove-list)
- "Maybe remove keywords depending on rules in REMOVE-LIST."
- (goto-char (point-min))
- (let ((re-todo (mapconcat 'identity org-export-latex-todo-keywords-1 "\\|"))
- (case-fold-search nil)
- (todo-markup org-export-latex-todo-keyword-markup)
- fmt)
- ;; convert TODO keywords
- (when (re-search-forward (concat "^\\(" re-todo "\\)") nil t)
- (if (plist-get remove-list :todo)
- (replace-match "")
- (setq fmt (cond
- ((stringp todo-markup) todo-markup)
- ((and (consp todo-markup) (stringp (car todo-markup)))
- (if (member (match-string 1) org-export-latex-done-keywords)
- (cdr todo-markup) (car todo-markup)))
- (t (cdr (or (assoc (match-string 1) todo-markup)
- (car todo-markup))))))
- (replace-match (org-export-latex-protect-string
- (format fmt (match-string 1))) t t)))
- ;; convert priority string
- (when (re-search-forward "\\[\\\\#.\\]" nil t)
- (if (plist-get remove-list :priority)
- (replace-match "")
- (replace-match (format "\\textbf{%s}" (match-string 0)) t t)))
- ;; convert tags
- (when (re-search-forward "\\(:[a-zA-Z0-9_@#%]+\\)+:" nil t)
- (if (or (not org-export-with-tags)
- (plist-get remove-list :tags))
- (replace-match "")
- (replace-match
- (org-export-latex-protect-string
- (format org-export-latex-tag-markup
- (save-match-data
- (replace-regexp-in-string
- "_" "\\\\_" (match-string 0)))))
- t t)))))
-
-(defun org-export-latex-fontify-headline (string)
- "Fontify special words in STRING."
- (with-temp-buffer
- ;; FIXME: org-inside-LaTeX-fragment-p doesn't work when the $...$ is at
- ;; the beginning of the buffer - inserting "\n" is safe here though.
- (insert "\n" string)
-
- ;; Preserve math snippets
-
- (let* ((matchers (plist-get org-format-latex-options :matchers))
- (re-list org-latex-regexps)
- beg end re e m n block off)
- ;; Check the different regular expressions
- (while (setq e (pop re-list))
- (setq m (car e) re (nth 1 e) n (nth 2 e)
- block (if (nth 3 e) "\n\n" ""))
- (setq off (if (member m '("$" "$1")) 1 0))
- (when (and (member m matchers) (not (equal m "begin")))
- (goto-char (point-min))
- (while (re-search-forward re nil t)
- (setq beg (+ (match-beginning 0) off) end (- (match-end 0) 0))
- (add-text-properties beg end
- '(org-protected t org-latex-math t))))))
-
- ;; Convert LaTeX to \LaTeX{} and TeX to \TeX{}
- (goto-char (point-min))
- (let ((case-fold-search nil))
- (while (re-search-forward "\\<\\(\\(La\\)?TeX\\)\\>" nil t)
- (unless (eq (char-before (match-beginning 1)) ?\\)
- (org-if-unprotected-1
- (replace-match (org-export-latex-protect-string
- (concat "\\" (match-string 1)
- "{}")) t t)))))
- (goto-char (point-min))
- (let ((re (concat "\\\\\\([a-zA-Z]+\\)"
- "\\(?:<[^<>\n]*>\\)*"
- "\\(?:\\[[^][\n]*?\\]\\)*"
- "\\(?:<[^<>\n]*>\\)*"
- "\\("
- (org-create-multibrace-regexp "{" "}" 3)
- "\\)\\{1,3\\}")))
- (while (re-search-forward re nil t)
- (unless (or
- ;; check for comment line
- (save-excursion (goto-char (match-beginning 0))
- (org-in-indented-comment-line))
- ;; Check if this is a defined entity, so that is may need conversion
- (org-entity-get (match-string 1)))
- (add-text-properties (match-beginning 0) (match-end 0)
- '(org-protected t)))))
- (when (plist-get org-export-latex-options-plist :emphasize)
- (org-export-latex-fontify))
- (org-export-latex-keywords-maybe)
- (org-export-latex-special-chars
- (plist-get org-export-latex-options-plist :sub-superscript))
- (org-export-latex-links)
- (org-trim (buffer-string))))
-
-(defun org-export-latex-time-stamps ()
- "Format time stamps."
- (goto-char (point-min))
- (let ((org-display-custom-times org-export-latex-display-custom-times))
- (while (re-search-forward org-ts-regexp-both nil t)
- (org-if-unprotected-at (1- (point))
- (replace-match
- (org-export-latex-protect-string
- (format org-export-latex-timestamp-markup
- (substring (org-translate-time (match-string 0)) 1 -1)))
- t t)))))
-
-(defun org-export-latex-quotation-marks ()
- "Export quotation marks depending on language conventions."
- (let* ((lang (plist-get org-export-latex-options-plist :language))
- (quote-rpl (if (equal lang "fr")
- '(("\\(\\s-\\)\"" "«~")
- ("\\(\\S-\\)\"" "~»")
- ("\\(\\s-\\)'" "`"))
- '(("\\(\\s-\\|[[(]\\)\"" "``")
- ("\\(\\S-\\)\"" "''")
- ("\\(\\s-\\|(\\)'" "`")))))
- (mapc (lambda(l) (goto-char (point-min))
- (while (re-search-forward (car l) nil t)
- (let ((rpl (concat (match-string 1)
- (org-export-latex-protect-string
- (copy-sequence (cadr l))))))
- (org-if-unprotected-1
- (replace-match rpl t t))))) quote-rpl)))
-
-(defun org-export-latex-special-chars (sub-superscript)
- "Export special characters to LaTeX.
-If SUB-SUPERSCRIPT is non-nil, convert \\ and ^.
-See the `org-export-latex.el' code for a complete conversion table."
- (goto-char (point-min))
- (mapc (lambda(c)
- (goto-char (point-min))
- (while (re-search-forward c nil t)
- ;; Put the point where to check for org-protected
- (unless (get-text-property (match-beginning 2) 'org-protected)
- (cond ((member (match-string 2) '("\\$" "$"))
- (if (equal (match-string 2) "\\$")
- nil
- (replace-match "\\$" t t)))
- ((member (match-string 2) '("&" "%" "#"))
- (if (equal (match-string 1) "\\")
- (replace-match (match-string 2) t t)
- (replace-match (concat (match-string 1) "\\"
- (match-string 2)) t t)
- (backward-char 1)))
- ((equal (match-string 2) "...")
- (replace-match
- (concat (match-string 1)
- (org-export-latex-protect-string "\\ldots{}")) t t))
- ((equal (match-string 2) "~")
- (cond ((equal (match-string 1) "\\") nil)
- ((eq 'org-link (get-text-property 0 'face (match-string 2)))
- (replace-match (concat (match-string 1) "\\~") t t))
- (t (replace-match
- (org-export-latex-protect-string
- (concat (match-string 1) "\\~{}")) t t))))
- ((member (match-string 2) '("{" "}"))
- (unless (save-match-data (org-inside-latex-math-p))
- (if (equal (match-string 1) "\\")
- (replace-match (match-string 2) t t)
- (replace-match (concat (match-string 1) "\\"
- (match-string 2)) t t)))))
- (unless (save-match-data (org-inside-latex-math-p))
- (cond ((equal (match-string 2) "\\")
- (replace-match (or (save-match-data
- (org-export-latex-treat-backslash-char
- (match-string 1)
- (or (match-string 3) "")))
- "") t t)
- (when (and (get-text-property (1- (point)) 'org-entity)
- (looking-at "{}"))
- ;; OK, this was an entity replacement, and the user
- ;; had terminated the entity with {}. Make sure
- ;; {} is protected as well, and remove the extra {}
- ;; inserted by the conversion.
- (put-text-property (point) (+ 2 (point)) 'org-protected t)
- (if (save-excursion (goto-char (max (- (point) 2) (point-min)))
- (looking-at "{}"))
- (replace-match ""))
- (forward-char 2))
- (backward-char 1))
- ((member (match-string 2) '("_" "^"))
- (replace-match (or (save-match-data
- (org-export-latex-treat-sub-super-char
- sub-superscript
- (match-string 2)
- (match-string 1)
- (match-string 3))) "") t t)
- (backward-char 1)))))))
- '(;"^\\([^\n$]*?\\|^\\)\\(\\\\?\\$\\)\\([^\n$]*\\)$"
- "\\(\\(\\\\?\\$\\)\\)"
- "\\([a-zA-Z0-9()]+\\|[ \t\n]\\|\\b\\|\\\\\\)\\(_\\|\\^\\)\\({[^{}]+}\\|[a-zA-Z0-9]+\\|[ \t\n]\\|[:punct:]\\|)\\|{[a-zA-Z0-9]+}\\|([a-zA-Z0-9]+)\\)"
- "\\(.\\|^\\)\\(\\\\\\)\\([ \t\n]\\|\\([&#%{}\"]\\|[a-zA-Z][a-zA-Z0-9]*\\)\\)"
- "\\(.\\|^\\)\\(&\\)"
- "\\(.\\|^\\)\\(#\\)"
- "\\(.\\|^\\)\\(%\\)"
- "\\(.\\|^\\)\\({\\)"
- "\\(.\\|^\\)\\(}\\)"
- "\\(.\\|^\\)\\(~\\)"
- "\\(.\\|^\\)\\(\\.\\.\\.\\)"
- ;; (?\< . "\\textless{}")
- ;; (?\> . "\\textgreater{}")
- )))
-
-(defun org-inside-latex-math-p ()
- (get-text-property (point) 'org-latex-math))
-
-(defun org-export-latex-treat-sub-super-char
- (subsup char string-before string-after)
- "Convert the \"_\" and \"^\" characters to LaTeX.
-SUBSUP corresponds to the ^: option in the #+OPTIONS line.
-Convert CHAR depending on STRING-BEFORE and STRING-AFTER."
- (cond ((equal string-before "\\")
- (concat string-before char string-after))
- ((and (string-match "\\S-+" string-after))
- ;; this is part of a math formula
- (cond ((eq 'org-link (get-text-property 0 'face char))
- (concat string-before "\\" char string-after))
- ((save-match-data (org-inside-latex-math-p))
- (if subsup
- (cond ((eq 1 (length string-after))
- (concat string-before char string-after))
- ((string-match "[({]?\\([^)}]+\\)[)}]?" string-after)
- (format "%s%s{%s}" string-before char
- (match-string 1 string-after))))))
- ((and (> (length string-after) 1)
- (or (eq subsup t)
- (and (equal subsup '{}) (eq (string-to-char string-after) ?\{)))
- (or (string-match "[{]?\\([^}]+\\)[}]?" string-after)
- (string-match "[(]?\\([^)]+\\)[)]?" string-after)))
-
- (org-export-latex-protect-string
- (format "%s$%s{%s}$" string-before char
- (if (and (> (match-end 1) (1+ (match-beginning 1)))
- (not (equal (substring string-after 0 2) "{\\")))
- (concat "\\mathrm{" (match-string 1 string-after) "}")
- (match-string 1 string-after)))))
- ((eq subsup t) (concat string-before "$" char string-after "$"))
- (t (org-export-latex-protect-string
- (concat string-before "\\" char "{}" string-after)))))
- (t (org-export-latex-protect-string
- (concat string-before "\\" char "{}" string-after)))))
-
-(defun org-export-latex-treat-backslash-char (string-before string-after)
- "Convert the \"$\" special character to LaTeX.
-The conversion is made depending of STRING-BEFORE and STRING-AFTER."
- (let ((ass (org-entity-get string-after)))
- (cond
- (ass (org-add-props
- (if (nth 2 ass)
- (concat string-before
- (org-export-latex-protect-string
- (concat "$" (nth 1 ass) "$")))
- (concat string-before (org-export-latex-protect-string
- (nth 1 ass))))
- nil 'org-entity t))
- ((and (not (string-match "^[ \n\t]" string-after))
- (not (string-match "[ \t]\\'\\|^" string-before)))
- ;; backslash is inside a word
- (concat string-before
- (org-export-latex-protect-string
- (concat "\\textbackslash{}" string-after))))
- ((not (or (equal string-after "")
- (string-match "^[ \t\n]" string-after)))
- ;; backslash might escape a character (like \#) or a user TeX
- ;; macro (like \setcounter)
- (concat string-before
- (org-export-latex-protect-string (concat "\\" string-after))))
- ((and (string-match "^[ \t\n]" string-after)
- (string-match "[ \t\n]\\'" string-before))
- ;; backslash is alone, convert it to $\backslash$
- (org-export-latex-protect-string
- (concat string-before "\\textbackslash{}" string-after)))
- (t (org-export-latex-protect-string
- (concat string-before "\\textbackslash{}" string-after))))))
-
-(defun org-export-latex-keywords ()
- "Convert special keywords to LaTeX."
- (goto-char (point-min))
- (while (re-search-forward org-export-latex-special-keyword-regexp nil t)
- (replace-match (format org-export-latex-timestamp-keyword-markup
- (match-string 0)) t t)
- (save-excursion
- (beginning-of-line 1)
- (unless (looking-at ".*\n[ \t]*\n")
- (end-of-line 1)
- (insert "\n")))))
-
-(defun org-export-latex-fixed-width (opt)
- "When OPT is non-nil convert fixed-width sections to LaTeX."
- (goto-char (point-min))
- (while (re-search-forward "^[ \t]*:\\([ \t]\\|$\\)" nil t)
- (unless (get-text-property (point) 'org-example)
- (if opt
- (progn (goto-char (match-beginning 0))
- (insert "\\begin{verbatim}\n")
- (while (looking-at "^\\([ \t]*\\):\\(\\([ \t]\\|$\\).*\\)$")
- (replace-match (concat (match-string 1)
- (match-string 2)) t t)
- (forward-line))
- (insert "\\end{verbatim}\n\n"))
- (progn (goto-char (match-beginning 0))
- (while (looking-at "^\\([ \t]*\\):\\(\\([ \t]\\|$\\).*\\)$")
- (replace-match (concat "%" (match-string 1)
- (match-string 2)) t t)
- (forward-line)))))))
-
-(defvar org-table-last-alignment) ; defined in org-table.el
-(defvar org-table-last-column-widths) ; defined in org-table.el
-(declare-function orgtbl-to-latex "org-table" (table params) t)
-(defun org-export-latex-tables (insert)
- "Convert tables to LaTeX and INSERT it."
- ;; First, get the table.el tables
- (goto-char (point-min))
- (while (re-search-forward "^[ \t]*\\(\\+-[-+]*\\+\\)[ \t]*\n[ \t]*|" nil t)
- (org-if-unprotected
- (require 'table)
- (org-export-latex-convert-table.el-table)))
-
- ;; And now the Org-mode tables
- (goto-char (point-min))
- (while (re-search-forward "^\\([ \t]*\\)|" nil t)
- (org-if-unprotected-at (1- (point))
- (org-table-align)
- (let* ((beg (org-table-begin))
- (end (org-table-end))
- (raw-table (buffer-substring beg end))
- (org-table-last-alignment (copy-sequence org-table-last-alignment))
- (org-table-last-column-widths (copy-sequence
- org-table-last-column-widths))
- fnum fields line lines olines gr colgropen line-fmt align
- caption shortn label attr floatp placement longtblp)
- (if org-export-latex-tables-verbatim
- (let* ((tbl (concat "\\begin{verbatim}\n" raw-table
- "\\end{verbatim}\n")))
- (apply 'delete-region (list beg end))
- (insert (org-export-latex-protect-string tbl)))
- (progn
- (setq caption (org-find-text-property-in-string
- 'org-caption raw-table)
- shortn (org-find-text-property-in-string
- 'org-caption-shortn raw-table)
- attr (org-find-text-property-in-string
- 'org-attributes raw-table)
- label (org-find-text-property-in-string
- 'org-label raw-table)
- longtblp (and attr (stringp attr)
- (string-match "\\<longtable\\>" attr))
- align (and attr (stringp attr)
- (string-match "\\<align=\\([^ \t\n\r]+\\)" attr)
- (match-string 1 attr))
- floatp (or caption label)
- placement (if (and attr
- (stringp attr)
- (string-match "[ \t]*\\<placement=\\(\\S-+\\)" attr))
- (match-string 1 attr)
- "[htb]"))
- (setq caption (and caption (org-export-latex-fontify-headline caption)))
- (setq lines (org-split-string raw-table "\n"))
- (apply 'delete-region (list beg end))
- (when org-export-table-remove-special-lines
- (setq lines (org-table-clean-before-export lines 'maybe-quoted)))
- (when org-table-clean-did-remove-column
- (pop org-table-last-alignment)
- (pop org-table-last-column-widths))
- ;; make a formatting string to reflect alignment
- (setq olines lines)
- (while (and (not line-fmt) (setq line (pop olines)))
- (unless (string-match "^[ \t]*|-" line)
- (setq fields (org-split-string line "[ \t]*|[ \t]*"))
- (setq fnum (make-vector (length fields) 0))
- (setq line-fmt
- (mapconcat
- (lambda (x)
- (setq gr (pop org-table-colgroup-info))
- (format "%s%%s%s"
- (cond ((eq gr :start)
- (prog1 (if colgropen "|" "|")
- (setq colgropen t)))
- ((eq gr :startend)
- (prog1 (if colgropen "|" "|")
- (setq colgropen nil)))
- (t ""))
- (if (memq gr '(:end :startend))
- (progn (setq colgropen nil) "|")
- "")))
- fnum ""))))
- ;; fix double || in line-fmt
- (setq line-fmt (replace-regexp-in-string "||" "|" line-fmt))
- ;; maybe remove the first and last "|"
- (when (and (not org-export-latex-tables-column-borders)
- (string-match "^\\(|\\)?\\(.+\\)|$" line-fmt))
- (setq line-fmt (match-string 2 line-fmt)))
- ;; format alignment
- (unless align
- (setq align (apply 'format
- (cons line-fmt
- (mapcar (lambda (x) (if x "r" "l"))
- org-table-last-alignment)))))
- ;; prepare the table to send to orgtbl-to-latex
- (setq lines
- (mapcar
- (lambda(elem)
- (or (and (string-match "[ \t]*|-+" elem) 'hline)
- (org-split-string (org-trim elem) "|")))
- lines))
- (when insert
- (insert (org-export-latex-protect-string
- (concat
- (if longtblp
- (concat "\\begin{longtable}{" align "}\n")
- (if floatp (format "\\begin{table}%s\n" placement)))
- (if floatp
- (format
- "\\caption%s{%s} %s"
- (if shortn (concat "[" shortn "]") "")
- (or caption "")
- (if label (format "\\label{%s}" label) "")))
- (if (and longtblp caption) "\\\\\n" "\n")
- (if (and org-export-latex-tables-centered (not longtblp))
- "\\begin{center}\n")
- (if (not longtblp)
- (format "\\begin{%s}{%s}\n"
- org-export-latex-tabular-environment align))
- (orgtbl-to-latex
- lines
- `(:tstart nil :tend nil
- :hlend ,(if longtblp
- (format "\\\\
-\\hline
-\\endhead
-\\hline\\multicolumn{%d}{r}{Continued on next page}\\
-\\endfoot
-\\endlastfoot" (length org-table-last-alignment))
- nil)))
- (if (not longtblp)
- (format "\n\\end{%s}"
- org-export-latex-tabular-environment))
- (if longtblp "\n" (if org-export-latex-tables-centered
- "\n\\end{center}\n" "\n"))
- (if longtblp
- "\\end{longtable}"
- (if floatp "\\end{table}"))))
- "\n\n"))))))))
-
-(defun org-export-latex-convert-table.el-table ()
- "Replace table.el table at point with LaTeX code."
- (let (tbl caption shortn label line floatp attr align rmlines)
- (setq line (buffer-substring (point-at-bol) (point-at-eol))
- label (org-get-text-property-any 0 'org-label line)
- caption (org-get-text-property-any 0 'org-caption line)
- shortn (org-get-text-property-any 0 'org-caption-shortn line)
- attr (org-get-text-property-any 0 'org-attributes line)
- align (and attr (stringp attr)
- (string-match "\\<align=\\([^ \t\n\r,]+\\)" attr)
- (match-string 1 attr))
- rmlines (and attr (stringp attr)
- (string-match "\\<rmlines\\>" attr))
- floatp (or label caption))
- (and (get-buffer "*org-export-table*")
- (kill-buffer (get-buffer "*org-export-table*")))
- (table-generate-source 'latex "*org-export-table*" "caption")
- (setq tbl (with-current-buffer "*org-export-table*"
- (buffer-string)))
- (while (string-match "^%.*\n" tbl)
- (setq tbl (replace-match "" t t tbl)))
- ;; fix the hlines
- (when rmlines
- (let ((n 0) lines)
- (setq lines (mapcar (lambda (x)
- (if (string-match "^\\\\hline$" x)
- (progn
- (setq n (1+ n))
- (if (= n 2) x nil))
- x))
- (org-split-string tbl "\n")))
- (setq tbl (mapconcat 'identity (delq nil lines) "\n"))))
- (when (and align (string-match "\\\\begin{tabular}{.*}" tbl))
- (setq tbl (replace-match (concat "\\begin{tabular}{" align "}")
- t t tbl)))
- (and (get-buffer "*org-export-table*")
- (kill-buffer (get-buffer "*org-export-table*")))
- (beginning-of-line 0)
- (while (looking-at "[ \t]*\\(|\\|\\+-\\)")
- (delete-region (point) (1+ (point-at-eol))))
- (when org-export-latex-tables-centered
- (setq tbl (concat "\\begin{center}\n" tbl "\\end{center}")))
- (when floatp
- (setq tbl (concat "\\begin{table}\n"
- (format "\\caption%s{%s}%s\n"
- (if shortn (format "[%s]" shortn) "")
- (if label (format "\\label{%s}" label) "")
- (or caption ""))
- tbl
- "\n\\end{table}\n")))
- (insert (org-export-latex-protect-string tbl))))
-
-(defun org-export-latex-fontify ()
- "Convert fontification to LaTeX."
- (goto-char (point-min))
- (while (re-search-forward org-emph-re nil t)
- ;; The match goes one char after the *string*, except at the end of a line
- (let ((emph (assoc (match-string 3)
- org-export-latex-emphasis-alist))
- (beg (match-beginning 0))
- (end (match-end 0))
- rpl s)
- (unless emph
- (message "`org-export-latex-emphasis-alist' has no entry for formatting triggered by \"%s\""
- (match-string 3)))
- (unless (or (and (get-text-property (- (point) 2) 'org-protected)
- (not (get-text-property
- (- (point) 2) 'org-verbatim-emph)))
- (equal (char-after (match-beginning 3))
- (char-after (1+ (match-beginning 3))))
- (save-excursion
- (goto-char (match-beginning 1))
- (save-match-data
- (and (org-at-table-p)
- (string-match
- "[|\n]" (buffer-substring beg end)))))
- (and (equal (match-string 3) "+")
- (save-match-data
- (string-match "\\`-+\\'" (match-string 4)))))
- (setq s (match-string 4))
- (setq rpl (concat (match-string 1)
- (org-export-latex-emph-format (cadr emph)
- (match-string 4))
- (match-string 5)))
- (if (caddr emph)
- (setq rpl (org-export-latex-protect-string rpl))
- (save-match-data
- (if (string-match "\\`.?\\(\\\\[a-z]+{\\)\\(.*\\)\\(}\\).?\\'" rpl)
- (progn
- (add-text-properties (match-beginning 1) (match-end 1)
- '(org-protected t) rpl)
- (add-text-properties (match-beginning 3) (match-end 3)
- '(org-protected t) rpl)))))
- (replace-match rpl t t)))
- (backward-char)))
-
-(defvar org-export-latex-use-verb nil)
-(defun org-export-latex-emph-format (format string)
- "Format an emphasis string and handle the \\verb special case."
- (when (equal format "\\verb")
- (save-match-data
- (if org-export-latex-use-verb
- (let ((ll "~,./?;':\"|!@#%^&-_=+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ<>()[]{}"))
- (catch 'exit
- (loop for i from 0 to (1- (length ll)) do
- (if (not (string-match (regexp-quote (substring ll i (1+ i)))
- string))
- (progn
- (setq format (concat "\\verb" (substring ll i (1+ i))
- "%s" (substring ll i (1+ i))))
- (throw 'exit nil))))))
- (let ((start 0)
- (trans '(("\\" . "\\textbackslash{}")
- ("~" . "\\textasciitilde{}")
- ("^" . "\\textasciicircum{}")))
- (rtn "") char)
- (while (string-match "[\\{}$%&_#~^]" string)
- (setq char (match-string 0 string))
- (if (> (match-beginning 0) 0)
- (setq rtn (concat rtn (substring string
- 0 (match-beginning 0)))))
- (setq string (substring string (1+ (match-beginning 0))))
- (setq char (or (cdr (assoc char trans)) (concat "\\" char))
- rtn (concat rtn char)))
- (setq string (concat rtn string) format "\\texttt{%s}")))))
- (format format string))
-
-(defun org-export-latex-links ()
- ;; Make sure to use the LaTeX hyperref and graphicx package
- ;; or send some warnings.
- "Convert links to LaTeX."
- (goto-char (point-min))
- (while (re-search-forward org-bracket-link-analytic-regexp++ nil t)
- (org-if-unprotected-1
- (goto-char (match-beginning 0))
- (let* ((re-radio org-export-latex-all-targets-re)
- (remove (list (match-beginning 0) (match-end 0)))
- (raw-path (org-extract-attributes (match-string 3)))
- (full-raw-path (concat (match-string 1) raw-path))
- (desc (match-string 5))
- (type (or (match-string 2)
- (if (or (file-name-absolute-p raw-path)
- (string-match "^\\.\\.?/" raw-path))
- "file")))
- (coderefp (equal type "coderef"))
- (caption (org-find-text-property-in-string 'org-caption raw-path))
- (shortn (org-find-text-property-in-string 'org-caption-shortn raw-path))
- (attr (or (org-find-text-property-in-string 'org-attributes raw-path)
- (plist-get org-export-latex-options-plist :latex-image-options)))
- (label (org-find-text-property-in-string 'org-label raw-path))
- imgp radiop fnc
- ;; define the path of the link
- (path (cond
- ((member type '("coderef"))
- raw-path)
- ((member type '("http" "https" "ftp"))
- (concat type ":" raw-path))
- ((and re-radio (string-match re-radio raw-path))
- (setq radiop t))
- ((equal type "mailto")
- (concat type ":" raw-path))
- ((equal type "file")
- (if (and (org-file-image-p
- (expand-file-name
- raw-path)
- org-export-latex-inline-image-extensions)
- (or (get-text-property 0 'org-no-description
- raw-path)
- (equal desc full-raw-path)))
- (setq imgp t)
- (progn (when (string-match "\\(.+\\)::.+" raw-path)
- (setq raw-path (match-string 1 raw-path)))
- (if (file-exists-p raw-path)
- (concat type "://" (expand-file-name raw-path))
- (concat type "://" (org-export-directory
- :LaTeX org-export-latex-options-plist)
- raw-path))))))))
- ;; process with link inserting
- (apply 'delete-region remove)
- (setq caption (and caption (org-export-latex-fontify-headline caption)))
- (cond ((and imgp
- (plist-get org-export-latex-options-plist :inline-images))
- ;; OK, we need to inline an image
- (insert
- (org-export-latex-format-image raw-path caption label attr shortn)))
- (coderefp
- (insert (format
- (org-export-get-coderef-format path desc)
- (cdr (assoc path org-export-code-refs)))))
- (radiop (insert (format org-export-latex-hyperref-format
- (org-solidify-link-text raw-path) desc)))
- ((not type)
- (insert (format org-export-latex-hyperref-format
- (org-remove-initial-hash
- (org-solidify-link-text raw-path))
- desc)))
- (path
- (when (org-at-table-p)
- ;; There is a strange problem when we have a link in a table,
- ;; ampersands then cause a problem. I think this must be
- ;; a LaTeX issue, but we here implement a work-around anyway.
- (setq path (org-export-latex-protect-amp path)
- desc (org-export-latex-protect-amp desc)))
- (insert (format org-export-latex-href-format path desc)))
-
- ((functionp (setq fnc (nth 2 (assoc type org-link-protocols))))
- ;; The link protocol has a function for formatting the link
- (insert
- (save-match-data
- (funcall fnc (org-link-unescape raw-path) desc 'latex))))
-
- (t (insert "\\texttt{" desc "}")))))))
-
-
-(defun org-export-latex-format-image (path caption label attr &optional shortn)
- "Format the image element, depending on user settings."
- (let (ind floatp wrapp multicolumnp placement figenv)
- (setq floatp (or caption label))
- (setq ind (org-get-text-property-any 0 'original-indentation path))
- (when (and attr (stringp attr))
- (if (string-match "[ \t]*\\<wrap\\>" attr)
- (setq wrapp t floatp nil attr (replace-match "" t t attr)))
- (if (string-match "[ \t]*\\<float\\>" attr)
- (setq wrapp nil floatp t attr (replace-match "" t t attr)))
- (if (string-match "[ \t]*\\<multicolumn\\>" attr)
- (setq multicolumnp t attr (replace-match "" t t attr))))
-
- (setq placement
- (cond
- (wrapp "{l}{0.5\\textwidth}")
- (floatp "[htb]")
- (t "")))
-
- (when (and attr (stringp attr)
- (string-match "[ \t]*\\<placement=\\(\\S-+\\)" attr))
- (setq placement (match-string 1 attr)
- attr (replace-match "" t t attr)))
- (setq attr (and attr (org-trim attr)))
- (when (or (not attr) (= (length attr) 0))
- (setq attr (cond (floatp "width=0.7\\textwidth")
- (wrapp "width=0.48\\textwidth")
- (t attr))))
- (setq figenv
- (cond
- (wrapp "\\begin{wrapfigure}%placement
-\\centering
-\\includegraphics[%attr]{%path}
-\\caption%shortn{%labelcmd%caption}
-\\end{wrapfigure}")
- (multicolumnp "\\begin{figure*}%placement
-\\centering
-\\includegraphics[%attr]{%path}
-\\caption{%labelcmd%caption}
-\\end{figure*}")
- (floatp "\\begin{figure}%placement
-\\centering
-\\includegraphics[%attr]{%path}
-\\caption{%labelcmd%caption}
-\\end{figure}")
- (t "\\includegraphics[%attr]{%path}")))
-
-
- (setq figenv (mapconcat 'identity (split-string figenv "\n")
- (save-excursion (beginning-of-line 1)
- (looking-at "[ \t]*")
- (concat "\n" (match-string 0)))))
-
- (if (and (not label) (not caption)
- (string-match "^\\\\caption{.*\n" figenv))
- (setq figenv (replace-match "" t t figenv)))
- (org-add-props
- (org-fill-template
- figenv
- (list (cons "path"
- (if (file-name-absolute-p path)
- (expand-file-name path)
- path))
- (cons "attr" attr)
- (cons "shortn" (if shortn (format "[%s]" shortn) ""))
- (cons "labelcmd" (if label (format "\\label{%s}"
- label)""))
- (cons "caption" (or caption ""))
- (cons "placement" (or placement ""))))
- nil 'original-indentation ind)))
-
-(defun org-export-latex-protect-amp (s)
- (while (string-match "\\([^\\\\]\\)\\(&\\)" s)
- (setq s (replace-match (concat (match-string 1 s) "\\" (match-string 2 s))
- t t s)))
- s)
-
-(defun org-remove-initial-hash (s)
- (if (string-match "\\`#" s)
- (substring s 1)
- s))
-(defvar org-latex-entities) ; defined below
-(defvar org-latex-entities-regexp) ; defined below
-
-(defun org-export-latex-preprocess (parameters)
- "Clean stuff in the LaTeX export."
- ;; Preserve line breaks
- (goto-char (point-min))
- (while (re-search-forward "\\\\\\\\" nil t)
- (add-text-properties (match-beginning 0) (match-end 0)
- '(org-protected t)))
-
- ;; Preserve latex environments
- (goto-char (point-min))
- (while (re-search-forward "^[ \t]*\\\\begin{\\([a-zA-Z]+\\*?\\)}" nil t)
- (org-if-unprotected
- (let* ((start (progn (beginning-of-line) (point)))
- (end (and (re-search-forward
- (concat "^[ \t]*\\\\end{"
- (regexp-quote (match-string 1))
- "}") nil t)
- (point-at-eol))))
- (if end
- (add-text-properties start end '(org-protected t))
- (goto-char (point-at-eol))))))
-
- ;; Preserve math snippets
-
- (let* ((matchers (plist-get org-format-latex-options :matchers))
- (re-list org-latex-regexps)
- beg end re e m n block off)
- ;; Check the different regular expressions
- (while (setq e (pop re-list))
- (setq m (car e) re (nth 1 e) n (nth 2 e)
- block (if (nth 3 e) "\n\n" ""))
- (setq off (if (member m '("$" "$1")) 1 0))
- (when (and (member m matchers) (not (equal m "begin")))
- (goto-char (point-min))
- (while (re-search-forward re nil t)
- (setq beg (+ (match-beginning 0) off) end (- (match-end 0) 0))
- (add-text-properties beg end '(org-protected t org-latex-math t))))))
-
- ;; Convert LaTeX to \LaTeX{} and TeX to \TeX{}
- (goto-char (point-min))
- (let ((case-fold-search nil))
- (while (re-search-forward "\\<\\(\\(La\\)?TeX\\)\\>" nil t)
- (unless (eq (char-before (match-beginning 1)) ?\\)
- (org-if-unprotected-1
- (replace-match (org-export-latex-protect-string
- (concat "\\" (match-string 1)
- "{}")) t t)))))
-
- ;; Convert blockquotes
- (goto-char (point-min))
- (while (search-forward "ORG-BLOCKQUOTE-START" nil t)
- (org-replace-match-keep-properties "\\begin{quote}" t t))
- (goto-char (point-min))
- (while (search-forward "ORG-BLOCKQUOTE-END" nil t)
- (org-replace-match-keep-properties "\\end{quote}" t t))
-
- ;; Convert verse
- (goto-char (point-min))
- (while (search-forward "ORG-VERSE-START" nil t)
- (org-replace-match-keep-properties "\\begin{verse}" t t)
- (beginning-of-line 2)
- (while (and (not (looking-at "[ \t]*ORG-VERSE-END.*")) (not (eobp)))
- (when (looking-at "\\([ \t]+\\)\\([^ \t\n]\\)")
- (goto-char (match-end 1))
- (org-replace-match-keep-properties
- (org-export-latex-protect-string
- (concat "\\hspace*{1cm}" (match-string 2))) t t)
- (beginning-of-line 1))
- (if (looking-at "[ \t]*$")
- (insert (org-export-latex-protect-string "\\vspace*{1em}"))
- (unless (looking-at ".*?[^ \t\n].*?\\\\\\\\[ \t]*$")
- (end-of-line 1)
- (insert "\\\\")))
- (beginning-of-line 2))
- (and (looking-at "[ \t]*ORG-VERSE-END.*")
- (org-replace-match-keep-properties "\\end{verse}" t t)))
-
- ;; Convert center
- (goto-char (point-min))
- (while (search-forward "ORG-CENTER-START" nil t)
- (org-replace-match-keep-properties "\\begin{center}" t t))
- (goto-char (point-min))
- (while (search-forward "ORG-CENTER-END" nil t)
- (org-replace-match-keep-properties "\\end{center}" t t))
-
- (run-hooks 'org-export-latex-after-blockquotes-hook)
-
- ;; Convert horizontal rules
- (goto-char (point-min))
- (while (re-search-forward "^----+.$" nil t)
- (org-if-unprotected
- (replace-match (org-export-latex-protect-string "\\hrule") t t)))
-
- ;; Protect LaTeX commands like \command[...]{...} or \command{...}
- (goto-char (point-min))
- (let ((re (concat
- "\\\\\\([a-zA-Z]+\\)"
- "\\(?:<[^<>\n]*>\\)*"
- "\\(?:\\[[^][\n]*?\\]\\)*"
- "\\(?:<[^<>\n]*>\\)*"
- "\\(" (org-create-multibrace-regexp "{" "}" 3) "\\)\\{1,3\\}")))
- (while (re-search-forward re nil t)
- (unless (or
- ;; check for comment line
- (save-excursion (goto-char (match-beginning 0))
- (org-in-indented-comment-line))
- ;; Check if this is a defined entity, so that is may need conversion
- (org-entity-get (match-string 1))
- )
- (add-text-properties (match-beginning 0) (match-end 0)
- '(org-protected t)))))
-
- ;; Special case for \nbsp
- (goto-char (point-min))
- (while (re-search-forward "\\\\nbsp\\({}\\|\\>\\)" nil t)
- (org-if-unprotected
- (replace-match (org-export-latex-protect-string "~"))))
-
- ;; Protect LaTeX entities
- (goto-char (point-min))
- (while (re-search-forward org-latex-entities-regexp nil t)
- (org-if-unprotected
- (add-text-properties (match-beginning 0) (match-end 0)
- '(org-protected t))))
-
- ;; Replace radio links
- (goto-char (point-min))
- (while (re-search-forward
- (concat "<<<?" org-export-latex-all-targets-re
- ">>>?\\((INVISIBLE)\\)?") nil t)
- (org-if-unprotected-at (+ (match-beginning 0) 2)
- (replace-match
- (concat
- (org-export-latex-protect-string
- (format "\\label{%s}" (save-match-data (org-solidify-link-text
- (match-string 1)))))
- (if (match-string 2) "" (match-string 1)))
- t t)))
-
- ;; Delete @<...> constructs
- ;; Thanks to Daniel Clemente for this regexp
- (goto-char (point-min))
- (while (re-search-forward "@<\\(?:[^\"\n]\\|\".*\"\\)*?>" nil t)
- (org-if-unprotected
- (replace-match "")))
-
- ;; When converting to LaTeX, replace footnotes
- ;; FIXME: don't protect footnotes from conversion
- (when (plist-get org-export-latex-options-plist :footnotes)
- (goto-char (point-min))
- (while (re-search-forward "\\[\\([0-9]+\\)\\]" nil t)
- (org-if-unprotected
- (when (and (save-match-data
- (save-excursion (beginning-of-line)
- (looking-at "[^:|#]")))
- (not (org-in-verbatim-emphasis)))
- (let ((foot-beg (match-beginning 0))
- (foot-end (match-end 0))
- (foot-prefix (match-string 0))
- footnote footnote-rpl)
- (save-excursion
- (if (not (re-search-forward (concat "^" (regexp-quote foot-prefix))
- nil t))
- (replace-match (org-export-latex-protect-string
- (concat "$^{" (match-string 1) "}$")))
- (replace-match "")
- (let ((end (save-excursion
- (if (re-search-forward "^$\\|^#.*$\\|\\[[0-9]+\\]" nil t)
- (match-beginning 0) (point-max)))))
- (setq footnote (concat (org-trim (buffer-substring (point) end))
- " ")) ; prevent last } being part of a link
- (delete-region (point) end))
- (goto-char foot-beg)
- (delete-region foot-beg foot-end)
- (unless (null footnote)
- (setq footnote-rpl (format "\\footnote{%s}" footnote))
- (add-text-properties 0 10 '(org-protected t) footnote-rpl)
- (add-text-properties (1- (length footnote-rpl))
- (length footnote-rpl)
- '(org-protected t) footnote-rpl)
- (if (org-on-heading-p)
- (setq footnote-rpl
- (concat (org-export-latex-protect-string "\\protect")
- footnote-rpl)))
- (insert footnote-rpl)))
- )))))
-
- ;; Remove footnote section tag for LaTeX
- (goto-char (point-min))
- (while (re-search-forward
- (concat "^" footnote-section-tag-regexp) nil t)
- (org-if-unprotected
- (replace-match "")))))
-
-(defun org-export-latex-fix-inputenc ()
- "Set the coding system in inputenc to what the buffer is."
- (let* ((cs buffer-file-coding-system)
- (opt (or (ignore-errors (latexenc-coding-system-to-inputenc cs))
- "utf8")))
- (when opt
- ;; Translate if that is requested
- (setq opt (or (cdr (assoc opt org-export-latex-inputenc-alist)) opt))
- ;; find the \usepackage statement and replace the option
- (goto-char (point-min))
- (while (re-search-forward "\\\\usepackage\\[\\(AUTO\\)\\]{inputenc}"
- nil t)
- (goto-char (match-beginning 1))
- (delete-region (match-beginning 1) (match-end 1))
- (insert opt))
- (and buffer-file-name
- (save-buffer)))))
-
-;;; List handling:
-
-(defun org-export-latex-lists ()
- "Convert plain text lists in current buffer into LaTeX lists."
- (let (res)
- (goto-char (point-min))
- (while (org-search-forward-unenclosed org-item-beginning-re nil t)
- (beginning-of-line)
- (setq res (org-list-to-latex (org-list-parse-list t)
- org-export-latex-list-parameters))
- (while (string-match "^\\(\\\\item[ \t]+\\)\\[@\\(?:start:\\)?\\([0-9]+\\)\\]"
- res)
- (setq res (replace-match
- (concat (format "\\setcounter{enumi}{%d}"
- (1- (string-to-number
- (match-string 2 res))))
- "\n"
- (match-string 1 res))
- t t res)))
- (insert res))))
-
-(defconst org-latex-entities
- '("\\!"
- "\\'"
- "\\+"
- "\\,"
- "\\-"
- "\\:"
- "\\;"
- "\\<"
- "\\="
- "\\>"
- "\\Huge"
- "\\LARGE"
- "\\Large"
- "\\Styles"
- "\\\\"
- "\\`"
- "\\addcontentsline"
- "\\address"
- "\\addtocontents"
- "\\addtocounter"
- "\\addtolength"
- "\\addvspace"
- "\\alph"
- "\\appendix"
- "\\arabic"
- "\\author"
- "\\begin{array}"
- "\\begin{center}"
- "\\begin{description}"
- "\\begin{enumerate}"
- "\\begin{eqnarray}"
- "\\begin{equation}"
- "\\begin{figure}"
- "\\begin{flushleft}"
- "\\begin{flushright}"
- "\\begin{itemize}"
- "\\begin{list}"
- "\\begin{minipage}"
- "\\begin{picture}"
- "\\begin{quotation}"
- "\\begin{quote}"
- "\\begin{tabbing}"
- "\\begin{table}"
- "\\begin{tabular}"
- "\\begin{thebibliography}"
- "\\begin{theorem}"
- "\\begin{titlepage}"
- "\\begin{verbatim}"
- "\\begin{verse}"
- "\\bf"
- "\\bf"
- "\\bibitem"
- "\\bigskip"
- "\\cdots"
- "\\centering"
- "\\circle"
- "\\cite"
- "\\cleardoublepage"
- "\\clearpage"
- "\\cline"
- "\\closing"
- "\\dashbox"
- "\\date"
- "\\ddots"
- "\\dotfill"
- "\\em"
- "\\fbox"
- "\\flushbottom"
- "\\fnsymbol"
- "\\footnote"
- "\\footnotemark"
- "\\footnotesize"
- "\\footnotetext"
- "\\frac"
- "\\frame"
- "\\framebox"
- "\\hfill"
- "\\hline"
- "\\hrulespace"
- "\\hspace"
- "\\huge"
- "\\hyphenation"
- "\\include"
- "\\includeonly"
- "\\indent"
- "\\input"
- "\\it"
- "\\kill"
- "\\label"
- "\\large"
- "\\ldots"
- "\\line"
- "\\linebreak"
- "\\linethickness"
- "\\listoffigures"
- "\\listoftables"
- "\\location"
- "\\makebox"
- "\\maketitle"
- "\\mark"
- "\\mbox"
- "\\medskip"
- "\\multicolumn"
- "\\multiput"
- "\\newcommand"
- "\\newcounter"
- "\\newenvironment"
- "\\newfont"
- "\\newlength"
- "\\newline"
- "\\newpage"
- "\\newsavebox"
- "\\newtheorem"
- "\\nocite"
- "\\nofiles"
- "\\noindent"
- "\\nolinebreak"
- "\\nopagebreak"
- "\\normalsize"
- "\\onecolumn"
- "\\opening"
- "\\oval"
- "\\overbrace"
- "\\overline"
- "\\pagebreak"
- "\\pagenumbering"
- "\\pageref"
- "\\pagestyle"
- "\\par"
- "\\parbox"
- "\\put"
- "\\raggedbottom"
- "\\raggedleft"
- "\\raggedright"
- "\\raisebox"
- "\\ref"
- "\\rm"
- "\\roman"
- "\\rule"
- "\\savebox"
- "\\sc"
- "\\scriptsize"
- "\\setcounter"
- "\\setlength"
- "\\settowidth"
- "\\sf"
- "\\shortstack"
- "\\signature"
- "\\sl"
- "\\small"
- "\\smallskip"
- "\\sqrt"
- "\\tableofcontents"
- "\\telephone"
- "\\thanks"
- "\\thispagestyle"
- "\\tiny"
- "\\title"
- "\\tt"
- "\\twocolumn"
- "\\typein"
- "\\typeout"
- "\\underbrace"
- "\\underline"
- "\\usebox"
- "\\usecounter"
- "\\value"
- "\\vdots"
- "\\vector"
- "\\verb"
- "\\vfill"
- "\\vline"
- "\\vspace")
- "A list of LaTeX commands to be protected when performing conversion.")
-
-(defconst org-latex-entities-regexp
- (let (names rest)
- (dolist (x org-latex-entities)
- (if (string-match "[a-zA-Z]$" x)
- (push x names)
- (push x rest)))
- (concat "\\(" (regexp-opt (nreverse names)) "\\>\\)"
- "\\|\\(" (regexp-opt (nreverse rest)) "\\)")))
-
-(provide 'org-export-latex)
-(provide 'org-latex)
-
-;; arch-tag: 23c2b87d-da04-4c2d-ad2d-1eb6487bc3ad
-
-;;; org-latex.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-latex.elc b/.emacs.d/org-7.4/lisp/org-latex.elc
deleted file mode 100644
index c593d87..0000000
--- a/.emacs.d/org-7.4/lisp/org-latex.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-list.el b/.emacs.d/org-7.4/lisp/org-list.el
deleted file mode 100644
index bc8e7bd..0000000
--- a/.emacs.d/org-7.4/lisp/org-list.el
+++ /dev/null
@@ -1,2292 +0,0 @@
-;;; org-list.el --- Plain lists for Org-mode
-;;
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-;;
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Bastien Guerry <bzg AT altern DOT org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file contains the code dealing with plain lists in Org-mode.
-
-;;; Code:
-
-(eval-when-compile
- (require 'cl))
-(require 'org-macs)
-(require 'org-compat)
-
-(defvar org-blank-before-new-entry)
-(defvar org-M-RET-may-split-line)
-(defvar org-complex-heading-regexp)
-(defvar org-odd-levels-only)
-(defvar org-outline-regexp)
-(defvar org-ts-regexp)
-(defvar org-ts-regexp-both)
-
-(declare-function org-invisible-p "org" ())
-(declare-function org-on-heading-p "org" (&optional invisible-ok))
-(declare-function outline-next-heading "outline" ())
-(declare-function org-back-to-heading "org" (&optional invisible-ok))
-(declare-function org-back-over-empty-lines "org" ())
-(declare-function org-trim "org" (s))
-(declare-function org-get-indentation "org" (&optional line))
-(declare-function org-timer-item "org-timer" (&optional arg))
-(declare-function org-timer-hms-to-secs "org-timer" (hms))
-(declare-function org-combine-plists "org" (&rest plists))
-(declare-function org-entry-get "org"
- (pom property &optional inherit literal-nil))
-(declare-function org-narrow-to-subtree "org" ())
-(declare-function org-show-subtree "org" ())
-(declare-function org-in-regexps-block-p "org"
- (start-re end-re &optional bound))
-(declare-function org-level-increment "org" ())
-(declare-function org-at-heading-p "org" (&optional ignored))
-(declare-function outline-previous-heading "outline" ())
-(declare-function org-icompleting-read "org" (&rest args))
-(declare-function org-time-string-to-seconds "org" (s))
-
-(defgroup org-plain-lists nil
- "Options concerning plain lists in Org-mode."
- :tag "Org Plain lists"
- :group 'org-structure)
-
-(defcustom org-cycle-include-plain-lists t
- "When t, make TAB cycle visibility on plain list items.
-Cycling plain lists works only when the cursor is on a plain list
-item. When the cursor is on an outline heading, plain lists are
-treated as text. This is the most stable way of handling this,
-which is why it is the default.
-
-When this is the symbol `integrate', then during cycling, plain
-list items will *temporarily* be interpreted as outline headlines
-with a level given by 1000+i where i is the indentation of the
-bullet. This setting can lead to strange effects when switching
-visibility to `children', because the first \"child\" in a
-subtree decides what children should be listed. If that first
-\"child\" is a plain list item with an implied large level
-number, all true children and grand children of the outline
-heading will be exposed in a children' view."
- :group 'org-plain-lists
- :type '(choice
- (const :tag "Never" nil)
- (const :tag "With cursor in plain list (recommended)" t)
- (const :tag "As children of outline headings" integrate)))
-
-(defcustom org-list-demote-modify-bullet nil
- "Default bullet type installed when demoting an item.
-This is an association list, for each bullet type, this alist will point
-to the bullet that should be used when this item is demoted.
-For example,
-
- (setq org-list-demote-modify-bullet
- '((\"+\" . \"-\") (\"-\" . \"+\") (\"*\" . \"+\")))
-
-will make
-
- + Movies
- + Silence of the Lambs
- + My Cousin Vinny
- + Books
- + The Hunt for Red October
- + The Road to Omaha
-
-into
-
- + Movies
- - Silence of the Lambs
- - My Cousin Vinny
- + Books
- - The Hunt for Red October
- - The Road to Omaha"
- :group 'org-plain-lists
- :type '(repeat
- (cons
- (choice :tag "If the current bullet is "
- (const "-")
- (const "+")
- (const "*")
- (const "1.")
- (const "1)"))
- (choice :tag "demotion will change it to"
- (const "-")
- (const "+")
- (const "*")
- (const "1.")
- (const "1)")))))
-
-(defcustom org-plain-list-ordered-item-terminator t
- "The character that makes a line with leading number an ordered list item.
-Valid values are ?. and ?\). To get both terminators, use t. While
-?. may look nicer, it creates the danger that a line with leading
-number may be incorrectly interpreted as an item. ?\) therefore is
-the safe choice."
- :group 'org-plain-lists
- :type '(choice (const :tag "dot like in \"2.\"" ?.)
- (const :tag "paren like in \"2)\"" ?\))
- (const :tab "both" t)))
-
-(defcustom org-list-two-spaces-after-bullet-regexp nil
- "A regular expression matching bullets that should have 2 spaces after them.
-When nil, no bullet will have two spaces after them.
-When a string, it will be used as a regular expression. When the
-bullet type of a list is changed, the new bullet type will be
-matched against this regexp. If it matches, there will be two
-spaces instead of one after the bullet in each item of the list."
- :group 'org-plain-lists
- :type '(choice
- (const :tag "never" nil)
- (regexp)))
-
-(defcustom org-list-ending-method 'both
- "Determine where plain lists should end.
-Valid values are: `regexp', `indent' or `both'.
-
-When set to `regexp', Org will look into two variables,
-`org-empty-line-terminates-plain-lists' and the more general
-`org-list-end-regexp', to determine what will end lists. This is
-the fastest method.
-
-When set to `indent', a list will end whenever a line following
-an item, but not starting one, is less or equally indented than
-it.
-
-When set to `both', each of the preceding methods is applied to
-determine lists endings. This is the default method."
- :group 'org-plain-lists
- :type '(choice
- (const :tag "With a regexp defining ending" regexp)
- (const :tag "With indentation of regular (no bullet) text" indent)
- (const :tag "With both methods" both)))
-
-(defcustom org-empty-line-terminates-plain-lists nil
- "Non-nil means an empty line ends all plain list levels.
-This variable only makes sense if `org-list-ending-method' is set
-to `regexp' or `both'. This is then equivalent to set
-`org-list-end-regexp' to \"^[ \\t]*$\"."
- :group 'org-plain-lists
- :type 'boolean)
-
-(defcustom org-list-end-regexp "^[ \t]*\n[ \t]*\n"
- "Regexp matching the end of all plain list levels.
-It must start with \"^\" and end with \"\\n\". It defaults to 2
-blank lines. `org-empty-line-terminates-plain-lists' has
-precedence over it."
- :group 'org-plain-lists
- :type 'string)
-
-(defcustom org-list-automatic-rules '((bullet . t)
- (checkbox . t)
- (indent . t)
- (insert . t))
- "Non-nil means apply set of rules when acting on lists.
-By default, automatic actions are taken when using
- \\[org-meta-return], \\[org-metaright], \\[org-metaleft],
- \\[org-shiftmetaright], \\[org-shiftmetaleft],
- \\[org-ctrl-c-minus], \\[org-toggle-checkbox] or
- \\[org-insert-todo-heading]. You can disable individually these
- rules by setting them to nil. Valid rules are:
-
-bullet when non-nil, cycling bullet do not allow lists at
- column 0 to have * as a bullet and descriptions lists
- to be numbered.
-checkbox when non-nil, checkbox statistics is updated each time
- you either insert a new checkbox or toggle a checkbox.
- It also prevents from inserting a checkbox in a
- description item.
-indent when non-nil, indenting or outdenting list top-item
- with its subtree will move the whole list and
- outdenting a list whose bullet is * to column 0 will
- change that bullet to -
-insert when non-nil, trying to insert an item inside a block
- will insert it right before the block instead of
- throwing an error."
- :group 'org-plain-lists
- :type '(alist :tag "Sets of rules"
- :key-type
- (choice
- (const :tag "Bullet" bullet)
- (const :tag "Checkbox" checkbox)
- (const :tag "Indent" indent)
- (const :tag "Insert" insert))
- :value-type
- (boolean :tag "Activate" :value t)))
-
-(defcustom org-hierarchical-checkbox-statistics t
- "Non-nil means checkbox statistics counts only the state of direct children.
-When nil, all boxes below the cookie are counted.
-This can be set to nil on a per-node basis using a COOKIE_DATA property
-with the word \"recursive\" in the value."
- :group 'org-plain-lists
- :type 'boolean)
-
-(defcustom org-description-max-indent 20
- "Maximum indentation for the second line of a description list.
-When the indentation would be larger than this, it will become
-5 characters instead."
- :group 'org-plain-lists
- :type 'integer)
-
-(defcustom org-list-radio-list-templates
- '((latex-mode "% BEGIN RECEIVE ORGLST %n
-% END RECEIVE ORGLST %n
-\\begin{comment}
-#+ORGLST: SEND %n org-list-to-latex
--
-\\end{comment}\n")
- (texinfo-mode "@c BEGIN RECEIVE ORGLST %n
-@c END RECEIVE ORGLST %n
-@ignore
-#+ORGLST: SEND %n org-list-to-texinfo
--
-@end ignore\n")
- (html-mode "<!-- BEGIN RECEIVE ORGLST %n -->
-<!-- END RECEIVE ORGLST %n -->
-<!--
-#+ORGLST: SEND %n org-list-to-html
--
--->\n"))
- "Templates for radio lists in different major modes.
-All occurrences of %n in a template will be replaced with the name of the
-list, obtained by prompting the user."
- :group 'org-plain-lists
- :type '(repeat
- (list (symbol :tag "Major mode")
- (string :tag "Format"))))
-
-;;; Internal functions
-
-(defun org-list-end-re ()
- "Return the regex corresponding to the end of a list.
-It depends on `org-empty-line-terminates-plain-lists'."
- (if org-empty-line-terminates-plain-lists
- "^[ \t]*\n"
- org-list-end-regexp))
-
-(defun org-item-re (&optional general)
- "Return the correct regular expression for plain lists.
-If GENERAL is non-nil, return the general regexp independent of the value
-of `org-plain-list-ordered-item-terminator'."
- (cond
- ((or general (eq org-plain-list-ordered-item-terminator t))
- "\\([ \t]*\\([-+]\\|\\([0-9]+[.)]\\)\\)\\|[ \t]+\\*\\)\\([ \t]+\\|$\\)")
- ((= org-plain-list-ordered-item-terminator ?.)
- "\\([ \t]*\\([-+]\\|\\([0-9]+\\.\\)\\)\\|[ \t]+\\*\\)\\([ \t]+\\|$\\)")
- ((= org-plain-list-ordered-item-terminator ?\))
- "\\([ \t]*\\([-+]\\|\\([0-9]+)\\)\\)\\|[ \t]+\\*\\)\\([ \t]+\\|$\\)")
- (t (error "Invalid value of `org-plain-list-ordered-item-terminator'"))))
-
-(defconst org-item-beginning-re (concat "^" (org-item-re))
- "Regexp matching the beginning of a plain list item.")
-
-(defun org-list-ending-between (min max &optional firstp)
- "Find the position of a list ending between MIN and MAX, or nil.
-This function looks for `org-list-end-re' outside a block.
-
-If FIRSTP in non-nil, return the point at the beginning of the
-nearest valid terminator from MIN. Otherwise, return the point at
-the end of the nearest terminator from MAX."
- (save-excursion
- (let* ((start (if firstp min max))
- (end (if firstp max min))
- (search-fun (if firstp
- #'org-search-forward-unenclosed
- #'org-search-backward-unenclosed))
- (list-end-p (progn
- (goto-char start)
- (funcall search-fun (org-list-end-re) end t))))
- ;; Is there a valid list ending somewhere ?
- (and list-end-p
- ;; we want to be on the first line of the list ender
- (match-beginning 0)))))
-
-(defun org-list-maybe-skip-block (search limit)
- "Return non-nil value if point is in a block, skipping it on the way.
-It looks for the boundary of the block in SEARCH direction,
-stopping at LIMIT."
- (save-match-data
- (let ((case-fold-search t)
- (boundary (if (eq search 're-search-forward) 3 5)))
- (when (save-excursion
- (and (funcall search "^[ \t]*#\\+\\(begin\\|end\\)_" limit t)
- (= (length (match-string 1)) boundary)))
- ;; We're in a block: get out of it
- (goto-char (match-beginning 0))))))
-
-(defun org-list-search-unenclosed-generic (search re bound noerr)
- "Search a string outside blocks and protected places.
-Arguments SEARCH, RE, BOUND and NOERR are similar to those in
-`search-forward', `search-backward', `re-search-forward' and
-`re-search-backward'."
- (catch 'exit
- (let ((origin (point)))
- (while t
- ;; 1. No match: return to origin or bound, depending on NOERR.
- (unless (funcall search re bound noerr)
- (throw 'exit (and (goto-char (if (memq noerr '(t nil)) origin bound))
- nil)))
- ;; 2. Match not in block or protected: return point. Else
- ;; skip the block and carry on.
- (unless (or (get-text-property (match-beginning 0) 'org-protected)
- (org-list-maybe-skip-block search bound))
- (throw 'exit (point)))))))
-
-(defun org-search-backward-unenclosed (regexp &optional bound noerror)
- "Like `re-search-backward' but don't stop inside blocks or protected places.
-Arguments REGEXP, BOUND and NOERROR are similar to those used in
-`re-search-backward'."
- (org-list-search-unenclosed-generic
- #'re-search-backward regexp (or bound (point-min)) noerror))
-
-(defun org-search-forward-unenclosed (regexp &optional bound noerror)
- "Like `re-search-forward' but don't stop inside blocks or protected places.
-Arguments REGEXP, BOUND and NOERROR are similar to those used in
-`re-search-forward'."
- (org-list-search-unenclosed-generic
- #'re-search-forward regexp (or bound (point-max)) noerror))
-
-(defun org-list-in-item-p-with-indent (limit)
- "Is the cursor inside a plain list?
-Plain lists are considered ending when a non-blank line is less
-indented than the previous item within LIMIT."
- (save-excursion
- (beginning-of-line)
- (cond
- ;; do not start searching inside a block...
- ((org-list-maybe-skip-block #'re-search-backward limit))
- ;; ... or at a blank line
- ((looking-at "^[ \t]*$")
- (skip-chars-backward " \r\t\n")
- (beginning-of-line)))
- (beginning-of-line)
- (or (org-at-item-p)
- (let* ((case-fold-search t)
- (ind-ref (org-get-indentation))
- ;; Ensure there is at least an item above
- (up-item-p (save-excursion
- (org-search-backward-unenclosed
- org-item-beginning-re limit t))))
- (and up-item-p
- (catch 'exit
- (while t
- (cond
- ((org-at-item-p)
- (throw 'exit (< (org-get-indentation) ind-ref)))
- ((looking-at "^[ \t]*$")
- (skip-chars-backward " \r\t\n")
- (beginning-of-line))
- ((looking-at "^[ \t]*#\\+end_")
- (re-search-backward "^[ \t]*#\\+begin_"))
- (t
- (setq ind-ref (min (org-get-indentation) ind-ref))
- (forward-line -1))))))))))
-
-(defun org-list-in-item-p-with-regexp (limit)
- "Is the cursor inside a plain list?
-Plain lists end when `org-list-end-regexp' is matched, or at a
-blank line if `org-empty-line-terminates-plain-lists' is true.
-
-Argument LIMIT specifies the upper-bound of the search."
- (save-excursion
- (let* ((actual-pos (goto-char (point-at-eol)))
- ;; Moved to eol so current line can be matched by
- ;; `org-item-re'.
- (last-item-start (save-excursion
- (org-search-backward-unenclosed
- org-item-beginning-re limit t)))
- (list-ender (org-list-ending-between
- last-item-start actual-pos)))
- ;; We are in a list when we are on an item line or when we can
- ;; find an item before point and there is no valid list ender
- ;; between it and the point.
- (and last-item-start (not list-ender)))))
-
-(defun org-list-top-point-with-regexp (limit)
- "Return point at the top level item in a list.
-Argument LIMIT specifies the upper-bound of the search.
-
-List ending is determined by regexp. See
-`org-list-ending-method'. for more information."
- (save-excursion
- (let ((pos (point-at-eol)))
- ;; Is there some list above this one ? If so, go to its ending.
- ;; Otherwise, go back to the heading above or bob.
- (goto-char (or (org-list-ending-between limit pos) limit))
- ;; From there, search down our list.
- (org-search-forward-unenclosed org-item-beginning-re pos t)
- (point-at-bol))))
-
-(defun org-list-bottom-point-with-regexp (limit)
- "Return point just before list ending.
-Argument LIMIT specifies the lower-bound of the search.
-
-List ending is determined by regexp. See
-`org-list-ending-method'. for more information."
- (save-excursion
- (let ((pos (org-get-item-beginning)))
- ;; The list ending is either first point matching
- ;; `org-list-end-re', point at first white-line before next
- ;; heading, or eob.
- (or (org-list-ending-between (min pos limit) limit t) limit))))
-
-(defun org-list-top-point-with-indent (limit)
- "Return point at the top level in a list.
-Argument LIMIT specifies the upper-bound of the search.
-
-List ending is determined by indentation of text. See
-`org-list-ending-method'. for more information."
- (save-excursion
- (let ((case-fold-search t))
- (let ((item-ref (goto-char (org-get-item-beginning)))
- (ind-ref 10000))
- (forward-line -1)
- (catch 'exit
- (while t
- (let ((ind (+ (or (get-text-property (point) 'original-indentation) 0)
- (org-get-indentation))))
- (cond
- ((looking-at "^[ \t]*:END:")
- (throw 'exit item-ref))
- ((<= (point) limit)
- (throw 'exit
- (if (and (org-at-item-p) (< ind ind-ref))
- (point-at-bol)
- item-ref)))
- ((looking-at "^[ \t]*$")
- (skip-chars-backward " \r\t\n")
- (beginning-of-line))
- ((looking-at "^[ \t]*#\\+end_")
- (re-search-backward "^[ \t]*#\\+begin_"))
- ((not (org-at-item-p))
- (setq ind-ref (min ind ind-ref))
- (forward-line -1))
- ((>= ind ind-ref)
- (throw 'exit item-ref))
- (t
- (setq item-ref (point-at-bol) ind-ref 10000)
- (forward-line -1))))))))))
-
-(defun org-list-bottom-point-with-indent (limit)
- "Return point just before list ending or nil if not in a list.
-Argument LIMIT specifies the lower-bound of the search.
-
-List ending is determined by the indentation of text. See
-`org-list-ending-method' for more information."
- (save-excursion
- (let ((ind-ref (progn
- (goto-char (org-get-item-beginning))
- (org-get-indentation)))
- (case-fold-search t))
- ;; do not start inside a block
- (org-list-maybe-skip-block #'re-search-forward limit)
- (beginning-of-line)
- (catch 'exit
- (while t
- (skip-chars-forward " \t")
- (let ((ind (+ (or (get-text-property (point) 'original-indentation) 0)
- (org-get-indentation))))
- (cond
- ((or (>= (point) limit)
- (looking-at ":END:"))
- (throw 'exit (progn
- ;; Ensure bottom is just after a
- ;; non-blank line.
- (skip-chars-backward " \r\t\n")
- (min (point-max) (1+ (point-at-eol))))))
- ((= (point) (point-at-eol))
- (skip-chars-forward " \r\t\n")
- (beginning-of-line))
- ((org-at-item-p)
- (setq ind-ref ind)
- (forward-line 1))
- ((<= ind ind-ref)
- (throw 'exit (progn
- ;; Again, ensure bottom is just after a
- ;; non-blank line.
- (skip-chars-backward " \r\t\n")
- (min (point-max) (1+ (point-at-eol))))))
- ((looking-at "#\\+begin_")
- (re-search-forward "[ \t]*#\\+end_")
- (forward-line 1))
- (t (forward-line 1)))))))))
-
-(defun org-list-at-regexp-after-bullet-p (regexp)
- "Is point at a list item with REGEXP after bullet?"
- (and (org-at-item-p)
- (save-excursion
- (goto-char (match-end 0))
- ;; Ignore counter if any
- (when (looking-at "\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?")
- (goto-char (match-end 0)))
- (looking-at regexp))))
-
-(defun org-list-get-item-same-level (search-fun pos limit pre-move)
- "Return point at the beginning of next item at the same level.
-Search items using function SEARCH-FUN, from POS to LIMIT. It
-uses PRE-MOVE before search. Return nil if no item was found."
- (save-excursion
- (goto-char pos)
- (let* ((start (org-get-item-beginning))
- (ind (progn (goto-char start) (org-get-indentation))))
- ;; We don't want to match the current line.
- (funcall pre-move)
- ;; Skip any sublist on the way
- (while (and (funcall search-fun org-item-beginning-re limit t)
- (> (org-get-indentation) ind)))
- (when (and (/= (point-at-bol) start) ; Have we moved ?
- (= (org-get-indentation) ind))
- (point-at-bol)))))
-
-(defun org-list-separating-blank-lines-number (pos top bottom)
- "Return number of blank lines that should separate items in list.
-POS is the position of point to be considered.
-
-TOP and BOTTOM are respectively position of list beginning and
-list ending.
-
-Assume point is at item's beginning. If the item is alone, apply
-some heuristics to guess the result."
- (save-excursion
- (let ((insert-blank-p
- (cdr (assq 'plain-list-item org-blank-before-new-entry)))
- usr-blank)
- (cond
- ;; Trivial cases where there should be none.
- ((or (and (not (eq org-list-ending-method 'indent))
- org-empty-line-terminates-plain-lists)
- (not insert-blank-p)) 0)
- ;; When `org-blank-before-new-entry' says so, it is 1.
- ((eq insert-blank-p t) 1)
- ;; plain-list-item is 'auto. Count blank lines separating
- ;; neighbours items in list.
- (t (let ((next-p (org-get-next-item (point) bottom)))
- (cond
- ;; Is there a next item?
- (next-p (goto-char next-p)
- (org-back-over-empty-lines))
- ;; Is there a previous item?
- ((org-get-previous-item (point) top)
- (org-back-over-empty-lines))
- ;; User inserted blank lines, trust him
- ((and (> pos (org-end-of-item-before-blank bottom))
- (> (save-excursion
- (goto-char pos)
- (skip-chars-backward " \t")
- (setq usr-blank (org-back-over-empty-lines))) 0))
- usr-blank)
- ;; Are there blank lines inside the item ?
- ((save-excursion
- (org-search-forward-unenclosed
- "^[ \t]*$" (org-end-of-item-before-blank bottom) t)) 1)
- ;; No parent: no blank line.
- (t 0))))))))
-
-(defun org-list-insert-item-generic (pos &optional checkbox after-bullet)
- "Insert a new list item at POS.
-If POS is before first character after bullet of the item, the
-new item will be created before the current one.
-
-Insert a checkbox if CHECKBOX is non-nil, and string AFTER-BULLET
-after the bullet. Cursor will be after this text once the
-function ends."
- (goto-char pos)
- ;; Is point in a special block?
- (when (org-in-regexps-block-p
- "^[ \t]*#\\+\\(begin\\|BEGIN\\)_\\([a-zA-Z0-9_]+\\)"
- '(concat "^[ \t]*#\\+\\(end\\|END\\)_" (match-string 2)))
- (if (not (cdr (assq 'insert org-list-automatic-rules)))
- ;; Rule in `org-list-automatic-rules' forbids insertion.
- (error "Cannot insert item inside a block")
- ;; Else, move before it prior to add a new item.
- (end-of-line)
- (re-search-backward "^[ \t]*#\\+\\(begin\\|BEGIN\\)_" nil t)
- (end-of-line 0)))
- (let* ((true-pos (point))
- (top (org-list-top-point))
- (bottom (copy-marker (org-list-bottom-point)))
- (bullet (and (goto-char (org-get-item-beginning))
- (org-list-bullet-string (org-get-bullet))))
- (ind (org-get-indentation))
- (before-p (progn
- ;; Description item: text starts after colons.
- (or (org-at-item-description-p)
- ;; At a checkbox: text starts after it.
- (org-at-item-checkbox-p)
- ;; Otherwise, text starts after bullet.
- (org-at-item-p))
- (<= true-pos (match-end 0))))
- (blank-lines-nb (org-list-separating-blank-lines-number
- true-pos top bottom))
- (insert-fun
- (lambda (text)
- ;; insert bullet above item in order to avoid bothering
- ;; with possible blank lines ending last item.
- (goto-char (org-get-item-beginning))
- (org-indent-to-column ind)
- (insert (concat bullet (when checkbox "[ ] ") after-bullet))
- ;; Stay between after-bullet and before text.
- (save-excursion
- (insert (concat text (make-string (1+ blank-lines-nb) ?\n))))
- (unless before-p
- ;; store bottom: exchanging items doesn't change list
- ;; bottom point but will modify marker anyway
- (setq bottom (marker-position bottom))
- (let ((col (current-column)))
- (org-list-exchange-items
- (org-get-item-beginning) (org-get-next-item (point) bottom)
- bottom)
- ;; recompute next-item: last sexp modified list
- (goto-char (org-get-next-item (point) bottom))
- (org-move-to-column col)))
- ;; checkbox update might modify bottom point, so use a
- ;; marker here
- (setq bottom (copy-marker bottom))
- (when checkbox (org-update-checkbox-count-maybe))
- (org-list-repair nil top bottom))))
- (goto-char true-pos)
- (cond
- (before-p (funcall insert-fun nil) t)
- ;; Can't split item: insert bullet at the end of item.
- ((not (org-get-alist-option org-M-RET-may-split-line 'item))
- (funcall insert-fun nil) t)
- ;; else, insert a new bullet along with everything from point
- ;; down to last non-blank line of item.
- (t
- (delete-horizontal-space)
- ;; Get pos again in case previous command modified line.
- (let* ((pos (point))
- (end-before-blank (org-end-of-item-before-blank bottom))
- (after-text
- (when (< pos end-before-blank)
- (prog1
- (delete-and-extract-region pos end-before-blank)
- ;; delete any blank line at and before point.
- (beginning-of-line)
- (while (looking-at "^[ \t]*$")
- (delete-region (point-at-bol) (1+ (point-at-eol)))
- (beginning-of-line 0))))))
- (funcall insert-fun after-text) t)))))
-
-(defvar org-last-indent-begin-marker (make-marker))
-(defvar org-last-indent-end-marker (make-marker))
-
-(defun org-list-indent-item-generic (arg no-subtree top bottom)
- "Indent a local list item including its children.
-When number ARG is a negative, item will be outdented, otherwise
-it will be indented.
-
-If a region is active, all items inside will be moved.
-
-If NO-SUBTREE is non-nil, only indent the item itself, not its
-children.
-
-TOP and BOTTOM are respectively position at item beginning and at
-item ending.
-
-Return t if successful."
- (let* ((regionp (org-region-active-p))
- (rbeg (and regionp (region-beginning)))
- (rend (and regionp (region-end))))
- (cond
- ((and regionp
- (goto-char rbeg)
- (not (org-search-forward-unenclosed org-item-beginning-re rend t)))
- (error "No item in region"))
- ((not (org-at-item-p))
- (error "Not on an item"))
- (t
- ;; Are we going to move the whole list?
- (let* ((specialp (and (cdr (assq 'indent org-list-automatic-rules))
- (not no-subtree)
- (= top (point-at-bol)))))
- ;; Determine begin and end points of zone to indent. If moving
- ;; more than one item, ensure we keep them on subsequent moves.
- (unless (and (memq last-command '(org-shiftmetaright org-shiftmetaleft))
- (memq this-command '(org-shiftmetaright org-shiftmetaleft)))
- (if regionp
- (progn
- (set-marker org-last-indent-begin-marker rbeg)
- (set-marker org-last-indent-end-marker rend))
- (set-marker org-last-indent-begin-marker (point-at-bol))
- (set-marker org-last-indent-end-marker
- (save-excursion
- (cond
- (specialp bottom)
- (no-subtree (org-end-of-item-or-at-child bottom))
- (t (org-get-end-of-item bottom)))))))
- ;; Get everything ready
- (let* ((beg (marker-position org-last-indent-begin-marker))
- (end (marker-position org-last-indent-end-marker))
- (struct (org-list-struct
- beg end top (if specialp end bottom) (< arg 0)))
- (origins (org-list-struct-origins struct))
- (beg-item (assq beg struct)))
- (cond
- ;; Special case: moving top-item with indent rule
- (specialp
- (let* ((level-skip (org-level-increment))
- (offset (if (< arg 0) (- level-skip) level-skip))
- (top-ind (nth 1 beg-item)))
- (if (< (+ top-ind offset) 0)
- (error "Cannot outdent beyond margin")
- ;; Change bullet if necessary
- (when (and (= (+ top-ind offset) 0)
- (string-match "*" (nth 2 beg-item)))
- (setcdr beg-item (list (nth 1 beg-item)
- (org-list-bullet-string "-"))))
- ;; Shift ancestor
- (let ((anc (car struct)))
- (setcdr anc (list (+ (nth 1 anc) offset) "" nil)))
- (org-list-struct-fix-struct struct origins)
- (org-list-struct-apply-struct struct end))))
- ;; Forbidden move
- ((and (< arg 0)
- (or (and no-subtree
- (not regionp)
- (org-list-struct-get-child beg-item struct))
- (let ((last-item (save-excursion
- (goto-char end)
- (skip-chars-backward " \r\t\n")
- (goto-char (org-get-item-beginning))
- (org-list-struct-assoc-at-point))))
- (org-list-struct-get-child last-item struct))))
- (error "Cannot outdent an item without its children"))
- ;; Normal shifting
- (t
- (let* ((shifted-ori (if (< arg 0)
- (org-list-struct-outdent beg end origins)
- (org-list-struct-indent beg end origins struct))))
- (org-list-struct-fix-struct struct shifted-ori)
- (org-list-struct-apply-struct struct bottom))))))))))
-
-;;; Predicates
-
-(defun org-in-item-p ()
- "Is the cursor inside a plain list?
-This checks `org-list-ending-method'."
- (unless (let ((outline-regexp org-outline-regexp)) (org-at-heading-p))
- (let* ((prev-head (save-excursion (outline-previous-heading)))
- (bound (if prev-head
- (or (save-excursion
- (let ((case-fold-search t))
- (re-search-backward "^[ \t]*:END:" prev-head t)))
- prev-head)
- (point-min))))
- (cond
- ((eq org-list-ending-method 'regexp)
- (org-list-in-item-p-with-regexp bound))
- ((eq org-list-ending-method 'indent)
- (org-list-in-item-p-with-indent bound))
- (t (and (org-list-in-item-p-with-regexp bound)
- (org-list-in-item-p-with-indent bound)))))))
-
-(defun org-list-first-item-p (top)
- "Is this item the first item in a plain list?
-Assume point is at an item.
-
-TOP is the position of list's top-item."
- (save-excursion
- (beginning-of-line)
- (let ((ind (org-get-indentation)))
- (or (not (org-search-backward-unenclosed org-item-beginning-re top t))
- (< (org-get-indentation) ind)))))
-
-(defun org-at-item-p ()
- "Is point in a line starting a hand-formatted item?"
- (save-excursion
- (beginning-of-line) (looking-at org-item-beginning-re)))
-
-(defun org-at-item-bullet-p ()
- "Is point at the bullet of a plain list item?"
- (and (org-at-item-p)
- (not (member (char-after) '(?\ ?\t)))
- (< (point) (match-end 0))))
-
-(defun org-at-item-timer-p ()
- "Is point at a line starting a plain list item with a timer?"
- (org-list-at-regexp-after-bullet-p
- "\\([0-9]+:[0-9]+:[0-9]+\\)[ \t]+::[ \t]+"))
-
-(defun org-at-item-description-p ()
- "Is point at a description list item?"
- (org-list-at-regexp-after-bullet-p "\\(\\S-.+\\)[ \t]+::[ \t]+"))
-
-(defun org-at-item-checkbox-p ()
- "Is point at a line starting a plain-list item with a checklet?"
- (org-list-at-regexp-after-bullet-p "\\(\\[[- X]\\]\\)[ \t]+"))
-
-(defun org-checkbox-blocked-p ()
- "Is the current checkbox blocked from for being checked now?
-A checkbox is blocked if all of the following conditions are fulfilled:
-
-1. The checkbox is not checked already.
-2. The current entry has the ORDERED property set.
-3. There is an unchecked checkbox in this entry before the current line."
- (catch 'exit
- (save-match-data
- (save-excursion
- (unless (org-at-item-checkbox-p) (throw 'exit nil))
- (when (equal (match-string 1) "[X]")
- ;; the box is already checked!
- (throw 'exit nil))
- (let ((end (point-at-bol)))
- (condition-case nil (org-back-to-heading t)
- (error (throw 'exit nil)))
- (unless (org-entry-get nil "ORDERED") (throw 'exit nil))
- (when (org-search-forward-unenclosed
- "^[ \t]*[-+*0-9.)]+[ \t]+\\(\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\[[- ]\\]" end t)
- (org-current-line)))))))
-
-;;; Navigate
-
-;; Every interactive navigation function is derived from a
-;; non-interactive one, which doesn't move point, assumes point is
-;; already in a list and doesn't compute list boundaries.
-
-;; If you plan to use more than one org-list function is some code,
-;; you should therefore first check if point is in a list with
-;; `org-in-item-p' or `org-at-item-p', then compute list boundaries
-;; with `org-list-top-point' and `org-list-bottom-point', and make use
-;; of non-interactive forms.
-
-(defun org-list-top-point ()
- "Return point at the top level in a list.
-Assume point is in a list."
- (let* ((prev-head (save-excursion (outline-previous-heading)))
- (bound (if prev-head
- (or (save-excursion
- (let ((case-fold-search t))
- (re-search-backward "^[ \t]*:END:" prev-head t)))
- prev-head)
- (point-min))))
- (cond
- ((eq org-list-ending-method 'regexp)
- (org-list-top-point-with-regexp bound))
- ((eq org-list-ending-method 'indent)
- (org-list-top-point-with-indent bound))
- (t (let ((top-re (org-list-top-point-with-regexp bound)))
- (org-list-top-point-with-indent (or top-re bound)))))))
-
-(defun org-list-bottom-point ()
- "Return point just before list ending.
-Assume point is in a list."
- (let* ((next-head (save-excursion
- (and (let ((outline-regexp org-outline-regexp))
- ;; Use default regexp because folding
- ;; changes OUTLINE-REGEXP.
- (outline-next-heading)))))
- (limit (or (save-excursion
- (and (re-search-forward "^[ \t]*:END:" next-head t)
- (point-at-bol)))
- next-head
- (point-max))))
- (cond
- ((eq org-list-ending-method 'regexp)
- (org-list-bottom-point-with-regexp limit))
- ((eq org-list-ending-method 'indent)
- (org-list-bottom-point-with-indent limit))
- (t (let ((bottom-re (org-list-bottom-point-with-regexp limit)))
- (org-list-bottom-point-with-indent (or bottom-re limit)))))))
-
-(defun org-get-item-beginning ()
- "Return position of current item beginning."
- (save-excursion
- ;; possibly match current line
- (end-of-line)
- (org-search-backward-unenclosed org-item-beginning-re nil t)
- (point-at-bol)))
-
-(defun org-beginning-of-item ()
- "Go to the beginning of the current hand-formatted item.
-If the cursor is not in an item, throw an error."
- (interactive)
- (if (org-in-item-p)
- (goto-char (org-get-item-beginning))
- (error "Not in an item")))
-
-(defun org-get-beginning-of-list (top)
- "Return position of the first item of the current list or sublist.
-TOP is the position at list beginning."
- (save-excursion
- (let (prev-p)
- (while (setq prev-p (org-get-previous-item (point) top))
- (goto-char prev-p))
- (point-at-bol))))
-
-(defun org-beginning-of-item-list ()
- "Go to the beginning item of the current list or sublist.
-Return an error if not in a list."
- (interactive)
- (if (org-in-item-p)
- (goto-char (org-get-beginning-of-list (org-list-top-point)))
- (error "Not in an item")))
-
-(defun org-get-end-of-list (bottom)
- "Return position at the end of the current list or sublist.
-BOTTOM is the position at list ending."
- (save-excursion
- (goto-char (org-get-item-beginning))
- (let ((ind (org-get-indentation)))
- (while (and (/= (point) bottom)
- (>= (org-get-indentation) ind))
- (org-search-forward-unenclosed org-item-beginning-re bottom 'move))
- (if (= (point) bottom) bottom (point-at-bol)))))
-
-(defun org-end-of-item-list ()
- "Go to the end of the current list or sublist.
-If the cursor in not in an item, throw an error."
- (interactive)
- (if (org-in-item-p)
- (goto-char (org-get-end-of-list (org-list-bottom-point)))
- (error "Not in an item")))
-
-(defun org-get-end-of-item (bottom)
- "Return position at the end of the current item.
-BOTTOM is the position at list ending."
- (or (org-get-next-item (point) bottom)
- (org-get-end-of-list bottom)))
-
-(defun org-end-of-item ()
- "Go to the end of the current hand-formatted item.
-If the cursor is not in an item, throw an error."
- (interactive)
- (if (org-in-item-p)
- (goto-char (org-get-end-of-item (org-list-bottom-point)))
- (error "Not in an item")))
-
-(defun org-end-of-item-or-at-child (bottom)
- "Move to the end of the item, stops before the first child if any.
-BOTTOM is the position at list ending."
- (end-of-line)
- (goto-char
- (if (org-search-forward-unenclosed org-item-beginning-re bottom t)
- (point-at-bol)
- (org-get-end-of-item bottom))))
-
-(defun org-end-of-item-before-blank (bottom)
- "Return point at end of item, before any blank line.
-Point returned is at eol.
-
-BOTTOM is the position at list ending."
- (save-excursion
- (goto-char (org-get-end-of-item bottom))
- (skip-chars-backward " \r\t\n")
- (point-at-eol)))
-
-(defun org-get-previous-item (pos limit)
- "Return point of the previous item at the same level as POS.
-Stop searching at LIMIT. Return nil if no item is found."
- (org-list-get-item-same-level
- #'org-search-backward-unenclosed pos limit #'beginning-of-line))
-
-(defun org-previous-item ()
- "Move to the beginning of the previous item.
-Item is at the same level in the current plain list. Error if not
-in a plain list, or if this is the first item in the list."
- (interactive)
- (if (not (org-in-item-p))
- (error "Not in an item")
- (let ((prev-p (org-get-previous-item (point) (org-list-top-point))))
- (if prev-p (goto-char prev-p) (error "On first item")))))
-
-(defun org-get-next-item (pos limit)
- "Return point of the next item at the same level as POS.
-Stop searching at LIMIT. Return nil if no item is found."
- (org-list-get-item-same-level
- #'org-search-forward-unenclosed pos limit #'end-of-line))
-
-(defun org-next-item ()
- "Move to the beginning of the next item.
-Item is at the same level in the current plain list. Error if not
-in a plain list, or if this is the last item in the list."
- (interactive)
- (if (not (org-in-item-p))
- (error "Not in an item")
- (let ((next-p (org-get-next-item (point) (org-list-bottom-point))))
- (if next-p (goto-char next-p) (error "On last item")))))
-
-;;; Manipulate
-
-(defun org-list-exchange-items (beg-A beg-B bottom)
- "Swap item starting at BEG-A with item starting at BEG-B.
-Blank lines at the end of items are left in place. Assume BEG-A
-is lesser than BEG-B.
-
-BOTTOM is the position at list ending."
- (save-excursion
- (let* ((end-of-item-no-blank
- (lambda (pos)
- (goto-char pos)
- (goto-char (org-end-of-item-before-blank bottom))))
- (end-A-no-blank (funcall end-of-item-no-blank beg-A))
- (end-B-no-blank (funcall end-of-item-no-blank beg-B))
- (body-A (buffer-substring beg-A end-A-no-blank))
- (body-B (buffer-substring beg-B end-B-no-blank))
- (between-A-no-blank-and-B (buffer-substring end-A-no-blank beg-B)))
- (goto-char beg-A)
- (delete-region beg-A end-B-no-blank)
- (insert (concat body-B between-A-no-blank-and-B body-A)))))
-
-(defun org-move-item-down ()
- "Move the plain list item at point down, i.e. swap with following item.
-Subitems (items with larger indentation) are considered part of the item,
-so this really moves item trees."
- (interactive)
- (if (not (org-at-item-p))
- (error "Not at an item")
- (let* ((pos (point))
- (col (current-column))
- (bottom (org-list-bottom-point))
- (actual-item (goto-char (org-get-item-beginning)))
- (next-item (org-get-next-item (point) bottom)))
- (if (not next-item)
- (progn
- (goto-char pos)
- (error "Cannot move this item further down"))
- (org-list-exchange-items actual-item next-item bottom)
- (org-list-repair nil nil bottom)
- (goto-char (org-get-next-item (point) bottom))
- (org-move-to-column col)))))
-
-(defun org-move-item-up ()
- "Move the plain list item at point up, i.e. swap with previous item.
-Subitems (items with larger indentation) are considered part of the item,
-so this really moves item trees."
- (interactive)
- (if (not (org-at-item-p))
- (error "Not at an item")
- (let* ((pos (point))
- (col (current-column))
- (top (org-list-top-point))
- (bottom (org-list-bottom-point))
- (actual-item (goto-char (org-get-item-beginning)))
- (prev-item (org-get-previous-item (point) top)))
- (if (not prev-item)
- (progn
- (goto-char pos)
- (error "Cannot move this item further up"))
- (org-list-exchange-items prev-item actual-item bottom)
- (org-list-repair nil top bottom)
- (org-move-to-column col)))))
-
-(defun org-insert-item (&optional checkbox)
- "Insert a new item at the current level.
-If cursor is before first character after bullet of the item, the
-new item will be created before the current one.
-
-If CHECKBOX is non-nil, add a checkbox next to the bullet.
-
-Return t when things worked, nil when we are not in an item, or
-item is invisible."
- (unless (or (not (org-in-item-p))
- (save-excursion
- (goto-char (org-get-item-beginning))
- (org-invisible-p)))
- (if (save-excursion
- (goto-char (org-get-item-beginning))
- (org-at-item-timer-p))
- ;; Timer list: delegate to `org-timer-item'.
- (progn (org-timer-item) t)
- ;; if we're in a description list, ask for the new term.
- (let ((desc-text (when (save-excursion
- (and (goto-char (org-get-item-beginning))
- (org-at-item-description-p)))
- (concat (read-string "Term: ") " :: "))))
- ;; Don't insert a checkbox if checkbox rule is applied and it
- ;; is a description item.
- (org-list-insert-item-generic
- (point) (and checkbox
- (or (not desc-text)
- (not (cdr (assq 'checkbox org-list-automatic-rules)))))
- desc-text)))))
-
-;;; Structures
-
-;; The idea behind structures is to avoid moving back and forth in the
-;; buffer on costly operations like indenting or fixing bullets.
-
-;; It achieves this by taking a snapshot of an interesting part of the
-;; list, in the shape of an alist, using `org-list-struct'.
-
-;; It then proceeds to changes directly on the alist, with the help of
-;; and `org-list-struct-origins'. When those are done,
-;; `org-list-struct-apply-struct' applies the changes to the buffer.
-
-(defun org-list-struct-assoc-at-point ()
- "Return the structure association at point.
-It is a cons-cell whose key is point and values are indentation,
-bullet string and bullet counter, if any."
- (save-excursion
- (beginning-of-line)
- (list (point-at-bol)
- (org-get-indentation)
- (progn
- (looking-at "^[ \t]*\\([-+*0-9.)]+[ \t]+\\)")
- (match-string 1))
- (progn
- (goto-char (match-end 0))
- (and (looking-at "\\[@\\(?:start:\\)?\\([0-9]+\\)\\]")
- (match-string 1))))))
-
-(defun org-list-struct (begin end top bottom &optional outdent)
- "Return the structure containing the list between BEGIN and END.
-A structure is an alist where key is point of item and values
-are, in that order, indentation, bullet string and value of
-counter, if any. A structure contains every list and sublist that
-has items between BEGIN and END along with their common ancestor.
-If no such ancestor can be found, the function will add a virtual
-ancestor at position 0.
-
-TOP and BOTTOM are respectively the position of list beginning
-and list ending.
-
-If OUTDENT is non-nil, it will also grab all of the parent list
-and the grand-parent. Setting OUTDENT to t is mandatory when next
-change is an outdent."
- (save-excursion
- (let* (struct
- (extend
- (lambda (struct)
- (let* ((ind-min (apply 'min (mapcar 'cadr struct)))
- (begin (caar struct))
- (end (caar (last struct)))
- pre-list post-list)
- (goto-char begin)
- ;; Find beginning of most outdented list (min list)
- (while (and (org-search-backward-unenclosed
- org-item-beginning-re top t)
- (>= (org-get-indentation) ind-min))
- (setq pre-list (cons (org-list-struct-assoc-at-point)
- pre-list)))
- ;; Now get the parent. If none, add a virtual ancestor
- (if (< (org-get-indentation) ind-min)
- (setq pre-list (cons (org-list-struct-assoc-at-point)
- pre-list))
- (setq pre-list (cons (list 0 (org-get-indentation) "" nil)
- pre-list)))
- ;; Find end of min list
- (goto-char end)
- (end-of-line)
- (while (and (org-search-forward-unenclosed
- org-item-beginning-re bottom 'move)
- (>= (org-get-indentation) ind-min))
- (setq post-list (cons (org-list-struct-assoc-at-point)
- post-list)))
- ;; Is list is malformed? If some items are less
- ;; indented that top-item, add them anyhow.
- (when (and (= (caar pre-list) 0) (< (point) bottom))
- (beginning-of-line)
- (while (org-search-forward-unenclosed
- org-item-beginning-re bottom t)
- (setq post-list (cons (org-list-struct-assoc-at-point)
- post-list))))
- (append pre-list struct (reverse post-list))))))
- ;; Here we start: first get the core zone...
- (goto-char end)
- (while (org-search-backward-unenclosed org-item-beginning-re begin t)
- (setq struct (cons (org-list-struct-assoc-at-point) struct)))
- ;; ... then, extend it to make it a structure...
- (let ((extended (funcall extend struct)))
- ;; ... twice when OUTDENT is non-nil and struct still can be
- ;; extended
- (if (and outdent (> (caar extended) 0))
- (funcall extend extended)
- extended)))))
-
-(defun org-list-struct-origins (struct)
- "Return an alist where key is item's position and value parent's.
-STRUCT is the list's structure looked up."
- (let* ((struct-rev (reverse struct))
- (acc (list (cons (nth 1 (car struct)) 0)))
- (prev-item (lambda (item)
- (car (nth 1 (member (assq item struct) struct-rev)))))
- (get-origins
- (lambda (item)
- (let* ((item-pos (car item))
- (ind (nth 1 item))
- (prev-ind (caar acc)))
- (cond
- ;; List closing.
- ((> prev-ind ind)
- (let ((current-origin (or (member (assq ind acc) acc)
- ;; needed if top-point is
- ;; not the most outdented
- (last acc))))
- (setq acc current-origin)
- (cons item-pos (cdar acc))))
- ;; New list
- ((< prev-ind ind)
- (let ((origin (funcall prev-item item-pos)))
- (setq acc (cons (cons ind origin) acc))
- (cons item-pos origin)))
- ;; Current list going on
- (t (cons item-pos (cdar acc))))))))
- (cons '(0 . 0) (mapcar get-origins (cdr struct)))))
-
-(defun org-list-struct-get-parent (item struct origins)
- "Return parent association of ITEM in STRUCT or nil.
-ORIGINS is the alist of parents. See `org-list-struct-origins'."
- (let* ((parent-pos (cdr (assq (car item) origins))))
- (when (> parent-pos 0) (assq parent-pos struct))))
-
-(defun org-list-struct-get-child (item struct)
- "Return child association of ITEM in STRUCT or nil."
- (let ((ind (nth 1 item))
- (next-item (cadr (member item struct))))
- (when (and next-item (> (nth 1 next-item) ind)) next-item)))
-
-(defun org-list-struct-fix-bul (struct origins)
- "Verify and correct bullets for every association in STRUCT.
-ORIGINS is the alist of parents. See `org-list-struct-origins'.
-
-This function modifies STRUCT."
- (let* (acc
- (init-bul (lambda (item)
- (let ((counter (nth 3 item))
- (bullet (org-list-bullet-string (nth 2 item))))
- (cond
- ((and (string-match "[0-9]+" bullet) counter)
- (replace-match counter nil nil bullet))
- ((string-match "[0-9]+" bullet)
- (replace-match "1" nil nil bullet))
- (t bullet)))))
- (set-bul (lambda (item bullet)
- (setcdr item (list (nth 1 item) bullet (nth 3 item)))))
- (get-bul (lambda (item bullet)
- (let* ((counter (nth 3 item)))
- (if (and counter (string-match "[0-9]+" bullet))
- (replace-match counter nil nil bullet)
- bullet))))
- (fix-bul
- (lambda (item) struct
- (let* ((parent (cdr (assq (car item) origins)))
- (orig-ref (assq parent acc)))
- (if orig-ref
- ;; Continuing previous list
- (let* ((prev-bul (cdr orig-ref))
- (new-bul (funcall get-bul item prev-bul)))
- (setcdr orig-ref (org-list-inc-bullet-maybe new-bul))
- (funcall set-bul item new-bul))
- ;; A new list is starting
- (let ((new-bul (funcall init-bul item)))
- (funcall set-bul item new-bul)
- (setq acc (cons (cons parent
- (org-list-inc-bullet-maybe new-bul))
- acc))))))))
- (mapc fix-bul (cdr struct))))
-
-(defun org-list-struct-fix-ind (struct origins)
- "Verify and correct indentation for every association in STRUCT.
-ORIGINS is the alist of parents. See `org-list-struct-origins'.
-
-This function modifies STRUCT."
- (let* ((headless (cdr struct))
- (ancestor (car struct))
- (top-ind (+ (nth 1 ancestor) (length (nth 2 ancestor))))
- (new-ind
- (lambda (item)
- (let* ((parent (org-list-struct-get-parent item headless origins)))
- (if parent
- ;; Indent like parent + length of parent's bullet
- (setcdr item (cons (+ (length (nth 2 parent)) (nth 1 parent))
- (cddr item)))
- ;; If no parent, indent like top-point
- (setcdr item (cons top-ind (cddr item))))))))
- (mapc new-ind headless)))
-
-(defun org-list-struct-fix-struct (struct origins)
- "Return STRUCT with correct bullets and indentation.
-ORIGINS is the alist of parents. See `org-list-struct-origins'.
-
-Only elements of STRUCT that have changed are returned."
- (let ((old (copy-alist struct)))
- (org-list-struct-fix-bul struct origins)
- (org-list-struct-fix-ind struct origins)
- (delq nil (mapcar (lambda (e) (when (not (equal (pop old) e)) e)) struct))))
-
-(defun org-list-struct-outdent (start end origins)
- "Outdent items in a structure.
-Items are indented when their key is between START, included, and
-END, excluded.
-
-ORIGINS is the alist of parents. See `org-list-struct-origins'.
-
-STRUCT is the concerned structure."
- (let* (acc
- (out (lambda (cell)
- (let* ((item (car cell))
- (parent (cdr cell)))
- (cond
- ;; Item not yet in zone: keep association
- ((< item start) cell)
- ;; Item out of zone: follow associations in acc
- ((>= item end)
- (let ((convert (assq parent acc)))
- (if convert (cons item (cdr convert)) cell)))
- ;; Item has no parent: error
- ((<= parent 0)
- (error "Cannot outdent top-level items"))
- ;; Parent is outdented: keep association
- ((>= parent start)
- (setq acc (cons (cons parent item) acc)) cell)
- (t
- ;; Parent isn't outdented: reparent to grand-parent
- (let ((grand-parent (cdr (assq parent origins))))
- (setq acc (cons (cons parent item) acc))
- (cons item grand-parent))))))))
- (mapcar out origins)))
-
-(defun org-list-struct-indent (start end origins struct)
- "Indent items in a structure.
-Items are indented when their key is between START, included, and
-END, excluded.
-
-ORIGINS is the alist of parents. See `org-list-struct-origins'.
-
-STRUCT is the concerned structure. It may be modified if
-`org-list-demote-modify-bullet' matches bullets between START and
-END."
- (let* (acc
- (orig-rev (reverse origins))
- (get-prev-item
- (lambda (cell parent)
- (car (rassq parent (cdr (memq cell orig-rev))))))
- (set-assoc
- (lambda (cell)
- (setq acc (cons cell acc)) cell))
- (change-bullet-maybe
- (lambda (item)
- (let* ((full-item (assq item struct))
- (item-bul (org-trim (nth 2 full-item)))
- (new-bul-p (cdr (assoc item-bul org-list-demote-modify-bullet))))
- (when new-bul-p
- ;; new bullet is stored without space to ensure item
- ;; will be modified
- (setcdr full-item
- (list (nth 1 full-item)
- new-bul-p
- (nth 3 full-item)))))))
- (ind
- (lambda (cell)
- (let* ((item (car cell))
- (parent (cdr cell)))
- (cond
- ;; Item not yet in zone: keep association
- ((< item start) cell)
- ((>= item end)
- ;; Item out of zone: follow associations in acc
- (let ((convert (assq parent acc)))
- (if convert (cons item (cdr convert)) cell)))
- (t
- ;; Item is in zone...
- (let ((prev (funcall get-prev-item cell parent)))
- ;; Check if bullet needs to be changed
- (funcall change-bullet-maybe item)
- (cond
- ;; First item indented but not parent: error
- ((and (or (not prev) (= prev 0)) (< parent start))
- (error "Cannot indent the first item of a list"))
- ;; First item and parent indented: keep same parent
- ((or (not prev) (= prev 0))
- (funcall set-assoc cell))
- ;; Previous item not indented: reparent to it
- ((< prev start)
- (funcall set-assoc (cons item prev)))
- ;; Previous item indented: reparent like it
- (t
- (funcall set-assoc (cons item
- (cdr (assq prev acc)))))))))))))
- (mapcar ind origins)))
-
-(defun org-list-struct-apply-struct (struct bottom)
- "Apply modifications to list so it mirrors STRUCT.
-BOTTOM is position at list ending.
-
-Initial position is restored after the changes."
- (let* ((pos (copy-marker (point)))
- (ancestor (caar struct))
- (modify
- (lambda (item)
- (goto-char (car item))
- (let* ((new-ind (nth 1 item))
- (new-bul (org-list-bullet-string (nth 2 item)))
- (old-ind (org-get-indentation))
- (old-bul (progn
- (looking-at "[ \t]*\\(\\S-+[ \t]*\\)")
- (match-string 1)))
- (old-body-ind (+ (length old-bul) old-ind))
- (new-body-ind (+ (length new-bul) new-ind)))
- ;; 1. Shift item's body
- (unless (= old-body-ind new-body-ind)
- (org-shift-item-indentation
- (- new-body-ind old-body-ind) bottom))
- ;; 2. Replace bullet
- (unless (equal new-bul old-bul)
- (save-excursion
- (looking-at "[ \t]*\\(\\S-+[ \t]*\\)")
- (replace-match new-bul nil nil nil 1)))
- ;; 3. Indent item to appropriate column
- (unless (= new-ind old-ind)
- (delete-region (point-at-bol)
- (progn
- (skip-chars-forward " \t")
- (point)))
- (indent-to new-ind)))))
- ;; Remove ancestor if it is left.
- (struct-to-apply (if (or (not ancestor) (= 0 ancestor))
- (cdr struct)
- struct)))
- ;; Apply changes from bottom to top
- (mapc modify (nreverse struct-to-apply))
- (goto-char pos)))
-
-;;; Indentation
-
-(defun org-get-string-indentation (s)
- "What indentation has S due to SPACE and TAB at the beginning of the string?"
- (let ((n -1) (i 0) (w tab-width) c)
- (catch 'exit
- (while (< (setq n (1+ n)) (length s))
- (setq c (aref s n))
- (cond ((= c ?\ ) (setq i (1+ i)))
- ((= c ?\t) (setq i (* (/ (+ w i) w) w)))
- (t (throw 'exit t)))))
- i))
-
-(defun org-shift-item-indentation (delta bottom)
- "Shift the indentation in current item by DELTA.
-Sub-items are not moved.
-
-BOTTOM is position at list ending."
- (save-excursion
- (let ((beg (point-at-bol))
- (end (org-end-of-item-or-at-child bottom)))
- (beginning-of-line (unless (eolp) 0))
- (while (> (point) beg)
- (when (looking-at "[ \t]*\\S-")
- ;; this is not an empty line
- (let ((i (org-get-indentation)))
- (when (and (> i 0) (> (+ i delta) 0))
- (org-indent-line-to (+ i delta)))))
- (beginning-of-line 0)))))
-
-(defun org-outdent-item ()
- "Outdent a local list item, but not its children.
-If a region is active, all items inside will be moved."
- (interactive)
- (org-list-indent-item-generic
- -1 t (org-list-top-point) (org-list-bottom-point)))
-
-(defun org-indent-item ()
- "Indent a local list item, but not its children.
-If a region is active, all items inside will be moved."
- (interactive)
- (org-list-indent-item-generic
- 1 t (org-list-top-point) (org-list-bottom-point)))
-
-(defun org-outdent-item-tree ()
- "Outdent a local list item including its children.
-If a region is active, all items inside will be moved."
- (interactive)
- (org-list-indent-item-generic
- -1 nil (org-list-top-point) (org-list-bottom-point)))
-
-(defun org-indent-item-tree ()
- "Indent a local list item including its children.
-If a region is active, all items inside will be moved."
- (interactive)
- (org-list-indent-item-generic
- 1 nil (org-list-top-point) (org-list-bottom-point)))
-
-(defvar org-tab-ind-state)
-(defun org-cycle-item-indentation ()
- "Cycle levels of indentation of an empty item.
-The first run indent the item, if applicable. Subsequents runs
-outdent it at meaningful levels in the list. When done, item is
-put back at its original position with its original bullet.
-
-Return t at each successful move."
- (let ((org-adapt-indentation nil)
- (ind (org-get-indentation))
- (bottom (and (org-at-item-p) (org-list-bottom-point))))
- (when (and (or (org-at-item-description-p)
- (org-at-item-checkbox-p)
- (org-at-item-p))
- ;; Check that item is really empty
- (>= (match-end 0) (save-excursion
- (org-end-of-item-or-at-child bottom)
- (skip-chars-backward " \r\t\n")
- (point))))
- (setq this-command 'org-cycle-item-indentation)
- (let ((top (org-list-top-point)))
- ;; When in the middle of the cycle, try to outdent first. If it
- ;; fails, and point is still at initial position, indent. Else,
- ;; go back to original position.
- (if (eq last-command 'org-cycle-item-indentation)
- (cond
- ((ignore-errors (org-list-indent-item-generic -1 t top bottom)))
- ((and (= (org-get-indentation) (car org-tab-ind-state))
- (ignore-errors
- (org-list-indent-item-generic 1 t top bottom))))
- (t (back-to-indentation)
- (org-indent-to-column (car org-tab-ind-state))
- (end-of-line)
- (org-list-repair (cdr org-tab-ind-state))
- ;; Break cycle
- (setq this-command 'identity)))
- ;; If a cycle is starting, remember indentation and bullet,
- ;; then try to indent. If it fails, try to outdent.
- (setq org-tab-ind-state (cons ind (org-get-bullet)))
- (cond
- ((ignore-errors (org-list-indent-item-generic 1 t top bottom)))
- ((ignore-errors (org-list-indent-item-generic -1 t top bottom)))
- (t (error "Cannot move item")))))
- t)))
-
-;;; Bullets
-
-(defun org-get-bullet ()
- "Return the bullet of the item at point.
-Assume cursor is at an item."
- (save-excursion
- (beginning-of-line)
- (and (looking-at "[ \t]*\\(\\S-+\\)") (match-string 1))))
-
-(defun org-list-bullet-string (bullet)
- "Return BULLET with the correct number of whitespaces.
-It determines the number of whitespaces to append by looking at
-`org-list-two-spaces-after-bullet-regexp'."
- (save-match-data
- (string-match "\\S-+\\([ \t]*\\)" bullet)
- (replace-match
- (save-match-data
- (concat
- " "
- ;; Do we need to concat another white space ?
- (when (and org-list-two-spaces-after-bullet-regexp
- (string-match org-list-two-spaces-after-bullet-regexp bullet))
- " ")))
- nil nil bullet 1)))
-
-(defun org-list-inc-bullet-maybe (bullet)
- "Increment BULLET if applicable."
- (if (string-match "[0-9]+" bullet)
- (replace-match
- (number-to-string (1+ (string-to-number (match-string 0 bullet))))
- nil nil bullet)
- bullet))
-
-(defun org-list-repair (&optional force-bullet top bottom)
- "Make sure all items are correctly indented, with the right bullet.
-This function scans the list at point, along with any sublist.
-
-If FORCE-BULLET is a string, ensure all items in list share this
-bullet, or a logical successor in the case of an ordered list.
-
-When non-nil, TOP and BOTTOM specify respectively position of
-list beginning and list ending.
-
-Item's body is not indented, only shifted with the bullet."
- (interactive)
- (unless (org-at-item-p) (error "This is not a list"))
- (let* ((bottom (or bottom (org-list-bottom-point)))
- (struct (org-list-struct
- (point-at-bol) (point-at-eol)
- (or top (org-list-top-point)) bottom))
- (origins (org-list-struct-origins struct))
- fixed-struct)
- (if (stringp force-bullet)
- (let ((begin (nth 1 struct)))
- (setcdr begin (list (nth 1 begin)
- (org-list-bullet-string force-bullet)
- (nth 3 begin)))
- (setq fixed-struct
- (cons begin (org-list-struct-fix-struct struct origins))))
- (setq fixed-struct (org-list-struct-fix-struct struct origins)))
- (org-list-struct-apply-struct fixed-struct bottom)))
-
-(defun org-cycle-list-bullet (&optional which)
- "Cycle through the different itemize/enumerate bullets.
-This cycle the entire list level through the sequence:
-
- `-' -> `+' -> `*' -> `1.' -> `1)'
-
-If WHICH is a valid string, use that as the new bullet. If WHICH
-is an integer, 0 means `-', 1 means `+' etc. If WHICH is
-'previous, cycle backwards."
- (interactive "P")
- (save-excursion
- (let* ((top (org-list-top-point))
- (bullet (progn
- (goto-char (org-get-beginning-of-list top))
- (org-get-bullet)))
- (current (cond
- ((string-match "\\." bullet) "1.")
- ((string-match ")" bullet) "1)")
- (t bullet)))
- (bullet-rule-p (cdr (assq 'bullet org-list-automatic-rules)))
- (bullet-list (append '("-" "+" )
- ;; *-bullets are not allowed at column 0
- (unless (and bullet-rule-p
- (looking-at "\\S-")) '("*"))
- ;; Description items cannot be numbered
- (unless (and bullet-rule-p
- (or (eq org-plain-list-ordered-item-terminator ?\))
- (org-at-item-description-p))) '("1."))
- (unless (and bullet-rule-p
- (or (eq org-plain-list-ordered-item-terminator ?.)
- (org-at-item-description-p))) '("1)"))))
- (len (length bullet-list))
- (item-index (- len (length (member current bullet-list))))
- (get-value (lambda (index) (nth (mod index len) bullet-list)))
- (new (cond
- ((member which bullet-list) which)
- ((numberp which) (funcall get-value which))
- ((eq 'previous which) (funcall get-value (1- item-index)))
- (t (funcall get-value (1+ item-index))))))
- (org-list-repair new top))))
-
-;;; Checkboxes
-
-(defun org-toggle-checkbox (&optional toggle-presence)
- "Toggle the checkbox in the current line.
-With prefix arg TOGGLE-PRESENCE, add or remove checkboxes. With
-double prefix, set checkbox to [-].
-
-When there is an active region, toggle status or presence of the
-first checkbox there, and make every item inside have the
-same status or presence, respectively.
-
-If the cursor is in a headline, apply this to all checkbox items
-in the text below the heading, taking as reference the first item
-in subtree, ignoring drawers."
- (interactive "P")
- ;; Bounds is a list of type (beg end single-p) where single-p is t
- ;; when `org-toggle-checkbox' is applied to a single item. Only
- ;; toggles on single items will return errors.
- (let* ((bounds
- (cond
- ((org-region-active-p)
- (let ((rbeg (region-beginning))
- (rend (region-end)))
- (save-excursion
- (goto-char rbeg)
- (if (org-search-forward-unenclosed org-item-beginning-re rend 'move)
- (list (point-at-bol) rend nil)
- (error "No item in region")))))
- ((org-on-heading-p)
- ;; In this case, reference line is the first item in
- ;; subtree outside drawers
- (let ((pos (point))
- (limit (save-excursion (outline-next-heading) (point))))
- (save-excursion
- (goto-char limit)
- (org-search-backward-unenclosed ":END:" pos 'move)
- (org-search-forward-unenclosed
- org-item-beginning-re limit 'move)
- (list (point) limit nil))))
- ((org-at-item-p)
- (list (point-at-bol) (1+ (point-at-eol)) t))
- (t (error "Not at an item or heading, and no active region"))))
- (beg (car bounds))
- ;; marker is needed because deleting or inserting checkboxes
- ;; will change bottom point
- (end (copy-marker (nth 1 bounds)))
- (single-p (nth 2 bounds))
- (ref-presence (save-excursion
- (goto-char beg)
- (org-at-item-checkbox-p)))
- (ref-status (equal (match-string 1) "[X]"))
- (act-on-item
- (lambda (ref-pres ref-stat)
- (if (equal toggle-presence '(4))
- (cond
- ((and ref-pres (org-at-item-checkbox-p))
- (replace-match ""))
- ((and (not ref-pres)
- (not (org-at-item-checkbox-p))
- (org-at-item-p))
- (goto-char (match-end 0))
- ;; Ignore counter, if any
- (when (looking-at "\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?")
- (goto-char (match-end 0)))
- (let ((desc-p (and (org-at-item-description-p)
- (cdr (assq 'checkbox org-list-automatic-rules)))))
- (cond
- ((and single-p desc-p)
- (error "Cannot add a checkbox in a description list"))
- ((not desc-p) (insert "[ ] "))))))
- (let ((blocked (org-checkbox-blocked-p)))
- (cond
- ((and blocked single-p)
- (error "Checkbox blocked because of unchecked box in line %d" blocked))
- (blocked nil)
- ((org-at-item-checkbox-p)
- (replace-match
- (cond ((equal toggle-presence '(16)) "[-]")
- (ref-stat "[ ]")
- (t "[X]"))
- t t nil 1))))))))
- (save-excursion
- (goto-char beg)
- (while (< (point) end)
- (funcall act-on-item ref-presence ref-status)
- (org-search-forward-unenclosed org-item-beginning-re end 'move)))
- (org-update-checkbox-count-maybe)))
-
-(defun org-reset-checkbox-state-subtree ()
- "Reset all checkboxes in an entry subtree."
- (interactive "*")
- (save-restriction
- (save-excursion
- (org-narrow-to-subtree)
- (org-show-subtree)
- (goto-char (point-min))
- (let ((end (point-max)))
- (while (< (point) end)
- (when (org-at-item-checkbox-p)
- (replace-match "[ ]" t t nil 1))
- (beginning-of-line 2))))
- (org-update-checkbox-count-maybe)))
-
-(defvar org-checkbox-statistics-hook nil
- "Hook that is run whenever Org thinks checkbox statistics should be updated.
-This hook runs even if checkbox rule in
-`org-list-automatic-rules' does not apply, so it can be used to
-implement alternative ways of collecting statistics
-information.")
-
-(defun org-update-checkbox-count-maybe ()
- "Update checkbox statistics unless turned off by user."
- (when (cdr (assq 'checkbox org-list-automatic-rules))
- (org-update-checkbox-count))
- (run-hooks 'org-checkbox-statistics-hook))
-
-(defun org-update-checkbox-count (&optional all)
- "Update the checkbox statistics in the current section.
-This will find all statistic cookies like [57%] and [6/12] and update them
-with the current numbers. With optional prefix argument ALL, do this for
-the whole buffer."
- (interactive "P")
- (save-excursion
- (let ((cstat 0))
- (catch 'exit
- (while t
- (let* ((buffer-invisibility-spec (org-inhibit-invisibility)) ; Emacs 21
- (beg (condition-case nil
- (progn (org-back-to-heading) (point))
- (error (point-min))))
- (end (copy-marker (save-excursion
- (outline-next-heading) (point))))
- (re-cookie "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)")
- (re-box "^[ \t]*\\([-+*]\\|[0-9]+[.)]\\)[ \t]+\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\(\\[[- X]\\]\\)")
- beg-cookie end-cookie is-percent c-on c-off lim new
- curr-ind next-ind continue-from startsearch list-beg list-end
- (recursive
- (or (not org-hierarchical-checkbox-statistics)
- (string-match "\\<recursive\\>"
- (or (ignore-errors
- (org-entry-get nil "COOKIE_DATA"))
- "")))))
- (goto-char end)
- ;; find each statistics cookie
- (while (and (org-search-backward-unenclosed re-cookie beg 'move)
- (not (save-match-data
- (and (org-on-heading-p)
- (string-match "\\<todo\\>"
- (downcase
- (or (org-entry-get
- nil "COOKIE_DATA")
- "")))))))
- (setq beg-cookie (match-beginning 1)
- end-cookie (match-end 1)
- cstat (+ cstat (if end-cookie 1 0))
- startsearch (point-at-eol)
- continue-from (match-beginning 0)
- is-percent (match-beginning 2)
- lim (cond
- ((org-on-heading-p) (outline-next-heading) (point))
- ;; Ensure many cookies in the same list won't imply
- ;; computing list boundaries as many times.
- ((org-at-item-p)
- (unless (and list-beg (>= (point) list-beg))
- (setq list-beg (org-list-top-point)
- list-end (copy-marker
- (org-list-bottom-point))))
- (org-get-end-of-item list-end))
- (t nil))
- c-on 0
- c-off 0)
- (when lim
- ;; find first checkbox for this cookie and gather
- ;; statistics from all that are at this indentation level
- (goto-char startsearch)
- (if (org-search-forward-unenclosed re-box lim t)
- (progn
- (beginning-of-line)
- (setq curr-ind (org-get-indentation))
- (setq next-ind curr-ind)
- (while (and (bolp) (org-at-item-p)
- (if recursive
- (<= curr-ind next-ind)
- (= curr-ind next-ind)))
- (when (org-at-item-checkbox-p)
- (if (member (match-string 1) '("[ ]" "[-]"))
- (setq c-off (1+ c-off))
- (setq c-on (1+ c-on))))
- (if (not recursive)
- ;; org-get-next-item goes through list-enders
- ;; with proper limit.
- (goto-char (or (org-get-next-item (point) lim) lim))
- (end-of-line)
- (when (org-search-forward-unenclosed
- org-item-beginning-re lim t)
- (beginning-of-line)))
- (setq next-ind (org-get-indentation)))))
- (goto-char continue-from)
- ;; update cookie
- (when end-cookie
- (setq new (if is-percent
- (format "[%d%%]" (/ (* 100 c-on)
- (max 1 (+ c-on c-off))))
- (format "[%d/%d]" c-on (+ c-on c-off))))
- (goto-char beg-cookie)
- (insert new)
- (delete-region (point) (+ (point) (- end-cookie beg-cookie))))
- ;; update items checkbox if it has one
- (when (and (org-at-item-checkbox-p)
- (> (+ c-on c-off) 0))
- (setq beg-cookie (match-beginning 1)
- end-cookie (match-end 1))
- (delete-region beg-cookie end-cookie)
- (goto-char beg-cookie)
- (cond ((= c-off 0) (insert "[X]"))
- ((= c-on 0) (insert "[ ]"))
- (t (insert "[-]")))))
- (goto-char continue-from)))
- (unless (and all (outline-next-heading)) (throw 'exit nil))))
- (when (interactive-p)
- (message "Checkbox statistics updated %s (%d places)"
- (if all "in entire file" "in current outline entry") cstat)))))
-
-(defun org-get-checkbox-statistics-face ()
- "Select the face for checkbox statistics.
-The face will be `org-done' when all relevant boxes are checked.
-Otherwise it will be `org-todo'."
- (if (match-end 1)
- (if (equal (match-string 1) "100%")
- 'org-checkbox-statistics-done
- 'org-checkbox-statistics-todo)
- (if (and (> (match-end 2) (match-beginning 2))
- (equal (match-string 2) (match-string 3)))
- 'org-checkbox-statistics-done
- 'org-checkbox-statistics-todo)))
-
-;;; Misc Tools
-
-(defun org-apply-on-list (function init-value &rest args)
- "Call FUNCTION on each item of the list at point.
-FUNCTION must be called with at least one argument: INIT-VALUE,
-that will contain the value returned by the function at the
-previous item, plus ARGS extra arguments.
-
-As an example, (org-apply-on-list (lambda (result) (1+ result)) 0)
-will return the number of items in the current list.
-
-Sublists of the list are skipped. Cursor is always at the
-beginning of the item."
- (let* ((pos (copy-marker (point)))
- (end (copy-marker (org-list-bottom-point)))
- (next-p (copy-marker (org-get-beginning-of-list (org-list-top-point))))
- (value init-value))
- (while (< next-p end)
- (goto-char next-p)
- (set-marker next-p (or (org-get-next-item (point) end) end))
- (setq value (apply function value args)))
- (goto-char pos)
- value))
-
-(defun org-sort-list (&optional with-case sorting-type getkey-func compare-func)
- "Sort plain list items.
-The cursor may be at any item of the list that should be sorted.
-Sublists are not sorted. Checkboxes, if any, are ignored.
-
-Sorting can be alphabetically, numerically, by date/time as given by
-a time stamp, by a property or by priority.
-
-Comparing entries ignores case by default. However, with an
-optional argument WITH-CASE, the sorting considers case as well.
-
-The command prompts for the sorting type unless it has been given
-to the function through the SORTING-TYPE argument, which needs to
-be a character, \(?n ?N ?a ?A ?t ?T ?f ?F). Here is the precise
-meaning of each character:
-
-n Numerically, by converting the beginning of the item to a number.
-a Alphabetically. Only the first line of item is checked.
-t By date/time, either the first active time stamp in the entry, if
- any, or by the first inactive one. In a timer list, sort the timers.
-
-Capital letters will reverse the sort order.
-
-If the SORTING-TYPE is ?f or ?F, then GETKEY-FUNC specifies a
-function to be called with point at the beginning of the record.
-It must return either a string or a number that should serve as
-the sorting key for that record. It will then use COMPARE-FUNC to
-compare entries."
- (interactive "P")
- (let* ((case-func (if with-case 'identity 'downcase))
- (top (org-list-top-point))
- (bottom (org-list-bottom-point))
- (start (org-get-beginning-of-list top))
- (end (org-get-end-of-list bottom))
- (sorting-type
- (progn
- (message
- "Sort plain list: [a]lpha [n]umeric [t]ime [f]unc A/N/T/F means reversed:")
- (read-char-exclusive)))
- (getkey-func (and (= (downcase sorting-type) ?f)
- (org-icompleting-read "Sort using function: "
- obarray 'fboundp t nil nil)
- (intern getkey-func))))
- (message "Sorting items...")
- (save-restriction
- (narrow-to-region start end)
- (goto-char (point-min))
- (let* ((dcst (downcase sorting-type))
- (case-fold-search nil)
- (now (current-time))
- (sort-func (cond
- ((= dcst ?a) 'string<)
- ((= dcst ?f) compare-func)
- ((= dcst ?t) '<)
- (t nil)))
- (begin-record (lambda ()
- (skip-chars-forward " \r\t\n")
- (beginning-of-line)))
- (end-record (lambda ()
- (goto-char (org-end-of-item-before-blank end))))
- (value-to-sort
- (lambda ()
- (when (looking-at "[ \t]*[-+*0-9.)]+\\([ \t]+\\[[- X]\\]\\)?[ \t]+")
- (cond
- ((= dcst ?n)
- (string-to-number (buffer-substring (match-end 0)
- (point-at-eol))))
- ((= dcst ?a)
- (buffer-substring (match-end 0) (point-at-eol)))
- ((= dcst ?t)
- (cond
- ;; If it is a timer list, convert timer to seconds
- ((org-at-item-timer-p)
- (org-timer-hms-to-secs (match-string 1)))
- ((or (org-search-forward-unenclosed org-ts-regexp
- (point-at-eol) t)
- (org-search-forward-unenclosed org-ts-regexp-both
- (point-at-eol) t))
- (org-time-string-to-seconds (match-string 0)))
- (t (org-float-time now))))
- ((= dcst ?f)
- (if getkey-func
- (let ((value (funcall getkey-func)))
- (if (stringp value)
- (funcall case-func value)
- value))
- (error "Invalid key function `%s'" getkey-func)))
- (t (error "Invalid sorting type `%c'" sorting-type)))))))
- (sort-subr (/= dcst sorting-type)
- begin-record
- end-record
- value-to-sort
- nil
- sort-func)
- (org-list-repair nil top bottom)
- (run-hooks 'org-after-sorting-entries-or-items-hook)
- (message "Sorting items...done")))))
-
-;;; Send and receive lists
-
-(defun org-list-parse-list (&optional delete)
- "Parse the list at point and maybe DELETE it.
-Return a list containing first level items as strings and
-sublevels as a list of strings."
- (let* ((start (goto-char (org-list-top-point)))
- (end (org-list-bottom-point))
- output itemsep ltype)
- (while (org-search-forward-unenclosed org-item-beginning-re end t)
- (save-excursion
- (beginning-of-line)
- (setq ltype (cond ((org-looking-at-p "^[ \t]*[0-9]") 'ordered)
- ((org-at-item-description-p) 'descriptive)
- (t 'unordered))))
- (let* ((indent1 (org-get-indentation))
- (nextitem (or (org-get-next-item (point) end) end))
- (item (org-trim (buffer-substring (point)
- (org-end-of-item-or-at-child end))))
- (nextindent (if (= (point) end) 0 (org-get-indentation)))
- (item (if (string-match
- "^\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\[\\([xX ]\\)\\]"
- item)
- (replace-match (if (equal (match-string 1 item) " ")
- "CBOFF"
- "CBON")
- t nil item 1)
- item)))
- (push item output)
- (when (> nextindent indent1)
- (save-restriction
- (narrow-to-region (point) nextitem)
- (push (org-list-parse-list) output)))))
- (when delete
- (delete-region start end)
- (save-match-data
- (when (and (not (eq org-list-ending-method 'indent))
- (looking-at (org-list-end-re)))
- (replace-match "\n"))))
- (setq output (nreverse output))
- (push ltype output)))
-
-(defun org-list-make-subtree ()
- "Convert the plain list at point into a subtree."
- (interactive)
- (if (not (org-in-item-p))
- (error "Not in a list")
- (let ((list (org-list-parse-list t)) nstars)
- (save-excursion
- (if (ignore-errors
- (org-back-to-heading))
- (progn (looking-at org-complex-heading-regexp)
- (setq nstars (length (match-string 1))))
- (setq nstars 0)))
- (org-list-make-subtrees list (1+ nstars)))))
-
-(defun org-list-make-subtrees (list level)
- "Convert LIST into subtrees starting at LEVEL."
- (if (symbolp (car list))
- (org-list-make-subtrees (cdr list) level)
- (mapcar (lambda (item)
- (if (stringp item)
- (insert (make-string
- (if org-odd-levels-only
- (1- (* 2 level)) level) ?*) " " item "\n")
- (org-list-make-subtrees item (1+ level))))
- list)))
-
-(defun org-list-insert-radio-list ()
- "Insert a radio list template appropriate for this major mode."
- (interactive)
- (let* ((e (assq major-mode org-list-radio-list-templates))
- (txt (nth 1 e))
- name pos)
- (unless e (error "No radio list setup defined for %s" major-mode))
- (setq name (read-string "List name: "))
- (while (string-match "%n" txt)
- (setq txt (replace-match name t t txt)))
- (or (bolp) (insert "\n"))
- (setq pos (point))
- (insert txt)
- (goto-char pos)))
-
-(defun org-list-send-list (&optional maybe)
- "Send a transformed version of this list to the receiver position.
-With argument MAYBE, fail quietly if no transformation is defined for
-this list."
- (interactive)
- (catch 'exit
- (unless (org-at-item-p) (error "Not at a list item"))
- (save-excursion
- (re-search-backward "#\\+ORGLST" nil t)
- (unless (looking-at "[ \t]*#\\+ORGLST[: \t][ \t]*SEND[ \t]+\\([^ \t\r\n]+\\)[ \t]+\\([^ \t\r\n]+\\)\\([ \t]+.*\\)?")
- (if maybe
- (throw 'exit nil)
- (error "Don't know how to transform this list"))))
- (let* ((name (match-string 1))
- (transform (intern (match-string 2)))
- (bottom-point
- (save-excursion
- (re-search-forward
- "\\(\\\\end{comment}\\|@end ignore\\|-->\\)" nil t)
- (match-beginning 0)))
- (top-point
- (progn
- (re-search-backward "#\\+ORGLST" nil t)
- (re-search-forward org-item-beginning-re bottom-point t)
- (match-beginning 0)))
- (list (save-restriction
- (narrow-to-region top-point bottom-point)
- (org-list-parse-list)))
- beg txt)
- (unless (fboundp transform)
- (error "No such transformation function %s" transform))
- (let ((txt (funcall transform list)))
- ;; Find the insertion place
- (save-excursion
- (goto-char (point-min))
- (unless (re-search-forward
- (concat "BEGIN RECEIVE ORGLST +"
- name
- "\\([ \t]\\|$\\)") nil t)
- (error "Don't know where to insert translated list"))
- (goto-char (match-beginning 0))
- (beginning-of-line 2)
- (setq beg (point))
- (unless (re-search-forward (concat "END RECEIVE ORGLST +" name) nil t)
- (error "Cannot find end of insertion region"))
- (delete-region beg (point-at-bol))
- (goto-char beg)
- (insert txt "\n")))
- (message "List converted and installed at receiver location"))))
-
-(defun org-list-to-generic (list params)
- "Convert a LIST parsed through `org-list-parse-list' to other formats.
-Valid parameters PARAMS are
-
-:ustart String to start an unordered list
-:uend String to end an unordered list
-
-:ostart String to start an ordered list
-:oend String to end an ordered list
-
-:dstart String to start a descriptive list
-:dend String to end a descriptive list
-:dtstart String to start a descriptive term
-:dtend String to end a descriptive term
-:ddstart String to start a description
-:ddend String to end a description
-
-:splice When set to t, return only list body lines, don't wrap
- them into :[u/o]start and :[u/o]end. Default is nil.
-
-:istart String to start a list item
-:iend String to end a list item
-:isep String to separate items
-:lsep String to separate sublists
-
-:cboff String to insert for an unchecked checkbox
-:cbon String to insert for a checked checkbox"
- (interactive)
- (let* ((p params) sublist
- (splicep (plist-get p :splice))
- (ostart (plist-get p :ostart))
- (oend (plist-get p :oend))
- (ustart (plist-get p :ustart))
- (uend (plist-get p :uend))
- (dstart (plist-get p :dstart))
- (dend (plist-get p :dend))
- (dtstart (plist-get p :dtstart))
- (dtend (plist-get p :dtend))
- (ddstart (plist-get p :ddstart))
- (ddend (plist-get p :ddend))
- (istart (plist-get p :istart))
- (iend (plist-get p :iend))
- (isep (plist-get p :isep))
- (lsep (plist-get p :lsep))
- (cbon (plist-get p :cbon))
- (cboff (plist-get p :cboff)))
- (let ((wrapper
- (cond ((eq (car list) 'ordered)
- (concat ostart "\n%s" oend "\n"))
- ((eq (car list) 'unordered)
- (concat ustart "\n%s" uend "\n"))
- ((eq (car list) 'descriptive)
- (concat dstart "\n%s" dend "\n"))))
- rtn term defstart defend)
- (while (setq sublist (pop list))
- (cond ((symbolp sublist) nil)
- ((stringp sublist)
- (when (string-match "^\\(.*\\)[ \t]+::" sublist)
- (setq term (org-trim (format (concat dtstart "%s" dtend)
- (match-string 1 sublist))))
- (setq sublist (concat ddstart
- (org-trim (substring sublist
- (match-end 0)))
- ddend)))
- (if (string-match "\\[CBON\\]" sublist)
- (setq sublist (replace-match cbon t t sublist)))
- (if (string-match "\\[CBOFF\\]" sublist)
- (setq sublist (replace-match cboff t t sublist)))
- (if (string-match "\\[-\\]" sublist)
- (setq sublist (replace-match "$\\boxminus$" t t sublist)))
- (setq rtn (concat rtn istart term sublist iend isep)))
- (t (setq rtn (concat rtn ;; previous list
- lsep ;; list separator
- (org-list-to-generic sublist p)
- lsep ;; list separator
- )))))
- (format wrapper rtn))))
-
-(defun org-list-to-latex (list &optional params)
- "Convert LIST into a LaTeX list.
-LIST is as returned by `org-list-parse-list'. PARAMS is a property list
-with overruling parameters for `org-list-to-generic'."
- (org-list-to-generic
- list
- (org-combine-plists
- '(:splicep nil :ostart "\\begin{enumerate}" :oend "\\end{enumerate}"
- :ustart "\\begin{itemize}" :uend "\\end{itemize}"
- :dstart "\\begin{description}" :dend "\\end{description}"
- :dtstart "[" :dtend "]"
- :ddstart "" :ddend ""
- :istart "\\item " :iend ""
- :isep "\n" :lsep "\n"
- :cbon "\\texttt{[X]}" :cboff "\\texttt{[ ]}")
- params)))
-
-(defun org-list-to-html (list &optional params)
- "Convert LIST into a HTML list.
-LIST is as returned by `org-list-parse-list'. PARAMS is a property list
-with overruling parameters for `org-list-to-generic'."
- (org-list-to-generic
- list
- (org-combine-plists
- '(:splicep nil :ostart "<ol>" :oend "</ol>"
- :ustart "<ul>" :uend "</ul>"
- :dstart "<dl>" :dend "</dl>"
- :dtstart "<dt>" :dtend "</dt>"
- :ddstart "<dd>" :ddend "</dd>"
- :istart "<li>" :iend "</li>"
- :isep "\n" :lsep "\n"
- :cbon "<code>[X]</code>" :cboff "<code>[ ]</code>")
- params)))
-
-(defun org-list-to-texinfo (list &optional params)
- "Convert LIST into a Texinfo list.
-LIST is as returned by `org-list-parse-list'. PARAMS is a property list
-with overruling parameters for `org-list-to-generic'."
- (org-list-to-generic
- list
- (org-combine-plists
- '(:splicep nil :ostart "@itemize @minus" :oend "@end itemize"
- :ustart "@enumerate" :uend "@end enumerate"
- :dstart "@table" :dend "@end table"
- :dtstart "@item " :dtend "\n"
- :ddstart "" :ddend ""
- :istart "@item\n" :iend ""
- :isep "\n" :lsep "\n"
- :cbon "@code{[X]}" :cboff "@code{[ ]}")
- params)))
-
-(provide 'org-list)
-
-;; arch-tag: 73cf50c1-200f-4d1d-8a53-4e842a5b11c8
-;;; org-list.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-list.elc b/.emacs.d/org-7.4/lisp/org-list.elc
deleted file mode 100644
index 071c8b3..0000000
--- a/.emacs.d/org-7.4/lisp/org-list.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-mac-message.el b/.emacs.d/org-7.4/lisp/org-mac-message.el
deleted file mode 100644
index a146cc8..0000000
--- a/.emacs.d/org-7.4/lisp/org-mac-message.el
+++ /dev/null
@@ -1,219 +0,0 @@
-;;; org-mac-message.el --- Links to Apple Mail.app messages from within Org-mode
-
-;; Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: John Wiegley <johnw@gnu.org>
-;; Christopher Suckling <suckling at gmail dot com>
-
-;; Version: 7.4
-;; Keywords: outlines, hypermedia, calendar, wp
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-;; This file implements links to Apple Mail.app messages from within Org-mode.
-;; Org-mode does not load this module by default - if you would actually like
-;; this to happen then configure the variable `org-modules'.
-
-;; If you would like to create links to all flagged messages in an
-;; Apple Mail.app account, please customize the variable
-;; `org-mac-mail-account' and then call one of the following functions:
-
-;; (org-mac-message-insert-selected) copies a formatted list of links to
-;; the kill ring.
-
-;; (org-mac-message-insert-selected) inserts at point links to any
-;; messages selected in Mail.app.
-
-;; (org-mac-message-insert-flagged) searches within an org-mode buffer
-;; for a specific heading, creating it if it doesn't exist. Any
-;; message:// links within the first level of the heading are deleted
-;; and replaced with links to flagged messages.
-
-;;; Code:
-
-(require 'org)
-
-(defgroup org-mac-flagged-mail nil
- "Options concerning linking to flagged Mail.app messages"
- :tag "Org Mail.app"
- :group 'org-link)
-
-(defcustom org-mac-mail-account "customize"
- "The Mail.app account in which to search for flagged messages."
- :group 'org-mac-flagged-mail
- :type 'string)
-
-(org-add-link-type "message" 'org-mac-message-open)
-
-;; In mac.c, removed in Emacs 23.
-(declare-function do-applescript "org-mac-message" (script))
-(unless (fboundp 'do-applescript)
- ;; Need to fake this using shell-command-to-string
- (defun do-applescript (script)
- (let (start cmd return)
- (while (string-match "\n" script)
- (setq script (replace-match "\r" t t script)))
- (while (string-match "'" script start)
- (setq start (+ 2 (match-beginning 0))
- script (replace-match "\\'" t t script)))
- (setq cmd (concat "osascript -e '" script "'"))
- (setq return (shell-command-to-string cmd))
- (concat "\"" (org-trim return) "\""))))
-
-(defun org-mac-message-open (message-id)
- "Visit the message with the given MESSAGE-ID.
-This will use the command `open' with the message URL."
- (start-process (concat "open message:" message-id) nil
- "open" (concat "message://<" (substring message-id 2) ">")))
-
-(defun as-get-selected-mail ()
- "AppleScript to create links to selected messages in Mail.app."
- (do-applescript
- (concat
- "tell application \"Mail\"\n"
- "set theLinkList to {}\n"
- "set theSelection to selection\n"
- "repeat with theMessage in theSelection\n"
- "set theID to message id of theMessage\n"
- "set theSubject to subject of theMessage\n"
- "set theLink to \"message://\" & theID & \"::split::\" & theSubject & \"\n\"\n"
- "copy theLink to end of theLinkList\n"
- "end repeat\n"
- "return theLinkList as string\n"
- "end tell")))
-
-(defun as-get-flagged-mail ()
- "AppleScript to create links to flagged messages in Mail.app."
- (do-applescript
- (concat
- ;; Is Growl installed?
- "tell application \"System Events\"\n"
- "set growlHelpers to the name of every process whose creator type contains \"GRRR\"\n"
- "if (count of growlHelpers) > 0 then\n"
- "set growlHelperApp to item 1 of growlHelpers\n"
- "else\n"
- "set growlHelperApp to \"\"\n"
- "end if\n"
- "end tell\n"
-
- ;; Get links
- "tell application \"Mail\"\n"
- "set theMailboxes to every mailbox of account \"" org-mac-mail-account "\"\n"
- "set theLinkList to {}\n"
- "repeat with aMailbox in theMailboxes\n"
- "set theSelection to (every message in aMailbox whose flagged status = true)\n"
- "repeat with theMessage in theSelection\n"
- "set theID to message id of theMessage\n"
- "set theSubject to subject of theMessage\n"
- "set theLink to \"message://\" & theID & \"::split::\" & theSubject & \"\n\"\n"
- "copy theLink to end of theLinkList\n"
-
- ;; Report progress through Growl
- ;; This "double tell" idiom is described in detail at
- ;; http://macscripter.net/viewtopic.php?id=24570 The
- ;; script compiler needs static knowledge of the
- ;; growlHelperApp. Hmm, since we're compiling
- ;; on-the-fly here, this is likely to be way less
- ;; portable than I'd hoped. It'll work when the name
- ;; is still "GrowlHelperApp", though.
- "if growlHelperApp is not \"\" then\n"
- "tell application \"GrowlHelperApp\"\n"
- "tell application growlHelperApp\n"
- "set the allNotificationsList to {\"FlaggedMail\"}\n"
- "set the enabledNotificationsList to allNotificationsList\n"
- "register as application \"FlaggedMail\" all notifications allNotificationsList default notifications enabledNotificationsList icon of application \"Mail\"\n"
- "notify with name \"FlaggedMail\" title \"Importing flagged message\" description theSubject application name \"FlaggedMail\"\n"
- "end tell\n"
- "end tell\n"
- "end if\n"
- "end repeat\n"
- "end repeat\n"
- "return theLinkList as string\n"
- "end tell")))
-
-(defun org-mac-message-get-links (&optional select-or-flag)
- "Create links to the messages currently selected or flagged in Mail.app.
-This will use AppleScript to get the message-id and the subject of the
-messages in Mail.app and make a link out of it.
-When SELECT-OR-FLAG is \"s\", get the selected messages (this is also
-the default). When SELECT-OR-FLAG is \"f\", get the flagged messages.
-The Org-syntax text will be pushed to the kill ring, and also returned."
- (interactive "sLink to (s)elected or (f)lagged messages: ")
- (setq select-or-flag (or select-or-flag "s"))
- (message "AppleScript: searching mailboxes...")
- (let* ((as-link-list
- (if (string= select-or-flag "s")
- (as-get-selected-mail)
- (if (string= select-or-flag "f")
- (as-get-flagged-mail)
- (error "Please select \"s\" or \"f\""))))
- (link-list
- (mapcar
- (lambda (x) (if (string-match "\\`\"\\(.*\\)\"\\'" x) (setq x (match-string 1 x))) x)
- (split-string as-link-list "[\r\n]+")))
- split-link URL description orglink orglink-insert rtn orglink-list)
- (while link-list
- (setq split-link (split-string (pop link-list) "::split::"))
- (setq URL (car split-link))
- (setq description (cadr split-link))
- (when (not (string= URL ""))
- (setq orglink (org-make-link-string URL description))
- (push orglink orglink-list)))
- (setq rtn (mapconcat 'identity orglink-list "\n"))
- (kill-new rtn)
- rtn))
-
-(defun org-mac-message-insert-selected ()
- "Insert a link to the messages currently selected in Mail.app.
-This will use AppleScript to get the message-id and the subject of the
-active mail in Mail.app and make a link out of it."
- (interactive)
- (insert (org-mac-message-get-links "s")))
-
-;; The following line is for backward compatibility
-(defalias 'org-mac-message-insert-link 'org-mac-message-insert-selected)
-
-(defun org-mac-message-insert-flagged (org-buffer org-heading)
- "Asks for an org buffer and a heading within it, and replace message links.
-If heading exists, delete all message:// links within heading's first
-level. If heading doesn't exist, create it at point-max. Insert
-list of message:// links to flagged mail after heading."
- (interactive "bBuffer in which to insert links: \nsHeading after which to insert links: ")
- (with-current-buffer org-buffer
- (goto-char (point-min))
- (let ((isearch-forward t)
- (message-re "\\[\\[\\(message:\\)\\([^]]+\\)\\]\\(\\[\\([^]]+\\)\\]\\)?\\]"))
- (if (org-goto-local-search-headings org-heading nil t)
- (if (not (eobp))
- (progn
- (save-excursion
- (while (re-search-forward
- message-re (save-excursion (outline-next-heading)) t)
- (delete-region (match-beginning 0) (match-end 0)))
- (insert "\n" (org-mac-message-get-links "f")))
- (flush-lines "^$" (point) (outline-next-heading)))
- (insert "\n" (org-mac-message-get-links "f")))
- (goto-char (point-max))
- (insert "\n")
- (org-insert-heading nil t)
- (insert org-heading "\n" (org-mac-message-get-links "f"))))))
-
-(provide 'org-mac-message)
-
-;; arch-tag: 3806d0c1-abe1-4db6-9c31-f3ed7d4a9b32
-
-;;; org-mac-message.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-mac-message.elc b/.emacs.d/org-7.4/lisp/org-mac-message.elc
deleted file mode 100644
index 75bda17..0000000
--- a/.emacs.d/org-7.4/lisp/org-mac-message.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-macs.el b/.emacs.d/org-7.4/lisp/org-macs.el
deleted file mode 100644
index 97a8fdc..0000000
--- a/.emacs.d/org-7.4/lisp/org-macs.el
+++ /dev/null
@@ -1,349 +0,0 @@
-;;; org-macs.el --- Top-level definitions for Org-mode
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file contains macro definitions, defsubst definitions, other
-;; stuff needed for compilation and top-level forms in Org-mode, as well
-;; lots of small functions that are not org-mode specific but simply
-;; generally useful stuff.
-
-;;; Code:
-
-(eval-and-compile
- (unless (fboundp 'declare-function)
- (defmacro declare-function (fn file &optional arglist fileonly))))
-
-(declare-function org-add-props "org-compat" (string plist &rest props))
-(declare-function org-string-match-p "org-compat" (&rest args))
-
-(defmacro org-called-interactively-p (&optional kind)
- `(if (featurep 'xemacs)
- (interactive-p)
- (if (or (> emacs-major-version 23)
- (and (>= emacs-major-version 23)
- (>= emacs-minor-version 2)))
- (with-no-warnings (called-interactively-p ,kind)) ;; defined with no argument in <=23.1
- (interactive-p))))
-
-(if (and (not (fboundp 'with-silent-modifications))
- (or (< emacs-major-version 23)
- (and (= emacs-major-version 23)
- (< emacs-minor-version 2))))
- (defmacro with-silent-modifications (&rest body)
- `(org-unmodified ,@body)))
-
-(defmacro org-bound-and-true-p (var)
- "Return the value of symbol VAR if it is bound, else nil."
- `(and (boundp (quote ,var)) ,var))
-
-(defun org-string-nw-p (s)
- "Is S a string with a non-white character?"
- (and (stringp s)
- (org-string-match-p "\\S-" s)
- s))
-
-(defun org-not-nil (v)
- "If V not nil, and also not the string \"nil\", then return V.
-Otherwise return nil."
- (and v (not (equal v "nil")) v))
-
-(defmacro org-unmodified (&rest body)
- "Execute body without changing `buffer-modified-p'.
-Also, do not record undo information."
- `(set-buffer-modified-p
- (prog1 (buffer-modified-p)
- (let ((buffer-undo-list t)
- before-change-functions after-change-functions)
- ,@body))))
-
-(defmacro org-re (s)
- "Replace posix classes in regular expression."
- (if (featurep 'xemacs)
- (let ((ss s))
- (save-match-data
- (while (string-match "\\[:alnum:\\]" ss)
- (setq ss (replace-match "a-zA-Z0-9" t t ss)))
- (while (string-match "\\[:word:\\]" ss)
- (setq ss (replace-match "a-zA-Z0-9" t t ss)))
- (while (string-match "\\[:alpha:\\]" ss)
- (setq ss (replace-match "a-zA-Z" t t ss)))
- (while (string-match "\\[:punct:\\]" ss)
- (setq ss (replace-match "\001-@[-`{-~" t t ss)))
- ss))
- s))
-
-(defmacro org-preserve-lc (&rest body)
- `(let ((_line (org-current-line))
- (_col (current-column)))
- (unwind-protect
- (progn ,@body)
- (org-goto-line _line)
- (org-move-to-column _col))))
-
-(defmacro org-without-partial-completion (&rest body)
- `(let ((pc-mode (and (boundp 'partial-completion-mode)
- partial-completion-mode)))
- (unwind-protect
- (progn
- (if pc-mode (partial-completion-mode -1))
- ,@body)
- (if pc-mode (partial-completion-mode 1)))))
-
-(defmacro org-maybe-intangible (props)
- "Add '(intangible t) to PROPS if Emacs version is earlier than Emacs 22.
-In Emacs 21, invisible text is not avoided by the command loop, so the
-intangible property is needed to make sure point skips this text.
-In Emacs 22, this is not necessary. The intangible text property has
-led to problems with flyspell. These problems are fixed in flyspell.el,
-but we still avoid setting the property in Emacs 22 and later.
-We use a macro so that the test can happen at compilation time."
- (if (< emacs-major-version 22)
- `(append '(intangible t) ,props)
- props))
-
-(defmacro org-with-point-at (pom &rest body)
- "Move to buffer and point of point-or-marker POM for the duration of BODY."
- `(save-excursion
- (if (markerp ,pom) (set-buffer (marker-buffer ,pom)))
- (save-excursion
- (goto-char (or ,pom (point)))
- ,@body)))
-(put 'org-with-point-at 'lisp-indent-function 1)
-
-(defmacro org-no-warnings (&rest body)
- (cons (if (fboundp 'with-no-warnings) 'with-no-warnings 'progn) body))
-
-(defmacro org-if-unprotected (&rest body)
- "Execute BODY if there is no `org-protected' text property at point."
- `(unless (get-text-property (point) 'org-protected)
- ,@body))
-
-(defmacro org-if-unprotected-1 (&rest body)
- "Execute BODY if there is no `org-protected' text property at point-1."
- `(unless (get-text-property (1- (point)) 'org-protected)
- ,@body))
-
-(defmacro org-if-unprotected-at (pos &rest body)
- "Execute BODY if there is no `org-protected' text property at POS."
- `(unless (get-text-property ,pos 'org-protected)
- ,@body))
-(put 'org-if-unprotected-at 'lisp-indent-function 1)
-
-(defun org-re-search-forward-unprotected (&rest args)
- "Like re-search-forward, but stop only in unprotected places."
- (catch 'exit
- (while t
- (unless (apply 're-search-forward args)
- (throw 'exit nil))
- (unless (get-text-property (match-beginning 0) 'org-protected)
- (throw 'exit (point))))))
-
-(defmacro org-with-remote-undo (_buffer &rest _body)
- "Execute BODY while recording undo information in two buffers."
- `(let ((_cline (org-current-line))
- (_cmd this-command)
- (_buf1 (current-buffer))
- (_buf2 ,_buffer)
- (_undo1 buffer-undo-list)
- (_undo2 (with-current-buffer ,_buffer buffer-undo-list))
- _c1 _c2)
- ,@_body
- (when org-agenda-allow-remote-undo
- (setq _c1 (org-verify-change-for-undo
- _undo1 (with-current-buffer _buf1 buffer-undo-list))
- _c2 (org-verify-change-for-undo
- _undo2 (with-current-buffer _buf2 buffer-undo-list)))
- (when (or _c1 _c2)
- ;; make sure there are undo boundaries
- (and _c1 (with-current-buffer _buf1 (undo-boundary)))
- (and _c2 (with-current-buffer _buf2 (undo-boundary)))
- ;; remember which buffer to undo
- (push (list _cmd _cline _buf1 _c1 _buf2 _c2)
- org-agenda-undo-list)))))
-
-(defmacro org-no-read-only (&rest body)
- "Inhibit read-only for BODY."
- `(let ((inhibit-read-only t)) ,@body))
-
-(defconst org-rm-props '(invisible t face t keymap t intangible t mouse-face t
- rear-nonsticky t mouse-map t fontified t
- org-emphasis t)
- "Properties to remove when a string without properties is wanted.")
-
-(defsubst org-match-string-no-properties (num &optional string)
- (if (featurep 'xemacs)
- (let ((s (match-string num string)))
- (and s (remove-text-properties 0 (length s) org-rm-props s))
- s)
- (match-string-no-properties num string)))
-
-(defsubst org-no-properties (s)
- (if (fboundp 'set-text-properties)
- (set-text-properties 0 (length s) nil s)
- (remove-text-properties 0 (length s) org-rm-props s))
- s)
-
-(defsubst org-get-alist-option (option key)
- (cond ((eq key t) t)
- ((eq option t) t)
- ((assoc key option) (cdr (assoc key option)))
- (t (cdr (assq 'default option)))))
-
-(defsubst org-check-external-command (cmd &optional use no-error)
- "Check if external program CMD for USE exists, error if not.
-When the program does exist, return its path.
-When it does not exist and NO-ERROR is set, return nil.
-Otherwise, throw an error. The optional argument USE can describe what this
-program is needed for, so that the error message can be more informative."
- (or (executable-find cmd)
- (if no-error
- nil
- (error "Can't find `%s'%s" cmd
- (if use (format " (%s)" use) "")))))
-
-(defsubst org-inhibit-invisibility ()
- "Modified `buffer-invisibility-spec' for Emacs 21.
-Some ops with invisible text do not work correctly on Emacs 21. For these
-we turn off invisibility temporarily. Use this in a `let' form."
- (if (< emacs-major-version 22) nil buffer-invisibility-spec))
-
-(defsubst org-set-local (var value)
- "Make VAR local in current buffer and set it to VALUE."
- (set (make-local-variable var) value))
-
-(defsubst org-mode-p ()
- "Check if the current buffer is in Org-mode."
- (eq major-mode 'org-mode))
-
-(defsubst org-last (list)
- "Return the last element of LIST."
- (car (last list)))
-
-(defun org-let (list &rest body)
- (eval (cons 'let (cons list body))))
-(put 'org-let 'lisp-indent-function 1)
-
-(defun org-let2 (list1 list2 &rest body)
- (eval (cons 'let (cons list1 (list (cons 'let (cons list2 body)))))))
-(put 'org-let2 'lisp-indent-function 2)
-
-(defsubst org-call-with-arg (command arg)
- "Call COMMAND interactively, but pretend prefix arg was ARG."
- (let ((current-prefix-arg arg)) (call-interactively command)))
-
-(defsubst org-current-line (&optional pos)
- (save-excursion
- (and pos (goto-char pos))
- ;; works also in narrowed buffer, because we start at 1, not point-min
- (+ (if (bolp) 1 0) (count-lines 1 (point)))))
-
-(defsubst org-goto-line (N)
- (save-restriction
- (widen)
- (goto-char (point-min))
- (forward-line (1- N))))
-
-(defsubst org-current-line-string (&optional to-here)
- (buffer-substring (point-at-bol) (if to-here (point) (point-at-eol))))
-
-(defsubst org-pos-in-match-range (pos n)
- (and (match-beginning n)
- (<= (match-beginning n) pos)
- (>= (match-end n) pos)))
-
-(defun org-autoload (file functions)
- "Establish autoload for all FUNCTIONS in FILE, if not bound already."
- (let ((d (format "Documentation will be available after `%s.el' is loaded."
- file))
- f)
- (while (setq f (pop functions))
- (or (fboundp f) (autoload f file d t)))))
-
-(defun org-match-line (re)
- "Looking-at at the beginning of the current line."
- (save-excursion
- (goto-char (point-at-bol))
- (looking-at re)))
-
-(defun org-plist-delete (plist property)
- "Delete PROPERTY from PLIST.
-This is in contrast to merely setting it to 0."
- (let (p)
- (while plist
- (if (not (eq property (car plist)))
- (setq p (plist-put p (car plist) (nth 1 plist))))
- (setq plist (cddr plist)))
- p))
-
-(defun org-replace-match-keep-properties (newtext &optional fixedcase
- literal string)
- "Like `replace-match', but add the text properties found original text."
- (setq newtext (org-add-props newtext (text-properties-at
- (match-beginning 0) string)))
- (replace-match newtext fixedcase literal string))
-
-(defmacro org-save-outline-visibility (use-markers &rest body)
- "Save and restore outline visibility around BODY.
-If USE-MARKERS is non-nil, use markers for the positions.
-This means that the buffer may change while running BODY,
-but it also means that the buffer should stay alive
-during the operation, because otherwise all these markers will
-point nowhere."
- (declare (indent 1))
- `(let ((data (org-outline-overlay-data ,use-markers)))
- (unwind-protect
- (progn
- ,@body
- (org-set-outline-overlay-data data))
- (when ,use-markers
- (mapc (lambda (c)
- (and (markerp (car c)) (move-marker (car c) nil))
- (and (markerp (cdr c)) (move-marker (cdr c) nil)))
- data)))))
-
-(defmacro org-with-limited-levels (&rest body)
- "Execute BODY with limited number of outline levels."
- `(let* ((outline-regexp (org-get-limited-outline-regexp)))
- ,@body))
-
-(defvar org-odd-levels-only) ; defined in org.el
-(defvar org-inlinetask-min-level) ; defined in org-inlinetask.el
-(defun org-get-limited-outline-regexp ()
- "Return outline-regexp with limited number of levels.
-The number of levels is controlled by `org-inlinetask-min-level'"
- (if (or (not (org-mode-p)) (not (featurep 'org-inlinetask)))
-
- outline-regexp
- (let* ((limit-level (1- org-inlinetask-min-level))
- (nstars (if org-odd-levels-only (1- (* limit-level 2)) limit-level)))
- (format "\\*\\{1,%d\\} " nstars))))
-
-(provide 'org-macs)
-
-;; arch-tag: 7e6a73ce-aac9-4fc0-9b30-ce6f89dc6668
-
-;;; org-macs.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-macs.elc b/.emacs.d/org-7.4/lisp/org-macs.elc
deleted file mode 100644
index fd20f0f..0000000
--- a/.emacs.d/org-7.4/lisp/org-macs.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-mew.el b/.emacs.d/org-7.4/lisp/org-mew.el
deleted file mode 100644
index 9636a1a..0000000
--- a/.emacs.d/org-7.4/lisp/org-mew.el
+++ /dev/null
@@ -1,140 +0,0 @@
-;;; org-mew.el --- Support for links to Mew messages from within Org-mode
-
-;; Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file implements links to Mew messages from within Org-mode.
-;; Org-mode loads this module by default - if this is not what you want,
-;; configure the variable `org-modules'.
-
-;;; Code:
-
-(require 'org)
-
-(defgroup org-mew nil
- "Options concerning the Mew link."
- :tag "Org Startup"
- :group 'org-link)
-
-(defcustom org-mew-link-to-refile-destination t
- "Create a link to the refile destination if the message is marked as refile."
- :group 'org-mew
- :type 'boolean)
-
-;; Declare external functions and variables
-(declare-function mew-cache-hit "ext:mew-cache" (fld msg &optional must-hit))
-(declare-function mew-case-folder "ext:mew-func" (case folder))
-(declare-function mew-header-get-value "ext:mew-header"
- (field &optional as-list))
-(declare-function mew-init "ext:mew" ())
-(declare-function mew-refile-get "ext:mew-refile" (msg))
-(declare-function mew-sinfo-get-case "ext:mew-summary" ())
-(declare-function mew-summary-display "ext:mew-summary2" (&optional redisplay))
-(declare-function mew-summary-folder-name "ext:mew-syntax" (&optional ext))
-(declare-function mew-summary-get-mark "ext:mew-mark" ())
-(declare-function mew-summary-message-number2 "ext:mew-syntax" ())
-(declare-function mew-summary-pick-with-mewl "ext:mew-pick"
- (pattern folder src-msgs))
-(declare-function mew-summary-search-msg "ext:mew-const" (msg))
-(declare-function mew-summary-set-message-buffer "ext:mew-summary3" (fld msg))
-(declare-function mew-summary-visit-folder "ext:mew-summary4"
- (folder &optional goend no-ls))
-(declare-function mew-window-push "ext:mew" ())
-(defvar mew-init-p)
-(defvar mew-summary-goto-line-then-display)
-
-;; Install the link type
-(org-add-link-type "mew" 'org-mew-open)
-(add-hook 'org-store-link-functions 'org-mew-store-link)
-
-;; Implementation
-(defun org-mew-store-link ()
- "Store a link to a Mew folder or message."
- (when (memq major-mode '(mew-summary-mode mew-virtual-mode))
- (let* ((msgnum (mew-summary-message-number2))
- (mark-info (mew-summary-get-mark))
- (folder-name
- (if (and org-mew-link-to-refile-destination
- (eq mark-info ?o)) ; marked as refile
- (mew-case-folder (mew-sinfo-get-case)
- (nth 1 (mew-refile-get msgnum)))
- (mew-summary-folder-name)))
- message-id from to subject desc link date date-ts date-ts-ia)
- (save-window-excursion
- (if (fboundp 'mew-summary-set-message-buffer)
- (mew-summary-set-message-buffer folder-name msgnum)
- (set-buffer (mew-cache-hit folder-name msgnum t)))
- (setq message-id (mew-header-get-value "Message-Id:"))
- (setq from (mew-header-get-value "From:"))
- (setq to (mew-header-get-value "To:"))
- (setq date (mew-header-get-value "Date:"))
- (setq date-ts (and date (format-time-string
- (org-time-stamp-format t)
- (date-to-time date))))
- (setq date-ts-ia (and date (format-time-string
- (org-time-stamp-format t t)
- (date-to-time date))))
- (setq subject (mew-header-get-value "Subject:")))
- (org-store-link-props :type "mew" :from from :to to
- :subject subject :message-id message-id)
- (when date
- (org-add-link-props :date date :date-timestamp date-ts
- :date-timestamp-inactive date-ts-ia))
- (setq message-id (org-remove-angle-brackets message-id))
- (setq desc (org-email-link-description))
- (setq link (org-make-link "mew:" folder-name
- "#" message-id))
- (org-add-link-props :link link :description desc)
- link)))
-
-(defun org-mew-open (path)
- "Follow the Mew message link specified by PATH."
- (let (folder msgnum)
- (cond ((string-match "\\`\\(+.*\\)+\\+\\([0-9]+\\)\\'" path) ; for Bastien's
- (setq folder (match-string 1 path))
- (setq msgnum (match-string 2 path)))
- ((string-match "\\`\\(\\(%#\\)?[^#]+\\)\\(#\\(.*\\)\\)?" path)
- (setq folder (match-string 1 path))
- (setq msgnum (match-string 4 path)))
- (t (error "Error in Mew link")))
- (require 'mew)
- (mew-window-push)
- (unless mew-init-p (mew-init))
- (mew-summary-visit-folder folder)
- (when msgnum
- (if (not (string-match "\\`[0-9]+\\'" msgnum))
- (let* ((pattern (concat "message-id=" msgnum))
- (msgs (mew-summary-pick-with-mewl pattern folder nil)))
- (setq msgnum (car msgs))))
- (if (mew-summary-search-msg msgnum)
- (if mew-summary-goto-line-then-display
- (mew-summary-display))
- (error "Message not found")))))
-
-(provide 'org-mew)
-
-;; arch-tag: 07ccdca7-6020-4941-a593-588a1e51b870
-
-;;; org-mew.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-mew.elc b/.emacs.d/org-7.4/lisp/org-mew.elc
deleted file mode 100644
index 894cef3..0000000
--- a/.emacs.d/org-7.4/lisp/org-mew.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-mhe.el b/.emacs.d/org-7.4/lisp/org-mhe.el
deleted file mode 100644
index c384062..0000000
--- a/.emacs.d/org-7.4/lisp/org-mhe.el
+++ /dev/null
@@ -1,230 +0,0 @@
-;;; org-mhe.el --- Support for links to MH-E messages from within Org-mode
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Thomas Baumann <thomas dot baumann at ch dot tum dot de>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file implements links to MH-E messages from within Org-mode.
-;; Org-mode loads this module by default - if this is not what you want,
-;; configure the variable `org-modules'.
-
-;;; Code:
-
-(require 'org)
-
-;; Customization variables
-
-(defcustom org-mhe-search-all-folders nil
- "Non-nil means the search for the mh-message may extend to all folders.
-When non-nil, the search for a message will extend to all other
-folders if it cannot be found in the folder given in the link.
-Searching all folders may be slow with the default pick based
-search but is very efficient with one of the other search engines
-supported by MH-E."
- :group 'org-link-follow
- :type 'boolean)
-
-;; Declare external functions and variables
-(declare-function mh-display-msg "mh-show" (msg-num folder-name))
-(declare-function mh-find-path "mh-utils" ())
-(declare-function mh-get-header-field "mh-utils" (field))
-(declare-function mh-get-msg-num "mh-utils" (error-if-no-message))
-(declare-function mh-header-display "mh-show" ())
-(declare-function mh-index-previous-folder "mh-search" ())
-(declare-function mh-normalize-folder-name "mh-utils"
- (folder &optional empty-string-okay dont-remove-trailing-slash
- return-nil-if-folder-empty))
-(declare-function mh-search "mh-search"
- (folder search-regexp &optional redo-search-flag
- window-config))
-(declare-function mh-search-choose "mh-search" (&optional searcher))
-(declare-function mh-show "mh-show" (&optional message redisplay-flag))
-(declare-function mh-show-buffer-message-number "mh-comp" (&optional buffer))
-(declare-function mh-show-header-display "mh-show" t t)
-(declare-function mh-show-msg "mh-show" (msg))
-(declare-function mh-show-show "mh-show" t t)
-(declare-function mh-visit-folder "mh-folder" (folder &optional
- range index-data))
-(defvar mh-progs)
-(defvar mh-current-folder)
-(defvar mh-show-folder-buffer)
-(defvar mh-index-folder)
-(defvar mh-searcher)
-(defvar mh-search-regexp-builder)
-
-;; Install the link type
-(org-add-link-type "mhe" 'org-mhe-open)
-(add-hook 'org-store-link-functions 'org-mhe-store-link)
-
-;; Implementation
-(defun org-mhe-store-link ()
- "Store a link to an MH-E folder or message."
- (when (or (equal major-mode 'mh-folder-mode)
- (equal major-mode 'mh-show-mode))
- (let* ((from (org-mhe-get-header "From:"))
- (to (org-mhe-get-header "To:"))
- (message-id (org-mhe-get-header "Message-Id:"))
- (subject (org-mhe-get-header "Subject:"))
- (date (org-mhe-get-header "Date:"))
- (date-ts (and date (format-time-string
- (org-time-stamp-format t) (date-to-time date))))
- (date-ts-ia (and date (format-time-string
- (org-time-stamp-format t t)
- (date-to-time date))))
- link desc)
- (org-store-link-props :type "mh" :from from :to to
- :subject subject :message-id message-id)
- (when date
- (org-add-link-props :date date :date-timestamp date-ts
- :date-timestamp-inactive date-ts-ia))
- (setq desc (org-email-link-description))
- (setq link (org-make-link "mhe:" (org-mhe-get-message-real-folder) "#"
- (org-remove-angle-brackets message-id)))
- (org-add-link-props :link link :description desc)
- link)))
-
-(defun org-mhe-open (path)
- "Follow an MH-E message link specified by PATH."
- (let (folder article)
- (if (not (string-match "\\`\\([^#]+\\)\\(#\\(.*\\)\\)?" path))
- (error "Error in MH-E link"))
- (setq folder (match-string 1 path)
- article (match-string 3 path))
- (org-mhe-follow-link folder article)))
-
-;;; mh-e integration based on planner-mode
-(defun org-mhe-get-message-real-folder ()
- "Return the name of the real folder for the current message.
-So if you use sequences, it will now work."
- (save-excursion
- (let* ((folder
- (if (equal major-mode 'mh-folder-mode)
- mh-current-folder
- ;; Refer to the show buffer
- mh-show-folder-buffer))
- (end-index
- (if (boundp 'mh-index-folder)
- (min (length mh-index-folder) (length folder))))
- )
- ;; a simple test on mh-index-data does not work, because
- ;; mh-index-data is always nil in a show buffer.
- (if (and (boundp 'mh-index-folder)
- (string= mh-index-folder (substring folder 0 end-index)))
- (if (equal major-mode 'mh-show-mode)
- (save-window-excursion
- (let (pop-up-frames)
- (when (buffer-live-p (get-buffer folder))
- (progn
- (pop-to-buffer folder)
- (org-mhe-get-message-folder-from-index)
- )
- )))
- (org-mhe-get-message-folder-from-index)
- )
- folder
- )
- )))
-
-(defun org-mhe-get-message-folder-from-index ()
- "Return the name of the message folder in an index folder buffer."
- (save-excursion
- (mh-index-previous-folder)
- (if (re-search-forward "^\\(+.*\\)$" nil t)
- (message "%s" (match-string 1)))))
-
-(defun org-mhe-get-message-folder ()
- "Return the name of the current message folder.
-Be careful if you use sequences."
- (save-excursion
- (if (equal major-mode 'mh-folder-mode)
- mh-current-folder
- ;; Refer to the show buffer
- mh-show-folder-buffer)))
-
-(defun org-mhe-get-message-num ()
- "Return the number of the current message.
-Be careful if you use sequences."
- (save-excursion
- (if (equal major-mode 'mh-folder-mode)
- (mh-get-msg-num nil)
- ;; Refer to the show buffer
- (mh-show-buffer-message-number))))
-
-(defun org-mhe-get-header (header)
- "Return the field for HEADER of the message in folder mode.
-This will create a show buffer for the corresponding message. If
-you have a better idea of how to do this then please let us know."
- (let* ((folder (org-mhe-get-message-folder))
- (num (org-mhe-get-message-num))
- (buffer (get-buffer-create (concat "show-" folder)))
- (header-field))
- (with-current-buffer buffer
- (mh-display-msg num folder)
- (if (equal major-mode 'mh-folder-mode)
- (mh-header-display)
- (mh-show-header-display))
- (set-buffer buffer)
- (setq header-field (mh-get-header-field header))
- (if (equal major-mode 'mh-folder-mode)
- (mh-show)
- (mh-show-show))
- (org-trim header-field))))
-
-(defun org-mhe-follow-link (folder article)
- "Follow an MH-E link to FOLDER and ARTICLE.
-If ARTICLE is nil FOLDER is shown. If the configuration variable
-`org-mhe-search-all-folders' is t and `mh-searcher' is pick,
-ARTICLE is searched in all folders. Indexed searches (swish++,
-namazu, and others supported by MH-E) will always search in all
-folders."
- (require 'mh-e)
- (require 'mh-search)
- (require 'mh-utils)
- (mh-find-path)
- (if (not article)
- (mh-visit-folder (mh-normalize-folder-name folder))
- (mh-search-choose)
- (if (equal mh-searcher 'pick)
- (progn
- (setq article (org-add-angle-brackets article))
- (mh-search folder (list "--message-id" article))
- (when (and org-mhe-search-all-folders
- (not (org-mhe-get-message-real-folder)))
- (kill-this-buffer)
- (mh-search "+" (list "--message-id" article))))
- (if mh-search-regexp-builder
- (mh-search "+" (funcall mh-search-regexp-builder
- (list (cons 'message-id article))))
- (mh-search "+" article)))
- (if (org-mhe-get-message-real-folder)
- (mh-show-msg 1)
- (kill-this-buffer)
- (error "Message not found"))))
-
-(provide 'org-mhe)
-
-;; arch-tag: dcb05484-8627-491d-a8c1-01dbd2bde4ae
-
-;;; org-mhe.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-mhe.elc b/.emacs.d/org-7.4/lisp/org-mhe.elc
deleted file mode 100644
index 7f40b13..0000000
--- a/.emacs.d/org-7.4/lisp/org-mhe.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-mks.el b/.emacs.d/org-7.4/lisp/org-mks.el
deleted file mode 100644
index df4ab3e..0000000
--- a/.emacs.d/org-7.4/lisp/org-mks.el
+++ /dev/null
@@ -1,137 +0,0 @@
-;;; org-mks.el --- Multi-key-selection for Org-mode
-
-;; Copyright (C) 2010 Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-
-;;; Commentary:
-;;
-
-;;; Code:
-
-(require 'org)
-(eval-when-compile
- (require 'cl))
-
-(defun org-mks (table title &optional prompt specials)
- "Select a member of an alist with multiple keys.
-TABLE is the alist which should contain entries where the car is a string.
-There should be two types of entries.
-
-1. prefix descriptions like (\"a\" \"Description\")
- This indicates that `a' is a prefix key for multi-letter selection, and
- that there are entries following with keys like \"ab\", \"ax\"...
-
-2. Selectable members must have more than two elements, with the first
- being the string of keys that lead to selecting it, and the second a
- short description string of the item.
-
-The command will then make a temporary buffer listing all entries
-that can be selected with a single key, and all the single key
-prefixes. When you press the key for a single-letter entry, it is selected.
-When you press a prefix key, the commands (and maybe further prefixes)
-under this key will be shown and offered for selection.
-
-TITLE will be placed over the selection in the temporary buffer,
-PROMPT will be used when prompting for a key. SPECIAL is an alist with
-also (\"key\" \"description\") entries. When one of these is selection,
-only the bare key is returned."
- (setq prompt (or prompt "Select: "))
- (let (tbl orig-table dkey ddesc des-keys allowed-keys
- current prefix rtn re pressed buffer (inhibit-quit t))
- (save-window-excursion
- (setq buffer (org-switch-to-buffer-other-window "*Org Select*"))
- (setq orig-table table)
- (catch 'exit
- (while t
- (erase-buffer)
- (insert title "\n\n")
- (setq tbl table
- des-keys nil
- allowed-keys nil)
- (setq prefix (if current (concat current " ") ""))
- (while tbl
- (cond
- ((and (= 2 (length (car tbl))) (= (length (caar tbl)) 1))
- ;; This is a description on this level
- (setq dkey (caar tbl) ddesc (cadar tbl))
- (pop tbl)
- (push dkey des-keys)
- (push dkey allowed-keys)
- (insert prefix "[" dkey "]" "..." " " ddesc "..." "\n")
- ;; Skip keys which are below this prefix
- (setq re (concat "\\`" (regexp-quote dkey)))
- (while (and tbl (string-match re (caar tbl))) (pop tbl)))
- ((= 2 (length (car tbl)))
- ;; Not yet a usable description, skip it
- )
- (t
- ;; usable entry on this level
- (insert prefix "[" (caar tbl) "]" " " (nth 1 (car tbl)) "\n")
- (push (caar tbl) allowed-keys)
- (pop tbl))))
- (when specials
- (insert "-------------------------------------------------------------------------------\n")
- (let ((sp specials))
- (while sp
- (insert (format "[%s] %s\n"
- (caar sp) (nth 1 (car sp))))
- (push (caar sp) allowed-keys)
- (pop sp))))
- (push "\C-g" allowed-keys)
- (goto-char (point-min))
- (if (not (pos-visible-in-window-p (point-max)))
- (org-fit-window-to-buffer))
- (message prompt)
- (setq pressed (char-to-string (read-char-exclusive)))
- (while (not (member pressed allowed-keys))
- (message "Invalid key `%s'" pressed) (sit-for 1)
- (message prompt)
- (setq pressed (char-to-string (read-char-exclusive))))
- (when (equal pressed "\C-g")
- (kill-buffer buffer)
- (error "Abort"))
- (when (and (not (assoc pressed table))
- (not (member pressed des-keys))
- (assoc pressed specials))
- (throw 'exit (setq rtn pressed)))
- (unless (member pressed des-keys)
- (throw 'exit (setq rtn (rassoc (cdr (assoc pressed table))
- orig-table))))
- (setq current (concat current pressed))
- (setq table (mapcar
- (lambda (x)
- (if (and (> (length (car x)) 1)
- (equal (substring (car x) 0 1) pressed))
- (cons (substring (car x) 1) (cdr x))
- nil))
- table))
- (setq table (remove nil table)))))
- (when buffer (kill-buffer buffer))
- rtn))
-
-(provide 'org-mks)
-
-;; arch-tag: 4ea90d0e-c6e4-4684-bd61-baf878712f9f
-
-;;; org-mks.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-mks.elc b/.emacs.d/org-7.4/lisp/org-mks.elc
deleted file mode 100644
index e1c644c..0000000
--- a/.emacs.d/org-7.4/lisp/org-mks.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-mobile.el b/.emacs.d/org-7.4/lisp/org-mobile.el
deleted file mode 100644
index 4b16e2b..0000000
--- a/.emacs.d/org-7.4/lisp/org-mobile.el
+++ /dev/null
@@ -1,1089 +0,0 @@
-;;; org-mobile.el --- Code for asymmetric sync with a mobile device
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-;;
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-;;
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-;;
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-;;
-;; This file contains the code to interact with Richard Moreland's iPhone
-;; application MobileOrg, as well as with the Android version by Matthew Jones.
-;; This code is documented in Appendix B of the Org-mode manual. The code is
-;; not specific for the iPhone and Android - any external
-;; viewer/flagging/editing application that uses the same conventions could
-;; be used.
-
-(require 'org)
-(require 'org-agenda)
-;;; Code:
-
-(eval-when-compile (require 'cl))
-
-(defgroup org-mobile nil
- "Options concerning support for a viewer/editor on a mobile device."
- :tag "Org Mobile"
- :group 'org)
-
-(defcustom org-mobile-files '(org-agenda-files)
- "Files to be staged for MobileOrg.
-This is basically a list of files and directories. Files will be staged
-directly. Directories will be search for files with the extension `.org'.
-In addition to this, the list may also contain the following symbols:
-
-org-agenda-files
- This means include the complete, unrestricted list of files given in
- the variable `org-agenda-files'.
-org-agenda-text-search-extra-files
- Include the files given in the variable
- `org-agenda-text-search-extra-files'"
- :group 'org-mobile
- :type '(list :greedy t
- (option (const :tag "org-agenda-files" org-agenda-files))
- (option (const :tag "org-agenda-text-search-extra-files"
- org-agenda-text-search-extra-files))
- (repeat :inline t :tag "Additional files"
- (file))))
-
-(defcustom org-mobile-directory ""
- "The WebDAV directory where the interaction with the mobile takes place."
- :group 'org-mobile
- :type 'directory)
-
-(defcustom org-mobile-use-encryption nil
- "Non-nil means keep only encrypted files on the WebDAV server.
-Encryption uses AES-256, with a password given in
-`org-mobile-encryption-password'.
-When nil, plain files are kept on the server.
-Turning on encryption requires to set the same password in the MobileOrg
-application. Before turning this on, check of MobileOrg does already
-support it - at the time of this writing it did not yet."
- :group 'org-mobile
- :type 'boolean)
-
-(defcustom org-mobile-encryption-tempfile "~/orgtmpcrypt"
- "File that is being used as a temporary file for encryption.
-This must be local file on your local machine (not on the WebDAV server).
-You might want to put this file into a directory where only you have access."
- :group 'org-mobile
- :type 'directory)
-
-(defcustom org-mobile-encryption-password ""
- "Password for encrypting files uploaded to the server.
-This is a single password which is used for AES-256 encryption. The same
-password must also be set in the MobileOrg application. All Org files,
-including mobileorg.org will be encrypted using this password.
-
-SECURITY CONSIDERATIONS:
-
-Note that, when Org runs the encryption commands, the password could
-be visible briefly on your system with the `ps' command. So this method is
-only intended to keep the files secure on the server, not on your own machine.
-
-Also, if you set this variable in an init file (.emacs or .emacs.d/init.el
-or custom.el...) and if that file is stored in a way so that other can read
-it, this also limits the security of this approach. You can also leave
-this variable empty - Org will then ask for the password once per Emacs
-session."
- :group 'org-mobile
- :type '(string :tag "Password"))
-
-(defvar org-mobile-encryption-password-session nil)
-
-(defun org-mobile-encryption-password ()
- (or (org-string-nw-p org-mobile-encryption-password)
- (org-string-nw-p org-mobile-encryption-password-session)
- (setq org-mobile-encryption-password-session
- (read-passwd "Password for MobileOrg: " t))))
-
-(defcustom org-mobile-inbox-for-pull "~/org/from-mobile.org"
- "The file where captured notes and flags will be appended to.
-During the execution of `org-mobile-pull', the file
-`org-mobile-capture-file' will be emptied it's contents have
-been appended to the file given here. This file should be in
-`org-directory', and not in the staging area or on the web server."
- :group 'org-mobile
- :type 'file)
-
-(defconst org-mobile-capture-file "mobileorg.org"
- "The capture file where the mobile stores captured notes and flags.
-This should not be changed, because MobileOrg assumes this name.")
-
-(defcustom org-mobile-index-file "index.org"
- "The index file with inks to all Org files that should be loaded by MobileOrg.
-Relative to `org-mobile-directory'. The Address field in the MobileOrg setup
-should point to this file."
- :group 'org-mobile
- :type 'file)
-
-(defcustom org-mobile-agendas 'all
- "The agendas that should be pushed to MobileOrg.
-Allowed values:
-
-default the weekly agenda and the global TODO list
-custom all custom agendas defined by the user
-all the custom agendas and the default ones
-list a list of selection key(s) as string."
- :group 'org-mobile
- :type '(choice
- (const :tag "Default Agendas" default)
- (const :tag "Custom Agendas" custom)
- (const :tag "Default and Custom Agendas" all)
- (repeat :tag "Selected"
- (string :tag "Selection Keys"))))
-
-(defcustom org-mobile-force-id-on-agenda-items t
- "Non-nil means make all agenda items carry an ID."
- :group 'org-mobile
- :type 'boolean)
-
-(defcustom org-mobile-force-mobile-change nil
- "Non-nil means force the change made on the mobile device.
-So even if there have been changes to the computer version of the entry,
-force the new value set on the mobile.
-When nil, mark the entry from the mobile with an error message.
-Instead of nil or t, this variable can also be a list of symbols, indicating
-the editing types for which the mobile version should always dominate."
- :group 'org-mobile
- :type '(choice
- (const :tag "Always" t)
- (const :tag "Never" nil)
- (set :greedy t :tag "Specify"
- (const todo)
- (const tags)
- (const priority)
- (const heading)
- (const body))))
-
-(defcustom org-mobile-action-alist
- '(("edit" . (org-mobile-edit data old new)))
- "Alist with flags and actions for mobile sync.
-When flagging an entry, MobileOrg will create entries that look like
-
- * F(action:data) [[id:entry-id][entry title]]
-
-This alist defines that the ACTION in the parentheses of F() should mean,
-i.e. what action should be taken. The :data part in the parenthesis is
-optional. If present, the string after the colon will be passed to the
-action form as the `data' variable.
-The car of each elements of the alist is an actions string. The cdr is
-an Emacs Lisp form that will be evaluated with the cursor on the headline
-of that entry.
-
-For now, it is not recommended to change this variable."
- :group 'org-mobile
- :type '(repeat
- (cons (string :tag "Action flag")
- (sexp :tag "Action form"))))
-
-(defcustom org-mobile-checksum-binary (or (executable-find "shasum")
- (executable-find "sha1sum")
- (executable-find "md5sum")
- (executable-find "md5"))
- "Executable used for computing checksums of agenda files."
- :group 'org-mobile
- :type 'string)
-
-(defvar org-mobile-pre-push-hook nil
- "Hook run before running `org-mobile-push'.
-This could be used to clean up `org-mobile-directory', for example to
-remove files that used to be included in the agenda but no longer are.
-The presence of such files would not really be a problem, but after time
-they may accumulate.")
-
-(defvar org-mobile-post-push-hook nil
- "Hook run after running `org-mobile-push'.
-If Emacs does not have direct write access to the WebDAV directory used
-by the mobile device, this hook should be used to copy all files from the
-local staging directory `org-mobile-directory' to the WebDAV directory,
-for example using `rsync' or `scp'.")
-
-(defvar org-mobile-pre-pull-hook nil
- "Hook run before executing `org-mobile-pull'.
-If Emacs does not have direct write access to the WebDAV directory used
-by the mobile device, this hook should be used to copy the capture file
-`mobileorg.org' from the WebDAV location to the local staging
-directory `org-mobile-directory'.")
-
-(defvar org-mobile-post-pull-hook nil
- "Hook run after running `org-mobile-pull'.
-If Emacs does not have direct write access to the WebDAV directory used
-by the mobile device, this hook should be used to copy the emptied
-capture file `mobileorg.org' back to the WebDAV directory, for example
-using `rsync' or `scp'.")
-
-(defvar org-mobile-last-flagged-files nil
- "List of files containing entries flagged in the latest pull.")
-
-(defvar org-mobile-files-alist nil)
-(defvar org-mobile-checksum-files nil)
-
-(defun org-mobile-prepare-file-lists ()
- (setq org-mobile-files-alist (org-mobile-files-alist))
- (setq org-mobile-checksum-files nil))
-
-(defun org-mobile-files-alist ()
- "Expand the list in `org-mobile-files' to a list of existing files."
- (let* ((include-archives
- (and (member 'org-agenda-text-search-extra-files org-mobile-files)
- (member 'agenda-archives org-agenda-text-search-extra-files)
- t))
- (files
- (apply 'append
- (mapcar
- (lambda (f)
- (cond
- ((eq f 'org-agenda-files)
- (org-agenda-files t include-archives))
- ((eq f 'org-agenda-text-search-extra-files)
- (delq 'agenda-archives
- (copy-sequence
- org-agenda-text-search-extra-files)))
- ((and (stringp f) (file-directory-p f))
- (directory-files f 'full "\\.org\\'"))
- ((and (stringp f) (file-exists-p f))
- (list f))
- (t nil)))
- org-mobile-files)))
- (orgdir-uname (file-name-as-directory (file-truename org-directory)))
- (orgdir-re (concat "\\`" (regexp-quote orgdir-uname)))
- uname seen rtn file link-name)
- ;; Make the files unique, and determine the name under which they will
- ;; be listed.
- (while (setq file (pop files))
- (if (not (file-name-absolute-p file))
- (setq file (expand-file-name file org-directory)))
- (setq uname (file-truename file))
- (unless (member uname seen)
- (push uname seen)
- (if (string-match orgdir-re uname)
- (setq link-name (substring uname (match-end 0)))
- (setq link-name (file-name-nondirectory uname)))
- (push (cons file link-name) rtn)))
- (nreverse rtn)))
-
-;;;###autoload
-(defun org-mobile-push ()
- "Push the current state of Org affairs to the WebDAV directory.
-This will create the index file, copy all agenda files there, and also
-create all custom agenda views, for upload to the mobile phone."
- (interactive)
- (let ((a-buffer (get-buffer org-agenda-buffer-name)))
- (let ((org-agenda-buffer-name "*SUMO*")
- (org-agenda-filter org-agenda-filter)
- (org-agenda-redo-command org-agenda-redo-command))
- (save-excursion
- (save-window-excursion
- (org-mobile-check-setup)
- (org-mobile-prepare-file-lists)
- (run-hooks 'org-mobile-pre-push-hook)
- (message "Creating agendas...")
- (let ((inhibit-redisplay t)) (org-mobile-create-sumo-agenda))
- (message "Creating agendas...done")
- (org-save-all-org-buffers) ; to save any IDs created by this process
- (message "Copying files...")
- (org-mobile-copy-agenda-files)
- (message "Writing index file...")
- (org-mobile-create-index-file)
- (message "Writing checksums...")
- (org-mobile-write-checksums)
- (run-hooks 'org-mobile-post-push-hook))))
- (redraw-display)
- (when (and a-buffer (buffer-live-p a-buffer))
- (if (not (get-buffer-window a-buffer))
- (kill-buffer a-buffer)
- (let ((cw (selected-window)))
- (select-window (get-buffer-window a-buffer))
- (org-agenda-redo)
- (select-window cw)))))
- (message "Files for mobile viewer staged"))
-
-(defvar org-mobile-before-process-capture-hook nil
- "Hook that is run after content was moved to `org-mobile-inbox-for-pull'.
-The inbox file is visited by the current buffer, and the buffer is
-narrowed to the newly captured data.")
-
-;;;###autoload
-(defun org-mobile-pull ()
- "Pull the contents of `org-mobile-capture-file' and integrate them.
-Apply all flagged actions, flag entries to be flagged and then call an
-agenda view showing the flagged items."
- (interactive)
- (org-mobile-check-setup)
- (run-hooks 'org-mobile-pre-pull-hook)
- (let ((insertion-marker (org-mobile-move-capture)))
- (if (not (markerp insertion-marker))
- (message "No new items")
- (org-with-point-at insertion-marker
- (save-restriction
- (narrow-to-region (point) (point-max))
- (run-hooks 'org-mobile-before-process-capture-hook)))
- (org-with-point-at insertion-marker
- (org-mobile-apply (point) (point-max)))
- (move-marker insertion-marker nil)
- (run-hooks 'org-mobile-post-pull-hook)
- (when org-mobile-last-flagged-files
- ;; Make an agenda view of flagged entries, but only in the files
- ;; where stuff has been added.
- (put 'org-agenda-files 'org-restrict org-mobile-last-flagged-files)
- (let ((org-agenda-keep-restricted-file-list t))
- (org-agenda nil "?"))))))
-
-(defun org-mobile-check-setup ()
- "Check if org-mobile-directory has been set up."
- (org-mobile-cleanup-encryption-tempfile)
- (unless (and org-directory
- (stringp org-directory)
- (string-match "\\S-" org-directory)
- (file-exists-p org-directory)
- (file-directory-p org-directory))
- (error
- "Please set `org-directory' to the directory where your org files live"))
- (unless (and org-mobile-directory
- (stringp org-mobile-directory)
- (string-match "\\S-" org-mobile-directory)
- (file-exists-p org-mobile-directory)
- (file-directory-p org-mobile-directory))
- (error
- "Variable `org-mobile-directory' must point to an existing directory"))
- (unless (and org-mobile-inbox-for-pull
- (stringp org-mobile-inbox-for-pull)
- (string-match "\\S-" org-mobile-inbox-for-pull)
- (file-exists-p
- (file-name-directory org-mobile-inbox-for-pull)))
- (error
- "Variable `org-mobile-inbox-for-pull' must point to a file in an existing directory"))
- (unless (and org-mobile-checksum-binary
- (string-match "\\S-" org-mobile-checksum-binary))
- (error "No executable found to compute checksums"))
- (when org-mobile-use-encryption
- (unless (string-match "\\S-" (org-mobile-encryption-password))
- (error
- "To use encryption, you must set `org-mobile-encryption-password'"))
- (unless (file-writable-p org-mobile-encryption-tempfile)
- (error "Cannot write to encryption tempfile %s"
- org-mobile-encryption-tempfile))
- (unless (executable-find "openssl")
- (error "openssl is needed to encrypt files"))))
-
-(defun org-mobile-create-index-file ()
- "Write the index file in the WebDAV directory."
- (let ((files-alist (sort (copy-sequence org-mobile-files-alist)
- (lambda (a b) (string< (cdr a) (cdr b)))))
- (def-todo (default-value 'org-todo-keywords))
- (def-tags (default-value 'org-tag-alist))
- (target-file (expand-file-name org-mobile-index-file
- org-mobile-directory))
- file link-name todo-kwds done-kwds tags drawers entry kwds dwds twds)
-
- (org-prepare-agenda-buffers (mapcar 'car files-alist))
- (setq done-kwds (org-uniquify org-done-keywords-for-agenda))
- (setq todo-kwds (org-delete-all
- done-kwds
- (org-uniquify org-todo-keywords-for-agenda)))
- (setq drawers (org-uniquify org-drawers-for-agenda))
- (setq tags (org-uniquify
- (delq nil
- (mapcar
- (lambda (e)
- (cond ((stringp e) e)
- ((listp e)
- (if (stringp (car e)) (car e) nil))
- (t nil)))
- org-tag-alist-for-agenda))))
- (with-temp-file
- (if org-mobile-use-encryption
- org-mobile-encryption-tempfile
- target-file)
- (while (setq entry (pop def-todo))
- (insert "#+READONLY\n")
- (setq kwds (mapcar (lambda (x) (if (string-match "(" x)
- (substring x 0 (match-beginning 0))
- x))
- (cdr entry)))
- (insert "#+TODO: " (mapconcat 'identity kwds " ") "\n")
- (setq dwds (member "|" kwds)
- twds (org-delete-all dwds kwds)
- todo-kwds (org-delete-all twds todo-kwds)
- done-kwds (org-delete-all dwds done-kwds)))
- (when (or todo-kwds done-kwds)
- (insert "#+TODO: " (mapconcat 'identity todo-kwds " ") " | "
- (mapconcat 'identity done-kwds " ") "\n"))
- (setq def-tags (mapcar
- (lambda (x)
- (cond ((null x) nil)
- ((stringp x) x)
- ((eq (car x) :startgroup) "{")
- ((eq (car x) :endgroup) "}")
- ((eq (car x) :newline) nil)
- ((listp x) (car x))
- (t nil)))
- def-tags))
- (setq def-tags (delq nil def-tags))
- (setq tags (org-delete-all def-tags tags))
- (setq tags (sort tags (lambda (a b) (string< (downcase a) (downcase b)))))
- (setq tags (append def-tags tags nil))
- (insert "#+TAGS: " (mapconcat 'identity tags " ") "\n")
- (insert "#+DRAWERS: " (mapconcat 'identity drawers " ") "\n")
- (insert "#+ALLPRIORITIES: A B C" "\n")
- (when (file-exists-p (expand-file-name
- org-mobile-directory "agendas.org"))
- (insert "* [[file:agendas.org][Agenda Views]]\n"))
- (while (setq entry (pop files-alist))
- (setq file (car entry)
- link-name (cdr entry))
- (insert (format "* [[file:%s][%s]]\n"
- link-name link-name)))
- (push (cons org-mobile-index-file (md5 (buffer-string)))
- org-mobile-checksum-files))
- (when org-mobile-use-encryption
- (org-mobile-encrypt-and-move org-mobile-encryption-tempfile
- target-file)
- (org-mobile-cleanup-encryption-tempfile))))
-
-(defun org-mobile-copy-agenda-files ()
- "Copy all agenda files to the stage or WebDAV directory."
- (let ((files-alist org-mobile-files-alist)
- file buf entry link-name target-path target-dir check)
- (while (setq entry (pop files-alist))
- (setq file (car entry) link-name (cdr entry))
- (when (file-exists-p file)
- (setq target-path (expand-file-name link-name org-mobile-directory)
- target-dir (file-name-directory target-path))
- (unless (file-directory-p target-dir)
- (make-directory target-dir 'parents))
- (if org-mobile-use-encryption
- (org-mobile-encrypt-and-move file target-path)
- (copy-file file target-path 'ok-if-exists))
- (setq check (shell-command-to-string
- (concat org-mobile-checksum-binary " "
- (shell-quote-argument (expand-file-name file)))))
- (when (string-match "[a-fA-F0-9]\\{30,40\\}" check)
- (push (cons link-name (match-string 0 check))
- org-mobile-checksum-files))))
-
- (setq file (expand-file-name org-mobile-capture-file
- org-mobile-directory))
- (save-excursion
- (setq buf (find-file file))
- (when (and (= (point-min) (point-max)))
- (insert "\n")
- (save-buffer)
- (when org-mobile-use-encryption
- (write-file org-mobile-encryption-tempfile)
- (org-mobile-encrypt-and-move org-mobile-encryption-tempfile file)))
- (push (cons org-mobile-capture-file (md5 (buffer-string)))
- org-mobile-checksum-files))
- (org-mobile-cleanup-encryption-tempfile)
- (kill-buffer buf)))
-
-(defun org-mobile-write-checksums ()
- "Create checksums for all files in `org-mobile-directory'.
-The table of checksums is written to the file mobile-checksums."
- (let ((sumfile (expand-file-name "checksums.dat" org-mobile-directory))
- (files org-mobile-checksum-files)
- entry file sum)
- (with-temp-file sumfile
- (set-buffer-file-coding-system 'undecided-unix nil)
- (while (setq entry (pop files))
- (setq file (car entry) sum (cdr entry))
- (insert (format "%s %s\n" sum file))))))
-
-(defun org-mobile-sumo-agenda-command ()
- "Return an agenda custom command that comprises all custom commands."
- (let ((custom-list
- ;; normalize different versions
- (delq nil
- (mapcar
- (lambda (x)
- (cond ((stringp (cdr x)) nil)
- ((stringp (nth 1 x)) x)
- ((not (nth 1 x)) (cons (car x) (cons "" (cddr x))))
- (t (cons (car x) (cons "" (cdr x))))))
- org-agenda-custom-commands)))
- (default-list '(("a" "Agenda" agenda) ("t" "All TODO" alltodo)))
- thelist new e key desc type match settings cmds gkey gdesc gsettings cnt)
- (cond
- ((eq org-mobile-agendas 'custom)
- (setq thelist custom-list))
- ((eq org-mobile-agendas 'default)
- (setq thelist default-list))
- ((eq org-mobile-agendas 'all)
- (setq thelist custom-list)
- (unless (assoc "t" thelist) (push '("t" "ALL TODO" alltodo) thelist))
- (unless (assoc "a" thelist) (push '("a" "Agenda" agenda) thelist)))
- ((listp org-mobile-agendas)
- (setq thelist (append custom-list default-list))
- (setq thelist (delq nil (mapcar (lambda (k) (assoc k thelist))
- org-mobile-agendas)))))
- (while (setq e (pop thelist))
- (cond
- ((stringp (cdr e))
- ;; this is a description entry - skip it
- )
- ((eq (nth 2 e) 'search)
- ;; Search view is interactive, skip
- )
- ((memq (nth 2 e) '(todo-tree tags-tree occur-tree))
- ;; These are trees, not really agenda commands
- )
- ((and (memq (nth 2 e) '(todo tags tags-todo))
- (or (null (nth 3 e))
- (not (string-match "\\S-" (nth 3 e)))))
- ;; These would be interactive because the match string is empty
- )
- ((memq (nth 2 e) '(agenda alltodo todo tags tags-todo))
- ;; a normal command
- (setq key (car e) desc (nth 1 e) type (nth 2 e) match (nth 3 e)
- settings (nth 4 e))
- (setq settings
- (cons (list 'org-agenda-title-append
- (concat "<after>KEYS=" key " TITLE: "
- (if (and (stringp desc) (> (length desc) 0))
- desc (symbol-name type))
- " " match "</after>"))
- settings))
- (push (list type match settings) new))
- ((symbolp (nth 2 e))
- ;; A user-defined function, not sure how to handle that yet
- )
- (t
- ;; a block agenda
- (setq gkey (car e) gdesc (nth 1 e) gsettings (nth 3 e) cmds (nth 2 e))
- (setq cnt 0)
- (while (setq e (pop cmds))
- (setq type (car e) match (nth 1 e) settings (nth 2 e))
- (setq settings (append gsettings settings))
- (setq settings
- (cons (list 'org-agenda-title-append
- (concat "<after>KEYS=" gkey "#" (number-to-string
- (setq cnt (1+ cnt)))
- " TITLE: " gdesc " " match "</after>"))
- settings))
- (push (list type match settings) new)))))
- (and new (list "X" "SUMO" (reverse new)
- '((org-agenda-compact-blocks nil))))))
-
-(defvar org-mobile-creating-agendas nil)
-(defun org-mobile-write-agenda-for-mobile (file)
- (let ((all (buffer-string)) in-date id pl prefix line app short m sexp)
- (with-temp-file file
- (org-mode)
- (insert "#+READONLY\n")
- (insert all)
- (goto-char (point-min))
- (while (not (eobp))
- (cond
- ((looking-at "[ \t]*$")) ; keep empty lines
- ((looking-at "=+$")
- ;; remove underlining
- (delete-region (point) (point-at-eol)))
- ((get-text-property (point) 'org-agenda-structural-header)
- (setq in-date nil)
- (setq app (get-text-property (point)
- 'org-agenda-title-append))
- (setq short (get-text-property (point)
- 'short-heading))
- (when (and short (looking-at ".+"))
- (replace-match short)
- (beginning-of-line 1))
- (when app
- (end-of-line 1)
- (insert app)
- (beginning-of-line 1))
- (insert "* "))
- ((get-text-property (point) 'org-agenda-date-header)
- (setq in-date t)
- (insert "** "))
- ((setq m (or (get-text-property (point) 'org-hd-marker)
- (get-text-property (point) 'org-marker)))
- (setq sexp (member (get-text-property (point) 'type)
- '("diary" "sexp")))
- (if (setq pl (get-text-property (point) 'prefix-length))
- (progn
- (setq prefix (org-trim (buffer-substring
- (point) (+ (point) pl)))
- line (org-trim (buffer-substring
- (+ (point) pl)
- (point-at-eol))))
- (delete-region (point-at-bol) (point-at-eol))
- (insert line "<before>" prefix "</before>")
- (beginning-of-line 1))
- (and (looking-at "[ \t]+") (replace-match "")))
- (insert (if in-date "*** " "** "))
- (end-of-line 1)
- (insert "\n")
- (unless sexp
- (insert (org-agenda-get-some-entry-text
- m 10 " " 'planning)
- "\n")
- (when (setq id
- (if (org-bound-and-true-p
- org-mobile-force-id-on-agenda-items)
- (org-id-get m 'create)
- (or (org-entry-get m "ID")
- (org-mobile-get-outline-path-link m))))
- (insert " :PROPERTIES:\n :ORIGINAL_ID: " id
- "\n :END:\n")))))
- (beginning-of-line 2))
- (push (cons "agendas.org" (md5 (buffer-string)))
- org-mobile-checksum-files))
- (message "Agenda written to Org file %s" file)))
-
-(defun org-mobile-get-outline-path-link (pom)
- (org-with-point-at pom
- (concat "olp:"
- (org-mobile-escape-olp (file-name-nondirectory buffer-file-name))
- "/"
- (mapconcat 'org-mobile-escape-olp
- (org-get-outline-path)
- "/")
- "/"
- (org-mobile-escape-olp (nth 4 (org-heading-components))))))
-
-(defun org-mobile-escape-olp (s)
- (let ((table '((?: . "%3a") (?\[ . "%5b") (?\] . "%5d") (?/ . "%2f"))))
- (org-link-escape s table)))
-
-;;;###autoload
-(defun org-mobile-create-sumo-agenda ()
- "Create a file that contains all custom agenda views."
- (interactive)
- (let* ((file (expand-file-name "agendas.org"
- org-mobile-directory))
- (file1 (if org-mobile-use-encryption
- org-mobile-encryption-tempfile
- file))
- (sumo (org-mobile-sumo-agenda-command))
- (org-agenda-custom-commands
- (list (append sumo (list (list file1)))))
- (org-mobile-creating-agendas t))
- (unless (file-writable-p file1)
- (error "Cannot write to file %s" file1))
- (when sumo
- (org-store-agenda-views))
- (when org-mobile-use-encryption
- (org-mobile-encrypt-and-move file1 file)
- (delete-file file1)
- (org-mobile-cleanup-encryption-tempfile))))
-
-(defun org-mobile-encrypt-and-move (infile outfile)
- "Encrypt INFILE locally to INFILE_enc, then move it to OUTFILE.
-We do this in two steps so that remote paths will work, even if the
-encryption program does not understand them."
- (let ((encfile (concat infile "_enc")))
- (org-mobile-encrypt-file infile encfile)
- (when outfile
- (copy-file encfile outfile 'ok-if-exists)
- (delete-file encfile))))
-
-(defun org-mobile-encrypt-file (infile outfile)
- "Encrypt INFILE to OUTFILE, using `org-mobile-encryption-password'."
- (shell-command
- (format "openssl enc -aes-256-cbc -salt -pass %s -in %s -out %s"
- (shell-quote-argument (concat "pass:"
- (org-mobile-encryption-password)))
- (shell-quote-argument (expand-file-name infile))
- (shell-quote-argument (expand-file-name outfile)))))
-
-(defun org-mobile-decrypt-file (infile outfile)
- "Decrypt INFILE to OUTFILE, using `org-mobile-encryption-password'."
- (shell-command
- (format "openssl enc -d -aes-256-cbc -salt -pass %s -in %s -out %s"
- (shell-quote-argument (concat "pass:"
- (org-mobile-encryption-password)))
- (shell-quote-argument (expand-file-name infile))
- (shell-quote-argument (expand-file-name outfile)))))
-
-(defun org-mobile-cleanup-encryption-tempfile ()
- "Remove the encryption tempfile if it exists."
- (and (stringp org-mobile-encryption-tempfile)
- (file-exists-p org-mobile-encryption-tempfile)
- (delete-file org-mobile-encryption-tempfile)))
-
-(defun org-mobile-move-capture ()
- "Move the contents of the capture file to the inbox file.
-Return a marker to the location where the new content has been added.
-If nothing new has been added, return nil."
- (interactive)
- (let* ((encfile nil)
- (capture-file (expand-file-name org-mobile-capture-file
- org-mobile-directory))
- (inbox-buffer (find-file-noselect org-mobile-inbox-for-pull))
- (capture-buffer
- (if (not org-mobile-use-encryption)
- (find-file-noselect capture-file)
- (org-mobile-cleanup-encryption-tempfile)
- (setq encfile (concat org-mobile-encryption-tempfile "_enc"))
- (copy-file capture-file encfile)
- (org-mobile-decrypt-file encfile org-mobile-encryption-tempfile)
- (find-file-noselect org-mobile-encryption-tempfile)))
- (insertion-point (make-marker))
- not-empty content)
- (with-current-buffer capture-buffer
- (setq content (buffer-string))
- (setq not-empty (string-match "\\S-" content))
- (when not-empty
- (set-buffer inbox-buffer)
- (widen)
- (goto-char (point-max))
- (or (bolp) (newline))
- (move-marker insertion-point
- (prog1 (point) (insert content)))
- (save-buffer)
- (set-buffer capture-buffer)
- (erase-buffer)
- (save-buffer)
- (org-mobile-update-checksum-for-capture-file (buffer-string))))
- (kill-buffer capture-buffer)
- (when org-mobile-use-encryption
- (org-mobile-encrypt-and-move org-mobile-encryption-tempfile
- capture-file)
- (org-mobile-cleanup-encryption-tempfile))
- (if not-empty insertion-point)))
-
-(defun org-mobile-update-checksum-for-capture-file (buffer-string)
- "Find the checksum line and modify it to match BUFFER-STRING."
- (let* ((file (expand-file-name "checksums.dat" org-mobile-directory))
- (buffer (find-file-noselect file)))
- (when buffer
- (with-current-buffer buffer
- (when (re-search-forward (concat "\\([0-9a-fA-F]\\{30,\\}\\).*?"
- (regexp-quote org-mobile-capture-file)
- "[ \t]*$") nil t)
- (goto-char (match-beginning 1))
- (delete-region (match-beginning 1) (match-end 1))
- (insert (md5 buffer-string))
- (save-buffer)))
- (kill-buffer buffer))))
-
-(defun org-mobile-apply (&optional beg end)
- "Apply all change requests in the current buffer.
-If BEG and END are given, only do this in that region."
- (interactive)
- (require 'org-archive)
- (setq org-mobile-last-flagged-files nil)
- (setq beg (or beg (point-min)) end (or end (point-max)))
-
- ;; Remove all Note IDs
- (goto-char beg)
- (while (re-search-forward "^\\*\\* Note ID: [-0-9A-F]+[ \t]*\n" end t)
- (replace-match ""))
-
- ;; Find all the referenced entries, without making any changes yet
- (let ((marker (make-marker))
- (bos-marker (make-marker))
- (end (move-marker (make-marker) end))
- (cnt-new 0)
- (cnt-edit 0)
- (cnt-flag 0)
- (cnt-error 0)
- buf-list
- id-pos org-mobile-error)
-
- ;; Count the new captures
- (goto-char beg)
- (while (re-search-forward "^\\* \\(.*\\)" end t)
- (and (>= (- (match-end 1) (match-beginning 1)) 2)
- (not (equal (downcase (substring (match-string 1) 0 2)) "f("))
- (incf cnt-new)))
-
- (goto-char beg)
- (while (re-search-forward
- "^\\*+[ \t]+F(\\([^():\n]*\\)\\(:\\([^()\n]*\\)\\)?)[ \t]+\\[\\[\\(\\(id\\|olp\\):\\([^]\n]+\\)\\)" end t)
- (setq id-pos (condition-case msg
- (org-mobile-locate-entry (match-string 4))
- (error (nth 1 msg))))
- (when (and (markerp id-pos)
- (not (member (marker-buffer id-pos) buf-list)))
- (org-mobile-timestamp-buffer (marker-buffer id-pos))
- (push (marker-buffer id-pos) buf-list))
-
- (if (or (not id-pos) (stringp id-pos))
- (progn
- (goto-char (+ 2 (point-at-bol)))
- (insert id-pos " ")
- (incf cnt-error))
- (add-text-properties (point-at-bol) (point-at-eol)
- (list 'org-mobile-marker
- (or id-pos "Linked entry not found")))))
-
- ;; OK, now go back and start applying
- (goto-char beg)
- (while (re-search-forward "^\\*+[ \t]+F(\\([^():\n]*\\)\\(:\\([^()\n]*\\)\\)?)" end t)
- (catch 'next
- (setq id-pos (get-text-property (point-at-bol) 'org-mobile-marker))
- (if (not (markerp id-pos))
- (progn
- (incf cnt-error)
- (insert "UNKNOWN PROBLEM"))
- (let* ((action (match-string 1))
- (data (and (match-end 3) (match-string 3)))
- (bos (point-at-bol))
- (eos (save-excursion (org-end-of-subtree t t)))
- (cmd (if (equal action "")
- '(progn
- (incf cnt-flag)
- (org-toggle-tag "FLAGGED" 'on)
- (and note
- (org-entry-put nil "THEFLAGGINGNOTE" note)))
- (incf cnt-edit)
- (cdr (assoc action org-mobile-action-alist))))
- (note (and (equal action "")
- (buffer-substring (1+ (point-at-eol)) eos)))
- (org-inhibit-logging 'note) ;; Do not take notes interactively
- old new)
- (goto-char bos)
- (move-marker bos-marker (point))
- (if (re-search-forward "^** Old value[ \t]*$" eos t)
- (setq old (buffer-substring
- (1+ (match-end 0))
- (progn (outline-next-heading) (point)))))
- (if (re-search-forward "^** New value[ \t]*$" eos t)
- (setq new (buffer-substring
- (1+ (match-end 0))
- (progn (outline-next-heading)
- (if (eobp) (org-back-over-empty-lines))
- (point)))))
- (setq old (and old (if (string-match "\\S-" old) old nil)))
- (setq new (and new (if (string-match "\\S-" new) new nil)))
- (if (and note (> (length note) 0))
- ;; Make Note into a single line, to fit into a property
- (setq note (mapconcat 'identity
- (org-split-string (org-trim note) "\n")
- "\\n")))
- (unless (equal data "body")
- (setq new (and new (org-trim new))
- old (and old (org-trim old))))
- (goto-char (+ 2 bos-marker))
- (unless (markerp id-pos)
- (insert "BAD REFERENCE ")
- (incf cnt-error)
- (throw 'next t))
- (unless cmd
- (insert "BAD FLAG ")
- (incf cnt-error)
- (throw 'next t))
- ;; Remember this place so that we can return
- (move-marker marker (point))
- (setq org-mobile-error nil)
- (save-excursion
- (condition-case msg
- (org-with-point-at id-pos
- (progn
- (eval cmd)
- (if (member "FLAGGED" (org-get-tags))
- (add-to-list 'org-mobile-last-flagged-files
- (buffer-file-name (current-buffer))))))
- (error (setq org-mobile-error msg))))
- (when org-mobile-error
- (switch-to-buffer (marker-buffer marker))
- (goto-char marker)
- (incf cnt-error)
- (insert (if (stringp (nth 1 org-mobile-error))
- (nth 1 org-mobile-error)
- "EXECUTION FAILED")
- " ")
- (throw 'next t))
- ;; If we get here, the action has been applied successfully
- ;; So remove the entry
- (goto-char bos-marker)
- (delete-region (point) (org-end-of-subtree t t))))))
- (save-buffer)
- (move-marker marker nil)
- (move-marker end nil)
- (message "%d new, %d edits, %d flags, %d errors" cnt-new
- cnt-edit cnt-flag cnt-error)
- (sit-for 1)))
-
-(defun org-mobile-timestamp-buffer (buf)
- "Time stamp buffer BUF, just to make sure its checksum will change."
- (with-current-buffer buf
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (if (re-search-forward
- "^\\([ \t]*\\)#\\+LAST_MOBILE_CHANGE:.*\n?" nil t)
- (progn
- (goto-char (match-end 1))
- (delete-region (point) (match-end 0)))
- (if (looking-at ".*?-\\*-.*-\\*-")
- (forward-line 1)))
- (insert "#+LAST_MOBILE_CHANGE: "
- (format-time-string "%Y-%m-%d %T") "\n")))))
-
-(defun org-mobile-smart-read ()
- "Parse the entry at point for shortcuts and expand them.
-These shortcuts are meant for fast and easy typing on the limited
-keyboards of a mobile device. Below we show a list of the shortcuts
-currently implemented.
-
-The entry is expected to contain an inactive time stamp indicating when
-the entry was created. When setting dates and
-times (for example for deadlines), the time strings are interpreted
-relative to that creation date.
-Abbreviations are expected to take up entire lines, just because it is so
-easy to type RET on a mobile device. Abbreviations start with one or two
-letters, followed immediately by a dot and then additional information.
-Generally the entire shortcut line is removed after action have been taken.
-Time stamps will be constructed using `org-read-date'. So for example a
-line \"dd. 2tue\" will set a deadline on the second Tuesday after the
-creation date.
-
-Here are the shortcuts currently implemented:
-
-dd. string set deadline
-ss. string set scheduling
-tt. string set time tamp, here.
-ti. string set inactive time
-
-tg. tag1 tag2 tag3 set all these tags, change case where necessary
-td. kwd set this todo keyword, change case where necessary
-
-FIXME: Hmmm, not sure if we can make his work against the
-auto-correction feature. Needs a bit more thinking. So this function
-is currently a noop.")
-
-(defun org-mobile-locate-entry (link)
- (if (string-match "\\`id:\\(.*\\)$" link)
- (org-id-find (match-string 1 link) 'marker)
- (if (not (string-match "\\`olp:\\(.*?\\):\\(.*\\)$" link))
- nil
- (let ((file (match-string 1 link))
- (path (match-string 2 link))
- (table '((?: . "%3a") (?\[ . "%5b") (?\] . "%5d") (?/ . "%2f"))))
- (setq file (org-link-unescape file table))
- (setq file (expand-file-name file org-directory))
- (setq path (mapcar (lambda (x) (org-link-unescape x table))
- (org-split-string path "/")))
- (org-find-olp (cons file path))))))
-
-(defun org-mobile-edit (what old new)
- "Edit item WHAT in the current entry by replacing OLD with NEW.
-WHAT can be \"heading\", \"todo\", \"tags\", \"priority\", or \"body\".
-The edit only takes place if the current value is equal (except for
-white space) the OLD. If this is so, OLD will be replace by NEW
-and the command will return t. If something goes wrong, a string will
-be returned that indicates what went wrong."
- (let (current old1 new1)
- (if (stringp what) (setq what (intern what)))
-
- (cond
-
- ((memq what '(todo todostate))
- (setq current (org-get-todo-state))
- (cond
- ((equal new "DONEARCHIVE")
- (org-todo 'done)
- (org-archive-subtree-default))
- ((equal new current) t) ; nothing needs to be done
- ((or (equal current old)
- (eq org-mobile-force-mobile-change t)
- (memq 'todo org-mobile-force-mobile-change))
- (org-todo (or new 'none)) t)
- (t (error "State before change was expected as \"%s\", but is \"%s\""
- old current))))
-
- ((eq what 'tags)
- (setq current (org-get-tags)
- new1 (and new (org-split-string new ":+"))
- old1 (and old (org-split-string old ":+")))
- (cond
- ((org-mobile-tags-same-p current new1) t) ; no change needed
- ((or (org-mobile-tags-same-p current old1)
- (eq org-mobile-force-mobile-change t)
- (memq 'tags org-mobile-force-mobile-change))
- (org-set-tags-to new1) t)
- (t (error "Tags before change were expected as \"%s\", but are \"%s\""
- (or old "") (or current "")))))
-
- ((eq what 'priority)
- (when (looking-at org-complex-heading-regexp)
- (setq current (and (match-end 3) (substring (match-string 3) 2 3)))
- (cond
- ((equal current new) t) ; no action required
- ((or (equal current old)
- (eq org-mobile-force-mobile-change t)
- (memq 'tags org-mobile-force-mobile-change))
- (org-priority (and new (string-to-char new))))
- (t (error "Priority was expected to be %s, but is %s"
- old current)))))
-
- ((eq what 'heading)
- (when (looking-at org-complex-heading-regexp)
- (setq current (match-string 4))
- (cond
- ((equal current new) t) ; no action required
- ((or (equal current old)
- (eq org-mobile-force-mobile-change t)
- (memq 'heading org-mobile-force-mobile-change))
- (goto-char (match-beginning 4))
- (insert new)
- (delete-region (point) (+ (point) (length current)))
- (org-set-tags nil 'align))
- (t (error "Heading changed in MobileOrg and on the computer")))))
-
- ((eq what 'body)
- (setq current (buffer-substring (min (1+ (point-at-eol)) (point-max))
- (save-excursion (outline-next-heading)
- (point))))
- (if (not (string-match "\\S-" current)) (setq current nil))
- (cond
- ((org-mobile-bodies-same-p current new) t) ; no action necessary
- ((or (org-mobile-bodies-same-p current old)
- (eq org-mobile-force-mobile-change t)
- (memq 'body org-mobile-force-mobile-change))
- (save-excursion
- (end-of-line 1)
- (insert "\n" new)
- (or (bolp) (insert "\n"))
- (delete-region (point) (progn (org-back-to-heading t)
- (outline-next-heading)
- (point))))
- t)
- (t (error "Body was changed in MobileOrg and on the computer")))))))
-
-(defun org-mobile-tags-same-p (list1 list2)
- "Are the two tag lists the same?"
- (not (or (org-delete-all list1 list2)
- (org-delete-all list2 list1))))
-
-(defun org-mobile-bodies-same-p (a b)
- "Compare if A and B are visually equal strings.
-We first remove leading and trailing white space from the entire strings.
-Then we split the strings into lines and remove leading/trailing whitespace
-from each line. Then we compare.
-A and B must be strings or nil."
- (cond
- ((and (not a) (not b)) t)
- ((or (not a) (not b)) nil)
- (t (setq a (org-trim a) b (org-trim b))
- (setq a (mapconcat 'identity (org-split-string a "[ \t]*\n[ \t]*") "\n"))
- (setq b (mapconcat 'identity (org-split-string b "[ \t]*\n[ \t]*") "\n"))
- (equal a b))))
-
-(provide 'org-mobile)
-
-;; arch-tag: ace0e26c-58f2-4309-8a61-05ec1535f658
-
-;;; org-mobile.el ends here
-
diff --git a/.emacs.d/org-7.4/lisp/org-mobile.elc b/.emacs.d/org-7.4/lisp/org-mobile.elc
deleted file mode 100644
index 7ea62fc..0000000
--- a/.emacs.d/org-7.4/lisp/org-mobile.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-mouse.el b/.emacs.d/org-7.4/lisp/org-mouse.el
deleted file mode 100644
index d1540c3..0000000
--- a/.emacs.d/org-7.4/lisp/org-mouse.el
+++ /dev/null
@@ -1,1148 +0,0 @@
-;;; org-mouse.el --- Better mouse support for org-mode
-
-;; Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation
-;;
-;; Author: Piotr Zielinski <piotr dot zielinski at gmail dot com>
-;; Maintainer: Carsten Dominik <carsten at orgmode dot org>
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-;;
-;; Org-mouse provides mouse support for org-mode.
-;;
-;; http://orgmode.org
-;;
-;; Org-mouse implements the following features:
-;; * following links with the left mouse button (in Emacs 22)
-;; * subtree expansion/collapse (org-cycle) with the left mouse button
-;; * several context menus on the right mouse button:
-;; + general text
-;; + headlines
-;; + timestamps
-;; + priorities
-;; + links
-;; + tags
-;; * promoting/demoting/moving subtrees with mouse-3
-;; + if the drag starts and ends in the same line then promote/demote
-;; + otherwise move the subtree
-;;
-;; Use
-;; ---
-;;
-;; To use this package, put the following line in your .emacs:
-;;
-;; (require 'org-mouse)
-;;
-
-;; FIXME:
-;; + deal with folding / unfolding issues
-
-;; TODO (This list is only theoretical, if you'd like to have some
-;; feature implemented or a bug fix please send me an email, even if
-;; something similar appears in the list below. This will help me get
-;; the priorities right.):
-;;
-;; + org-store-link, insert link
-;; + org tables
-;; + occur with the current word/tag (same menu item)
-;; + ctrl-c ctrl-c, for example, renumber the current list
-;; + internal links
-
-;; Please email the maintainer with new feature suggestions / bugs
-
-;; History:
-;;
-;; Since version 5.10: Changes are listed in the general org-mode docs.
-;;
-;; Version 5.09
-;; + Version number synchronization with Org-mode.
-;;
-;; Version 0.25
-;; + made compatible with org-mode 4.70 (thanks to Carsten for the patch)
-;;
-;; Version 0.24
-;; + minor changes to the table menu
-;;
-;; Version 0.23
-;; + preliminary support for tables and calculation marks
-;; + context menu support for org-agenda-undo & org-sort-entries
-;;
-;; Version 0.22
-;; + handles undo support for the agenda buffer (requires org-mode >=4.58)
-;;
-;; Version 0.21
-;; + selected text activates its context menu
-;; + shift-middleclick or right-drag inserts the text from the clipboard in the form of a link
-;;
-;; Version 0.20
-;; + the new "TODO Status" submenu replaces the "Cycle TODO" menu item
-;; + the TODO menu can now list occurrences of a specific TODO keyword
-;; + #+STARTUP line is now recognized
-;;
-;; Version 0.19
-;; + added support for dragging URLs to the org-buffer
-;;
-;; Version 0.18
-;; + added support for agenda blocks
-;;
-;; Version 0.17
-;; + toggle checkboxes with a single click
-;;
-;; Version 0.16
-;; + added support for checkboxes
-;;
-;; Version 0.15
-;; + org-mode now works with the Agenda buffer as well
-;;
-;; Version 0.14
-;; + added a menu option that converts plain list items to outline items
-;;
-;; Version 0.13
-;; + "Insert Heading" now inserts a sibling heading if the point is
-;; on "***" and a child heading otherwise
-;;
-;; Version 0.12
-;; + compatible with Emacs 21
-;; + custom agenda commands added to the main menu
-;; + moving trees should now work between windows in the same frame
-;;
-;; Version 0.11
-;; + fixed org-mouse-at-link (thanks to Carsten)
-;; + removed [follow-link] bindings
-;;
-;; Version 0.10
-;; + added a menu option to remove highlights
-;; + compatible with org-mode 4.21 now
-;;
-;; Version 0.08:
-;; + trees can be moved/promoted/demoted by dragging with the right
-;; mouse button (mouse-3)
-;; + small changes in the above function
-;;
-;; Versions 0.01 -- 0.07: (I don't remember)
-
-;;; Code:
-
-(eval-when-compile (require 'cl))
-(require 'org)
-
-(defvar org-agenda-allow-remote-undo)
-(defvar org-agenda-undo-list)
-(defvar org-agenda-custom-commands)
-(declare-function org-agenda-change-all-lines "org-agenda"
- (newhead hdmarker &optional fixface just-this))
-(declare-function org-verify-change-for-undo "org-agenda" (l1 l2))
-(declare-function org-apply-on-list "org-list" (function init-value &rest args))
-
-(defvar org-mouse-plain-list-regexp "\\([ \t]*\\)\\([-+*]\\|[0-9]+[.)]\\) "
- "Regular expression that matches a plain list.")
-(defvar org-mouse-direct t
- "Internal variable indicating whether the current action is direct.
-
-If t, then the current action has been invoked directly through the buffer
-it is intended to operate on. If nil, then the action has been invoked
-indirectly, for example, through the agenda buffer.")
-
-(defgroup org-mouse nil
- "Mouse support for org-mode."
- :tag "Org Mouse"
- :group 'org)
-
-(defcustom org-mouse-punctuation ":"
- "Punctuation used when inserting text by drag and drop."
- :group 'org-mouse
- :type 'string)
-
-(defcustom org-mouse-features
- '(context-menu yank-link activate-stars activate-bullets activate-checkboxes)
- "The features of org-mouse that should be activated.
-Changing this variable requires a restart of Emacs to get activated."
- :group 'org-mouse
- :type '(set :greedy t
- (const :tag "Mouse-3 shows context menu" context-menu)
- (const :tag "C-mouse-1 and mouse-3 move trees" move-tree)
- (const :tag "S-mouse-2 and drag-mouse-3 yank link" yank-link)
- (const :tag "Activate headline stars" activate-stars)
- (const :tag "Activate item bullets" activate-bullets)
- (const :tag "Activate checkboxes" activate-checkboxes)))
-
-(defun org-mouse-re-search-line (regexp)
- "Search the current line for a given regular expression."
- (beginning-of-line)
- (re-search-forward regexp (point-at-eol) t))
-
-(defun org-mouse-end-headline ()
- "Go to the end of current headline (ignoring tags)."
- (interactive)
- (end-of-line)
- (skip-chars-backward "\t ")
- (when (org-looking-back ":[A-Za-z]+:")
- (skip-chars-backward ":A-Za-z")
- (skip-chars-backward "\t ")))
-
-(defvar org-mouse-context-menu-function nil
- "Function to create the context menu.
-The value of this variable is the function invoked by
-`org-mouse-context-menu' as the context menu.")
-(make-variable-buffer-local 'org-mouse-context-menu-function)
-
-(defun org-mouse-show-context-menu (event prefix)
- "Invoke the context menu.
-
-If the value of `org-mouse-context-menu-function' is a function, then
-this function is called. Otherwise, the current major mode menu is used."
- (interactive "@e \nP")
- (if (and (= (event-click-count event) 1)
- (or (not mark-active)
- (sit-for (/ double-click-time 1000.0))))
- (progn
- (select-window (posn-window (event-start event)))
- (when (not (org-mouse-mark-active))
- (goto-char (posn-point (event-start event)))
- (when (not (eolp)) (save-excursion (run-hooks 'post-command-hook)))
- (let ((redisplay-dont-pause t))
- (sit-for 0)))
- (if (functionp org-mouse-context-menu-function)
- (funcall org-mouse-context-menu-function event)
- (if (fboundp 'mouse-menu-major-mode-map)
- (popup-menu (mouse-menu-major-mode-map) event prefix)
- (org-no-warnings ; don't warn about fallback, obsolete since 23.1
- (mouse-major-mode-menu event prefix)))))
- (setq this-command 'mouse-save-then-kill)
- (mouse-save-then-kill event)))
-
-(defun org-mouse-line-position ()
- "Return `:beginning' or `:middle' or `:end', depending on the point position.
-
-If the point is at the end of the line, return `:end'.
-If the point is separated from the beginning of the line only by white
-space and *'s (`org-mouse-bolp'), return `:beginning'. Otherwise,
-return `:middle'."
- (cond
- ((eolp) :end)
- ((org-mouse-bolp) :beginning)
- (t :middle)))
-
-(defun org-mouse-empty-line ()
- "Return non-nil iff the line contains only white space."
- (save-excursion (beginning-of-line) (looking-at "[ \t]*$")))
-
-(defun org-mouse-next-heading ()
- "Go to the next heading.
-If there is none, ensure that the point is at the beginning of an empty line."
- (unless (outline-next-heading)
- (beginning-of-line)
- (unless (org-mouse-empty-line)
- (end-of-line)
- (newline))))
-
-(defun org-mouse-insert-heading ()
- "Insert a new heading, as `org-insert-heading'.
-
-If the point is at the :beginning (`org-mouse-line-position') of the line,
-insert the new heading before the current line. Otherwise, insert it
-after the current heading."
- (interactive)
- (case (org-mouse-line-position)
- (:beginning (beginning-of-line)
- (org-insert-heading))
- (t (org-mouse-next-heading)
- (org-insert-heading))))
-
-(defun org-mouse-timestamp-today (&optional shift units)
- "Change the timestamp into SHIFT UNITS in the future.
-
-For the acceptable UNITS, see `org-timestamp-change'."
- (interactive)
- (flet ((org-read-date (&rest rest) (current-time)))
- (org-time-stamp nil))
- (when shift
- (org-timestamp-change shift units)))
-
-(defun org-mouse-keyword-menu (keywords function &optional selected itemformat)
- "A helper function.
-
-Returns a menu fragment consisting of KEYWORDS. When a keyword
-is selected by the user, FUNCTION is called with the selected
-keyword as the only argument.
-
-If SELECTED is nil, then all items are normal menu items. If
-SELECTED is a function, then each item is a checkbox, which is
-enabled for a given keyword iff (funcall SELECTED keyword) return
-non-nil. If SELECTED is neither nil nor a function, then the
-items are radio buttons. A radio button is enabled for the
-keyword `equal' to SELECTED.
-
-ITEMFORMAT governs formatting of the elements of KEYWORDS. If it
-is a function, it is invoked with the keyword as the only
-argument. If it is a string, it is interpreted as the format
-string to (format ITEMFORMAT keyword). If it is neither a string
-nor a function, elements of KEYWORDS are used directly."
- (mapcar
- `(lambda (keyword)
- (vector (cond
- ((functionp ,itemformat) (funcall ,itemformat keyword))
- ((stringp ,itemformat) (format ,itemformat keyword))
- (t keyword))
- (list 'funcall ,function keyword)
- :style (cond
- ((null ,selected) t)
- ((functionp ,selected) 'toggle)
- (t 'radio))
- :selected (if (functionp ,selected)
- (and (funcall ,selected keyword) t)
- (equal ,selected keyword))))
- keywords))
-
-(defun org-mouse-remove-match-and-spaces ()
- "Remove the match, make just one space around the point."
- (interactive)
- (replace-match "")
- (just-one-space))
-
-(defvar rest)
-(defun org-mouse-replace-match-and-surround (newtext &optional fixedcase
- literal string subexp)
- "The same as `replace-match', but surrounds the replacement with spaces."
- (apply 'replace-match rest)
- (save-excursion
- (goto-char (match-beginning (or subexp 0)))
- (just-one-space)
- (goto-char (match-end (or subexp 0)))
- (just-one-space)))
-
-
-(defun org-mouse-keyword-replace-menu (keywords &optional group itemformat
- nosurround)
- "A helper function.
-
-Returns a menu fragment consisting of KEYWORDS. When a keyword
-is selected, group GROUP of the current match is replaced by the
-keyword. The method ensures that both ends of the replacement
-are separated from the rest of the text in the buffer by
-individual spaces (unless NOSURROUND is non-nil).
-
-The final entry of the menu is always \"None\", which removes the
-match.
-
-ITEMFORMAT governs formatting of the elements of KEYWORDS. If it
-is a function, it is invoked with the keyword as the only
-argument. If it is a string, it is interpreted as the format
-string to (format ITEMFORMAT keyword). If it is neither a string
-nor a function, elements of KEYWORDS are used directly."
- (setq group (or group 0))
- (let ((replace (org-mouse-match-closure
- (if nosurround 'replace-match
- 'org-mouse-replace-match-and-surround))))
- (append
- (org-mouse-keyword-menu
- keywords
- `(lambda (keyword) (funcall ,replace keyword t t nil ,group))
- (match-string group)
- itemformat)
- `(["None" org-mouse-remove-match-and-spaces
- :style radio
- :selected ,(not (member (match-string group) keywords))]))))
-
-(defun org-mouse-show-headlines ()
- "Change the visibility of the current org buffer to only show headlines."
- (interactive)
- (let ((this-command 'org-cycle)
- (last-command 'org-cycle)
- (org-cycle-global-status nil))
- (org-cycle '(4))
- (org-cycle '(4))))
-
-(defun org-mouse-show-overview ()
- "Change visibility of current org buffer to first-level headlines only."
- (interactive)
- (let ((org-cycle-global-status nil))
- (org-cycle '(4))))
-
-(defun org-mouse-set-priority (priority)
- "Set the priority of the current headline to PRIORITY."
- (flet ((read-char-exclusive () priority))
- (org-priority)))
-
-(defvar org-mouse-priority-regexp "\\[#\\([A-Z]\\)\\]"
- "Regular expression matching the priority indicator.
-Differs from `org-priority-regexp' in that it doesn't contain the
-leading '.*?'.")
-
-(defun org-mouse-get-priority (&optional default)
- "Return the priority of the current headline.
-DEFAULT is returned if no priority is given in the headline."
- (save-excursion
- (if (org-mouse-re-search-line org-mouse-priority-regexp)
- (match-string 1)
- (when default (char-to-string org-default-priority)))))
-
-;; (defun org-mouse-at-link ()
-;; (and (eq (get-text-property (point) 'face) 'org-link)
-;; (save-excursion
-;; (goto-char (previous-single-property-change (point) 'face))
-;; (or (looking-at org-bracket-link-regexp)
-;; (looking-at org-angle-link-re)
-;; (looking-at org-plain-link-re)))))
-
-
-(defun org-mouse-delete-timestamp ()
- "Deletes the current timestamp as well as the preceding keyword.
-SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
- (when (or (org-at-date-range-p) (org-at-timestamp-p))
- (replace-match "") ; delete the timestamp
- (skip-chars-backward " :A-Z")
- (when (looking-at " *[A-Z][A-Z]+:")
- (replace-match ""))))
-
-(defun org-mouse-looking-at (regexp skipchars &optional movechars)
- (save-excursion
- (let ((point (point)))
- (if (looking-at regexp) t
- (skip-chars-backward skipchars)
- (forward-char (or movechars 0))
- (when (looking-at regexp)
- (> (match-end 0) point))))))
-
-(defun org-mouse-priority-list ()
- (loop for priority from ?A to org-lowest-priority
- collect (char-to-string priority)))
-
-(defun org-mouse-todo-menu (state)
- "Create the menu with TODO keywords."
- (append
- (let ((kwds org-todo-keywords-1))
- (org-mouse-keyword-menu
- kwds
- `(lambda (kwd) (org-todo kwd))
- (lambda (kwd) (equal state kwd))))))
-
-(defun org-mouse-tag-menu () ;todo
- "Create the tags menu."
- (append
- (let ((tags (org-get-tags)))
- (org-mouse-keyword-menu
- (sort (mapcar 'car (org-get-buffer-tags)) 'string-lessp)
- `(lambda (tag)
- (org-mouse-set-tags
- (sort (if (member tag (quote ,tags))
- (delete tag (quote ,tags))
- (cons tag (quote ,tags)))
- 'string-lessp)))
- `(lambda (tag) (member tag (quote ,tags)))
- ))
- '("--"
- ["Align Tags Here" (org-set-tags nil t) t]
- ["Align Tags in Buffer" (org-set-tags t t) t]
- ["Set Tags ..." (org-set-tags) t])))
-
-
-(defun org-mouse-set-tags (tags)
- (save-excursion
- ;; remove existing tags first
- (beginning-of-line)
- (when (org-mouse-re-search-line ":\\(\\([A-Za-z_]+:\\)+\\)")
- (replace-match ""))
-
- ;; set new tags if any
- (when tags
- (end-of-line)
- (insert " :" (mapconcat 'identity tags ":") ":")
- (org-set-tags nil t))))
-
-(defun org-mouse-insert-checkbox ()
- (interactive)
- (and (org-at-item-p)
- (goto-char (match-end 0))
- (unless (org-at-item-checkbox-p)
- (delete-horizontal-space)
- (insert " [ ] "))))
-
-(defun org-mouse-agenda-type (type)
- (case type
- ('tags "Tags: ")
- ('todo "TODO: ")
- ('tags-tree "Tags tree: ")
- ('todo-tree "TODO tree: ")
- ('occur-tree "Occur tree: ")
- (t "Agenda command ???")))
-
-
-(defun org-mouse-list-options-menu (alloptions &optional function)
- (let ((options (save-match-data
- (split-string (match-string-no-properties 1)))))
- (print options)
- (loop for name in alloptions
- collect
- (vector name
- `(progn
- (replace-match
- (mapconcat 'identity
- (sort (if (member ',name ',options)
- (delete ',name ',options)
- (cons ',name ',options))
- 'string-lessp)
- " ")
- nil nil nil 1)
- (when (functionp ',function) (funcall ',function)))
- :style 'toggle
- :selected (and (member name options) t)))))
-
-(defun org-mouse-clip-text (text maxlength)
- (if (> (length text) maxlength)
- (concat (substring text 0 (- maxlength 3)) "...")
- text))
-
-(defun org-mouse-popup-global-menu ()
- (popup-menu
- `("Main Menu"
- ["Show Overview" org-mouse-show-overview t]
- ["Show Headlines" org-mouse-show-headlines t]
- ["Show All" show-all t]
- ["Remove Highlights" org-remove-occur-highlights
- :visible org-occur-highlights]
- "--"
- ["Check Deadlines"
- (if (functionp 'org-check-deadlines-and-todos)
- (org-check-deadlines-and-todos org-deadline-warning-days)
- (org-check-deadlines org-deadline-warning-days)) t]
- ["Check TODOs" org-show-todo-tree t]
- ("Check Tags"
- ,@(org-mouse-keyword-menu
- (sort (mapcar 'car (org-get-buffer-tags)) 'string-lessp)
- '(lambda (tag) (org-tags-sparse-tree nil tag)))
- "--"
- ["Custom Tag ..." org-tags-sparse-tree t])
- ["Check Phrase ..." org-occur]
- "--"
- ["Display Agenda" org-agenda-list t]
- ["Display Timeline" org-timeline t]
- ["Display TODO List" org-todo-list t]
- ("Display Tags"
- ,@(org-mouse-keyword-menu
- (sort (mapcar 'car (org-get-buffer-tags)) 'string-lessp)
- '(lambda (tag) (org-tags-view nil tag)))
- "--"
- ["Custom Tag ..." org-tags-view t])
- ["Display Calendar" org-goto-calendar t]
- "--"
- ,@(org-mouse-keyword-menu
- (mapcar 'car org-agenda-custom-commands)
- '(lambda (key)
- (eval `(flet ((read-char-exclusive () (string-to-char ,key)))
- (org-agenda nil))))
- nil
- '(lambda (key)
- (let ((entry (assoc key org-agenda-custom-commands)))
- (org-mouse-clip-text
- (cond
- ((stringp (nth 1 entry)) (nth 1 entry))
- ((stringp (nth 2 entry))
- (concat (org-mouse-agenda-type (nth 1 entry))
- (nth 2 entry)))
- (t "Agenda Command '%s'"))
- 30))))
- "--"
- ["Delete Blank Lines" delete-blank-lines
- :visible (org-mouse-empty-line)]
- ["Insert Checkbox" org-mouse-insert-checkbox
- :visible (and (org-at-item-p) (not (org-at-item-checkbox-p)))]
- ["Insert Checkboxes"
- (org-mouse-for-each-item 'org-mouse-insert-checkbox)
- :visible (and (org-at-item-p) (not (org-at-item-checkbox-p)))]
- ["Plain List to Outline" org-mouse-transform-to-outline
- :visible (org-at-item-p)])))
-
-
-(defun org-mouse-get-context (contextlist context)
- (let ((contextdata (assq context contextlist)))
- (when contextdata
- (save-excursion
- (goto-char (second contextdata))
- (re-search-forward ".*" (third contextdata))))))
-
-(defun org-mouse-for-each-item (funct)
- ;; Functions called by `org-apply-on-list' need an argument
- (let ((wrap-fun (lambda (c) (funcall funct))))
- (when (org-in-item-p)
- (org-apply-on-list wrap-fun nil))))
-
-(defun org-mouse-bolp ()
- "Return true if there only spaces, tabs, and '*' before point.
-This means, between the beginning of line and the point."
- (save-excursion
- (skip-chars-backward " \t*") (bolp)))
-
-(defun org-mouse-insert-item (text)
- (case (org-mouse-line-position)
- (:beginning ; insert before
- (beginning-of-line)
- (looking-at "[ \t]*")
- (open-line 1)
- (org-indent-to-column (- (match-end 0) (match-beginning 0)))
- (insert "+ "))
-
- (:middle ; insert after
- (end-of-line)
- (newline t)
- (indent-relative)
- (insert "+ "))
-
- (:end ; insert text here
- (skip-chars-backward " \t")
- (kill-region (point) (point-at-eol))
- (unless (org-looking-back org-mouse-punctuation)
- (insert (concat org-mouse-punctuation " ")))))
-
- (insert text)
- (beginning-of-line))
-
-(defadvice dnd-insert-text (around org-mouse-dnd-insert-text activate)
- (if (eq major-mode 'org-mode)
- (org-mouse-insert-item text)
- ad-do-it))
-
-(defadvice dnd-open-file (around org-mouse-dnd-open-file activate)
- (if (eq major-mode 'org-mode)
- (org-mouse-insert-item uri)
- ad-do-it))
-
-(defun org-mouse-match-closure (function)
- (let ((match (match-data t)))
- `(lambda (&rest rest)
- (save-match-data
- (set-match-data ',match)
- (apply ',function rest)))))
-
-(defun org-mouse-match-todo-keyword ()
- (save-excursion
- (org-back-to-heading)
- (if (looking-at outline-regexp) (goto-char (match-end 0)))
- (or (looking-at (concat " +" org-todo-regexp " *"))
- (looking-at " \\( *\\)"))))
-
-(defun org-mouse-yank-link (click)
- (interactive "e")
- ;; Give temporary modes such as isearch a chance to turn off.
- (run-hooks 'mouse-leave-buffer-hook)
- (mouse-set-point click)
- (setq mouse-selection-click-count 0)
- (delete-horizontal-space)
- (insert-for-yank (concat " [[" (current-kill 0) "]] ")))
-
-(defun org-mouse-context-menu (&optional event)
- (let ((stamp-prefixes (list org-deadline-string org-scheduled-string))
- (contextlist (org-context)))
- (flet ((get-context (context) (org-mouse-get-context contextlist context)))
- (cond
- ((org-mouse-mark-active)
- (let ((region-string (buffer-substring (region-beginning) (region-end))))
- (popup-menu
- `(nil
- ["Sparse Tree" (org-occur ',region-string)]
- ["Find in Buffer" (occur ',region-string)]
- ["Grep in Current Dir"
- (grep (format "grep -rnH -e '%s' *" ',region-string))]
- ["Grep in Parent Dir"
- (grep (format "grep -rnH -e '%s' ../*" ',region-string))]
- "--"
- ["Convert to Link"
- (progn (save-excursion (goto-char (region-beginning)) (insert "[["))
- (save-excursion (goto-char (region-end)) (insert "]]")))]
- ["Insert Link Here" (org-mouse-yank-link ',event)]))))
-
- ((save-excursion (beginning-of-line) (looking-at "#\\+STARTUP: \\(.*\\)"))
- (popup-menu
- `(nil
- ,@(org-mouse-list-options-menu (mapcar 'car org-startup-options)
- 'org-mode-restart))))
- ((or (eolp)
- (and (looking-at "\\( \\|\t\\)\\(+:[0-9a-zA-Z_:]+\\)?\\( \\|\t\\)+$")
- (org-looking-back " \\|\t")))
- (org-mouse-popup-global-menu))
- ((get-context :checkbox)
- (popup-menu
- '(nil
- ["Toggle" org-toggle-checkbox t]
- ["Remove" org-mouse-remove-match-and-spaces t]
- ""
- ["All Clear" (org-mouse-for-each-item
- (lambda ()
- (when (save-excursion (org-at-item-checkbox-p))
- (replace-match "[ ]"))))]
- ["All Set" (org-mouse-for-each-item
- (lambda ()
- (when (save-excursion (org-at-item-checkbox-p))
- (replace-match "[X]"))))]
- ["All Toggle" (org-mouse-for-each-item 'org-toggle-checkbox) t]
- ["All Remove" (org-mouse-for-each-item
- (lambda ()
- (when (save-excursion (org-at-item-checkbox-p))
- (org-mouse-remove-match-and-spaces))))]
- )))
- ((and (org-mouse-looking-at "\\b\\w+" "a-zA-Z0-9_")
- (member (match-string 0) org-todo-keywords-1))
- (popup-menu
- `(nil
- ,@(org-mouse-todo-menu (match-string 0))
- "--"
- ["Check TODOs" org-show-todo-tree t]
- ["List all TODO keywords" org-todo-list t]
- [,(format "List only %s" (match-string 0))
- (org-todo-list (match-string 0)) t]
- )))
- ((and (org-mouse-looking-at "\\b[A-Z]+:" "A-Z")
- (member (match-string 0) stamp-prefixes))
- (popup-menu
- `(nil
- ,@(org-mouse-keyword-replace-menu stamp-prefixes)
- "--"
- ["Check Deadlines" org-check-deadlines t]
- )))
- ((org-mouse-looking-at org-mouse-priority-regexp "[]A-Z#") ; priority
- (popup-menu `(nil ,@(org-mouse-keyword-replace-menu
- (org-mouse-priority-list) 1 "Priority %s" t))))
- ((get-context :link)
- (popup-menu
- '(nil
- ["Open" org-open-at-point t]
- ["Open in Emacs" (org-open-at-point t) t]
- "--"
- ["Copy link" (org-kill-new (match-string 0))]
- ["Cut link"
- (progn
- (kill-region (match-beginning 0) (match-end 0))
- (just-one-space))]
- "--"
- ["Grep for TODOs"
- (grep (format "grep -nH -i 'todo\\|fixme' %s*" (match-string 2)))]
-; ["Paste file link" ((insert "file:") (yank))]
- )))
- ((org-mouse-looking-at ":\\([A-Za-z0-9_]+\\):" "A-Za-z0-9_" -1) ;tags
- (popup-menu
- `(nil
- [,(format "Display '%s'" (match-string 1))
- (org-tags-view nil ,(match-string 1))]
- [,(format "Sparse Tree '%s'" (match-string 1))
- (org-tags-sparse-tree nil ,(match-string 1))]
- "--"
- ,@(org-mouse-tag-menu))))
- ((org-at-timestamp-p)
- (popup-menu
- '(nil
- ["Show Day" org-open-at-point t]
- ["Change Timestamp" org-time-stamp t]
- ["Delete Timestamp" (org-mouse-delete-timestamp) t]
- ["Compute Time Range" org-evaluate-time-range (org-at-date-range-p)]
- "--"
- ["Set for Today" org-mouse-timestamp-today]
- ["Set for Tomorrow" (org-mouse-timestamp-today 1 'day)]
- ["Set in 1 Week" (org-mouse-timestamp-today 7 'day)]
- ["Set in 2 Weeks" (org-mouse-timestamp-today 14 'day)]
- ["Set in a Month" (org-mouse-timestamp-today 1 'month)]
- "--"
- ["+ 1 Day" (org-timestamp-change 1 'day)]
- ["+ 1 Week" (org-timestamp-change 7 'day)]
- ["+ 1 Month" (org-timestamp-change 1 'month)]
- "--"
- ["- 1 Day" (org-timestamp-change -1 'day)]
- ["- 1 Week" (org-timestamp-change -7 'day)]
- ["- 1 Month" (org-timestamp-change -1 'month)])))
- ((get-context :table-special)
- (let ((mdata (match-data)))
- (incf (car mdata) 2)
- (store-match-data mdata))
- (message "match: %S" (match-string 0))
- (popup-menu `(nil ,@(org-mouse-keyword-replace-menu
- '(" " "!" "^" "_" "$" "#" "*" "'") 0
- (lambda (mark)
- (case (string-to-char mark)
- (? "( ) Nothing Special")
- (?! "(!) Column Names")
- (?^ "(^) Field Names Above")
- (?_ "(^) Field Names Below")
- (?$ "($) Formula Parameters")
- (?# "(#) Recalculation: Auto")
- (?* "(*) Recalculation: Manual")
- (?' "(') Recalculation: None"))) t))))
- ((assq :table contextlist)
- (popup-menu
- '(nil
- ["Align Table" org-ctrl-c-ctrl-c]
- ["Blank Field" org-table-blank-field]
- ["Edit Field" org-table-edit-field]
- "--"
- ("Column"
- ["Move Column Left" org-metaleft]
- ["Move Column Right" org-metaright]
- ["Delete Column" org-shiftmetaleft]
- ["Insert Column" org-shiftmetaright]
- "--"
- ["Enable Narrowing" (setq org-table-limit-column-width (not org-table-limit-column-width)) :selected org-table-limit-column-width :style toggle])
- ("Row"
- ["Move Row Up" org-metaup]
- ["Move Row Down" org-metadown]
- ["Delete Row" org-shiftmetaup]
- ["Insert Row" org-shiftmetadown]
- ["Sort lines in region" org-table-sort-lines (org-at-table-p)]
- "--"
- ["Insert Hline" org-table-insert-hline])
- ("Rectangle"
- ["Copy Rectangle" org-copy-special]
- ["Cut Rectangle" org-cut-special]
- ["Paste Rectangle" org-paste-special]
- ["Fill Rectangle" org-table-wrap-region])
- "--"
- ["Set Column Formula" org-table-eval-formula]
- ["Set Field Formula" (org-table-eval-formula '(4))]
- ["Edit Formulas" org-table-edit-formulas]
- "--"
- ["Recalculate Line" org-table-recalculate]
- ["Recalculate All" (org-table-recalculate '(4))]
- ["Iterate All" (org-table-recalculate '(16))]
- "--"
- ["Toggle Recalculate Mark" org-table-rotate-recalc-marks]
- ["Sum Column/Rectangle" org-table-sum
- :active (or (org-at-table-p) (org-region-active-p))]
- ["Field Info" org-table-field-info]
- ["Debug Formulas"
- (setq org-table-formula-debug (not org-table-formula-debug))
- :style toggle :selected org-table-formula-debug]
- )))
- ((and (assq :headline contextlist) (not (eolp)))
- (let ((priority (org-mouse-get-priority t)))
- (popup-menu
- `("Headline Menu"
- ("Tags and Priorities"
- ,@(org-mouse-keyword-menu
- (org-mouse-priority-list)
- '(lambda (keyword)
- (org-mouse-set-priority (string-to-char keyword)))
- priority "Priority %s")
- "--"
- ,@(org-mouse-tag-menu))
- ("TODO Status"
- ,@(org-mouse-todo-menu (org-get-todo-state)))
- ["Show Tags"
- (with-current-buffer org-mouse-main-buffer (org-agenda-show-tags))
- :visible (not org-mouse-direct)]
- ["Show Priority"
- (with-current-buffer org-mouse-main-buffer (org-agenda-show-priority))
- :visible (not org-mouse-direct)]
- ,@(if org-mouse-direct '("--") nil)
- ["New Heading" org-mouse-insert-heading :visible org-mouse-direct]
- ["Set Deadline"
- (progn (org-mouse-end-headline) (insert " ") (org-deadline))
- :active (not (save-excursion
- (org-mouse-re-search-line org-deadline-regexp)))]
- ["Schedule Task"
- (progn (org-mouse-end-headline) (insert " ") (org-schedule))
- :active (not (save-excursion
- (org-mouse-re-search-line org-scheduled-regexp)))]
- ["Insert Timestamp"
- (progn (org-mouse-end-headline) (insert " ") (org-time-stamp nil)) t]
-; ["Timestamp (inactive)" org-time-stamp-inactive t]
- "--"
- ["Archive Subtree" org-archive-subtree]
- ["Cut Subtree" org-cut-special]
- ["Copy Subtree" org-copy-special]
- ["Paste Subtree" org-paste-special :visible org-mouse-direct]
- ("Sort Children"
- ["Alphabetically" (org-sort-entries nil ?a)]
- ["Numerically" (org-sort-entries nil ?n)]
- ["By Time/Date" (org-sort-entries nil ?t)]
- "--"
- ["Reverse Alphabetically" (org-sort-entries nil ?A)]
- ["Reverse Numerically" (org-sort-entries nil ?N)]
- ["Reverse By Time/Date" (org-sort-entries nil ?T)])
- "--"
- ["Move Trees" org-mouse-move-tree :active nil]
- ))))
- (t
- (org-mouse-popup-global-menu))))))
-
-;; (defun org-mouse-at-regexp (regexp)
-;; (save-excursion
-;; (let ((point (point))
-;; (bol (progn (beginning-of-line) (point)))
-;; (eol (progn (end-of-line) (point))))
-;; (goto-char point)
-;; (re-search-backward regexp bol 1)
-;; (and (not (eolp))
-;; (progn (forward-char)
-;; (re-search-forward regexp eol t))
-;; (<= (match-beginning 0) point)))))
-
-(defun org-mouse-mark-active ()
- (and mark-active transient-mark-mode))
-
-(defun org-mouse-in-region-p (pos)
- (and (org-mouse-mark-active)
- (>= pos (region-beginning))
- (< pos (region-end))))
-
-(defun org-mouse-down-mouse (event)
- (interactive "e")
- (setq this-command last-command)
- (unless (and (= 1 (event-click-count event))
- (org-mouse-in-region-p (posn-point (event-start event))))
- (mouse-drag-region event)))
-
-(add-hook 'org-mode-hook
- '(lambda ()
- (setq org-mouse-context-menu-function 'org-mouse-context-menu)
-
- (when (memq 'context-menu org-mouse-features)
- (org-defkey org-mouse-map [mouse-3] nil)
- (org-defkey org-mode-map [mouse-3] 'org-mouse-show-context-menu))
- (org-defkey org-mode-map [down-mouse-1] 'org-mouse-down-mouse)
- (when (memq 'context-menu org-mouse-features)
- (org-defkey org-mouse-map [C-drag-mouse-1] 'org-mouse-move-tree)
- (org-defkey org-mouse-map [C-down-mouse-1] 'org-mouse-move-tree-start))
- (when (memq 'yank-link org-mouse-features)
- (org-defkey org-mode-map [S-mouse-2] 'org-mouse-yank-link)
- (org-defkey org-mode-map [drag-mouse-3] 'org-mouse-yank-link))
- (when (memq 'move-tree org-mouse-features)
- (org-defkey org-mouse-map [drag-mouse-3] 'org-mouse-move-tree)
- (org-defkey org-mouse-map [down-mouse-3] 'org-mouse-move-tree-start))
-
- (when (memq 'activate-stars org-mouse-features)
- (font-lock-add-keywords
- nil
- `((,outline-regexp
- 0 `(face org-link mouse-face highlight keymap ,org-mouse-map)
- 'prepend))
- t))
-
- (when (memq 'activate-bullets org-mouse-features)
- (font-lock-add-keywords
- nil
- `(("^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +"
- (1 `(face org-link keymap ,org-mouse-map mouse-face highlight)
- 'prepend)))
- t))
-
- (when (memq 'activate-checkboxes org-mouse-features)
- (font-lock-add-keywords
- nil
- `(("^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +\\(\\[[ X]\\]\\)"
- (2 `(face bold keymap ,org-mouse-map mouse-face highlight) t)))
- t))
-
- (defadvice org-open-at-point (around org-mouse-open-at-point activate)
- (let ((context (org-context)))
- (cond
- ((assq :headline-stars context) (org-cycle))
- ((assq :checkbox context) (org-toggle-checkbox))
- ((assq :item-bullet context)
- (let ((org-cycle-include-plain-lists t)) (org-cycle)))
- (t ad-do-it))))))
-
-(defun org-mouse-move-tree-start (event)
- (interactive "e")
- (message "Same line: promote/demote, (***):move before, (text): make a child"))
-
-
-(defun org-mouse-make-marker (position)
- (with-current-buffer (window-buffer (posn-window position))
- (copy-marker (posn-point position))))
-
-(defun org-mouse-move-tree (event)
- ;; todo: handle movements between different buffers
- (interactive "e")
- (save-excursion
- (let* ((start (org-mouse-make-marker (event-start event)))
- (end (org-mouse-make-marker (event-end event)))
- (sbuf (marker-buffer start))
- (ebuf (marker-buffer end)))
-
- (when (and sbuf ebuf)
- (set-buffer sbuf)
- (goto-char start)
- (org-back-to-heading)
- (if (and (eq sbuf ebuf)
- (equal
- (point)
- (save-excursion (goto-char end) (org-back-to-heading) (point))))
- ;; if the same line then promote/demote
- (if (>= end start) (org-demote-subtree) (org-promote-subtree))
- ;; if different lines then move
- (org-cut-subtree)
-
- (set-buffer ebuf)
- (goto-char end)
- (org-back-to-heading)
- (when (and (eq sbuf ebuf)
- (equal
- (point)
- (save-excursion (goto-char start)
- (org-back-to-heading) (point))))
- (outline-end-of-subtree)
- (end-of-line)
- (if (eobp) (newline) (forward-char)))
-
- (when (looking-at outline-regexp)
- (let ((level (- (match-end 0) (match-beginning 0))))
- (when (> end (match-end 0))
- (outline-end-of-subtree)
- (end-of-line)
- (if (eobp) (newline) (forward-char))
- (setq level (1+ level)))
- (org-paste-subtree level)
- (save-excursion
- (outline-end-of-subtree)
- (when (bolp) (delete-char -1))))))))))
-
-
-(defun org-mouse-transform-to-outline ()
- (interactive)
- (org-back-to-heading)
- (let ((minlevel 1000)
- (replace-text (concat (match-string 0) "* ")))
- (beginning-of-line 2)
- (save-excursion
- (while (not (or (eobp) (looking-at outline-regexp)))
- (when (looking-at org-mouse-plain-list-regexp)
- (setq minlevel (min minlevel (- (match-end 1) (match-beginning 1)))))
- (forward-line)))
- (while (not (or (eobp) (looking-at outline-regexp)))
- (when (and (looking-at org-mouse-plain-list-regexp)
- (eq minlevel (- (match-end 1) (match-beginning 1))))
- (replace-match replace-text))
- (forward-line))))
-
-(defvar _cmd) ;dynamically scoped from `org-with-remote-undo'.
-
-(defun org-mouse-do-remotely (command)
-; (org-agenda-check-no-diary)
- (when (get-text-property (point) 'org-marker)
- (let* ((anticol (- (point-at-eol) (point)))
- (marker (get-text-property (point) 'org-marker))
- (buffer (marker-buffer marker))
- (pos (marker-position marker))
- (hdmarker (get-text-property (point) 'org-hd-marker))
- (buffer-read-only nil)
- (newhead "--- removed ---")
- (org-mouse-direct nil)
- (org-mouse-main-buffer (current-buffer)))
- (when (eq (with-current-buffer buffer major-mode) 'org-mode)
- (let ((endmarker (with-current-buffer buffer
- (outline-end-of-subtree)
- (forward-char 1)
- (copy-marker (point)))))
- (org-with-remote-undo buffer
- (with-current-buffer buffer
- (widen)
- (goto-char pos)
- (org-show-hidden-entry)
- (save-excursion
- (and (outline-next-heading)
- (org-flag-heading nil))) ; show the next heading
- (org-back-to-heading)
- (setq marker (copy-marker (point)))
- (goto-char (max (point-at-bol) (- (point-at-eol) anticol)))
- (funcall command)
- (message "_cmd: %S" _cmd)
- (message "this-command: %S" this-command)
- (unless (eq (marker-position marker) (marker-position endmarker))
- (setq newhead (org-get-heading))))
-
- (beginning-of-line 1)
- (save-excursion
- (org-agenda-change-all-lines newhead hdmarker 'fixface))))
- t))))
-
-(defun org-mouse-agenda-context-menu (&optional event)
- (or (org-mouse-do-remotely 'org-mouse-context-menu)
- (popup-menu
- '("Agenda"
- ("Agenda Files")
- "--"
- ["Undo" (progn (message "last command: %S" last-command) (setq this-command 'org-agenda-undo) (org-agenda-undo))
- :visible (if (eq last-command 'org-agenda-undo)
- org-agenda-pending-undo-list
- org-agenda-undo-list)]
- ["Rebuild Buffer" org-agenda-redo t]
- ["New Diary Entry"
- org-agenda-diary-entry (org-agenda-check-type nil 'agenda 'timeline) t]
- "--"
- ["Goto Today" org-agenda-goto-today
- (org-agenda-check-type nil 'agenda 'timeline) t]
- ["Display Calendar" org-agenda-goto-calendar
- (org-agenda-check-type nil 'agenda 'timeline) t]
- ("Calendar Commands"
- ["Phases of the Moon" org-agenda-phases-of-moon
- (org-agenda-check-type nil 'agenda 'timeline)]
- ["Sunrise/Sunset" org-agenda-sunrise-sunset
- (org-agenda-check-type nil 'agenda 'timeline)]
- ["Holidays" org-agenda-holidays
- (org-agenda-check-type nil 'agenda 'timeline)]
- ["Convert" org-agenda-convert-date
- (org-agenda-check-type nil 'agenda 'timeline)]
- "--"
- ["Create iCalendar file" org-export-icalendar-combine-agenda-files t])
- "--"
- ["Day View" org-agenda-day-view
- :active (org-agenda-check-type nil 'agenda)
- :style radio :selected (eq org-agenda-current-span 'day)]
- ["Week View" org-agenda-week-view
- :active (org-agenda-check-type nil 'agenda)
- :style radio :selected (eq org-agenda-current-span 'week)]
- "--"
- ["Show Logbook entries" org-agenda-log-mode
- :style toggle :selected org-agenda-show-log
- :active (org-agenda-check-type nil 'agenda 'timeline)]
- ["Include Diary" org-agenda-toggle-diary
- :style toggle :selected org-agenda-include-diary
- :active (org-agenda-check-type nil 'agenda)]
- ["Use Time Grid" org-agenda-toggle-time-grid
- :style toggle :selected org-agenda-use-time-grid
- :active (org-agenda-check-type nil 'agenda)]
- ["Follow Mode" org-agenda-follow-mode
- :style toggle :selected org-agenda-follow-mode]
- "--"
- ["Quit" org-agenda-quit t]
- ["Exit and Release Buffers" org-agenda-exit t]
- ))))
-
-(defun org-mouse-get-gesture (event)
- (let ((startxy (posn-x-y (event-start event)))
- (endxy (posn-x-y (event-end event))))
- (if (< (car startxy) (car endxy)) :right :left)))
-
-
-; (setq org-agenda-mode-hook nil)
-(add-hook 'org-agenda-mode-hook
- '(lambda ()
- (setq org-mouse-context-menu-function 'org-mouse-agenda-context-menu)
- (org-defkey org-agenda-mode-map [mouse-3] 'org-mouse-show-context-menu)
- (org-defkey org-agenda-mode-map [down-mouse-3] 'org-mouse-move-tree-start)
- (org-defkey org-agenda-mode-map [C-mouse-4] 'org-agenda-earlier)
- (org-defkey org-agenda-mode-map [C-mouse-5] 'org-agenda-later)
- (org-defkey org-agenda-mode-map [drag-mouse-3]
- '(lambda (event) (interactive "e")
- (case (org-mouse-get-gesture event)
- (:left (org-agenda-earlier 1))
- (:right (org-agenda-later 1)))))))
-
-(provide 'org-mouse)
-
-;; arch-tag: ff1ae557-3529-41a3-95c6-baaebdcc280f
-
-;;; org-mouse.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-mouse.elc b/.emacs.d/org-7.4/lisp/org-mouse.elc
deleted file mode 100644
index e489016..0000000
--- a/.emacs.d/org-7.4/lisp/org-mouse.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-plot.el b/.emacs.d/org-7.4/lisp/org-plot.el
deleted file mode 100644
index 374e2d4..0000000
--- a/.emacs.d/org-7.4/lisp/org-plot.el
+++ /dev/null
@@ -1,354 +0,0 @@
-;;; org-plot.el --- Support for plotting from Org-mode
-
-;; Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
-;;
-;; Author: Eric Schulte <schulte dot eric at gmail dot com>
-;; Keywords: tables, plotting
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Borrows ideas and a couple of lines of code from org-exp.el.
-
-;; Thanks to the org-mode mailing list for testing and implementation
-;; and feature suggestions
-
-;;; Code:
-(require 'org)
-(require 'org-exp)
-(require 'org-table)
-(eval-when-compile
- (require 'cl))
-
-(declare-function gnuplot-delchar-or-maybe-eof "ext:gnuplot" (arg))
-(declare-function gnuplot-mode "ext:gnuplot" ())
-(declare-function gnuplot-send-buffer-to-gnuplot "ext:gnuplot" ())
-
-(defvar org-plot/gnuplot-default-options
- '((:plot-type . 2d)
- (:with . lines)
- (:ind . 0))
- "Default options to gnuplot used by `org-plot/gnuplot'.")
-
-(defvar org-plot-timestamp-fmt nil)
-
-(defun org-plot/add-options-to-plist (p options)
- "Parse an OPTIONS line and set values in the property list P.
-Returns the resulting property list."
- (let (o)
- (when options
- (let ((op '(("type" . :plot-type)
- ("script" . :script)
- ("line" . :line)
- ("set" . :set)
- ("title" . :title)
- ("ind" . :ind)
- ("deps" . :deps)
- ("with" . :with)
- ("file" . :file)
- ("labels" . :labels)
- ("map" . :map)
- ("timeind" . :timeind)
- ("timefmt" . :timefmt)))
- (multiples '("set" "line"))
- (regexp ":\\([\"][^\"]+?[\"]\\|[(][^)]+?[)]\\|[^ \t\n\r;,.]*\\)")
- (start 0)
- o)
- (while (setq o (pop op))
- (if (member (car o) multiples) ;; keys with multiple values
- (while (string-match
- (concat (regexp-quote (car o)) regexp)
- options start)
- (setq start (match-end 0))
- (setq p (plist-put p (cdr o)
- (cons (car (read-from-string
- (match-string 1 options)))
- (plist-get p (cdr o)))))
- p)
- (if (string-match (concat (regexp-quote (car o)) regexp)
- options)
- (setq p (plist-put p (cdr o)
- (car (read-from-string
- (match-string 1 options)))))))))))
- p)
-
-(defun org-plot/goto-nearest-table ()
- "Move the point forward to the beginning of nearest table.
-Return value is the point at the beginning of the table."
- (interactive) (move-beginning-of-line 1)
- (while (not (or (org-at-table-p) (< 0 (forward-line 1)))))
- (goto-char (org-table-begin)))
-
-(defun org-plot/collect-options (&optional params)
- "Collect options from an org-plot '#+Plot:' line.
-Accepts an optional property list PARAMS, to which the options
-will be added. Returns the resulting property list."
- (interactive)
- (let ((line (thing-at-point 'line)))
- (if (string-match "#\\+PLOT: +\\(.*\\)$" line)
- (org-plot/add-options-to-plist params (match-string 1 line))
- params)))
-
-(defun org-plot-quote-timestamp-field (s)
- "Convert field S from timestamp to Unix time and export to gnuplot."
- (format-time-string org-plot-timestamp-fmt (org-time-string-to-time s)))
-
-(defun org-plot-quote-tsv-field (s)
- "Quote field S for export to gnuplot."
- (if (string-match org-table-number-regexp s) s
- (if (string-match org-ts-regexp3 s)
- (org-plot-quote-timestamp-field s)
- (concat "\"" (mapconcat 'identity (split-string s "\"") "\"\"") "\""))))
-
-(defun org-plot/gnuplot-to-data (table data-file params)
- "Export TABLE to DATA-FILE in a format readable by gnuplot.
-Pass PARAMS through to `orgtbl-to-generic' when exporting TABLE."
- (with-temp-file
- data-file
- (make-local-variable 'org-plot-timestamp-fmt)
- (setq org-plot-timestamp-fmt (or
- (plist-get params :timefmt)
- "%Y-%m-%d-%H:%M:%S"))
- (insert (orgtbl-to-generic
- table
- (org-combine-plists
- '(:sep "\t" :fmt org-plot-quote-tsv-field)
- params))))
- nil)
-
-(defun org-plot/gnuplot-to-grid-data (table data-file params)
- "Export the data in TABLE to DATA-FILE for gnuplot.
-This means in a format appropriate for grid plotting by gnuplot.
-PARAMS specifies which columns of TABLE should be plotted as independent
-and dependant variables."
- (interactive)
- (let* ((ind (- (plist-get params :ind) 1))
- (deps (if (plist-member params :deps)
- (mapcar (lambda (val) (- val 1)) (plist-get params :deps))
- (let (collector)
- (dotimes (col (length (first table)))
- (setf collector (cons col collector)))
- collector)))
- row-vals (counter 0))
- (when (>= ind 0) ;; collect values of ind col
- (setf row-vals (mapcar (lambda (row) (setf counter (+ 1 counter))
- (cons counter (nth ind row))) table)))
- (when (or deps (>= ind 0)) ;; remove non-plotting columns
- (setf deps (delq ind deps))
- (setf table (mapcar (lambda (row)
- (dotimes (col (length row))
- (unless (memq col deps)
- (setf (nth col row) nil)))
- (delq nil row))
- table)))
- ;; write table to gnuplot grid datafile format
- (with-temp-file data-file
- (let ((num-rows (length table)) (num-cols (length (first table)))
- front-edge back-edge)
- (flet ((gnuplot-row (col row value)
- (setf col (+ 1 col)) (setf row (+ 1 row))
- (format "%f %f %f\n%f %f %f\n"
- col (- row 0.5) value ;; lower edge
- col (+ row 0.5) value))) ;; upper edge
- (dotimes (col num-cols)
- (dotimes (row num-rows)
- (setf back-edge
- (concat back-edge
- (gnuplot-row (- col 1) row (string-to-number
- (nth col (nth row table))))))
- (setf front-edge
- (concat front-edge
- (gnuplot-row col row (string-to-number
- (nth col (nth row table)))))))
- ;; only insert once per row
- (insert back-edge) (insert "\n") ;; back edge
- (insert front-edge) (insert "\n") ;; front edge
- (setf back-edge "") (setf front-edge "")))))
- row-vals))
-
-(defun org-plot/gnuplot-script (data-file num-cols params &optional preface)
- "Write a gnuplot script to DATA-FILE respecting the options set in PARAMS.
-NUM-COLS controls the number of columns plotted in a 2-d plot.
-Optional argument PREFACE returns only option parameters in a
-manner suitable for prepending to a user-specified script."
- (let* ((type (plist-get params :plot-type))
- (with (if (equal type 'grid)
- 'pm3d
- (plist-get params :with)))
- (sets (plist-get params :set))
- (lines (plist-get params :line))
- (map (plist-get params :map))
- (title (plist-get params :title))
- (file (plist-get params :file))
- (ind (plist-get params :ind))
- (time-ind (plist-get params :timeind))
- (timefmt (plist-get params :timefmt))
- (text-ind (plist-get params :textind))
- (deps (if (plist-member params :deps) (plist-get params :deps)))
- (col-labels (plist-get params :labels))
- (x-labels (plist-get params :xlabels))
- (y-labels (plist-get params :ylabels))
- (plot-str "'%s' using %s%d%s with %s title '%s'")
- (plot-cmd (case type
- ('2d "plot")
- ('3d "splot")
- ('grid "splot")))
- (script "reset") plot-lines)
- (flet ((add-to-script (line) (setf script (format "%s\n%s" script line))))
- (when file ;; output file
- (add-to-script (format "set term %s" (file-name-extension file)))
- (add-to-script (format "set output '%s'" file)))
- (case type ;; type
- ('2d ())
- ('3d (if map (add-to-script "set map")))
- ('grid (if map
- (add-to-script "set pm3d map")
- (add-to-script "set pm3d"))))
- (when title (add-to-script (format "set title '%s'" title))) ;; title
- (when lines (mapc (lambda (el) (add-to-script el)) lines)) ;; line
- (when sets ;; set
- (mapc (lambda (el) (add-to-script (format "set %s" el))) sets))
- (when x-labels ;; x labels (xtics)
- (add-to-script
- (format "set xtics (%s)"
- (mapconcat (lambda (pair)
- (format "\"%s\" %d" (cdr pair) (car pair)))
- x-labels ", "))))
- (when y-labels ;; y labels (ytics)
- (add-to-script
- (format "set ytics (%s)"
- (mapconcat (lambda (pair)
- (format "\"%s\" %d" (cdr pair) (car pair)))
- y-labels ", "))))
- (when time-ind ;; timestamp index
- (add-to-script "set xdata time")
- (add-to-script (concat "set timefmt \""
- (or timefmt ;; timefmt passed to gnuplot
- "%Y-%m-%d-%H:%M:%S") "\"")))
- (unless preface
- (case type ;; plot command
- ('2d (dotimes (col num-cols)
- (unless (and (equal type '2d)
- (or (and ind (equal (+ 1 col) ind))
- (and deps (not (member (+ 1 col) deps)))))
- (setf plot-lines
- (cons
- (format plot-str data-file
- (or (and ind (> ind 0)
- (not text-ind)
- (format "%d:" ind)) "")
- (+ 1 col)
- (if text-ind (format ":xticlabel(%d)" ind) "")
- with
- (or (nth col col-labels) (format "%d" (+ 1 col))))
- plot-lines)))))
- ('3d
- (setq plot-lines (list (format "'%s' matrix with %s title ''"
- data-file with))))
- ('grid
- (setq plot-lines (list (format "'%s' with %s title ''"
- data-file with)))))
- (add-to-script
- (concat plot-cmd " " (mapconcat 'identity (reverse plot-lines) ",\\\n "))))
- script)))
-
-;;-----------------------------------------------------------------------------
-;; facade functions
-;;;###autoload
-(defun org-plot/gnuplot (&optional params)
- "Plot table using gnuplot. Gnuplot options can be specified with PARAMS.
-If not given options will be taken from the +PLOT
-line directly before or after the table."
- (interactive)
- (require 'gnuplot)
- (save-window-excursion
- (delete-other-windows)
- (when (get-buffer "*gnuplot*") ;; reset *gnuplot* if it already running
- (with-current-buffer "*gnuplot*"
- (goto-char (point-max))
- (gnuplot-delchar-or-maybe-eof nil)))
- (org-plot/goto-nearest-table)
- ;; set default options
- (mapc
- (lambda (pair)
- (unless (plist-member params (car pair))
- (setf params (plist-put params (car pair) (cdr pair)))))
- org-plot/gnuplot-default-options)
- ;; collect table and table information
- (let* ((data-file (make-temp-file "org-plot"))
- (table (org-table-to-lisp))
- (num-cols (length (if (eq (first table) 'hline) (second table)
- (first table)))))
- (while (equal 'hline (first table)) (setf table (cdr table)))
- (when (equal (second table) 'hline)
- (setf params (plist-put params :labels (first table))) ;; headers to labels
- (setf table (delq 'hline (cdr table)))) ;; clean non-data from table
- ;; collect options
- (save-excursion (while (and (equal 0 (forward-line -1))
- (looking-at "[[:space:]]*#\\+"))
- (setf params (org-plot/collect-options params))))
- ;; dump table to datafile (very different for grid)
- (case (plist-get params :plot-type)
- ('2d (org-plot/gnuplot-to-data table data-file params))
- ('3d (org-plot/gnuplot-to-data table data-file params))
- ('grid (let ((y-labels (org-plot/gnuplot-to-grid-data
- table data-file params)))
- (when y-labels (plist-put params :ylabels y-labels)))))
- ;; check for timestamp ind column
- (let ((ind (- (plist-get params :ind) 1)))
- (when (and (>= ind 0) (equal '2d (plist-get params :plot-type)))
- (if (= (length
- (delq 0 (mapcar
- (lambda (el)
- (if (string-match org-ts-regexp3 el)
- 0 1))
- (mapcar (lambda (row) (nth ind row)) table)))) 0)
- (plist-put params :timeind t)
- ;; check for text ind column
- (if (or (string= (plist-get params :with) "hist")
- (> (length
- (delq 0 (mapcar
- (lambda (el)
- (if (string-match org-table-number-regexp el)
- 0 1))
- (mapcar (lambda (row) (nth ind row)) table)))) 0))
- (plist-put params :textind t)))))
- ;; write script
- (with-temp-buffer
- (if (plist-get params :script) ;; user script
- (progn (insert
- (org-plot/gnuplot-script data-file num-cols params t))
- (insert "\n")
- (insert-file-contents (plist-get params :script))
- (goto-char (point-min))
- (while (re-search-forward "$datafile" nil t)
- (replace-match data-file nil nil)))
- (insert
- (org-plot/gnuplot-script data-file num-cols params)))
- ;; graph table
- (gnuplot-mode)
- (gnuplot-send-buffer-to-gnuplot))
- ;; cleanup
- (bury-buffer (get-buffer "*gnuplot*"))
- (run-with-idle-timer 0.1 nil (lambda () (delete-file data-file))))))
-
-(provide 'org-plot)
-
-;; arch-tag: 5763f7c6-0c75-416d-b070-398ee4ec0eca
-;;; org-plot.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-plot.elc b/.emacs.d/org-7.4/lisp/org-plot.elc
deleted file mode 100644
index 893f1d3..0000000
--- a/.emacs.d/org-7.4/lisp/org-plot.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-protocol.el b/.emacs.d/org-7.4/lisp/org-protocol.el
deleted file mode 100644
index 5d5059f..0000000
--- a/.emacs.d/org-7.4/lisp/org-protocol.el
+++ /dev/null
@@ -1,708 +0,0 @@
-;;; org-protocol.el --- Intercept calls from emacsclient to trigger custom actions.
-;;
-;; Copyright (C) 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-;;
-;; Author: Bastien Guerry <bzg AT altern DOT org>
-;; Author: Daniel M German <dmg AT uvic DOT org>
-;; Author: Sebastian Rose <sebastian_rose AT gmx DOT de>
-;; Author: Ross Patterson <me AT rpatterson DOT net>
-;; Maintainer: Sebastian Rose <sebastian_rose AT gmx DOT de>
-;; Keywords: org, emacsclient, wp
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Commentary:
-;;
-;; Intercept calls from emacsclient to trigger custom actions.
-;;
-;; This is done by advising `server-visit-files' to scan the list of filenames
-;; for `org-protocol-the-protocol' and sub-protocols defined in
-;; `org-protocol-protocol-alist' and `org-protocol-protocol-alist-default'.
-;;
-;; Any application that supports calling external programs with an URL
-;; as argument may be used with this functionality.
-;;
-;;
-;; Usage:
-;; ------
-;;
-;; 1.) Add this to your init file (.emacs probably):
-;;
-;; (add-to-list 'load-path "/path/to/org-protocol/")
-;; (require 'org-protocol)
-;;
-;; 3.) Ensure emacs-server is up and running.
-;; 4.) Try this from the command line (adjust the URL as needed):
-;;
-;; $ emacsclient \
-;; org-protocol://store-link://http:%2F%2Flocalhost%2Findex.html/The%20title
-;;
-;; 5.) Optionally add custom sub-protocols and handlers:
-;;
-;; (setq org-protocol-protocol-alist
-;; '(("my-protocol"
-;; :protocol "my-protocol"
-;; :function my-protocol-handler-function)))
-;;
-;; A "sub-protocol" will be found in URLs like this:
-;;
-;; org-protocol://sub-protocol://data
-;;
-;; If it works, you can now setup other applications for using this feature.
-;;
-;;
-;; As of March 2009 Firefox users follow the steps documented on
-;; http://kb.mozillazine.org/Register_protocol, Opera setup is described here:
-;; http://www.opera.com/support/kb/view/535/
-;;
-;;
-;; Documentation
-;; -------------
-;;
-;; org-protocol.el comes with and installs handlers to open sources of published
-;; online content, store and insert the browser's URLs and cite online content
-;; by clicking on a bookmark in Firefox, Opera and probably other browsers and
-;; applications:
-;;
-;; * `org-protocol-open-source' uses the sub-protocol \"open-source\" and maps
-;; URLs to local filenames defined in `org-protocol-project-alist'.
-;;
-;; * `org-protocol-store-link' stores an Org-link (if Org-mode is present) and
-;; pushes the browsers URL to the `kill-ring' for yanking. This handler is
-;; triggered through the sub-protocol \"store-link\".
-;;
-;; * Call `org-protocol-capture' by using the sub-protocol \"capture\". If
-;; Org-mode is loaded, Emacs will pop-up a capture buffer and fill the
-;; template with the data provided. I.e. the browser's URL is inserted as an
-;; Org-link of which the page title will be the description part. If text
-;; was select in the browser, that text will be the body of the entry.
-;;
-;; * Call `org-protocol-remember' by using the sub-protocol \"remember\".
-;; This is provided for backward compatibility.
-;; You may read `org-capture' as `org-remember' throughout this file if
-;; you still use `org-remember'.
-;;
-;; You may use the same bookmark URL for all those standard handlers and just
-;; adjust the sub-protocol used:
-;;
-;; location.href='org-protocol://sub-protocol://'+
-;; encodeURIComponent(location.href)+'/'+
-;; encodeURIComponent(document.title)+'/'+
-;; encodeURIComponent(window.getSelection())
-;;
-;; The handler for the sub-protocol \"capture\" detects an optional template
-;; char that, if present, triggers the use of a special template.
-;; Example:
-;;
-;; location.href='org-protocol://sub-protocol://x/'+ ...
-;;
-;; use template ?x.
-;;
-;; Note, that using double slashes is optional from org-protocol.el's point of
-;; view because emacsclient squashes the slashes to one.
-;;
-;;
-;; provides: 'org-protocol
-;;
-;;; Code:
-
-(require 'org)
-(eval-when-compile
- (require 'cl))
-
-(declare-function org-publish-get-project-from-filename "org-publish"
- (filename &optional up))
-(declare-function server-edit "server" (&optional arg))
-
-
-(defgroup org-protocol nil
- "Intercept calls from emacsclient to trigger custom actions.
-
-This is done by advising `server-visit-files' to scann the list of filenames
-for `org-protocol-the-protocol' and sub-procols defined in
-`org-protocol-protocol-alist' and `org-protocol-protocol-alist-default'."
- :version "22.1"
- :group 'convenience
- :group 'org)
-
-
-;;; Variables:
-
-(defconst org-protocol-protocol-alist-default
- '(("org-remember" :protocol "remember" :function org-protocol-remember :kill-client t)
- ("org-capture" :protocol "capture" :function org-protocol-capture :kill-client t)
- ("org-store-link" :protocol "store-link" :function org-protocol-store-link)
- ("org-open-source" :protocol "open-source" :function org-protocol-open-source))
- "Default protocols to use.
-See `org-protocol-protocol-alist' for a description of this variable.")
-
-
-(defconst org-protocol-the-protocol "org-protocol"
- "This is the protocol to detect if org-protocol.el is loaded.
-`org-protocol-protocol-alist-default' and `org-protocol-protocol-alist' hold
-the sub-protocols that trigger the required action. You will have to define
-just one protocol handler OS-wide (MS-Windows) or per application (Linux).
-That protocol handler should call emacsclient.")
-
-
-;;; User variables:
-
-(defcustom org-protocol-reverse-list-of-files t
- "* Non-nil means re-reverse the list of filenames passed on the command line.
-The filenames passed on the command line are passed to the emacs-server in
-reverse order. Set to t (default) to re-reverse the list, i.e. use the
-sequence on the command line. If nil, the sequence of the filenames is
-unchanged."
- :group 'org-protocol
- :type 'boolean)
-
-
-(defcustom org-protocol-project-alist nil
- "* Map URLs to local filenames for `org-protocol-open-source' (open-source).
-
-Each element of this list must be of the form:
-
- (module-name :property value property: value ...)
-
-where module-name is an arbitrary name. All the values are strings.
-
-Possible properties are:
-
- :online-suffix - the suffix to strip from the published URLs
- :working-suffix - the replacement for online-suffix
- :base-url - the base URL, e.g. http://www.example.com/project/
- Last slash required.
- :working-directory - the local working directory. This is, what base-url will
- be replaced with.
- :redirects - A list of cons cells, each of which maps a regular
- expression to match to a path relative to :working-directory.
-
-Example:
-
- (setq org-protocol-project-alist
- '((\"http://orgmode.org/worg/\"
- :online-suffix \".php\"
- :working-suffix \".org\"
- :base-url \"http://orgmode.org/worg/\"
- :working-directory \"/home/user/org/Worg/\")
- (\"http://localhost/org-notes/\"
- :online-suffix \".html\"
- :working-suffix \".org\"
- :base-url \"http://localhost/org/\"
- :working-directory \"/home/user/org/\"
- :rewrites ((\"org/?$\" . \"index.php\")))))
-
- The last line tells `org-protocol-open-source' to open
- /home/user/org/index.php, if the URL cannot be mapped to an existing
- file, and ends with either \"org\" or \"org/\".
-
-Consider using the interactive functions `org-protocol-create' and
-`org-protocol-create-for-org' to help you filling this variable with valid contents."
- :group 'org-protocol
- :type 'alist)
-
-
-(defcustom org-protocol-protocol-alist nil
- "* Register custom handlers for org-protocol.
-
-Each element of this list must be of the form:
-
- (module-name :protocol protocol :function func :kill-client nil)
-
-protocol - protocol to detect in a filename without trailing colon and slashes.
- See rfc1738 section 2.1 for more on this.
- If you define a protocol \"my-protocol\", `org-protocol-check-filename-for-protocol'
- will search filenames for \"org-protocol:/my-protocol:/\"
- and trigger your action for every match. `org-protocol' is defined in
- `org-protocol-the-protocol'. Double and triple slashes are compressed
- to one by emacsclient.
-
-function - function that handles requests with protocol and takes exactly one
- argument: the filename with all protocols stripped. If the function
- returns nil, emacsclient and -server do nothing. Any non-nil return
- value is considered a valid filename and thus passed to the server.
-
- `org-protocol.el provides some support for handling those filenames,
- if you stay with the conventions used for the standard handlers in
- `org-protocol-protocol-alist-default'. See `org-protocol-split-data'.
-
-kill-client - If t, kill the client immediately, once the sub-protocol is
- detected. This is necessary for actions that can be interrupted by
- `C-g' to avoid dangling emacsclients. Note, that all other command
- line arguments but the this one will be discarded, greedy handlers
- still receive the whole list of arguments though.
-
-Here is an example:
-
- (setq org-protocol-protocol-alist
- '((\"my-protocol\"
- :protocol \"my-protocol\"
- :function my-protocol-handler-function)
- (\"your-protocol\"
- :protocol \"your-protocol\"
- :function your-protocol-handler-function)))"
- :group 'org-protocol
- :type '(alist))
-
-(defcustom org-protocol-default-template-key nil
- "The default org-remember-templates key to use."
- :group 'org-protocol
- :type 'string)
-
-;;; Helper functions:
-
-(defun org-protocol-sanitize-uri (uri)
- "emacsclient compresses double and triple slashes.
-Slashes are sanitized to double slashes here."
- (when (string-match "^\\([a-z]+\\):/" uri)
- (let* ((splitparts (split-string uri "/+")))
- (setq uri (concat (car splitparts) "//" (mapconcat 'identity (cdr splitparts) "/")))))
- uri)
-
-
-(defun org-protocol-split-data(data &optional unhexify separator)
- "Split, what an org-protocol handler function gets as only argument.
-DATA is that one argument. DATA is split at each occurrence of
-SEPARATOR (regexp). If no SEPARATOR is specified or SEPARATOR is
-nil, assume \"/+\". The results of that splitting are returned
-as a list. If UNHEXIFY is non-nil, hex-decode each split part. If
-UNHEXIFY is a function, use that function to decode each split
-part."
- (let* ((sep (or separator "/+"))
- (split-parts (split-string data sep)))
- (if unhexify
- (if (fboundp unhexify)
- (mapcar unhexify split-parts)
- (mapcar 'org-protocol-unhex-string split-parts))
- split-parts)))
-
-;; This inline function is needed in org-protocol-unhex-compound to do
-;; the right thing to decode UTF-8 char integer values.
-(eval-when-compile
- (if (>= emacs-major-version 23)
- (defsubst org-protocol-char-to-string(c)
- "Defsubst to decode UTF-8 character values in emacs 23 and beyond."
- (char-to-string c))
- (defsubst org-protocol-char-to-string (c)
- "Defsubst to decode UTF-8 character values in emacs 22."
- (string (decode-char 'ucs c)))))
-
-(defun org-protocol-unhex-string(str)
- "Unhex hexified unicode strings as returned from the JavaScript function
-encodeURIComponent. E.g. `%C3%B6' is the german Umlaut `ü'."
- (setq str (or str ""))
- (let ((tmp "")
- (case-fold-search t))
- (while (string-match "\\(%[0-9a-f][0-9a-f]\\)+" str)
- (let* ((start (match-beginning 0))
- (end (match-end 0))
- (hex (match-string 0 str))
- (replacement (org-protocol-unhex-compound (upcase hex))))
- (setq tmp (concat tmp (substring str 0 start) replacement))
- (setq str (substring str end))))
- (setq tmp (concat tmp str))
- tmp))
-
-
-(defun org-protocol-unhex-compound (hex)
- "Unhexify unicode hex-chars. E.g. `%C3%B6' is the German Umlaut `ü'."
- (let* ((bytes (remove "" (split-string hex "%")))
- (ret "")
- (eat 0)
- (sum 0))
- (while bytes
- (let* ((b (pop bytes))
- (a (elt b 0))
- (b (elt b 1))
- (c1 (if (> a ?9) (+ 10 (- a ?A)) (- a ?0)))
- (c2 (if (> b ?9) (+ 10 (- b ?A)) (- b ?0)))
- (val (+ (lsh c1 4) c2))
- (shift
- (if (= 0 eat) ;; new byte
- (if (>= val 252) 6
- (if (>= val 248) 5
- (if (>= val 240) 4
- (if (>= val 224) 3
- (if (>= val 192) 2 0)))))
- 6))
- (xor
- (if (= 0 eat) ;; new byte
- (if (>= val 252) 252
- (if (>= val 248) 248
- (if (>= val 240) 240
- (if (>= val 224) 224
- (if (>= val 192) 192 0)))))
- 128)))
- (if (>= val 192) (setq eat shift))
- (setq val (logxor val xor))
- (setq sum (+ (lsh sum shift) val))
- (if (> eat 0) (setq eat (- eat 1)))
- (when (= 0 eat)
- (setq ret (concat ret (org-protocol-char-to-string sum)))
- (setq sum 0))
- )) ;; end (while bytes
- ret ))
-
-(defun org-protocol-flatten-greedy (param-list &optional strip-path replacement)
- "Greedy handlers might receive a list like this from emacsclient:
- '( (\"/dir/org-protocol:/greedy:/~/path1\" (23 . 12)) (\"/dir/param\")
-where \"/dir/\" is the absolute path to emacsclients working directory. This
-function transforms it into a flat list utilizing `org-protocol-flatten' and
-transforms the elements of that list as follows:
-
-If strip-path is non-nil, remove the \"/dir/\" prefix from all members of
-param-list.
-
-If replacement is string, replace the \"/dir/\" prefix with it.
-
-The first parameter, the one that contains the protocols, is always changed.
-Everything up to the end of the protocols is stripped.
-
-Note, that this function will always behave as if
-`org-protocol-reverse-list-of-files' was set to t and the returned list will
-reflect that. I.e. emacsclients first parameter will be the first one in the
-returned list."
-(let* ((l (org-protocol-flatten (if org-protocol-reverse-list-of-files
- param-list
- (reverse param-list))))
- (trigger (car l))
- (len 0)
- dir
- ret)
- (when (string-match "^\\(.*\\)\\(org-protocol:/+[a-zA-z0-9][-_a-zA-z0-9]*:/+\\)\\(.*\\)" trigger)
- (setq dir (match-string 1 trigger))
- (setq len (length dir))
- (setcar l (concat dir (match-string 3 trigger))))
- (if strip-path
- (progn
- (dolist (e l ret)
- (setq ret
- (append ret
- (list
- (if (stringp e)
- (if (stringp replacement)
- (setq e (concat replacement (substring e len)))
- (setq e (substring e len)))
- e)))))
- ret)
- l)))
-
-
-(defun org-protocol-flatten (l)
- "Greedy handlers might receive a list like this from emacsclient:
- '( (\"/dir/org-protocol:/greedy:/~/path1\" (23 . 12)) (\"/dir/param\")
-where \"/dir/\" is the absolute path to emacsclients working directory.
-This function transforms it into a flat list."
- (if (null l) ()
- (if (listp l)
- (append (org-protocol-flatten (car l)) (org-protocol-flatten (cdr l)))
- (list l))))
-
-;;; Standard protocol handlers:
-
-(defun org-protocol-store-link (fname)
- "Process an org-protocol://store-link:// style url.
-Additionally store a browser URL as an org link. Also pushes the
-link's URL to the `kill-ring'.
-
-The location for a browser's bookmark has to look like this:
-
- javascript:location.href='org-protocol://store-link://'+ \\
- encodeURIComponent(location.href)
- encodeURIComponent(document.title)+'/'+ \\
-
-Don't use `escape()'! Use `encodeURIComponent()' instead. The title of the page
-could contain slashes and the location definitely will.
-
-The sub-protocol used to reach this function is set in
-`org-protocol-protocol-alist'."
- (let* ((splitparts (org-protocol-split-data fname t))
- (uri (org-protocol-sanitize-uri (car splitparts)))
- (title (cadr splitparts))
- orglink)
- (if (boundp 'org-stored-links)
- (setq org-stored-links (cons (list uri title) org-stored-links)))
- (kill-new uri)
- (message "`%s' to insert new org-link, `%s' to insert `%s'"
- (substitute-command-keys"\\[org-insert-link]")
- (substitute-command-keys"\\[yank]")
- uri))
- nil)
-
-(defun org-protocol-remember (info)
- "Process an org-protocol://remember:// style url.
-
-The location for a browser's bookmark has to look like this:
-
- javascript:location.href='org-protocol://remember://'+ \\
- encodeURIComponent(location.href)+'/' \\
- encodeURIComponent(document.title)+'/'+ \\
- encodeURIComponent(window.getSelection())
-
-See the docs for `org-protocol-capture' for more information."
-
- (if (and (boundp 'org-stored-links)
- (or (fboundp 'org-capture))
- (org-protocol-do-capture info 'org-remember))
- (message "Org-mode not loaded."))
- nil)
-
-(defun org-protocol-capture (info)
- "Process an org-protocol://capture:// style url.
-
-The sub-protocol used to reach this function is set in
-`org-protocol-protocol-alist'.
-
-This function detects an URL, title and optional text, separated by '/'
-The location for a browser's bookmark has to look like this:
-
- javascript:location.href='org-protocol://capture://'+ \\
- encodeURIComponent(location.href)+'/' \\
- encodeURIComponent(document.title)+'/'+ \\
- encodeURIComponent(window.getSelection())
-
-By default, it uses the character `org-protocol-default-template-key',
-which should be associated with a template in `org-capture-templates'.
-But you may prepend the encoded URL with a character and a slash like so:
-
- javascript:location.href='org-protocol://capture://b/'+ ...
-
-Now template ?b will be used."
- (if (and (boundp 'org-stored-links)
- (or (fboundp 'org-capture))
- (org-protocol-do-capture info 'org-capture))
- (message "Org-mode not loaded."))
- nil)
-
-(defun org-protocol-do-capture (info capture-func)
- "Support `org-capture' and `org-remember' alike.
-CAPTURE-FUNC is either the symbol `org-remember' or `org-capture'."
- (let* ((parts (org-protocol-split-data info t))
- (template (or (and (= 1 (length (car parts))) (pop parts))
- org-protocol-default-template-key))
- (url (org-protocol-sanitize-uri (car parts)))
- (type (if (string-match "^\\([a-z]+\\):" url)
- (match-string 1 url)))
- (title(or (cadr parts) ""))
- (region (or (caddr parts) ""))
- (orglink (org-make-link-string
- url (if (string-match "[^[:space:]]" title) title url)))
- (org-capture-link-is-already-stored t) ;; avoid call to org-store-link
- remember-annotation-functions)
- (setq org-stored-links
- (cons (list url title) org-stored-links))
- (kill-new orglink)
- (org-store-link-props :type type
- :link url
- :description title
- :annotation orglink
- :initial region)
- (raise-frame)
- (funcall capture-func nil template)))
-
-
-(defun org-protocol-open-source (fname)
- "Process an org-protocol://open-source:// style url.
-
-Change a filename by mapping URLs to local filenames as set
-in `org-protocol-project-alist'.
-
-The location for a browser's bookmark should look like this:
-
- javascript:location.href='org-protocol://open-source://'+ \\
- encodeURIComponent(location.href)"
-
- ;; As we enter this function for a match on our protocol, the return value
- ;; defaults to nil.
- (let ((result nil)
- (f (org-protocol-unhex-string fname)))
- (catch 'result
- (dolist (prolist org-protocol-project-alist)
- (let* ((base-url (plist-get (cdr prolist) :base-url))
- (wsearch (regexp-quote base-url)))
-
- (when (string-match wsearch f)
- (let* ((wdir (plist-get (cdr prolist) :working-directory))
- (strip-suffix (plist-get (cdr prolist) :online-suffix))
- (add-suffix (plist-get (cdr prolist) :working-suffix))
- ;; Strip "[?#].*$" if `f' is a redirect with another
- ;; ending than strip-suffix here:
- (f1 (substring f 0 (string-match "\\([\\?#].*\\)?$" f)))
- (start-pos (+ (string-match wsearch f1) (length base-url)))
- (end-pos (string-match
- (regexp-quote strip-suffix) f1))
- ;; We have to compare redirects without suffix below:
- (f2 (concat wdir (substring f1 start-pos end-pos)))
- (the-file (concat f2 add-suffix)))
-
- ;; Note: the-file may still contain `%C3' et al here because browsers
- ;; tend to encode `&auml;' in URLs to `%25C3' - `%25' being `%'.
- ;; So the results may vary.
-
- ;; -- start redirects --
- (unless (file-exists-p the-file)
- (message "File %s does not exist.\nTesting for rewritten URLs." the-file)
- (let ((rewrites (plist-get (cdr prolist) :rewrites)))
- (when rewrites
- (message "Rewrites found: %S" rewrites)
- (mapc
- (lambda (rewrite)
- "Try to match a rewritten URL and map it to a real file."
- ;; Compare redirects without suffix:
- (if (string-match (car rewrite) f2)
- (throw 'result (concat wdir (cdr rewrite)))))
- rewrites))))
- ;; -- end of redirects --
-
- (if (file-readable-p the-file)
- (throw 'result the-file))
- (if (file-exists-p the-file)
- (message "%s: permission denied!" the-file)
- (message "%s: no such file or directory." the-file))))))
- result)))
-
-
-;;; Core functions:
-
-(defun org-protocol-check-filename-for-protocol (fname restoffiles client)
- "Detect if `org-protocol-the-protocol' and a known sub-protocol is used in fname.
-Sub-protocols are registered in `org-protocol-protocol-alist' and
-`org-protocol-protocol-alist-default'.
-This is, how the matching is done:
-
- (string-match \"protocol:/+sub-protocol:/+\" ...)
-
-protocol and sub-protocol are regexp-quoted.
-
-If a matching protocol is found, the protocol is stripped from fname and the
-result is passed to the protocols function as the only parameter. If the
-function returns nil, the filename is removed from the list of filenames
-passed from emacsclient to the server.
-If the function returns a non nil value, that value is passed to the server
-as filename."
- (let ((sub-protocols (append org-protocol-protocol-alist org-protocol-protocol-alist-default)))
- (catch 'fname
- (let ((the-protocol (concat (regexp-quote org-protocol-the-protocol) ":/+")))
- (when (string-match the-protocol fname)
- (dolist (prolist sub-protocols)
- (let ((proto (concat the-protocol (regexp-quote (plist-get (cdr prolist) :protocol)) ":/+")))
- (when (string-match proto fname)
- (let* ((func (plist-get (cdr prolist) :function))
- (greedy (plist-get (cdr prolist) :greedy))
- (splitted (split-string fname proto))
- (result (if greedy restoffiles (cadr splitted))))
- (when (plist-get (cdr prolist) :kill-client)
- (message "Greedy org-protocol handler. Killing client.")
- (server-edit))
- (when (fboundp func)
- (unless greedy
- (throw 'fname (funcall func result)))
- (funcall func result)
- (throw 'fname t))))))))
- ;; (message "fname: %s" fname)
- fname)))
-
-
-(defadvice server-visit-files (before org-protocol-detect-protocol-server activate)
- "Advice server-visit-flist to call `org-protocol-modify-filename-for-protocol'."
- (let ((flist (if org-protocol-reverse-list-of-files
- (reverse (ad-get-arg 0))
- (ad-get-arg 0)))
- (client (ad-get-arg 1)))
- (catch 'greedy
- (dolist (var flist)
- (let ((fname (expand-file-name (car var)))) ;; `\' to `/' on windows. FIXME: could this be done any better?
- (setq fname (org-protocol-check-filename-for-protocol fname (member var flist) client))
- (if (eq fname t) ;; greedy? We need the `t' return value.
- (progn
- (ad-set-arg 0 nil)
- (throw 'greedy t))
- (if (stringp fname) ;; probably filename
- (setcar var fname)
- (ad-set-arg 0 (delq var (ad-get-arg 0))))))
- ))))
-
-;;; Org specific functions:
-
-(defun org-protocol-create-for-org ()
- "Create a org-protocol project for the current file's Org-mode project.
-This works, if the file visited is part of a publishing project in
-`org-publish-project-alist'. This function calls `org-protocol-create' to do
-most of the work."
- (interactive)
- (require 'org-publish)
- (let ((all (or (org-publish-get-project-from-filename buffer-file-name))))
- (if all (org-protocol-create (cdr all))
- (message "Not in an org-project. Did mean %s?"
- (substitute-command-keys"\\[org-protocol-create]")))))
-
-
-(defun org-protocol-create(&optional project-plist)
- "Create a new org-protocol project interactively.
-An org-protocol project is an entry in `org-protocol-project-alist'
-which is used by `org-protocol-open-source'.
-Optionally use project-plist to initialize the defaults for this project. If
-project-plist is the CDR of an element in `org-publish-project-alist', reuse
-:base-directory, :html-extension and :base-extension."
- (interactive)
- (let ((working-dir (expand-file-name(or (plist-get project-plist :base-directory) default-directory)))
- (base-url "http://orgmode.org/worg/")
- (strip-suffix (or (plist-get project-plist :html-extension) ".html"))
- (working-suffix (if (plist-get project-plist :base-extension)
- (concat "." (plist-get project-plist :base-extension))
- ".org"))
-
- (worglet-buffer nil)
-
- (insert-default-directory t)
- (minibuffer-allow-text-properties nil))
-
- (setq base-url (read-string "Base URL of published content: " base-url nil base-url t))
- (if (not (string-match "\\/$" base-url))
- (setq base-url (concat base-url "/")))
-
- (setq working-dir
- (expand-file-name
- (read-directory-name "Local working directory: " working-dir working-dir t)))
- (if (not (string-match "\\/$" working-dir))
- (setq working-dir (concat working-dir "/")))
-
- (setq strip-suffix
- (read-string
- (concat "Extension to strip from published URLs ("strip-suffix"): ")
- strip-suffix nil strip-suffix t))
-
- (setq working-suffix
- (read-string
- (concat "Extension of editable files ("working-suffix"): ")
- working-suffix nil working-suffix t))
-
- (when (yes-or-no-p "Save the new org-protocol-project to your init file? ")
- (setq org-protocol-project-alist
- (cons `(,base-url . (:base-url ,base-url
- :working-directory ,working-dir
- :online-suffix ,strip-suffix
- :working-suffix ,working-suffix))
- org-protocol-project-alist))
- (customize-save-variable 'org-protocol-project-alist org-protocol-project-alist))))
-
-(provide 'org-protocol)
-
-;; arch-tag: b5c5c2ac-77cf-4a94-a649-2163dff95846
-;;; org-protocol.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-protocol.elc b/.emacs.d/org-7.4/lisp/org-protocol.elc
deleted file mode 100644
index 53d8fff..0000000
--- a/.emacs.d/org-7.4/lisp/org-protocol.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-publish.el b/.emacs.d/org-7.4/lisp/org-publish.el
deleted file mode 100644
index bb20cc6..0000000
--- a/.emacs.d/org-7.4/lisp/org-publish.el
+++ /dev/null
@@ -1,1082 +0,0 @@
-;;; org-publish.el --- publish related org-mode files as a website
-;; Copyright (C) 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: David O'Toole <dto@gnu.org>
-;; Maintainer: Carsten Dominik <carsten DOT dominik AT gmail DOT com>
-;; Keywords: hypermedia, outlines, wp
-;; Version: 7.4
-
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This program allow configurable publishing of related sets of
-;; Org-mode files as a complete website.
-;;
-;; org-publish.el can do the following:
-;;
-;; + Publish all one's org-files to HTML or PDF
-;; + Upload HTML, images, attachments and other files to a web server
-;; + Exclude selected private pages from publishing
-;; + Publish a clickable sitemap of pages
-;; + Manage local timestamps for publishing only changed files
-;; + Accept plugin functions to extend range of publishable content
-;;
-;; Documentation for publishing is in the manual.
-
-;;; Code:
-
-
-(defun org-publish-sanitize-plist (plist)
- (mapcar (lambda (x)
- (or (cdr (assq x '((:index-filename . :sitemap-filename)
- (:index-title . :sitemap-title)
- (:index-function . :sitemap-function)
- (:index-style . :sitemap-style)
- (:auto-index . :auto-sitemap))))
- x))
- plist))
-
-(eval-when-compile
- (require 'cl))
-(require 'org)
-(require 'org-exp)
-
-(eval-and-compile
- (unless (fboundp 'declare-function)
- (defmacro declare-function (fn file &optional arglist fileonly))))
-
-(defgroup org-publish nil
- "Options for publishing a set of Org-mode and related files."
- :tag "Org Publishing"
- :group 'org)
-
-(defcustom org-publish-project-alist nil
- "Association list to control publishing behavior.
-Each element of the alist is a publishing 'project.' The CAR of
-each element is a string, uniquely identifying the project. The
-CDR of each element is in one of the following forms:
-
-1. A well-formed property list with an even number of elements, alternating
- keys and values, specifying parameters for the publishing process.
-
- (:property value :property value ... )
-
-2. A meta-project definition, specifying of a list of sub-projects:
-
- (:components (\"project-1\" \"project-2\" ...))
-
-When the CDR of an element of org-publish-project-alist is in
-this second form, the elements of the list after :components are
-taken to be components of the project, which group together files
-requiring different publishing options. When you publish such a
-project with \\[org-publish], the components all publish.
-
-When a property is given a value in org-publish-project-alist, its
-setting overrides the value of the corresponding user variable
-\(if any) during publishing. However, options set within a file
-override everything.
-
-Most properties are optional, but some should always be set:
-
- :base-directory Directory containing publishing source files
- :base-extension Extension (without the dot!) of source files.
- This can be a regular expression. If not given,
- \"org\" will be used as default extension.
- :publishing-directory Directory (possibly remote) where output
- files will be published
-
-The :exclude property may be used to prevent certain files from
-being published. Its value may be a string or regexp matching
-file names you don't want to be published.
-
-The :include property may be used to include extra files. Its
-value may be a list of filenames to include. The filenames are
-considered relative to the base directory.
-
-When both :include and :exclude properties are given values, the
-exclusion step happens first.
-
-One special property controls which back-end function to use for
-publishing files in the project. This can be used to extend the
-set of file types publishable by org-publish, as well as the set
-of output formats.
-
- :publishing-function Function to publish file. The default is
- `org-publish-org-to-html', but other
- values are possible. May also be a
- list of functions, in which case
- each function in the list is invoked
- in turn.
-
-Another property allows you to insert code that prepares a
-project for publishing. For example, you could call GNU Make on a
-certain makefile, to ensure published files are built up to date.
-
- :preparation-function Function to be called before publishing
- this project. This may also be a list
- of functions.
- :completion-function Function to be called after publishing
- this project. This may also be a list
- of functions.
-
-Some properties control details of the Org publishing process,
-and are equivalent to the corresponding user variables listed in
-the right column. See the documentation for those variables to
-learn more about their use and default values.
-
- :language `org-export-default-language'
- :headline-levels `org-export-headline-levels'
- :section-numbers `org-export-with-section-numbers'
- :table-of-contents `org-export-with-toc'
- :emphasize `org-export-with-emphasize'
- :sub-superscript `org-export-with-sub-superscripts'
- :TeX-macros `org-export-with-TeX-macros'
- :fixed-width `org-export-with-fixed-width'
- :tables `org-export-with-tables'
- :table-auto-headline `org-export-highlight-first-table-line'
- :style `org-export-html-style'
- :convert-org-links `org-export-html-link-org-files-as-html'
- :inline-images `org-export-html-inline-images'
- :expand-quoted-html `org-export-html-expand'
- :timestamp `org-export-html-with-timestamp'
- :publishing-directory `org-export-publishing-directory'
- :preamble `org-export-html-preamble'
- :postamble `org-export-html-postamble'
- :auto-preamble `org-export-html-auto-preamble'
- :auto-postamble `org-export-html-auto-postamble'
- :author `user-full-name'
- :email `user-mail-address'
-
-The following properties may be used to control publishing of a
-sitemap of files or summary page for a given project.
-
- :auto-sitemap Whether to publish a sitemap during
- `org-publish-current-project' or `org-publish-all'.
- :sitemap-filename Filename for output of sitemap. Defaults
- to 'sitemap.org' (which becomes 'sitemap.html').
- :sitemap-title Title of sitemap page. Defaults to name of file.
- :sitemap-function Plugin function to use for generation of sitemap.
- Defaults to `org-publish-org-sitemap', which
- generates a plain list of links to all files
- in the project.
- :sitemap-style Can be `list' (sitemap is just an itemized list
- of the titles of the files involved) or
- `tree' (the directory structure of the source
- files is reflected in the sitemap). Defaults to
- `tree'.
-
- If you create a sitemap file, adjust the sorting like this:
-
- :sitemap-sort-folders Where folders should appear in the sitemap.
- Set this to `first' (default) or `last' to
- display folders first or last, respectively.
- Any other value will mix files and folders.
- :sitemap-alphabetically The site map is normally sorted alphabetically.
- Set this explicitly to nil to turn off sorting.
- :sitemap-ignore-case Should sorting be case-sensitive? Default nil.
-
-The following properties control the creation of a concept index.
-
- :makeindex Create a concept index.
-
-Other properties affecting publication.
-
- :body-only Set this to 't' to publish only the body of the
- documents, excluding everything outside and
- including the <body> tags in HTML, or
- \begin{document}..\end{document} in LaTeX."
- :group 'org-publish
- :type 'alist)
-
-(defcustom org-publish-use-timestamps-flag t
- "Non-nil means use timestamp checking to publish only changed files.
-When nil, do no timestamp checking and always publish all files."
- :group 'org-publish
- :type 'boolean)
-
-(defcustom org-publish-timestamp-directory (convert-standard-filename
- "~/.org-timestamps/")
- "Name of directory in which to store publishing timestamps."
- :group 'org-publish
- :type 'directory)
-
-(defcustom org-publish-list-skipped-files t
- "Non-nil means show message about files *not* published."
- :group 'org-publish
- :type 'boolean)
-
-(defcustom org-publish-before-export-hook nil
- "Hook run before export on the Org file.
-The hook may modify the file in arbitrary ways before publishing happens.
-The original version of the buffer will be restored after publishing."
- :group 'org-publish
- :type 'hook)
-
-(defcustom org-publish-after-export-hook nil
- "Hook run after export on the exported buffer.
-Any changes made by this hook will be saved."
- :group 'org-publish
- :type 'hook)
-
-(defcustom org-publish-sitemap-sort-alphabetically t
- "Should sitemaps be sorted alphabetically by default?
-
-You can overwrite this default per project in your
-`org-publish-project-alist', using `:sitemap-alphabetically'."
- :group 'org-publish
- :type 'boolean)
-
-(defcustom org-publish-sitemap-sort-folders 'first
- "A symbol, denoting if folders are sorted first in sitemaps.
-Possible values are `first', `last', and nil.
-If `first', folders will be sorted before files.
-If `last', folders are sorted to the end after the files.
-Any other value will not mix files and folders.
-
-You can overwrite this default per project in your
-`org-publish-project-alist', using `:sitemap-sort-folders'."
- :group 'org-publish
- :type 'symbol)
-
-(defcustom org-publish-sitemap-sort-ignore-case nil
- "Sort sitemaps case insensitively by default?
-
-You can overwrite this default per project in your
-`org-publish-project-alist', using `:sitemap-ignore-case'."
- :group 'org-publish
- :type 'boolean)
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Timestamp-related functions
-
-(defun org-publish-timestamp-filename (filename &optional pub-dir pub-func)
- "Return path to timestamp file for filename FILENAME."
- (setq filename (concat filename "::" (or pub-dir "") "::"
- (format "%s" (or pub-func ""))))
- (concat "X" (if (fboundp 'sha1) (sha1 filename) (md5 filename))))
-
-(defun org-publish-needed-p (filename &optional pub-dir pub-func true-pub-dir)
- "Return t if FILENAME should be published in PUB-DIR using PUB-FUNC.
-TRUE-PUB-DIR is where the file will truly end up. Currently we are not using
-this - maybe it can eventually be used to check if the file is present at
-the target location, and how old it is. Right ow we cannot do this, because
-we do not know under what file name the file will be stored - the publishing
-function can still decide about that independently."
- (let ((rtn
- (if org-publish-use-timestamps-flag
- (org-publish-cache-file-needs-publishing
- filename pub-dir pub-func)
- ;; don't use timestamps, always return t
- t)))
- (if rtn
- (message "Publishing file %s using `%s'" filename pub-func)
- (when org-publish-list-skipped-files
- (message "Skipping unmodified file %s" filename)))
- rtn))
-
-(defun org-publish-update-timestamp (filename &optional pub-dir pub-func)
- "Update publishing timestamp for file FILENAME.
-If there is no timestamp, create one."
- (let ((key (org-publish-timestamp-filename filename pub-dir pub-func))
- (stamp (org-publish-cache-ctime-of-src filename)))
- (org-publish-cache-set key stamp)))
-
-(defun org-publish-remove-all-timestamps ()
- "Remove all files in the timestamp directory."
- (let ((dir org-publish-timestamp-directory)
- files)
- (when (and (file-exists-p dir)
- (file-directory-p dir))
- (mapc 'delete-file (directory-files dir 'full "[^.]\\'"))
- (org-publish-reset-cache))))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;
-
-(defvar org-publish-initial-buffer nil
- "The buffer `org-publish' has been called from.")
-(defvar org-publish-temp-files nil
- "Temporary list of files to be published.")
-
-;; Here, so you find the variable right before it's used the first time:
-(defvar org-publish-cache nil
- "This will cache timestamps and titles for files in publishing projects.
-Blocks could hash sha1 values here.")
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Compatibility aliases
-
-;; Delete-dups is not in Emacs <22
-(if (fboundp 'delete-dups)
- (defalias 'org-publish-delete-dups 'delete-dups)
- (defun org-publish-delete-dups (list)
- "Destructively remove `equal' duplicates from LIST.
-Store the result in LIST and return it. LIST must be a proper list.
-Of several `equal' occurrences of an element in LIST, the first
-one is kept.
-
-This is a compatibility function for Emacsen without `delete-dups'."
- ;; Code from `subr.el' in Emacs 22:
- (let ((tail list))
- (while tail
- (setcdr tail (delete (car tail) (cdr tail)))
- (setq tail (cdr tail))))
- list))
-
-(declare-function org-publish-delete-dups "org-publish" (list))
-(declare-function find-lisp-find-files "find-lisp" (directory regexp))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Getting project information out of org-publish-project-alist
-
-(defun org-publish-expand-projects (projects-alist)
- "Expand projects in PROJECTS-ALIST.
-This splices all the components into the list."
- (let ((rest projects-alist) rtn p components)
- (while (setq p (pop rest))
- (if (setq components (plist-get (cdr p) :components))
- (setq rest (append
- (mapcar (lambda (x) (assoc x org-publish-project-alist))
- components)
- rest))
- (push p rtn)))
- (nreverse (org-publish-delete-dups (delq nil rtn)))))
-
-
-(defvar sitemap-alphabetically)
-(defvar sitemap-sort-folders)
-(defvar sitemap-ignore-case)
-(defvar sitemap-requested)
-(defun org-publish-compare-directory-files (a b)
- "Predicate for `sort', that sorts folders-first/last and alphabetically."
- (let ((retval t))
- (when (or sitemap-alphabetically sitemap-sort-folders)
- ;; First we sort alphabetically:
- (when sitemap-alphabetically
- (let* ((adir (file-directory-p a))
- (aorg (and (string-match "\\.org$" a) (not adir)))
- (bdir (file-directory-p b))
- (borg (and (string-match "\\.org$" b) (not bdir)))
- (A (if aorg
- (concat (file-name-directory a)
- (org-publish-find-title a)) a))
- (B (if borg
- (concat (file-name-directory b)
- (org-publish-find-title b)) b)))
- (setq retval (if sitemap-ignore-case
- (not (string-lessp (upcase B) (upcase A)))
- (not (string-lessp B A))))))
-
- ;; Directory-wise wins:
- (when sitemap-sort-folders
- ;; a is directory, b not:
- (cond
- ((and (file-directory-p a) (not (file-directory-p b)))
- (setq retval (equal sitemap-sort-folders 'first)))
- ;; a is not a directory, but b is:
- ((and (not (file-directory-p a)) (file-directory-p b))
- (setq retval (equal sitemap-sort-folders 'last))))))
- retval))
-
-(defun org-publish-get-base-files-1 (base-dir &optional recurse match skip-file skip-dir)
- "Set `org-publish-temp-files' with files from BASE-DIR directory.
-If RECURSE is non-nil, check BASE-DIR recursively. If MATCH is
-non-nil, restrict this list to the files matching the regexp
-MATCH. If SKIP-FILE is non-nil, skip file matching the regexp
-SKIP-FILE. If SKIP-DIR is non-nil, don't check directories
-matching the regexp SKIP-DIR when recursing through BASE-DIR."
- (mapc (lambda (f)
- (let ((fd-p (file-directory-p f))
- (fnd (file-name-nondirectory f)))
- (if (and fd-p recurse
- (not (string-match "^\\.+$" fnd))
- (if skip-dir (not (string-match skip-dir fnd)) t))
- (org-publish-get-base-files-1 f recurse match skip-file skip-dir)
- (unless (or fd-p ;; this is a directory
- (and skip-file (string-match skip-file fnd))
- (not (file-exists-p (file-truename f)))
- (not (string-match match fnd)))
-
- (pushnew f org-publish-temp-files)))))
- (if sitemap-requested
- (sort (directory-files base-dir t (unless recurse match))
- 'org-publish-compare-directory-files)
- (directory-files base-dir t (unless recurse match)))))
-
-(defun org-publish-get-base-files (project &optional exclude-regexp)
- "Return a list of all files in PROJECT.
-If EXCLUDE-REGEXP is set, this will be used to filter out
-matching filenames."
- (let* ((project-plist (cdr project))
- (base-dir (file-name-as-directory
- (plist-get project-plist :base-directory)))
- (include-list (plist-get project-plist :include))
- (recurse (plist-get project-plist :recursive))
- (extension (or (plist-get project-plist :base-extension) "org"))
- ;; sitemap-... variables are dynamically scoped for
- ;; org-publish-compare-directory-files:
- (sitemap-requested
- (plist-get project-plist :auto-sitemap))
- (sitemap-sort-folders
- (if (plist-member project-plist :sitemap-sort-folders)
- (plist-get project-plist :sitemap-sort-folders)
- org-publish-sitemap-sort-folders))
- (sitemap-alphabetically
- (if (plist-member project-plist :sitemap-alphabetically)
- (plist-get project-plist :sitemap-alphabetically)
- org-publish-sitemap-sort-alphabetically))
- (sitemap-ignore-case
- (if (plist-member project-plist :sitemap-ignore-case)
- (plist-get project-plist :sitemap-ignore-case)
- org-publish-sitemap-sort-ignore-case))
- (match (if (eq extension 'any)
- "^[^\\.]"
- (concat "^[^\\.].*\\.\\(" extension "\\)$"))))
- ;; Make sure sitemap-sort-folders' has an accepted value
- (unless (memq sitemap-sort-folders '(first last))
- (setq sitemap-sort-folders nil))
-
- (setq org-publish-temp-files nil)
- (org-publish-get-base-files-1 base-dir recurse match
- ;; FIXME distinguish exclude regexp
- ;; for skip-file and skip-dir?
- exclude-regexp exclude-regexp)
- (mapc (lambda (f)
- (pushnew
- (expand-file-name (concat base-dir f))
- org-publish-temp-files))
- include-list)
- org-publish-temp-files))
-
-(defun org-publish-get-project-from-filename (filename &optional up)
- "Return the project that FILENAME belongs to."
- (let* ((filename (expand-file-name filename))
- project-name)
-
- (catch 'p-found
- (dolist (prj org-publish-project-alist)
- (unless (plist-get (cdr prj) :components)
- ;; [[info:org:Selecting%20files]] shows how this is supposed to work:
- (let* ((r (plist-get (cdr prj) :recursive))
- (b (expand-file-name (file-name-as-directory
- (plist-get (cdr prj) :base-directory))))
- (x (or (plist-get (cdr prj) :base-extension) "org"))
- (e (plist-get (cdr prj) :exclude))
- (i (plist-get (cdr prj) :include))
- (xm (concat "^" b (if r ".+" "[^/]+") "\\.\\(" x "\\)$")))
- (when (or
- (and
- i
- (member filename
- (mapcar
- (lambda (file) (expand-file-name file b))
- i)))
- (and
- (not (and e (string-match e filename)))
- (string-match xm filename)))
- (setq project-name (car prj))
- (throw 'p-found project-name))))))
- (when up
- (dolist (prj org-publish-project-alist)
- (if (member project-name (plist-get (cdr prj) :components))
- (setq project-name (car prj)))))
- (assoc project-name org-publish-project-alist)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Pluggable publishing back-end functions
-
-(defun org-publish-org-to (format plist filename pub-dir)
- "Publish an org file to FORMAT.
-PLIST is the property list for the given project.
-FILENAME is the filename of the org file to be published.
-PUB-DIR is the publishing directory."
- (require 'org)
- (unless (file-exists-p pub-dir)
- (make-directory pub-dir t))
- (let ((visiting (find-buffer-visiting filename)))
- (save-excursion
- (switch-to-buffer (or visiting (find-file filename)))
- (let* ((plist (cons :buffer-will-be-killed (cons t plist)))
- (init-buf (current-buffer))
- (init-point (point))
- (init-buf-string (buffer-string))
- export-buf-or-file)
- ;; run hooks before exporting
- (run-hooks 'org-publish-before-export-hook)
- ;; export the possibly modified buffer
- (setq export-buf-or-file
- (funcall (intern (concat "org-export-as-" format))
- (plist-get plist :headline-levels)
- nil plist nil
- (plist-get plist :body-only)
- pub-dir))
- (when (and (bufferp export-buf-or-file)
- (buffer-live-p export-buf-or-file))
- (set-buffer export-buf-or-file)
- ;; run hooks after export and save export
- (progn (run-hooks 'org-publish-after-export-hook)
- (if (buffer-modified-p) (save-buffer)))
- (kill-buffer export-buf-or-file))
- ;; maybe restore buffer's content
- (set-buffer init-buf)
- (when (buffer-modified-p init-buf)
- (erase-buffer)
- (insert init-buf-string)
- (save-buffer)
- (goto-char init-point))
- (unless visiting
- (kill-buffer init-buf))))))
-
-(defmacro org-publish-with-aux-preprocess-maybe (&rest body)
- "Execute BODY with a modified hook to preprocess for index."
- `(let ((org-export-preprocess-after-headline-targets-hook
- (if (plist-get project-plist :makeindex)
- (cons 'org-publish-aux-preprocess
- org-export-preprocess-after-headline-targets-hook)
- org-export-preprocess-after-headline-targets-hook)))
- ,@body))
-
-(defvar project-plist)
-(defun org-publish-org-to-latex (plist filename pub-dir)
- "Publish an org file to LaTeX.
-See `org-publish-org-to' to the list of arguments."
- (org-publish-with-aux-preprocess-maybe
- (org-publish-org-to "latex" plist filename pub-dir)))
-
-(defun org-publish-org-to-pdf (plist filename pub-dir)
- "Publish an org file to PDF (via LaTeX).
-See `org-publish-org-to' to the list of arguments."
- (org-publish-with-aux-preprocess-maybe
- (org-publish-org-to "pdf" plist filename pub-dir)))
-
-(defun org-publish-org-to-html (plist filename pub-dir)
- "Publish an org file to HTML.
-See `org-publish-org-to' to the list of arguments."
- (org-publish-with-aux-preprocess-maybe
- (org-publish-org-to "html" plist filename pub-dir)))
-
-(defun org-publish-org-to-org (plist filename pub-dir)
- "Publish an org file to HTML.
-See `org-publish-org-to' to the list of arguments."
- (org-publish-org-to "org" plist filename pub-dir))
-
-(defun org-publish-org-to-ascii (plist filename pub-dir)
- "Publish an org file to ASCII.
-See `org-publish-org-to' to the list of arguments."
- (org-publish-with-aux-preprocess-maybe
- (org-publish-org-to "ascii" plist filename pub-dir)))
-
-(defun org-publish-org-to-latin1 (plist filename pub-dir)
- "Publish an org file to Latin-1.
-See `org-publish-org-to' to the list of arguments."
- (org-publish-with-aux-preprocess-maybe
- (org-publish-org-to "latin1" plist filename pub-dir)))
-
-(defun org-publish-org-to-utf8 (plist filename pub-dir)
- "Publish an org file to UTF-8.
-See `org-publish-org-to' to the list of arguments."
- (org-publish-with-aux-preprocess-maybe
- (org-publish-org-to "utf8" plist filename pub-dir)))
-
-(defun org-publish-attachment (plist filename pub-dir)
- "Publish a file with no transformation of any kind.
-See `org-publish-org-to' to the list of arguments."
- ;; make sure eshell/cp code is loaded
- (unless (file-directory-p pub-dir)
- (make-directory pub-dir t))
- (or (equal (expand-file-name (file-name-directory filename))
- (file-name-as-directory (expand-file-name pub-dir)))
- (copy-file filename
- (expand-file-name (file-name-nondirectory filename) pub-dir)
- t)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Publishing files, sets of files, and indices
-
-(defun org-publish-file (filename &optional project no-cache)
- "Publish file FILENAME from PROJECT.
-If NO-CACHE is not nil, do not initialize org-publish-cache and
-write it to disk. This is needed, since this function is used to
-publish single files, when entire projects are published.
-See `org-publish-projects'."
- (let* ((project
- (or project
- (or (org-publish-get-project-from-filename filename)
- (error "File %s not part of any known project"
- (abbreviate-file-name filename)))))
- (project-plist (cdr project))
- (ftname (expand-file-name filename))
- (publishing-function
- (or (plist-get project-plist :publishing-function)
- 'org-publish-org-to-html))
- (base-dir
- (file-name-as-directory
- (expand-file-name
- (or (plist-get project-plist :base-directory)
- (error "Project %s does not have :base-directory defined"
- (car project))))))
- (pub-dir
- (file-name-as-directory
- (file-truename
- (or (plist-get project-plist :publishing-directory)
- (error "Project %s does not have :publishing-directory defined"
- (car project))))))
- tmp-pub-dir)
-
- (unless no-cache
- (org-publish-initialize-cache (car project)))
-
- (setq tmp-pub-dir
- (file-name-directory
- (concat pub-dir
- (and (string-match (regexp-quote base-dir) ftname)
- (substring ftname (match-end 0))))))
- (if (listp publishing-function)
- ;; allow chain of publishing functions
- (mapc (lambda (f)
- (when (org-publish-needed-p filename pub-dir f tmp-pub-dir)
- (funcall f project-plist filename tmp-pub-dir)
- (org-publish-update-timestamp filename pub-dir f)))
- publishing-function)
- (when (org-publish-needed-p filename pub-dir publishing-function
- tmp-pub-dir)
- (funcall publishing-function project-plist filename tmp-pub-dir)
- (org-publish-update-timestamp
- filename pub-dir publishing-function)))
- (unless no-cache (org-publish-write-cache-file))))
-
-(defun org-publish-projects (projects)
- "Publish all files belonging to the PROJECTS alist.
-If :auto-sitemap is set, publish the sitemap too.
-If :makeindex is set, also produce a file theindex.org."
- (mapc
- (lambda (project)
- ;; Each project uses it's own cache file:
- (org-publish-initialize-cache (car project))
- (let*
- ((project-plist (cdr project))
- (exclude-regexp (plist-get project-plist :exclude))
- (sitemap-p (plist-get project-plist :auto-sitemap))
- (sitemap-filename (or (plist-get project-plist :sitemap-filename)
- "sitemap.org"))
- (sitemap-function (or (plist-get project-plist :sitemap-function)
- 'org-publish-org-sitemap))
- (preparation-function (plist-get project-plist :preparation-function))
- (completion-function (plist-get project-plist :completion-function))
- (files (org-publish-get-base-files project exclude-regexp)) file)
- (when preparation-function (run-hooks 'preparation-function))
- (if sitemap-p (funcall sitemap-function project sitemap-filename))
- (while (setq file (pop files))
- (org-publish-file file project t))
- (when (plist-get project-plist :makeindex)
- (org-publish-index-generate-theindex.inc
- (plist-get project-plist :base-directory))
- (org-publish-file (expand-file-name
- "theindex.org"
- (plist-get project-plist :base-directory))
- project t))
- (when completion-function (run-hooks 'completion-function))
- (org-publish-write-cache-file)))
- (org-publish-expand-projects projects)))
-
-(defun org-publish-org-sitemap (project &optional sitemap-filename)
- "Create a sitemap of pages in set defined by PROJECT.
-Optionally set the filename of the sitemap with SITEMAP-FILENAME.
-Default for SITEMAP-FILENAME is 'sitemap.org'."
- (let* ((project-plist (cdr project))
- (dir (file-name-as-directory
- (plist-get project-plist :base-directory)))
- (localdir (file-name-directory dir))
- (indent-str (make-string 2 ?\ ))
- (exclude-regexp (plist-get project-plist :exclude))
- (files (nreverse (org-publish-get-base-files project exclude-regexp)))
- (sitemap-filename (concat dir (or sitemap-filename "sitemap.org")))
- (sitemap-title (or (plist-get project-plist :sitemap-title)
- (concat "Sitemap for project " (car project))))
- (sitemap-style (or (plist-get project-plist :sitemap-style)
- 'tree))
- (visiting (find-buffer-visiting sitemap-filename))
- (ifn (file-name-nondirectory sitemap-filename))
- file sitemap-buffer)
- (with-current-buffer (setq sitemap-buffer
- (or visiting (find-file sitemap-filename)))
- (erase-buffer)
- (insert (concat "#+TITLE: " sitemap-title "\n\n"))
- (while (setq file (pop files))
- (let ((fn (file-name-nondirectory file))
- (link (file-relative-name file dir))
- (oldlocal localdir))
- ;; sitemap shouldn't list itself
- (unless (equal (file-truename sitemap-filename)
- (file-truename file))
- (if (eq sitemap-style 'list)
- (message "Generating list-style sitemap for %s" sitemap-title)
- (message "Generating tree-style sitemap for %s" sitemap-title)
- (setq localdir (concat (file-name-as-directory dir)
- (file-name-directory link)))
- (unless (string= localdir oldlocal)
- (if (string= localdir dir)
- (setq indent-str (make-string 2 ?\ ))
- (let ((subdirs
- (split-string
- (directory-file-name
- (file-name-directory
- (file-relative-name localdir dir))) "/"))
- (subdir "")
- (old-subdirs (split-string
- (file-relative-name oldlocal dir) "/")))
- (setq indent-str (make-string 2 ?\ ))
- (while (string= (car old-subdirs) (car subdirs))
- (setq indent-str (concat indent-str (make-string 2 ?\ )))
- (pop old-subdirs)
- (pop subdirs))
- (dolist (d subdirs)
- (setq subdir (concat subdir d "/"))
- (insert (concat indent-str " + " d "\n"))
- (setq indent-str (make-string
- (+ (length indent-str) 2) ?\ )))))))
- ;; This is common to 'flat and 'tree
- (insert (concat indent-str " + [[file:" link "]["
- (org-publish-find-title file)
- "]]\n")))))
- (save-buffer))
- (or visiting (kill-buffer sitemap-buffer))))
-
-(defun org-publish-find-title (file)
- "Find the title of FILE in project."
- (or
- (org-publish-cache-get-file-property file :title nil t)
- (let* ((visiting (find-buffer-visiting file))
- (buffer (or visiting (find-file-noselect file)))
- title)
- (with-current-buffer buffer
- (let* ((opt-plist (org-combine-plists (org-default-export-plist)
- (org-infile-export-plist))))
- (setq title
- (or (plist-get opt-plist :title)
- (and (not
- (plist-get opt-plist :skip-before-1st-heading))
- (org-export-grab-title-from-buffer))
- (file-name-nondirectory (file-name-sans-extension file))))))
- (unless visiting
- (kill-buffer buffer))
- (org-publish-cache-set-file-property file :title title)
- title)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Interactive publishing functions
-
-;;;###autoload
-(defalias 'org-publish-project 'org-publish)
-
-;;;###autoload
-(defun org-publish (project &optional force)
- "Publish PROJECT."
- (interactive
- (list
- (assoc (org-icompleting-read
- "Publish project: "
- org-publish-project-alist nil t)
- org-publish-project-alist)
- current-prefix-arg))
- (setq org-publish-initial-buffer (current-buffer))
- (save-window-excursion
- (let* ((org-publish-use-timestamps-flag
- (if force nil org-publish-use-timestamps-flag)))
- (org-publish-projects
- (if (stringp project)
- ;; If this function is called in batch mode,
- ;; project is still a string here.
- (list (assoc project org-publish-project-alist))
- (list project))))))
-
-;;;###autoload
-(defun org-publish-all (&optional force)
- "Publish all projects.
-With prefix argument, remove all files in the timestamp
-directory and force publishing all files."
- (interactive "P")
- (when force
- (org-publish-remove-all-timestamps))
- (save-window-excursion
- (let ((org-publish-use-timestamps-flag
- (if force nil org-publish-use-timestamps-flag)))
- (org-publish-projects org-publish-project-alist))))
-
-
-;;;###autoload
-(defun org-publish-current-file (&optional force)
- "Publish the current file.
-With prefix argument, force publish the file."
- (interactive "P")
- (save-window-excursion
- (let ((org-publish-use-timestamps-flag
- (if force nil org-publish-use-timestamps-flag)))
- (org-publish-file (buffer-file-name)))))
-
-;;;###autoload
-(defun org-publish-current-project (&optional force)
- "Publish the project associated with the current file.
-With a prefix argument, force publishing of all files in
-the project."
- (interactive "P")
- (save-window-excursion
- (let ((project (org-publish-get-project-from-filename (buffer-file-name) 'up))
- (org-publish-use-timestamps-flag
- (if force nil org-publish-use-timestamps-flag)))
- (if (not project)
- (error "File %s is not part of any known project" (buffer-file-name)))
- ;; FIXME: force is not used here?
- (org-publish project))))
-
-
-;;; Index generation
-
-(defvar backend) ; dynamically scoped
-(defun org-publish-aux-preprocess ()
- "Find index entries and write them to an .orgx file."
- (let ((case-fold-search t)
- entry index target)
- (goto-char (point-min))
- (while
- (and
- (re-search-forward "^[ \t]*#\\+index:[ \t]*\\(.*?\\)[ \t]*$" nil t)
- (> (match-end 1) (match-beginning 1)))
- (setq entry (match-string 1))
- (when (eq backend 'latex)
- (replace-match (format "\\index{%s}" entry) t t))
- (save-excursion
- (ignore-errors (org-back-to-heading t))
- (setq target (get-text-property (point) 'target))
- (setq target (or (cdr (assoc target org-export-preferred-target-alist))
- (cdr (assoc target org-export-id-target-alist))
- target ""))
- (push (cons entry target) index)))
- (with-temp-file
- (concat (file-name-sans-extension org-current-export-file) ".orgx")
- (dolist (entry (nreverse index))
- (insert (format "INDEX: (%s) %s\n" (cdr entry) (car entry)))))))
-
-(defun org-publish-index-generate-theindex.inc (directory)
- "Generate the index from all .orgx files in the current directory and below."
- (require 'find-lisp)
- (let* ((fulldir (file-name-as-directory
- (expand-file-name directory)))
- (full-files (find-lisp-find-files directory "\\.orgx\\'"))
- (re (concat "\\`" fulldir))
- (files (mapcar (lambda (f) (if (string-match re f)
- (substring f (match-end 0))
- f))
- full-files))
- (default-directory directory)
- index origfile buf target entry ibuffer
- main last-main letter last-letter file sub link tgext)
- ;; `files' contains the list of relative file names
- (dolist (file files)
- (setq origfile (substring file 0 -1))
- (setq buf (find-file-noselect file))
- (with-current-buffer buf
- (goto-char (point-min))
- (while (re-search-forward "^INDEX: (\\(.*?\\)) \\(.*\\)" nil t)
- (setq target (match-string 1)
- entry (match-string 2))
- (push (list entry origfile target) index)))
- (kill-buffer buf))
- (setq index (sort index (lambda (a b) (string< (downcase (car a))
- (downcase (car b))))))
- (setq ibuffer (find-file-noselect (expand-file-name "theindex.inc" directory)))
- (with-current-buffer ibuffer
- (erase-buffer)
- (insert "* Index\n")
- (setq last-letter nil)
- (dolist (idx index)
- (setq entry (car idx) file (nth 1 idx) target (nth 2 idx))
- (if (and (stringp target) (string-match "\\S-" target))
- (setq tgext (concat "::#" target))
- (setq tgext ""))
- (setq letter (upcase (substring entry 0 1)))
- (when (not (equal letter last-letter))
- (insert "** " letter "\n")
- (setq last-letter letter))
- (if (string-match "!" entry)
- (setq main (substring entry 0 (match-beginning 0))
- sub (substring entry (match-end 0)))
- (setq main nil sub nil last-main nil))
- (when (and main (not (equal main last-main)))
- (insert " - " main "\n")
- (setq last-main main))
- (setq link (concat "[[file:" file tgext "]"
- "[" (or sub entry) "]]"))
- (if (and main sub)
- (insert " - " link "\n")
- (insert " - " link "\n")))
- (save-buffer))
- (kill-buffer ibuffer)
-
- (let ((index-file (expand-file-name "theindex.org" directory)))
- (unless (file-exists-p index-file)
- (setq ibuffer (find-file-noselect index-file))
- (with-current-buffer ibuffer
- (erase-buffer)
- (insert "\n\n#+include: \"theindex.inc\"\n\n")
- (save-buffer))
- (kill-buffer ibuffer)))))
-
-
-;; Caching functions:
-
-(defun org-publish-write-cache-file (&optional free-cache)
- "Write `org-publish-cache' to file.
-If FREE-CACHE, empty the cache."
- (unless org-publish-cache
- (error "%s" "`org-publish-write-cache-file' called, but no cache present"))
-
- (let ((cache-file (org-publish-cache-get ":cache-file:")))
- (unless cache-file
- (error
- "%s" "Cannot find cache-file name in `org-publish-write-cache-file'"))
- (with-temp-file cache-file
- (let ((print-level nil)
- (print-length nil))
- (insert "(setq org-publish-cache (make-hash-table :test 'equal :weakness nil :size 100))\n")
- (maphash (lambda (k v)
- (insert
- (format (concat "(puthash %S "
- (if (or (listp v) (symbolp v))
- "'" "")
- "%S org-publish-cache)\n") k v)))
- org-publish-cache)))
- (when free-cache (org-publish-reset-cache))))
-
-(defun org-publish-initialize-cache (project-name)
- "Initialize the projects cache if not initialized yet and return it."
-
- (unless project-name
- (error "%s%s" "Cannot initialize `org-publish-cache' without projects name"
- " in `org-publish-initialize-cache'"))
-
- (unless (file-exists-p org-publish-timestamp-directory)
- (make-directory org-publish-timestamp-directory t))
- (if (not (file-directory-p org-publish-timestamp-directory))
- (error "Org publish timestamp: %s is not a directory"
- org-publish-timestamp-directory))
-
- (unless (and org-publish-cache
- (string= (org-publish-cache-get ":project:") project-name))
- (let* ((cache-file (concat
- (expand-file-name org-publish-timestamp-directory)
- project-name
- ".cache"))
- (cexists (file-exists-p cache-file)))
-
- (when org-publish-cache
- (org-publish-reset-cache))
-
- (if cexists
- (load-file cache-file)
- (setq org-publish-cache
- (make-hash-table :test 'equal :weakness nil :size 100))
- (org-publish-cache-set ":project:" project-name)
- (org-publish-cache-set ":cache-file:" cache-file))
- (unless cexists (org-publish-write-cache-file nil))))
- org-publish-cache)
-
-(defun org-publish-reset-cache ()
- "Empty org-publish-cache and reset it nil."
- (message "%s" "Resetting org-publish-cache")
- (if (hash-table-p org-publish-cache)
- (clrhash org-publish-cache))
- (setq org-publish-cache nil))
-
-(defun org-publish-cache-file-needs-publishing (filename &optional pub-dir pub-func)
- "Check the timestamp of the last publishing of FILENAME.
-Return `t', if the file needs publishing"
- (unless org-publish-cache
- (error "%s" "`org-publish-cache-file-needs-publishing' called, but no cache present"))
- (let* ((key (org-publish-timestamp-filename filename pub-dir pub-func))
- (pstamp (org-publish-cache-get key)))
- (if (null pstamp)
- t
- (let ((ctime (org-publish-cache-ctime-of-src filename)))
- (< pstamp ctime)))))
-
-(defun org-publish-cache-set-file-property (filename property value &optional project-name)
- "Set the VALUE for a PROPERTY of file FILENAME in publishing cache to VALUE.
-Use cache file of PROJECT-NAME. If the entry does not exist, it will be
-created. Return VALUE."
- ;; Evtl. load the requested cache file:
- (if project-name (org-publish-initialize-cache project-name))
- (let ((pl (org-publish-cache-get filename)))
- (if pl
- (progn
- (plist-put pl property value)
- value)
- (org-publish-cache-get-file-property
- filename property value nil project-name))))
-
-(defun org-publish-cache-get-file-property
- (filename property &optional default no-create project-name)
- "Return the value for a PROPERTY of file FILENAME in publishing cache.
-Use cache file of PROJECT-NAME. Return the value of that PROPERTY or
-DEFAULT, if the value does not yet exist.
-If the entry will be created, unless NO-CREATE is not nil."
- ;; Evtl. load the requested cache file:
- (if project-name (org-publish-initialize-cache project-name))
- (let ((pl (org-publish-cache-get filename))
- (retval nil))
- (if pl
- (if (plist-member pl property)
- (setq retval (plist-get pl property))
- (setq retval default))
- ;; no pl yet:
- (unless no-create
- (org-publish-cache-set filename (list property default)))
- (setq retval default))
- retval))
-
-(defun org-publish-cache-get (key)
- "Return the value stored in `org-publish-cache' for key KEY.
-Returns nil, if no value or nil is found, or the cache does not
-exist."
- (unless org-publish-cache
- (error "%s" "`org-publish-cache-get' called, but no cache present"))
- (gethash key org-publish-cache))
-
-(defun org-publish-cache-set (key value)
- "Store KEY VALUE pair in `org-publish-cache'.
-Returns value on success, else nil."
- (unless org-publish-cache
- (error "%s" "`org-publish-cache-set' called, but no cache present"))
- (puthash key value org-publish-cache))
-
-(defun org-publish-cache-ctime-of-src (filename)
- "Get the files ctime as integer."
- (let ((src-attr (file-attributes filename)))
- (+
- (lsh (car (nth 5 src-attr)) 16)
- (cadr (nth 5 src-attr)))))
-
-
-
-(provide 'org-publish)
-
-;; arch-tag: 72807f3c-8af0-4a6b-8dca-c3376eb25adb
-
-;;; org-publish.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-publish.elc b/.emacs.d/org-7.4/lisp/org-publish.elc
deleted file mode 100644
index 5d7dd48..0000000
--- a/.emacs.d/org-7.4/lisp/org-publish.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-remember.el b/.emacs.d/org-7.4/lisp/org-remember.el
deleted file mode 100644
index c6e21ae..0000000
--- a/.emacs.d/org-7.4/lisp/org-remember.el
+++ /dev/null
@@ -1,1155 +0,0 @@
-;;; org-remember.el --- Fast note taking in Org-mode
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file contains the system to take fast notes with Org-mode.
-;; This system is used together with John Wiegley's `remember.el'.
-
-;;; Code:
-
-(eval-when-compile
- (require 'cl))
-(require 'org)
-(require 'org-datetree)
-
-(declare-function remember-mode "remember" ())
-(declare-function remember "remember" (&optional initial))
-(declare-function remember-buffer-desc "remember" ())
-(declare-function remember-finalize "remember" ())
-(defvar remember-save-after-remembering)
-(defvar remember-register)
-(defvar remember-buffer)
-(defvar remember-handler-functions)
-(defvar remember-annotation-functions)
-(defvar org-clock-heading)
-(defvar org-clock-heading-for-remember)
-
-(defgroup org-remember nil
- "Options concerning interaction with remember.el."
- :tag "Org Remember"
- :group 'org)
-
-(defcustom org-remember-store-without-prompt t
- "Non-nil means \\<org-remember-mode-map>\\[org-remember-finalize] \
-stores the remember note without further prompts.
-It then uses the file and headline specified by the template or (if the
-template does not specify them) by the variables `org-default-notes-file'
-and `org-remember-default-headline'. To force prompting anyway, use
-\\[universal-argument] \\[org-remember-finalize] to file the note.
-
-When this variable is nil, \\[org-remember-finalize] gives you the prompts, and
-\\[universal-argument] \\[org-remember-finalize] triggers the fasttrack."
- :group 'org-remember
- :type 'boolean)
-
-(defcustom org-remember-interactive-interface 'refile
- "The interface to be used for interactive filing of remember notes.
-This is only used when the interactive mode for selecting a filing
-location is used (see the variable `org-remember-store-without-prompt').
-Allowed values are:
-outline The interface shows an outline of the relevant file
- and the correct heading is found by moving through
- the outline or by searching with incremental search.
-outline-path-completion Headlines in the current buffer are offered via
- completion.
-refile Use the refile interface, and offer headlines,
- possibly from different buffers."
- :group 'org-remember
- :type '(choice
- (const :tag "Refile" refile)
- (const :tag "Outline" outline)
- (const :tag "Outline-path-completion" outline-path-completion)))
-
-(defcustom org-remember-default-headline ""
- "The headline that should be the default location in the notes file.
-When filing remember notes, the cursor will start at that position.
-You can set this on a per-template basis with the variable
-`org-remember-templates'."
- :group 'org-remember
- :type 'string)
-
-(defcustom org-remember-templates nil
- "Templates for the creation of remember buffers.
-When nil, just let remember make the buffer.
-When non-nil, this is a list of (up to) 6-element lists. In each entry,
-the first element is the name of the template, which should be a single
-short word. The second element is a character, a unique key to select
-this template. The third element is the template.
-
-The fourth element is optional and can specify a destination file for
-remember items created with this template. The default file is given
-by `org-default-notes-file'. If the file name is not an absolute path,
-it will be interpreted relative to `org-directory'.
-
-An optional fifth element can specify the headline in that file that should
-be offered first when the user is asked to file the entry. The default
-headline is given in the variable `org-remember-default-headline'. When
-this element is `top' or `bottom', the note will be placed as a level-1
-entry at the beginning or end of the file, respectively.
-
-An optional sixth element specifies the contexts in which the template
-will be offered to the user. This element can be a list of major modes
-or a function, and the template will only be offered if `org-remember'
-is called from a mode in the list, or if the function returns t.
-Templates that specify t or nil for the context will always be added
-to the list of selectable templates.
-
-The template specifies the structure of the remember buffer. It should have
-a first line starting with a star, to act as the org-mode headline.
-Furthermore, the following %-escapes will be replaced with content:
-
- %^{PROMPT} prompt the user for a string and replace this sequence with it.
- A default value and a completion table can be specified like this:
- %^{prompt|default|completion2|completion3|...}
- The arrow keys access a prompt-specific history.
- %a annotation, normally the link created with `org-store-link'
- %A like %a, but prompt for the description part
- %i initial content, copied from the active region. If %i is
- indented, the entire inserted text will be indented as well.
- %t time stamp, date only
- %T time stamp with date and time
- %u, %U like the above, but inactive time stamps
- %^t like %t, but prompt for date. Similarly %^T, %^u, %^U.
- You may define a prompt like %^{Please specify birthday}t
- %n user name (taken from `user-full-name')
- %c current kill ring head
- %x content of the X clipboard
- %:keyword specific information for certain link types, see below
- %^C interactive selection of which kill or clip to use
- %^L like %^C, but insert as link
- %k title of the currently clocked task
- %K link to the currently clocked task
- %^g prompt for tags, completing tags in the target file
- %^G prompt for tags, completing all tags in all agenda files
- %^{PROP}p Prompt the user for a value for property PROP
- %[PATHNAME] insert the contents of the file given by PATHNAME
- %(SEXP) evaluate elisp `(SEXP)' and replace with the result
- %! store this note immediately after completing the template\
- \\<org-remember-mode-map>
- (skipping the \\[org-remember-finalize] that normally triggers storing)
- %& jump to target location immediately after storing note
- %? after completing the template, position cursor here.
-
-Apart from these general escapes, you can access information specific to the
-link type that is created. For example, calling `remember' in emails or gnus
-will record the author and the subject of the message, which you can access
-with %:fromname and %:subject, respectively. Here is a complete list of what
-is recorded for each link type.
-
-Link type | Available information
--------------------+------------------------------------------------------
-bbdb | %:type %:name %:company
-vm, wl, mh, rmail | %:type %:subject %:message-id
- | %:from %:fromname %:fromaddress
- | %:to %:toname %:toaddress
- | %:fromto (either \"to NAME\" or \"from NAME\")
-gnus | %:group, for messages also all email fields and
- | %:org-date (the Date: header in Org format)
-w3, w3m | %:type %:url
-info | %:type %:file %:node
-calendar | %:type %:date"
- :group 'org-remember
- :get (lambda (var) ; Make sure all entries have at least 5 elements
- (mapcar (lambda (x)
- (if (not (stringp (car x))) (setq x (cons "" x)))
- (cond ((= (length x) 4) (append x '(nil)))
- ((= (length x) 3) (append x '(nil nil)))
- (t x)))
- (default-value var)))
- :type '(repeat
- :tag "enabled"
- (list :value ("" ?a "\n" nil nil nil)
- (string :tag "Name")
- (character :tag "Selection Key")
- (string :tag "Template")
- (choice :tag "Destination file"
- (file :tag "Specify")
- (function :tag "Function")
- (const :tag "Use `org-default-notes-file'" nil))
- (choice :tag "Destin. headline"
- (string :tag "Specify")
- (function :tag "Function")
- (const :tag "Use `org-remember-default-headline'" nil)
- (const :tag "At beginning of file" top)
- (const :tag "At end of file" bottom)
- (const :tag "In a date tree" date-tree))
- (choice :tag "Context"
- (const :tag "Use in all contexts" nil)
- (const :tag "Use in all contexts" t)
- (repeat :tag "Use only if in major mode"
- (symbol :tag "Major mode"))
- (function :tag "Perform a check against function")))))
-
-(defcustom org-remember-delete-empty-lines-at-end t
- "Non-nil means clean up final empty lines in remember buffer."
- :group 'org-remember
- :type 'boolean)
-
-(defcustom org-remember-before-finalize-hook nil
- "Hook that is run right before a remember process is finalized.
-The remember buffer is still current when this hook runs."
- :group 'org-remember
- :type 'hook)
-
-(defvar org-remember-mode-map (make-sparse-keymap)
- "Keymap for `org-remember-mode', a minor mode.
-Use this map to set additional keybindings for when Org-mode is used
-for a Remember buffer.")
-(defvar org-remember-mode-hook nil
- "Hook for the minor `org-remember-mode'.")
-
-(define-minor-mode org-remember-mode
- "Minor mode for special key bindings in a remember buffer."
- nil " Rem" org-remember-mode-map
- (run-hooks 'org-remember-mode-hook))
-(define-key org-remember-mode-map "\C-c\C-c" 'org-remember-finalize)
-(define-key org-remember-mode-map "\C-c\C-k" 'org-remember-kill)
-
-(defcustom org-remember-clock-out-on-exit 'query
- "Non-nil means stop the clock when exiting a clocking remember buffer.
-This only applies if the clock is running in the remember buffer. If the
-clock is not stopped, it continues to run in the storage location.
-Instead of nil or t, this may also be the symbol `query' to prompt the
-user each time a remember buffer with a running clock is filed away."
- :group 'org-remember
- :type '(choice
- (const :tag "Never" nil)
- (const :tag "Always" t)
- (const :tag "Query user" query)))
-
-(defcustom org-remember-backup-directory nil
- "Directory where to store all remember buffers, for backup purposes.
-After a remember buffer has been stored successfully, the backup file
-will be removed. However, if you forget to finish the remember process,
-the file will remain there.
-See also `org-remember-auto-remove-backup-files'."
- :group 'org-remember
- :type '(choice
- (const :tag "No backups" nil)
- (directory :tag "Directory")))
-
-(defcustom org-remember-auto-remove-backup-files t
- "Non-nil means remove remember backup files after successfully storage.
-When remember is finished successfully, with storing the note at the
-desired target, remove the backup files related to this remember process
-and show a message about remaining backup files, from previous, unfinished
-remember sessions.
-Backup files will only be made at all, when `org-remember-backup-directory'
-is set."
- :group 'org-remember
- :type 'boolean)
-
-(defcustom org-remember-warn-about-backups t
- "Non-nil means warn about backup files in `org-remember-backup-directory'.
-
-Set this to nil if you find that you don't need the warning.
-
-If you cancel remember calls frequently and know when they
-contain useful information (because you know that you made an
-error or Emacs crashed, for example) nil is more useful. In the
-opposite case, the default, t, is more useful."
- :group 'org-remember
- :type 'boolean)
-
-(defvar annotation) ; from remember.el, dynamically scoped in `remember-mode'
-(defvar initial) ; from remember.el, dynamically scoped in `remember-mode'
-
-;;;###autoload
-(defun org-remember-insinuate ()
- "Setup remember.el for use with Org-mode."
- (org-require-remember)
- (setq remember-annotation-functions '(org-remember-annotation))
- (setq remember-handler-functions '(org-remember-handler))
- (add-hook 'remember-mode-hook 'org-remember-apply-template))
-
-;;;###autoload
-(defun org-remember-annotation ()
- "Return a link to the current location as an annotation for remember.el.
-If you are using Org-mode files as target for data storage with
-remember.el, then the annotations should include a link compatible with the
-conventions in Org-mode. This function returns such a link."
- (org-store-link nil))
-
-(defconst org-remember-help
-"Select a destination location for the note.
-UP/DOWN=headline TAB=cycle visibility [Q]uit RET/<left>/<right>=Store
-RET on headline -> Store as sublevel entry to current headline
-RET at beg-of-buf -> Append to file as level 2 headline
-<left>/<right> -> before/after current headline, same headings level")
-
-(defvar org-jump-to-target-location nil)
-(defvar org-remember-previous-location nil)
-(defvar org-remember-reference-date nil)
-(defvar org-force-remember-template-char) ;; dynamically scoped
-
-;; Save the major mode of the buffer we called remember from
-(defvar org-select-template-temp-major-mode nil)
-
-;; Temporary store the buffer where remember was called from
-(defvar org-select-template-original-buffer nil)
-
-(defun org-select-remember-template (&optional use-char)
- (when org-remember-templates
- (let* ((pre-selected-templates
- (mapcar
- (lambda (tpl)
- (let ((ctxt (nth 5 tpl))
- (mode org-select-template-temp-major-mode)
- (buf org-select-template-original-buffer))
- (and (or (not ctxt) (eq ctxt t)
- (and (listp ctxt) (memq mode ctxt))
- (and (functionp ctxt)
- (with-current-buffer buf
- ;; Protect the user-defined function from error
- (condition-case nil (funcall ctxt) (error nil)))))
- tpl)))
- org-remember-templates))
- ;; If no template at this point, add the default templates:
- (pre-selected-templates1
- (if (not (delq nil pre-selected-templates))
- (mapcar (lambda(x) (if (not (nth 5 x)) x))
- org-remember-templates)
- pre-selected-templates))
- ;; Then unconditionally add template for any contexts
- (pre-selected-templates2
- (append (mapcar (lambda(x) (if (eq (nth 5 x) t) x))
- org-remember-templates)
- (delq nil pre-selected-templates1)))
- (templates (mapcar (lambda (x)
- (if (stringp (car x))
- (append (list (nth 1 x) (car x)) (cddr x))
- (append (list (car x) "") (cdr x))))
- (delq nil pre-selected-templates2)))
- msg
- (char (or use-char
- (cond
- ((= (length templates) 1)
- (caar templates))
- ((and (boundp 'org-force-remember-template-char)
- org-force-remember-template-char)
- (if (stringp org-force-remember-template-char)
- (string-to-char org-force-remember-template-char)
- org-force-remember-template-char))
- (t
- (setq msg (format
- "Select template: %s%s"
- (mapconcat
- (lambda (x)
- (cond
- ((not (string-match "\\S-" (nth 1 x)))
- (format "[%c]" (car x)))
- ((equal (downcase (car x))
- (downcase (aref (nth 1 x) 0)))
- (format "[%c]%s" (car x)
- (substring (nth 1 x) 1)))
- (t (format "[%c]%s" (car x) (nth 1 x)))))
- templates " ")
- (if (assoc ?C templates)
- ""
- " [C]customize templates")))
- (let ((inhibit-quit t) char0)
- (while (not char0)
- (message msg)
- (setq char0 (read-char-exclusive))
- (when (and (not (assoc char0 templates))
- (not (equal char0 ?\C-g))
- (not (equal char0 ?C)))
- (message "No such template \"%c\"" char0)
- (ding) (sit-for 1)
- (setq char0 nil)))
- (when (equal char0 ?\C-g)
- (jump-to-register remember-register)
- (kill-buffer remember-buffer)
- (error "Abort"))
- (when (not (assoc char0 templates))
- (jump-to-register remember-register)
- (kill-buffer remember-buffer)
- (customize-variable 'org-remember-templates)
- (error "Customize templates"))
- char0))))))
- (cddr (assoc char templates)))))
-
-;;;###autoload
-(defun org-remember-apply-template (&optional use-char skip-interactive)
- "Initialize *remember* buffer with template, invoke `org-mode'.
-This function should be placed into `remember-mode-hook' and in fact requires
-to be run from that hook to function properly."
- (when (and (boundp 'initial) (stringp initial))
- (setq initial (org-no-properties initial))
- (remove-text-properties 0 (length initial) '(read-only t) initial))
- (if org-remember-templates
- (let* ((entry (org-select-remember-template use-char))
- (ct (or org-overriding-default-time (org-current-time)))
- (dct (decode-time ct))
- (ct1
- (if (< (nth 2 dct) org-extend-today-until)
- (encode-time 0 59 23 (1- (nth 3 dct)) (nth 4 dct) (nth 5 dct))
- ct))
- (tpl (car entry))
- (plist-p (if org-store-link-plist t nil))
- (file (if (and (nth 1 entry)
- (or (and (stringp (nth 1 entry))
- (string-match "\\S-" (nth 1 entry)))
- (functionp (nth 1 entry))))
- (nth 1 entry)
- org-default-notes-file))
- (headline (nth 2 entry))
- (v-c (and (> (length kill-ring) 0) (current-kill 0)))
- (v-x (or (org-get-x-clipboard 'PRIMARY)
- (org-get-x-clipboard 'CLIPBOARD)
- (org-get-x-clipboard 'SECONDARY)))
- (v-t (format-time-string (car org-time-stamp-formats) ct))
- (v-T (format-time-string (cdr org-time-stamp-formats) ct))
- (v-u (concat "[" (substring v-t 1 -1) "]"))
- (v-U (concat "[" (substring v-T 1 -1) "]"))
- ;; `initial' and `annotation' are bound in `remember'.
- ;; But if the property list has them, we prefer those values
- (v-i (or (plist-get org-store-link-plist :initial)
- (and (boundp 'initial) initial)
- ""))
- (v-a (or (plist-get org-store-link-plist :annotation)
- (and (boundp 'annotation) annotation)
- ""))
- ;; Is the link empty? Then we do not want it...
- (v-a (if (equal v-a "[[]]") "" v-a))
- (clipboards (remove nil (list v-i
- (org-get-x-clipboard 'PRIMARY)
- (org-get-x-clipboard 'CLIPBOARD)
- (org-get-x-clipboard 'SECONDARY)
- v-c)))
- (v-A (if (and v-a
- (string-match "\\[\\(\\[.*?\\]\\)\\(\\[.*?\\]\\)?\\]" v-a))
- (replace-match "[\\1[%^{Link description}]]" nil nil v-a)
- v-a))
- (v-n user-full-name)
- (v-k (if (marker-buffer org-clock-marker)
- (org-substring-no-properties org-clock-heading)))
- (v-K (if (marker-buffer org-clock-marker)
- (org-make-link-string
- (buffer-file-name (marker-buffer org-clock-marker))
- org-clock-heading)))
- v-I
- (org-startup-folded nil)
- (org-inhibit-startup t)
- org-time-was-given org-end-time-was-given x
- prompt completions char time pos default histvar)
-
- (when (functionp file)
- (setq file (funcall file)))
- (when (functionp headline)
- (setq headline (funcall headline)))
- (when (and file (not (file-name-absolute-p file)))
- (setq file (expand-file-name file org-directory)))
-
- (setq org-store-link-plist
- (plist-put org-store-link-plist :annotation v-a)
- org-store-link-plist
- (plist-put org-store-link-plist :initial v-i))
-
- (unless tpl (setq tpl "") (message "No template") (ding) (sit-for 1))
- (erase-buffer)
- (insert (substitute-command-keys
- (format
-"## %s \"%s\" -> \"* %s\"
-## C-u C-c C-c like C-c C-c, and immediately visit note at target location
-## C-0 C-c C-c \"%s\" -> \"* %s\"
-## %s to select file and header location interactively.
-## C-2 C-c C-c as child (C-3: as sibling) of the currently clocked item
-## To switch templates, use `\\[org-remember]'. To abort use `C-c C-k'.\n\n"
- (if org-remember-store-without-prompt " C-c C-c" " C-1 C-c C-c")
- (abbreviate-file-name (or file org-default-notes-file))
- (or headline "")
- (or (car org-remember-previous-location) "???")
- (or (cdr org-remember-previous-location) "???")
- (if org-remember-store-without-prompt "C-1 C-c C-c" " C-c C-c"))))
- (insert tpl)
-
- ;; %[] Insert contents of a file.
- (goto-char (point-min))
- (while (re-search-forward "%\\[\\(.+\\)\\]" nil t)
- (unless (org-remember-escaped-%)
- (let ((start (match-beginning 0))
- (end (match-end 0))
- (filename (expand-file-name (match-string 1))))
- (goto-char start)
- (delete-region start end)
- (condition-case error
- (insert-file-contents filename)
- (error (insert (format "%%![Couldn't insert %s: %s]"
- filename error)))))))
- ;; Simple %-escapes
- (goto-char (point-min))
- (while (re-search-forward "%\\([tTuUaiAcxkKI]\\)" nil t)
- (unless (org-remember-escaped-%)
- (when (and initial (equal (match-string 0) "%i"))
- (save-match-data
- (let* ((lead (buffer-substring
- (point-at-bol) (match-beginning 0))))
- (setq v-i (mapconcat 'identity
- (org-split-string initial "\n")
- (concat "\n" lead))))))
- (replace-match
- (or (eval (intern (concat "v-" (match-string 1)))) "")
- t t)))
-
- ;; %() embedded elisp
- (goto-char (point-min))
- (while (re-search-forward "%\\((.+)\\)" nil t)
- (unless (org-remember-escaped-%)
- (goto-char (match-beginning 0))
- (let ((template-start (point)))
- (forward-char 1)
- (let ((result
- (condition-case error
- (eval (read (current-buffer)))
- (error (format "%%![Error: %s]" error)))))
- (delete-region template-start (point))
- (insert result)))))
-
- ;; From the property list
- (when plist-p
- (goto-char (point-min))
- (while (re-search-forward "%\\(:[-a-zA-Z]+\\)" nil t)
- (unless (org-remember-escaped-%)
- (and (setq x (or (plist-get org-store-link-plist
- (intern (match-string 1))) ""))
- (replace-match x t t)))))
-
- ;; Turn on org-mode in the remember buffer, set local variables
- (let ((org-inhibit-startup t)) (org-mode) (org-remember-mode 1))
- (if (and file (string-match "\\S-" file) (not (file-directory-p file)))
- (org-set-local 'org-default-notes-file file))
- (if headline
- (org-set-local 'org-remember-default-headline headline))
- (org-set-local 'org-remember-reference-date
- (list (nth 4 dct) (nth 3 dct) (nth 5 dct)))
- ;; Interactive template entries
- (goto-char (point-min))
- (while (re-search-forward "%^\\({\\([^}]*\\)}\\)?\\([gGtTuUCLp]\\)?" nil t)
- (unless (org-remember-escaped-%)
- (setq char (if (match-end 3) (match-string 3))
- prompt (if (match-end 2) (match-string 2)))
- (goto-char (match-beginning 0))
- (replace-match "")
- (setq completions nil default nil)
- (when prompt
- (setq completions (org-split-string prompt "|")
- prompt (pop completions)
- default (car completions)
- histvar (intern (concat
- "org-remember-template-prompt-history::"
- (or prompt "")))
- completions (mapcar 'list completions)))
- (cond
- ((member char '("G" "g"))
- (let* ((org-last-tags-completion-table
- (org-global-tags-completion-table
- (if (equal char "G") (org-agenda-files) (and file (list file)))))
- (org-add-colon-after-tag-completion t)
- (ins (org-icompleting-read
- (if prompt (concat prompt ": ") "Tags: ")
- 'org-tags-completion-function nil nil nil
- 'org-tags-history)))
- (setq ins (mapconcat 'identity
- (org-split-string ins (org-re "[^[:alnum:]_@#%]+"))
- ":"))
- (when (string-match "\\S-" ins)
- (or (equal (char-before) ?:) (insert ":"))
- (insert ins)
- (or (equal (char-after) ?:) (insert ":")))))
- ((equal char "C")
- (cond ((= (length clipboards) 1) (insert (car clipboards)))
- ((> (length clipboards) 1)
- (insert (read-string "Clipboard/kill value: "
- (car clipboards) '(clipboards . 1)
- (car clipboards))))))
- ((equal char "L")
- (cond ((= (length clipboards) 1)
- (org-insert-link 0 (car clipboards)))
- ((> (length clipboards) 1)
- (org-insert-link 0 (read-string "Clipboard/kill value: "
- (car clipboards)
- '(clipboards . 1)
- (car clipboards))))))
- ((equal char "p")
- (let*
- ((prop (org-substring-no-properties prompt))
- (pall (concat prop "_ALL"))
- (allowed
- (with-current-buffer
- (or (find-buffer-visiting file)
- (find-file-noselect file))
- (or (cdr (assoc pall org-file-properties))
- (cdr (assoc pall org-global-properties))
- (cdr (assoc pall org-global-properties-fixed)))))
- (existing (with-current-buffer
- (or (find-buffer-visiting file)
- (find-file-noselect file))
- (mapcar 'list (org-property-values prop))))
- (propprompt (concat "Value for " prop ": "))
- (val (if allowed
- (org-completing-read
- propprompt
- (mapcar 'list (org-split-string allowed "[ \t]+"))
- nil 'req-match)
- (org-completing-read-no-i propprompt existing nil nil
- "" nil ""))))
- (org-set-property prop val)))
- (char
- ;; These are the date/time related ones
- (setq org-time-was-given (equal (upcase char) char))
- (setq time (org-read-date (equal (upcase char) "U") t nil
- prompt))
- (org-insert-time-stamp time org-time-was-given
- (member char '("u" "U"))
- nil nil (list org-end-time-was-given)))
- (t
- (let (org-completion-use-ido)
- (insert (org-without-partial-completion
- (org-completing-read-no-i
- (concat (if prompt prompt "Enter string")
- (if default (concat " [" default "]"))
- ": ")
- completions nil nil nil histvar default))))))))
-
- (goto-char (point-min))
- (if (re-search-forward "%\\?" nil t)
- (replace-match "")
- (and (re-search-forward "^[^#\n]" nil t) (backward-char 1))))
- (let ((org-inhibit-startup t)) (org-mode) (org-remember-mode 1)))
- (when (save-excursion
- (goto-char (point-min))
- (re-search-forward "%&" nil t))
- (replace-match "")
- (org-set-local 'org-jump-to-target-location t))
- (when org-remember-backup-directory
- (unless (file-directory-p org-remember-backup-directory)
- (make-directory org-remember-backup-directory))
- (org-set-local 'auto-save-file-name-transforms nil)
- (setq buffer-file-name
- (expand-file-name
- (format-time-string "remember-%Y-%m-%d-%H-%M-%S")
- org-remember-backup-directory))
- (save-buffer)
- (org-set-local 'auto-save-visited-file-name t)
- (auto-save-mode 1))
- (when (save-excursion
- (goto-char (point-min))
- (re-search-forward "%!" nil t))
- (replace-match "")
- (add-hook 'post-command-hook 'org-remember-finish-immediately 'append)))
-
-(defun org-remember-escaped-% ()
- (if (equal (char-before (match-beginning 0)) ?\\)
- (progn
- (delete-region (1- (match-beginning 0)) (match-beginning 0))
- t)
- nil))
-
-
-(defun org-remember-finish-immediately ()
- "File remember note immediately.
-This should be run in `post-command-hook' and will remove itself
-from that hook."
- (remove-hook 'post-command-hook 'org-remember-finish-immediately)
- (org-remember-finalize))
-
-(defun org-remember-visit-immediately ()
- "File remember note immediately.
-This should be run in `post-command-hook' and will remove itself
-from that hook."
- (org-remember '(16))
- (goto-char (or (text-property-any
- (point) (save-excursion (org-end-of-subtree t t))
- 'org-position-cursor t)
- (point)))
- (message "%s"
- (format
- (substitute-command-keys
- "Restore window configuration with \\[jump-to-register] %c")
- remember-register)))
-
-(defvar org-clock-marker) ; Defined in org.el
-(defun org-remember-finalize ()
- "Finalize the remember process."
- (interactive)
- (unless org-remember-mode
- (error "This does not seem to be a remember buffer for Org-mode"))
- (run-hooks 'org-remember-before-finalize-hook)
- (unless (fboundp 'remember-finalize)
- (defalias 'remember-finalize 'remember-buffer))
- (when (and org-clock-marker
- (equal (marker-buffer org-clock-marker) (current-buffer)))
- ;; the clock is running in this buffer.
- (when (and (equal (marker-buffer org-clock-marker) (current-buffer))
- (or (eq org-remember-clock-out-on-exit t)
- (and org-remember-clock-out-on-exit
- (y-or-n-p "The clock is running in this buffer. Clock out now? "))))
- (let (org-log-note-clock-out) (org-clock-out))))
- (when buffer-file-name
- (do-auto-save))
- (remember-finalize))
-
-(defun org-remember-kill ()
- "Abort the current remember process."
- (interactive)
- (let ((org-note-abort t))
- (org-remember-finalize)))
-
-;;;###autoload
-(defun org-remember (&optional goto org-force-remember-template-char)
- "Call `remember'. If this is already a remember buffer, re-apply template.
-If there is an active region, make sure remember uses it as initial content
-of the remember buffer.
-
-When called interactively with a \\[universal-argument] \
-prefix argument GOTO, don't remember
-anything, just go to the file/headline where the selected template usually
-stores its notes. With a double prefix argument \
-\\[universal-argument] \\[universal-argument], go to the last
-note stored by remember.
-
-Lisp programs can set ORG-FORCE-REMEMBER-TEMPLATE-CHAR to a character
-associated with a template in `org-remember-templates'."
- (interactive "P")
- (org-require-remember)
- (cond
- ((equal goto '(4)) (org-go-to-remember-target))
- ((equal goto '(16)) (org-remember-goto-last-stored))
- (t
- ;; set temporary variables that will be needed in
- ;; `org-select-remember-template'
- (setq org-select-template-temp-major-mode major-mode)
- (setq org-select-template-original-buffer (current-buffer))
- (if org-remember-mode
- (progn
- (when (< (length org-remember-templates) 2)
- (error "No other template available"))
- (erase-buffer)
- (let ((annotation (plist-get org-store-link-plist :annotation))
- (initial (plist-get org-store-link-plist :initial)))
- (org-remember-apply-template))
- (message "Press C-c C-c to remember data"))
- (if (org-region-active-p)
- (org-do-remember (buffer-substring (point) (mark)))
- (org-do-remember))))))
-
-(defvar org-remember-last-stored-marker (make-marker)
- "Marker pointing to the entry most recently stored with `org-remember'.")
-
-(defun org-remember-goto-last-stored ()
- "Go to the location where the last remember note was stored."
- (interactive)
- (org-goto-marker-or-bmk org-remember-last-stored-marker
- "org-remember-last-stored")
- (message "This is the last note stored by remember"))
-
-(defun org-go-to-remember-target (&optional template-key)
- "Go to the target location of a remember template.
-The user is queried for the template."
- (interactive)
- (let* (org-select-template-temp-major-mode
- (entry (org-select-remember-template template-key))
- (file (nth 1 entry))
- (heading (nth 2 entry))
- visiting)
- (unless (and file (stringp file) (string-match "\\S-" file))
- (setq file org-default-notes-file))
- (when (and file (not (file-name-absolute-p file)))
- (setq file (expand-file-name file org-directory)))
- (unless (and heading (stringp heading) (string-match "\\S-" heading))
- (setq heading org-remember-default-headline))
- (setq visiting (org-find-base-buffer-visiting file))
- (if (not visiting) (find-file-noselect file))
- (switch-to-buffer (or visiting (get-file-buffer file)))
- (widen)
- (goto-char (point-min))
- (if (re-search-forward
- (format org-complex-heading-regexp-format (regexp-quote heading))
- nil t)
- (goto-char (match-beginning 0))
- (error "Target headline not found: %s" heading))))
-
-;; FIXME (bzg): let's clean up of final empty lines happen only once
-;; (see the org-remember-delete-empty-lines-at-end option below)
-;;;###autoload
-(defun org-remember-handler ()
- "Store stuff from remember.el into an org file.
-When the template has specified a file and a headline, the entry is filed
-there, or in the location defined by `org-default-notes-file' and
-`org-remember-default-headline'.
-\\<org-remember-mode-map>
-If no defaults have been defined, or if the current prefix argument
-is 1 (using C-1 \\[org-remember-finalize] to exit remember), an interactive
-process is used to select the target location.
-
-When the prefix is 0 (i.e. when remember is exited with \
-C-0 \\[org-remember-finalize]),
-the entry is filed to the same location as the previous note.
-
-When the prefix is 2 (i.e. when remember is exited with \
-C-2 \\[org-remember-finalize]),
-the entry is filed as a subentry of the entry where the clock is
-currently running.
-
-When \\[universal-argument] has been used as prefix argument, the
-note is stored and Emacs moves point to the new location of the
-note, so that editing can be continued there (similar to
-inserting \"%&\" into the template).
-
-Before storing the note, the function ensures that the text has an
-org-mode-style headline, i.e. a first line that starts with
-a \"*\". If not, a headline is constructed from the current date and
-some additional data.
-
-If the variable `org-adapt-indentation' is non-nil, the entire text is
-also indented so that it starts in the same column as the headline
-\(i.e. after the stars).
-
-See also the variable `org-reverse-note-order'."
- (when (and (equal current-prefix-arg 2)
- (not (marker-buffer org-clock-marker)))
- (error "No running clock"))
- (when (org-bound-and-true-p org-jump-to-target-location)
- (let* ((end (min (point-max) (1+ (point))))
- (beg (point)))
- (if (= end beg) (setq beg (1- beg)))
- (put-text-property beg end 'org-position-cursor t)))
- (goto-char (point-min))
- (while (looking-at "^[ \t]*\n\\|^##.*\n")
- (replace-match ""))
- (when org-remember-delete-empty-lines-at-end
- (goto-char (point-max))
- (beginning-of-line 1)
- (while (and (looking-at "[ \t]*$\\|##.*") (> (point) 1))
- (delete-region (1- (point)) (point-max))
- (beginning-of-line 1)))
- (catch 'quit
- (if org-note-abort (throw 'quit t))
- (let* ((visitp (org-bound-and-true-p org-jump-to-target-location))
- (backup-file
- (and buffer-file-name
- (equal (file-name-directory buffer-file-name)
- (file-name-as-directory
- (expand-file-name org-remember-backup-directory)))
- (string-match "^remember-[0-9]\\{4\\}"
- (file-name-nondirectory buffer-file-name))
- buffer-file-name))
-
- (dummy
- (unless (string-match "\\S-" (buffer-string))
- (message "Nothing to remember")
- (and backup-file
- (ignore-errors
- (delete-file backup-file)
- (delete-file (concat backup-file "~"))))
- (set-buffer-modified-p nil)
- (throw 'quit t)))
- (reference-date org-remember-reference-date)
- (previousp (and (member current-prefix-arg '((16) 0))
- org-remember-previous-location))
- (clockp (equal current-prefix-arg 2))
- (clocksp (equal current-prefix-arg 3))
- (fastp (org-xor (equal current-prefix-arg 1)
- org-remember-store-without-prompt))
- (file (cond
- (fastp org-default-notes-file)
- ((and (eq org-remember-interactive-interface 'refile)
- org-refile-targets)
- org-default-notes-file)
- ((not previousp)
- (org-get-org-file))))
- (heading org-remember-default-headline)
- (visiting (and file (org-find-base-buffer-visiting file)))
- (org-startup-folded nil)
- (org-startup-align-all-tables nil)
- (org-goto-start-pos 1)
- spos exitcmd level reversed txt text-before-node-creation)
- (when (equal current-prefix-arg '(4))
- (setq visitp t))
- (when previousp
- (setq file (car org-remember-previous-location)
- visiting (and file (org-find-base-buffer-visiting file))
- heading (cdr org-remember-previous-location)
- fastp t))
- (when (or clockp clocksp)
- (setq file (buffer-file-name (marker-buffer org-clock-marker))
- visiting (and file (org-find-base-buffer-visiting file))
- heading org-clock-heading-for-remember
- fastp t))
- (setq current-prefix-arg nil)
- ;; Modify text so that it becomes a nice subtree which can be inserted
- ;; into an org tree.
- (when org-remember-delete-empty-lines-at-end
- (goto-char (point-min))
- (if (re-search-forward "[ \t\n]+\\'" nil t)
- ;; remove empty lines at end
- (replace-match "")))
- (goto-char (point-min))
- (setq text-before-node-creation (buffer-string))
- (unless (looking-at org-outline-regexp)
- ;; add a headline
- (insert (concat "* " (current-time-string)
- " (" (remember-buffer-desc) ")\n"))
- (backward-char 1)
- (when org-adapt-indentation
- (while (re-search-forward "^" nil t)
- (insert " "))))
- ;; Delete final empty lines
- (when org-remember-delete-empty-lines-at-end
- (goto-char (point-min))
- (if (re-search-forward "\n[ \t]*\n[ \t\n]*\\'" nil t)
- (replace-match "\n\n")
- (if (re-search-forward "[ \t\n]*\\'")
- (replace-match "\n"))))
- (goto-char (point-min))
- (setq txt (buffer-string))
- (org-save-markers-in-region (point-min) (point-max))
- (set-buffer-modified-p nil)
- (when (and (eq org-remember-interactive-interface 'refile)
- (not fastp))
- (org-refile nil (or visiting (find-file-noselect file)))
- (and visitp (run-with-idle-timer 0.01 nil 'org-remember-visit-immediately))
- (save-excursion
- (bookmark-jump "org-refile-last-stored")
- (bookmark-set "org-remember-last-stored")
- (move-marker org-remember-last-stored-marker (point)))
- (throw 'quit t))
- ;; Find the file
- (with-current-buffer (or visiting (find-file-noselect file))
- (unless (or (org-mode-p) (member heading '(top bottom)))
- (error "Target files for notes must be in Org-mode if not filing to top/bottom"))
- (save-excursion
- (save-restriction
- (widen)
- (setq reversed (org-notes-order-reversed-p))
-
- ;; Find the default location
- (when heading
- (cond
- ((not (org-mode-p))
- (if (eq heading 'top)
- (goto-char (point-min))
- (goto-char (point-max))
- (or (bolp) (newline)))
- (insert text-before-node-creation)
- (when remember-save-after-remembering
- (save-buffer)
- (if (not visiting) (kill-buffer (current-buffer))))
- (throw 'quit t))
- ((eq heading 'top)
- (goto-char (point-min))
- (or (looking-at org-outline-regexp)
- (re-search-forward org-outline-regexp nil t))
- (setq org-goto-start-pos (or (match-beginning 0) (point-min))))
- ((eq heading 'bottom)
- (goto-char (point-max))
- (or (bolp) (newline))
- (setq org-goto-start-pos (point)))
- ((eq heading 'date-tree)
- (org-datetree-find-date-create reference-date)
- (setq reversed nil)
- (setq org-goto-start-pos (point)))
- ((and (stringp heading) (string-match "\\S-" heading))
- (goto-char (point-min))
- (if (re-search-forward
- (format org-complex-heading-regexp-format
- (regexp-quote heading))
- nil t)
- (setq org-goto-start-pos (match-beginning 0))
- (when fastp
- (goto-char (point-max))
- (unless (bolp) (newline))
- (insert "* " heading "\n")
- (setq org-goto-start-pos (point-at-bol 0)))))
- (t (goto-char (point-min)) (setq org-goto-start-pos (point)
- heading 'top))))
-
- ;; Ask the User for a location, using the appropriate interface
- (cond
- ((and fastp (memq heading '(top bottom)))
- (setq spos org-goto-start-pos
- exitcmd (if (eq heading 'top) 'left nil)))
- (fastp (setq spos org-goto-start-pos
- exitcmd 'return))
- ((eq org-remember-interactive-interface 'outline)
- (setq spos (org-get-location (current-buffer)
- org-remember-help)
- exitcmd (cdr spos)
- spos (car spos)))
- ((eq org-remember-interactive-interface 'outline-path-completion)
- (let ((org-refile-targets '((nil . (:maxlevel . 10))))
- (org-refile-use-outline-path t))
- (setq spos (org-refile-get-location "Heading: ")
- exitcmd 'return
- spos (nth 3 spos))))
- (t (error "This should not happen")))
- (if (not spos) (throw 'quit nil)) ; return nil to show we did
- ; not handle this note
- (and visitp (run-with-idle-timer 0.01 nil 'org-remember-visit-immediately))
- (goto-char spos)
- (cond ((org-on-heading-p t)
- (org-back-to-heading t)
- (setq level (funcall outline-level))
- (cond
- ((eq exitcmd 'return)
- ;; sublevel of current
- (setq org-remember-previous-location
- (cons (abbreviate-file-name file)
- (org-get-heading 'notags)))
- (if reversed
- (outline-next-heading)
- (org-end-of-subtree t)
- (if (not (bolp))
- (if (looking-at "[ \t]*\n")
- (beginning-of-line 2)
- (end-of-line 1)
- (insert "\n"))))
- (org-paste-subtree (if clocksp
- level
- (org-get-valid-level level 1)) txt)
- (and org-auto-align-tags (org-set-tags nil t))
- (bookmark-set "org-remember-last-stored")
- (move-marker org-remember-last-stored-marker (point)))
- ((eq exitcmd 'left)
- ;; before current
- (org-paste-subtree level txt)
- (and org-auto-align-tags (org-set-tags nil t))
- (bookmark-set "org-remember-last-stored")
- (move-marker org-remember-last-stored-marker (point)))
- ((eq exitcmd 'right)
- ;; after current
- (org-end-of-subtree t)
- (org-paste-subtree level txt)
- (and org-auto-align-tags (org-set-tags nil t))
- (bookmark-set "org-remember-last-stored")
- (move-marker org-remember-last-stored-marker (point)))
- (t (error "This should not happen"))))
-
- ((eq heading 'bottom)
- (org-paste-subtree 1 txt)
- (and org-auto-align-tags (org-set-tags nil t))
- (bookmark-set "org-remember-last-stored")
- (move-marker org-remember-last-stored-marker (point)))
-
- ((and (bobp) (not reversed))
- ;; Put it at the end, one level below level 1
- (save-restriction
- (widen)
- (goto-char (point-max))
- (if (not (bolp)) (newline))
- (org-paste-subtree (org-get-valid-level 1 1) txt)
- (and org-auto-align-tags (org-set-tags nil t))
- (bookmark-set "org-remember-last-stored")
- (move-marker org-remember-last-stored-marker (point))))
-
- ((and (bobp) reversed)
- ;; Put it at the start, as level 1
- (save-restriction
- (widen)
- (goto-char (point-min))
- (re-search-forward "^\\*+ " nil t)
- (beginning-of-line 1)
- (org-paste-subtree 1 txt)
- (and org-auto-align-tags (org-set-tags nil t))
- (bookmark-set "org-remember-last-stored")
- (move-marker org-remember-last-stored-marker (point))))
- (t
- ;; Put it right there, with automatic level determined by
- ;; org-paste-subtree or from prefix arg
- (org-paste-subtree
- (if (numberp current-prefix-arg) current-prefix-arg)
- txt)
- (and org-auto-align-tags (org-set-tags nil t))
- (bookmark-set "org-remember-last-stored")
- (move-marker org-remember-last-stored-marker (point))))
-
- (when remember-save-after-remembering
- (save-buffer)
- (if (and (not visiting)
- (not (equal (marker-buffer org-clock-marker)
- (current-buffer))))
- (kill-buffer (current-buffer))))
- (when org-remember-auto-remove-backup-files
- (when backup-file
- (ignore-errors
- (delete-file backup-file)
- (delete-file (concat backup-file "~"))))
- (when org-remember-backup-directory
- (let ((n (length
- (directory-files
- org-remember-backup-directory nil
- "^remember-.*[0-9]$"))))
- (when (and org-remember-warn-about-backups
- (> n 0))
- (message
- "%d backup files (unfinished remember calls) in %s"
- n org-remember-backup-directory))))))))))
-
- t) ;; return t to indicate that we took care of this note.
-
-(defun org-do-remember (&optional initial)
- "Call remember."
- (remember initial))
-
-(defun org-require-remember ()
- "Make sure remember is loaded, or install our own emergency version of it."
- (condition-case nil
- (require 'remember)
- (error
- ;; Lets install our own micro version of remember
- (defvar remember-register ?R)
- (defvar remember-mode-hook nil)
- (defvar remember-handler-functions nil)
- (defvar remember-buffer "*Remember*")
- (defvar remember-save-after-remembering t)
- (defvar remember-annotation-functions '(buffer-file-name))
- (defun remember-finalize ()
- (run-hook-with-args-until-success 'remember-handler-functions)
- (when (equal remember-buffer (buffer-name))
- (kill-buffer (current-buffer))
- (jump-to-register remember-register)))
- (defun remember-mode ()
- (fundamental-mode)
- (setq mode-name "Remember")
- (run-hooks 'remember-mode-hook))
- (defun remember (&optional initial)
- (window-configuration-to-register remember-register)
- (let* ((annotation (run-hook-with-args-until-success
- 'remember-annotation-functions)))
- (switch-to-buffer-other-window (get-buffer-create remember-buffer))
- (remember-mode)))
- (defun remember-buffer-desc ()
- (buffer-substring (point-min) (save-excursion (goto-char (point-min))
- (point-at-eol)))))))
-
-(provide 'org-remember)
-
-;; arch-tag: 497f30d0-4bc3-4097-8622-2d27ac5f2698
-
-;;; org-remember.el ends here
-
diff --git a/.emacs.d/org-7.4/lisp/org-remember.elc b/.emacs.d/org-7.4/lisp/org-remember.elc
deleted file mode 100644
index 241c526..0000000
--- a/.emacs.d/org-7.4/lisp/org-remember.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-rmail.el b/.emacs.d/org-7.4/lisp/org-rmail.el
deleted file mode 100644
index 7325868..0000000
--- a/.emacs.d/org-7.4/lisp/org-rmail.el
+++ /dev/null
@@ -1,120 +0,0 @@
-;;; org-rmail.el --- Support for links to Rmail messages from within Org-mode
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file implements links to Rmail messages from within Org-mode.
-;; Org-mode loads this module by default - if this is not what you want,
-;; configure the variable `org-modules'.
-
-;;; Code:
-
-(require 'org)
-
-;; Declare external functions and variables
-(declare-function rmail-show-message "rmail" (&optional n no-summary))
-(declare-function rmail-what-message "rmail" ())
-(defvar rmail-current-message)
-
-;; Install the link type
-(org-add-link-type "rmail" 'org-rmail-open)
-(add-hook 'org-store-link-functions 'org-rmail-store-link)
-
-;; Implementation
-(defun org-rmail-store-link ()
- "Store a link to an Rmail folder or message."
- (when (or (eq major-mode 'rmail-mode)
- (eq major-mode 'rmail-summary-mode))
- (save-window-excursion
- (save-restriction
- (when (eq major-mode 'rmail-summary-mode)
- (rmail-show-message rmail-current-message))
- (when (fboundp 'rmail-narrow-to-non-pruned-header)
- (rmail-narrow-to-non-pruned-header))
- (let* ((folder buffer-file-name)
- (message-id (mail-fetch-field "message-id"))
- (from (mail-fetch-field "from"))
- (to (mail-fetch-field "to"))
- (subject (mail-fetch-field "subject"))
- (date (mail-fetch-field "date"))
- (date-ts (and date (format-time-string
- (org-time-stamp-format t)
- (date-to-time date))))
- (date-ts-ia (and date (format-time-string
- (org-time-stamp-format t t)
- (date-to-time date))))
- desc link)
- (org-store-link-props
- :type "rmail" :from from :to to
- :subject subject :message-id message-id)
- (when date
- (org-add-link-props :date date :date-timestamp date-ts
- :date-timestamp-inactive date-ts-ia))
- (setq message-id (org-remove-angle-brackets message-id))
- (setq desc (org-email-link-description))
- (setq link (org-make-link "rmail:" folder "#" message-id))
- (org-add-link-props :link link :description desc)
- (rmail-show-message rmail-current-message)
- link)))))
-
-(defun org-rmail-open (path)
- "Follow an Rmail message link to the specified PATH."
- (let (folder article)
- (if (not (string-match "\\`\\([^#]+\\)\\(#\\(.*\\)\\)?" path))
- (error "Error in Rmail link"))
- (setq folder (match-string 1 path)
- article (match-string 3 path))
- (org-rmail-follow-link folder article)))
-
-(defun org-rmail-follow-link (folder article)
- "Follow an Rmail link to FOLDER and ARTICLE."
- (require 'rmail)
- (setq article (org-add-angle-brackets article))
- (let (message-number)
- (save-excursion
- (save-window-excursion
- (rmail (if (string= folder "RMAIL") rmail-file-name folder))
- (setq message-number
- (save-restriction
- (widen)
- (goto-char (point-max))
- (if (re-search-backward
- (concat "^Message-ID:\\s-+" (regexp-quote
- (or article "")))
- nil t)
- (rmail-what-message))))))
- (if message-number
- (progn
- (rmail (if (string= folder "RMAIL") rmail-file-name folder))
- (rmail-show-message message-number)
- message-number)
- (error "Message not found"))))
-
-(provide 'org-rmail)
-
-;; arch-tag: c6cf4a8b-6639-4b7f-821f-bdf10746b173
-
-;;; org-rmail.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-rmail.elc b/.emacs.d/org-7.4/lisp/org-rmail.elc
deleted file mode 100644
index 83a45ec..0000000
--- a/.emacs.d/org-7.4/lisp/org-rmail.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-src.el b/.emacs.d/org-7.4/lisp/org-src.el
deleted file mode 100644
index c932b4a..0000000
--- a/.emacs.d/org-7.4/lisp/org-src.el
+++ /dev/null
@@ -1,811 +0,0 @@
-;;; org-src.el --- Source code examples in Org
-;;
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-;;
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Bastien Guerry <bzg AT altern DOT org>
-;; Dan Davison <davison at stats dot ox dot ac dot uk>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file contains the code dealing with source code examples in Org-mode.
-
-;;; Code:
-
-(require 'org-macs)
-(require 'org-compat)
-(require 'ob-keys)
-(require 'ob-comint)
-(eval-when-compile
- (require 'cl))
-
-(declare-function org-do-remove-indentation "org" (&optional n))
-(declare-function org-at-table.el-p "org" ())
-(declare-function org-get-indentation "org" (&optional line))
-(declare-function org-switch-to-buffer-other-window "org" (&rest args))
-
-(defcustom org-edit-src-region-extra nil
- "Additional regexps to identify regions for editing with `org-edit-src-code'.
-For examples see the function `org-edit-src-find-region-and-lang'.
-The regular expression identifying the begin marker should end with a newline,
-and the regexp marking the end line should start with a newline, to make sure
-there are kept outside the narrowed region."
- :group 'org-edit-structure
- :type '(repeat
- (list
- (regexp :tag "begin regexp")
- (regexp :tag "end regexp")
- (choice :tag "language"
- (string :tag "specify")
- (integer :tag "from match group")
- (const :tag "from `lang' element")
- (const :tag "from `style' element")))))
-
-(defcustom org-coderef-label-format "(ref:%s)"
- "The default coderef format.
-This format string will be used to search for coderef labels in literal
-examples (EXAMPLE and SRC blocks). The format can be overwritten in
-an individual literal example with the -l option, like
-
-#+BEGIN_SRC pascal +n -r -l \"((%s))\"
-...
-#+END_SRC
-
-If you want to use this for HTML export, make sure that the format does
-not introduce special font-locking, and avoid the HTML special
-characters `<', `>', and `&'. The reason for this restriction is that
-the labels are searched for only after htmlize has done its job."
- :group 'org-edit-structure ; FIXME this is not in the right group
- :type 'string)
-
-(defcustom org-edit-fixed-width-region-mode 'artist-mode
- "The mode that should be used to edit fixed-width regions.
-These are the regions where each line starts with a colon."
- :group 'org-edit-structure
- :type '(choice
- (const artist-mode)
- (const picture-mode)
- (const fundamental-mode)
- (function :tag "Other (specify)")))
-
-(defcustom org-src-preserve-indentation nil
- "If non-nil preserve leading whitespace characters on export.
-If non-nil leading whitespace characters in source code blocks
-are preserved on export, and when switching between the org
-buffer and the language mode edit buffer. If this variable is nil
-then, after editing with \\[org-edit-src-code], the
-minimum (across-lines) number of leading whitespace characters
-are removed from all lines, and the code block is uniformly
-indented according to the value of `org-edit-src-content-indentation'."
- :group 'org-edit-structure
- :type 'boolean)
-
-(defcustom org-edit-src-content-indentation 2
- "Indentation for the content of a source code block.
-This should be the number of spaces added to the indentation of the #+begin
-line in order to compute the indentation of the block content after
-editing it with \\[org-edit-src-code]. Has no effect if
-`org-src-preserve-indentation' is non-nil."
- :group 'org-edit-structure
- :type 'integer)
-
-(defvar org-src-strip-leading-and-trailing-blank-lines nil
- "If non-nil, blank lines are removed when exiting the code edit
-buffer.")
-
-(defcustom org-edit-src-persistent-message t
- "Non-nil means show persistent exit help message while editing src examples.
-The message is shown in the header-line, which will be created in the
-first line of the window showing the editing buffer.
-When nil, the message will only be shown intermittently in the echo area."
- :group 'org-edit-structure
- :type 'boolean)
-
-(defcustom org-src-window-setup 'reorganize-frame
- "How the source code edit buffer should be displayed.
-Possible values for this option are:
-
-current-window Show edit buffer in the current window, keeping all other
- windows.
-other-window Use `switch-to-buffer-other-window' to display edit buffer.
-reorganize-frame Show only two windows on the current frame, the current
- window and the edit buffer. When exiting the edit buffer,
- return to one window.
-other-frame Use `switch-to-buffer-other-frame' to display edit buffer.
- Also, when exiting the edit buffer, kill that frame."
- :group 'org-edit-structure
- :type '(choice
- (const current-window)
- (const other-frame)
- (const other-window)
- (const reorganize-frame)))
-
-(defvar org-src-mode-hook nil
- "Hook run after Org switched a source code snippet to its Emacs mode.
-This hook will run
-
-- when editing a source code snippet with \"C-c '\".
-- When formatting a source code snippet for export with htmlize.
-
-You may want to use this hook for example to turn off `outline-minor-mode'
-or similar things which you want to have when editing a source code file,
-but which mess up the display of a snippet in Org exported files.")
-
-(defcustom org-src-lang-modes
- '(("ocaml" . tuareg) ("elisp" . emacs-lisp) ("ditaa" . artist)
- ("asymptote" . asy) ("dot" . fundamental) ("sqlite" . sql)
- ("calc" . fundamental))
- "Alist mapping languages to their major mode.
-The key is the language name, the value is the string that should
-be inserted as the name of the major mode. For many languages this is
-simple, but for language where this is not the case, this variable
-provides a way to simplify things on the user side.
-For example, there is no ocaml-mode in Emacs, but the mode to use is
-`tuareg-mode'."
- :group 'org-edit-structure
- :type '(repeat
- (cons
- (string "Language name")
- (symbol "Major mode"))))
-
-;;; Editing source examples
-
-(defvar org-src-mode-map (make-sparse-keymap))
-(define-key org-src-mode-map "\C-c'" 'org-edit-src-exit)
-
-(defvar org-edit-src-force-single-line nil)
-(defvar org-edit-src-from-org-mode nil)
-(defvar org-edit-src-allow-write-back-p t)
-(defvar org-edit-src-picture nil)
-(defvar org-edit-src-beg-marker nil)
-(defvar org-edit-src-end-marker nil)
-(defvar org-edit-src-overlay nil)
-(defvar org-edit-src-block-indentation nil)
-(defvar org-edit-src-saved-temp-window-config nil)
-
-(defvar org-src-ask-before-returning-to-edit-buffer t
- "If nil, when org-edit-src code is used on a block that already
- has an active edit buffer, it will switch to that edit buffer
- immediately; otherwise it will ask whether you want to return
- to the existing edit buffer.")
-
-(defvar org-src-babel-info nil)
-
-(define-minor-mode org-src-mode
- "Minor mode for language major mode buffers generated by org.
-This minor mode is turned on in two situations:
-- when editing a source code snippet with \"C-c '\".
-- When formatting a source code snippet for export with htmlize.
-There is a mode hook, and keybindings for `org-edit-src-exit' and
-`org-edit-src-save'")
-
-(defun org-edit-src-code (&optional context code edit-buffer-name quietp)
- "Edit the source code example at point.
-The example is copied to a separate buffer, and that buffer is
-switched to the correct language mode. When done, exit with
-\\[org-edit-src-exit]. This will remove the original code in the
-Org buffer, and replace it with the edited version. Optional
-argument CONTEXT is used by \\[org-edit-src-save] when calling
-this function. See \\[org-src-window-setup] to configure the
-display of windows containing the Org buffer and the code
-buffer."
- (interactive)
- (unless (eq context 'save)
- (setq org-edit-src-saved-temp-window-config (current-window-configuration)))
- (let ((mark (and (org-region-active-p) (mark)))
- (case-fold-search t)
- (info (org-edit-src-find-region-and-lang))
- (babel-info (org-babel-get-src-block-info 'light))
- (org-mode-p (eq major-mode 'org-mode))
- (beg (make-marker))
- (end (make-marker))
- (preserve-indentation org-src-preserve-indentation)
- (allow-write-back-p (null code))
- block-nindent total-nindent ovl lang lang-f single lfmt buffer msg
- begline markline markcol line col)
- (if (not info)
- nil
- (setq beg (move-marker beg (nth 0 info))
- end (move-marker end (nth 1 info))
- msg (if allow-write-back-p
- (substitute-command-keys
- "Edit, then exit with C-c ' (C-c and single quote)")
- "Exit with C-c ' (C-c and single quote)")
- code (or code (buffer-substring-no-properties beg end))
- lang (or (cdr (assoc (nth 2 info) org-src-lang-modes))
- (nth 2 info))
- lang (if (symbolp lang) (symbol-name lang) lang)
- single (nth 3 info)
- lfmt (nth 4 info)
- block-nindent (nth 5 info)
- lang-f (intern (concat lang "-mode"))
- begline (save-excursion (goto-char beg) (org-current-line)))
- (if (and mark (>= mark beg) (<= mark (1+ end)))
- (save-excursion (goto-char (min mark end))
- (setq markline (org-current-line)
- markcol (current-column))))
- (if (equal lang-f 'table.el-mode)
- (setq lang-f (lambda ()
- (text-mode)
- (if (org-bound-and-true-p flyspell-mode)
- (flyspell-mode -1))
- (table-recognize)
- (org-set-local 'org-edit-src-content-indentation 0))))
- (unless (functionp lang-f)
- (error "No such language mode: %s" lang-f))
- (save-excursion
- (if (> (point) end) (goto-char end))
- (setq line (org-current-line)
- col (current-column)))
- (if (and (setq buffer (org-edit-src-find-buffer beg end))
- (if org-src-ask-before-returning-to-edit-buffer
- (y-or-n-p "Return to existing edit buffer? [n] will revert changes: ") t))
- (org-src-switch-to-buffer buffer 'return)
- (when buffer
- (with-current-buffer buffer
- (if (boundp 'org-edit-src-overlay)
- (delete-overlay org-edit-src-overlay)))
- (kill-buffer buffer))
- (setq buffer (generate-new-buffer
- (or edit-buffer-name
- (org-src-construct-edit-buffer-name (buffer-name) lang))))
- (setq ovl (make-overlay beg end))
- (overlay-put ovl 'edit-buffer buffer)
- (overlay-put ovl 'help-echo "Click with mouse-1 to switch to buffer editing this segment")
- (overlay-put ovl 'face 'secondary-selection)
- (overlay-put ovl
- 'keymap
- (let ((map (make-sparse-keymap)))
- (define-key map [mouse-1] 'org-edit-src-continue)
- map))
- (overlay-put ovl :read-only "Leave me alone")
- (org-src-switch-to-buffer buffer 'edit)
- (if (eq single 'macro-definition)
- (setq code (replace-regexp-in-string "\\\\n" "\n" code t t)))
- (insert code)
- (remove-text-properties (point-min) (point-max)
- '(display nil invisible nil intangible nil))
- (unless preserve-indentation
- (setq total-nindent (or (org-do-remove-indentation) 0)))
- (let ((org-inhibit-startup t))
- (condition-case e
- (funcall lang-f)
- (error
- (error "Language mode `%s' fails with: %S" lang-f (nth 1 e)))))
- (set (make-local-variable 'org-edit-src-force-single-line) single)
- (set (make-local-variable 'org-edit-src-from-org-mode) org-mode-p)
- (set (make-local-variable 'org-edit-src-allow-write-back-p) allow-write-back-p)
- (set (make-local-variable 'org-src-preserve-indentation) preserve-indentation)
- (when babel-info
- (set (make-local-variable 'org-src-babel-info) babel-info))
- (when lfmt
- (set (make-local-variable 'org-coderef-label-format) lfmt))
- (when org-mode-p
- (goto-char (point-min))
- (while (re-search-forward "^," nil t)
- (if (eq (org-current-line) line) (setq total-nindent (1+ total-nindent)))
- (replace-match "")))
- (when markline
- (org-goto-line (1+ (- markline begline)))
- (org-move-to-column
- (if preserve-indentation markcol (max 0 (- markcol total-nindent))))
- (push-mark (point) 'no-message t)
- (setq deactivate-mark nil))
- (org-goto-line (1+ (- line begline)))
- (org-move-to-column
- (if preserve-indentation col (max 0 (- col total-nindent))))
- (org-set-local 'org-edit-src-beg-marker beg)
- (org-set-local 'org-edit-src-end-marker end)
- (org-set-local 'org-edit-src-overlay ovl)
- (org-set-local 'org-edit-src-block-indentation block-nindent)
- (org-src-mode)
- (set-buffer-modified-p nil)
- (and org-edit-src-persistent-message
- (org-set-local 'header-line-format msg)))
- (unless quietp (message "%s" msg))
- t)))
-
-(defun org-edit-src-continue (e)
- (interactive "e")
- (mouse-set-point e)
- (let ((buf (get-char-property (point) 'edit-buffer)))
- (if buf (org-src-switch-to-buffer buf 'continue)
- (error "Something is wrong here"))))
-
-(defun org-src-switch-to-buffer (buffer context)
- (case org-src-window-setup
- ('current-window
- (switch-to-buffer buffer))
- ('other-window
- (switch-to-buffer-other-window buffer))
- ('other-frame
- (case context
- ('exit
- (let ((frame (selected-frame)))
- (switch-to-buffer-other-frame buffer)
- (delete-frame frame)))
- ('save
- (kill-buffer (current-buffer))
- (switch-to-buffer buffer))
- (t
- (switch-to-buffer-other-frame buffer))))
- ('reorganize-frame
- (if (eq context 'edit) (delete-other-windows))
- (org-switch-to-buffer-other-window buffer)
- (if (eq context 'exit) (delete-other-windows)))
- ('switch-invisibly
- (set-buffer buffer))
- (t
- (message "Invalid value %s for org-src-window-setup"
- (symbol-name org-src-window-setup))
- (switch-to-buffer buffer))))
-
-(defun org-src-construct-edit-buffer-name (org-buffer-name lang)
- "Construct the buffer name for a source editing buffer."
- (concat "*Org Src " org-buffer-name "[ " lang " ]*"))
-
-(defun org-edit-src-find-buffer (beg end)
- "Find a source editing buffer that is already editing the region BEG to END."
- (catch 'exit
- (mapc
- (lambda (b)
- (with-current-buffer b
- (if (and (string-match "\\`*Org Src " (buffer-name))
- (local-variable-p 'org-edit-src-beg-marker (current-buffer))
- (local-variable-p 'org-edit-src-end-marker (current-buffer))
- (equal beg org-edit-src-beg-marker)
- (equal end org-edit-src-end-marker))
- (throw 'exit (current-buffer)))))
- (buffer-list))
- nil))
-
-(defun org-edit-fixed-width-region ()
- "Edit the fixed-width ascii drawing at point.
-This must be a region where each line starts with a colon followed by
-a space character.
-An new buffer is created and the fixed-width region is copied into it,
-and the buffer is switched into `artist-mode' for editing. When done,
-exit with \\[org-edit-src-exit]. The edited text will then replace
-the fragment in the Org-mode buffer."
- (interactive)
- (let ((line (org-current-line))
- (col (current-column))
- (case-fold-search t)
- (msg (substitute-command-keys
- "Edit, then exit with C-c ' (C-c and single quote)"))
- (org-mode-p (eq major-mode 'org-mode))
- (beg (make-marker))
- (end (make-marker))
- (preserve-indentation org-src-preserve-indentation)
- block-nindent ovl beg1 end1 code begline buffer)
- (beginning-of-line 1)
- (if (looking-at "[ \t]*[^:\n \t]")
- nil
- (if (looking-at "[ \t]*\\(\n\\|\\'\\)")
- (setq beg1 (point) end1 beg1)
- (save-excursion
- (if (re-search-backward "^[ \t]*[^: \t]" nil 'move)
- (setq beg1 (point-at-bol 2))
- (setq beg1 (point))))
- (save-excursion
- (if (re-search-forward "^[ \t]*[^: \t]" nil 'move)
- (setq end1 (1- (match-beginning 0)))
- (setq end1 (point))))
- (org-goto-line line))
- (setq beg (move-marker beg beg1)
- end (move-marker end end1)
- code (buffer-substring-no-properties beg end)
- begline (save-excursion (goto-char beg) (org-current-line)))
- (if (and (setq buffer (org-edit-src-find-buffer beg end))
- (y-or-n-p "Return to existing edit buffer? [n] will revert changes: "))
- (switch-to-buffer buffer)
- (when buffer
- (with-current-buffer buffer
- (if (boundp 'org-edit-src-overlay)
- (delete-overlay org-edit-src-overlay)))
- (kill-buffer buffer))
- (setq buffer (generate-new-buffer
- (org-src-construct-edit-buffer-name
- (buffer-name) "Fixed Width")))
- (setq ovl (make-overlay beg end))
- (overlay-put ovl 'face 'secondary-selection)
- (overlay-put ovl 'edit-buffer buffer)
- (overlay-put ovl 'help-echo "Click with mouse-1 to switch to buffer editing this segment")
- (overlay-put ovl 'face 'secondary-selection)
- (overlay-put ovl
- 'keymap
- (let ((map (make-sparse-keymap)))
- (define-key map [mouse-1] 'org-edit-src-continue)
- map))
- (overlay-put ovl :read-only "Leave me alone")
- (switch-to-buffer buffer)
- (insert code)
- (remove-text-properties (point-min) (point-max)
- '(display nil invisible nil intangible nil))
- (setq block-nindent (or (org-do-remove-indentation) 0))
- (cond
- ((eq org-edit-fixed-width-region-mode 'artist-mode)
- (fundamental-mode)
- (artist-mode 1))
- (t (funcall org-edit-fixed-width-region-mode)))
- (set (make-local-variable 'org-edit-src-force-single-line) nil)
- (set (make-local-variable 'org-edit-src-from-org-mode) org-mode-p)
- (set (make-local-variable 'org-edit-src-picture) t)
- (goto-char (point-min))
- (while (re-search-forward "^[ \t]*: ?" nil t)
- (replace-match ""))
- (org-goto-line (1+ (- line begline)))
- (org-move-to-column (max 0 (- col block-nindent 2)))
- (org-set-local 'org-edit-src-beg-marker beg)
- (org-set-local 'org-edit-src-end-marker end)
- (org-set-local 'org-edit-src-overlay ovl)
- (org-set-local 'org-edit-src-block-indentation block-nindent)
- (org-set-local 'org-edit-src-content-indentation 0)
- (org-set-local 'org-src-preserve-indentation nil)
- (org-src-mode)
- (set-buffer-modified-p nil)
- (and org-edit-src-persistent-message
- (org-set-local 'header-line-format msg)))
- (message "%s" msg)
- t)))
-
-(defun org-edit-src-find-region-and-lang ()
- "Find the region and language for a local edit.
-Return a list with beginning and end of the region, a string representing
-the language, a switch telling if the content should be in a single line."
- (let ((re-list
- (append
- org-edit-src-region-extra
- '(
- ("<src\\>[^<]*>[ \t]*\n?" "\n?[ \t]*</src>" lang)
- ("<literal\\>[^<]*>[ \t]*\n?" "\n?[ \t]*</literal>" style)
- ("<example>[ \t]*\n?" "\n?[ \t]*</example>" "fundamental")
- ("<lisp>[ \t]*\n?" "\n?[ \t]*</lisp>" "emacs-lisp")
- ("<perl>[ \t]*\n?" "\n?[ \t]*</perl>" "perl")
- ("<python>[ \t]*\n?" "\n?[ \t]*</python>" "python")
- ("<ruby>[ \t]*\n?" "\n?[ \t]*</ruby>" "ruby")
- ("^[ \t]*#\\+begin_src\\( \\([^ \t\n]+\\)\\)?.*\n" "\n[ \t]*#\\+end_src" 2)
- ("^[ \t]*#\\+begin_example.*\n" "\n[ \t]*#\\+end_example" "fundamental")
- ("^[ \t]*#\\+html:" "\n" "html" single-line)
- ("^[ \t]*#\\+begin_html.*\n" "\n[ \t]*#\\+end_html" "html")
- ("^[ \t]*#\\+latex:" "\n" "latex" single-line)
- ("^[ \t]*#\\+begin_latex.*\n" "\n[ \t]*#\\+end_latex" "latex")
- ("^[ \t]*#\\+ascii:" "\n" "fundamental" single-line)
- ("^[ \t]*#\\+begin_ascii.*\n" "\n[ \t]*#\\+end_ascii" "fundamental")
- ("^[ \t]*#\\+docbook:" "\n" "xml" single-line)
- ("^[ \t]*#\\+macro:[ \t]+\\S-+\\( \\|$\\)"
- "\n" "fundamental" macro-definition)
- ("^[ \t]*#\\+begin_docbook.*\n" "\n[ \t]*#\\+end_docbook" "xml")
- )))
- (pos (point))
- re1 re2 single beg end lang lfmt match-re1 ind entry)
- (catch 'exit
- (while (setq entry (pop re-list))
- (setq re1 (car entry) re2 (nth 1 entry) lang (nth 2 entry)
- single (nth 3 entry))
- (save-excursion
- (if (or (looking-at re1)
- (re-search-backward re1 nil t))
- (progn
- (setq match-re1 (match-string 0))
- (setq beg (match-end 0)
- lang (org-edit-src-get-lang lang)
- lfmt (org-edit-src-get-label-format match-re1)
- ind (org-edit-src-get-indentation (match-beginning 0)))
- (if (and (re-search-forward re2 nil t)
- (>= (match-end 0) pos))
- (throw 'exit (list beg (match-beginning 0)
- lang single lfmt ind))))
- (if (or (looking-at re2)
- (re-search-forward re2 nil t))
- (progn
- (setq end (match-beginning 0))
- (if (and (re-search-backward re1 nil t)
- (<= (match-beginning 0) pos))
- (progn
- (setq lfmt (org-edit-src-get-label-format
- (match-string 0))
- ind (org-edit-src-get-indentation
- (match-beginning 0)))
- (throw 'exit
- (list (match-end 0) end
- (org-edit-src-get-lang lang)
- single lfmt ind)))))))))
- (when (org-at-table.el-p)
- (re-search-backward "^[\t]*[^ \t|\\+]" nil t)
- (setq beg (1+ (point-at-eol)))
- (goto-char beg)
- (or (re-search-forward "^[\t]*[^ \t|\\+]" nil t)
- (progn (goto-char (point-max)) (newline)))
- (setq end (point-at-bol))
- (setq ind (org-edit-src-get-indentation beg))
- (throw 'exit (list beg end 'table.el nil nil ind))))))
-
-(defun org-edit-src-get-lang (lang)
- "Extract the src language."
- (let ((m (match-string 0)))
- (cond
- ((stringp lang) lang)
- ((integerp lang) (match-string lang))
- ((and (eq lang 'lang)
- (string-match "\\<lang=\"\\([^ \t\n\"]+\\)\"" m))
- (match-string 1 m))
- ((and (eq lang 'style)
- (string-match "\\<style=\"\\([^ \t\n\"]+\\)\"" m))
- (match-string 1 m))
- (t "fundamental"))))
-
-(defun org-edit-src-get-label-format (s)
- "Extract the label format."
- (save-match-data
- (if (string-match "-l[ \t]+\\\\?\"\\([^\t\r\n\"]+\\)\\\\?\"" s)
- (match-string 1 s))))
-
-(defun org-edit-src-get-indentation (pos)
- "Count leading whitespace characters on line."
- (save-match-data
- (goto-char pos)
- (org-get-indentation)))
-
-(defun org-edit-src-exit (&optional context)
- "Exit special edit and protect problematic lines."
- (interactive)
- (unless (org-bound-and-true-p org-edit-src-from-org-mode)
- (error "This is not a sub-editing buffer, something is wrong"))
- (widen)
- (let* ((beg org-edit-src-beg-marker)
- (end org-edit-src-end-marker)
- (ovl org-edit-src-overlay)
- (buffer (current-buffer))
- (single (org-bound-and-true-p org-edit-src-force-single-line))
- (macro (eq single 'macro-definition))
- (total-nindent (+ (or org-edit-src-block-indentation 0)
- org-edit-src-content-indentation))
- (preserve-indentation org-src-preserve-indentation)
- (allow-write-back-p (org-bound-and-true-p org-edit-src-allow-write-back-p))
- (delta 0) code line col indent)
- (when allow-write-back-p
- (unless preserve-indentation (untabify (point-min) (point-max)))
- (if org-src-strip-leading-and-trailing-blank-lines
- (save-excursion
- (goto-char (point-min))
- (if (looking-at "[ \t\n]*\n") (replace-match ""))
- (unless macro
- (if (re-search-forward "\n[ \t\n]*\\'" nil t) (replace-match ""))))))
- (setq line (if (org-bound-and-true-p org-edit-src-force-single-line)
- 1
- (org-current-line))
- col (current-column))
- (when allow-write-back-p
- (when single
- (goto-char (point-min))
- (if (re-search-forward "\\s-+\\'" nil t) (replace-match ""))
- (goto-char (point-min))
- (let ((cnt 0))
- (while (re-search-forward "\n" nil t)
- (setq cnt (1+ cnt))
- (replace-match (if macro "\\n" " ") t t))
- (when (and macro (> cnt 0))
- (goto-char (point-max)) (insert "\\n")))
- (goto-char (point-min))
- (if (looking-at "\\s-*") (replace-match " ")))
- (when (org-bound-and-true-p org-edit-src-from-org-mode)
- (goto-char (point-min))
- (while (re-search-forward
- (if (org-mode-p) "^\\(.\\)" "^\\([*]\\|[ \t]*#\\+\\)") nil t)
- (if (eq (org-current-line) line) (setq delta (1+ delta)))
- (replace-match ",\\1")))
- (when (org-bound-and-true-p org-edit-src-picture)
- (setq preserve-indentation nil)
- (untabify (point-min) (point-max))
- (goto-char (point-min))
- (while (re-search-forward "^" nil t)
- (replace-match ": ")))
- (unless (or single preserve-indentation (= total-nindent 0))
- (setq indent (make-string total-nindent ?\ ))
- (goto-char (point-min))
- (while (re-search-forward "^" nil t)
- (replace-match indent)))
- (if (org-bound-and-true-p org-edit-src-picture)
- (setq total-nindent (+ total-nindent 2)))
- (setq code (buffer-string))
- (set-buffer-modified-p nil))
- (org-src-switch-to-buffer (marker-buffer beg) (or context 'exit))
- (kill-buffer buffer)
- (goto-char beg)
- (when allow-write-back-p
- (delete-region beg end)
- (insert code)
- (goto-char beg)
- (if single (just-one-space)))
- (if (memq t (mapcar (lambda (overlay)
- (eq (overlay-get overlay 'invisible)
- 'org-hide-block))
- (overlays-at (point))))
- ;; Block is hidden; put point at start of block
- (beginning-of-line 0)
- ;; Block is visible, put point where it was in the code buffer
- (org-goto-line (1- (+ (org-current-line) line)))
- (org-move-to-column (if preserve-indentation col (+ col total-nindent delta))))
- (move-marker beg nil)
- (move-marker end nil))
- (unless (eq context 'save)
- (when org-edit-src-saved-temp-window-config
- (set-window-configuration org-edit-src-saved-temp-window-config)
- (setq org-edit-src-saved-temp-window-config nil))))
-
-(defun org-edit-src-save ()
- "Save parent buffer with current state source-code buffer."
- (interactive)
- (let ((p (point)) (m (mark)) msg)
- (save-window-excursion
- (org-edit-src-exit 'save)
- (save-buffer)
- (setq msg (current-message))
- (if (eq org-src-window-setup 'other-frame)
- (let ((org-src-window-setup 'current-window))
- (org-edit-src-code 'save))
- (org-edit-src-code 'save)))
- (push-mark m 'nomessage)
- (goto-char (min p (point-max)))
- (message (or msg ""))))
-
-(defun org-src-mode-configure-edit-buffer ()
- (when (org-bound-and-true-p org-edit-src-from-org-mode)
- (org-add-hook 'kill-buffer-hook
- '(lambda () (delete-overlay org-edit-src-overlay)) nil 'local)
- (if (org-bound-and-true-p org-edit-src-allow-write-back-p)
- (progn
- (setq buffer-offer-save t)
- (setq buffer-file-name
- (concat (buffer-file-name (marker-buffer org-edit-src-beg-marker))
- "[" (buffer-name) "]"))
- (if (featurep 'xemacs)
- (progn
- (make-variable-buffer-local 'write-contents-hooks) ; needed only for 21.4
- (setq write-contents-hooks '(org-edit-src-save)))
- (setq write-contents-functions '(org-edit-src-save))))
- (setq buffer-read-only t))))
-
-(org-add-hook 'org-src-mode-hook 'org-src-mode-configure-edit-buffer)
-
-
-(defun org-src-associate-babel-session (info)
- "Associate edit buffer with comint session."
- (interactive)
- (let ((session (cdr (assoc :session (nth 2 info)))))
- (and session (not (string= session "none"))
- (org-babel-comint-buffer-livep session)
- ((lambda (f) (and (fboundp f) (funcall f session)))
- (intern (format "org-babel-%s-associate-session" (nth 0 info)))))))
-
-(defun org-src-babel-configure-edit-buffer ()
- (when org-src-babel-info
- (org-src-associate-babel-session org-src-babel-info)))
-
-(org-add-hook 'org-src-mode-hook 'org-src-babel-configure-edit-buffer)
-(defmacro org-src-do-at-code-block (&rest body)
- "Execute a command from an edit buffer in the Org-mode buffer."
- `(let ((beg-marker org-edit-src-beg-marker))
- (if beg-marker
- (with-current-buffer (marker-buffer beg-marker)
- (goto-char (marker-position beg-marker))
- ,@body))))
-
-(defun org-src-do-key-sequence-at-code-block (&optional key)
- "Execute key sequence at code block in the source Org buffer.
-The command bound to KEY in the Org-babel key map is executed
-remotely with point temporarily at the start of the code block in
-the Org buffer.
-
-This command is not bound to a key by default, to avoid conflicts
-with language major mode bindings. To bind it to C-c @ in all
-language major modes, you could use
-
- (add-hook 'org-src-mode-hook
- (lambda () (define-key org-src-mode-map \"\\C-c@\"
- 'org-src-do-key-sequence-at-code-block)))
-
-In that case, for example, C-c @ t issued in code edit buffers
-would tangle the current Org code block, C-c @ e would execute
-the block and C-c @ h would display the other available
-Org-babel commands."
- (interactive "kOrg-babel key: ")
- (if (equal key (kbd "C-g")) (keyboard-quit)
- (org-edit-src-save)
- (org-src-do-at-code-block
- (call-interactively
- (lookup-key org-babel-map key)))))
-
-(defcustom org-src-tab-acts-natively nil
- "If non-nil, the effect of TAB in a code block is as if it were
-issued in the language major mode buffer."
- :type 'boolean
- :group 'org-babel)
-
-(defun org-src-native-tab-command-maybe ()
- "Perform language-specific TAB action.
-Alter code block according to effect of TAB in the language major
-mode."
- (and org-src-tab-acts-natively
- (let ((org-src-strip-leading-and-trailing-blank-lines nil))
- (org-babel-do-key-sequence-in-edit-buffer (kbd "TAB")))))
-
-(add-hook 'org-tab-first-hook 'org-src-native-tab-command-maybe)
-
-(defun org-src-font-lock-fontify-block (lang start end)
- "Fontify code block.
-This function is called by emacs automatic fontification, as long
-as `org-src-fontify-natively' is non-nil. For manual
-fontification of code blocks see `org-src-fontify-block' and
-`org-src-fontify-buffer'"
- (let* ((lang-mode (org-src-get-lang-mode lang))
- (string (buffer-substring-no-properties start end))
- (modified (buffer-modified-p))
- (org-buffer (current-buffer)) pos next)
- (remove-text-properties start end '(face nil))
- (with-current-buffer
- (get-buffer-create
- (concat " org-src-fontification:" (symbol-name lang-mode)))
- (delete-region (point-min) (point-max))
- (insert string)
- (unless (eq major-mode lang-mode) (funcall lang-mode))
- (font-lock-fontify-buffer)
- (setq pos (point-min))
- (while (setq next (next-single-property-change pos 'face))
- (put-text-property
- (+ start (1- pos)) (+ start next) 'face
- (get-text-property pos 'face) org-buffer)
- (setq pos next)))
- (add-text-properties
- start end
- '(font-lock-fontified t fontified t font-lock-multiline t))
- (set-buffer-modified-p modified))
- t) ;; Tell `org-fontify-meta-lines-and-blocks' that we fontified
-
-(defun org-src-fontify-block ()
- "Fontify code block at point."
- (interactive)
- (save-excursion
- (let ((org-src-fontify-natively t)
- (info (org-edit-src-find-region-and-lang)))
- (font-lock-fontify-region (nth 0 info) (nth 1 info)))))
-
-(defun org-src-fontify-buffer ()
- "Fontify all code blocks in the current buffer"
- (interactive)
- (org-babel-map-src-blocks nil
- (org-src-fontify-block)))
-
-(defun org-src-get-lang-mode (lang)
- "Return major mode that should be used for LANG.
-LANG is a string, and the returned major mode is a symbol."
- (intern
- (concat
- ((lambda (l) (if (symbolp l) (symbol-name l) l))
- (or (cdr (assoc lang org-src-lang-modes)) lang)) "-mode")))
-
-(provide 'org-src)
-
-;; arch-tag: 6a1fc84f-dec7-47be-a416-64be56bea5d8
-;;; org-src.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-src.elc b/.emacs.d/org-7.4/lisp/org-src.elc
deleted file mode 100644
index 007e002..0000000
--- a/.emacs.d/org-7.4/lisp/org-src.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-table.el b/.emacs.d/org-7.4/lisp/org-table.el
deleted file mode 100644
index 116c3fc..0000000
--- a/.emacs.d/org-7.4/lisp/org-table.el
+++ /dev/null
@@ -1,4398 +0,0 @@
-;;; org-table.el --- The table editor for Org-mode
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file contains the table editor and spreadsheet for Org-mode.
-
-;; Watch out: Here we are talking about two different kind of tables.
-;; Most of the code is for the tables created with the Org-mode table editor.
-;; Sometimes, we talk about tables created and edited with the table.el
-;; Emacs package. We call the former org-type tables, and the latter
-;; table.el-type tables.
-
-;;; Code:
-
-(eval-when-compile
- (require 'cl))
-(require 'org)
-
-(declare-function org-table-clean-before-export "org-exp"
- (lines &optional maybe-quoted))
-(declare-function org-format-org-table-html "org-html" (lines &optional splice))
-(defvar orgtbl-mode) ; defined below
-(defvar orgtbl-mode-menu) ; defined when orgtbl mode get initialized
-(defvar org-export-html-table-tag) ; defined in org-exp.el
-(defvar constants-unit-system)
-
-(defvar orgtbl-after-send-table-hook nil
- "Hook for functions attaching to `C-c C-c', if the table is sent.
-This can be used to add additional functionality after the table is sent
-to the receiver position, othewise, if table is not sent, the functions
-are not run.")
-
-(defcustom orgtbl-optimized (eq org-enable-table-editor 'optimized)
- "Non-nil means use the optimized table editor version for `orgtbl-mode'.
-In the optimized version, the table editor takes over all simple keys that
-normally just insert a character. In tables, the characters are inserted
-in a way to minimize disturbing the table structure (i.e. in overwrite mode
-for empty fields). Outside tables, the correct binding of the keys is
-restored.
-
-The default for this option is t if the optimized version is also used in
-Org-mode. See the variable `org-enable-table-editor' for details. Changing
-this variable requires a restart of Emacs to become effective."
- :group 'org-table
- :type 'boolean)
-
-(defcustom orgtbl-radio-table-templates
- '((latex-mode "% BEGIN RECEIVE ORGTBL %n
-% END RECEIVE ORGTBL %n
-\\begin{comment}
-#+ORGTBL: SEND %n orgtbl-to-latex :splice nil :skip 0
-| | |
-\\end{comment}\n")
- (texinfo-mode "@c BEGIN RECEIVE ORGTBL %n
-@c END RECEIVE ORGTBL %n
-@ignore
-#+ORGTBL: SEND %n orgtbl-to-html :splice nil :skip 0
-| | |
-@end ignore\n")
- (html-mode "<!-- BEGIN RECEIVE ORGTBL %n -->
-<!-- END RECEIVE ORGTBL %n -->
-<!--
-#+ORGTBL: SEND %n orgtbl-to-html :splice nil :skip 0
-| | |
--->\n"))
- "Templates for radio tables in different major modes.
-All occurrences of %n in a template will be replaced with the name of the
-table, obtained by prompting the user."
- :group 'org-table
- :type '(repeat
- (list (symbol :tag "Major mode")
- (string :tag "Format"))))
-
-(defgroup org-table-settings nil
- "Settings for tables in Org-mode."
- :tag "Org Table Settings"
- :group 'org-table)
-
-(defcustom org-table-default-size "5x2"
- "The default size for newly created tables, Columns x Rows."
- :group 'org-table-settings
- :type 'string)
-
-(defcustom org-table-number-regexp
- "^\\([<>]?[-+^.0-9]*[0-9][-+^.0-9eEdDx()%:]*\\|\\(0[xX]\\)[0-9a-fA-F]+\\|nan\\)$"
- "Regular expression for recognizing numbers in table columns.
-If a table column contains mostly numbers, it will be aligned to the
-right. If not, it will be aligned to the left.
-
-The default value of this option is a regular expression which allows
-anything which looks remotely like a number as used in scientific
-context. For example, all of the following will be considered a
-number:
- 12 12.2 2.4e-08 2x10^12 4.034+-0.02 2.7(10) >3.5
-
-Other options offered by the customize interface are more restrictive."
- :group 'org-table-settings
- :type '(choice
- (const :tag "Positive Integers"
- "^[0-9]+$")
- (const :tag "Integers"
- "^[-+]?[0-9]+$")
- (const :tag "Floating Point Numbers"
- "^[-+]?\\([0-9]*\\.[0-9]+\\|[0-9]+\\.[0-9]*\\)$")
- (const :tag "Floating Point Number or Integer"
- "^[-+]?\\([0-9]*\\.[0-9]+\\|[0-9]+\\.?[0-9]*\\)$")
- (const :tag "Exponential, Floating point, Integer"
- "^[-+]?[0-9.]+\\([eEdD][-+0-9]+\\)?$")
- (const :tag "Very General Number-Like, including hex"
- "^\\([<>]?[-+^.0-9]*[0-9][-+^.0-9eEdDx()%]*\\|\\(0[xX]\\)[0-9a-fA-F]+\\|nan\\)$")
- (string :tag "Regexp:")))
-
-(defcustom org-table-number-fraction 0.5
- "Fraction of numbers in a column required to make the column align right.
-In a column all non-white fields are considered. If at least this
-fraction of fields is matched by `org-table-number-fraction',
-alignment to the right border applies."
- :group 'org-table-settings
- :type 'number)
-
-(defgroup org-table-editing nil
- "Behavior of tables during editing in Org-mode."
- :tag "Org Table Editing"
- :group 'org-table)
-
-(defcustom org-table-automatic-realign t
- "Non-nil means automatically re-align table when pressing TAB or RETURN.
-When nil, aligning is only done with \\[org-table-align], or after column
-removal/insertion."
- :group 'org-table-editing
- :type 'boolean)
-
-(defcustom org-table-auto-blank-field t
- "Non-nil means automatically blank table field when starting to type into it.
-This only happens when typing immediately after a field motion
-command (TAB, S-TAB or RET).
-Only relevant when `org-enable-table-editor' is equal to `optimized'."
- :group 'org-table-editing
- :type 'boolean)
-
-(defcustom org-table-tab-jumps-over-hlines t
- "Non-nil means tab in the last column of a table with jump over a hline.
-If a horizontal separator line is following the current line,
-`org-table-next-field' can either create a new row before that line, or jump
-over the line. When this option is nil, a new line will be created before
-this line."
- :group 'org-table-editing
- :type 'boolean)
-
-(defgroup org-table-calculation nil
- "Options concerning tables in Org-mode."
- :tag "Org Table Calculation"
- :group 'org-table)
-
-(defcustom org-table-use-standard-references t
- "Should org-mode work with table references like B3 instead of @3$2?
-Possible values are:
-nil never use them
-from accept as input, do not present for editing
-t: accept as input and present for editing"
- :group 'org-table-calculation
- :type '(choice
- (const :tag "Never, don't even check user input for them" nil)
- (const :tag "Always, both as user input, and when editing" t)
- (const :tag "Convert user input, don't offer during editing" 'from)))
-
-(defcustom org-table-copy-increment t
- "Non-nil means increment when copying current field with \\[org-table-copy-down]."
- :group 'org-table-calculation
- :type 'boolean)
-
-(defcustom org-calc-default-modes
- '(calc-internal-prec 12
- calc-float-format (float 8)
- calc-angle-mode deg
- calc-prefer-frac nil
- calc-symbolic-mode nil
- calc-date-format (YYYY "-" MM "-" DD " " Www (" " hh ":" mm))
- calc-display-working-message t
- )
- "List with Calc mode settings for use in `calc-eval' for table formulas.
-The list must contain alternating symbols (Calc modes variables and values).
-Don't remove any of the default settings, just change the values. Org-mode
-relies on the variables to be present in the list."
- :group 'org-table-calculation
- :type 'plist)
-
-(defcustom org-table-formula-evaluate-inline t
- "Non-nil means TAB and RET evaluate a formula in current table field.
-If the current field starts with an equal sign, it is assumed to be a formula
-which should be evaluated as described in the manual and in the documentation
-string of the command `org-table-eval-formula'. This feature requires the
-Emacs calc package.
-When this variable is nil, formula calculation is only available through
-the command \\[org-table-eval-formula]."
- :group 'org-table-calculation
- :type 'boolean)
-
-(defcustom org-table-formula-use-constants t
- "Non-nil means interpret constants in formulas in tables.
-A constant looks like `$c' or `$Grav' and will be replaced before evaluation
-by the value given in `org-table-formula-constants', or by a value obtained
-from the `constants.el' package."
- :group 'org-table-calculation
- :type 'boolean)
-
-(defcustom org-table-formula-constants nil
- "Alist with constant names and values, for use in table formulas.
-The car of each element is a name of a constant, without the `$' before it.
-The cdr is the value as a string. For example, if you'd like to use the
-speed of light in a formula, you would configure
-
- (setq org-table-formula-constants '((\"c\" . \"299792458.\")))
-
-and then use it in an equation like `$1*$c'.
-
-Constants can also be defined on a per-file basis using a line like
-
-#+CONSTANTS: c=299792458. pi=3.14 eps=2.4e-6"
- :group 'org-table-calculation
- :type '(repeat
- (cons (string :tag "name")
- (string :tag "value"))))
-
-(defcustom org-table-allow-automatic-line-recalculation t
- "Non-nil means lines marked with |#| or |*| will be recomputed automatically.
-Automatically means when TAB or RET or C-c C-c are pressed in the line."
- :group 'org-table-calculation
- :type 'boolean)
-
-(defcustom org-table-error-on-row-ref-crossing-hline t
- "OBSOLETE VARIABLE, please see `org-table-relative-ref-may-cross-hline'."
- :group 'org-table
- :type 'boolean)
-
-(defcustom org-table-relative-ref-may-cross-hline t
- "Non-nil means relative formula references may cross hlines.
-Here are the allowed values:
-
-nil Relative references may not cross hlines. They will reference the
- field next to the hline instead. Coming from below, the reference
- will be to the field below the hline. Coming from above, it will be
- to the field above.
-t Relative references may cross hlines.
-error An attempt to cross a hline will throw an error.
-
-It is probably good to never set this variable to nil, for the sake of
-portability of tables."
- :group 'org-table-calculation
- :type '(choice
- (const :tag "Allow to cross" t)
- (const :tag "Stick to hline" nil)
- (const :tag "Error on attempt to cross" error)))
-
-(defgroup org-table-import-export nil
- "Options concerning table import and export in Org-mode."
- :tag "Org Table Import Export"
- :group 'org-table)
-
-(defcustom org-table-export-default-format "orgtbl-to-tsv"
- "Default export parameters for `org-table-export'.
-These can be overridden for a specific table by setting the
-TABLE_EXPORT_FORMAT property. See the manual section on orgtbl
-radio tables for the different export transformations and
-available parameters."
- :group 'org-table-import-export
- :type 'string)
-
-(defconst org-table-auto-recalculate-regexp "^[ \t]*| *# *\\(|\\|$\\)"
- "Detects a table line marked for automatic recalculation.")
-(defconst org-table-recalculate-regexp "^[ \t]*| *[#*] *\\(|\\|$\\)"
- "Detects a table line marked for automatic recalculation.")
-(defconst org-table-calculate-mark-regexp "^[ \t]*| *[!$^_#*] *\\(|\\|$\\)"
- "Detects a table line marked for automatic recalculation.")
-(defconst org-table-border-regexp "^[ \t]*[^| \t]"
- "Searching from within a table (any type) this finds the first line outside the table.")
-(defvar org-table-last-highlighted-reference nil)
-(defvar org-table-formula-history nil)
-
-(defvar org-table-column-names nil
- "Alist with column names, derived from the `!' line.")
-(defvar org-table-column-name-regexp nil
- "Regular expression matching the current column names.")
-(defvar org-table-local-parameters nil
- "Alist with parameter names, derived from the `$' line.")
-(defvar org-table-named-field-locations nil
- "Alist with locations of named fields.")
-
-(defvar org-table-current-line-types nil
- "Table row types, non-nil only for the duration of a command.")
-(defvar org-table-current-begin-line nil
- "Table begin line, non-nil only for the duration of a command.")
-(defvar org-table-current-begin-pos nil
- "Table begin position, non-nil only for the duration of a command.")
-(defvar org-table-dlines nil
- "Vector of data line line numbers in the current table.")
-(defvar org-table-hlines nil
- "Vector of hline line numbers in the current table.")
-
-(defconst org-table-range-regexp
- "@\\([-+]?I*[-+]?[0-9]*\\)?\\(\\$[-+]?[0-9]+\\)?\\(\\.\\.@?\\([-+]?I*[-+]?[0-9]*\\)?\\(\\$[-+]?[0-9]+\\)?\\)?"
- ;; 1 2 3 4 5
- "Regular expression for matching ranges in formulas.")
-
-(defconst org-table-range-regexp2
- (concat
- "\\(" "@[-0-9I$&]+" "\\|" "[a-zA-Z]\\{1,2\\}\\([0-9]+\\|&\\)" "\\|" "\\$[a-zA-Z0-9]+" "\\)"
- "\\.\\."
- "\\(" "@?[-0-9I$&]+" "\\|" "[a-zA-Z]\\{1,2\\}\\([0-9]+\\|&\\)" "\\|" "\\$[a-zA-Z0-9]+" "\\)")
- "Match a range for reference display.")
-
-(defun org-table-colgroup-line-p (line)
- "Is this a table line colgroup information?"
- (save-match-data
- (and (string-match "[<>]\\|&[lg]t;" line)
- (string-match "\\`[ \t]*|[ \t]*/[ \t]*\\(|[ \t<>0-9|lgt&;]+\\)\\'"
- line)
- (not (delq
- nil
- (mapcar
- (lambda (s)
- (not (member s '("" "<" ">" "<>" "&lt;" "&gt;" "&lt;&gt;"))))
- (org-split-string (match-string 1 line) "[ \t]*|[ \t]*")))))))
-
-(defun org-table-cookie-line-p (line)
- "Is this a table line with only alignment/width cookies?"
- (save-match-data
- (and (string-match "[<>]\\|&[lg]t;" line)
- (or (string-match
- "\\`[ \t]*|[ \t]*/[ \t]*\\(|[ \t<>0-9|lrcgt&;]+\\)\\'" line)
- (string-match "\\(\\`[ \t<>lrc0-9|gt&;]+\\'\\)" line))
- (not (delq nil (mapcar
- (lambda (s)
- (not (or (equal s "")
- (string-match
- "\\`<\\([lrc]?[0-9]+\\|[lrc]\\)>\\'" s)
- (string-match
- "\\`&lt;\\([lrc]?[0-9]+\\|[lrc]\\)&gt;\\'"
- s))))
- (org-split-string (match-string 1 line)
- "[ \t]*|[ \t]*")))))))
-
-(defconst org-table-translate-regexp
- (concat "\\(" "@[-0-9I$]+" "\\|" "[a-zA-Z]\\{1,2\\}\\([0-9]+\\|&\\)" "\\)")
- "Match a reference that needs translation, for reference display.")
-
-(defun org-table-create-with-table.el ()
- "Use the table.el package to insert a new table.
-If there is already a table at point, convert between Org-mode tables
-and table.el tables."
- (interactive)
- (require 'table)
- (cond
- ((org-at-table.el-p)
- (if (y-or-n-p "Convert table to Org-mode table? ")
- (org-table-convert)))
- ((org-at-table-p)
- (when (y-or-n-p "Convert table to table.el table? ")
- (org-table-align)
- (org-table-convert)))
- (t (call-interactively 'table-insert))))
-
-(defun org-table-create-or-convert-from-region (arg)
- "Convert region to table, or create an empty table.
-If there is an active region, convert it to a table, using the function
-`org-table-convert-region'. See the documentation of that function
-to learn how the prefix argument is interpreted to determine the field
-separator.
-If there is no such region, create an empty table with `org-table-create'."
- (interactive "P")
- (if (org-region-active-p)
- (org-table-convert-region (region-beginning) (region-end) arg)
- (org-table-create arg)))
-
-(defun org-table-create (&optional size)
- "Query for a size and insert a table skeleton.
-SIZE is a string Columns x Rows like for example \"3x2\"."
- (interactive "P")
- (unless size
- (setq size (read-string
- (concat "Table size Columns x Rows [e.g. "
- org-table-default-size "]: ")
- "" nil org-table-default-size)))
-
- (let* ((pos (point))
- (indent (make-string (current-column) ?\ ))
- (split (org-split-string size " *x *"))
- (rows (string-to-number (nth 1 split)))
- (columns (string-to-number (car split)))
- (line (concat (apply 'concat indent "|" (make-list columns " |"))
- "\n")))
- (if (string-match "^[ \t]*$" (buffer-substring-no-properties
- (point-at-bol) (point)))
- (beginning-of-line 1)
- (newline))
- ;; (mapcar (lambda (x) (insert line)) (make-list rows t))
- (dotimes (i rows) (insert line))
- (goto-char pos)
- (if (> rows 1)
- ;; Insert a hline after the first row.
- (progn
- (end-of-line 1)
- (insert "\n|-")
- (goto-char pos)))
- (org-table-align)))
-
-(defun org-table-convert-region (beg0 end0 &optional separator)
- "Convert region to a table.
-The region goes from BEG0 to END0, but these borders will be moved
-slightly, to make sure a beginning of line in the first line is included.
-
-SEPARATOR specifies the field separator in the lines. It can have the
-following values:
-
-'(4) Use the comma as a field separator
-'(16) Use a TAB as field separator
-integer When a number, use that many spaces as field separator
-nil When nil, the command tries to be smart and figure out the
- separator in the following way:
- - when each line contains a TAB, assume TAB-separated material
- - when each line contains a comma, assume CSV material
- - else, assume one or more SPACE characters as separator."
- (interactive "rP")
- (let* ((beg (min beg0 end0))
- (end (max beg0 end0))
- re)
- (goto-char beg)
- (beginning-of-line 1)
- (setq beg (move-marker (make-marker) (point)))
- (goto-char end)
- (if (bolp) (backward-char 1) (end-of-line 1))
- (setq end (move-marker (make-marker) (point)))
- ;; Get the right field separator
- (unless separator
- (goto-char beg)
- (setq separator
- (cond
- ((not (re-search-forward "^[^\n\t]+$" end t)) '(16))
- ((not (re-search-forward "^[^\n,]+$" end t)) '(4))
- (t 1))))
- (goto-char beg)
- (if (equal separator '(4))
- (while (< (point) end)
- ;; parse the csv stuff
- (cond
- ((looking-at "^") (insert "| "))
- ((looking-at "[ \t]*$") (replace-match " |") (beginning-of-line 2))
- ((looking-at "[ \t]*\"\\([^\"\n]*\\)\"")
- (replace-match "\\1")
- (if (looking-at "\"") (insert "\"")))
- ((looking-at "[^,\n]+") (goto-char (match-end 0)))
- ((looking-at "[ \t]*,") (replace-match " | "))
- (t (beginning-of-line 2))))
- (setq re (cond
- ((equal separator '(4)) "^\\|\"?[ \t]*,[ \t]*\"?")
- ((equal separator '(16)) "^\\|\t")
- ((integerp separator)
- (format "^ *\\| *\t *\\| \\{%d,\\}" separator))
- (t (error "This should not happen"))))
- (while (re-search-forward re end t)
- (replace-match "| " t t)))
- (goto-char beg)
- (org-table-align)))
-
-(defun org-table-import (file arg)
- "Import FILE as a table.
-The file is assumed to be tab-separated. Such files can be produced by most
-spreadsheet and database applications. If no tabs (at least one per line)
-are found, lines will be split on whitespace into fields."
- (interactive "f\nP")
- (or (bolp) (newline))
- (let ((beg (point))
- (pm (point-max)))
- (insert-file-contents file)
- (org-table-convert-region beg (+ (point) (- (point-max) pm)) arg)))
-
-
-(defvar org-table-last-alignment)
-(defvar org-table-last-column-widths)
-(defun org-table-export (&optional file format)
- "Export table to a file, with configurable format.
-Such a file can be imported into a spreadsheet program like Excel.
-FILE can be the output file name. If not given, it will be taken from
-a TABLE_EXPORT_FILE property in the current entry or higher up in the
-hierarchy, or the user will be prompted for a file name.
-FORMAT can be an export format, of the same kind as it used when
-`orgtbl-mode' sends a table in a different format. The default format can
-be found in the variable `org-table-export-default-format', but the function
-first checks if there is an export format specified in a TABLE_EXPORT_FORMAT
-property, locally or anywhere up in the hierarchy."
- (interactive)
- (unless (org-at-table-p)
- (error "No table at point"))
- (require 'org-exp)
- (org-table-align) ;; make sure we have everything we need
- (let* ((beg (org-table-begin))
- (end (org-table-end))
- (txt (buffer-substring-no-properties beg end))
- (file (or file
- (condition-case nil
- (org-entry-get beg "TABLE_EXPORT_FILE" t)
- (error nil))))
- (format (or format
- (condition-case nil
- (org-entry-get beg "TABLE_EXPORT_FORMAT" t)
- (error nil))))
- buf deffmt-readable)
- (unless file
- (setq file (read-file-name "Export table to: "))
- (unless (or (not (file-exists-p file))
- (y-or-n-p (format "Overwrite file %s? " file)))
- (error "Abort")))
- (if (file-directory-p file)
- (error "This is a directory path, not a file"))
- (if (and (buffer-file-name)
- (equal (file-truename file)
- (file-truename (buffer-file-name))))
- (error "Please specify a file name that is different from current"))
- (unless format
- (setq deffmt-readable org-table-export-default-format)
- (while (string-match "\t" deffmt-readable)
- (setq deffmt-readable (replace-match "\\t" t t deffmt-readable)))
- (while (string-match "\n" deffmt-readable)
- (setq deffmt-readable (replace-match "\\n" t t deffmt-readable)))
- (setq format (org-completing-read
- "Format: "
- '("orgtbl-to-tsv" "orgtbl-to-csv"
- "orgtbl-to-latex" "orgtbl-to-html"
- "orgtbl-to-generic" "orgtbl-to-texinfo"
- "orgtbl-to-orgtbl") nil nil
- deffmt-readable)))
- (if (string-match "\\([^ \t\r\n]+\\)\\( +.*\\)?" format)
- (let* ((transform (intern (match-string 1 format)))
- (params (if (match-end 2)
- (read (concat "(" (match-string 2 format) ")"))))
- (skip (plist-get params :skip))
- (skipcols (plist-get params :skipcols))
- (lines (nthcdr (or skip 0) (org-split-string txt "[ \t]*\n[ \t]*")))
- (lines (org-table-clean-before-export lines))
- (i0 (if org-table-clean-did-remove-column 2 1))
- (table (mapcar
- (lambda (x)
- (if (string-match org-table-hline-regexp x)
- 'hline
- (org-remove-by-index
- (org-split-string (org-trim x) "\\s-*|\\s-*")
- skipcols i0)))
- lines))
- (fun (if (= i0 2) 'cdr 'identity))
- (org-table-last-alignment
- (org-remove-by-index (funcall fun org-table-last-alignment)
- skipcols i0))
- (org-table-last-column-widths
- (org-remove-by-index (funcall fun org-table-last-column-widths)
- skipcols i0)))
-
- (unless (fboundp transform)
- (error "No such transformation function %s" transform))
- (setq txt (funcall transform table params))
-
- (with-current-buffer (find-file-noselect file)
- (setq buf (current-buffer))
- (erase-buffer)
- (fundamental-mode)
- (insert txt "\n")
- (save-buffer))
- (kill-buffer buf)
- (message "Export done."))
- (error "TABLE_EXPORT_FORMAT invalid"))))
-
-(defvar org-table-aligned-begin-marker (make-marker)
- "Marker at the beginning of the table last aligned.
-Used to check if cursor still is in that table, to minimize realignment.")
-(defvar org-table-aligned-end-marker (make-marker)
- "Marker at the end of the table last aligned.
-Used to check if cursor still is in that table, to minimize realignment.")
-(defvar org-table-last-alignment nil
- "List of flags for flushright alignment, from the last re-alignment.
-This is being used to correctly align a single field after TAB or RET.")
-(defvar org-table-last-column-widths nil
- "List of max width of fields in each column.
-This is being used to correctly align a single field after TAB or RET.")
-(defvar org-table-formula-debug nil
- "Non-nil means debug table formulas.
-When nil, simply write \"#ERROR\" in corrupted fields.")
-(make-variable-buffer-local 'org-table-formula-debug)
-(defvar org-table-overlay-coordinates nil
- "Overlay coordinates after each align of a table.")
-(make-variable-buffer-local 'org-table-overlay-coordinates)
-
-(defvar org-last-recalc-line nil)
-(defvar org-table-do-narrow t) ; for dynamic scoping
-(defconst org-narrow-column-arrow "=>"
- "Used as display property in narrowed table columns.")
-
-(defun org-table-align ()
- "Align the table at point by aligning all vertical bars."
- (interactive)
- (let* (
- ;; Limits of table
- (beg (org-table-begin))
- (end (org-table-end))
- ;; Current cursor position
- (linepos (org-current-line))
- (colpos (org-table-current-column))
- (winstart (window-start))
- (winstartline (org-current-line (min winstart (1- (point-max)))))
- lines (new "") lengths l typenums ty fields maxfields i
- column
- (indent "") cnt frac
- rfmt hfmt
- (spaces '(1 . 1))
- (sp1 (car spaces))
- (sp2 (cdr spaces))
- (rfmt1 (concat
- (make-string sp2 ?\ ) "%%%s%ds" (make-string sp1 ?\ ) "|"))
- (hfmt1 (concat
- (make-string sp2 ?-) "%s" (make-string sp1 ?-) "+"))
- emptystrings links dates emph raise narrow
- falign falign1 fmax f1 len c e space)
- (untabify beg end)
- (remove-text-properties beg end '(org-cwidth t org-dwidth t display t))
- ;; Check if we have links or dates
- (goto-char beg)
- (setq links (re-search-forward org-bracket-link-regexp end t))
- (goto-char beg)
- (setq emph (and org-hide-emphasis-markers
- (re-search-forward org-emph-re end t)))
- (goto-char beg)
- (setq raise (and org-use-sub-superscripts
- (re-search-forward org-match-substring-regexp end t)))
- (goto-char beg)
- (setq dates (and org-display-custom-times
- (re-search-forward org-ts-regexp-both end t)))
- ;; Make sure the link properties are right
- (when links (goto-char beg) (while (org-activate-bracket-links end)))
- ;; Make sure the date properties are right
- (when dates (goto-char beg) (while (org-activate-dates end)))
- (when emph (goto-char beg) (while (org-do-emphasis-faces end)))
- (when raise (goto-char beg) (while (org-raise-scripts end)))
-
- ;; Check if we are narrowing any columns
- (goto-char beg)
- (setq narrow (and org-table-do-narrow
- org-format-transports-properties-p
- (re-search-forward "<[lrc]?[0-9]+>" end t)))
- (goto-char beg)
- (setq falign (re-search-forward "<[lrc][0-9]*>" end t))
- (goto-char beg)
- ;; Get the rows
- (setq lines (org-split-string
- (buffer-substring beg end) "\n"))
- ;; Store the indentation of the first line
- (if (string-match "^ *" (car lines))
- (setq indent (make-string (- (match-end 0) (match-beginning 0)) ?\ )))
- ;; Mark the hlines by setting the corresponding element to nil
- ;; At the same time, we remove trailing space.
- (setq lines (mapcar (lambda (l)
- (if (string-match "^ *|-" l)
- nil
- (if (string-match "[ \t]+$" l)
- (substring l 0 (match-beginning 0))
- l)))
- lines))
- ;; Get the data fields by splitting the lines.
- (setq fields (mapcar
- (lambda (l)
- (org-split-string l " *| *"))
- (delq nil (copy-sequence lines))))
- ;; How many fields in the longest line?
- (condition-case nil
- (setq maxfields (apply 'max (mapcar 'length fields)))
- (error
- (kill-region beg end)
- (org-table-create org-table-default-size)
- (error "Empty table - created default table")))
- ;; A list of empty strings to fill any short rows on output
- (setq emptystrings (make-list maxfields ""))
- ;; Check for special formatting.
- (setq i -1)
- (while (< (setq i (1+ i)) maxfields) ;; Loop over all columns
- (setq column (mapcar (lambda (x) (or (nth i x) "")) fields))
- ;; Check if there is an explicit width specified
- (setq fmax nil)
- (when (or narrow falign)
- (setq c column fmax nil falign1 nil)
- (while c
- (setq e (pop c))
- (when (and (stringp e) (string-match "^<\\([lrc]\\)?\\([0-9]+\\)?>$" e))
- (if (match-end 1) (setq falign1 (match-string 1 e)))
- (if (and org-table-do-narrow (match-end 2))
- (setq fmax (string-to-number (match-string 2 e)) c nil))))
- ;; Find fields that are wider than fmax, and shorten them
- (when fmax
- (loop for xx in column do
- (when (and (stringp xx)
- (> (org-string-width xx) fmax))
- (org-add-props xx nil
- 'help-echo
- (concat "Clipped table field, use C-c ` to edit. Full value is:\n" (org-no-properties (copy-sequence xx))))
- (setq f1 (min fmax (or (string-match org-bracket-link-regexp xx) fmax)))
- (unless (> f1 1)
- (error "Cannot narrow field starting with wide link \"%s\""
- (match-string 0 xx)))
- (add-text-properties f1 (length xx) (list 'org-cwidth t) xx)
- (add-text-properties (- f1 2) f1
- (list 'display org-narrow-column-arrow)
- xx)))))
- ;; Get the maximum width for each column
- (push (apply 'max (or fmax 1) 1 (mapcar 'org-string-width column))
- lengths)
- ;; Get the fraction of numbers, to decide about alignment of the column
- (if falign1
- (push (equal (downcase falign1) "r") typenums)
- (setq cnt 0 frac 0.0)
- (loop for x in column do
- (if (equal x "")
- nil
- (setq frac ( / (+ (* frac cnt)
- (if (string-match org-table-number-regexp x) 1 0))
- (setq cnt (1+ cnt))))))
- (push (>= frac org-table-number-fraction) typenums)))
- (setq lengths (nreverse lengths) typenums (nreverse typenums))
-
- ;; Store the alignment of this table, for later editing of single fields
- (setq org-table-last-alignment typenums
- org-table-last-column-widths lengths)
-
- ;; With invisible characters, `format' does not get the field width right
- ;; So we need to make these fields wide by hand.
- (when (or links emph raise)
- (loop for i from 0 upto (1- maxfields) do
- (setq len (nth i lengths))
- (loop for j from 0 upto (1- (length fields)) do
- (setq c (nthcdr i (car (nthcdr j fields))))
- (if (and (stringp (car c))
- (or (text-property-any 0 (length (car c))
- 'invisible 'org-link (car c))
- (text-property-any 0 (length (car c))
- 'org-dwidth t (car c)))
- (< (org-string-width (car c)) len))
- (progn
- (setq space (make-string (- len (org-string-width (car c))) ?\ ))
- (setcar c (if (nth i typenums)
- (concat space (car c))
- (concat (car c) space))))))))
-
- ;; Compute the formats needed for output of the table
- (setq rfmt (concat indent "|") hfmt (concat indent "|"))
- (while (setq l (pop lengths))
- (setq ty (if (pop typenums) "" "-")) ; number types flushright
- (setq rfmt (concat rfmt (format rfmt1 ty l))
- hfmt (concat hfmt (format hfmt1 (make-string l ?-)))))
- (setq rfmt (concat rfmt "\n")
- hfmt (concat (substring hfmt 0 -1) "|\n"))
-
- (setq new (mapconcat
- (lambda (l)
- (if l (apply 'format rfmt
- (append (pop fields) emptystrings))
- hfmt))
- lines ""))
- (if (equal (char-before) ?\n)
- ;; This hack is for org-indent, to force redisplay of the
- ;; line prefix of the first line. Apparently the redisplay
- ;; is tied to the newline, which is, I think, a bug.
- ;; To force this redisplay, we remove and re-insert the
- ;; newline, so that the redisplay engine thinks it belongs
- ;; to the changed text.
- (progn
- (backward-delete-char 1)
- (insert "\n")))
- (move-marker org-table-aligned-begin-marker (point))
- (insert new)
- ;; Replace the old one
- (delete-region (point) end)
- (move-marker end nil)
- (move-marker org-table-aligned-end-marker (point))
- (when (and orgtbl-mode (not (org-mode-p)))
- (goto-char org-table-aligned-begin-marker)
- (while (org-hide-wide-columns org-table-aligned-end-marker)))
- ;; Try to move to the old location
- (org-goto-line winstartline)
- (setq winstart (point-at-bol))
- (org-goto-line linepos)
- (set-window-start (selected-window) winstart 'noforce)
- (org-table-goto-column colpos)
- (and org-table-overlay-coordinates (org-table-overlay-coordinates))
- (setq org-table-may-need-update nil)
- ))
-
-(defun org-table-begin (&optional table-type)
- "Find the beginning of the table and return its position.
-With argument TABLE-TYPE, go to the beginning of a table.el-type table."
- (save-excursion
- (if (not (re-search-backward
- (if table-type org-table-any-border-regexp
- org-table-border-regexp)
- nil t))
- (progn (goto-char (point-min)) (point))
- (goto-char (match-beginning 0))
- (beginning-of-line 2)
- (point))))
-
-(defun org-table-end (&optional table-type)
- "Find the end of the table and return its position.
-With argument TABLE-TYPE, go to the end of a table.el-type table."
- (save-excursion
- (if (not (re-search-forward
- (if table-type org-table-any-border-regexp
- org-table-border-regexp)
- nil t))
- (goto-char (point-max))
- (goto-char (match-beginning 0)))
- (point-marker)))
-
-(defun org-table-justify-field-maybe (&optional new)
- "Justify the current field, text to left, number to right.
-Optional argument NEW may specify text to replace the current field content."
- (cond
- ((and (not new) org-table-may-need-update)) ; Realignment will happen anyway
- ((org-at-table-hline-p))
- ((and (not new)
- (or (not (equal (marker-buffer org-table-aligned-begin-marker)
- (current-buffer)))
- (< (point) org-table-aligned-begin-marker)
- (>= (point) org-table-aligned-end-marker)))
- ;; This is not the same table, force a full re-align
- (setq org-table-may-need-update t))
- (t ;; realign the current field, based on previous full realign
- (let* ((pos (point)) s
- (col (org-table-current-column))
- (num (if (> col 0) (nth (1- col) org-table-last-alignment)))
- l f n o e)
- (when (> col 0)
- (skip-chars-backward "^|\n")
- (if (looking-at " *\\([^|\n]*?\\) *\\(|\\|$\\)")
- (progn
- (setq s (match-string 1)
- o (match-string 0)
- l (max 1 (- (match-end 0) (match-beginning 0) 3))
- e (not (= (match-beginning 2) (match-end 2))))
- (setq f (format (if num " %%%ds %s" " %%-%ds %s")
- l (if e "|" (setq org-table-may-need-update t) ""))
- n (format f s))
- (if new
- (if (<= (length new) l) ;; FIXME: length -> str-width?
- (setq n (format f new))
- (setq n (concat new "|") org-table-may-need-update t)))
- (if (equal (string-to-char n) ?-) (setq n (concat " " n)))
- (or (equal n o)
- (let (org-table-may-need-update)
- (replace-match n t t))))
- (setq org-table-may-need-update t))
- (goto-char pos))))))
-
-(defun org-table-next-field ()
- "Go to the next field in the current table, creating new lines as needed.
-Before doing so, re-align the table if necessary."
- (interactive)
- (org-table-maybe-eval-formula)
- (org-table-maybe-recalculate-line)
- (if (and org-table-automatic-realign
- org-table-may-need-update)
- (org-table-align))
- (let ((end (org-table-end)))
- (if (org-at-table-hline-p)
- (end-of-line 1))
- (condition-case nil
- (progn
- (re-search-forward "|" end)
- (if (looking-at "[ \t]*$")
- (re-search-forward "|" end))
- (if (and (looking-at "-")
- org-table-tab-jumps-over-hlines
- (re-search-forward "^[ \t]*|\\([^-]\\)" end t))
- (goto-char (match-beginning 1)))
- (if (looking-at "-")
- (progn
- (beginning-of-line 0)
- (org-table-insert-row 'below))
- (if (looking-at " ") (forward-char 1))))
- (error
- (org-table-insert-row 'below)))))
-
-(defun org-table-previous-field ()
- "Go to the previous field in the table.
-Before doing so, re-align the table if necessary."
- (interactive)
- (org-table-justify-field-maybe)
- (org-table-maybe-recalculate-line)
- (if (and org-table-automatic-realign
- org-table-may-need-update)
- (org-table-align))
- (if (org-at-table-hline-p)
- (end-of-line 1))
- (condition-case nil
- (progn
- (re-search-backward "|" (org-table-begin))
- (re-search-backward "|" (org-table-begin)))
- (error (error "Cannot move to previous table field")))
- (while (looking-at "|\\(-\\|[ \t]*$\\)")
- (re-search-backward "|" (org-table-begin)))
- (if (looking-at "| ?")
- (goto-char (match-end 0))))
-
-(defun org-table-beginning-of-field (&optional n)
- "Move to the end of the current table field.
-If already at or after the end, move to the end of the next table field.
-With numeric argument N, move N-1 fields forward first."
- (interactive "p")
- (let ((pos (point)))
- (while (> n 1)
- (setq n (1- n))
- (org-table-previous-field))
- (if (not (re-search-backward "|" (point-at-bol 0) t))
- (error "No more table fields before the current")
- (goto-char (match-end 0))
- (and (looking-at " ") (forward-char 1)))
- (if (>= (point) pos) (org-table-beginning-of-field 2))))
-
-(defun org-table-end-of-field (&optional n)
- "Move to the beginning of the current table field.
-If already at or before the beginning, move to the beginning of the
-previous field.
-With numeric argument N, move N-1 fields backward first."
- (interactive "p")
- (let ((pos (point)))
- (while (> n 1)
- (setq n (1- n))
- (org-table-next-field))
- (when (re-search-forward "|" (point-at-eol 1) t)
- (backward-char 1)
- (skip-chars-backward " ")
- (if (and (equal (char-before (point)) ?|) (looking-at " "))
- (forward-char 1)))
- (if (<= (point) pos) (org-table-end-of-field 2))))
-
-(defun org-table-next-row ()
- "Go to the next row (same column) in the current table.
-Before doing so, re-align the table if necessary."
- (interactive)
- (org-table-maybe-eval-formula)
- (org-table-maybe-recalculate-line)
- (if (or (looking-at "[ \t]*$")
- (save-excursion (skip-chars-backward " \t") (bolp)))
- (newline)
- (if (and org-table-automatic-realign
- org-table-may-need-update)
- (org-table-align))
- (let ((col (org-table-current-column)))
- (beginning-of-line 2)
- (if (or (not (org-at-table-p))
- (org-at-table-hline-p))
- (progn
- (beginning-of-line 0)
- (org-table-insert-row 'below)))
- (org-table-goto-column col)
- (skip-chars-backward "^|\n\r")
- (if (looking-at " ") (forward-char 1)))))
-
-(defun org-table-copy-down (n)
- "Copy a field down in the current column.
-If the field at the cursor is empty, copy into it the content of the nearest
-non-empty field above. With argument N, use the Nth non-empty field.
-If the current field is not empty, it is copied down to the next row, and
-the cursor is moved with it. Therefore, repeating this command causes the
-column to be filled row-by-row.
-If the variable `org-table-copy-increment' is non-nil and the field is an
-integer or a timestamp, it will be incremented while copying. In the case of
-a timestamp, if the cursor is on the year, change the year. If it is on the
-month or the day, change that. Point will stay on the current date field
-in order to easily repeat the interval."
- (interactive "p")
- (let* ((colpos (org-table-current-column))
- (col (current-column))
- (field (org-table-get-field))
- (non-empty (string-match "[^ \t]" field))
- (beg (org-table-begin))
- (orig-n n)
- txt)
- (org-table-check-inside-data-field)
- (if non-empty
- (progn
- (setq txt (org-trim field))
- (org-table-next-row)
- (org-table-blank-field))
- (save-excursion
- (setq txt
- (catch 'exit
- (while (progn (beginning-of-line 1)
- (re-search-backward org-table-dataline-regexp
- beg t))
- (org-table-goto-column colpos t)
- (if (and (looking-at
- "|[ \t]*\\([^| \t][^|]*?\\)[ \t]*|")
- (<= (setq n (1- n)) 0))
- (throw 'exit (match-string 1))))))))
- (if txt
- (progn
- (if (and org-table-copy-increment
- (not (equal orig-n 0))
- (string-match "^[0-9]+$" txt)
- (< (string-to-number txt) 100000000))
- (setq txt (format "%d" (+ (string-to-number txt) 1))))
- (insert txt)
- (org-move-to-column col)
- (if (and org-table-copy-increment (org-at-timestamp-p t))
- (org-timestamp-up-day)
- (org-table-maybe-recalculate-line))
- (org-table-align)
- (org-move-to-column col))
- (error "No non-empty field found"))))
-
-(defun org-table-check-inside-data-field ()
- "Is point inside a table data field?
-I.e. not on a hline or before the first or after the last column?
-This actually throws an error, so it aborts the current command."
- (if (or (not (org-at-table-p))
- (= (org-table-current-column) 0)
- (org-at-table-hline-p)
- (looking-at "[ \t]*$"))
- (error "Not in table data field")))
-
-(defvar org-table-clip nil
- "Clipboard for table regions.")
-
-(defun org-table-get (line column)
- "Get the field in table line LINE, column COLUMN.
-If LINE is larger than the number of data lines in the table, the function
-returns nil. However, if COLUMN is too large, we will simply return an
-empty string.
-If LINE is nil, use the current line.
-If column is nil, use the current column."
- (setq column (or column (org-table-current-column)))
- (save-excursion
- (and (or (not line) (org-table-goto-line line))
- (org-trim (org-table-get-field column)))))
-
-(defun org-table-put (line column value &optional align)
- "Put VALUE into line LINE, column COLUMN.
-When ALIGN is set, also realign the table."
- (setq column (or column (org-table-current-column)))
- (prog1 (save-excursion
- (and (or (not line) (org-table-goto-line line))
- (progn (org-table-goto-column column nil 'force) t)
- (org-table-get-field column value)))
- (and align (org-table-align))))
-
-(defun org-table-current-line ()
- "Return the index of the current data line."
- (let ((pos (point)) (end (org-table-end)) (cnt 0))
- (save-excursion
- (goto-char (org-table-begin))
- (while (and (re-search-forward org-table-dataline-regexp end t)
- (setq cnt (1+ cnt))
- (< (point-at-eol) pos))))
- cnt))
-
-(defun org-table-goto-line (N)
- "Go to the Nth data line in the current table.
-Return t when the line exists, nil if it does not exist."
- (goto-char (org-table-begin))
- (let ((end (org-table-end)) (cnt 0))
- (while (and (re-search-forward org-table-dataline-regexp end t)
- (< (setq cnt (1+ cnt)) N)))
- (= cnt N)))
-
-(defun org-table-blank-field ()
- "Blank the current table field or active region."
- (interactive)
- (org-table-check-inside-data-field)
- (if (and (interactive-p) (org-region-active-p))
- (let (org-table-clip)
- (org-table-cut-region (region-beginning) (region-end)))
- (skip-chars-backward "^|")
- (backward-char 1)
- (if (looking-at "|[^|\n]+")
- (let* ((pos (match-beginning 0))
- (match (match-string 0))
- (len (org-string-width match)))
- (replace-match (concat "|" (make-string (1- len) ?\ )))
- (goto-char (+ 2 pos))
- (substring match 1)))))
-
-(defun org-table-get-field (&optional n replace)
- "Return the value of the field in column N of current row.
-N defaults to current field.
-If REPLACE is a string, replace field with this value. The return value
-is always the old value."
- (and n (org-table-goto-column n))
- (skip-chars-backward "^|\n")
- (backward-char 1)
- (if (looking-at "|[^|\r\n]*")
- (let* ((pos (match-beginning 0))
- (val (buffer-substring (1+ pos) (match-end 0))))
- (if replace
- (replace-match (concat "|" replace) t t))
- (goto-char (min (point-at-eol) (+ 2 pos)))
- val)
- (forward-char 1) ""))
-
-(defun org-table-field-info (arg)
- "Show info about the current field, and highlight any reference at point."
- (interactive "P")
- (org-table-get-specials)
- (save-excursion
- (let* ((pos (point))
- (col (org-table-current-column))
- (cname (car (rassoc (int-to-string col) org-table-column-names)))
- (name (car (rassoc (list (org-current-line) col)
- org-table-named-field-locations)))
- (eql (org-table-get-stored-formulas))
- (dline (org-table-current-dline))
- (ref (format "@%d$%d" dline col))
- (ref1 (org-table-convert-refs-to-an ref))
- (fequation (or (assoc name eql) (assoc ref eql)))
- (cequation (assoc (int-to-string col) eql))
- (eqn (or fequation cequation)))
- (goto-char pos)
- (condition-case nil
- (org-table-show-reference 'local)
- (error nil))
- (message "line @%d, col $%s%s, ref @%d$%d or %s%s%s"
- dline col
- (if cname (concat " or $" cname) "")
- dline col ref1
- (if name (concat " or $" name) "")
- ;; FIXME: formula info not correct if special table line
- (if eqn
- (concat ", formula: "
- (org-table-formula-to-user
- (concat
- (if (string-match "^[$@]"(car eqn)) "" "$")
- (car eqn) "=" (cdr eqn))))
- "")))))
-
-(defun org-table-current-column ()
- "Find out which column we are in."
- (interactive)
- (if (interactive-p) (org-table-check-inside-data-field))
- (save-excursion
- (let ((cnt 0) (pos (point)))
- (beginning-of-line 1)
- (while (search-forward "|" pos t)
- (setq cnt (1+ cnt)))
- (if (interactive-p) (message "In table column %d" cnt))
- cnt)))
-
-(defun org-table-current-dline ()
- "Find out what table data line we are in.
-Only data lines count for this."
- (interactive)
- (if (interactive-p) (org-table-check-inside-data-field))
- (save-excursion
- (let ((cnt 0) (pos (point)))
- (goto-char (org-table-begin))
- (while (<= (point) pos)
- (if (looking-at org-table-dataline-regexp) (setq cnt (1+ cnt)))
- (beginning-of-line 2))
- (if (interactive-p) (message "This is table line %d" cnt))
- cnt)))
-
-(defun org-table-goto-column (n &optional on-delim force)
- "Move the cursor to the Nth column in the current table line.
-With optional argument ON-DELIM, stop with point before the left delimiter
-of the field.
-If there are less than N fields, just go to after the last delimiter.
-However, when FORCE is non-nil, create new columns if necessary."
- (interactive "p")
- (beginning-of-line 1)
- (when (> n 0)
- (while (and (> (setq n (1- n)) -1)
- (or (search-forward "|" (point-at-eol) t)
- (and force
- (progn (end-of-line 1)
- (skip-chars-backward "^|")
- (insert " | ")
- t)))))
- (when (and force (not (looking-at ".*|")))
- (save-excursion (end-of-line 1) (insert " | ")))
- (if on-delim
- (backward-char 1)
- (if (looking-at " ") (forward-char 1)))))
-
-(defun org-table-insert-column ()
- "Insert a new column into the table."
- (interactive)
- (if (not (org-at-table-p))
- (error "Not at a table"))
- (org-table-find-dataline)
- (let* ((col (max 1 (org-table-current-column)))
- (beg (org-table-begin))
- (end (org-table-end))
- ;; Current cursor position
- (linepos (org-current-line))
- (colpos col))
- (goto-char beg)
- (while (< (point) end)
- (if (org-at-table-hline-p)
- nil
- (org-table-goto-column col t)
- (insert "| "))
- (beginning-of-line 2))
- (move-marker end nil)
- (org-goto-line linepos)
- (org-table-goto-column colpos)
- (org-table-align)
- (org-table-fix-formulas "$" nil (1- col) 1)
- (org-table-fix-formulas "$LR" nil (1- col) 1)))
-
-(defun org-table-find-dataline ()
- "Find a data line in the current table, which is needed for column commands."
- (if (and (org-at-table-p)
- (not (org-at-table-hline-p)))
- t
- (let ((col (current-column))
- (end (org-table-end)))
- (org-move-to-column col)
- (while (and (< (point) end)
- (or (not (= (current-column) col))
- (org-at-table-hline-p)))
- (beginning-of-line 2)
- (org-move-to-column col))
- (if (and (org-at-table-p)
- (not (org-at-table-hline-p)))
- t
- (error
- "Please position cursor in a data line for column operations")))))
-
-(defun org-table-delete-column ()
- "Delete a column from the table."
- (interactive)
- (if (not (org-at-table-p))
- (error "Not at a table"))
- (org-table-find-dataline)
- (org-table-check-inside-data-field)
- (let* ((col (org-table-current-column))
- (beg (org-table-begin))
- (end (org-table-end))
- ;; Current cursor position
- (linepos (org-current-line))
- (colpos col))
- (goto-char beg)
- (while (< (point) end)
- (if (org-at-table-hline-p)
- nil
- (org-table-goto-column col t)
- (and (looking-at "|[^|\n]+|")
- (replace-match "|")))
- (beginning-of-line 2))
- (move-marker end nil)
- (org-goto-line linepos)
- (org-table-goto-column colpos)
- (org-table-align)
- (org-table-fix-formulas "$" (list (cons (number-to-string col) "INVALID"))
- col -1 col)
- (org-table-fix-formulas "$LR" (list (cons (number-to-string col) "INVALID"))
- col -1 col)))
-
-(defun org-table-move-column-right ()
- "Move column to the right."
- (interactive)
- (org-table-move-column nil))
-(defun org-table-move-column-left ()
- "Move column to the left."
- (interactive)
- (org-table-move-column 'left))
-
-(defun org-table-move-column (&optional left)
- "Move the current column to the right. With arg LEFT, move to the left."
- (interactive "P")
- (if (not (org-at-table-p))
- (error "Not at a table"))
- (org-table-find-dataline)
- (org-table-check-inside-data-field)
- (let* ((col (org-table-current-column))
- (col1 (if left (1- col) col))
- (beg (org-table-begin))
- (end (org-table-end))
- ;; Current cursor position
- (linepos (org-current-line))
- (colpos (if left (1- col) (1+ col))))
- (if (and left (= col 1))
- (error "Cannot move column further left"))
- (if (and (not left) (looking-at "[^|\n]*|[^|\n]*$"))
- (error "Cannot move column further right"))
- (goto-char beg)
- (while (< (point) end)
- (if (org-at-table-hline-p)
- nil
- (org-table-goto-column col1 t)
- (and (looking-at "|\\([^|\n]+\\)|\\([^|\n]+\\)|")
- (replace-match "|\\2|\\1|")))
- (beginning-of-line 2))
- (move-marker end nil)
- (org-goto-line linepos)
- (org-table-goto-column colpos)
- (org-table-align)
- (org-table-fix-formulas
- "$" (list (cons (number-to-string col) (number-to-string colpos))
- (cons (number-to-string colpos) (number-to-string col))))
- (org-table-fix-formulas
- "$LR" (list (cons (number-to-string col) (number-to-string colpos))
- (cons (number-to-string colpos) (number-to-string col))))))
-
-(defun org-table-move-row-down ()
- "Move table row down."
- (interactive)
- (org-table-move-row nil))
-(defun org-table-move-row-up ()
- "Move table row up."
- (interactive)
- (org-table-move-row 'up))
-
-(defun org-table-move-row (&optional up)
- "Move the current table line down. With arg UP, move it up."
- (interactive "P")
- (let* ((col (current-column))
- (pos (point))
- (hline1p (save-excursion (beginning-of-line 1)
- (looking-at org-table-hline-regexp)))
- (dline1 (org-table-current-dline))
- (dline2 (+ dline1 (if up -1 1)))
- (tonew (if up 0 2))
- txt hline2p)
- (beginning-of-line tonew)
- (unless (org-at-table-p)
- (goto-char pos)
- (error "Cannot move row further"))
- (setq hline2p (looking-at org-table-hline-regexp))
- (goto-char pos)
- (beginning-of-line 1)
- (setq pos (point))
- (setq txt (buffer-substring (point) (1+ (point-at-eol))))
- (delete-region (point) (1+ (point-at-eol)))
- (beginning-of-line tonew)
- (insert txt)
- (beginning-of-line 0)
- (org-move-to-column col)
- (unless (or hline1p hline2p)
- (org-table-fix-formulas
- "@" (list (cons (number-to-string dline1) (number-to-string dline2))
- (cons (number-to-string dline2) (number-to-string dline1)))))))
-
-(defun org-table-insert-row (&optional arg)
- "Insert a new row above the current line into the table.
-With prefix ARG, insert below the current line."
- (interactive "P")
- (if (not (org-at-table-p))
- (error "Not at a table"))
- (let* ((line (buffer-substring (point-at-bol) (point-at-eol)))
- (new (org-table-clean-line line)))
- ;; Fix the first field if necessary
- (if (string-match "^[ \t]*| *[#$] *|" line)
- (setq new (replace-match (match-string 0 line) t t new)))
- (beginning-of-line (if arg 2 1))
- (let (org-table-may-need-update) (insert-before-markers new "\n"))
- (beginning-of-line 0)
- (re-search-forward "| ?" (point-at-eol) t)
- (and (or org-table-may-need-update org-table-overlay-coordinates)
- (org-table-align))
- (org-table-fix-formulas "@" nil (1- (org-table-current-dline)) 1)))
-
-(defun org-table-insert-hline (&optional above)
- "Insert a horizontal-line below the current line into the table.
-With prefix ABOVE, insert above the current line."
- (interactive "P")
- (if (not (org-at-table-p))
- (error "Not at a table"))
- (when (eobp) (insert "\n") (backward-char 1))
- (if (not (string-match "|[ \t]*$" (org-current-line-string)))
- (org-table-align))
- (let ((line (org-table-clean-line
- (buffer-substring (point-at-bol) (point-at-eol))))
- (col (current-column)))
- (while (string-match "|\\( +\\)|" line)
- (setq line (replace-match
- (concat "+" (make-string (- (match-end 1) (match-beginning 1))
- ?-) "|") t t line)))
- (and (string-match "\\+" line) (setq line (replace-match "|" t t line)))
- (beginning-of-line (if above 1 2))
- (insert line "\n")
- (beginning-of-line (if above 1 -1))
- (org-move-to-column col)
- (and org-table-overlay-coordinates (org-table-align))))
-
-(defun org-table-hline-and-move (&optional same-column)
- "Insert a hline and move to the row below that line."
- (interactive "P")
- (let ((col (org-table-current-column)))
- (org-table-maybe-eval-formula)
- (org-table-maybe-recalculate-line)
- (org-table-insert-hline)
- (end-of-line 2)
- (if (looking-at "\n[ \t]*|-")
- (progn (insert "\n|") (org-table-align))
- (org-table-next-field))
- (if same-column (org-table-goto-column col))))
-
-(defun org-table-clean-line (s)
- "Convert a table line S into a string with only \"|\" and space.
-In particular, this does handle wide and invisible characters."
- (if (string-match "^[ \t]*|-" s)
- ;; It's a hline, just map the characters
- (setq s (mapconcat (lambda (x) (if (member x '(?| ?+)) "|" " ")) s ""))
- (while (string-match "|\\([ \t]*?[^ \t\r\n|][^\r\n|]*\\)|" s)
- (setq s (replace-match
- (concat "|" (make-string (org-string-width (match-string 1 s))
- ?\ ) "|")
- t t s)))
- s))
-
-(defun org-table-kill-row ()
- "Delete the current row or horizontal line from the table."
- (interactive)
- (if (not (org-at-table-p))
- (error "Not at a table"))
- (let ((col (current-column))
- (dline (org-table-current-dline)))
- (kill-region (point-at-bol) (min (1+ (point-at-eol)) (point-max)))
- (if (not (org-at-table-p)) (beginning-of-line 0))
- (org-move-to-column col)
- (org-table-fix-formulas "@" (list (cons (number-to-string dline) "INVALID"))
- dline -1 dline)))
-
-(defun org-table-sort-lines (with-case &optional sorting-type)
- "Sort table lines according to the column at point.
-
-The position of point indicates the column to be used for
-sorting, and the range of lines is the range between the nearest
-horizontal separator lines, or the entire table of no such lines
-exist. If point is before the first column, you will be prompted
-for the sorting column. If there is an active region, the mark
-specifies the first line and the sorting column, while point
-should be in the last line to be included into the sorting.
-
-The command then prompts for the sorting type which can be
-alphabetically, numerically, or by time (as given in a time stamp
-in the field). Sorting in reverse order is also possible.
-
-With prefix argument WITH-CASE, alphabetic sorting will be case-sensitive.
-
-If SORTING-TYPE is specified when this function is called from a Lisp
-program, no prompting will take place. SORTING-TYPE must be a character,
-any of (?a ?A ?n ?N ?t ?T) where the capital letter indicate that sorting
-should be done in reverse order."
- (interactive "P")
- (let* ((thisline (org-current-line))
- (thiscol (org-table-current-column))
- beg end bcol ecol tend tbeg column lns pos)
- (when (equal thiscol 0)
- (if (interactive-p)
- (setq thiscol
- (string-to-number
- (read-string "Use column N for sorting: ")))
- (setq thiscol 1))
- (org-table-goto-column thiscol))
- (org-table-check-inside-data-field)
- (if (org-region-active-p)
- (progn
- (setq beg (region-beginning) end (region-end))
- (goto-char beg)
- (setq column (org-table-current-column)
- beg (point-at-bol))
- (goto-char end)
- (setq end (point-at-bol 2)))
- (setq column (org-table-current-column)
- pos (point)
- tbeg (org-table-begin)
- tend (org-table-end))
- (if (re-search-backward org-table-hline-regexp tbeg t)
- (setq beg (point-at-bol 2))
- (goto-char tbeg)
- (setq beg (point-at-bol 1)))
- (goto-char pos)
- (if (re-search-forward org-table-hline-regexp tend t)
- (setq end (point-at-bol 1))
- (goto-char tend)
- (setq end (point-at-bol))))
- (setq beg (move-marker (make-marker) beg)
- end (move-marker (make-marker) end))
- (untabify beg end)
- (goto-char beg)
- (org-table-goto-column column)
- (skip-chars-backward "^|")
- (setq bcol (current-column))
- (org-table-goto-column (1+ column))
- (skip-chars-backward "^|")
- (setq ecol (1- (current-column)))
- (org-table-goto-column column)
- (setq lns (mapcar (lambda(x) (cons
- (org-sort-remove-invisible
- (nth (1- column)
- (org-split-string x "[ \t]*|[ \t]*")))
- x))
- (org-split-string (buffer-substring beg end) "\n")))
- (setq lns (org-do-sort lns "Table" with-case sorting-type))
- (delete-region beg end)
- (move-marker beg nil)
- (move-marker end nil)
- (insert (mapconcat 'cdr lns "\n") "\n")
- (org-goto-line thisline)
- (org-table-goto-column thiscol)
- (message "%d lines sorted, based on column %d" (length lns) column)))
-
-
-(defun org-table-cut-region (beg end)
- "Copy region in table to the clipboard and blank all relevant fields.
-If there is no active region, use just the field at point."
- (interactive (list
- (if (org-region-active-p) (region-beginning) (point))
- (if (org-region-active-p) (region-end) (point))))
- (org-table-copy-region beg end 'cut))
-
-(defun org-table-copy-region (beg end &optional cut)
- "Copy rectangular region in table to clipboard.
-A special clipboard is used which can only be accessed
-with `org-table-paste-rectangle'."
- (interactive (list
- (if (org-region-active-p) (region-beginning) (point))
- (if (org-region-active-p) (region-end) (point))
- current-prefix-arg))
- (let* (l01 c01 l02 c02 l1 c1 l2 c2 ic1 ic2
- region cols
- (rpl (if cut " " nil)))
- (goto-char beg)
- (org-table-check-inside-data-field)
- (setq l01 (org-current-line)
- c01 (org-table-current-column))
- (goto-char end)
- (org-table-check-inside-data-field)
- (setq l02 (org-current-line)
- c02 (org-table-current-column))
- (setq l1 (min l01 l02) l2 (max l01 l02)
- c1 (min c01 c02) c2 (max c01 c02))
- (catch 'exit
- (while t
- (catch 'nextline
- (if (> l1 l2) (throw 'exit t))
- (org-goto-line l1)
- (if (org-at-table-hline-p) (throw 'nextline (setq l1 (1+ l1))))
- (setq cols nil ic1 c1 ic2 c2)
- (while (< ic1 (1+ ic2))
- (push (org-table-get-field ic1 rpl) cols)
- (setq ic1 (1+ ic1)))
- (push (nreverse cols) region)
- (setq l1 (1+ l1)))))
- (setq org-table-clip (nreverse region))
- (if cut (org-table-align))
- org-table-clip))
-
-(defun org-table-paste-rectangle ()
- "Paste a rectangular region into a table.
-The upper right corner ends up in the current field. All involved fields
-will be overwritten. If the rectangle does not fit into the present table,
-the table is enlarged as needed. The process ignores horizontal separator
-lines."
- (interactive)
- (unless (and org-table-clip (listp org-table-clip))
- (error "First cut/copy a region to paste!"))
- (org-table-check-inside-data-field)
- (let* ((clip org-table-clip)
- (line (org-current-line))
- (col (org-table-current-column))
- (org-enable-table-editor t)
- (org-table-automatic-realign nil)
- c cols field)
- (while (setq cols (pop clip))
- (while (org-at-table-hline-p) (beginning-of-line 2))
- (if (not (org-at-table-p))
- (progn (end-of-line 0) (org-table-next-field)))
- (setq c col)
- (while (setq field (pop cols))
- (org-table-goto-column c nil 'force)
- (org-table-get-field nil field)
- (setq c (1+ c)))
- (beginning-of-line 2))
- (org-goto-line line)
- (org-table-goto-column col)
- (org-table-align)))
-
-(defun org-table-convert ()
- "Convert from `org-mode' table to table.el and back.
-Obviously, this only works within limits. When an Org-mode table is
-converted to table.el, all horizontal separator lines get lost, because
-table.el uses these as cell boundaries and has no notion of horizontal lines.
-A table.el table can be converted to an Org-mode table only if it does not
-do row or column spanning. Multiline cells will become multiple cells.
-Beware, Org-mode does not test if the table can be successfully converted - it
-blindly applies a recipe that works for simple tables."
- (interactive)
- (require 'table)
- (if (org-at-table.el-p)
- ;; convert to Org-mode table
- (let ((beg (move-marker (make-marker) (org-table-begin t)))
- (end (move-marker (make-marker) (org-table-end t))))
- (table-unrecognize-region beg end)
- (goto-char beg)
- (while (re-search-forward "^\\([ \t]*\\)\\+-.*\n" end t)
- (replace-match ""))
- (goto-char beg))
- (if (org-at-table-p)
- ;; convert to table.el table
- (let ((beg (move-marker (make-marker) (org-table-begin)))
- (end (move-marker (make-marker) (org-table-end))))
- ;; first, get rid of all horizontal lines
- (goto-char beg)
- (while (re-search-forward "^\\([ \t]*\\)|-.*\n" end t)
- (replace-match ""))
- ;; insert a hline before first
- (goto-char beg)
- (org-table-insert-hline 'above)
- (beginning-of-line -1)
- ;; insert a hline after each line
- (while (progn (beginning-of-line 3) (< (point) end))
- (org-table-insert-hline))
- (goto-char beg)
- (setq end (move-marker end (org-table-end)))
- ;; replace "+" at beginning and ending of hlines
- (while (re-search-forward "^\\([ \t]*\\)|-" end t)
- (replace-match "\\1+-"))
- (goto-char beg)
- (while (re-search-forward "-|[ \t]*$" end t)
- (replace-match "-+"))
- (goto-char beg)))))
-
-(defun org-table-wrap-region (arg)
- "Wrap several fields in a column like a paragraph.
-This is useful if you'd like to spread the contents of a field over several
-lines, in order to keep the table compact.
-
-If there is an active region, and both point and mark are in the same column,
-the text in the column is wrapped to minimum width for the given number of
-lines. Generally, this makes the table more compact. A prefix ARG may be
-used to change the number of desired lines. For example, `C-2 \\[org-table-wrap]'
-formats the selected text to two lines. If the region was longer than two
-lines, the remaining lines remain empty. A negative prefix argument reduces
-the current number of lines by that amount. The wrapped text is pasted back
-into the table. If you formatted it to more lines than it was before, fields
-further down in the table get overwritten - so you might need to make space in
-the table first.
-
-If there is no region, the current field is split at the cursor position and
-the text fragment to the right of the cursor is prepended to the field one
-line down.
-
-If there is no region, but you specify a prefix ARG, the current field gets
-blank, and the content is appended to the field above."
- (interactive "P")
- (org-table-check-inside-data-field)
- (if (org-region-active-p)
- ;; There is a region: fill as a paragraph
- (let* ((beg (region-beginning))
- (cline (save-excursion (goto-char beg) (org-current-line)))
- (ccol (save-excursion (goto-char beg) (org-table-current-column)))
- nlines)
- (org-table-cut-region (region-beginning) (region-end))
- (if (> (length (car org-table-clip)) 1)
- (error "Region must be limited to single column"))
- (setq nlines (if arg
- (if (< arg 1)
- (+ (length org-table-clip) arg)
- arg)
- (length org-table-clip)))
- (setq org-table-clip
- (mapcar 'list (org-wrap (mapconcat 'car org-table-clip " ")
- nil nlines)))
- (org-goto-line cline)
- (org-table-goto-column ccol)
- (org-table-paste-rectangle))
- ;; No region, split the current field at point
- (unless (org-get-alist-option org-M-RET-may-split-line 'table)
- (skip-chars-forward "^\r\n|"))
- (if arg
- ;; combine with field above
- (let ((s (org-table-blank-field))
- (col (org-table-current-column)))
- (beginning-of-line 0)
- (while (org-at-table-hline-p) (beginning-of-line 0))
- (org-table-goto-column col)
- (skip-chars-forward "^|")
- (skip-chars-backward " ")
- (insert " " (org-trim s))
- (org-table-align))
- ;; split field
- (if (looking-at "\\([^|]+\\)+|")
- (let ((s (match-string 1)))
- (replace-match " |")
- (goto-char (match-beginning 0))
- (org-table-next-row)
- (insert (org-trim s) " ")
- (org-table-align))
- (org-table-next-row)))))
-
-(defvar org-field-marker nil)
-
-(defun org-table-edit-field (arg)
- "Edit table field in a different window.
-This is mainly useful for fields that contain hidden parts.
-When called with a \\[universal-argument] prefix, just make the full field visible so that
-it can be edited in place."
- (interactive "P")
- (if arg
- (let ((b (save-excursion (skip-chars-backward "^|") (point)))
- (e (save-excursion (skip-chars-forward "^|\r\n") (point))))
- (remove-text-properties b e '(org-cwidth t invisible t
- display t intangible t))
- (if (and (boundp 'font-lock-mode) font-lock-mode)
- (font-lock-fontify-block)))
- (let ((pos (move-marker (make-marker) (point)))
- (field (org-table-get-field))
- (cw (current-window-configuration))
- p)
- (org-switch-to-buffer-other-window "*Org tmp*")
- (erase-buffer)
- (insert "#\n# Edit field and finish with C-c C-c\n#\n")
- (let ((org-inhibit-startup t)) (org-mode))
- (goto-char (setq p (point-max)))
- (insert (org-trim field))
- (remove-text-properties p (point-max)
- '(invisible t org-cwidth t display t
- intangible t))
- (goto-char p)
- (org-set-local 'org-finish-function 'org-table-finish-edit-field)
- (org-set-local 'org-window-configuration cw)
- (org-set-local 'org-field-marker pos)
- (message "Edit and finish with C-c C-c"))))
-
-(defun org-table-finish-edit-field ()
- "Finish editing a table data field.
-Remove all newline characters, insert the result into the table, realign
-the table and kill the editing buffer."
- (let ((pos org-field-marker)
- (cw org-window-configuration)
- (cb (current-buffer))
- text)
- (goto-char (point-min))
- (while (re-search-forward "^#.*\n?" nil t) (replace-match ""))
- (while (re-search-forward "\\([ \t]*\n[ \t]*\\)+" nil t)
- (replace-match " "))
- (setq text (org-trim (buffer-string)))
- (set-window-configuration cw)
- (kill-buffer cb)
- (select-window (get-buffer-window (marker-buffer pos)))
- (goto-char pos)
- (move-marker pos nil)
- (org-table-check-inside-data-field)
- (org-table-get-field nil text)
- (org-table-align)
- (message "New field value inserted")))
-
-(defvar org-timecnt) ; dynamically scoped parameter
-
-(defun org-table-sum (&optional beg end nlast)
- "Sum numbers in region of current table column.
-The result will be displayed in the echo area, and will be available
-as kill to be inserted with \\[yank].
-
-If there is an active region, it is interpreted as a rectangle and all
-numbers in that rectangle will be summed. If there is no active
-region and point is located in a table column, sum all numbers in that
-column.
-
-If at least one number looks like a time HH:MM or HH:MM:SS, all other
-numbers are assumed to be times as well (in decimal hours) and the
-numbers are added as such.
-
-If NLAST is a number, only the NLAST fields will actually be summed."
- (interactive)
- (save-excursion
- (let (col (org-timecnt 0) diff h m s org-table-clip)
- (cond
- ((and beg end)) ; beg and end given explicitly
- ((org-region-active-p)
- (setq beg (region-beginning) end (region-end)))
- (t
- (setq col (org-table-current-column))
- (goto-char (org-table-begin))
- (unless (re-search-forward "^[ \t]*|[^-]" nil t)
- (error "No table data"))
- (org-table-goto-column col)
- (setq beg (point))
- (goto-char (org-table-end))
- (unless (re-search-backward "^[ \t]*|[^-]" nil t)
- (error "No table data"))
- (org-table-goto-column col)
- (setq end (point))))
- (let* ((items (apply 'append (org-table-copy-region beg end)))
- (items1 (cond ((not nlast) items)
- ((>= nlast (length items)) items)
- (t (setq items (reverse items))
- (setcdr (nthcdr (1- nlast) items) nil)
- (nreverse items))))
- (numbers (delq nil (mapcar 'org-table-get-number-for-summing
- items1)))
- (res (apply '+ numbers))
- (sres (if (= org-timecnt 0)
- (number-to-string res)
- (setq diff (* 3600 res)
- h (floor (/ diff 3600)) diff (mod diff 3600)
- m (floor (/ diff 60)) diff (mod diff 60)
- s diff)
- (format "%d:%02d:%02d" h m s))))
- (kill-new sres)
- (if (interactive-p)
- (message "%s"
- (substitute-command-keys
- (format "Sum of %d items: %-20s (\\[yank] will insert result into buffer)"
- (length numbers) sres))))
- sres))))
-
-(defun org-table-get-number-for-summing (s)
- (let (n)
- (if (string-match "^ *|? *" s)
- (setq s (replace-match "" nil nil s)))
- (if (string-match " *|? *$" s)
- (setq s (replace-match "" nil nil s)))
- (setq n (string-to-number s))
- (cond
- ((and (string-match "0" s)
- (string-match "\\`[-+ \t0.edED]+\\'" s)) 0)
- ((string-match "\\`[ \t]+\\'" s) nil)
- ((string-match "\\`\\([0-9]+\\):\\([0-9]+\\)\\(:\\([0-9]+\\)\\)?\\'" s)
- (let ((h (string-to-number (or (match-string 1 s) "0")))
- (m (string-to-number (or (match-string 2 s) "0")))
- (s (string-to-number (or (match-string 4 s) "0"))))
- (if (boundp 'org-timecnt) (setq org-timecnt (1+ org-timecnt)))
- (* 1.0 (+ h (/ m 60.0) (/ s 3600.0)))))
- ((equal n 0) nil)
- (t n))))
-
-(defun org-table-current-field-formula (&optional key noerror)
- "Return the formula active for the current field.
-Assumes that specials are in place.
-If KEY is given, return the key to this formula.
-Otherwise return the formula preceded with \"=\" or \":=\"."
- (let* ((name (car (rassoc (list (org-current-line)
- (org-table-current-column))
- org-table-named-field-locations)))
- (col (org-table-current-column))
- (scol (int-to-string col))
- (ref (format "@%d$%d" (org-table-current-dline) col))
- (stored-list (org-table-get-stored-formulas noerror))
- (ass (or (assoc name stored-list)
- (assoc ref stored-list)
- (assoc scol stored-list))))
- (if key
- (car ass)
- (if ass (concat (if (string-match "^[0-9]+$" (car ass)) "=" ":=")
- (cdr ass))))))
-
-(defun org-table-get-formula (&optional equation named)
- "Read a formula from the minibuffer, offer stored formula as default.
-When NAMED is non-nil, look for a named equation."
- (let* ((stored-list (org-table-get-stored-formulas))
- (name (car (rassoc (list (org-current-line)
- (org-table-current-column))
- org-table-named-field-locations)))
- (ref (format "@%d$%d" (org-table-current-dline)
- (org-table-current-column)))
- (refass (assoc ref stored-list))
- (nameass (assoc name stored-list))
- (scol (if named
- (if (and name (not (string-match "^LR[0-9]+$" name)))
- name
- ref)
- (int-to-string (org-table-current-column))))
- (dummy (and (or nameass refass) (not named)
- (not (y-or-n-p "Replace existing field formula with column formula? " ))
- (error "Abort")))
- (name (or name ref))
- (org-table-may-need-update nil)
- (stored (cdr (assoc scol stored-list)))
- (eq (cond
- ((and stored equation (string-match "^ *=? *$" equation))
- stored)
- ((stringp equation)
- equation)
- (t (org-table-formula-from-user
- (read-string
- (org-table-formula-to-user
- (format "%s formula %s%s="
- (if named "Field" "Column")
- (if (member (string-to-char scol) '(?$ ?@)) "" "$")
- scol))
- (if stored (org-table-formula-to-user stored) "")
- 'org-table-formula-history
- )))))
- mustsave)
- (when (not (string-match "\\S-" eq))
- ;; remove formula
- (setq stored-list (delq (assoc scol stored-list) stored-list))
- (org-table-store-formulas stored-list)
- (error "Formula removed"))
- (if (string-match "^ *=?" eq) (setq eq (replace-match "" t t eq)))
- (if (string-match " *$" eq) (setq eq (replace-match "" t t eq)))
- (if (and name (not named))
- ;; We set the column equation, delete the named one.
- (setq stored-list (delq (assoc name stored-list) stored-list)
- mustsave t))
- (if stored
- (setcdr (assoc scol stored-list) eq)
- (setq stored-list (cons (cons scol eq) stored-list)))
- (if (or mustsave (not (equal stored eq)))
- (org-table-store-formulas stored-list))
- eq))
-
-(defun org-table-store-formulas (alist)
- "Store the list of formulas below the current table."
- (setq alist (sort alist 'org-table-formula-less-p))
- (save-excursion
- (goto-char (org-table-end))
- (if (looking-at "\\([ \t]*\n\\)*[ \t]*#\\+TBLFM:\\(.*\n?\\)")
- (progn
- ;; don't overwrite TBLFM, we might use text properties to store stuff
- (goto-char (match-beginning 2))
- (delete-region (match-beginning 2) (match-end 0)))
- (org-indent-line-function)
- (insert "#+TBLFM:"))
- (insert " "
- (mapconcat (lambda (x)
- (concat
- (if (equal (string-to-char (car x)) ?@) "" "$")
- (car x) "=" (cdr x)))
- alist "::")
- "\n")))
-
-(defsubst org-table-formula-make-cmp-string (a)
- (when (string-match "^\\(@\\([0-9]+\\)\\)?\\(\\$?\\([0-9]+\\)\\)?\\(\\$?[a-zA-Z0-9]+\\)?" a)
- (concat
- (if (match-end 2) (format "@%05d" (string-to-number (match-string 2 a))) "")
- (if (match-end 4) (format "$%05d" (string-to-number (match-string 4 a))) "")
- (if (match-end 5) (concat "@@" (match-string 5 a))))))
-
-(defun org-table-formula-less-p (a b)
- "Compare two formulas for sorting."
- (let ((as (org-table-formula-make-cmp-string (car a)))
- (bs (org-table-formula-make-cmp-string (car b))))
- (and as bs (string< as bs))))
-
-(defun org-table-get-stored-formulas (&optional noerror)
- "Return an alist with the stored formulas directly after current table."
- (interactive)
- (let (scol eq eq-alist strings string seen)
- (save-excursion
- (goto-char (org-table-end))
- (when (looking-at "\\([ \t]*\n\\)*[ \t]*#\\+TBLFM: *\\(.*\\)")
- (setq strings (org-split-string (match-string 2) " *:: *"))
- (while (setq string (pop strings))
- (when (string-match "\\`\\(@[0-9]+\\$[0-9]+\\|\\$\\([a-zA-Z0-9]+\\)\\) *= *\\(.*[^ \t]\\)" string)
- (setq scol (if (match-end 2)
- (match-string 2 string)
- (match-string 1 string))
- eq (match-string 3 string)
- eq-alist (cons (cons scol eq) eq-alist))
- (if (member scol seen)
- (if noerror
- (progn
- (message "Double definition `$%s=' in TBLFM line, please fix by hand" scol)
- (ding)
- (sit-for 2))
- (error "Double definition `$%s=' in TBLFM line, please fix by hand" scol))
- (push scol seen))))))
- (nreverse eq-alist)))
-
-(defun org-table-fix-formulas (key replace &optional limit delta remove)
- "Modify the equations after the table structure has been edited.
-KEY is \"@\" or \"$\". REPLACE is an alist of numbers to replace.
-For all numbers larger than LIMIT, shift them by DELTA."
- (save-excursion
- (goto-char (org-table-end))
- (when (looking-at "[ \t]*#\\+TBLFM:")
- (let ((re (concat key "\\([0-9]+\\)"))
- (re2
- (when remove
- (if (or (equal key "$") (equal key "$LR"))
- (format "\\(@[0-9]+\\)?%s%d=.*?\\(::\\|$\\)"
- (regexp-quote key) remove)
- (format "@%d\\$[0-9]+=.*?\\(::\\|$\\)" remove))))
- s n a)
- (when remove
- (while (re-search-forward re2 (point-at-eol) t)
- (unless (save-match-data (org-in-regexp "remote([^)]+?)"))
- (replace-match ""))))
- (while (re-search-forward re (point-at-eol) t)
- (unless (save-match-data (org-in-regexp "remote([^)]+?)"))
- (setq s (match-string 1) n (string-to-number s))
- (cond
- ((setq a (assoc s replace))
- (replace-match (concat key (cdr a)) t t))
- ((and limit (> n limit))
- (replace-match (concat key (int-to-string (+ n delta)))
- t t)))))))))
-
-(defun org-table-get-specials ()
- "Get the column names and local parameters for this table."
- (save-excursion
- (let ((beg (org-table-begin)) (end (org-table-end))
- names name fields fields1 field cnt
- c v l line col types dlines hlines last-dline)
- (setq org-table-column-names nil
- org-table-local-parameters nil
- org-table-named-field-locations nil
- org-table-current-begin-line nil
- org-table-current-begin-pos nil
- org-table-current-line-types nil)
- (goto-char beg)
- (when (re-search-forward "^[ \t]*| *! *\\(|.*\\)" end t)
- (setq names (org-split-string (match-string 1) " *| *")
- cnt 1)
- (while (setq name (pop names))
- (setq cnt (1+ cnt))
- (if (string-match "^[a-zA-Z][a-zA-Z0-9]*$" name)
- (push (cons name (int-to-string cnt)) org-table-column-names))))
- (setq org-table-column-names (nreverse org-table-column-names))
- (setq org-table-column-name-regexp
- (concat "\\$\\(" (mapconcat 'car org-table-column-names "\\|") "\\)\\>"))
- (goto-char beg)
- (while (re-search-forward "^[ \t]*| *\\$ *\\(|.*\\)" end t)
- (setq fields (org-split-string (match-string 1) " *| *"))
- (while (setq field (pop fields))
- (if (string-match "^\\([a-zA-Z][_a-zA-Z0-9]*\\|%\\) *= *\\(.*\\)" field)
- (push (cons (match-string 1 field) (match-string 2 field))
- org-table-local-parameters))))
- (goto-char beg)
- (while (re-search-forward "^[ \t]*| *\\([_^]\\) *\\(|.*\\)" end t)
- (setq c (match-string 1)
- fields (org-split-string (match-string 2) " *| *"))
- (save-excursion
- (beginning-of-line (if (equal c "_") 2 0))
- (setq line (org-current-line) col 1)
- (and (looking-at "^[ \t]*|[^|]*\\(|.*\\)")
- (setq fields1 (org-split-string (match-string 1) " *| *"))))
- (while (and fields1 (setq field (pop fields)))
- (setq v (pop fields1) col (1+ col))
- (when (and (stringp field) (stringp v)
- (string-match "^[a-zA-Z][a-zA-Z0-9]*$" field))
- (push (cons field v) org-table-local-parameters)
- (push (list field line col) org-table-named-field-locations))))
- ;; Analyse the line types
- (goto-char beg)
- (setq org-table-current-begin-line (org-current-line)
- org-table-current-begin-pos (point)
- l org-table-current-begin-line)
- (while (looking-at "[ \t]*|\\(-\\)?")
- (push (if (match-end 1) 'hline 'dline) types)
- (if (match-end 1) (push l hlines) (push l dlines))
- (beginning-of-line 2)
- (setq l (1+ l)))
- (push 'hline types) ;; add an imaginary extra hline to the end
- (setq org-table-current-line-types (apply 'vector (nreverse types))
- last-dline (car dlines)
- org-table-dlines (apply 'vector (cons nil (nreverse dlines)))
- org-table-hlines (apply 'vector (cons nil (nreverse hlines))))
- (org-goto-line last-dline)
- (let* ((l last-dline)
- (fields (org-split-string
- (buffer-substring (point-at-bol) (point-at-eol))
- "[ \t]*|[ \t]*"))
- (nfields (length fields))
- al al2)
- (loop for i from 1 to nfields do
- (push (list (format "LR%d" i) l i) al)
- (push (cons (format "LR%d" i) (nth (1- i) fields)) al2))
- (setq org-table-named-field-locations
- (append org-table-named-field-locations al))
- (setq org-table-local-parameters
- (append org-table-local-parameters al2))))))
-
-
-(defun org-table-maybe-eval-formula ()
- "Check if the current field starts with \"=\" or \":=\".
-If yes, store the formula and apply it."
- ;; We already know we are in a table. Get field will only return a formula
- ;; when appropriate. It might return a separator line, but no problem.
- (when org-table-formula-evaluate-inline
- (let* ((field (org-trim (or (org-table-get-field) "")))
- named eq)
- (when (string-match "^:?=\\(.*\\)" field)
- (setq named (equal (string-to-char field) ?:)
- eq (match-string 1 field))
- (if (or (fboundp 'calc-eval)
- (equal (substring eq 0 (min 2 (length eq))) "'("))
- (org-table-eval-formula (if named '(4) nil)
- (org-table-formula-from-user eq))
- (error "Calc does not seem to be installed, and is needed to evaluate the formula"))))))
-
-(defvar org-recalc-commands nil
- "List of commands triggering the recalculation of a line.
-Will be filled automatically during use.")
-
-(defvar org-recalc-marks
- '((" " . "Unmarked: no special line, no automatic recalculation")
- ("#" . "Automatically recalculate this line upon TAB, RET, and C-c C-c in the line")
- ("*" . "Recalculate only when entire table is recalculated with `C-u C-c *'")
- ("!" . "Column name definition line. Reference in formula as $name.")
- ("$" . "Parameter definition line name=value. Reference in formula as $name.")
- ("_" . "Names for values in row below this one.")
- ("^" . "Names for values in row above this one.")))
-
-(defun org-table-rotate-recalc-marks (&optional newchar)
- "Rotate the recalculation mark in the first column.
-If in any row, the first field is not consistent with a mark,
-insert a new column for the markers.
-When there is an active region, change all the lines in the region,
-after prompting for the marking character.
-After each change, a message will be displayed indicating the meaning
-of the new mark."
- (interactive)
- (unless (org-at-table-p) (error "Not at a table"))
- (let* ((marks (append (mapcar 'car org-recalc-marks) '(" ")))
- (beg (org-table-begin))
- (end (org-table-end))
- (l (org-current-line))
- (l1 (if (org-region-active-p) (org-current-line (region-beginning))))
- (l2 (if (org-region-active-p) (org-current-line (region-end))))
- (have-col
- (save-excursion
- (goto-char beg)
- (not (re-search-forward "^[ \t]*|[^-|][^|]*[^#!$*_^| \t][^|]*|" end t))))
- (col (org-table-current-column))
- (forcenew (car (assoc newchar org-recalc-marks)))
- epos new)
- (when l1
- (message "Change region to what mark? Type # * ! $ or SPC: ")
- (setq newchar (char-to-string (read-char-exclusive))
- forcenew (car (assoc newchar org-recalc-marks))))
- (if (and newchar (not forcenew))
- (error "Invalid NEWCHAR `%s' in `org-table-rotate-recalc-marks'"
- newchar))
- (if l1 (org-goto-line l1))
- (save-excursion
- (beginning-of-line 1)
- (unless (looking-at org-table-dataline-regexp)
- (error "Not at a table data line")))
- (unless have-col
- (org-table-goto-column 1)
- (org-table-insert-column)
- (org-table-goto-column (1+ col)))
- (setq epos (point-at-eol))
- (save-excursion
- (beginning-of-line 1)
- (org-table-get-field
- 1 (if (looking-at "^[ \t]*| *\\([#!$*^_ ]\\) *|")
- (concat " "
- (setq new (or forcenew
- (cadr (member (match-string 1) marks))))
- " ")
- " # ")))
- (if (and l1 l2)
- (progn
- (org-goto-line l1)
- (while (progn (beginning-of-line 2) (not (= (org-current-line) l2)))
- (and (looking-at org-table-dataline-regexp)
- (org-table-get-field 1 (concat " " new " "))))
- (org-goto-line l1)))
- (if (not (= epos (point-at-eol))) (org-table-align))
- (org-goto-line l)
- (and (interactive-p) (message "%s" (cdr (assoc new org-recalc-marks))))))
-
-(defun org-table-maybe-recalculate-line ()
- "Recompute the current line if marked for it, and if we haven't just done it."
- (interactive)
- (and org-table-allow-automatic-line-recalculation
- (not (and (memq last-command org-recalc-commands)
- (equal org-last-recalc-line (org-current-line))))
- (save-excursion (beginning-of-line 1)
- (looking-at org-table-auto-recalculate-regexp))
- (org-table-recalculate) t))
-
-(defvar modes)
-(defsubst org-set-calc-mode (var &optional value)
- (if (stringp var)
- (setq var (assoc var '(("D" calc-angle-mode deg)
- ("R" calc-angle-mode rad)
- ("F" calc-prefer-frac t)
- ("S" calc-symbolic-mode t)))
- value (nth 2 var) var (nth 1 var)))
- (if (memq var modes)
- (setcar (cdr (memq var modes)) value)
- (cons var (cons value modes)))
- modes)
-
-(defun org-table-eval-formula (&optional arg equation
- suppress-align suppress-const
- suppress-store suppress-analysis)
- "Replace the table field value at the cursor by the result of a calculation.
-
-This function makes use of Dave Gillespie's Calc package, in my view the
-most exciting program ever written for GNU Emacs. So you need to have Calc
-installed in order to use this function.
-
-In a table, this command replaces the value in the current field with the
-result of a formula. It also installs the formula as the \"current\" column
-formula, by storing it in a special line below the table. When called
-with a `C-u' prefix, the current field must be a named field, and the
-formula is installed as valid in only this specific field.
-
-When called with two `C-u' prefixes, insert the active equation
-for the field back into the current field, so that it can be
-edited there. This is useful in order to use \\[org-table-show-reference]
-to check the referenced fields.
-
-When called, the command first prompts for a formula, which is read in
-the minibuffer. Previously entered formulas are available through the
-history list, and the last used formula is offered as a default.
-These stored formulas are adapted correctly when moving, inserting, or
-deleting columns with the corresponding commands.
-
-The formula can be any algebraic expression understood by the Calc package.
-For details, see the Org-mode manual.
-
-This function can also be called from Lisp programs and offers
-additional arguments: EQUATION can be the formula to apply. If this
-argument is given, the user will not be prompted. SUPPRESS-ALIGN is
-used to speed-up recursive calls by by-passing unnecessary aligns.
-SUPPRESS-CONST suppresses the interpretation of constants in the
-formula, assuming that this has been done already outside the function.
-SUPPRESS-STORE means the formula should not be stored, either because
-it is already stored, or because it is a modified equation that should
-not overwrite the stored one."
- (interactive "P")
- (org-table-check-inside-data-field)
- (or suppress-analysis (org-table-get-specials))
- (if (equal arg '(16))
- (let ((eq (org-table-current-field-formula)))
- (or eq (error "No equation active for current field"))
- (org-table-get-field nil eq)
- (org-table-align)
- (setq org-table-may-need-update t))
- (let* (fields
- (ndown (if (integerp arg) arg 1))
- (org-table-automatic-realign nil)
- (case-fold-search nil)
- (down (> ndown 1))
- (formula (if (and equation suppress-store)
- equation
- (org-table-get-formula equation (equal arg '(4)))))
- (n0 (org-table-current-column))
- (modes (copy-sequence org-calc-default-modes))
- (numbers nil) ; was a variable, now fixed default
- (keep-empty nil)
- n form form0 bw fmt x ev orig c lispp literal)
- ;; Parse the format string. Since we have a lot of modes, this is
- ;; a lot of work. However, I think calc still uses most of the time.
- (if (string-match ";" formula)
- (let ((tmp (org-split-string formula ";")))
- (setq formula (car tmp)
- fmt (concat (cdr (assoc "%" org-table-local-parameters))
- (nth 1 tmp)))
- (while (string-match "\\([pnfse]\\)\\(-?[0-9]+\\)" fmt)
- (setq c (string-to-char (match-string 1 fmt))
- n (string-to-number (match-string 2 fmt)))
- (if (= c ?p)
- (setq modes (org-set-calc-mode 'calc-internal-prec n))
- (setq modes (org-set-calc-mode
- 'calc-float-format
- (list (cdr (assoc c '((?n . float) (?f . fix)
- (?s . sci) (?e . eng))))
- n))))
- (setq fmt (replace-match "" t t fmt)))
- (if (string-match "[NT]" fmt)
- (setq numbers (equal (match-string 0 fmt) "N")
- fmt (replace-match "" t t fmt)))
- (if (string-match "L" fmt)
- (setq literal t
- fmt (replace-match "" t t fmt)))
- (if (string-match "E" fmt)
- (setq keep-empty t
- fmt (replace-match "" t t fmt)))
- (while (string-match "[DRFS]" fmt)
- (setq modes (org-set-calc-mode (match-string 0 fmt)))
- (setq fmt (replace-match "" t t fmt)))
- (unless (string-match "\\S-" fmt)
- (setq fmt nil))))
- (if (and (not suppress-const) org-table-formula-use-constants)
- (setq formula (org-table-formula-substitute-names formula)))
- (setq orig (or (get-text-property 1 :orig-formula formula) "?"))
- (while (> ndown 0)
- (setq fields (org-split-string
- (org-no-properties
- (buffer-substring (point-at-bol) (point-at-eol)))
- " *| *"))
- (if (eq numbers t)
- (setq fields (mapcar
- (lambda (x) (number-to-string (string-to-number x)))
- fields)))
- (setq ndown (1- ndown))
- (setq form (copy-sequence formula)
- lispp (and (> (length form) 2)(equal (substring form 0 2) "'(")))
- (if (and lispp literal) (setq lispp 'literal))
-
- ;; Insert row and column number of formula result field
- (while (string-match "[@$]#" form)
- (setq form
- (replace-match
- (format "%d"
- (save-match-data
- (if (equal (substring form (match-beginning 0)
- (1+ (match-beginning 0)))
- "@")
- (org-table-current-dline)
- (org-table-current-column))))
- t t form)))
-
- ;; Check for old vertical references
- (setq form (org-table-rewrite-old-row-references form))
- ;; Insert remote references
- (while (string-match "\\<remote([ \t]*\\([-_a-zA-Z0-9]+\\)[ \t]*,[ \t]*\\([^\n)]+\\))" form)
- (setq form
- (replace-match
- (save-match-data
- (org-table-make-reference
- (org-table-get-remote-range
- (match-string 1 form) (match-string 2 form))
- keep-empty numbers lispp))
- t t form)))
- ;; Insert complex ranges
- (while (and (string-match org-table-range-regexp form)
- (> (length (match-string 0 form)) 1))
- (setq form
- (replace-match
- (save-match-data
- (org-table-make-reference
- (org-table-get-range (match-string 0 form) nil n0)
- keep-empty numbers lispp))
- t t form)))
- ;; Insert simple ranges
- (while (string-match "\\$\\([0-9]+\\)\\.\\.\\$\\([0-9]+\\)" form)
- (setq form
- (replace-match
- (save-match-data
- (org-table-make-reference
- (org-sublist
- fields (string-to-number (match-string 1 form))
- (string-to-number (match-string 2 form)))
- keep-empty numbers lispp))
- t t form)))
- (setq form0 form)
- ;; Insert the references to fields in same row
- (while (string-match "\\$\\([0-9]+\\)" form)
- (setq n (string-to-number (match-string 1 form))
- x (nth (1- (if (= n 0) n0 n)) fields))
- (unless x (error "Invalid field specifier \"%s\""
- (match-string 0 form)))
- (setq form (replace-match
- (save-match-data
- (org-table-make-reference x nil numbers lispp))
- t t form)))
-
- (if lispp
- (setq ev (condition-case nil
- (eval (eval (read form)))
- (error "#ERROR"))
- ev (if (numberp ev) (number-to-string ev) ev))
- (or (fboundp 'calc-eval)
- (error "Calc does not seem to be installed, and is needed to evaluate the formula"))
- (setq ev (calc-eval (cons form modes)
- (if numbers 'num))))
-
- (when org-table-formula-debug
- (with-output-to-temp-buffer "*Substitution History*"
- (princ (format "Substitution history of formula
-Orig: %s
-$xyz-> %s
-@r$c-> %s
-$1-> %s\n" orig formula form0 form))
- (if (listp ev)
- (princ (format " %s^\nError: %s"
- (make-string (car ev) ?\-) (nth 1 ev)))
- (princ (format "Result: %s\nFormat: %s\nFinal: %s"
- ev (or fmt "NONE")
- (if fmt (format fmt (string-to-number ev)) ev)))))
- (setq bw (get-buffer-window "*Substitution History*"))
- (org-fit-window-to-buffer bw)
- (unless (and (interactive-p) (not ndown))
- (unless (let (inhibit-redisplay)
- (y-or-n-p "Debugging Formula. Continue to next? "))
- (org-table-align)
- (error "Abort"))
- (delete-window bw)
- (message "")))
- (if (listp ev) (setq fmt nil ev "#ERROR"))
- (org-table-justify-field-maybe
- (if fmt (format fmt (string-to-number ev)) ev))
- (if (and down (> ndown 0) (looking-at ".*\n[ \t]*|[^-]"))
- (call-interactively 'org-return)
- (setq ndown 0)))
- (and down (org-table-maybe-recalculate-line))
- (or suppress-align (and org-table-may-need-update
- (org-table-align))))))
-
-(defun org-table-put-field-property (prop value)
- (save-excursion
- (put-text-property (progn (skip-chars-backward "^|") (point))
- (progn (skip-chars-forward "^|") (point))
- prop value)))
-
-(defun org-table-get-range (desc &optional tbeg col highlight)
- "Get a calc vector from a column, according to descriptor DESC.
-Optional arguments TBEG and COL can give the beginning of the table and
-the current column, to avoid unnecessary parsing.
-HIGHLIGHT means just highlight the range."
- (if (not (equal (string-to-char desc) ?@))
- (setq desc (concat "@" desc)))
- (save-excursion
- (or tbeg (setq tbeg (org-table-begin)))
- (or col (setq col (org-table-current-column)))
- (let ((thisline (org-current-line))
- beg end c1 c2 r1 r2 rangep tmp)
- (unless (string-match org-table-range-regexp desc)
- (error "Invalid table range specifier `%s'" desc))
- (setq rangep (match-end 3)
- r1 (and (match-end 1) (match-string 1 desc))
- r2 (and (match-end 4) (match-string 4 desc))
- c1 (and (match-end 2) (substring (match-string 2 desc) 1))
- c2 (and (match-end 5) (substring (match-string 5 desc) 1)))
-
- (and c1 (setq c1 (+ (string-to-number c1)
- (if (memq (string-to-char c1) '(?- ?+)) col 0))))
- (and c2 (setq c2 (+ (string-to-number c2)
- (if (memq (string-to-char c2) '(?- ?+)) col 0))))
- (if (equal r1 "") (setq r1 nil))
- (if (equal r2 "") (setq r2 nil))
- (if r1 (setq r1 (org-table-get-descriptor-line r1)))
- (if r2 (setq r2 (org-table-get-descriptor-line r2)))
-; (setq r2 (or r2 r1) c2 (or c2 c1))
- (if (not r1) (setq r1 thisline))
- (if (not r2) (setq r2 thisline))
- (if (not c1) (setq c1 col))
- (if (not c2) (setq c2 col))
- (if (or (not rangep) (and (= r1 r2) (= c1 c2)))
- ;; just one field
- (progn
- (org-goto-line r1)
- (while (not (looking-at org-table-dataline-regexp))
- (beginning-of-line 2))
- (prog1 (org-trim (org-table-get-field c1))
- (if highlight (org-table-highlight-rectangle (point) (point)))))
- ;; A range, return a vector
- ;; First sort the numbers to get a regular ractangle
- (if (< r2 r1) (setq tmp r1 r1 r2 r2 tmp))
- (if (< c2 c1) (setq tmp c1 c1 c2 c2 tmp))
- (org-goto-line r1)
- (while (not (looking-at org-table-dataline-regexp))
- (beginning-of-line 2))
- (org-table-goto-column c1)
- (setq beg (point))
- (org-goto-line r2)
- (while (not (looking-at org-table-dataline-regexp))
- (beginning-of-line 0))
- (org-table-goto-column c2)
- (setq end (point))
- (if highlight
- (org-table-highlight-rectangle
- beg (progn (skip-chars-forward "^|\n") (point))))
- ;; return string representation of calc vector
- (mapcar 'org-trim
- (apply 'append (org-table-copy-region beg end)))))))
-
-(defun org-table-get-descriptor-line (desc &optional cline bline table)
- "Analyze descriptor DESC and retrieve the corresponding line number.
-The cursor is currently in line CLINE, the table begins in line BLINE,
-and TABLE is a vector with line types."
- (if (string-match "^[0-9]+$" desc)
- (aref org-table-dlines (string-to-number desc))
- (setq cline (or cline (org-current-line))
- bline (or bline org-table-current-begin-line)
- table (or table org-table-current-line-types))
- (if (or
- (not (string-match "^\\(\\([-+]\\)?\\(I+\\)\\)?\\(\\([-+]\\)?\\([0-9]+\\)\\)?" desc))
- ;; 1 2 3 4 5 6
- (and (not (match-end 3)) (not (match-end 6)))
- (and (match-end 3) (match-end 6) (not (match-end 5))))
- (error "Invalid row descriptor `%s'" desc))
- (let* ((hdir (and (match-end 2) (match-string 2 desc)))
- (hn (if (match-end 3) (- (match-end 3) (match-beginning 3)) nil))
- (odir (and (match-end 5) (match-string 5 desc)))
- (on (if (match-end 6) (string-to-number (match-string 6 desc))))
- (i (- cline bline))
- (rel (and (match-end 6)
- (or (and (match-end 1) (not (match-end 3)))
- (match-end 5)))))
- (if (and hn (not hdir))
- (progn
- (setq i 0 hdir "+")
- (if (eq (aref table 0) 'hline) (setq hn (1- hn)))))
- (if (and (not hn) on (not odir))
- (error "Should never happen");;(aref org-table-dlines on)
- (if (and hn (> hn 0))
- (setq i (org-table-find-row-type table i 'hline (equal hdir "-")
- nil hn cline desc)))
- (if on
- (setq i (org-table-find-row-type table i 'dline (equal odir "-")
- rel on cline desc)))
- (+ bline i)))))
-
-(defun org-table-find-row-type (table i type backwards relative n cline desc)
- "FIXME: Needs more documentation."
- (let ((l (length table)))
- (while (> n 0)
- (while (and (setq i (+ i (if backwards -1 1)))
- (>= i 0) (< i l)
- (not (eq (aref table i) type))
- (if (and relative (eq (aref table i) 'hline))
- (cond
- ((eq org-table-relative-ref-may-cross-hline t) t)
- ((eq org-table-relative-ref-may-cross-hline 'error)
- (error "Row descriptor %s used in line %d crosses hline" desc cline))
- (t (setq i (- i (if backwards -1 1))
- n 1)
- nil))
- t)))
- (setq n (1- n)))
- (if (or (< i 0) (>= i l))
- (error "Row descriptor %s used in line %d leads outside table"
- desc cline)
- i)))
-
-(defun org-table-rewrite-old-row-references (s)
- (if (string-match "&[-+0-9I]" s)
- (error "Formula contains old &row reference, please rewrite using @-syntax")
- s))
-
-(defun org-table-make-reference (elements keep-empty numbers lispp)
- "Convert list ELEMENTS to something appropriate to insert into formula.
-KEEP-EMPTY indicated to keep empty fields, default is to skip them.
-NUMBERS indicates that everything should be converted to numbers.
-LISPP means to return something appropriate for a Lisp list."
- (if (stringp elements) ; just a single val
- (if lispp
- (if (eq lispp 'literal)
- elements
- (prin1-to-string (if numbers (string-to-number elements) elements)))
- (if (equal elements "") (setq elements "0"))
- (if numbers (setq elements (number-to-string (string-to-number elements))))
- (concat "(" elements ")"))
- (unless keep-empty
- (setq elements
- (delq nil
- (mapcar (lambda (x) (if (string-match "\\S-" x) x nil))
- elements))))
- (setq elements (or elements '("0")))
- (if lispp
- (mapconcat
- (lambda (x)
- (if (eq lispp 'literal)
- x
- (prin1-to-string (if numbers (string-to-number x) x))))
- elements " ")
- (concat "[" (mapconcat
- (lambda (x)
- (if numbers (number-to-string (string-to-number x)) x))
- elements
- ",") "]"))))
-
-(defun org-table-recalculate (&optional all noalign)
- "Recalculate the current table line by applying all stored formulas.
-With prefix arg ALL, do this for all lines in the table.
-With the prefix argument ALL is `(16)' \
-\(a double \\[universal-prefix] \\[universal-prefix] prefix), or if
-it is the symbol `iterate', recompute the table until it no longer changes.
-If NOALIGN is not nil, do not re-align the table after the computations
-are done. This is typically used internally to save time, if it is
-known that the table will be realigned a little later anyway."
- (interactive "P")
- (or (memq this-command org-recalc-commands)
- (setq org-recalc-commands (cons this-command org-recalc-commands)))
- (unless (org-at-table-p) (error "Not at a table"))
- (if (or (eq all 'iterate) (equal all '(16)))
- (org-table-iterate)
- (org-table-get-specials)
- (let* ((eqlist (sort (org-table-get-stored-formulas)
- (lambda (a b) (string< (car a) (car b)))))
- (inhibit-redisplay (not debug-on-error))
- (line-re org-table-dataline-regexp)
- (thisline (org-current-line))
- (thiscol (org-table-current-column))
- beg end entry eqlnum eqlname eqlname1 eql (cnt 0) eq a name)
- ;; Insert constants in all formulas
- (setq eqlist
- (mapcar (lambda (x)
- (setcdr x (org-table-formula-substitute-names (cdr x)))
- x)
- eqlist))
- ;; Split the equation list
- (while (setq eq (pop eqlist))
- (if (<= (string-to-char (car eq)) ?9)
- (push eq eqlnum)
- (push eq eqlname)))
- (setq eqlnum (nreverse eqlnum) eqlname (nreverse eqlname))
- (if all
- (progn
- (setq end (move-marker (make-marker) (1+ (org-table-end))))
- (goto-char (setq beg (org-table-begin)))
- (if (re-search-forward org-table-calculate-mark-regexp end t)
- ;; This is a table with marked lines, compute selected lines
- (setq line-re org-table-recalculate-regexp)
- ;; Move forward to the first non-header line
- (if (and (re-search-forward org-table-dataline-regexp end t)
- (re-search-forward org-table-hline-regexp end t)
- (re-search-forward org-table-dataline-regexp end t))
- (setq beg (match-beginning 0))
- nil))) ;; just leave beg where it is
- (setq beg (point-at-bol)
- end (move-marker (make-marker) (1+ (point-at-eol)))))
- (goto-char beg)
- (and all (message "Re-applying formulas to full table..."))
-
- ;; First find the named fields, and mark them untouchable
- (remove-text-properties beg end '(org-untouchable t))
- (while (setq eq (pop eqlname))
- (setq name (car eq)
- a (assoc name org-table-named-field-locations))
- (and (not a)
- (string-match "@\\([0-9]+\\)\\$\\([0-9]+\\)" name)
- (setq a (list name
- (condition-case nil
- (aref org-table-dlines
- (string-to-number (match-string 1 name)))
- (error (error "Invalid row number in %s"
- name)))
- (string-to-number (match-string 2 name)))))
- (when (and a (or all (equal (nth 1 a) thisline)))
- (message "Re-applying formula to field: %s" name)
- (org-goto-line (nth 1 a))
- (org-table-goto-column (nth 2 a))
- (push (append a (list (cdr eq))) eqlname1)
- (org-table-put-field-property :org-untouchable t)))
-
- ;; Now evaluate the column formulas, but skip fields covered by
- ;; field formulas
- (goto-char beg)
- (while (re-search-forward line-re end t)
- (unless (string-match "^ *[_^!$/] *$" (org-table-get-field 1))
- ;; Unprotected line, recalculate
- (and all (message "Re-applying formulas to full table...(line %d)"
- (setq cnt (1+ cnt))))
- (setq org-last-recalc-line (org-current-line))
- (setq eql eqlnum)
- (while (setq entry (pop eql))
- (org-goto-line org-last-recalc-line)
- (org-table-goto-column (string-to-number (car entry)) nil 'force)
- (unless (get-text-property (point) :org-untouchable)
- (org-table-eval-formula nil (cdr entry)
- 'noalign 'nocst 'nostore 'noanalysis)))))
-
- ;; Now evaluate the field formulas
- (while (setq eq (pop eqlname1))
- (message "Re-applying formula to field: %s" (car eq))
- (org-goto-line (nth 1 eq))
- (org-table-goto-column (nth 2 eq))
- (org-table-eval-formula nil (nth 3 eq) 'noalign 'nocst
- 'nostore 'noanalysis))
-
- (org-goto-line thisline)
- (org-table-goto-column thiscol)
- (remove-text-properties (point-min) (point-max) '(org-untouchable t))
- (or noalign (and org-table-may-need-update (org-table-align))
- (and all (message "Re-applying formulas to %d lines...done" cnt)))
-
- ;; back to initial position
- (message "Re-applying formulas...done")
- (org-goto-line thisline)
- (org-table-goto-column thiscol)
- (or noalign (and org-table-may-need-update (org-table-align))
- (and all (message "Re-applying formulas...done"))))))
-
-(defun org-table-iterate (&optional arg)
- "Recalculate the table until it does not change anymore."
- (interactive "P")
- (let ((imax (if arg (prefix-numeric-value arg) 10))
- (i 0)
- (lasttbl (buffer-substring (org-table-begin) (org-table-end)))
- thistbl)
- (catch 'exit
- (while (< i imax)
- (setq i (1+ i))
- (org-table-recalculate 'all)
- (setq thistbl (buffer-substring (org-table-begin) (org-table-end)))
- (if (not (string= lasttbl thistbl))
- (setq lasttbl thistbl)
- (if (> i 1)
- (message "Convergence after %d iterations" i)
- (message "Table was already stable"))
- (throw 'exit t)))
- (error "No convergence after %d iterations" i))))
-
-(defun org-table-recalculate-buffer-tables ()
- "Recalculate all tables in the current buffer."
- (interactive)
- (save-excursion
- (save-restriction
- (widen)
- (org-table-map-tables (lambda () (org-table-recalculate t)) t))))
-
-(defun org-table-iterate-buffer-tables ()
- "Iterate all tables in the buffer, to converge inter-table dependencies."
- (interactive)
- (let* ((imax 10)
- (checksum (md5 (buffer-string)))
-
- c1
- (i imax))
- (save-excursion
- (save-restriction
- (widen)
- (catch 'exit
- (while (> i 0)
- (setq i (1- i))
- (org-table-map-tables (lambda () (org-table-recalculate t)) t)
- (if (equal checksum (setq c1 (md5 (buffer-string))))
- (progn
- (message "Convergence after %d iterations" (- imax i))
- (throw 'exit t))
- (setq checksum c1)))
- (error "No convergence after %d iterations" imax))))))
-
-(defun org-table-formula-substitute-names (f)
- "Replace $const with values in string F."
- (let ((start 0) a (f1 f) (pp (/= (string-to-char f) ?')))
- ;; First, check for column names
- (while (setq start (string-match org-table-column-name-regexp f start))
- (setq start (1+ start))
- (setq a (assoc (match-string 1 f) org-table-column-names))
- (setq f (replace-match (concat "$" (cdr a)) t t f)))
- ;; Parameters and constants
- (setq start 0)
- (while (setq start (string-match "\\$\\([a-zA-Z][_a-zA-Z0-9]*\\)\\|\\(\\<remote([^)]*)\\)" f start))
- (if (match-end 2)
- (setq start (match-end 2))
- (setq start (1+ start))
- (if (setq a (save-match-data
- (org-table-get-constant (match-string 1 f))))
- (setq f (replace-match
- (concat (if pp "(") a (if pp ")")) t t f)))))
- (if org-table-formula-debug
- (put-text-property 0 (length f) :orig-formula f1 f))
- f))
-
-(defun org-table-get-constant (const)
- "Find the value for a parameter or constant in a formula.
-Parameters get priority."
- (or (cdr (assoc const org-table-local-parameters))
- (cdr (assoc const org-table-formula-constants-local))
- (cdr (assoc const org-table-formula-constants))
- (and (fboundp 'constants-get) (constants-get const))
- (and (string= (substring const 0 (min 5 (length const))) "PROP_")
- (org-entry-get nil (substring const 5) 'inherit))
- "#UNDEFINED_NAME"))
-
-(defvar org-table-fedit-map
- (let ((map (make-sparse-keymap)))
- (org-defkey map "\C-x\C-s" 'org-table-fedit-finish)
- (org-defkey map "\C-c\C-s" 'org-table-fedit-finish)
- (org-defkey map "\C-c\C-c" 'org-table-fedit-finish)
- (org-defkey map "\C-c'" 'org-table-fedit-finish)
- (org-defkey map "\C-c\C-q" 'org-table-fedit-abort)
- (org-defkey map "\C-c?" 'org-table-show-reference)
- (org-defkey map [(meta shift up)] 'org-table-fedit-line-up)
- (org-defkey map [(meta shift down)] 'org-table-fedit-line-down)
- (org-defkey map [(shift up)] 'org-table-fedit-ref-up)
- (org-defkey map [(shift down)] 'org-table-fedit-ref-down)
- (org-defkey map [(shift left)] 'org-table-fedit-ref-left)
- (org-defkey map [(shift right)] 'org-table-fedit-ref-right)
- (org-defkey map [(meta up)] 'org-table-fedit-scroll-down)
- (org-defkey map [(meta down)] 'org-table-fedit-scroll)
- (org-defkey map [(meta tab)] 'lisp-complete-symbol)
- (org-defkey map "\M-\C-i" 'lisp-complete-symbol)
- (org-defkey map [(tab)] 'org-table-fedit-lisp-indent)
- (org-defkey map "\C-i" 'org-table-fedit-lisp-indent)
- (org-defkey map "\C-c\C-r" 'org-table-fedit-toggle-ref-type)
- (org-defkey map "\C-c}" 'org-table-fedit-toggle-coordinates)
- map))
-
-(easy-menu-define org-table-fedit-menu org-table-fedit-map "Org Edit Formulas Menu"
- '("Edit-Formulas"
- ["Finish and Install" org-table-fedit-finish t]
- ["Finish, Install, and Apply" (org-table-fedit-finish t) :keys "C-u C-c C-c"]
- ["Abort" org-table-fedit-abort t]
- "--"
- ["Pretty-Print Lisp Formula" org-table-fedit-lisp-indent t]
- ["Complete Lisp Symbol" lisp-complete-symbol t]
- "--"
- "Shift Reference at Point"
- ["Up" org-table-fedit-ref-up t]
- ["Down" org-table-fedit-ref-down t]
- ["Left" org-table-fedit-ref-left t]
- ["Right" org-table-fedit-ref-right t]
- "-"
- "Change Test Row for Column Formulas"
- ["Up" org-table-fedit-line-up t]
- ["Down" org-table-fedit-line-down t]
- "--"
- ["Scroll Table Window" org-table-fedit-scroll t]
- ["Scroll Table Window down" org-table-fedit-scroll-down t]
- ["Show Table Grid" org-table-fedit-toggle-coordinates
- :style toggle :selected (with-current-buffer (marker-buffer org-pos)
- org-table-overlay-coordinates)]
- "--"
- ["Standard Refs (B3 instead of @3$2)" org-table-fedit-toggle-ref-type
- :style toggle :selected org-table-buffer-is-an]))
-
-(defvar org-pos)
-
-(defun org-table-edit-formulas ()
- "Edit the formulas of the current table in a separate buffer."
- (interactive)
- (when (save-excursion (beginning-of-line 1) (looking-at "[ \t]*#\\+TBLFM"))
- (beginning-of-line 0))
- (unless (org-at-table-p) (error "Not at a table"))
- (org-table-get-specials)
- (let ((key (org-table-current-field-formula 'key 'noerror))
- (eql (sort (org-table-get-stored-formulas 'noerror)
- 'org-table-formula-less-p))
- (pos (move-marker (make-marker) (point)))
- (startline 1)
- (wc (current-window-configuration))
- (sel-win (selected-window))
- (titles '((column . "# Column Formulas\n")
- (field . "# Field Formulas\n")
- (named . "# Named Field Formulas\n")))
- entry s type title)
- (org-switch-to-buffer-other-window "*Edit Formulas*")
- (erase-buffer)
- ;; Keep global-font-lock-mode from turning on font-lock-mode
- (let ((font-lock-global-modes '(not fundamental-mode)))
- (fundamental-mode))
- (org-set-local 'font-lock-global-modes (list 'not major-mode))
- (org-set-local 'org-pos pos)
- (org-set-local 'org-window-configuration wc)
- (org-set-local 'org-selected-window sel-win)
- (use-local-map org-table-fedit-map)
- (org-add-hook 'post-command-hook 'org-table-fedit-post-command t t)
- (easy-menu-add org-table-fedit-menu)
- (setq startline (org-current-line))
- (while (setq entry (pop eql))
- (setq type (cond
- ((equal (string-to-char (car entry)) ?@) 'field)
- ((string-match "^[0-9]" (car entry)) 'column)
- (t 'named)))
- (when (setq title (assq type titles))
- (or (bobp) (insert "\n"))
- (insert (org-add-props (cdr title) nil 'face font-lock-comment-face))
- (setq titles (delq title titles)))
- (if (equal key (car entry)) (setq startline (org-current-line)))
- (setq s (concat (if (equal (string-to-char (car entry)) ?@) "" "$")
- (car entry) " = " (cdr entry) "\n"))
- (remove-text-properties 0 (length s) '(face nil) s)
- (insert s))
- (if (eq org-table-use-standard-references t)
- (org-table-fedit-toggle-ref-type))
- (org-goto-line startline)
- (message "Edit formulas, finish with `C-c C-c' or `C-c ' '. See menu for more commands.")))
-
-(defun org-table-fedit-post-command ()
- (when (not (memq this-command '(lisp-complete-symbol)))
- (let ((win (selected-window)))
- (save-excursion
- (condition-case nil
- (org-table-show-reference)
- (error nil))
- (select-window win)))))
-
-(defun org-table-formula-to-user (s)
- "Convert a formula from internal to user representation."
- (if (eq org-table-use-standard-references t)
- (org-table-convert-refs-to-an s)
- s))
-
-(defun org-table-formula-from-user (s)
- "Convert a formula from user to internal representation."
- (if org-table-use-standard-references
- (org-table-convert-refs-to-rc s)
- s))
-
-(defun org-table-convert-refs-to-rc (s)
- "Convert spreadsheet references from AB7 to @7$28.
-Works for single references, but also for entire formulas and even the
-full TBLFM line."
- (let ((start 0))
- (while (string-match "\\<\\([a-zA-Z]+\\)\\([0-9]+\\>\\|&\\)\\|\\(;[^\r\n:]+\\|\\<remote([^)]*)\\)" s start)
- (cond
- ((match-end 3)
- ;; format match, just advance
- (setq start (match-end 0)))
- ((and (> (match-beginning 0) 0)
- (equal ?. (aref s (max (1- (match-beginning 0)) 0)))
- (not (equal ?. (aref s (max (- (match-beginning 0) 2) 0)))))
- ;; 3.e5 or something like this.
- (setq start (match-end 0)))
- ((or (> (- (match-end 1) (match-beginning 1)) 2)
- ;; (member (match-string 1 s)
- ;; '("arctan" "exp" "expm" "lnp" "log" "stir"))
- )
- ;; function name, just advance
- (setq start (match-end 0)))
- (t
- (setq start (match-beginning 0)
- s (replace-match
- (if (equal (match-string 2 s) "&")
- (format "$%d" (org-letters-to-number (match-string 1 s)))
- (format "@%d$%d"
- (string-to-number (match-string 2 s))
- (org-letters-to-number (match-string 1 s))))
- t t s)))))
- s))
-
-(defun org-table-convert-refs-to-an (s)
- "Convert spreadsheet references from to @7$28 to AB7.
-Works for single references, but also for entire formulas and even the
-full TBLFM line."
- (while (string-match "@\\([0-9]+\\)\\$\\([0-9]+\\)" s)
- (setq s (replace-match
- (format "%s%d"
- (org-number-to-letters
- (string-to-number (match-string 2 s)))
- (string-to-number (match-string 1 s)))
- t t s)))
- (while (string-match "\\(^\\|[^0-9a-zA-Z]\\)\\$\\([0-9]+\\)" s)
- (setq s (replace-match (concat "\\1"
- (org-number-to-letters
- (string-to-number (match-string 2 s))) "&")
- t nil s)))
- s)
-
-(defun org-letters-to-number (s)
- "Convert a base 26 number represented by letters into an integer.
-For example: AB -> 28."
- (let ((n 0))
- (setq s (upcase s))
- (while (> (length s) 0)
- (setq n (+ (* n 26) (string-to-char s) (- ?A) 1)
- s (substring s 1)))
- n))
-
-(defun org-number-to-letters (n)
- "Convert an integer into a base 26 number represented by letters.
-For example: 28 -> AB."
- (let ((s ""))
- (while (> n 0)
- (setq s (concat (char-to-string (+ (mod (1- n) 26) ?A)) s)
- n (/ (1- n) 26)))
- s))
-
-(defun org-table-fedit-convert-buffer (function)
- "Convert all references in this buffer, using FUNCTION."
- (let ((line (org-current-line)))
- (goto-char (point-min))
- (while (not (eobp))
- (insert (funcall function (buffer-substring (point) (point-at-eol))))
- (delete-region (point) (point-at-eol))
- (or (eobp) (forward-char 1)))
- (org-goto-line line)))
-
-(defun org-table-fedit-toggle-ref-type ()
- "Convert all references in the buffer from B3 to @3$2 and back."
- (interactive)
- (org-set-local 'org-table-buffer-is-an (not org-table-buffer-is-an))
- (org-table-fedit-convert-buffer
- (if org-table-buffer-is-an
- 'org-table-convert-refs-to-an 'org-table-convert-refs-to-rc))
- (message "Reference type switched to %s"
- (if org-table-buffer-is-an "A1 etc" "@row$column")))
-
-(defun org-table-fedit-ref-up ()
- "Shift the reference at point one row/hline up."
- (interactive)
- (org-table-fedit-shift-reference 'up))
-(defun org-table-fedit-ref-down ()
- "Shift the reference at point one row/hline down."
- (interactive)
- (org-table-fedit-shift-reference 'down))
-(defun org-table-fedit-ref-left ()
- "Shift the reference at point one field to the left."
- (interactive)
- (org-table-fedit-shift-reference 'left))
-(defun org-table-fedit-ref-right ()
- "Shift the reference at point one field to the right."
- (interactive)
- (org-table-fedit-shift-reference 'right))
-
-(defun org-table-fedit-shift-reference (dir)
- (cond
- ((org-at-regexp-p "\\(\\<[a-zA-Z]\\)&")
- (if (memq dir '(left right))
- (org-rematch-and-replace 1 (eq dir 'left))
- (error "Cannot shift reference in this direction")))
- ((org-at-regexp-p "\\(\\<[a-zA-Z]\\{1,2\\}\\)\\([0-9]+\\)")
- ;; A B3-like reference
- (if (memq dir '(up down))
- (org-rematch-and-replace 2 (eq dir 'up))
- (org-rematch-and-replace 1 (eq dir 'left))))
- ((org-at-regexp-p
- "\\(@\\|\\.\\.\\)\\([-+]?\\(I+\\>\\|[0-9]+\\)\\)\\(\\$\\([-+]?[0-9]+\\)\\)?")
- ;; An internal reference
- (if (memq dir '(up down))
- (org-rematch-and-replace 2 (eq dir 'up) (match-end 3))
- (org-rematch-and-replace 5 (eq dir 'left))))))
-
-(defun org-rematch-and-replace (n &optional decr hline)
- "Re-match the group N, and replace it with the shifted reference."
- (or (match-end n) (error "Cannot shift reference in this direction"))
- (goto-char (match-beginning n))
- (and (looking-at (regexp-quote (match-string n)))
- (replace-match (org-table-shift-refpart (match-string 0) decr hline)
- t t)))
-
-(defun org-table-shift-refpart (ref &optional decr hline)
- "Shift a reference part REF.
-If DECR is set, decrease the references row/column, else increase.
-If HLINE is set, this may be a hline reference, it certainly is not
-a translation reference."
- (save-match-data
- (let* ((sign (string-match "^[-+]" ref)) n)
-
- (if sign (setq sign (substring ref 0 1) ref (substring ref 1)))
- (cond
- ((and hline (string-match "^I+" ref))
- (setq n (string-to-number (concat sign (number-to-string (length ref)))))
- (setq n (+ n (if decr -1 1)))
- (if (= n 0) (setq n (+ n (if decr -1 1))))
- (if sign
- (setq sign (if (< n 0) "-" "+") n (abs n))
- (setq n (max 1 n)))
- (concat sign (make-string n ?I)))
-
- ((string-match "^[0-9]+" ref)
- (setq n (string-to-number (concat sign ref)))
- (setq n (+ n (if decr -1 1)))
- (if sign
- (concat (if (< n 0) "-" "+") (number-to-string (abs n)))
- (number-to-string (max 1 n))))
-
- ((string-match "^[a-zA-Z]+" ref)
- (org-number-to-letters
- (max 1 (+ (org-letters-to-number ref) (if decr -1 1)))))
-
- (t (error "Cannot shift reference"))))))
-
-(defun org-table-fedit-toggle-coordinates ()
- "Toggle the display of coordinates in the referenced table."
- (interactive)
- (let ((pos (marker-position org-pos)))
- (with-current-buffer (marker-buffer org-pos)
- (save-excursion
- (goto-char pos)
- (org-table-toggle-coordinate-overlays)))))
-
-(defun org-table-fedit-finish (&optional arg)
- "Parse the buffer for formula definitions and install them.
-With prefix ARG, apply the new formulas to the table."
- (interactive "P")
- (org-table-remove-rectangle-highlight)
- (if org-table-use-standard-references
- (progn
- (org-table-fedit-convert-buffer 'org-table-convert-refs-to-rc)
- (setq org-table-buffer-is-an nil)))
- (let ((pos org-pos) (sel-win org-selected-window) eql var form)
- (goto-char (point-min))
- (while (re-search-forward
- "^\\(@[0-9]+\\$[0-9]+\\|\\$\\([a-zA-Z0-9]+\\)\\) *= *\\(.*\\(\n[ \t]+.*$\\)*\\)"
- nil t)
- (setq var (if (match-end 2) (match-string 2) (match-string 1))
- form (match-string 3))
- (setq form (org-trim form))
- (when (not (equal form ""))
- (while (string-match "[ \t]*\n[ \t]*" form)
- (setq form (replace-match " " t t form)))
- (when (assoc var eql)
- (error "Double formulas for %s" var))
- (push (cons var form) eql)))
- (setq org-pos nil)
- (set-window-configuration org-window-configuration)
- (select-window sel-win)
- (goto-char pos)
- (unless (org-at-table-p)
- (error "Lost table position - cannot install formulas"))
- (org-table-store-formulas eql)
- (move-marker pos nil)
- (kill-buffer "*Edit Formulas*")
- (if arg
- (org-table-recalculate 'all)
- (message "New formulas installed - press C-u C-c C-c to apply."))))
-
-(defun org-table-fedit-abort ()
- "Abort editing formulas, without installing the changes."
- (interactive)
- (org-table-remove-rectangle-highlight)
- (let ((pos org-pos) (sel-win org-selected-window))
- (set-window-configuration org-window-configuration)
- (select-window sel-win)
- (goto-char pos)
- (move-marker pos nil)
- (message "Formula editing aborted without installing changes")))
-
-(defun org-table-fedit-lisp-indent ()
- "Pretty-print and re-indent Lisp expressions in the Formula Editor."
- (interactive)
- (let ((pos (point)) beg end ind)
- (beginning-of-line 1)
- (cond
- ((looking-at "[ \t]")
- (goto-char pos)
- (call-interactively 'lisp-indent-line))
- ((looking-at "[$&@0-9a-zA-Z]+ *= *[^ \t\n']") (goto-char pos))
- ((not (fboundp 'pp-buffer))
- (error "Cannot pretty-print. Command `pp-buffer' is not available"))
- ((looking-at "[$&@0-9a-zA-Z]+ *= *'(")
- (goto-char (- (match-end 0) 2))
- (setq beg (point))
- (setq ind (make-string (current-column) ?\ ))
- (condition-case nil (forward-sexp 1)
- (error
- (error "Cannot pretty-print Lisp expression: Unbalanced parenthesis")))
- (setq end (point))
- (save-restriction
- (narrow-to-region beg end)
- (if (eq last-command this-command)
- (progn
- (goto-char (point-min))
- (setq this-command nil)
- (while (re-search-forward "[ \t]*\n[ \t]*" nil t)
- (replace-match " ")))
- (pp-buffer)
- (untabify (point-min) (point-max))
- (goto-char (1+ (point-min)))
- (while (re-search-forward "^." nil t)
- (beginning-of-line 1)
- (insert ind))
- (goto-char (point-max))
- (backward-delete-char 1)))
- (goto-char beg))
- (t nil))))
-
-(defvar org-show-positions nil)
-
-(defun org-table-show-reference (&optional local)
- "Show the location/value of the $ expression at point."
- (interactive)
- (org-table-remove-rectangle-highlight)
- (catch 'exit
- (let ((pos (if local (point) org-pos))
- (face2 'highlight)
- (org-inhibit-highlight-removal t)
- (win (selected-window))
- (org-show-positions nil)
- var name e what match dest)
- (if local (org-table-get-specials))
- (setq what (cond
- ((or (org-at-regexp-p org-table-range-regexp2)
- (org-at-regexp-p org-table-translate-regexp)
- (org-at-regexp-p org-table-range-regexp))
- (setq match
- (save-match-data
- (org-table-convert-refs-to-rc (match-string 0))))
- 'range)
- ((org-at-regexp-p "\\$[a-zA-Z][a-zA-Z0-9]*") 'name)
- ((org-at-regexp-p "\\$[0-9]+") 'column)
- ((not local) nil)
- (t (error "No reference at point")))
- match (and what (or match (match-string 0))))
- (when (and match (not (equal (match-beginning 0) (point-at-bol))))
- (org-table-add-rectangle-overlay (match-beginning 0) (match-end 0)
- 'secondary-selection))
- (org-add-hook 'before-change-functions
- 'org-table-remove-rectangle-highlight)
- (if (eq what 'name) (setq var (substring match 1)))
- (when (eq what 'range)
- (or (equal (string-to-char match) ?@) (setq match (concat "@" match)))
- (setq match (org-table-formula-substitute-names match)))
- (unless local
- (save-excursion
- (end-of-line 1)
- (re-search-backward "^\\S-" nil t)
- (beginning-of-line 1)
- (when (looking-at "\\(\\$[0-9a-zA-Z]+\\|@[0-9]+\\$[0-9]+\\|[a-zA-Z]+\\([0-9]+\\|&\\)\\) *=")
- (setq dest
- (save-match-data
- (org-table-convert-refs-to-rc (match-string 1))))
- (org-table-add-rectangle-overlay
- (match-beginning 1) (match-end 1) face2))))
- (if (and (markerp pos) (marker-buffer pos))
- (if (get-buffer-window (marker-buffer pos))
- (select-window (get-buffer-window (marker-buffer pos)))
- (org-switch-to-buffer-other-window (get-buffer-window
- (marker-buffer pos)))))
- (goto-char pos)
- (org-table-force-dataline)
- (when dest
- (setq name (substring dest 1))
- (cond
- ((string-match "^\\$[a-zA-Z][a-zA-Z0-9]*" dest)
- (setq e (assoc name org-table-named-field-locations))
- (org-goto-line (nth 1 e))
- (org-table-goto-column (nth 2 e)))
- ((string-match "^@\\([0-9]+\\)\\$\\([0-9]+\\)" dest)
- (let ((l (string-to-number (match-string 1 dest)))
- (c (string-to-number (match-string 2 dest))))
- (org-goto-line (aref org-table-dlines l))
- (org-table-goto-column c)))
- (t (org-table-goto-column (string-to-number name))))
- (move-marker pos (point))
- (org-table-highlight-rectangle nil nil face2))
- (cond
- ((equal dest match))
- ((not match))
- ((eq what 'range)
- (condition-case nil
- (save-excursion
- (org-table-get-range match nil nil 'highlight))
- (error nil)))
- ((setq e (assoc var org-table-named-field-locations))
- (org-goto-line (nth 1 e))
- (org-table-goto-column (nth 2 e))
- (org-table-highlight-rectangle (point) (point))
- (message "Named field, column %d of line %d" (nth 2 e) (nth 1 e)))
- ((setq e (assoc var org-table-column-names))
- (org-table-goto-column (string-to-number (cdr e)))
- (org-table-highlight-rectangle (point) (point))
- (goto-char (org-table-begin))
- (if (re-search-forward (concat "^[ \t]*| *! *.*?| *\\(" var "\\) *|")
- (org-table-end) t)
- (progn
- (goto-char (match-beginning 1))
- (org-table-highlight-rectangle)
- (message "Named column (column %s)" (cdr e)))
- (error "Column name not found")))
- ((eq what 'column)
- ;; column number
- (org-table-goto-column (string-to-number (substring match 1)))
- (org-table-highlight-rectangle (point) (point))
- (message "Column %s" (substring match 1)))
- ((setq e (assoc var org-table-local-parameters))
- (goto-char (org-table-begin))
- (if (re-search-forward (concat "^[ \t]*| *\\$ *.*?| *\\(" var "=\\)") nil t)
- (progn
- (goto-char (match-beginning 1))
- (org-table-highlight-rectangle)
- (message "Local parameter."))
- (error "Parameter not found")))
- (t
- (cond
- ((not var) (error "No reference at point"))
- ((setq e (assoc var org-table-formula-constants-local))
- (message "Local Constant: $%s=%s in #+CONSTANTS line."
- var (cdr e)))
- ((setq e (assoc var org-table-formula-constants))
- (message "Constant: $%s=%s in `org-table-formula-constants'."
- var (cdr e)))
- ((setq e (and (fboundp 'constants-get) (constants-get var)))
- (message "Constant: $%s=%s, from `constants.el'%s."
- var e (format " (%s units)" constants-unit-system)))
- (t (error "Undefined name $%s" var)))))
- (goto-char pos)
- (when (and org-show-positions
- (not (memq this-command '(org-table-fedit-scroll
- org-table-fedit-scroll-down))))
- (push pos org-show-positions)
- (push org-table-current-begin-pos org-show-positions)
- (let ((min (apply 'min org-show-positions))
- (max (apply 'max org-show-positions)))
- (goto-char min) (recenter 0)
- (goto-char max)
- (or (pos-visible-in-window-p max) (recenter -1))))
- (select-window win))))
-
-(defun org-table-force-dataline ()
- "Make sure the cursor is in a dataline in a table."
- (unless (save-excursion
- (beginning-of-line 1)
- (looking-at org-table-dataline-regexp))
- (let* ((re org-table-dataline-regexp)
- (p1 (save-excursion (re-search-forward re nil 'move)))
- (p2 (save-excursion (re-search-backward re nil 'move))))
- (cond ((and p1 p2)
- (goto-char (if (< (abs (- p1 (point))) (abs (- p2 (point))))
- p1 p2)))
- ((or p1 p2) (goto-char (or p1 p2)))
- (t (error "No table dataline around here"))))))
-
-(defun org-table-fedit-line-up ()
- "Move cursor one line up in the window showing the table."
- (interactive)
- (org-table-fedit-move 'previous-line))
-
-(defun org-table-fedit-line-down ()
- "Move cursor one line down in the window showing the table."
- (interactive)
- (org-table-fedit-move 'next-line))
-
-(defun org-table-fedit-move (command)
- "Move the cursor in the window showing the table.
-Use COMMAND to do the motion, repeat if necessary to end up in a data line."
- (let ((org-table-allow-automatic-line-recalculation nil)
- (pos org-pos) (win (selected-window)) p)
- (select-window (get-buffer-window (marker-buffer org-pos)))
- (setq p (point))
- (call-interactively command)
- (while (and (org-at-table-p)
- (org-at-table-hline-p))
- (call-interactively command))
- (or (org-at-table-p) (goto-char p))
- (move-marker pos (point))
- (select-window win)))
-
-(defun org-table-fedit-scroll (N)
- (interactive "p")
- (let ((other-window-scroll-buffer (marker-buffer org-pos)))
- (scroll-other-window N)))
-
-(defun org-table-fedit-scroll-down (N)
- (interactive "p")
- (org-table-fedit-scroll (- N)))
-
-(defvar org-table-rectangle-overlays nil)
-
-(defun org-table-add-rectangle-overlay (beg end &optional face)
- "Add a new overlay."
- (let ((ov (make-overlay beg end)))
- (overlay-put ov 'face (or face 'secondary-selection))
- (push ov org-table-rectangle-overlays)))
-
-(defun org-table-highlight-rectangle (&optional beg end face)
- "Highlight rectangular region in a table."
- (setq beg (or beg (point)) end (or end (point)))
- (let ((b (min beg end))
- (e (max beg end))
- l1 c1 l2 c2 tmp)
- (and (boundp 'org-show-positions)
- (setq org-show-positions (cons b (cons e org-show-positions))))
- (goto-char (min beg end))
- (setq l1 (org-current-line)
- c1 (org-table-current-column))
- (goto-char (max beg end))
- (setq l2 (org-current-line)
- c2 (org-table-current-column))
- (if (> c1 c2) (setq tmp c1 c1 c2 c2 tmp))
- (org-goto-line l1)
- (beginning-of-line 1)
- (loop for line from l1 to l2 do
- (when (looking-at org-table-dataline-regexp)
- (org-table-goto-column c1)
- (skip-chars-backward "^|\n") (setq beg (point))
- (org-table-goto-column c2)
- (skip-chars-forward "^|\n") (setq end (point))
- (org-table-add-rectangle-overlay beg end face))
- (beginning-of-line 2))
- (goto-char b))
- (add-hook 'before-change-functions 'org-table-remove-rectangle-highlight))
-
-(defun org-table-remove-rectangle-highlight (&rest ignore)
- "Remove the rectangle overlays."
- (unless org-inhibit-highlight-removal
- (remove-hook 'before-change-functions 'org-table-remove-rectangle-highlight)
- (mapc 'delete-overlay org-table-rectangle-overlays)
- (setq org-table-rectangle-overlays nil)))
-
-(defvar org-table-coordinate-overlays nil
- "Collects the coordinate grid overlays, so that they can be removed.")
-(make-variable-buffer-local 'org-table-coordinate-overlays)
-
-(defun org-table-overlay-coordinates ()
- "Add overlays to the table at point, to show row/column coordinates."
- (interactive)
- (mapc 'delete-overlay org-table-coordinate-overlays)
- (setq org-table-coordinate-overlays nil)
- (save-excursion
- (let ((id 0) (ih 0) hline eol s1 s2 str ic ov beg)
- (goto-char (org-table-begin))
- (while (org-at-table-p)
- (setq eol (point-at-eol))
- (setq ov (make-overlay (point-at-bol) (1+ (point-at-bol))))
- (push ov org-table-coordinate-overlays)
- (setq hline (looking-at org-table-hline-regexp))
- (setq str (if hline (format "I*%-2d" (setq ih (1+ ih)))
- (format "%4d" (setq id (1+ id)))))
- (org-overlay-before-string ov str 'org-special-keyword 'evaporate)
- (when hline
- (setq ic 0)
- (while (re-search-forward "[+|]\\(-+\\)" eol t)
- (setq beg (1+ (match-beginning 0))
- ic (1+ ic)
- s1 (concat "$" (int-to-string ic))
- s2 (org-number-to-letters ic)
- str (if (eq org-table-use-standard-references t) s2 s1))
- (setq ov (make-overlay beg (+ beg (length str))))
- (push ov org-table-coordinate-overlays)
- (org-overlay-display ov str 'org-special-keyword 'evaporate)))
- (beginning-of-line 2)))))
-
-(defun org-table-toggle-coordinate-overlays ()
- "Toggle the display of Row/Column numbers in tables."
- (interactive)
- (setq org-table-overlay-coordinates (not org-table-overlay-coordinates))
- (message "Row/Column number display turned %s"
- (if org-table-overlay-coordinates "on" "off"))
- (if (and (org-at-table-p) org-table-overlay-coordinates)
- (org-table-align))
- (unless org-table-overlay-coordinates
- (mapc 'delete-overlay org-table-coordinate-overlays)
- (setq org-table-coordinate-overlays nil)))
-
-(defun org-table-toggle-formula-debugger ()
- "Toggle the formula debugger in tables."
- (interactive)
- (setq org-table-formula-debug (not org-table-formula-debug))
- (message "Formula debugging has been turned %s"
- (if org-table-formula-debug "on" "off")))
-
-;;; The orgtbl minor mode
-
-;; Define a minor mode which can be used in other modes in order to
-;; integrate the org-mode table editor.
-
-;; This is really a hack, because the org-mode table editor uses several
-;; keys which normally belong to the major mode, for example the TAB and
-;; RET keys. Here is how it works: The minor mode defines all the keys
-;; necessary to operate the table editor, but wraps the commands into a
-;; function which tests if the cursor is currently inside a table. If that
-;; is the case, the table editor command is executed. However, when any of
-;; those keys is used outside a table, the function uses `key-binding' to
-;; look up if the key has an associated command in another currently active
-;; keymap (minor modes, major mode, global), and executes that command.
-;; There might be problems if any of the keys used by the table editor is
-;; otherwise used as a prefix key.
-
-;; Another challenge is that the key binding for TAB can be tab or \C-i,
-;; likewise the binding for RET can be return or \C-m. Orgtbl-mode
-;; addresses this by checking explicitly for both bindings.
-
-;; The optimized version (see variable `orgtbl-optimized') takes over
-;; all keys which are bound to `self-insert-command' in the *global map*.
-;; Some modes bind other commands to simple characters, for example
-;; AUCTeX binds the double quote to `Tex-insert-quote'. With orgtbl-mode
-;; active, this binding is ignored inside tables and replaced with a
-;; modified self-insert.
-
-
-(defvar orgtbl-mode-map (make-keymap)
- "Keymap for `orgtbl-mode'.")
-
-;;;###autoload
-(defun turn-on-orgtbl ()
- "Unconditionally turn on `orgtbl-mode'."
- (orgtbl-mode 1))
-
-(defvar org-old-auto-fill-inhibit-regexp nil
- "Local variable used by `orgtbl-mode'.")
-
-(defconst orgtbl-line-start-regexp
- "[ \t]*\\(|\\|#\\+\\(TBLFM\\|ORGTBL\\|TBLNAME\\):\\)"
- "Matches a line belonging to an orgtbl.")
-
-(defconst orgtbl-extra-font-lock-keywords
- (list (list (concat "^" orgtbl-line-start-regexp ".*")
- 0 (quote 'org-table) 'prepend))
- "Extra `font-lock-keywords' to be added when `orgtbl-mode' is active.")
-
-;; Install it as a minor mode.
-(put 'orgtbl-mode :included t)
-(put 'orgtbl-mode :menu-tag "Org Table Mode")
-
-;;;###autoload
-(define-minor-mode orgtbl-mode
- "The `org-mode' table editor as a minor mode for use in other modes."
- :lighter " OrgTbl" :keymap orgtbl-mode-map
- (org-load-modules-maybe)
- (cond
- ((org-mode-p)
- ;; Exit without error, in case some hook functions calls this
- ;; by accident in org-mode.
- (message "Orgtbl-mode is not useful in org-mode, command ignored"))
- (orgtbl-mode
- (and (orgtbl-setup) (defun orgtbl-setup () nil)) ;; FIXME: Yuck!?!
- ;; Make sure we are first in minor-mode-map-alist
- (let ((c (assq 'orgtbl-mode minor-mode-map-alist)))
- ;; FIXME: maybe it should use emulation-mode-map-alists?
- (and c (setq minor-mode-map-alist
- (cons c (delq c minor-mode-map-alist)))))
- (org-set-local (quote org-table-may-need-update) t)
- (org-add-hook 'before-change-functions 'org-before-change-function
- nil 'local)
- (org-set-local 'org-old-auto-fill-inhibit-regexp
- auto-fill-inhibit-regexp)
- (org-set-local 'auto-fill-inhibit-regexp
- (if auto-fill-inhibit-regexp
- (concat orgtbl-line-start-regexp "\\|"
- auto-fill-inhibit-regexp)
- orgtbl-line-start-regexp))
- (add-to-invisibility-spec '(org-cwidth))
- (when (fboundp 'font-lock-add-keywords)
- (font-lock-add-keywords nil orgtbl-extra-font-lock-keywords)
- (org-restart-font-lock))
- (easy-menu-add orgtbl-mode-menu))
- (t
- (setq auto-fill-inhibit-regexp org-old-auto-fill-inhibit-regexp)
- (org-table-cleanup-narrow-column-properties)
- (org-remove-from-invisibility-spec '(org-cwidth))
- (remove-hook 'before-change-functions 'org-before-change-function t)
- (when (fboundp 'font-lock-remove-keywords)
- (font-lock-remove-keywords nil orgtbl-extra-font-lock-keywords)
- (org-restart-font-lock))
- (easy-menu-remove orgtbl-mode-menu)
- (force-mode-line-update 'all))))
-
-(defun org-table-cleanup-narrow-column-properties ()
- "Remove all properties related to narrow-column invisibility."
- (let ((s 1))
- (while (setq s (text-property-any s (point-max)
- 'display org-narrow-column-arrow))
- (remove-text-properties s (1+ s) '(display t)))
- (setq s 1)
- (while (setq s (text-property-any s (point-max) 'org-cwidth 1))
- (remove-text-properties s (1+ s) '(org-cwidth t)))
- (setq s 1)
- (while (setq s (text-property-any s (point-max) 'invisible 'org-cwidth))
- (remove-text-properties s (1+ s) '(invisible t)))))
-
-(defun orgtbl-make-binding (fun n &rest keys)
- "Create a function for binding in the table minor mode.
-FUN is the command to call inside a table. N is used to create a unique
-command name. KEYS are keys that should be checked in for a command
-to execute outside of tables."
- (eval
- (list 'defun
- (intern (concat "orgtbl-hijacker-command-" (int-to-string n)))
- '(arg)
- (concat "In tables, run `" (symbol-name fun) "'.\n"
- "Outside of tables, run the binding of `"
- (mapconcat (lambda (x) (format "%s" x)) keys "' or `")
- "'.")
- '(interactive "p")
- (list 'if
- '(org-at-table-p)
- (list 'call-interactively (list 'quote fun))
- (list 'let '(orgtbl-mode)
- (list 'call-interactively
- (append '(or)
- (mapcar (lambda (k)
- (list 'key-binding k))
- keys)
- '('orgtbl-error))))))))
-
-(defun orgtbl-error ()
- "Error when there is no default binding for a table key."
- (interactive)
- (error "This key has no function outside tables"))
-
-(defun orgtbl-setup ()
- "Setup orgtbl keymaps."
- (let ((nfunc 0)
- (bindings
- '(([(meta shift left)] org-table-delete-column)
- ([(meta left)] org-table-move-column-left)
- ([(meta right)] org-table-move-column-right)
- ([(meta shift right)] org-table-insert-column)
- ([(meta shift up)] org-table-kill-row)
- ([(meta shift down)] org-table-insert-row)
- ([(meta up)] org-table-move-row-up)
- ([(meta down)] org-table-move-row-down)
- ("\C-c\C-w" org-table-cut-region)
- ("\C-c\M-w" org-table-copy-region)
- ("\C-c\C-y" org-table-paste-rectangle)
- ("\C-c-" org-table-insert-hline)
- ("\C-c}" org-table-toggle-coordinate-overlays)
- ("\C-c{" org-table-toggle-formula-debugger)
- ("\C-m" org-table-next-row)
- ([(shift return)] org-table-copy-down)
- ("\C-c?" org-table-field-info)
- ("\C-c " org-table-blank-field)
- ("\C-c+" org-table-sum)
- ("\C-c=" org-table-eval-formula)
- ("\C-c'" org-table-edit-formulas)
- ("\C-c`" org-table-edit-field)
- ("\C-c*" org-table-recalculate)
- ("\C-c^" org-table-sort-lines)
- ("\M-a" org-table-beginning-of-field)
- ("\M-e" org-table-end-of-field)
- ([(control ?#)] org-table-rotate-recalc-marks)))
- elt key fun cmd)
- (while (setq elt (pop bindings))
- (setq nfunc (1+ nfunc))
- (setq key (org-key (car elt))
- fun (nth 1 elt)
- cmd (orgtbl-make-binding fun nfunc key))
- (org-defkey orgtbl-mode-map key cmd))
-
- ;; Special treatment needed for TAB and RET
- (org-defkey orgtbl-mode-map [(return)]
- (orgtbl-make-binding 'orgtbl-ret 100 [(return)] "\C-m"))
- (org-defkey orgtbl-mode-map "\C-m"
- (orgtbl-make-binding 'orgtbl-ret 101 "\C-m" [(return)]))
-
- (org-defkey orgtbl-mode-map [(tab)]
- (orgtbl-make-binding 'orgtbl-tab 102 [(tab)] "\C-i"))
- (org-defkey orgtbl-mode-map "\C-i"
- (orgtbl-make-binding 'orgtbl-tab 103 "\C-i" [(tab)]))
-
- (org-defkey orgtbl-mode-map [(shift tab)]
- (orgtbl-make-binding 'org-table-previous-field 104
- [(shift tab)] [(tab)] "\C-i"))
-
-
- (unless (featurep 'xemacs)
- (org-defkey orgtbl-mode-map [S-iso-lefttab]
- (orgtbl-make-binding 'org-table-previous-field 107
- [S-iso-lefttab] [backtab] [(shift tab)]
- [(tab)] "\C-i")))
-
- (org-defkey orgtbl-mode-map [backtab]
- (orgtbl-make-binding 'org-table-previous-field 108
- [backtab] [S-iso-lefttab] [(shift tab)]
- [(tab)] "\C-i"))
-
- (org-defkey orgtbl-mode-map "\M-\C-m"
- (orgtbl-make-binding 'org-table-wrap-region 105
- "\M-\C-m" [(meta return)]))
- (org-defkey orgtbl-mode-map [(meta return)]
- (orgtbl-make-binding 'org-table-wrap-region 106
- [(meta return)] "\M-\C-m"))
-
- (org-defkey orgtbl-mode-map "\C-c\C-c" 'orgtbl-ctrl-c-ctrl-c)
- (org-defkey orgtbl-mode-map "\C-c|" 'orgtbl-create-or-convert-from-region)
-
- (when orgtbl-optimized
- ;; If the user wants maximum table support, we need to hijack
- ;; some standard editing functions
- (org-remap orgtbl-mode-map
- 'self-insert-command 'orgtbl-self-insert-command
- 'delete-char 'org-delete-char
- 'delete-backward-char 'org-delete-backward-char)
- (org-defkey orgtbl-mode-map "|" 'org-force-self-insert))
- (easy-menu-define orgtbl-mode-menu orgtbl-mode-map "OrgTbl menu"
- '("OrgTbl"
- ["Create or convert" org-table-create-or-convert-from-region
- :active (not (org-at-table-p)) :keys "C-c |" ]
- "--"
- ["Align" org-ctrl-c-ctrl-c :active (org-at-table-p) :keys "C-c C-c"]
- ["Next Field" org-cycle :active (org-at-table-p) :keys "TAB"]
- ["Previous Field" org-shifttab :active (org-at-table-p) :keys "S-TAB"]
- ["Next Row" org-return :active (org-at-table-p) :keys "RET"]
- "--"
- ["Blank Field" org-table-blank-field :active (org-at-table-p) :keys "C-c SPC"]
- ["Edit Field" org-table-edit-field :active (org-at-table-p) :keys "C-c ` "]
- ["Copy Field from Above"
- org-table-copy-down :active (org-at-table-p) :keys "S-RET"]
- "--"
- ("Column"
- ["Move Column Left" org-metaleft :active (org-at-table-p) :keys "M-<left>"]
- ["Move Column Right" org-metaright :active (org-at-table-p) :keys "M-<right>"]
- ["Delete Column" org-shiftmetaleft :active (org-at-table-p) :keys "M-S-<left>"]
- ["Insert Column" org-shiftmetaright :active (org-at-table-p) :keys "M-S-<right>"])
- ("Row"
- ["Move Row Up" org-metaup :active (org-at-table-p) :keys "M-<up>"]
- ["Move Row Down" org-metadown :active (org-at-table-p) :keys "M-<down>"]
- ["Delete Row" org-shiftmetaup :active (org-at-table-p) :keys "M-S-<up>"]
- ["Insert Row" org-shiftmetadown :active (org-at-table-p) :keys "M-S-<down>"]
- ["Sort lines in region" org-table-sort-lines :active (org-at-table-p) :keys "C-c ^"]
- "--"
- ["Insert Hline" org-table-insert-hline :active (org-at-table-p) :keys "C-c -"])
- ("Rectangle"
- ["Copy Rectangle" org-copy-special :active (org-at-table-p)]
- ["Cut Rectangle" org-cut-special :active (org-at-table-p)]
- ["Paste Rectangle" org-paste-special :active (org-at-table-p)]
- ["Fill Rectangle" org-table-wrap-region :active (org-at-table-p)])
- "--"
- ("Radio tables"
- ["Insert table template" orgtbl-insert-radio-table
- (assq major-mode orgtbl-radio-table-templates)]
- ["Comment/uncomment table" orgtbl-toggle-comment t])
- "--"
- ["Set Column Formula" org-table-eval-formula :active (org-at-table-p) :keys "C-c ="]
- ["Set Field Formula" (org-table-eval-formula '(4)) :active (org-at-table-p) :keys "C-u C-c ="]
- ["Edit Formulas" org-table-edit-formulas :active (org-at-table-p) :keys "C-c '"]
- ["Recalculate line" org-table-recalculate :active (org-at-table-p) :keys "C-c *"]
- ["Recalculate all" (org-table-recalculate '(4)) :active (org-at-table-p) :keys "C-u C-c *"]
- ["Iterate all" (org-table-recalculate '(16)) :active (org-at-table-p) :keys "C-u C-u C-c *"]
- ["Toggle Recalculate Mark" org-table-rotate-recalc-marks :active (org-at-table-p) :keys "C-c #"]
- ["Sum Column/Rectangle" org-table-sum
- :active (or (org-at-table-p) (org-region-active-p)) :keys "C-c +"]
- ["Which Column?" org-table-current-column :active (org-at-table-p) :keys "C-c ?"]
- ["Debug Formulas"
- org-table-toggle-formula-debugger :active (org-at-table-p)
- :keys "C-c {"
- :style toggle :selected org-table-formula-debug]
- ["Show Col/Row Numbers"
- org-table-toggle-coordinate-overlays :active (org-at-table-p)
- :keys "C-c }"
- :style toggle :selected org-table-overlay-coordinates]
- ))
- t))
-
-(defun orgtbl-ctrl-c-ctrl-c (arg)
- "If the cursor is inside a table, realign the table.
-If it is a table to be sent away to a receiver, do it.
-With prefix arg, also recompute table."
- (interactive "P")
- (let ((pos (point)) action)
- (save-excursion
- (beginning-of-line 1)
- (setq action (cond ((looking-at "[ \t]*#\\+ORGTBL:.*\n[ \t]*|") (match-end 0))
- ((looking-at "[ \t]*|") pos)
- ((looking-at "[ \t]*#\\+TBLFM:") 'recalc))))
- (cond
- ((integerp action)
- (goto-char action)
- (org-table-maybe-eval-formula)
- (if arg
- (call-interactively 'org-table-recalculate)
- (org-table-maybe-recalculate-line))
- (call-interactively 'org-table-align)
- (when (orgtbl-send-table 'maybe)
- (run-hooks 'orgtbl-after-send-table-hook)))
- ((eq action 'recalc)
- (save-excursion
- (beginning-of-line 1)
- (skip-chars-backward " \r\n\t")
- (if (org-at-table-p)
- (org-call-with-arg 'org-table-recalculate t))))
- (t (let (orgtbl-mode)
- (call-interactively (key-binding "\C-c\C-c")))))))
-
-(defun orgtbl-create-or-convert-from-region (arg)
- "Create table or convert region to table, if no conflicting binding.
-This installs the table binding `C-c |', but only if there is no
-conflicting binding to this key outside orgtbl-mode."
- (interactive "P")
- (let* (orgtbl-mode (cmd (key-binding "\C-c|")))
- (if cmd
- (call-interactively cmd)
- (call-interactively 'org-table-create-or-convert-from-region))))
-
-(defun orgtbl-tab (arg)
- "Justification and field motion for `orgtbl-mode'."
- (interactive "P")
- (if arg (org-table-edit-field t)
- (org-table-justify-field-maybe)
- (org-table-next-field)))
-
-(defun orgtbl-ret ()
- "Justification and field motion for `orgtbl-mode'."
- (interactive)
- (if (bobp)
- (newline)
- (org-table-justify-field-maybe)
- (org-table-next-row)))
-
-(defun orgtbl-self-insert-command (N)
- "Like `self-insert-command', use overwrite-mode for whitespace in tables.
-If the cursor is in a table looking at whitespace, the whitespace is
-overwritten, and the table is not marked as requiring realignment."
- (interactive "p")
- (if (and (org-at-table-p)
- (or
- (and org-table-auto-blank-field
- (member last-command
- '(orgtbl-hijacker-command-100
- orgtbl-hijacker-command-101
- orgtbl-hijacker-command-102
- orgtbl-hijacker-command-103
- orgtbl-hijacker-command-104
- orgtbl-hijacker-command-105
- yas/expand))
- (org-table-blank-field))
- t)
- (eq N 1)
- (looking-at "[^|\n]* +|"))
- (let (org-table-may-need-update)
- (goto-char (1- (match-end 0)))
- (delete-backward-char 1)
- (goto-char (match-beginning 0))
- (self-insert-command N))
- (setq org-table-may-need-update t)
- (let* (orgtbl-mode
- a
- (cmd (or (key-binding
- (or (and (listp function-key-map)
- (setq a (assoc last-input-event function-key-map))
- (cdr a))
- (vector last-input-event)))
- 'self-insert-command)))
- (call-interactively cmd)
- (if (and org-self-insert-cluster-for-undo
- (eq cmd 'self-insert-command))
- (if (not (eq last-command 'orgtbl-self-insert-command))
- (setq org-self-insert-command-undo-counter 1)
- (if (>= org-self-insert-command-undo-counter 20)
- (setq org-self-insert-command-undo-counter 1)
- (and (> org-self-insert-command-undo-counter 0)
- buffer-undo-list
- (not (cadr buffer-undo-list)) ; remove nil entry
- (setcdr buffer-undo-list (cddr buffer-undo-list)))
- (setq org-self-insert-command-undo-counter
- (1+ org-self-insert-command-undo-counter))))))))
-
-(defvar orgtbl-exp-regexp "^\\([-+]?[0-9][0-9.]*\\)[eE]\\([-+]?[0-9]+\\)$"
- "Regular expression matching exponentials as produced by calc.")
-
-(defun orgtbl-export (table target)
- (require 'org-exp)
- (let ((func (intern (concat "orgtbl-to-" (symbol-name target))))
- (lines (org-split-string table "[ \t]*\n[ \t]*"))
- org-table-last-alignment org-table-last-column-widths
- maxcol column)
- (if (not (fboundp func))
- (error "Cannot export orgtbl table to %s" target))
- (setq lines (org-table-clean-before-export lines))
- (setq table
- (mapcar
- (lambda (x)
- (if (string-match org-table-hline-regexp x)
- 'hline
- (org-split-string (org-trim x) "\\s-*|\\s-*")))
- lines))
- (setq maxcol (apply 'max (mapcar (lambda (x) (if (listp x) (length x) 0))
- table)))
- (loop for i from (1- maxcol) downto 0 do
- (setq column (mapcar (lambda (x) (if (listp x) (nth i x) nil)) table))
- (setq column (delq nil column))
- (push (apply 'max (mapcar 'string-width column)) org-table-last-column-widths)
- (push (> (/ (apply '+ (mapcar (lambda (x) (if (string-match org-table-number-regexp x) 1 0)) column)) maxcol) org-table-number-fraction) org-table-last-alignment))
- (funcall func table nil)))
-
-(defun orgtbl-gather-send-defs ()
- "Gather a plist of :name, :transform, :params for each destination before
-a radio table."
- (save-excursion
- (goto-char (org-table-begin))
- (let (rtn)
- (beginning-of-line 0)
- (while (looking-at "[ \t]*#\\+ORGTBL[: \t][ \t]*SEND[ \t]+\\([^ \t\r\n]+\\)[ \t]+\\([^ \t\r\n]+\\)\\([ \t]+.*\\)?")
- (let ((name (org-no-properties (match-string 1)))
- (transform (intern (match-string 2)))
- (params (if (match-end 3)
- (read (concat "(" (match-string 3) ")")))))
- (push (list :name name :transform transform :params params)
- rtn)
- (beginning-of-line 0)))
- rtn)))
-
-(defun orgtbl-send-replace-tbl (name txt)
- "Find and replace table NAME with TXT."
- (save-excursion
- (goto-char (point-min))
- (unless (re-search-forward
- (concat "BEGIN RECEIVE ORGTBL +" name "\\([ \t]\\|$\\)") nil t)
- (error "Don't know where to insert translated table"))
- (goto-char (match-beginning 0))
- (beginning-of-line 2)
- (save-excursion
- (let ((beg (point)))
- (unless (re-search-forward
- (concat "END RECEIVE ORGTBL +" name) nil t)
- (error "Cannot find end of insertion region"))
- (beginning-of-line 1)
- (delete-region beg (point))))
- (insert txt "\n")))
-
-;;;###autoload
-(defun org-table-to-lisp (&optional txt)
- "Convert the table at point to a Lisp structure.
-The structure will be a list. Each item is either the symbol `hline'
-for a horizontal separator line, or a list of field values as strings.
-The table is taken from the parameter TXT, or from the buffer at point."
- (unless txt
- (unless (org-at-table-p)
- (error "No table at point")))
- (let* ((txt (or txt
- (buffer-substring-no-properties (org-table-begin)
- (org-table-end))))
- (lines (org-split-string txt "[ \t]*\n[ \t]*")))
-
- (mapcar
- (lambda (x)
- (if (string-match org-table-hline-regexp x)
- 'hline
- (org-split-string (org-trim x) "\\s-*|\\s-*")))
- lines)))
-
-(defun orgtbl-send-table (&optional maybe)
- "Send a transformed version of this table to the receiver position.
-With argument MAYBE, fail quietly if no transformation is defined for
-this table."
- (interactive)
- (catch 'exit
- (unless (org-at-table-p) (error "Not at a table"))
- ;; when non-interactive, we assume align has just happened.
- (when (interactive-p) (org-table-align))
- (let ((dests (orgtbl-gather-send-defs))
- (txt (buffer-substring-no-properties (org-table-begin)
- (org-table-end)))
- (ntbl 0))
- (unless dests (if maybe (throw 'exit nil)
- (error "Don't know how to transform this table")))
- (dolist (dest dests)
- (let* ((name (plist-get dest :name))
- (transform (plist-get dest :transform))
- (params (plist-get dest :params))
- (skip (plist-get params :skip))
- (skipcols (plist-get params :skipcols))
- beg
- (lines (org-table-clean-before-export
- (nthcdr (or skip 0)
- (org-split-string txt "[ \t]*\n[ \t]*"))))
- (i0 (if org-table-clean-did-remove-column 2 1))
- (table (mapcar
- (lambda (x)
- (if (string-match org-table-hline-regexp x)
- 'hline
- (org-remove-by-index
- (org-split-string (org-trim x) "\\s-*|\\s-*")
- skipcols i0)))
- lines))
- (fun (if (= i0 2) 'cdr 'identity))
- (org-table-last-alignment
- (org-remove-by-index (funcall fun org-table-last-alignment)
- skipcols i0))
- (org-table-last-column-widths
- (org-remove-by-index (funcall fun org-table-last-column-widths)
- skipcols i0))
- (txt (if (fboundp transform)
- (funcall transform table params)
- (error "No such transformation function %s" transform))))
- (orgtbl-send-replace-tbl name txt))
- (setq ntbl (1+ ntbl)))
- (message "Table converted and installed at %d receiver location%s"
- ntbl (if (> ntbl 1) "s" ""))
- (if (> ntbl 0)
- ntbl
- nil))))
-
-(defun org-remove-by-index (list indices &optional i0)
- "Remove the elements in LIST with indices in INDICES.
-First element has index 0, or I0 if given."
- (if (not indices)
- list
- (if (integerp indices) (setq indices (list indices)))
- (setq i0 (1- (or i0 0)))
- (delq :rm (mapcar (lambda (x)
- (setq i0 (1+ i0))
- (if (memq i0 indices) :rm x))
- list))))
-
-(defun orgtbl-toggle-comment ()
- "Comment or uncomment the orgtbl at point."
- (interactive)
- (let* ((re1 (concat "^" (regexp-quote comment-start) orgtbl-line-start-regexp))
- (re2 (concat "^" orgtbl-line-start-regexp))
- (commented (save-excursion (beginning-of-line 1)
- (cond ((looking-at re1) t)
- ((looking-at re2) nil)
- (t (error "Not at an org table")))))
- (re (if commented re1 re2))
- beg end)
- (save-excursion
- (beginning-of-line 1)
- (while (looking-at re) (beginning-of-line 0))
- (beginning-of-line 2)
- (setq beg (point))
- (while (looking-at re) (beginning-of-line 2))
- (setq end (point)))
- (comment-region beg end (if commented '(4) nil))))
-
-(defun orgtbl-insert-radio-table ()
- "Insert a radio table template appropriate for this major mode."
- (interactive)
- (let* ((e (assq major-mode orgtbl-radio-table-templates))
- (txt (nth 1 e))
- name pos)
- (unless e (error "No radio table setup defined for %s" major-mode))
- (setq name (read-string "Table name: "))
- (while (string-match "%n" txt)
- (setq txt (replace-match name t t txt)))
- (or (bolp) (insert "\n"))
- (setq pos (point))
- (insert txt)
- (goto-char pos)))
-
-;; Dynamically bound input and output for table formatting.
-(defvar *orgtbl-table* nil
- "Carries the current table through formatting routines.")
-(defvar *orgtbl-rtn* nil
- "Formatting routines push the output lines here.")
-;; Formatting parameters for the current table section.
-(defvar *orgtbl-hline* nil "Text used for horizontal lines.")
-(defvar *orgtbl-sep* nil "Text used as a column separator.")
-(defvar *orgtbl-default-fmt* nil "Default format for each entry.")
-(defvar *orgtbl-fmt* nil "Format for each entry.")
-(defvar *orgtbl-efmt* nil "Format for numbers.")
-(defvar *orgtbl-lfmt* nil "Format for an entire line, overrides fmt.")
-(defvar *orgtbl-llfmt* nil "Specializes lfmt for the last row.")
-(defvar *orgtbl-lstart* nil "Text starting a row.")
-(defvar *orgtbl-llstart* nil "Specializes lstart for the last row.")
-(defvar *orgtbl-lend* nil "Text ending a row.")
-(defvar *orgtbl-llend* nil "Specializes lend for the last row.")
-
-(defsubst orgtbl-get-fmt (fmt i)
- "Retrieve the format from FMT corresponding to the Ith column."
- (if (and (not (functionp fmt)) (consp fmt))
- (plist-get fmt i)
- fmt))
-
-(defsubst orgtbl-apply-fmt (fmt &rest args)
- "Apply format FMT to the arguments. NIL FMTs return the first argument."
- (cond ((functionp fmt) (apply fmt args))
- (fmt (apply 'format fmt args))
- (args (car args))
- (t args)))
-
-(defsubst orgtbl-eval-str (str)
- "If STR is a function, evaluate it with no arguments."
- (if (functionp str)
- (funcall str)
- str))
-
-(defun orgtbl-format-line (line)
- "Format LINE as a table row."
- (if (eq line 'hline) (if *orgtbl-hline* (push *orgtbl-hline* *orgtbl-rtn*))
- (let* ((i 0)
- (line
- (mapcar
- (lambda (f)
- (setq i (1+ i))
- (let* ((efmt (orgtbl-get-fmt *orgtbl-efmt* i))
- (f (if (and efmt (string-match orgtbl-exp-regexp f))
- (orgtbl-apply-fmt efmt (match-string 1 f)
- (match-string 2 f))
- f)))
- (orgtbl-apply-fmt (or (orgtbl-get-fmt *orgtbl-fmt* i)
- *orgtbl-default-fmt*)
- f)))
- line)))
- (push (if *orgtbl-lfmt*
- (orgtbl-apply-fmt *orgtbl-lfmt* line)
- (concat (orgtbl-eval-str *orgtbl-lstart*)
- (mapconcat 'identity line *orgtbl-sep*)
- (orgtbl-eval-str *orgtbl-lend*)))
- *orgtbl-rtn*))))
-
-(defun orgtbl-format-section (section-stopper)
- "Format lines until the first occurrence of SECTION-STOPPER."
- (let (prevline)
- (progn
- (while (not (eq (car *orgtbl-table*) section-stopper))
- (if prevline (orgtbl-format-line prevline))
- (setq prevline (pop *orgtbl-table*)))
- (if prevline (let ((*orgtbl-lstart* *orgtbl-llstart*)
- (*orgtbl-lend* *orgtbl-llend*)
- (*orgtbl-lfmt* *orgtbl-llfmt*))
- (orgtbl-format-line prevline))))))
-
-(defun orgtbl-to-generic (table params)
- "Convert the orgtbl-mode TABLE to some other format.
-This generic routine can be used for many standard cases.
-TABLE is a list, each entry either the symbol `hline' for a horizontal
-separator line, or a list of fields for that line.
-PARAMS is a property list of parameters that can influence the conversion.
-For the generic converter, some parameters are obligatory: You need to
-specify either :lfmt, or all of (:lstart :lend :sep).
-
-Valid parameters are
-
-:splice When set to t, return only table body lines, don't wrap
- them into :tstart and :tend. Default is nil. When :splice
- is non-nil, this also means that the exporter should not look
- for and interpret header and footer sections.
-
-:hline String to be inserted on horizontal separation lines.
- May be nil to ignore hlines.
-
-:sep Separator between two fields
-:remove-nil-lines Do not include lines that evaluate to nil.
-
-
-Each in the following group may be either a string or a function
-of no arguments returning a string:
-:tstart String to start the table. Ignored when :splice is t.
-:tend String to end the table. Ignored when :splice is t.
-:lstart String to start a new table line.
-:llstart String to start the last table line, defaults to :lstart.
-:lend String to end a table line
-:llend String to end the last table line, defaults to :lend.
-
-Each in the following group may be a string, a function of one
-argument (the field or line) returning a string, or a plist
-mapping columns to either of the above:
-:lfmt Format for entire line, with enough %s to capture all fields.
- If this is present, :lstart, :lend, and :sep are ignored.
-:llfmt Format for the entire last line, defaults to :lfmt.
-:fmt A format to be used to wrap the field, should contain
- %s for the original field value. For example, to wrap
- everything in dollars, you could use :fmt \"$%s$\".
- This may also be a property list with column numbers and
- formats. For example :fmt (2 \"$%s$\" 4 \"%s%%\")
-
-:hlstart :hllstart :hlend :hllend :hlsep :hlfmt :hllfmt :hfmt
- Same as above, specific for the header lines in the table.
- All lines before the first hline are treated as header.
- If any of these is not present, the data line value is used.
-
-This may be either a string or a function of two arguments:
-:efmt Use this format to print numbers with exponentials.
- The format should have %s twice for inserting mantissa
- and exponent, for example \"%s\\\\times10^{%s}\". This
- may also be a property list with column numbers and
- formats. :fmt will still be applied after :efmt.
-
-In addition to this, the parameters :skip and :skipcols are always handled
-directly by `orgtbl-send-table'. See manual."
- (interactive)
-
- (let* ((splicep (plist-get params :splice))
- (hline (plist-get params :hline))
- (remove-nil-linesp (plist-get params :remove-nil-lines))
- (remove-newlines (plist-get params :remove-newlines))
- (*orgtbl-hline* hline)
- (*orgtbl-table* table)
- (*orgtbl-sep* (plist-get params :sep))
- (*orgtbl-efmt* (plist-get params :efmt))
- (*orgtbl-lstart* (plist-get params :lstart))
- (*orgtbl-llstart* (or (plist-get params :llstart) *orgtbl-lstart*))
- (*orgtbl-lend* (plist-get params :lend))
- (*orgtbl-llend* (or (plist-get params :llend) *orgtbl-lend*))
- (*orgtbl-lfmt* (plist-get params :lfmt))
- (*orgtbl-llfmt* (or (plist-get params :llfmt) *orgtbl-lfmt*))
- (*orgtbl-fmt* (plist-get params :fmt))
- *orgtbl-rtn*)
-
- ;; Put header
- (unless splicep
- (when (plist-member params :tstart)
- (let ((tstart (orgtbl-eval-str (plist-get params :tstart))))
- (if tstart (push tstart *orgtbl-rtn*)))))
-
- ;; Do we have a heading section? If so, format it and handle the
- ;; trailing hline.
- (if (and (not splicep)
- (or (consp (car *orgtbl-table*))
- (consp (nth 1 *orgtbl-table*)))
- (memq 'hline (cdr *orgtbl-table*)))
- (progn
- (when (eq 'hline (car *orgtbl-table*))
- ;; there is a hline before the first data line
- (and hline (push hline *orgtbl-rtn*))
- (pop *orgtbl-table*))
- (let* ((*orgtbl-lstart* (or (plist-get params :hlstart)
- *orgtbl-lstart*))
- (*orgtbl-llstart* (or (plist-get params :hllstart)
- *orgtbl-llstart*))
- (*orgtbl-lend* (or (plist-get params :hlend) *orgtbl-lend*))
- (*orgtbl-llend* (or (plist-get params :hllend)
- (plist-get params :hlend) *orgtbl-llend*))
- (*orgtbl-lfmt* (or (plist-get params :hlfmt) *orgtbl-lfmt*))
- (*orgtbl-llfmt* (or (plist-get params :hllfmt)
- (plist-get params :hlfmt) *orgtbl-llfmt*))
- (*orgtbl-sep* (or (plist-get params :hlsep) *orgtbl-sep*))
- (*orgtbl-fmt* (or (plist-get params :hfmt) *orgtbl-fmt*)))
- (orgtbl-format-section 'hline))
- (if hline (push hline *orgtbl-rtn*))
- (pop *orgtbl-table*)))
-
- ;; Now format the main section.
- (orgtbl-format-section nil)
-
- (unless splicep
- (when (plist-member params :tend)
- (let ((tend (orgtbl-eval-str (plist-get params :tend))))
- (if tend (push tend *orgtbl-rtn*)))))
-
- (mapconcat (if remove-newlines
- (lambda (tend)
- (replace-regexp-in-string "[\n\r\t\f]" "\\\\n" tend))
- 'identity)
- (nreverse (if remove-nil-linesp
- (remq nil *orgtbl-rtn*)
- *orgtbl-rtn*)) "\n")))
-
-(defun orgtbl-to-tsv (table params)
- "Convert the orgtbl-mode table to TAB separated material."
- (orgtbl-to-generic table (org-combine-plists '(:sep "\t") params)))
-(defun orgtbl-to-csv (table params)
- "Convert the orgtbl-mode table to CSV material.
-This does take care of the proper quoting of fields with comma or quotes."
- (orgtbl-to-generic table (org-combine-plists
- '(:sep "," :fmt org-quote-csv-field)
- params)))
-
-(defun orgtbl-to-latex (table params)
- "Convert the orgtbl-mode TABLE to LaTeX.
-TABLE is a list, each entry either the symbol `hline' for a horizontal
-separator line, or a list of fields for that line.
-PARAMS is a property list of parameters that can influence the conversion.
-Supports all parameters from `orgtbl-to-generic'. Most important for
-LaTeX are:
-
-:splice When set to t, return only table body lines, don't wrap
- them into a tabular environment. Default is nil.
-
-:fmt A format to be used to wrap the field, should contain %s for the
- original field value. For example, to wrap everything in dollars,
- use :fmt \"$%s$\". This may also be a property list with column
- numbers and formats. For example :fmt (2 \"$%s$\" 4 \"%s%%\")
- The format may also be a function that formats its one argument.
-
-:efmt Format for transforming numbers with exponentials. The format
- should have %s twice for inserting mantissa and exponent, for
- example \"%s\\\\times10^{%s}\". LaTeX default is \"%s\\\\,(%s)\".
- This may also be a property list with column numbers and formats.
- The format may also be a function that formats its two arguments.
-
-:llend If you find too much space below the last line of a table,
- pass a value of \"\" for :llend to suppress the final \\\\.
-
-The general parameters :skip and :skipcols have already been applied when
-this function is called."
- (let* ((alignment (mapconcat (lambda (x) (if x "r" "l"))
- org-table-last-alignment ""))
- (params2
- (list
- :tstart (concat "\\begin{tabular}{" alignment "}")
- :tend "\\end{tabular}"
- :lstart "" :lend " \\\\" :sep " & "
- :efmt "%s\\,(%s)" :hline "\\hline")))
- (orgtbl-to-generic table (org-combine-plists params2 params))))
-
-(defun orgtbl-to-html (table params)
- "Convert the orgtbl-mode TABLE to HTML.
-TABLE is a list, each entry either the symbol `hline' for a horizontal
-separator line, or a list of fields for that line.
-PARAMS is a property list of parameters that can influence the conversion.
-Currently this function recognizes the following parameters:
-
-:splice When set to t, return only table body lines, don't wrap
- them into a <table> environment. Default is nil.
-
-The general parameters :skip and :skipcols have already been applied when
-this function is called. The function does *not* use `orgtbl-to-generic',
-so you cannot specify parameters for it."
- (let* ((splicep (plist-get params :splice))
- (html-table-tag org-export-html-table-tag)
- html)
- ;; Just call the formatter we already have
- ;; We need to make text lines for it, so put the fields back together.
- (setq html (org-format-org-table-html
- (mapcar
- (lambda (x)
- (if (eq x 'hline)
- "|----+----|"
- (concat "| " (mapconcat 'org-html-expand x " | ") " |")))
- table)
- splicep))
- (if (string-match "\n+\\'" html)
- (setq html (replace-match "" t t html)))
- html))
-
-(defun orgtbl-to-texinfo (table params)
- "Convert the orgtbl-mode TABLE to TeXInfo.
-TABLE is a list, each entry either the symbol `hline' for a horizontal
-separator line, or a list of fields for that line.
-PARAMS is a property list of parameters that can influence the conversion.
-Supports all parameters from `orgtbl-to-generic'. Most important for
-TeXInfo are:
-
-:splice nil/t When set to t, return only table body lines, don't wrap
- them into a multitable environment. Default is nil.
-
-:fmt fmt A format to be used to wrap the field, should contain
- %s for the original field value. For example, to wrap
- everything in @kbd{}, you could use :fmt \"@kbd{%s}\".
- This may also be a property list with column numbers and
- formats. For example :fmt (2 \"@kbd{%s}\" 4 \"@code{%s}\").
- Each format also may be a function that formats its one
- argument.
-
-:cf \"f1 f2..\" The column fractions for the table. By default these
- are computed automatically from the width of the columns
- under org-mode.
-
-The general parameters :skip and :skipcols have already been applied when
-this function is called."
- (let* ((total (float (apply '+ org-table-last-column-widths)))
- (colfrac (or (plist-get params :cf)
- (mapconcat
- (lambda (x) (format "%.3f" (/ (float x) total)))
- org-table-last-column-widths " ")))
- (params2
- (list
- :tstart (concat "@multitable @columnfractions " colfrac)
- :tend "@end multitable"
- :lstart "@item " :lend "" :sep " @tab "
- :hlstart "@headitem ")))
- (orgtbl-to-generic table (org-combine-plists params2 params))))
-
-(defun orgtbl-to-orgtbl (table params)
- "Convert the orgtbl-mode TABLE into another orgtbl-mode table.
-Useful when slicing one table into many. The :hline, :sep,
-:lstart, and :lend provide orgtbl framing. The default nil :tstart
-and :tend suppress strings without splicing; they can be set to
-provide ORGTBL directives for the generated table."
- (let* ((params2
- (list
- :remove-newlines t
- :tstart nil :tend nil
- :hline "|---"
- :sep " | "
- :lstart "| "
- :lend " |"))
- (params (org-combine-plists params2 params)))
- (orgtbl-to-generic table params)))
-
-(defun org-table-get-remote-range (name-or-id form)
- "Get a field value or a list of values in a range from table at ID.
-
-NAME-OR-ID may be the name of a table in the current file as set by
-a \"#+TBLNAME:\" directive. The first table following this line
-will then be used. Alternatively, it may be an ID referring to
-any entry, also in a different file. In this case, the first table
-in that entry will be referenced.
-FORM is a field or range descriptor like \"@2$3\" or or \"B3\" or
-\"@I$2..@II$2\". All the references must be absolute, not relative.
-
-The return value is either a single string for a single field, or a
-list of the fields in the rectangle ."
- (save-match-data
- (let ((id-loc nil)
- org-table-column-names org-table-column-name-regexp
- org-table-local-parameters org-table-named-field-locations
- org-table-current-line-types org-table-current-begin-line
- org-table-current-begin-pos org-table-dlines
- org-table-hlines org-table-last-alignment
- org-table-last-column-widths org-table-last-alignment
- org-table-last-column-widths tbeg
- buffer loc)
- (setq form (org-table-convert-refs-to-rc form))
- (save-excursion
- (save-restriction
- (widen)
- (save-excursion
- (goto-char (point-min))
- (if (re-search-forward
- (concat "^[ \t]*#\\+TBLNAME:[ \t]*" (regexp-quote name-or-id) "[ \t]*$")
- nil t)
- (setq buffer (current-buffer) loc (match-beginning 0))
- (setq id-loc (org-id-find name-or-id 'marker))
- (unless (and id-loc (markerp id-loc))
- (error "Can't find remote table \"%s\"" name-or-id))
- (setq buffer (marker-buffer id-loc)
- loc (marker-position id-loc))
- (move-marker id-loc nil)))
- (with-current-buffer buffer
- (save-excursion
- (save-restriction
- (widen)
- (goto-char loc)
- (forward-char 1)
- (unless (and (re-search-forward "^\\(\\*+ \\)\\|[ \t]*|" nil t)
- (not (match-beginning 1)))
- (error "Cannot find a table at NAME or ID %s" name-or-id))
- (setq tbeg (point-at-bol))
- (org-table-get-specials)
- (setq form (org-table-formula-substitute-names form))
- (if (and (string-match org-table-range-regexp form)
- (> (length (match-string 0 form)) 1))
- (save-match-data
- (org-table-get-range (match-string 0 form) tbeg 1))
- form)))))))))
-
-(provide 'org-table)
-
-;; arch-tag: 4d21cfdd-0268-440a-84b0-09237a0fe0ef
-
-;;; org-table.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-table.elc b/.emacs.d/org-7.4/lisp/org-table.elc
deleted file mode 100644
index 5c38858..0000000
--- a/.emacs.d/org-7.4/lisp/org-table.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-taskjuggler.el b/.emacs.d/org-7.4/lisp/org-taskjuggler.el
deleted file mode 100644
index d78e10d..0000000
--- a/.emacs.d/org-7.4/lisp/org-taskjuggler.el
+++ /dev/null
@@ -1,648 +0,0 @@
-;;; org-taskjuggler.el --- TaskJuggler exporter for org-mode
-;;
-;; Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-;;
-;; Emacs Lisp Archive Entry
-;; Filename: org-taskjuggler.el
-;; Version: 7.4
-;; Author: Christian Egli
-;; Maintainer: Christian Egli
-;; Keywords: org, taskjuggler, project planning
-;; Description: Converts an org-mode buffer into a taskjuggler project plan
-;; URL:
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;; Commentary:
-;;
-;; This library implements a TaskJuggler exporter for org-mode.
-;; TaskJuggler uses a text format to define projects, tasks and
-;; resources, so it is a natural fit for org-mode. It can produce all
-;; sorts of reports for tasks or resources in either HTML, CSV or PDF.
-;; The current version of TaskJuggler requires KDE but the next
-;; version is implemented in Ruby and should therefore run on any
-;; platform.
-;;
-;; The exporter is a bit different from other exporters, such as the
-;; HTML and LaTeX exporters for example, in that it does not export
-;; all the nodes of a document or strictly follow the order of the
-;; nodes in the document.
-;;
-;; Instead the TaskJuggler exporter looks for a tree that defines the
-;; tasks and a optionally tree that defines the resources for this
-;; project. It then creates a TaskJuggler file based on these trees
-;; and the attributes defined in all the nodes.
-;;
-;; * Installation
-;;
-;; Put this file into your load-path and the following line into your
-;; ~/.emacs:
-;;
-;; (require 'org-taskjuggler)
-;;
-;; The interactive functions are similar to those of the HTML and LaTeX
-;; exporters:
-;;
-;; M-x `org-export-as-taskjuggler'
-;; M-x `org-export-as-taskjuggler-and-open'
-;;
-;; * Tasks
-;;
-;; Let's illustrate the usage with a small example. Create your tasks
-;; as you usually do with org-mode. Assign efforts to each task using
-;; properties (it's easiest to do this in the column view). You should
-;; end up with something similar to the example by Peter Jones in
-;; http://www.contextualdevelopment.com/static/artifacts/articles/2008/project-planning/project-planning.org.
-;; Now mark the top node of your tasks with a tag named
-;; "taskjuggler_project" (or whatever you customized
-;; `org-export-taskjuggler-project-tag' to). You are now ready to
-;; export the project plan with `org-export-as-taskjuggler-and-open'
-;; which will export the project plan and open a gant chart in
-;; TaskJugglerUI.
-;;
-;; * Resources
-;;
-;; Next you can define resources and assign those to work on specific
-;; tasks. You can group your resources hierarchically. Tag the top
-;; node of the resources with "taskjuggler_resource" (or whatever you
-;; customized `org-export-taskjuggler-resource-tag' to). You can
-;; optionally assign an identifier (named "resource_id") to the
-;; resources (using the standard org properties commands) or you can
-;; let the exporter generate identifiers automatically (the exporter
-;; picks the first word of the headline as the identifier as long as
-;; it is unique, see the documentation of
-;; `org-taskjuggler-get-unique-id'). Using that identifier you can
-;; then allocate resources to tasks. This is again done with the
-;; "allocate" property on the tasks. Do this in column view or when on
-;; the task type
-;;
-;; C-c C-x p allocate RET <resource_id> RET
-;;
-;; Once the allocations are done you can again export to TaskJuggler
-;; and check in the Resource Allocation Graph which person is working
-;; on what task at what time.
-;;
-;; * Export of properties
-;;
-;; The exporter also takes TODO state information into consideration,
-;; i.e. if a task is marked as done it will have the corresponding
-;; attribute in TaskJuggler ("complete 100"). Also it will export any
-;; property on a task resource or resource node which is known to
-;; TaskJuggler, such as limits, vacation, shift, booking, efficiency,
-;; journalentry, rate for resources or account, start, note, duration,
-;; end, journalentry, milestone, reference, responsible, scheduling,
-;; etc for tasks.
-;;
-;; * Dependencies
-;;
-;; The exporter will handle dependencies that are defined in the tasks
-;; either with the ORDERED attribute (see TODO dependencies in the Org
-;; mode manual) or with the BLOCKER attribute (see org-depend.el) or
-;; alternatively with a depends attribute. Both the BLOCKER and the
-;; depends attribute can be either "previous-sibling" or a reference
-;; to an identifier (named "task_id") which is defined for another
-;; task in the project. BLOCKER and the depends attribute can define
-;; multiple dependencies separated by either space or comma. You can
-;; also specify optional attributes on the dependency by simply
-;; appending it. The following examples should illustrate this:
-;;
-;; * Training material
-;; :PROPERTIES:
-;; :task_id: training_material
-;; :ORDERED: t
-;; :END:
-;; ** Markup Guidelines
-;; :PROPERTIES:
-;; :Effort: 2.0
-;; :END:
-;; ** Workflow Guidelines
-;; :PROPERTIES:
-;; :Effort: 2.0
-;; :END:
-;; * Presentation
-;; :PROPERTIES:
-;; :Effort: 2.0
-;; :BLOCKER: training_material { gapduration 1d } some_other_task
-;; :END:
-;;
-;;;; * TODO
-;; - Use SCHEDULED and DEADLINE information (not just start and end
-;; properties).
-;; - Look at org-file-properties, org-global-properties and
-;; org-global-properties-fixed
-;; - What about property inheritance and org-property-inherit-p?
-;; - Use TYPE_TODO as an way to assign resources
-;; - Make sure multiple dependency definitions (i.e. BLOCKER on
-;; previous-sibling and on a specific task_id) in multiple
-;; attributes are properly exported.
-;;
-;;; Code:
-
-(eval-when-compile
- (require 'cl))
-
-(require 'org)
-(require 'org-exp)
-
-;;; User variables:
-
-(defgroup org-export-taskjuggler nil
- "Options for exporting Org-mode files to TaskJuggler."
- :tag "Org Export TaskJuggler"
- :group 'org-export)
-
-(defcustom org-export-taskjuggler-extension ".tjp"
- "Extension of TaskJuggler files."
- :group 'org-export-taskjuggler
- :type 'string)
-
-(defcustom org-export-taskjuggler-project-tag "taskjuggler_project"
- "Tag, property or todo used to find the tree containing all
-the tasks for the project."
- :group 'org-export-taskjuggler
- :type 'string)
-
-(defcustom org-export-taskjuggler-resource-tag "taskjuggler_resource"
- "Tag, property or todo used to find the tree containing all the
-resources for the project."
- :group 'org-export-taskjuggler
- :type 'string)
-
-(defcustom org-export-taskjuggler-default-project-version "1.0"
- "Default version string for the project."
- :group 'org-export-taskjuggler
- :type 'string)
-
-(defcustom org-export-taskjuggler-default-project-duration 280
- "Default project duration if no start and end date have been defined
-in the root node of the task tree, i.e. the tree that has been marked
-with `org-export-taskjuggler-project-tag'"
- :group 'org-export-taskjuggler
- :type 'integer)
-
-(defcustom org-export-taskjuggler-default-reports
- '("taskreport \"Gantt Chart\" {
- headline \"Project Gantt Chart\"
- columns hierarchindex, name, start, end, effort, duration, completed, chart
- timeformat \"%Y-%m-%d\"
- hideresource 1
- loadunit shortauto
-}"
-"resourcereport \"Resource Graph\" {
- headline \"Resource Allocation Graph\"
- columns no, name, utilization, freeload, chart
- loadunit shortauto
- sorttasks startup
- hidetask ~isleaf()
-}")
- "Default reports for the project."
- :group 'org-export-taskjuggler
- :type '(repeat (string :tag "Report")))
-
-(defcustom org-export-taskjuggler-default-global-properties
- "shift s40 \"Part time shift\" {
- workinghours wed, thu, fri off
-}
-"
- "Default global properties for the project. Here you typically
-define global properties such as shifts, accounts, rates,
-vacation, macros and flags. Any property that is allowed within
-the TaskJuggler file can be inserted. You could for example
-include another TaskJuggler file.
-
-The global properties are inserted after the project declaration
-but before any resource and task declarations."
- :group 'org-export-taskjuggler
- :type '(string :tag "Preamble"))
-
-;;; Hooks
-
-(defvar org-export-taskjuggler-final-hook nil
- "Hook run at the end of TaskJuggler export, in the new buffer.")
-
-;;; Autoload functions:
-
-;; avoid compiler warning about free variable
-(defvar org-export-taskjuggler-old-level)
-
-;;;###autoload
-(defun org-export-as-taskjuggler ()
- "Export parts of the current buffer as a TaskJuggler file.
-The exporter looks for a tree with tag, property or todo that
-matches `org-export-taskjuggler-project-tag' and takes this as
-the tasks for this project. The first node of this tree defines
-the project properties such as project name and project period.
-If there is a tree with tag, property or todo that matches
-`org-export-taskjuggler-resource-tag' this three is taken as
-resources for the project. If no resources are specified, a
-default resource is created and allocated to the project. Also
-the taskjuggler project will be created with default reports as
-defined in `org-export-taskjuggler-default-reports'."
- (interactive)
-
- (message "Exporting...")
- (setq-default org-done-keywords org-done-keywords)
- (let* ((tasks
- (org-taskjuggler-resolve-dependencies
- (org-taskjuggler-assign-task-ids
- (org-map-entries
- '(org-taskjuggler-components)
- org-export-taskjuggler-project-tag nil 'archive 'comment))))
- (resources
- (org-taskjuggler-assign-resource-ids
- (org-map-entries
- '(org-taskjuggler-components)
- org-export-taskjuggler-resource-tag nil 'archive 'comment)))
- (filename (expand-file-name
- (concat
- (file-name-sans-extension
- (file-name-nondirectory buffer-file-name))
- org-export-taskjuggler-extension)))
- (buffer (find-file-noselect filename))
- (org-export-taskjuggler-old-level 0)
- task resource)
- (unless tasks
- (error "No tasks specified"))
- ;; add a default resource
- (unless resources
- (setq resources
- `((("resource_id" . ,(user-login-name))
- ("headline" . ,user-full-name)
- ("level" . 1)))))
- ;; add a default allocation to the first task if none was given
- (unless (assoc "allocate" (car tasks))
- (let ((task (car tasks))
- (resource-id (cdr (assoc "resource_id" (car resources)))))
- (setcar tasks (push (cons "allocate" resource-id) task))))
- ;; add a default start date to the first task if none was given
- (unless (assoc "start" (car tasks))
- (let ((task (car tasks))
- (time-string (format-time-string "%Y-%m-%d")))
- (setcar tasks (push (cons "start" time-string) task))))
- ;; add a default version if none was given
- (unless (assoc "version" (car tasks))
- (let ((task (car tasks))
- (version org-export-taskjuggler-default-project-version))
- (setcar tasks (push (cons "version" version) task))))
- (with-current-buffer buffer
- (erase-buffer)
- (org-taskjuggler-open-project (car tasks))
- (insert org-export-taskjuggler-default-global-properties)
- (insert "\n")
- (dolist (resource resources)
- (let ((level (cdr (assoc "level" resource))))
- (org-taskjuggler-close-maybe level)
- (org-taskjuggler-open-resource resource)
- (setq org-export-taskjuggler-old-level level)))
- (org-taskjuggler-close-maybe 1)
- (setq org-export-taskjuggler-old-level 0)
- (dolist (task tasks)
- (let ((level (cdr (assoc "level" task))))
- (org-taskjuggler-close-maybe level)
- (org-taskjuggler-open-task task)
- (setq org-export-taskjuggler-old-level level)))
- (org-taskjuggler-close-maybe 1)
- (org-taskjuggler-insert-reports)
- (save-buffer)
- (or (org-export-push-to-kill-ring "TaskJuggler")
- (message "Exporting... done"))
- (current-buffer))))
-
-;;;###autoload
-(defun org-export-as-taskjuggler-and-open ()
- "Export the current buffer as a TaskJuggler file and open it
-with the TaskJuggler GUI."
- (interactive)
- (let* ((file-name (buffer-file-name (org-export-as-taskjuggler)))
- (process-name "TaskJugglerUI")
- (command (concat process-name " " file-name)))
- (start-process-shell-command process-name nil command)))
-
-(defun org-taskjuggler-parent-is-ordered-p ()
- "Return true if the parent of the current node has a property
-\"ORDERED\". Return nil otherwise."
- (save-excursion
- (and (org-up-heading-safe) (org-entry-get (point) "ORDERED"))))
-
-(defun org-taskjuggler-components ()
- "Return an alist containing all the pertinent information for
-the current node such as the headline, the level, todo state
-information, all the properties, etc."
- (let* ((props (org-entry-properties))
- (components (org-heading-components))
- (level (nth 1 components))
- (headline (nth 4 components))
- (parent-ordered (org-taskjuggler-parent-is-ordered-p)))
- (push (cons "level" level) props)
- (push (cons "headline" headline) props)
- (push (cons "parent-ordered" parent-ordered) props)))
-
-(defun org-taskjuggler-assign-task-ids (tasks)
- "Given a list of tasks return the same list assigning a unique id
-and the full path to each task. Taskjuggler takes hierarchical ids.
-For that reason we have to make ids locally unique and we have to keep
-a path to the current task."
- (let ((previous-level 0)
- unique-ids unique-id
- path
- task resolved-tasks tmp)
- (dolist (task tasks resolved-tasks)
- (let ((level (cdr (assoc "level" task))))
- (cond
- ((< previous-level level)
- (setq unique-id (org-taskjuggler-get-unique-id task (car unique-ids)))
- (dotimes (tmp (- level previous-level))
- (push (list unique-id) unique-ids)
- (push unique-id path)))
- ((= previous-level level)
- (setq unique-id (org-taskjuggler-get-unique-id task (car unique-ids)))
- (push unique-id (car unique-ids))
- (setcar path unique-id))
- ((> previous-level level)
- (dotimes (tmp (- previous-level level))
- (pop unique-ids)
- (pop path))
- (setq unique-id (org-taskjuggler-get-unique-id task (car unique-ids)))
- (push unique-id (car unique-ids))
- (setcar path unique-id)))
- (push (cons "unique-id" unique-id) task)
- (push (cons "path" (mapconcat 'identity (reverse path) ".")) task)
- (setq previous-level level)
- (setq resolved-tasks (append resolved-tasks (list task)))))))
-
-(defun org-taskjuggler-assign-resource-ids (resources &optional unique-ids)
- "Given a list of resources return the same list, assigning a
-unique id to each resource."
- (cond
- ((null resources) nil)
- (t
- (let* ((resource (car resources))
- (unique-id (org-taskjuggler-get-unique-id resource unique-ids)))
- (push (cons "unique-id" unique-id) resource)
- (cons resource
- (org-taskjuggler-assign-resource-ids (cdr resources)
- (cons unique-id unique-ids)))))))
-
-(defun org-taskjuggler-resolve-dependencies (tasks)
- (let ((previous-level 0)
- siblings
- task resolved-tasks)
- (dolist (task tasks resolved-tasks)
- (let* ((level (cdr (assoc "level" task)))
- (depends (cdr (assoc "depends" task)))
- (parent-ordered (cdr (assoc "parent-ordered" task)))
- (blocker (cdr (assoc "BLOCKER" task)))
- (blocked-on-previous
- (and blocker (string-match "previous-sibling" blocker)))
- (dependencies
- (org-taskjuggler-resolve-explicit-dependencies
- (append
- (and depends (org-taskjuggler-tokenize-dependencies depends))
- (and blocker (org-taskjuggler-tokenize-dependencies blocker)))
- tasks))
- previous-sibling)
- ; update previous sibling info
- (cond
- ((< previous-level level)
- (dotimes (tmp (- level previous-level))
- (push task siblings)))
- ((= previous-level level)
- (setq previous-sibling (car siblings))
- (setcar siblings task))
- ((> previous-level level)
- (dotimes (tmp (- previous-level level))
- (pop siblings))
- (setq previous-sibling (car siblings))
- (setcar siblings task)))
- ; insert a dependency on previous sibling if the parent is
- ; ordered or if the tasks has a BLOCKER attribute with value "previous-sibling"
- (when (or (and previous-sibling parent-ordered) blocked-on-previous)
- (push (format "!%s" (cdr (assoc "unique-id" previous-sibling))) dependencies))
- ; store dependency information
- (when dependencies
- (push (cons "depends" (mapconcat 'identity dependencies ", ")) task))
- (setq previous-level level)
- (setq resolved-tasks (append resolved-tasks (list task)))))))
-
-(defun org-taskjuggler-tokenize-dependencies (dependencies)
- "Split a dependency property value DEPENDENCIES into the
-individual dependencies and return them as a list while keeping
-the optional arguments (such as gapduration) for the
-dependencies. A dependency will have to match `[-a-zA-Z0-9_]+'."
- (cond
- ((string-match "^ *$" dependencies) nil)
- ((string-match "^[ \t]*\\([-a-zA-Z0-9_]+\\([ \t]*{[^}]+}\\)?\\)[ \t,]*" dependencies)
- (cons
- (substring dependencies (match-beginning 1) (match-end 1))
- (org-taskjuggler-tokenize-dependencies (substring dependencies (match-end 0)))))
- (t (error (format "invalid dependency id %s" dependencies)))))
-
-(defun org-taskjuggler-resolve-explicit-dependencies (dependencies tasks)
- "For each dependency in DEPENDENCIES try to find a
-corresponding task with a matching property \"task_id\" in TASKS.
-Return a list containing the resolved links for all DEPENDENCIES
-where a matching tasks was found. If the dependency is
-\"previous-sibling\" it is ignored (as this is dealt with in
-`org-taskjuggler-resolve-dependencies'). If there is no matching
-task the dependency is ignored and a warning is displayed ."
- (unless (null dependencies)
- (let*
- ;; the dependency might have optional attributes such as "{
- ;; gapduration 5d }", so only use the first string as id for the
- ;; dependency
- ((dependency (car dependencies))
- (id (car (split-string dependency)))
- (optional-attributes
- (mapconcat 'identity (cdr (split-string dependency)) " "))
- (path (org-taskjuggler-find-task-with-id id tasks)))
- (cond
- ;; ignore previous sibling dependencies
- ((equal (car dependencies) "previous-sibling")
- (org-taskjuggler-resolve-explicit-dependencies (cdr dependencies) tasks))
- ;; if the id is found in another task use its path
- ((not (null path))
- (cons (mapconcat 'identity (list path optional-attributes) " ")
- (org-taskjuggler-resolve-explicit-dependencies
- (cdr dependencies) tasks)))
- ;; warn about dangling dependency but otherwise ignore it
- (t (display-warning
- 'org-export-taskjuggler
- (format "No task with matching property \"task_id\" found for id %s" id))
- (org-taskjuggler-resolve-explicit-dependencies (cdr dependencies) tasks))))))
-
-(defun org-taskjuggler-find-task-with-id (id tasks)
- "Find ID in tasks. If found return the path of task. Otherwise
-return nil."
- (let ((task-id (cdr (assoc "task_id" (car tasks))))
- (path (cdr (assoc "path" (car tasks)))))
- (cond
- ((null tasks) nil)
- ((equal task-id id) path)
- (t (org-taskjuggler-find-task-with-id id (cdr tasks))))))
-
-(defun org-taskjuggler-get-unique-id (item unique-ids)
- "Return a unique id for an ITEM which can be a task or a resource.
-The id is derived from the headline and made unique against
-UNIQUE-IDS. If the (downcased) first token of the headline is not
-unique try to add more (downcased) tokens of the headline or
-finally add more underscore characters (\"_\")."
- (let* ((headline (cdr (assoc "headline" item)))
- (parts (split-string headline))
- (id (org-taskjuggler-clean-id (downcase (pop parts)))))
- ; try to add more parts of the headline to make it unique
- (while (and (member id unique-ids) (car parts))
- (setq id (concat id "_" (org-taskjuggler-clean-id (downcase (pop parts))))))
- ; if its still not unique add "_"
- (while (member id unique-ids)
- (setq id (concat id "_")))
- id))
-
-(defun org-taskjuggler-clean-id (id)
- "Clean and return ID to make it acceptable for taskjuggler."
- (and id (replace-regexp-in-string "[^a-zA-Z0-9_]" "_" id)))
-
-(defun org-taskjuggler-open-project (project)
- "Insert the beginning of a project declaration. All valid
-attributes from the PROJECT alist are inserted. If no end date is
-specified it is calculated
-`org-export-taskjuggler-default-project-duration' days from now."
- (let* ((unique-id (cdr (assoc "unique-id" project)))
- (headline (cdr (assoc "headline" project)))
- (version (cdr (assoc "version" project)))
- (start (cdr (assoc "start" project)))
- (end (cdr (assoc "end" project))))
- (insert
- (format "project %s \"%s\" \"%s\" %s +%sd {\n }\n"
- unique-id headline version start
- org-export-taskjuggler-default-project-duration))))
-
-(defun org-taskjuggler-filter-and-join (items)
- "Filter all nil elements from ITEMS and join the remaining ones
-with separator \"\n\"."
- (let ((filtered-items (remq nil items)))
- (and filtered-items (mapconcat 'identity filtered-items "\n"))))
-
-(defun org-taskjuggler-get-attributes (item attributes)
- "Return all attribute as a single formated string. ITEM is an
-alist representing either a resource or a task. ATTRIBUTES is a
-list of symbols. Only entries from ITEM are considered that are
-listed in ATTRIBUTES."
- (org-taskjuggler-filter-and-join
- (mapcar
- (lambda (attribute)
- (org-taskjuggler-filter-and-join
- (org-taskjuggler-get-attribute item attribute)))
- attributes)))
-
-(defun org-taskjuggler-get-attribute (item attribute)
- "Return a list of strings containing the properly formatted
-taskjuggler declaration for a given ATTRIBUTE in ITEM (an alist).
-If the ATTRIBUTE is not in ITEM return nil."
- (cond
- ((null item) nil)
- ((equal (symbol-name attribute) (car (car item)))
- (cons (format "%s %s" (symbol-name attribute) (cdr (car item)))
- (org-taskjuggler-get-attribute (cdr item) attribute)))
- (t (org-taskjuggler-get-attribute (cdr item) attribute))))
-
-(defun org-taskjuggler-open-resource (resource)
- "Insert the beginning of a resource declaration. All valid
-attributes from the RESOURCE alist are inserted. If the RESOURCE
-defines a property \"resource_id\" it will be used as the id for
-this resource. Otherwise it will use the ID property. If neither
-is defined it will calculate a unique id for the resource using
-`org-taskjuggler-get-unique-id'."
- (let ((id (org-taskjuggler-clean-id
- (or (cdr (assoc "resource_id" resource))
- (cdr (assoc "ID" resource))
- (cdr (assoc "unique-id" resource)))))
- (headline (cdr (assoc "headline" resource)))
- (attributes '(limits vacation shift booking efficiency journalentry rate)))
- (insert
- (concat
- "resource " id " \"" headline "\" {\n "
- (org-taskjuggler-get-attributes resource attributes) "\n"))))
-
-(defun org-taskjuggler-clean-effort (effort)
- "Translate effort strings into a format acceptable to taskjuggler,
-i.e. REAL UNIT. If the effort string is something like 5:30 it
-will be assumed to be hours and will be translated into 5.5h.
-Otherwise if it contains something like 3.0 it is assumed to be
-days and will be translated into 3.0d. Other formats that
-taskjuggler supports (like weeks, months and years) are currently
-not supported."
- (cond
- ((null effort) effort)
- ((string-match "\\([0-9]+\\):\\([0-9]+\\)" effort)
- (let ((hours (string-to-number (match-string 1 effort)))
- (minutes (string-to-number (match-string 2 effort))))
- (format "%dh" (+ hours (/ minutes 60.0)))))
- ((string-match "\\([0-9]+\\).\\([0-9]+\\)" effort) (concat effort "d"))
- (t (error "Not a valid effort (%s)" effort))))
-
-(defun org-taskjuggler-get-priority (priority)
- "Return a priority between 1 and 1000 based on PRIORITY, an
-org-mode priority string."
- (max 1 (/ (* 1000 (- org-lowest-priority (string-to-char priority)))
- (- org-lowest-priority org-highest-priority))))
-
-(defun org-taskjuggler-open-task (task)
- (let* ((unique-id (cdr (assoc "unique-id" task)))
- (headline (cdr (assoc "headline" task)))
- (effort (org-taskjuggler-clean-effort (cdr (assoc org-effort-property task))))
- (depends (cdr (assoc "depends" task)))
- (allocate (cdr (assoc "allocate" task)))
- (priority-raw (cdr (assoc "PRIORITY" task)))
- (priority (and priority-raw (org-taskjuggler-get-priority priority-raw)))
- (state (cdr (assoc "TODO" task)))
- (complete (or (and (member state org-done-keywords) "100")
- (cdr (assoc "complete" task))))
- (parent-ordered (cdr (assoc "parent-ordered" task)))
- (previous-sibling (cdr (assoc "previous-sibling" task)))
- (attributes
- '(account start note duration endbuffer endcredit end
- flags journalentry length maxend maxstart milestone
- minend minstart period reference responsible
- scheduling startbuffer startcredit statusnote)))
- (insert
- (concat
- "task " unique-id " \"" headline "\" {\n"
- (if (and parent-ordered previous-sibling)
- (format " depends %s\n" previous-sibling)
- (and depends (format " depends %s\n" depends)))
- (and allocate (format " purge allocations\n allocate %s\n" allocate))
- (and complete (format " complete %s\n" complete))
- (and effort (format " effort %s\n" effort))
- (and priority (format " priority %s\n" priority))
-
- (org-taskjuggler-get-attributes task attributes)
- "\n"))))
-
-(defun org-taskjuggler-close-maybe (level)
- (while (> org-export-taskjuggler-old-level level)
- (insert "}\n")
- (setq org-export-taskjuggler-old-level (1- org-export-taskjuggler-old-level)))
- (when (= org-export-taskjuggler-old-level level)
- (insert "}\n")))
-
-(defun org-taskjuggler-insert-reports ()
- (let (report)
- (dolist (report org-export-taskjuggler-default-reports)
- (insert report "\n"))))
-
-(provide 'org-taskjuggler)
-
-;;; org-taskjuggler.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-taskjuggler.elc b/.emacs.d/org-7.4/lisp/org-taskjuggler.elc
deleted file mode 100644
index 14368db..0000000
--- a/.emacs.d/org-7.4/lisp/org-taskjuggler.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-timer.el b/.emacs.d/org-7.4/lisp/org-timer.el
deleted file mode 100644
index bac1187..0000000
--- a/.emacs.d/org-7.4/lisp/org-timer.el
+++ /dev/null
@@ -1,399 +0,0 @@
-;;; org-timer.el --- The relative timer code for Org-mode
-
-;; Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file contains the relative timer code for Org-mode
-
-;;; Code:
-
-(require 'org)
-
-(declare-function org-notify "org-clock" (notification &optional play-sound))
-(declare-function org-agenda-error "org-agenda" ())
-
-(defvar org-timer-start-time nil
- "t=0 for the running timer.")
-
-(defvar org-timer-pause-time nil
- "Time when the timer was paused.")
-
-(defconst org-timer-re "\\([-+]?[0-9]+\\):\\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)"
- "Regular expression used to match timer stamps.")
-
-(defcustom org-timer-format "%s "
- "The format to insert the time of the timer.
-This format must contain one instance of \"%s\" which will be replaced by
-the value of the relative timer."
- :group 'org-time
- :type 'string)
-
-(defcustom org-timer-default-timer 0
- "The default timer when a timer is set.
-When 0, the user is prompted for a value."
- :group 'org-time
- :type 'number)
-
-(defvar org-timer-start-hook nil
- "Hook run after relative timer is started.")
-
-(defvar org-timer-stop-hook nil
- "Hook run before relative timer is stopped.")
-
-(defvar org-timer-pause-hook nil
- "Hook run before relative timer is paused.")
-
-(defvar org-timer-set-hook nil
- "Hook run after countdown timer is set.")
-
-(defvar org-timer-done-hook nil
- "Hook run after countdown timer reaches zero.")
-
-(defvar org-timer-cancel-hook nil
- "Hook run before countdown timer is canceled.")
-
-;;;###autoload
-(defun org-timer-start (&optional offset)
- "Set the starting time for the relative timer to now.
-When called with prefix argument OFFSET, prompt the user for an offset time,
-with the default taken from a timer stamp at point, if any.
-If OFFSET is a string or an integer, it is directly taken to be the offset
-without user interaction.
-When called with a double prefix arg, all timer strings in the active
-region will be shifted by a specific amount. You will be prompted for
-the amount, with the default to make the first timer string in
-the region 0:00:00."
- (interactive "P")
- (if (equal offset '(16))
- (call-interactively 'org-timer-change-times-in-region)
- (let (delta def s)
- (if (not offset)
- (setq org-timer-start-time (current-time))
- (cond
- ((integerp offset) (setq delta offset))
- ((stringp offset) (setq delta (org-timer-hms-to-secs offset)))
- (t
- (setq def (if (org-in-regexp org-timer-re)
- (match-string 0)
- "0:00:00")
- s (read-string
- (format "Restart timer with offset [%s]: " def)))
- (unless (string-match "\\S-" s) (setq s def))
- (setq delta (org-timer-hms-to-secs (org-timer-fix-incomplete s)))))
- (setq org-timer-start-time
- (seconds-to-time
- (- (org-float-time) delta))))
- (org-timer-set-mode-line 'on)
- (message "Timer start time set to %s, current value is %s"
- (format-time-string "%T" org-timer-start-time)
- (org-timer-secs-to-hms (or delta 0)))
- (run-hooks 'org-timer-start-hook))))
-
-(defun org-timer-pause-or-continue (&optional stop)
- "Pause or continue the relative timer.
-With prefix arg STOP, stop it entirely."
- (interactive "P")
- (cond
- (stop (org-timer-stop))
- ((not org-timer-start-time) (error "No timer is running"))
- (org-timer-pause-time
- ;; timer is paused, continue
- (setq org-timer-start-time
- (seconds-to-time
- (-
- (org-float-time)
- (- (org-float-time org-timer-pause-time)
- (org-float-time org-timer-start-time))))
- org-timer-pause-time nil)
- (org-timer-set-mode-line 'on)
- (message "Timer continues at %s" (org-timer-value-string)))
- (t
- ;; pause timer
- (run-hooks 'org-timer-pause-hook)
- (setq org-timer-pause-time (current-time))
- (org-timer-set-mode-line 'pause)
- (message "Timer paused at %s" (org-timer-value-string)))))
-
-(defun org-timer-stop ()
- "Stop the relative timer."
- (interactive)
- (run-hooks 'org-timer-stop-hook)
- (setq org-timer-start-time nil
- org-timer-pause-time nil)
- (org-timer-set-mode-line 'off))
-
-;;;###autoload
-(defun org-timer (&optional restart no-insert-p)
- "Insert a H:MM:SS string from the timer into the buffer.
-The first time this command is used, the timer is started. When used with
-a \\[universal-argument] prefix, force restarting the timer.
-When used with a double prefix argument \\[universal-argument], change all the timer string
-in the region by a fixed amount. This can be used to recalibrate a timer
-that was not started at the correct moment.
-
-If NO-INSERT-P is non-nil, return the string instead of inserting
-it in the buffer."
- (interactive "P")
- (when (or (equal restart '(4)) (not org-timer-start-time))
- (org-timer-start))
- (if no-insert-p
- (org-timer-value-string)
- (insert (org-timer-value-string))))
-
-(defun org-timer-value-string ()
- (format org-timer-format (org-timer-secs-to-hms (floor (org-timer-seconds)))))
-
-(defvar org-timer-timer-is-countdown nil)
-(defun org-timer-seconds ()
- (if org-timer-timer-is-countdown
- (- (org-float-time org-timer-start-time)
- (org-float-time (current-time)))
- (- (org-float-time (or org-timer-pause-time (current-time)))
- (org-float-time org-timer-start-time))))
-
-;;;###autoload
-(defun org-timer-change-times-in-region (beg end delta)
- "Change all h:mm:ss time in region by a DELTA."
- (interactive
- "r\nsEnter time difference like \"-1:08:26\". Default is first time to zero: ")
- (let ((re "[-+]?[0-9]+:[0-9]\\{2\\}:[0-9]\\{2\\}") p)
- (unless (string-match "\\S-" delta)
- (save-excursion
- (goto-char beg)
- (when (re-search-forward re end t)
- (setq delta (match-string 0))
- (if (equal (string-to-char delta) ?-)
- (setq delta (substring delta 1))
- (setq delta (concat "-" delta))))))
- (setq delta (org-timer-hms-to-secs (org-timer-fix-incomplete delta)))
- (when (= delta 0) (error "No change"))
- (save-excursion
- (goto-char end)
- (while (re-search-backward re beg t)
- (setq p (point))
- (replace-match
- (save-match-data
- (org-timer-secs-to-hms (+ (org-timer-hms-to-secs (match-string 0)) delta)))
- t t)
- (goto-char p)))))
-
-;;;###autoload
-(defun org-timer-item (&optional arg)
- "Insert a description-type item with the current timer value."
- (interactive "P")
- (cond
- ;; In a timer list, insert with `org-list-insert-item-generic'.
- ((and (org-in-item-p)
- (save-excursion (org-beginning-of-item) (org-at-item-timer-p)))
- (org-list-insert-item-generic
- (point) nil (concat (org-timer (when arg '(4)) t) ":: ")))
- ;; In a list of another type, don't break anything: throw an error.
- ((org-in-item-p)
- (error "This is not a timer list"))
- ;; Else, insert the timer correctly indented at bol.
- (t
- (beginning-of-line)
- (org-indent-line-function)
- (insert "- ")
- (org-timer (when arg '(4)))
- (insert ":: "))))
-
-(defun org-timer-fix-incomplete (hms)
- "If hms is a H:MM:SS string with missing hour or hour and minute, fix it."
- (if (string-match "\\(?:\\([0-9]+:\\)?\\([0-9]+:\\)\\)?\\([0-9]+\\)" hms)
- (replace-match
- (format "%d:%02d:%02d"
- (if (match-end 1) (string-to-number (match-string 1 hms)) 0)
- (if (match-end 2) (string-to-number (match-string 2 hms)) 0)
- (string-to-number (match-string 3 hms)))
- t t hms)
- (error "Cannot parse HMS string \"%s\"" hms)))
-
-(defun org-timer-hms-to-secs (hms)
- "Convert h:mm:ss string to an integer time.
-If the string starts with a minus sign, the integer will be negative."
- (if (not (string-match
- "\\([-+]?[0-9]+\\):\\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)"
- hms))
- 0
- (let* ((h (string-to-number (match-string 1 hms)))
- (m (string-to-number (match-string 2 hms)))
- (s (string-to-number (match-string 3 hms)))
- (sign (equal (substring (match-string 1 hms) 0 1) "-")))
- (setq h (abs h))
- (* (if sign -1 1) (+ s (* 60 (+ m (* 60 h))))))))
-
-(defun org-timer-secs-to-hms (s)
- "Convert integer S into h:mm:ss.
-If the integer is negative, the string will start with \"-\"."
- (let (sign m h)
- (setq sign (if (< s 0) "-" "")
- s (abs s)
- m (/ s 60) s (- s (* 60 m))
- h (/ m 60) m (- m (* 60 h)))
- (format "%s%d:%02d:%02d" sign h m s)))
-
-(defvar org-timer-mode-line-timer nil)
-(defvar org-timer-mode-line-string nil)
-
-(defun org-timer-set-mode-line (value)
- "Set the mode-line display of the relative timer.
-VALUE can be `on', `off', or `pause'."
- (or global-mode-string (setq global-mode-string '("")))
- (or (memq 'org-timer-mode-line-string global-mode-string)
- (setq global-mode-string
- (append global-mode-string '(org-timer-mode-line-string))))
- (cond
- ((equal value 'off)
- (when org-timer-mode-line-timer
- (cancel-timer org-timer-mode-line-timer)
- (setq org-timer-mode-line-timer nil))
- (setq global-mode-string
- (delq 'org-timer-mode-line-string global-mode-string))
- (force-mode-line-update))
- ((equal value 'pause)
- (when org-timer-mode-line-timer
- (cancel-timer org-timer-mode-line-timer)
- (setq org-timer-mode-line-timer nil)))
- ((equal value 'on)
- (or global-mode-string (setq global-mode-string '("")))
- (or (memq 'org-timer-mode-line-string global-mode-string)
- (setq global-mode-string
- (append global-mode-string '(org-timer-mode-line-string))))
- (org-timer-update-mode-line)
- (when org-timer-mode-line-timer
- (cancel-timer org-timer-mode-line-timer))
- (setq org-timer-mode-line-timer
- (run-with-timer 1 1 'org-timer-update-mode-line)))))
-
-(defun org-timer-update-mode-line ()
- "Update the timer time in the mode line."
- (if org-timer-pause-time
- nil
- (setq org-timer-mode-line-string
- (concat " <" (substring (org-timer-value-string) 0 -1) ">"))
- (force-mode-line-update)))
-
-(defvar org-timer-current-timer nil)
-(defun org-timer-cancel-timer ()
- "Cancel the current timer."
- (interactive)
- (when (eval org-timer-current-timer)
- (run-hooks 'org-timer-cancel-hook)
- (cancel-timer org-timer-current-timer)
- (setq org-timer-current-timer nil)
- (setq org-timer-timer-is-countdown nil)
- (org-timer-set-mode-line 'off))
- (message "Last timer canceled"))
-
-(defun org-timer-show-remaining-time ()
- "Display the remaining time before the timer ends."
- (interactive)
- (require 'time)
- (if (not org-timer-current-timer)
- (message "No timer set")
- (let* ((rtime (decode-time
- (time-subtract (timer--time org-timer-current-timer)
- (current-time))))
- (rsecs (nth 0 rtime))
- (rmins (nth 1 rtime)))
- (message "%d minute(s) %d seconds left before next time out"
- rmins rsecs))))
-
-;;;###autoload
-(defun org-timer-set-timer (&optional opt)
- "Prompt for a duration and set a timer.
-
-If `org-timer-default-timer' is not zero, suggest this value as
-the default duration for the timer. If a timer is already set,
-prompt the user if she wants to replace it.
-
-Called with a numeric prefix argument, use this numeric value as
-the duration of the timer.
-
-Called with a `C-u' prefix arguments, use `org-timer-default-timer'
-without prompting the user for a duration.
-
-With two `C-u' prefix arguments, use `org-timer-default-timer'
-without prompting the user for a duration and automatically
-replace any running timer."
- (interactive "P")
- (let ((minutes (or (and (numberp opt) (number-to-string opt))
- (and (listp opt) (not (null opt))
- (number-to-string org-timer-default-timer))
- (read-from-minibuffer
- "How many minutes left? "
- (if (not (eq org-timer-default-timer 0))
- (number-to-string org-timer-default-timer))))))
- (if (not (string-match "[0-9]+" minutes))
- (org-timer-show-remaining-time)
- (let* ((mins (string-to-number (match-string 0 minutes)))
- (secs (* mins 60))
- (hl (cond
- ((string-match "Org Agenda" (buffer-name))
- (let* ((marker (or (get-text-property (point) 'org-marker)
- (org-agenda-error)))
- (hdmarker (or (get-text-property (point) 'org-hd-marker)
- marker))
- (pos (marker-position marker)))
- (with-current-buffer (marker-buffer marker)
- (widen)
- (goto-char pos)
- (org-show-entry)
- (or (ignore-errors (org-get-heading))
- (concat "File:" (file-name-nondirectory (buffer-file-name)))))))
- ((eq major-mode 'org-mode)
- (or (ignore-errors (org-get-heading))
- (concat "File:" (file-name-nondirectory (buffer-file-name)))))
- (t (error "Not in an Org buffer"))))
- timer-set)
- (if (or (and org-timer-current-timer
- (or (equal opt '(16))
- (y-or-n-p "Replace current timer? ")))
- (not org-timer-current-timer))
- (progn
- (require 'org-clock)
- (when org-timer-current-timer
- (cancel-timer org-timer-current-timer))
- (setq org-timer-current-timer
- (run-with-timer
- secs nil `(lambda ()
- (setq org-timer-current-timer nil)
- (org-notify ,(format "%s: time out" hl) t)
- (setq org-timer-timer-is-countdown nil)
- (org-timer-set-mode-line 'off)
- (run-hooks 'org-timer-done-hook))))
- (run-hooks 'org-timer-set-hook)
- (setq org-timer-timer-is-countdown t
- org-timer-start-time
- (time-add (current-time) (seconds-to-time (* mins 60))))
- (org-timer-set-mode-line 'on))
- (message "No timer set"))))))
-
-(provide 'org-timer)
-
-;; arch-tag: 97538f8c-3871-4509-8f23-1e7b3ff3d107
-
-;;; org-timer.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-timer.elc b/.emacs.d/org-7.4/lisp/org-timer.elc
deleted file mode 100644
index ec19659..0000000
--- a/.emacs.d/org-7.4/lisp/org-timer.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-vm.el b/.emacs.d/org-7.4/lisp/org-vm.el
deleted file mode 100644
index daef671..0000000
--- a/.emacs.d/org-7.4/lisp/org-vm.el
+++ /dev/null
@@ -1,143 +0,0 @@
-;;; org-vm.el --- Support for links to VM messages from within Org-mode
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-;; This file implements links to VM messages and folders from within Org-mode.
-;; Org-mode loads this module by default - if this is not what you want,
-;; configure the variable `org-modules'.
-
-;;; Code:
-
-(require 'org)
-
-;; Declare external functions and variables
-(declare-function vm-preview-current-message "ext:vm-page" ())
-(declare-function vm-follow-summary-cursor "ext:vm-motion" ())
-(declare-function vm-get-header-contents "ext:vm-summary"
- (message header-name-regexp &optional clump-sep))
-(declare-function vm-isearch-narrow "ext:vm-search" ())
-(declare-function vm-isearch-update "ext:vm-search" ())
-(declare-function vm-select-folder-buffer "ext:vm-macro" ())
-(declare-function vm-su-message-id "ext:vm-summary" (m))
-(declare-function vm-su-subject "ext:vm-summary" (m))
-(declare-function vm-summarize "ext:vm-summary" (&optional display raise))
-(defvar vm-message-pointer)
-(defvar vm-folder-directory)
-
-;; Install the link type
-(org-add-link-type "vm" 'org-vm-open)
-(add-hook 'org-store-link-functions 'org-vm-store-link)
-
-;; Implementation
-(defun org-vm-store-link ()
- "Store a link to a VM folder or message."
- (when (or (eq major-mode 'vm-summary-mode)
- (eq major-mode 'vm-presentation-mode))
- (and (eq major-mode 'vm-presentation-mode) (vm-summarize))
- (vm-follow-summary-cursor)
- (save-excursion
- (vm-select-folder-buffer)
- (let* ((message (car vm-message-pointer))
- (folder buffer-file-name)
- (subject (vm-su-subject message))
- (to (vm-get-header-contents message "To"))
- (from (vm-get-header-contents message "From"))
- (message-id (vm-su-message-id message))
- (date (vm-get-header-contents message "Date"))
- (date-ts (and date (format-time-string
- (org-time-stamp-format t)
- (date-to-time date))))
- (date-ts-ia (and date (format-time-string
- (org-time-stamp-format t t)
- (date-to-time date))))
- desc link)
- (org-store-link-props :type "vm" :from from :to to :subject subject
- :message-id message-id)
- (when date
- (org-add-link-props :date date :date-timestamp date-ts
- :date-timestamp-inactive date-ts-ia))
- (setq message-id (org-remove-angle-brackets message-id))
- (setq folder (abbreviate-file-name folder))
- (if (and vm-folder-directory
- (string-match (concat "^" (regexp-quote vm-folder-directory))
- folder))
- (setq folder (replace-match "" t t folder)))
- (setq desc (org-email-link-description))
- (setq link (org-make-link "vm:" folder "#" message-id))
- (org-add-link-props :link link :description desc)
- link))))
-
-(defun org-vm-open (path)
- "Follow a VM message link specified by PATH."
- (let (folder article)
- (if (not (string-match "\\`\\([^#]+\\)\\(#\\(.*\\)\\)?" path))
- (error "Error in VM link"))
- (setq folder (match-string 1 path)
- article (match-string 3 path))
- ;; The prefix argument will be interpreted as read-only
- (org-vm-follow-link folder article current-prefix-arg)))
-
-(defun org-vm-follow-link (&optional folder article readonly)
- "Follow a VM link to FOLDER and ARTICLE."
- (require 'vm)
- (setq article (org-add-angle-brackets article))
- (if (string-match "^//\\([a-zA-Z]+@\\)?\\([^:]+\\):\\(.*\\)" folder)
- ;; ange-ftp or efs or tramp access
- (let ((user (or (match-string 1 folder) (user-login-name)))
- (host (match-string 2 folder))
- (file (match-string 3 folder)))
- (cond
- ((featurep 'tramp)
- ;; use tramp to access the file
- (if (featurep 'xemacs)
- (setq folder (format "[%s@%s]%s" user host file))
- (setq folder (format "/%s@%s:%s" user host file))))
- (t
- ;; use ange-ftp or efs
- (require (if (featurep 'xemacs) 'efs 'ange-ftp))
- (setq folder (format "/%s@%s:%s" user host file))))))
- (when folder
- (funcall (cdr (assq 'vm org-link-frame-setup)) folder readonly)
- (sit-for 0.1)
- (when article
- (require 'vm-search)
- (vm-select-folder-buffer)
- (widen)
- (let ((case-fold-search t))
- (goto-char (point-min))
- (if (not (re-search-forward
- (concat "^" "message-id: *" (regexp-quote article))))
- (error "Could not find the specified message in this folder"))
- (vm-isearch-update)
- (vm-isearch-narrow)
- (vm-preview-current-message)
- (vm-summarize)))))
-
-(provide 'org-vm)
-
-;; arch-tag: cbc3047b-935e-4d2a-96e7-c5b0117aaa6d
-
-;;; org-vm.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-vm.elc b/.emacs.d/org-7.4/lisp/org-vm.elc
deleted file mode 100644
index a8080c1..0000000
--- a/.emacs.d/org-7.4/lisp/org-vm.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-w3m.el b/.emacs.d/org-7.4/lisp/org-w3m.el
deleted file mode 100644
index 6965ac6..0000000
--- a/.emacs.d/org-7.4/lisp/org-w3m.el
+++ /dev/null
@@ -1,173 +0,0 @@
-;;; org-w3m.el --- Support from copy and paste from w3m to Org-mode
-
-;; Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
-
-;; Author: Andy Stewart <lazycat dot manatee at gmail dot com>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file implements copying HTML content from a w3m buffer and
-;; transforming the text on the fly so that it can be pasted into
-;; an org-mode buffer with hot links. It will also work for regions
-;; in gnus buffers that have been washed with w3m.
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Acknowledgments:
-
-;; Richard Riley <rileyrgdev at googlemail dot com>
-;;
-;; The idea of transforming the HTML content with org-mode style is
-;; proposed by Richard, I'm just coding it.
-;;
-
-;;; Code:
-
-(require 'org)
-
-(defun org-w3m-copy-for-org-mode ()
- "Copy current buffer content or active region with `org-mode' style links.
-This will encode `link-title' and `link-location' with
-`org-make-link-string', and insert the transformed test into the kill ring,
-so that it can be yanked into an Org-mode buffer with links working correctly."
- (interactive)
- (let* ((regionp (org-region-active-p))
- (transform-start (point-min))
- (transform-end (point-max))
- return-content
- link-location link-title
- temp-position out-bound)
- (when regionp
- (setq transform-start (region-beginning))
- (setq transform-end (region-end))
- ;; Deactivate mark if current mark is activate.
- (if (fboundp 'deactivate-mark) (deactivate-mark)))
- (message "Transforming links...")
- (save-excursion
- (goto-char transform-start)
- (while (and (not out-bound) ; still inside region to copy
- (not (org-w3m-no-next-link-p))) ; no next link current buffer
- ;; store current point before jump next anchor
- (setq temp-position (point))
- ;; move to next anchor when current point is not at anchor
- (or (get-text-property (point) 'w3m-href-anchor) (org-w3m-get-next-link-start))
- (if (<= (point) transform-end) ; if point is inside transform bound
- (progn
- ;; get content between two links.
- (if (> (point) temp-position)
- (setq return-content (concat return-content
- (buffer-substring
- temp-position (point)))))
- ;; get link location at current point.
- (setq link-location (get-text-property (point) 'w3m-href-anchor))
- ;; get link title at current point.
- (setq link-title (buffer-substring (point)
- (org-w3m-get-anchor-end)))
- ;; concat `org-mode' style url to `return-content'.
- (setq return-content (concat return-content
- (org-make-link-string
- link-location link-title))))
- (goto-char temp-position) ; reset point before jump next anchor
- (setq out-bound t) ; for break out `while' loop
- ))
- ;; add the rest until end of the region to be copied
- (if (< (point) transform-end)
- (setq return-content
- (concat return-content
- (buffer-substring (point) transform-end))))
- (org-kill-new return-content)
- (message "Transforming links...done, use C-y to insert text into Org-mode file")
- (message "Copy with link transformation complete."))))
-
-(defun org-w3m-get-anchor-start ()
- "Move cursor to the start of current anchor. Return point."
- ;; get start position of anchor or current point
- (goto-char (or (previous-single-property-change (point) 'w3m-anchor-sequence)
- (point))))
-
-(defun org-w3m-get-anchor-end ()
- "Move cursor to the end of current anchor. Return point."
- ;; get end position of anchor or point
- (goto-char (or (next-single-property-change (point) 'w3m-anchor-sequence)
- (point))))
-
-(defun org-w3m-get-next-link-start ()
- "Move cursor to the start of next link. Return point."
- (catch 'reach
- (while (next-single-property-change (point) 'w3m-anchor-sequence)
- ;; jump to next anchor
- (goto-char (next-single-property-change (point) 'w3m-anchor-sequence))
- (when (get-text-property (point) 'w3m-href-anchor)
- ;; return point when current is valid link
- (throw 'reach nil))))
- (point))
-
-(defun org-w3m-get-prev-link-start ()
- "Move cursor to the start of previous link. Return point."
- (catch 'reach
- (while (previous-single-property-change (point) 'w3m-anchor-sequence)
- ;; jump to previous anchor
- (goto-char (previous-single-property-change (point) 'w3m-anchor-sequence))
- (when (get-text-property (point) 'w3m-href-anchor)
- ;; return point when current is valid link
- (throw 'reach nil))))
- (point))
-
-(defun org-w3m-no-next-link-p ()
- "Whether there is no next link after the cursor.
-Return t if there is no next link; otherwise, return nil."
- (save-excursion
- (equal (point) (org-w3m-get-next-link-start))))
-
-(defun org-w3m-no-prev-link-p ()
- "Whether there is no previous link after the cursor.
-Return t if there is no previous link; otherwise, return nil."
- (save-excursion
- (equal (point) (org-w3m-get-prev-link-start))))
-
-;; Install keys into the w3m keymap
-(defvar w3m-mode-map)
-(defvar w3m-minor-mode-map)
-(when (and (boundp 'w3m-mode-map)
- (keymapp w3m-mode-map))
- (define-key w3m-mode-map "\C-c\C-x\M-w" 'org-w3m-copy-for-org-mode)
- (define-key w3m-mode-map "\C-c\C-x\C-w" 'org-w3m-copy-for-org-mode))
-(when (and (boundp 'w3m-minor-mode-map)
- (keymapp w3m-minor-mode-map))
- (define-key w3m-minor-mode-map "\C-c\C-x\M-w" 'org-w3m-copy-for-org-mode)
- (define-key w3m-minor-mode-map "\C-c\C-x\C-w" 'org-w3m-copy-for-org-mode))
-(add-hook
- 'w3m-mode-hook
- (lambda ()
- (define-key w3m-mode-map "\C-c\C-x\M-w" 'org-w3m-copy-for-org-mode)
- (define-key w3m-mode-map "\C-c\C-x\C-w" 'org-w3m-copy-for-org-mode)))
-(add-hook
- 'w3m-minor-mode-hook
- (lambda ()
- (define-key w3m-minor-mode-map "\C-c\C-x\M-w" 'org-w3m-copy-for-org-mode)
- (define-key w3m-minor-mode-map "\C-c\C-x\C-w" 'org-w3m-copy-for-org-mode)))
-
-(provide 'org-w3m)
-
-;; arch-tag: 851d7447-488d-49f0-a14d-46c092e84352
-
-;;; org-w3m.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-w3m.elc b/.emacs.d/org-7.4/lisp/org-w3m.elc
deleted file mode 100644
index 885bb0f..0000000
--- a/.emacs.d/org-7.4/lisp/org-w3m.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-wl.el b/.emacs.d/org-7.4/lisp/org-wl.el
deleted file mode 100644
index 137bad9..0000000
--- a/.emacs.d/org-7.4/lisp/org-wl.el
+++ /dev/null
@@ -1,315 +0,0 @@
-;;; org-wl.el --- Support for links to Wanderlust messages from within Org-mode
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp>
-;; David Maus <dmaus at ictsoc dot de>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-
-;; This file implements links to Wanderlust messages from within Org-mode.
-;; Org-mode loads this module by default - if this is not what you want,
-;; configure the variable `org-modules'.
-
-;;; Code:
-
-(require 'org)
-
-(defgroup org-wl nil
- "Options concerning the Wanderlust link."
- :tag "Org Startup"
- :group 'org-link)
-
-(defcustom org-wl-link-to-refile-destination t
- "Create a link to the refile destination if the message is marked as refile."
- :group 'org-wl
- :type 'boolean)
-
-(defcustom org-wl-link-remove-filter nil
- "Remove filter condition if message is filter folder."
- :group 'org-wl
- :type 'boolean)
-
-(defcustom org-wl-shimbun-prefer-web-links nil
- "If non-nil create web links for shimbun messages."
- :group 'org-wl
- :type 'boolean)
-
-(defcustom org-wl-nntp-prefer-web-links nil
- "If non-nil create web links for nntp messages.
-When folder name contains string \"gmane\" link to gmane,
-googlegroups otherwise."
- :type 'boolean
- :group 'org-wl)
-
-(defcustom org-wl-disable-folder-check t
- "Disable check for new messages when open a link."
- :type 'boolean
- :group 'org-wl)
-
-(defcustom org-wl-namazu-default-index nil
- "Default namazu search index."
- :type 'directory
- :group 'org-wl)
-
-;; Declare external functions and variables
-(declare-function elmo-folder-exists-p "ext:elmo" (folder) t)
-(declare-function elmo-message-entity-field "ext:elmo-msgdb"
- (entity field &optional type))
-(declare-function elmo-message-field "ext:elmo"
- (folder number field &optional type) t)
-(declare-function elmo-msgdb-overview-get-entity "ext:elmo" (id msgdb) t)
-;; Backward compatibility to old version of wl
-(declare-function wl "ext:wl" () t)
-(declare-function wl-summary-buffer-msgdb "ext:wl-folder" () t)
-(declare-function wl-summary-jump-to-msg-by-message-id "ext:wl-summary"
- (&optional id))
-(declare-function wl-summary-jump-to-msg "ext:wl-summary"
- (&optional number beg end))
-(declare-function wl-summary-line-from "ext:wl-summary" ())
-(declare-function wl-summary-line-subject "ext:wl-summary" ())
-(declare-function wl-summary-message-number "ext:wl-summary" ())
-(declare-function wl-summary-redisplay "ext:wl-summary" (&optional arg))
-(declare-function wl-summary-registered-temp-mark "ext:wl-action" (number))
-(declare-function wl-folder-goto-folder-subr "ext:wl-folder"
- (&optional folder sticky))
-(declare-function wl-folder-get-petname "ext:wl-folder" (name))
-(declare-function wl-folder-get-entity-from-buffer "ext:wl-folder"
- (&optional getid))
-(declare-function wl-folder-buffer-group-p "ext:wl-folder")
-(defvar wl-init)
-(defvar wl-summary-buffer-elmo-folder)
-(defvar wl-summary-buffer-folder-name)
-(defvar wl-folder-group-regexp)
-(defvar wl-auto-check-folder-name)
-(defvar elmo-nntp-default-server)
-
-(defconst org-wl-folder-types
- '(("%" . imap) ("-" . nntp) ("+" . mh) ("=" . spool)
- ("$" . archive) ("&" . pop) ("@" . shimbun) ("[" . search)
- ("*" . multi) ("/" . filter) ("|" . pipe) ("'" . internal))
- "List of folder indicators. See Wanderlust manual, section 3.")
-
-;; Install the link type
-(org-add-link-type "wl" 'org-wl-open)
-(add-hook 'org-store-link-functions 'org-wl-store-link)
-
-;; Implementation
-
-(defun org-wl-folder-type (folder)
- "Return symbol that indicates the type of FOLDER.
-FOLDER is the wanderlust folder name. The first character of the
-folder name determines the the folder type."
- (let* ((indicator (substring folder 0 1))
- (type (cdr (assoc indicator org-wl-folder-types))))
- ;; maybe access or file folder
- (when (not type)
- (setq type
- (cond
- ((and (>= (length folder) 5)
- (string= (substring folder 0 5) "file:"))
- 'file)
- ((and (>= (length folder) 7)
- (string= (substring folder 0 7) "access:"))
- 'access)
- (t
- nil))))
- type))
-
-(defun org-wl-message-field (field entity)
- "Return content of FIELD in ENTITY.
-FIELD is a symbol of a rfc822 message header field.
-ENTITY is a message entity."
- (let ((content (elmo-message-entity-field entity field 'string)))
- (if (listp content) (car content) content)))
-
-(defun org-wl-store-link ()
- "Store a link to a WL message or folder."
- (unless (eobp)
- (cond
- ((memq major-mode '(wl-summary-mode mime-view-mode))
- (org-wl-store-link-message))
- ((eq major-mode 'wl-folder-mode)
- (org-wl-store-link-folder))
- (t
- nil))))
-
-(defun org-wl-store-link-folder ()
- "Store a link to a WL folder."
- (let* ((folder (wl-folder-get-entity-from-buffer))
- (petname (wl-folder-get-petname folder))
- (link (org-make-link "wl:" folder)))
- (save-excursion
- (beginning-of-line)
- (unless (and (wl-folder-buffer-group-p)
- (looking-at wl-folder-group-regexp))
- (org-store-link-props :type "wl" :description petname
- :link link)
- link))))
-
-(defun org-wl-store-link-message ()
- "Store a link to a WL message."
- (save-excursion
- (let ((buf (if (eq major-mode 'wl-summary-mode)
- (current-buffer)
- (and (boundp 'wl-message-buffer-cur-summary-buffer)
- wl-message-buffer-cur-summary-buffer))))
- (when buf
- (with-current-buffer buf
- (let* ((msgnum (wl-summary-message-number))
- (mark-info (wl-summary-registered-temp-mark msgnum))
- (folder-name
- (if (and org-wl-link-to-refile-destination
- mark-info
- (equal (nth 1 mark-info) "o")) ; marked as refile
- (nth 2 mark-info)
- wl-summary-buffer-folder-name))
- (folder-type (org-wl-folder-type folder-name))
- (wl-message-entity
- (if (fboundp 'elmo-message-entity)
- (elmo-message-entity
- wl-summary-buffer-elmo-folder msgnum)
- (elmo-msgdb-overview-get-entity
- msgnum (wl-summary-buffer-msgdb))))
- (message-id
- (org-wl-message-field 'message-id wl-message-entity))
- (message-id-no-brackets
- (org-remove-angle-brackets message-id))
- (from (org-wl-message-field 'from wl-message-entity))
- (to (org-wl-message-field 'to wl-message-entity))
- (xref (org-wl-message-field 'xref wl-message-entity))
- (subject (org-wl-message-field 'subject wl-message-entity))
- (date (org-wl-message-field 'date wl-message-entity))
- (date-ts (and date (format-time-string
- (org-time-stamp-format t)
- (date-to-time date))))
- (date-ts-ia (and date (format-time-string
- (org-time-stamp-format t t)
- (date-to-time date))))
- desc link)
-
- ;; remove text properties of subject string to avoid possible bug
- ;; when formatting the subject
- ;; (Emacs bug #5306, fixed)
- (set-text-properties 0 (length subject) nil subject)
-
- ;; maybe remove filter condition
- (when (and (eq folder-type 'filter) org-wl-link-remove-filter)
- (while (eq (org-wl-folder-type folder-name) 'filter)
- (setq folder-name
- (replace-regexp-in-string "^/[^/]+/" "" folder-name))))
-
- ;; maybe create http link
- (cond
- ((and (eq folder-type 'shimbun)
- org-wl-shimbun-prefer-web-links xref)
- (org-store-link-props :type "http" :link xref :description subject
- :from from :to to :message-id message-id
- :message-id-no-brackets message-id-no-brackets
- :subject subject))
- ((and (eq folder-type 'nntp) org-wl-nntp-prefer-web-links)
- (setq link
- (format
- (if (string-match "gmane\\." folder-name)
- "http://mid.gmane.org/%s"
- "http://groups.google.com/groups/search?as_umsgid=%s")
- (org-fixup-message-id-for-http message-id)))
- (org-store-link-props :type "http" :link link :description subject
- :from from :to to :message-id message-id
- :message-id-no-brackets message-id-no-brackets
- :subject subject))
- (t
- (org-store-link-props :type "wl" :from from :to to
- :subject subject :message-id message-id
- :message-id-no-brackets message-id-no-brackets)
- (setq desc (org-email-link-description))
- (setq link (org-make-link "wl:" folder-name "#" message-id-no-brackets))
- (org-add-link-props :link link :description desc)))
- (when date
- (org-add-link-props :date date :date-timestamp date-ts
- :date-timestamp-inactive date-ts-ia))
- (or link xref)))))))
-
-(defun org-wl-open-nntp (path)
- "Follow the nntp: link specified by PATH."
- (let* ((spec (split-string path "/"))
- (server (split-string (nth 2 spec) "@"))
- (group (nth 3 spec))
- (article (nth 4 spec)))
- (org-wl-open
- (concat "-" group ":" (if (cdr server)
- (car (split-string (car server) ":"))
- "")
- (if (string= elmo-nntp-default-server (nth 2 spec))
- ""
- (concat "@" (or (cdr server) (car server))))
- (if article (concat "#" article) "")))))
-
-(defun org-wl-open (path)
- "Follow the WL message link specified by PATH.
-When called with one prefix, open message in namazu search folder
-with `org-wl-namazu-default-index' as search index. When called
-with two prefixes or `org-wl-namazu-default-index' is nil, ask
-for namazu index."
- (require 'wl)
- (let ((wl-auto-check-folder-name
- (if org-wl-disable-folder-check
- 'none
- wl-auto-check-folder-name)))
- (unless wl-init (wl))
- ;; XXX: The imap-uw's MH folder names start with "%#".
- (if (not (string-match "\\`\\(\\(?:%#\\)?[^#]+\\)\\(#\\(.*\\)\\)?" path))
- (error "Error in Wanderlust link"))
- (let ((folder (match-string 1 path))
- (article (match-string 3 path)))
- ;; maybe open message in namazu search folder
- (when current-prefix-arg
- (setq folder (concat "[" article "]"
- (if (and (equal current-prefix-arg '(4))
- org-wl-namazu-default-index)
- org-wl-namazu-default-index
- (read-directory-name "Namazu index: ")))))
- (if (not (elmo-folder-exists-p (org-no-warnings
- (wl-folder-get-elmo-folder folder))))
- (error "No such folder: %s" folder))
- (let ((old-buf (current-buffer))
- (old-point (point-marker)))
- (wl-folder-goto-folder-subr folder)
- (with-current-buffer old-buf
- ;; XXX: `wl-folder-goto-folder-subr' moves point to the
- ;; beginning of the current line. So, restore the point
- ;; in the old buffer.
- (goto-char old-point))
- (when article
- (if (org-string-match-p "@" article)
- (wl-summary-jump-to-msg-by-message-id (org-add-angle-brackets
- article))
- (or (wl-summary-jump-to-msg (string-to-number article))
- (error "No such message: %s" article)))
- (wl-summary-redisplay))))))
-
-(provide 'org-wl)
-
-;; arch-tag: 29b75a0f-ef2e-430b-8abc-acff75bde54a
-
-;;; org-wl.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-wl.elc b/.emacs.d/org-7.4/lisp/org-wl.elc
deleted file mode 100644
index 9b25386..0000000
--- a/.emacs.d/org-7.4/lisp/org-wl.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org-xoxo.el b/.emacs.d/org-7.4/lisp/org-xoxo.el
deleted file mode 100644
index 2ce277e..0000000
--- a/.emacs.d/org-7.4/lisp/org-xoxo.el
+++ /dev/null
@@ -1,128 +0,0 @@
-;;; org-xoxo.el --- XOXO export for Org-mode
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-;; XOXO export
-
-;;; Code:
-
-(require 'org-exp)
-
-(defvar org-export-xoxo-final-hook nil
- "Hook run after XOXO export, in the new buffer.")
-
-(defun org-export-as-xoxo-insert-into (buffer &rest output)
- (with-current-buffer buffer
- (apply 'insert output)))
-(put 'org-export-as-xoxo-insert-into 'lisp-indent-function 1)
-
-;;;###autoload
-(defun org-export-as-xoxo (&optional buffer)
- "Export the org buffer as XOXO.
-The XOXO buffer is named *xoxo-<source buffer name>*"
- (interactive (list (current-buffer)))
- (run-hooks 'org-export-first-hook)
- ;; A quickie abstraction
-
- ;; Output everything as XOXO
- (with-current-buffer (get-buffer buffer)
- (let* ((pos (point))
- (opt-plist (org-combine-plists (org-default-export-plist)
- (org-infile-export-plist)))
- (filename (concat (file-name-as-directory
- (org-export-directory :xoxo opt-plist))
- (file-name-sans-extension
- (file-name-nondirectory buffer-file-name))
- ".html"))
- (out (find-file-noselect filename))
- (last-level 1)
- (hanging-li nil))
- (goto-char (point-min)) ;; CD: beginning-of-buffer is not allowed.
- ;; Check the output buffer is empty.
- (with-current-buffer out (erase-buffer))
- ;; Kick off the output
- (org-export-as-xoxo-insert-into out "<ol class='xoxo'>\n")
- (while (re-search-forward "^\\(\\*+\\)[ \t]+\\(.+\\)" (point-max) 't)
- (let* ((hd (match-string-no-properties 1))
- (level (length hd))
- (text (concat
- (match-string-no-properties 2)
- (save-excursion
- (goto-char (match-end 0))
- (let ((str ""))
- (catch 'loop
- (while 't
- (forward-line)
- (if (looking-at "^[ \t]\\(.*\\)")
- (setq str (concat str (match-string-no-properties 1)))
- (throw 'loop str)))))))))
-
- ;; Handle level rendering
- (cond
- ((> level last-level)
- (org-export-as-xoxo-insert-into out "\n<ol>\n"))
-
- ((< level last-level)
- (dotimes (- (- last-level level) 1)
- (if hanging-li
- (org-export-as-xoxo-insert-into out "</li>\n"))
- (org-export-as-xoxo-insert-into out "</ol>\n"))
- (when hanging-li
- (org-export-as-xoxo-insert-into out "</li>\n")
- (setq hanging-li nil)))
-
- ((equal level last-level)
- (if hanging-li
- (org-export-as-xoxo-insert-into out "</li>\n")))
- )
-
- (setq last-level level)
-
- ;; And output the new li
- (setq hanging-li 't)
- (if (equal ?+ (elt text 0))
- (org-export-as-xoxo-insert-into out "<li class='" (substring text 1) "'>")
- (org-export-as-xoxo-insert-into out "<li>" text))))
-
- ;; Finally finish off the ol
- (dotimes (- last-level 1)
- (if hanging-li
- (org-export-as-xoxo-insert-into out "</li>\n"))
- (org-export-as-xoxo-insert-into out "</ol>\n"))
-
- (goto-char pos)
- ;; Finish the buffer off and clean it up.
- (switch-to-buffer-other-window out)
- (indent-region (point-min) (point-max) nil)
- (run-hooks 'org-export-xoxo-final-hook)
- (save-buffer)
- (goto-char (point-min))
- )))
-
-(provide 'org-xoxo)
-
-;; arch-tag: 16e6a31f-f4f5-46f1-af18-48dc89faa702
-;;; org-xoxo.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org-xoxo.elc b/.emacs.d/org-7.4/lisp/org-xoxo.elc
deleted file mode 100644
index 91616a0..0000000
--- a/.emacs.d/org-7.4/lisp/org-xoxo.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/lisp/org.el b/.emacs.d/org-7.4/lisp/org.el
deleted file mode 100644
index eb91968..0000000
--- a/.emacs.d/org-7.4/lisp/org.el
+++ /dev/null
@@ -1,19647 +0,0 @@
-;;; org.el --- Outline-based notes management and organizer
-;; Carstens outline-mode for keeping track of everything.
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-;;
-;; Author: Carsten Dominik <carsten at orgmode dot org>
-;; Keywords: outlines, hypermedia, calendar, wp
-;; Homepage: http://orgmode.org
-;; Version: 7.4
-;;
-;; This file is part of GNU Emacs.
-;;
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;;; Commentary:
-;;
-;; Org-mode is a mode for keeping notes, maintaining ToDo lists, and doing
-;; project planning with a fast and effective plain-text system.
-;;
-;; Org-mode develops organizational tasks around NOTES files that contain
-;; information about projects as plain text. Org-mode is implemented on
-;; top of outline-mode, which makes it possible to keep the content of
-;; large files well structured. Visibility cycling and structure editing
-;; help to work with the tree. Tables are easily created with a built-in
-;; table editor. Org-mode supports ToDo items, deadlines, time stamps,
-;; and scheduling. It dynamically compiles entries into an agenda that
-;; utilizes and smoothly integrates much of the Emacs calendar and diary.
-;; Plain text URL-like links connect to websites, emails, Usenet
-;; messages, BBDB entries, and any files related to the projects. For
-;; printing and sharing of notes, an Org-mode file can be exported as a
-;; structured ASCII file, as HTML, or (todo and agenda items only) as an
-;; iCalendar file. It can also serve as a publishing tool for a set of
-;; linked webpages.
-;;
-;; Installation and Activation
-;; ---------------------------
-;; See the corresponding sections in the manual at
-;;
-;; http://orgmode.org/org.html#Installation
-;;
-;; Documentation
-;; -------------
-;; The documentation of Org-mode can be found in the TeXInfo file. The
-;; distribution also contains a PDF version of it. At the homepage of
-;; Org-mode, you can read the same text online as HTML. There is also an
-;; excellent reference card made by Philip Rooke. This card can be found
-;; in the etc/ directory of Emacs 22.
-;;
-;; A list of recent changes can be found at
-;; http://orgmode.org/Changes.html
-;;
-;;; Code:
-
-(defvar org-inhibit-highlight-removal nil) ; dynamically scoped param
-(defvar org-table-formula-constants-local nil
- "Local version of `org-table-formula-constants'.")
-(make-variable-buffer-local 'org-table-formula-constants-local)
-
-;;;; Require other packages
-
-(eval-when-compile
- (require 'cl)
- (require 'gnus-sum))
-
-(require 'calendar)
-
-;; Emacs 22 calendar compatibility: Make sure the new variables are available
-(when (fboundp 'defvaralias)
- (unless (boundp 'calendar-view-holidays-initially-flag)
- (defvaralias 'calendar-view-holidays-initially-flag
- 'view-calendar-holidays-initially))
- (unless (boundp 'calendar-view-diary-initially-flag)
- (defvaralias 'calendar-view-diary-initially-flag
- 'view-diary-entries-initially))
- (unless (boundp 'diary-fancy-buffer)
- (defvaralias 'diary-fancy-buffer 'fancy-diary-buffer)))
-
-(require 'outline) (require 'noutline)
-;; Other stuff we need.
-(require 'time-date)
-(unless (fboundp 'time-subtract) (defalias 'time-subtract 'subtract-time))
-(require 'easymenu)
-(require 'overlay)
-
-(require 'org-macs)
-(require 'org-entities)
-(require 'org-compat)
-(require 'org-faces)
-(require 'org-list)
-(require 'org-complete)
-(require 'org-src)
-(require 'org-footnote)
-
-;; babel
-(require 'ob)
-(require 'ob-table)
-(require 'ob-lob)
-(require 'ob-ref)
-(require 'ob-tangle)
-(require 'ob-comint)
-(require 'ob-keys)
-
-;; load languages based on value of `org-babel-load-languages'
-(defvar org-babel-load-languages)
-;;;###autoload
-(defun org-babel-do-load-languages (sym value)
- "Load the languages defined in `org-babel-load-languages'."
- (set-default sym value)
- (mapc (lambda (pair)
- (let ((active (cdr pair)) (lang (symbol-name (car pair))))
- (if active
- (progn
- (require (intern (concat "ob-" lang))))
- (progn
- (funcall 'fmakunbound
- (intern (concat "org-babel-execute:" lang)))
- (funcall 'fmakunbound
- (intern (concat "org-babel-expand-body:" lang)))))))
- org-babel-load-languages))
-
-(defcustom org-babel-load-languages '((emacs-lisp . t))
- "Languages which can be evaluated in Org-mode buffers.
-This list can be used to load support for any of the languages
-below, note that each language will depend on a different set of
-system executables and/or Emacs modes. When a language is
-\"loaded\", then code blocks in that language can be evaluated
-with `org-babel-execute-src-block' bound by default to C-c
-C-c (note the `org-babel-no-eval-on-ctrl-c-ctrl-c' variable can
-be set to remove code block evaluation from the C-c C-c
-keybinding. By default only Emacs Lisp (which has no
-requirements) is loaded."
- :group 'org-babel
- :set 'org-babel-do-load-languages
- :type '(alist :tag "Babel Languages"
- :key-type
- (choice
- (const :tag "C" C)
- (const :tag "R" R)
- (const :tag "Asymptote" asymptote)
- (const :tag "Calc" calc)
- (const :tag "Clojure" clojure)
- (const :tag "CSS" css)
- (const :tag "Ditaa" ditaa)
- (const :tag "Dot" dot)
- (const :tag "Emacs Lisp" emacs-lisp)
- (const :tag "Gnuplot" gnuplot)
- (const :tag "Haskell" haskell)
- (const :tag "Javascript" js)
- (const :tag "Latex" latex)
- (const :tag "Ledger" ledger)
- (const :tag "Matlab" matlab)
- (const :tag "Mscgen" mscgen)
- (const :tag "Ocaml" ocaml)
- (const :tag "Octave" octave)
- (const :tag "Org" org)
- (const :tag "Perl" perl)
- (const :tag "PlantUML" plantuml)
- (const :tag "Python" python)
- (const :tag "Ruby" ruby)
- (const :tag "Sass" sass)
- (const :tag "Scheme" scheme)
- (const :tag "Screen" screen)
- (const :tag "Shell Script" sh)
- (const :tag "Sql" sql)
- (const :tag "Sqlite" sqlite))
- :value-type (boolean :tag "Activate" :value t)))
-
-;;;; Customization variables
-(defcustom org-clone-delete-id nil
- "Remove ID property of clones of a subtree.
-When non-nil, clones of a subtree don't inherit the ID property.
-Otherwise they inherit the ID property with a new unique
-identifier."
- :type 'boolean
- :group 'org-id)
-
-;;; Version
-
-(defconst org-version "7.4"
- "The version number of the file org.el.")
-
-(defun org-version (&optional here)
- "Show the org-mode version in the echo area.
-With prefix arg HERE, insert it at point."
- (interactive "P")
- (let* ((origin default-directory)
- (version org-version)
- (git-version)
- (dir (concat (file-name-directory (locate-library "org")) "../" )))
- (when (and (file-exists-p (expand-file-name ".git" dir))
- (executable-find "git"))
- (unwind-protect
- (progn
- (cd dir)
- (when (eql 0 (shell-command "git describe --abbrev=4 HEAD"))
- (with-current-buffer "*Shell Command Output*"
- (goto-char (point-min))
- (setq git-version (buffer-substring (point) (point-at-eol))))
- (subst-char-in-string ?- ?. git-version t)
- (when (string-match "\\S-"
- (shell-command-to-string
- "git diff-index --name-only HEAD --"))
- (setq git-version (concat git-version ".dirty")))
- (setq version (concat version " (" git-version ")"))))
- (cd origin)))
- (setq version (format "Org-mode version %s" version))
- (if here (insert version))
- (message version)))
-
-;;; Compatibility constants
-
-;;; The custom variables
-
-(defgroup org nil
- "Outline-based notes management and organizer."
- :tag "Org"
- :group 'outlines
- :group 'calendar)
-
-(defcustom org-mode-hook nil
- "Mode hook for Org-mode, run after the mode was turned on."
- :group 'org
- :type 'hook)
-
-(defcustom org-load-hook nil
- "Hook that is run after org.el has been loaded."
- :group 'org
- :type 'hook)
-
-(defvar org-modules) ; defined below
-(defvar org-modules-loaded nil
- "Have the modules been loaded already?")
-
-(defun org-load-modules-maybe (&optional force)
- "Load all extensions listed in `org-modules'."
- (when (or force (not org-modules-loaded))
- (mapc (lambda (ext)
- (condition-case nil (require ext)
- (error (message "Problems while trying to load feature `%s'" ext))))
- org-modules)
- (setq org-modules-loaded t)))
-
-(defun org-set-modules (var value)
- "Set VAR to VALUE and call `org-load-modules-maybe' with the force flag."
- (set var value)
- (when (featurep 'org)
- (org-load-modules-maybe 'force)))
-
-(when (org-bound-and-true-p org-modules)
- (let ((a (member 'org-infojs org-modules)))
- (and a (setcar a 'org-jsinfo))))
-
-(defcustom org-modules '(org-bbdb org-bibtex org-docview org-gnus org-info org-jsinfo org-irc org-mew org-mhe org-rmail org-vm org-w3m org-wl)
- "Modules that should always be loaded together with org.el.
-If a description starts with <C>, the file is not part of Emacs
-and loading it will require that you have downloaded and properly installed
-the org-mode distribution.
-
-You can also use this system to load external packages (i.e. neither Org
-core modules, nor modules from the CONTRIB directory). Just add symbols
-to the end of the list. If the package is called org-xyz.el, then you need
-to add the symbol `xyz', and the package must have a call to
-
- (provide 'org-xyz)"
- :group 'org
- :set 'org-set-modules
- :type
- '(set :greedy t
- (const :tag " bbdb: Links to BBDB entries" org-bbdb)
- (const :tag " bibtex: Links to BibTeX entries" org-bibtex)
- (const :tag " crypt: Encryption of subtrees" org-crypt)
- (const :tag " ctags: Access to Emacs tags with links" org-ctags)
- (const :tag " docview: Links to doc-view buffers" org-docview)
- (const :tag " gnus: Links to GNUS folders/messages" org-gnus)
- (const :tag " id: Global IDs for identifying entries" org-id)
- (const :tag " info: Links to Info nodes" org-info)
- (const :tag " jsinfo: Set up Sebastian Rose's JavaScript org-info.js" org-jsinfo)
- (const :tag " habit: Track your consistency with habits" org-habit)
- (const :tag " inlinetask: Tasks independent of outline hierarchy" org-inlinetask)
- (const :tag " irc: Links to IRC/ERC chat sessions" org-irc)
- (const :tag " mac-message: Links to messages in Apple Mail" org-mac-message)
- (const :tag " mew Links to Mew folders/messages" org-mew)
- (const :tag " mhe: Links to MHE folders/messages" org-mhe)
- (const :tag " protocol: Intercept calls from emacsclient" org-protocol)
- (const :tag " rmail: Links to RMAIL folders/messages" org-rmail)
- (const :tag " vm: Links to VM folders/messages" org-vm)
- (const :tag " wl: Links to Wanderlust folders/messages" org-wl)
- (const :tag " w3m: Special cut/paste from w3m to Org-mode." org-w3m)
- (const :tag " mouse: Additional mouse support" org-mouse)
- (const :tag " TaskJuggler: Export tasks to a TaskJuggler project" org-taskjuggler)
-
- (const :tag "C annotate-file: Annotate a file with org syntax" org-annotate-file)
- (const :tag "C bookmark: Org-mode links to bookmarks" org-bookmark)
- (const :tag "C checklist: Extra functions for checklists in repeated tasks" org-checklist)
- (const :tag "C choose: Use TODO keywords to mark decisions states" org-choose)
- (const :tag "C collector: Collect properties into tables" org-collector)
- (const :tag "C depend: TODO dependencies for Org-mode\n\t\t\t(PARTIALLY OBSOLETE, see built-in dependency support))" org-depend)
- (const :tag "C elisp-symbol: Org-mode links to emacs-lisp symbols" org-elisp-symbol)
- (const :tag "C eval: Include command output as text" org-eval)
- (const :tag "C eval-light: Evaluate inbuffer-code on demand" org-eval-light)
- (const :tag "C expiry: Expiry mechanism for Org-mode entries" org-expiry)
- (const :tag "C exp-bibtex: Export citations using BibTeX" org-exp-bibtex)
- (const :tag "C git-link: Provide org links to specific file version" org-git-link)
- (const :tag "C interactive-query: Interactive modification of tags query\n\t\t\t(PARTIALLY OBSOLETE, see secondary filtering)" org-interactive-query)
-
- (const :tag "C invoice: Help manage client invoices in Org-mode" org-invoice)
-
- (const :tag "C jira: Add a jira:ticket protocol to Org-mode" org-jira)
- (const :tag "C learn: SuperMemo's incremental learning algorithm" org-learn)
- (const :tag "C mairix: Hook mairix search into Org-mode for different MUAs" org-mairix)
- (const :tag "C mac-iCal Imports events from iCal.app to the Emacs diary" org-mac-iCal)
- (const :tag "C mac-link-grabber Grab links and URLs from various Mac applications" org-mac-link-grabber)
- (const :tag "C man: Support for links to manpages in Org-mode" org-man)
- (const :tag "C mtags: Support for muse-like tags" org-mtags)
- (const :tag "C panel: Simple routines for us with bad memory" org-panel)
- (const :tag "C registry: A registry for Org-mode links" org-registry)
- (const :tag "C org2rem: Convert org appointments into reminders" org2rem)
- (const :tag "C screen: Visit screen sessions through Org-mode links" org-screen)
- (const :tag "C secretary: Team management with org-mode" org-secretary)
- (const :tag "C special-blocks: Turn blocks into LaTeX envs and HTML divs" org-special-blocks)
- (const :tag "C sqlinsert: Convert Org-mode tables to SQL insertions" orgtbl-sqlinsert)
- (const :tag "C toc: Table of contents for Org-mode buffer" org-toc)
- (const :tag "C track: Keep up with Org-mode development" org-track)
- (const :tag "C velocity Something like Notational Velocity for Org" org-velocity)
- (const :tag "C wikinodes: CamelCase wiki-like links" org-wikinodes)
- (repeat :tag "External packages" :inline t (symbol :tag "Package"))))
-
-(defcustom org-support-shift-select nil
- "Non-nil means make shift-cursor commands select text when possible.
-
-In Emacs 23, when `shift-select-mode' is on, shifted cursor keys start
-selecting a region, or enlarge regions started in this way.
-In Org-mode, in special contexts, these same keys are used for other
-purposes, important enough to compete with shift selection. Org tries
-to balance these needs by supporting `shift-select-mode' outside these
-special contexts, under control of this variable.
-
-The default of this variable is nil, to avoid confusing behavior. Shifted
-cursor keys will then execute Org commands in the following contexts:
-- on a headline, changing TODO state (left/right) and priority (up/down)
-- on a time stamp, changing the time
-- in a plain list item, changing the bullet type
-- in a property definition line, switching between allowed values
-- in the BEGIN line of a clock table (changing the time block).
-Outside these contexts, the commands will throw an error.
-
-When this variable is t and the cursor is not in a special context,
-Org-mode will support shift-selection for making and enlarging regions.
-To make this more effective, the bullet cycling will no longer happen
-anywhere in an item line, but only if the cursor is exactly on the bullet.
-
-If you set this variable to the symbol `always', then the keys
-will not be special in headlines, property lines, and item lines, to make
-shift selection work there as well. If this is what you want, you can
-use the following alternative commands: `C-c C-t' and `C-c ,' to
-change TODO state and priority, `C-u C-u C-c C-t' can be used to switch
-TODO sets, `C-c -' to cycle item bullet types, and properties can be
-edited by hand or in column view.
-
-However, when the cursor is on a timestamp, shift-cursor commands
-will still edit the time stamp - this is just too good to give up.
-
-XEmacs user should have this variable set to nil, because shift-select-mode
-is Emacs 23 only."
- :group 'org
- :type '(choice
- (const :tag "Never" nil)
- (const :tag "When outside special context" t)
- (const :tag "Everywhere except timestamps" always)))
-
-(defgroup org-startup nil
- "Options concerning startup of Org-mode."
- :tag "Org Startup"
- :group 'org)
-
-(defcustom org-startup-folded t
- "Non-nil means entering Org-mode will switch to OVERVIEW.
-This can also be configured on a per-file basis by adding one of
-the following lines anywhere in the buffer:
-
- #+STARTUP: fold (or `overview', this is equivalent)
- #+STARTUP: nofold (or `showall', this is equivalent)
- #+STARTUP: content
- #+STARTUP: showeverything"
- :group 'org-startup
- :type '(choice
- (const :tag "nofold: show all" nil)
- (const :tag "fold: overview" t)
- (const :tag "content: all headlines" content)
- (const :tag "show everything, even drawers" showeverything)))
-
-(defcustom org-startup-truncated t
- "Non-nil means entering Org-mode will set `truncate-lines'.
-This is useful since some lines containing links can be very long and
-uninteresting. Also tables look terrible when wrapped."
- :group 'org-startup
- :type 'boolean)
-
-(defcustom org-startup-indented nil
- "Non-nil means turn on `org-indent-mode' on startup.
-This can also be configured on a per-file basis by adding one of
-the following lines anywhere in the buffer:
-
- #+STARTUP: indent
- #+STARTUP: noindent"
- :group 'org-structure
- :type '(choice
- (const :tag "Not" nil)
- (const :tag "Globally (slow on startup in large files)" t)))
-
-(defcustom org-use-sub-superscripts t
- "Non-nil means interpret \"_\" and \"^\" for export.
-When this option is turned on, you can use TeX-like syntax for sub- and
-superscripts. Several characters after \"_\" or \"^\" will be
-considered as a single item - so grouping with {} is normally not
-needed. For example, the following things will be parsed as single
-sub- or superscripts.
-
- 10^24 or 10^tau several digits will be considered 1 item.
- 10^-12 or 10^-tau a leading sign with digits or a word
- x^2-y^3 will be read as x^2 - y^3, because items are
- terminated by almost any nonword/nondigit char.
- x_{i^2} or x^(2-i) braces or parenthesis do grouping.
-
-Still, ambiguity is possible - so when in doubt use {} to enclose the
-sub/superscript. If you set this variable to the symbol `{}',
-the braces are *required* in order to trigger interpretations as
-sub/superscript. This can be helpful in documents that need \"_\"
-frequently in plain text.
-
-Not all export backends support this, but HTML does.
-
-This option can also be set with the +OPTIONS line, e.g. \"^:nil\"."
- :group 'org-startup
- :group 'org-export-translation
- :type '(choice
- (const :tag "Always interpret" t)
- (const :tag "Only with braces" {})
- (const :tag "Never interpret" nil)))
-
-(if (fboundp 'defvaralias)
- (defvaralias 'org-export-with-sub-superscripts 'org-use-sub-superscripts))
-
-
-(defcustom org-startup-with-beamer-mode nil
- "Non-nil means turn on `org-beamer-mode' on startup.
-This can also be configured on a per-file basis by adding one of
-the following lines anywhere in the buffer:
-
- #+STARTUP: beamer"
- :group 'org-startup
- :type 'boolean)
-
-(defcustom org-startup-align-all-tables nil
- "Non-nil means align all tables when visiting a file.
-This is useful when the column width in tables is forced with <N> cookies
-in table fields. Such tables will look correct only after the first re-align.
-This can also be configured on a per-file basis by adding one of
-the following lines anywhere in the buffer:
- #+STARTUP: align
- #+STARTUP: noalign"
- :group 'org-startup
- :type 'boolean)
-
-(defcustom org-startup-with-inline-images nil
- "Non-nil means show inline images when loading a new Org file.
-This can also be configured on a per-file basis by adding one of
-the following lines anywhere in the buffer:
- #+STARTUP: inlineimages
- #+STARTUP: noinlineimages"
- :group 'org-startup
- :type 'boolean)
-
-(defcustom org-insert-mode-line-in-empty-file nil
- "Non-nil means insert the first line setting Org-mode in empty files.
-When the function `org-mode' is called interactively in an empty file, this
-normally means that the file name does not automatically trigger Org-mode.
-To ensure that the file will always be in Org-mode in the future, a
-line enforcing Org-mode will be inserted into the buffer, if this option
-has been set."
- :group 'org-startup
- :type 'boolean)
-
-(defcustom org-replace-disputed-keys nil
- "Non-nil means use alternative key bindings for some keys.
-Org-mode uses S-<cursor> keys for changing timestamps and priorities.
-These keys are also used by other packages like shift-selection-mode'
-\(built into Emacs 23), `CUA-mode' or `windmove.el'.
-If you want to use Org-mode together with one of these other modes,
-or more generally if you would like to move some Org-mode commands to
-other keys, set this variable and configure the keys with the variable
-`org-disputed-keys'.
-
-This option is only relevant at load-time of Org-mode, and must be set
-*before* org.el is loaded. Changing it requires a restart of Emacs to
-become effective."
- :group 'org-startup
- :type 'boolean)
-
-(defcustom org-use-extra-keys nil
- "Non-nil means use extra key sequence definitions for certain commands.
-This happens automatically if you run XEmacs or if `window-system'
-is nil. This variable lets you do the same manually. You must
-set it before loading org.
-
-Example: on Carbon Emacs 22 running graphically, with an external
-keyboard on a Powerbook, the default way of setting M-left might
-not work for either Alt or ESC. Setting this variable will make
-it work for ESC."
- :group 'org-startup
- :type 'boolean)
-
-(if (fboundp 'defvaralias)
- (defvaralias 'org-CUA-compatible 'org-replace-disputed-keys))
-
-(defcustom org-disputed-keys
- '(([(shift up)] . [(meta p)])
- ([(shift down)] . [(meta n)])
- ([(shift left)] . [(meta -)])
- ([(shift right)] . [(meta +)])
- ([(control shift right)] . [(meta shift +)])
- ([(control shift left)] . [(meta shift -)]))
- "Keys for which Org-mode and other modes compete.
-This is an alist, cars are the default keys, second element specifies
-the alternative to use when `org-replace-disputed-keys' is t.
-
-Keys can be specified in any syntax supported by `define-key'.
-The value of this option takes effect only at Org-mode's startup,
-therefore you'll have to restart Emacs to apply it after changing."
- :group 'org-startup
- :type 'alist)
-
-(defun org-key (key)
- "Select key according to `org-replace-disputed-keys' and `org-disputed-keys'.
-Or return the original if not disputed.
-Also apply the translations defined in `org-xemacs-key-equivalents'."
- (when org-replace-disputed-keys
- (let* ((nkey (key-description key))
- (x (org-find-if (lambda (x)
- (equal (key-description (car x)) nkey))
- org-disputed-keys)))
- (setq key (if x (cdr x) key))))
- (when (featurep 'xemacs)
- (setq key (or (cdr (assoc key org-xemacs-key-equivalents)) key)))
- key)
-
-(defun org-find-if (predicate seq)
- (catch 'exit
- (while seq
- (if (funcall predicate (car seq))
- (throw 'exit (car seq))
- (pop seq)))))
-
-(defun org-defkey (keymap key def)
- "Define a key, possibly translated, as returned by `org-key'."
- (define-key keymap (org-key key) def))
-
-(defcustom org-ellipsis nil
- "The ellipsis to use in the Org-mode outline.
-When nil, just use the standard three dots. When a string, use that instead,
-When a face, use the standard 3 dots, but with the specified face.
-The change affects only Org-mode (which will then use its own display table).
-Changing this requires executing `M-x org-mode' in a buffer to become
-effective."
- :group 'org-startup
- :type '(choice (const :tag "Default" nil)
- (face :tag "Face" :value org-warning)
- (string :tag "String" :value "...#")))
-
-(defvar org-display-table nil
- "The display table for org-mode, in case `org-ellipsis' is non-nil.")
-
-(defgroup org-keywords nil
- "Keywords in Org-mode."
- :tag "Org Keywords"
- :group 'org)
-
-(defcustom org-deadline-string "DEADLINE:"
- "String to mark deadline entries.
-A deadline is this string, followed by a time stamp. Should be a word,
-terminated by a colon. You can insert a schedule keyword and
-a timestamp with \\[org-deadline].
-Changes become only effective after restarting Emacs."
- :group 'org-keywords
- :type 'string)
-
-(defcustom org-scheduled-string "SCHEDULED:"
- "String to mark scheduled TODO entries.
-A schedule is this string, followed by a time stamp. Should be a word,
-terminated by a colon. You can insert a schedule keyword and
-a timestamp with \\[org-schedule].
-Changes become only effective after restarting Emacs."
- :group 'org-keywords
- :type 'string)
-
-(defcustom org-closed-string "CLOSED:"
- "String used as the prefix for timestamps logging closing a TODO entry."
- :group 'org-keywords
- :type 'string)
-
-(defcustom org-clock-string "CLOCK:"
- "String used as prefix for timestamps clocking work hours on an item."
- :group 'org-keywords
- :type 'string)
-
-(defcustom org-comment-string "COMMENT"
- "Entries starting with this keyword will never be exported.
-An entry can be toggled between COMMENT and normal with
-\\[org-toggle-comment].
-Changes become only effective after restarting Emacs."
- :group 'org-keywords
- :type 'string)
-
-(defcustom org-quote-string "QUOTE"
- "Entries starting with this keyword will be exported in fixed-width font.
-Quoting applies only to the text in the entry following the headline, and does
-not extend beyond the next headline, even if that is lower level.
-An entry can be toggled between QUOTE and normal with
-\\[org-toggle-fixed-width-section]."
- :group 'org-keywords
- :type 'string)
-
-(defconst org-repeat-re
- "<[0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9] [^>\n]*?\\([.+]?\\+[0-9]+[dwmy]\\(/[0-9]+[dwmy]\\)?\\)"
- "Regular expression for specifying repeated events.
-After a match, group 1 contains the repeat expression.")
-
-(defgroup org-structure nil
- "Options concerning the general structure of Org-mode files."
- :tag "Org Structure"
- :group 'org)
-
-(defgroup org-reveal-location nil
- "Options about how to make context of a location visible."
- :tag "Org Reveal Location"
- :group 'org-structure)
-
-(defconst org-context-choice
- '(choice
- (const :tag "Always" t)
- (const :tag "Never" nil)
- (repeat :greedy t :tag "Individual contexts"
- (cons
- (choice :tag "Context"
- (const agenda)
- (const org-goto)
- (const occur-tree)
- (const tags-tree)
- (const link-search)
- (const mark-goto)
- (const bookmark-jump)
- (const isearch)
- (const default))
- (boolean))))
- "Contexts for the reveal options.")
-
-(defcustom org-show-hierarchy-above '((default . t))
- "Non-nil means show full hierarchy when revealing a location.
-Org-mode often shows locations in an org-mode file which might have
-been invisible before. When this is set, the hierarchy of headings
-above the exposed location is shown.
-Turning this off for example for sparse trees makes them very compact.
-Instead of t, this can also be an alist specifying this option for different
-contexts. Valid contexts are
- agenda when exposing an entry from the agenda
- org-goto when using the command `org-goto' on key C-c C-j
- occur-tree when using the command `org-occur' on key C-c /
- tags-tree when constructing a sparse tree based on tags matches
- link-search when exposing search matches associated with a link
- mark-goto when exposing the jump goal of a mark
- bookmark-jump when exposing a bookmark location
- isearch when exiting from an incremental search
- default default for all contexts not set explicitly"
- :group 'org-reveal-location
- :type org-context-choice)
-
-(defcustom org-show-following-heading '((default . nil))
- "Non-nil means show following heading when revealing a location.
-Org-mode often shows locations in an org-mode file which might have
-been invisible before. When this is set, the heading following the
-match is shown.
-Turning this off for example for sparse trees makes them very compact,
-but makes it harder to edit the location of the match. In such a case,
-use the command \\[org-reveal] to show more context.
-Instead of t, this can also be an alist specifying this option for different
-contexts. See `org-show-hierarchy-above' for valid contexts."
- :group 'org-reveal-location
- :type org-context-choice)
-
-(defcustom org-show-siblings '((default . nil) (isearch t))
- "Non-nil means show all sibling heading when revealing a location.
-Org-mode often shows locations in an org-mode file which might have
-been invisible before. When this is set, the sibling of the current entry
-heading are all made visible. If `org-show-hierarchy-above' is t,
-the same happens on each level of the hierarchy above the current entry.
-
-By default this is on for the isearch context, off for all other contexts.
-Turning this off for example for sparse trees makes them very compact,
-but makes it harder to edit the location of the match. In such a case,
-use the command \\[org-reveal] to show more context.
-Instead of t, this can also be an alist specifying this option for different
-contexts. See `org-show-hierarchy-above' for valid contexts."
- :group 'org-reveal-location
- :type org-context-choice)
-
-(defcustom org-show-entry-below '((default . nil))
- "Non-nil means show the entry below a headline when revealing a location.
-Org-mode often shows locations in an org-mode file which might have
-been invisible before. When this is set, the text below the headline that is
-exposed is also shown.
-
-By default this is off for all contexts.
-Instead of t, this can also be an alist specifying this option for different
-contexts. See `org-show-hierarchy-above' for valid contexts."
- :group 'org-reveal-location
- :type org-context-choice)
-
-(defcustom org-indirect-buffer-display 'other-window
- "How should indirect tree buffers be displayed?
-This applies to indirect buffers created with the commands
-\\[org-tree-to-indirect-buffer] and \\[org-agenda-tree-to-indirect-buffer].
-Valid values are:
-current-window Display in the current window
-other-window Just display in another window.
-dedicated-frame Create one new frame, and re-use it each time.
-new-frame Make a new frame each time. Note that in this case
- previously-made indirect buffers are kept, and you need to
- kill these buffers yourself."
- :group 'org-structure
- :group 'org-agenda-windows
- :type '(choice
- (const :tag "In current window" current-window)
- (const :tag "In current frame, other window" other-window)
- (const :tag "Each time a new frame" new-frame)
- (const :tag "One dedicated frame" dedicated-frame)))
-
-(defcustom org-use-speed-commands nil
- "Non-nil means activate single letter commands at beginning of a headline.
-This may also be a function to test for appropriate locations where speed
-commands should be active."
- :group 'org-structure
- :type '(choice
- (const :tag "Never" nil)
- (const :tag "At beginning of headline stars" t)
- (function)))
-
-(defcustom org-speed-commands-user nil
- "Alist of additional speed commands.
-This list will be checked before `org-speed-commands-default'
-when the variable `org-use-speed-commands' is non-nil
-and when the cursor is at the beginning of a headline.
-The car if each entry is a string with a single letter, which must
-be assigned to `self-insert-command' in the global map.
-The cdr is either a command to be called interactively, a function
-to be called, or a form to be evaluated.
-An entry that is just a list with a single string will be interpreted
-as a descriptive headline that will be added when listing the speed
-commands in the Help buffer using the `?' speed command."
- :group 'org-structure
- :type '(repeat :value ("k" . ignore)
- (choice :value ("k" . ignore)
- (list :tag "Descriptive Headline" (string :tag "Headline"))
- (cons :tag "Letter and Command"
- (string :tag "Command letter")
- (choice
- (function)
- (sexp))))))
-
-(defgroup org-cycle nil
- "Options concerning visibility cycling in Org-mode."
- :tag "Org Cycle"
- :group 'org-structure)
-
-(defcustom org-cycle-skip-children-state-if-no-children t
- "Non-nil means skip CHILDREN state in entries that don't have any."
- :group 'org-cycle
- :type 'boolean)
-
-(defcustom org-cycle-max-level nil
- "Maximum level which should still be subject to visibility cycling.
-Levels higher than this will, for cycling, be treated as text, not a headline.
-When `org-odd-levels-only' is set, a value of N in this variable actually
-means 2N-1 stars as the limiting headline.
-When nil, cycle all levels.
-Note that the limiting level of cycling is also influenced by
-`org-inlinetask-min-level'. When `org-cycle-max-level' is not set but
-`org-inlinetask-min-level' is, cycling will be limited to levels one less
-than its value."
- :group 'org-cycle
- :type '(choice
- (const :tag "No limit" nil)
- (integer :tag "Maximum level")))
-
-(defcustom org-drawers '("PROPERTIES" "CLOCK" "LOGBOOK")
- "Names of drawers. Drawers are not opened by cycling on the headline above.
-Drawers only open with a TAB on the drawer line itself. A drawer looks like
-this:
- :DRAWERNAME:
- .....
- :END:
-The drawer \"PROPERTIES\" is special for capturing properties through
-the property API.
-
-Drawers can be defined on the per-file basis with a line like:
-
-#+DRAWERS: HIDDEN STATE PROPERTIES"
- :group 'org-structure
- :group 'org-cycle
- :type '(repeat (string :tag "Drawer Name")))
-
-(defcustom org-hide-block-startup nil
- "Non-nil means entering Org-mode will fold all blocks.
-This can also be set in on a per-file basis with
-
-#+STARTUP: hideblocks
-#+STARTUP: showblocks"
- :group 'org-startup
- :group 'org-cycle
- :type 'boolean)
-
-(defcustom org-cycle-global-at-bob nil
- "Cycle globally if cursor is at beginning of buffer and not at a headline.
-This makes it possible to do global cycling without having to use S-TAB or
-\\[universal-argument] TAB. For this special case to work, the first line \
-of the buffer
-must not be a headline - it may be empty or some other text. When used in
-this way, `org-cycle-hook' is disables temporarily, to make sure the
-cursor stays at the beginning of the buffer.
-When this option is nil, don't do anything special at the beginning
-of the buffer."
- :group 'org-cycle
- :type 'boolean)
-
-(defcustom org-cycle-level-after-item/entry-creation t
- "Non-nil means cycle entry level or item indentation in new empty entries.
-
-When the cursor is at the end of an empty headline, i.e with only stars
-and maybe a TODO keyword, TAB will then switch the entry to become a child,
-and then all possible ancestor states, before returning to the original state.
-This makes data entry extremely fast: M-RET to create a new headline,
-on TAB to make it a child, two or more tabs to make it a (grand-)uncle.
-
-When the cursor is at the end of an empty plain list item, one TAB will
-make it a subitem, two or more tabs will back up to make this an item
-higher up in the item hierarchy."
- :group 'org-cycle
- :type 'boolean)
-
-(defcustom org-cycle-emulate-tab t
- "Where should `org-cycle' emulate TAB.
-nil Never
-white Only in completely white lines
-whitestart Only at the beginning of lines, before the first non-white char
-t Everywhere except in headlines
-exc-hl-bol Everywhere except at the start of a headline
-If TAB is used in a place where it does not emulate TAB, the current subtree
-visibility is cycled."
- :group 'org-cycle
- :type '(choice (const :tag "Never" nil)
- (const :tag "Only in completely white lines" white)
- (const :tag "Before first char in a line" whitestart)
- (const :tag "Everywhere except in headlines" t)
- (const :tag "Everywhere except at bol in headlines" exc-hl-bol)
- ))
-
-(defcustom org-cycle-separator-lines 2
- "Number of empty lines needed to keep an empty line between collapsed trees.
-If you leave an empty line between the end of a subtree and the following
-headline, this empty line is hidden when the subtree is folded.
-Org-mode will leave (exactly) one empty line visible if the number of
-empty lines is equal or larger to the number given in this variable.
-So the default 2 means at least 2 empty lines after the end of a subtree
-are needed to produce free space between a collapsed subtree and the
-following headline.
-
-If the number is negative, and the number of empty lines is at least -N,
-all empty lines are shown.
-
-Special case: when 0, never leave empty lines in collapsed view."
- :group 'org-cycle
- :type 'integer)
-(put 'org-cycle-separator-lines 'safe-local-variable 'integerp)
-
-(defcustom org-pre-cycle-hook nil
- "Hook that is run before visibility cycling is happening.
-The function(s) in this hook must accept a single argument which indicates
-the new state that will be set right after running this hook. The
-argument is a symbol. Before a global state change, it can have the values
-`overview', `content', or `all'. Before a local state change, it can have
-the values `folded', `children', or `subtree'."
- :group 'org-cycle
- :type 'hook)
-
-(defcustom org-cycle-hook '(org-cycle-hide-archived-subtrees
- org-cycle-hide-drawers
- org-cycle-show-empty-lines
- org-optimize-window-after-visibility-change)
- "Hook that is run after `org-cycle' has changed the buffer visibility.
-The function(s) in this hook must accept a single argument which indicates
-the new state that was set by the most recent `org-cycle' command. The
-argument is a symbol. After a global state change, it can have the values
-`overview', `content', or `all'. After a local state change, it can have
-the values `folded', `children', or `subtree'."
- :group 'org-cycle
- :type 'hook)
-
-(defgroup org-edit-structure nil
- "Options concerning structure editing in Org-mode."
- :tag "Org Edit Structure"
- :group 'org-structure)
-
-(defcustom org-odd-levels-only nil
- "Non-nil means skip even levels and only use odd levels for the outline.
-This has the effect that two stars are being added/taken away in
-promotion/demotion commands. It also influences how levels are
-handled by the exporters.
-Changing it requires restart of `font-lock-mode' to become effective
-for fontification also in regions already fontified.
-You may also set this on a per-file basis by adding one of the following
-lines to the buffer:
-
- #+STARTUP: odd
- #+STARTUP: oddeven"
- :group 'org-edit-structure
- :group 'org-appearance
- :type 'boolean)
-
-(defcustom org-adapt-indentation t
- "Non-nil means adapt indentation to outline node level.
-
-When this variable is set, Org assumes that you write outlines by
-indenting text in each node to align with the headline (after the stars).
-The following issues are influenced by this variable:
-
-- When this is set and the *entire* text in an entry is indented, the
- indentation is increased by one space in a demotion command, and
- decreased by one in a promotion command. If any line in the entry
- body starts with text at column 0, indentation is not changed at all.
-
-- Property drawers and planning information is inserted indented when
- this variable s set. When nil, they will not be indented.
-
-- TAB indents a line relative to context. The lines below a headline
- will be indented when this variable is set.
-
-Note that this is all about true indentation, by adding and removing
-space characters. See also `org-indent.el' which does level-dependent
-indentation in a virtual way, i.e. at display time in Emacs."
- :group 'org-edit-structure
- :type 'boolean)
-
-(defcustom org-special-ctrl-a/e nil
- "Non-nil means `C-a' and `C-e' behave specially in headlines and items.
-
-When t, `C-a' will bring back the cursor to the beginning of the
-headline text, i.e. after the stars and after a possible TODO keyword.
-In an item, this will be the position after the bullet.
-When the cursor is already at that position, another `C-a' will bring
-it to the beginning of the line.
-
-`C-e' will jump to the end of the headline, ignoring the presence of tags
-in the headline. A second `C-e' will then jump to the true end of the
-line, after any tags. This also means that, when this variable is
-non-nil, `C-e' also will never jump beyond the end of the heading of a
-folded section, i.e. not after the ellipses.
-
-When set to the symbol `reversed', the first `C-a' or `C-e' works normally,
-going to the true line boundary first. Only a directly following, identical
-keypress will bring the cursor to the special positions.
-
-This may also be a cons cell where the behavior for `C-a' and `C-e' is
-set separately."
- :group 'org-edit-structure
- :type '(choice
- (const :tag "off" nil)
- (const :tag "on: after stars/bullet and before tags first" t)
- (const :tag "reversed: true line boundary first" reversed)
- (cons :tag "Set C-a and C-e separately"
- (choice :tag "Special C-a"
- (const :tag "off" nil)
- (const :tag "on: after stars/bullet first" t)
- (const :tag "reversed: before stars/bullet first" reversed))
- (choice :tag "Special C-e"
- (const :tag "off" nil)
- (const :tag "on: before tags first" t)
- (const :tag "reversed: after tags first" reversed)))))
-(if (fboundp 'defvaralias)
- (defvaralias 'org-special-ctrl-a 'org-special-ctrl-a/e))
-
-(defcustom org-special-ctrl-k nil
- "Non-nil means `C-k' will behave specially in headlines.
-When nil, `C-k' will call the default `kill-line' command.
-When t, the following will happen while the cursor is in the headline:
-
-- When the cursor is at the beginning of a headline, kill the entire
- line and possible the folded subtree below the line.
-- When in the middle of the headline text, kill the headline up to the tags.
-- When after the headline text, kill the tags."
- :group 'org-edit-structure
- :type 'boolean)
-
-(defcustom org-ctrl-k-protect-subtree nil
- "Non-nil means, do not delete a hidden subtree with C-k.
-When set to the symbol `error', simply throw an error when C-k is
-used to kill (part-of) a headline that has hidden text behind it.
-Any other non-nil value will result in a query to the user, if it is
-OK to kill that hidden subtree. When nil, kill without remorse."
- :group 'org-edit-structure
- :type '(choice
- (const :tag "Do not protect hidden subtrees" nil)
- (const :tag "Protect hidden subtrees with a security query" t)
- (const :tag "Never kill a hidden subtree with C-k" error)))
-
-(defcustom org-yank-folded-subtrees t
- "Non-nil means when yanking subtrees, fold them.
-If the kill is a single subtree, or a sequence of subtrees, i.e. if
-it starts with a heading and all other headings in it are either children
-or siblings, then fold all the subtrees. However, do this only if no
-text after the yank would be swallowed into a folded tree by this action."
- :group 'org-edit-structure
- :type 'boolean)
-
-(defcustom org-yank-adjusted-subtrees nil
- "Non-nil means when yanking subtrees, adjust the level.
-With this setting, `org-paste-subtree' is used to insert the subtree, see
-this function for details."
- :group 'org-edit-structure
- :type 'boolean)
-
-(defcustom org-M-RET-may-split-line '((default . t))
- "Non-nil means M-RET will split the line at the cursor position.
-When nil, it will go to the end of the line before making a
-new line.
-You may also set this option in a different way for different
-contexts. Valid contexts are:
-
-headline when creating a new headline
-item when creating a new item
-table in a table field
-default the value to be used for all contexts not explicitly
- customized"
- :group 'org-structure
- :group 'org-table
- :type '(choice
- (const :tag "Always" t)
- (const :tag "Never" nil)
- (repeat :greedy t :tag "Individual contexts"
- (cons
- (choice :tag "Context"
- (const headline)
- (const item)
- (const table)
- (const default))
- (boolean)))))
-
-
-(defcustom org-insert-heading-respect-content nil
- "Non-nil means insert new headings after the current subtree.
-When nil, the new heading is created directly after the current line.
-The commands \\[org-insert-heading-respect-content] and
-\\[org-insert-todo-heading-respect-content] turn this variable on
-for the duration of the command."
- :group 'org-structure
- :type 'boolean)
-
-(defcustom org-blank-before-new-entry '((heading . auto)
- (plain-list-item . auto))
- "Should `org-insert-heading' leave a blank line before new heading/item?
-The value is an alist, with `heading' and `plain-list-item' as car,
-and a boolean flag as cdr. The cdr may lso be the symbol `auto', and then
-Org will look at the surrounding headings/items and try to make an
-intelligent decision wether to insert a blank line or not.
-
-For plain lists, if the variable `org-empty-line-terminates-plain-lists' is
-set, the setting here is ignored and no empty line is inserted, to avoid
-breaking the list structure."
- :group 'org-edit-structure
- :type '(list
- (cons (const heading)
- (choice (const :tag "Never" nil)
- (const :tag "Always" t)
- (const :tag "Auto" auto)))
- (cons (const plain-list-item)
- (choice (const :tag "Never" nil)
- (const :tag "Always" t)
- (const :tag "Auto" auto)))))
-
-(defcustom org-insert-heading-hook nil
- "Hook being run after inserting a new heading."
- :group 'org-edit-structure
- :type 'hook)
-
-(defcustom org-enable-fixed-width-editor t
- "Non-nil means lines starting with \":\" are treated as fixed-width.
-This currently only means they are never auto-wrapped.
-When nil, such lines will be treated like ordinary lines.
-See also the QUOTE keyword."
- :group 'org-edit-structure
- :type 'boolean)
-
-(defcustom org-goto-auto-isearch t
- "Non-nil means typing characters in `org-goto' starts incremental search."
- :group 'org-edit-structure
- :type 'boolean)
-
-(defgroup org-sparse-trees nil
- "Options concerning sparse trees in Org-mode."
- :tag "Org Sparse Trees"
- :group 'org-structure)
-
-(defcustom org-highlight-sparse-tree-matches t
- "Non-nil means highlight all matches that define a sparse tree.
-The highlights will automatically disappear the next time the buffer is
-changed by an edit command."
- :group 'org-sparse-trees
- :type 'boolean)
-
-(defcustom org-remove-highlights-with-change t
- "Non-nil means any change to the buffer will remove temporary highlights.
-Such highlights are created by `org-occur' and `org-clock-display'.
-When nil, `C-c C-c needs to be used to get rid of the highlights.
-The highlights created by `org-preview-latex-fragment' always need
-`C-c C-c' to be removed."
- :group 'org-sparse-trees
- :group 'org-time
- :type 'boolean)
-
-
-(defcustom org-occur-hook '(org-first-headline-recenter)
- "Hook that is run after `org-occur' has constructed a sparse tree.
-This can be used to recenter the window to show as much of the structure
-as possible."
- :group 'org-sparse-trees
- :type 'hook)
-
-(defgroup org-imenu-and-speedbar nil
- "Options concerning imenu and speedbar in Org-mode."
- :tag "Org Imenu and Speedbar"
- :group 'org-structure)
-
-(defcustom org-imenu-depth 2
- "The maximum level for Imenu access to Org-mode headlines.
-This also applied for speedbar access."
- :group 'org-imenu-and-speedbar
- :type 'integer)
-
-(defgroup org-table nil
- "Options concerning tables in Org-mode."
- :tag "Org Table"
- :group 'org)
-
-(defcustom org-enable-table-editor 'optimized
- "Non-nil means lines starting with \"|\" are handled by the table editor.
-When nil, such lines will be treated like ordinary lines.
-
-When equal to the symbol `optimized', the table editor will be optimized to
-do the following:
-- Automatic overwrite mode in front of whitespace in table fields.
- This makes the structure of the table stay in tact as long as the edited
- field does not exceed the column width.
-- Minimize the number of realigns. Normally, the table is aligned each time
- TAB or RET are pressed to move to another field. With optimization this
- happens only if changes to a field might have changed the column width.
-Optimization requires replacing the functions `self-insert-command',
-`delete-char', and `backward-delete-char' in Org-mode buffers, with a
-slight (in fact: unnoticeable) speed impact for normal typing. Org-mode is
-very good at guessing when a re-align will be necessary, but you can always
-force one with \\[org-ctrl-c-ctrl-c].
-
-If you would like to use the optimized version in Org-mode, but the
-un-optimized version in OrgTbl-mode, see the variable `orgtbl-optimized'.
-
-This variable can be used to turn on and off the table editor during a session,
-but in order to toggle optimization, a restart is required.
-
-See also the variable `org-table-auto-blank-field'."
- :group 'org-table
- :type '(choice
- (const :tag "off" nil)
- (const :tag "on" t)
- (const :tag "on, optimized" optimized)))
-
-(defcustom org-self-insert-cluster-for-undo t
- "Non-nil means cluster self-insert commands for undo when possible.
-If this is set, then, like in the Emacs command loop, 20 consecutive
-characters will be undone together.
-This is configurable, because there is some impact on typing performance."
- :group 'org-table
- :type 'boolean)
-
-(defcustom org-table-tab-recognizes-table.el t
- "Non-nil means TAB will automatically notice a table.el table.
-When it sees such a table, it moves point into it and - if necessary -
-calls `table-recognize-table'."
- :group 'org-table-editing
- :type 'boolean)
-
-(defgroup org-link nil
- "Options concerning links in Org-mode."
- :tag "Org Link"
- :group 'org)
-
-(defvar org-link-abbrev-alist-local nil
- "Buffer-local version of `org-link-abbrev-alist', which see.
-The value of this is taken from the #+LINK lines.")
-(make-variable-buffer-local 'org-link-abbrev-alist-local)
-
-(defcustom org-link-abbrev-alist nil
- "Alist of link abbreviations.
-The car of each element is a string, to be replaced at the start of a link.
-The cdrs are replacement values, like (\"linkkey\" . REPLACE). Abbreviated
-links in Org-mode buffers can have an optional tag after a double colon, e.g.
-
- [[linkkey:tag][description]]
-
-The 'linkkey' must be a word word, starting with a letter, followed
-by letters, numbers, '-' or '_'.
-
-If REPLACE is a string, the tag will simply be appended to create the link.
-If the string contains \"%s\", the tag will be inserted there. Alternatively,
-the placeholder \"%h\" will cause a url-encoded version of the tag to
-be inserted at that point (see the function `url-hexify-string').
-
-REPLACE may also be a function that will be called with the tag as the
-only argument to create the link, which should be returned as a string.
-
-See the manual for examples."
- :group 'org-link
- :type '(repeat
- (cons
- (string :tag "Protocol")
- (choice
- (string :tag "Format")
- (function)))))
-
-(defcustom org-descriptive-links t
- "Non-nil means hide link part and only show description of bracket links.
-Bracket links are like [[link][description]]. This variable sets the initial
-state in new org-mode buffers. The setting can then be toggled on a
-per-buffer basis from the Org->Hyperlinks menu."
- :group 'org-link
- :type 'boolean)
-
-(defcustom org-link-file-path-type 'adaptive
- "How the path name in file links should be stored.
-Valid values are:
-
-relative Relative to the current directory, i.e. the directory of the file
- into which the link is being inserted.
-absolute Absolute path, if possible with ~ for home directory.
-noabbrev Absolute path, no abbreviation of home directory.
-adaptive Use relative path for files in the current directory and sub-
- directories of it. For other files, use an absolute path."
- :group 'org-link
- :type '(choice
- (const relative)
- (const absolute)
- (const noabbrev)
- (const adaptive)))
-
-(defcustom org-activate-links '(bracket angle plain radio tag date footnote)
- "Types of links that should be activated in Org-mode files.
-This is a list of symbols, each leading to the activation of a certain link
-type. In principle, it does not hurt to turn on most link types - there may
-be a small gain when turning off unused link types. The types are:
-
-bracket The recommended [[link][description]] or [[link]] links with hiding.
-angle Links in angular brackets that may contain whitespace like
- <bbdb:Carsten Dominik>.
-plain Plain links in normal text, no whitespace, like http://google.com.
-radio Text that is matched by a radio target, see manual for details.
-tag Tag settings in a headline (link to tag search).
-date Time stamps (link to calendar).
-footnote Footnote labels.
-
-Changing this variable requires a restart of Emacs to become effective."
- :group 'org-link
- :type '(set :greedy t
- (const :tag "Double bracket links" bracket)
- (const :tag "Angular bracket links" angle)
- (const :tag "Plain text links" plain)
- (const :tag "Radio target matches" radio)
- (const :tag "Tags" tag)
- (const :tag "Timestamps" date)
- (const :tag "Footnotes" footnote)))
-
-(defcustom org-make-link-description-function nil
- "Function to use to generate link descriptions from links.
-If nil the link location will be used. This function must take
-two parameters; the first is the link and the second the
-description `org-insert-link' has generated, and should return the
-description to use."
- :group 'org-link
- :type 'function)
-
-(defgroup org-link-store nil
- "Options concerning storing links in Org-mode."
- :tag "Org Store Link"
- :group 'org-link)
-
-(defcustom org-email-link-description-format "Email %c: %.30s"
- "Format of the description part of a link to an email or usenet message.
-The following %-escapes will be replaced by corresponding information:
-
-%F full \"From\" field
-%f name, taken from \"From\" field, address if no name
-%T full \"To\" field
-%t first name in \"To\" field, address if no name
-%c correspondent. Usually \"from NAME\", but if you sent it yourself, it
- will be \"to NAME\". See also the variable `org-from-is-user-regexp'.
-%s subject
-%m message-id.
-
-You may use normal field width specification between the % and the letter.
-This is for example useful to limit the length of the subject.
-
-Examples: \"%f on: %.30s\", \"Email from %f\", \"Email %c\""
- :group 'org-link-store
- :type 'string)
-
-(defcustom org-from-is-user-regexp
- (let (r1 r2)
- (when (and user-mail-address (not (string= user-mail-address "")))
- (setq r1 (concat "\\<" (regexp-quote user-mail-address) "\\>")))
- (when (and user-full-name (not (string= user-full-name "")))
- (setq r2 (concat "\\<" (regexp-quote user-full-name) "\\>")))
- (if (and r1 r2) (concat r1 "\\|" r2) (or r1 r2)))
- "Regexp matched against the \"From:\" header of an email or usenet message.
-It should match if the message is from the user him/herself."
- :group 'org-link-store
- :type 'regexp)
-
-(defcustom org-link-to-org-use-id 'create-if-interactive-and-no-custom-id
- "Non-nil means storing a link to an Org file will use entry IDs.
-
-Note that before this variable is even considered, org-id must be loaded,
-so please customize `org-modules' and turn it on.
-
-The variable can have the following values:
-
-t Create an ID if needed to make a link to the current entry.
-
-create-if-interactive
- If `org-store-link' is called directly (interactively, as a user
- command), do create an ID to support the link. But when doing the
- job for remember, only use the ID if it already exists. The
- purpose of this setting is to avoid proliferation of unwanted
- IDs, just because you happen to be in an Org file when you
- call `org-remember' that automatically and preemptively
- creates a link. If you do want to get an ID link in a remember
- template to an entry not having an ID, create it first by
- explicitly creating a link to it, using `C-c C-l' first.
-
-create-if-interactive-and-no-custom-id
- Like create-if-interactive, but do not create an ID if there is
- a CUSTOM_ID property defined in the entry. This is the default.
-
-use-existing
- Use existing ID, do not create one.
-
-nil Never use an ID to make a link, instead link using a text search for
- the headline text."
- :group 'org-link-store
- :type '(choice
- (const :tag "Create ID to make link" t)
- (const :tag "Create if storing link interactively"
- create-if-interactive)
- (const :tag "Create if storing link interactively and no CUSTOM_ID is present"
- create-if-interactive-and-no-custom-id)
- (const :tag "Only use existing" use-existing)
- (const :tag "Do not use ID to create link" nil)))
-
-(defcustom org-context-in-file-links t
- "Non-nil means file links from `org-store-link' contain context.
-A search string will be added to the file name with :: as separator and
-used to find the context when the link is activated by the command
-`org-open-at-point'. When this option is t, the entire active region
-will be placed in the search string of the file link. If set to a
-positive integer, only the first n lines of context will be stored.
-
-Using a prefix arg to the command \\[org-store-link] (`org-store-link')
-negates this setting for the duration of the command."
- :group 'org-link-store
- :type '(choice boolean integer))
-
-(defcustom org-keep-stored-link-after-insertion nil
- "Non-nil means keep link in list for entire session.
-
-The command `org-store-link' adds a link pointing to the current
-location to an internal list. These links accumulate during a session.
-The command `org-insert-link' can be used to insert links into any
-Org-mode file (offering completion for all stored links). When this
-option is nil, every link which has been inserted once using \\[org-insert-link]
-will be removed from the list, to make completing the unused links
-more efficient."
- :group 'org-link-store
- :type 'boolean)
-
-(defgroup org-link-follow nil
- "Options concerning following links in Org-mode."
- :tag "Org Follow Link"
- :group 'org-link)
-
-(defcustom org-link-translation-function nil
- "Function to translate links with different syntax to Org syntax.
-This can be used to translate links created for example by the Planner
-or emacs-wiki packages to Org syntax.
-The function must accept two parameters, a TYPE containing the link
-protocol name like \"rmail\" or \"gnus\" as a string, and the linked path,
-which is everything after the link protocol. It should return a cons
-with possibly modified values of type and path.
-Org contains a function for this, so if you set this variable to
-`org-translate-link-from-planner', you should be able follow many
-links created by planner."
- :group 'org-link-follow
- :type 'function)
-
-(defcustom org-follow-link-hook nil
- "Hook that is run after a link has been followed."
- :group 'org-link-follow
- :type 'hook)
-
-(defcustom org-tab-follows-link nil
- "Non-nil means on links TAB will follow the link.
-Needs to be set before org.el is loaded.
-This really should not be used, it does not make sense, and the
-implementation is bad."
- :group 'org-link-follow
- :type 'boolean)
-
-(defcustom org-return-follows-link nil
- "Non-nil means on links RET will follow the link."
- :group 'org-link-follow
- :type 'boolean)
-
-(defcustom org-mouse-1-follows-link
- (if (boundp 'mouse-1-click-follows-link) mouse-1-click-follows-link t)
- "Non-nil means mouse-1 on a link will follow the link.
-A longer mouse click will still set point. Does not work on XEmacs.
-Needs to be set before org.el is loaded."
- :group 'org-link-follow
- :type 'boolean)
-
-(defcustom org-mark-ring-length 4
- "Number of different positions to be recorded in the ring.
-Changing this requires a restart of Emacs to work correctly."
- :group 'org-link-follow
- :type 'integer)
-
-(defcustom org-link-search-must-match-exact-headline 'query-to-create
- "Non-nil means internal links in Org files must exactly match a headline.
-When nil, the link search tries to match a phrase will all words
-in the search text."
- :group 'org-link-follow
- :type '(choice
- (const :tag "Use fuzy text search" nil)
- (const :tag "Match only exact headline" t)
- (const :tag "Match extact headline or query to create it"
- query-to-create)))
-
-(defcustom org-link-frame-setup
- '((vm . vm-visit-folder-other-frame)
- (gnus . org-gnus-no-new-news)
- (file . find-file-other-window)
- (wl . wl-other-frame))
- "Setup the frame configuration for following links.
-When following a link with Emacs, it may often be useful to display
-this link in another window or frame. This variable can be used to
-set this up for the different types of links.
-For VM, use any of
- `vm-visit-folder'
- `vm-visit-folder-other-frame'
-For Gnus, use any of
- `gnus'
- `gnus-other-frame'
- `org-gnus-no-new-news'
-For FILE, use any of
- `find-file'
- `find-file-other-window'
- `find-file-other-frame'
-For Wanderlust use any of
- `wl'
- `wl-other-frame'
-For the calendar, use the variable `calendar-setup'.
-For BBDB, it is currently only possible to display the matches in
-another window."
- :group 'org-link-follow
- :type '(list
- (cons (const vm)
- (choice
- (const vm-visit-folder)
- (const vm-visit-folder-other-window)
- (const vm-visit-folder-other-frame)))
- (cons (const gnus)
- (choice
- (const gnus)
- (const gnus-other-frame)
- (const org-gnus-no-new-news)))
- (cons (const file)
- (choice
- (const find-file)
- (const find-file-other-window)
- (const find-file-other-frame)))
- (cons (const wl)
- (choice
- (const wl)
- (const wl-other-frame)))))
-
-(defcustom org-display-internal-link-with-indirect-buffer nil
- "Non-nil means use indirect buffer to display infile links.
-Activating internal links (from one location in a file to another location
-in the same file) normally just jumps to the location. When the link is
-activated with a \\[universal-argument] prefix (or with mouse-3), the link \
-is displayed in
-another window. When this option is set, the other window actually displays
-an indirect buffer clone of the current buffer, to avoid any visibility
-changes to the current buffer."
- :group 'org-link-follow
- :type 'boolean)
-
-(defcustom org-open-non-existing-files nil
- "Non-nil means `org-open-file' will open non-existing files.
-When nil, an error will be generated.
-This variable applies only to external applications because they
-might choke on non-existing files. If the link is to a file that
-will be opened in Emacs, the variable is ignored."
- :group 'org-link-follow
- :type 'boolean)
-
-(defcustom org-open-directory-means-index-dot-org nil
- "Non-nil means a link to a directory really means to index.org.
-When nil, following a directory link will run dired or open a finder/explorer
-window on that directory."
- :group 'org-link-follow
- :type 'boolean)
-
-(defcustom org-link-mailto-program '(browse-url "mailto:%a?subject=%s")
- "Function and arguments to call for following mailto links.
-This is a list with the first element being a Lisp function, and the
-remaining elements being arguments to the function. In string arguments,
-%a will be replaced by the address, and %s will be replaced by the subject
-if one was given like in <mailto:arthur@galaxy.org::this subject>."
- :group 'org-link-follow
- :type '(choice
- (const :tag "browse-url" (browse-url-mail "mailto:%a?subject=%s"))
- (const :tag "compose-mail" (compose-mail "%a" "%s"))
- (const :tag "message-mail" (message-mail "%a" "%s"))
- (cons :tag "other" (function) (repeat :tag "argument" sexp))))
-
-(defcustom org-confirm-shell-link-function 'yes-or-no-p
- "Non-nil means ask for confirmation before executing shell links.
-Shell links can be dangerous: just think about a link
-
- [[shell:rm -rf ~/*][Google Search]]
-
-This link would show up in your Org-mode document as \"Google Search\",
-but really it would remove your entire home directory.
-Therefore we advise against setting this variable to nil.
-Just change it to `y-or-n-p' if you want to confirm with a
-single keystroke rather than having to type \"yes\"."
- :group 'org-link-follow
- :type '(choice
- (const :tag "with yes-or-no (safer)" yes-or-no-p)
- (const :tag "with y-or-n (faster)" y-or-n-p)
- (const :tag "no confirmation (dangerous)" nil)))
-(put 'org-confirm-shell-link-function
- 'safe-local-variable
- '(lambda (x) (member x '(yes-or-no-p y-or-n-p))))
-
-(defcustom org-confirm-elisp-link-function 'yes-or-no-p
- "Non-nil means ask for confirmation before executing Emacs Lisp links.
-Elisp links can be dangerous: just think about a link
-
- [[elisp:(shell-command \"rm -rf ~/*\")][Google Search]]
-
-This link would show up in your Org-mode document as \"Google Search\",
-but really it would remove your entire home directory.
-Therefore we advise against setting this variable to nil.
-Just change it to `y-or-n-p' if you want to confirm with a
-single keystroke rather than having to type \"yes\"."
- :group 'org-link-follow
- :type '(choice
- (const :tag "with yes-or-no (safer)" yes-or-no-p)
- (const :tag "with y-or-n (faster)" y-or-n-p)
- (const :tag "no confirmation (dangerous)" nil)))
-(put 'org-confirm-shell-link-function
- 'safe-local-variable
- '(lambda (x) (member x '(yes-or-no-p y-or-n-p))))
-
-(defconst org-file-apps-defaults-gnu
- '((remote . emacs)
- (system . mailcap)
- (t . mailcap))
- "Default file applications on a UNIX or GNU/Linux system.
-See `org-file-apps'.")
-
-(defconst org-file-apps-defaults-macosx
- '((remote . emacs)
- (t . "open %s")
- (system . "open %s")
- ("ps.gz" . "gv %s")
- ("eps.gz" . "gv %s")
- ("dvi" . "xdvi %s")
- ("fig" . "xfig %s"))
- "Default file applications on a MacOS X system.
-The system \"open\" is known as a default, but we use X11 applications
-for some files for which the OS does not have a good default.
-See `org-file-apps'.")
-
-(defconst org-file-apps-defaults-windowsnt
- (list
- '(remote . emacs)
- (cons t
- (list (if (featurep 'xemacs)
- 'mswindows-shell-execute
- 'w32-shell-execute)
- "open" 'file))
- (cons 'system
- (list (if (featurep 'xemacs)
- 'mswindows-shell-execute
- 'w32-shell-execute)
- "open" 'file)))
- "Default file applications on a Windows NT system.
-The system \"open\" is used for most files.
-See `org-file-apps'.")
-
-(defcustom org-file-apps
- '(
- (auto-mode . emacs)
- ("\\.mm\\'" . default)
- ("\\.x?html?\\'" . default)
- ("\\.pdf\\'" . default)
- )
- "External applications for opening `file:path' items in a document.
-Org-mode uses system defaults for different file types, but
-you can use this variable to set the application for a given file
-extension. The entries in this list are cons cells where the car identifies
-files and the cdr the corresponding command. Possible values for the
-file identifier are
- \"string\" A string as a file identifier can be interpreted in different
- ways, depending on its contents:
-
- - Alphanumeric characters only:
- Match links with this file extension.
- Example: (\"pdf\" . \"evince %s\")
- to open PDFs with evince.
-
- - Regular expression: Match links where the
- filename matches the regexp. If you want to
- use groups here, use shy groups.
-
- Example: (\"\\.x?html\\'\" . \"firefox %s\")
- (\"\\(?:xhtml\\|html\\)\" . \"firefox %s\")
- to open *.html and *.xhtml with firefox.
-
- - Regular expression which contains (non-shy) groups:
- Match links where the whole link, including \"::\", and
- anything after that, matches the regexp.
- In a custom command string, %1, %2, etc. are replaced with
- the parts of the link that were matched by the groups.
- For backwards compatibility, if a command string is given
- that does not use any of the group matches, this case is
- handled identically to the second one (i.e. match against
- file name only).
- In a custom lisp form, you can access the group matches with
- (match-string n link).
-
- Example: (\"\\.pdf::\\(\\d+\\)\\'\" . \"evince -p %1 %s\")
- to open [[file:document.pdf::5]] with evince at page 5.
-
- `directory' Matches a directory
- `remote' Matches a remote file, accessible through tramp or efs.
- Remote files most likely should be visited through Emacs
- because external applications cannot handle such paths.
-`auto-mode' Matches files that are matched by any entry in `auto-mode-alist',
- so all files Emacs knows how to handle. Using this with
- command `emacs' will open most files in Emacs. Beware that this
- will also open html files inside Emacs, unless you add
- (\"html\" . default) to the list as well.
- t Default for files not matched by any of the other options.
- `system' The system command to open files, like `open' on Windows
- and Mac OS X, and mailcap under GNU/Linux. This is the command
- that will be selected if you call `C-c C-o' with a double
- \\[universal-argument] \\[universal-argument] prefix.
-
-Possible values for the command are:
- `emacs' The file will be visited by the current Emacs process.
- `default' Use the default application for this file type, which is the
- association for t in the list, most likely in the system-specific
- part.
- This can be used to overrule an unwanted setting in the
- system-specific variable.
- `system' Use the system command for opening files, like \"open\".
- This command is specified by the entry whose car is `system'.
- Most likely, the system-specific version of this variable
- does define this command, but you can overrule/replace it
- here.
- string A command to be executed by a shell; %s will be replaced
- by the path to the file.
- sexp A Lisp form which will be evaluated. The file path will
- be available in the Lisp variable `file'.
-For more examples, see the system specific constants
-`org-file-apps-defaults-macosx'
-`org-file-apps-defaults-windowsnt'
-`org-file-apps-defaults-gnu'."
- :group 'org-link-follow
- :type '(repeat
- (cons (choice :value ""
- (string :tag "Extension")
- (const :tag "System command to open files" system)
- (const :tag "Default for unrecognized files" t)
- (const :tag "Remote file" remote)
- (const :tag "Links to a directory" directory)
- (const :tag "Any files that have Emacs modes"
- auto-mode))
- (choice :value ""
- (const :tag "Visit with Emacs" emacs)
- (const :tag "Use default" default)
- (const :tag "Use the system command" system)
- (string :tag "Command")
- (sexp :tag "Lisp form")))))
-
-
-
-(defgroup org-refile nil
- "Options concerning refiling entries in Org-mode."
- :tag "Org Refile"
- :group 'org)
-
-(defcustom org-directory "~/org"
- "Directory with org files.
-This is just a default location to look for Org files. There is no need
-at all to put your files into this directory. It is only used in the
-following situations:
-
-1. When a remember template specifies a target file that is not an
- absolute path. The path will then be interpreted relative to
- `org-directory'
-2. When a remember note is filed away in an interactive way (when exiting the
- note buffer with `C-1 C-c C-c'. The user is prompted for an org file,
- with `org-directory' as the default path."
- :group 'org-refile
- :group 'org-remember
- :type 'directory)
-
-(defcustom org-default-notes-file (convert-standard-filename "~/.notes")
- "Default target for storing notes.
-Used as a fall back file for org-remember.el and org-capture.el, for
-templates that do not specify a target file."
- :group 'org-refile
- :group 'org-remember
- :type '(choice
- (const :tag "Default from remember-data-file" nil)
- file))
-
-(defcustom org-goto-interface 'outline
- "The default interface to be used for `org-goto'.
-Allowed values are:
-outline The interface shows an outline of the relevant file
- and the correct heading is found by moving through
- the outline or by searching with incremental search.
-outline-path-completion Headlines in the current buffer are offered via
- completion. This is the interface also used by
- the refile command."
- :group 'org-refile
- :type '(choice
- (const :tag "Outline" outline)
- (const :tag "Outline-path-completion" outline-path-completion)))
-
-(defcustom org-goto-max-level 5
- "Maximum target level when running `org-goto' with refile interface."
- :group 'org-refile
- :type 'integer)
-
-(defcustom org-reverse-note-order nil
- "Non-nil means store new notes at the beginning of a file or entry.
-When nil, new notes will be filed to the end of a file or entry.
-This can also be a list with cons cells of regular expressions that
-are matched against file names, and values."
- :group 'org-remember
- :group 'org-refile
- :type '(choice
- (const :tag "Reverse always" t)
- (const :tag "Reverse never" nil)
- (repeat :tag "By file name regexp"
- (cons regexp boolean))))
-
-(defcustom org-log-refile nil
- "Information to record when a task is refiled.
-
-Possible values are:
-
-nil Don't add anything
-time Add a time stamp to the task
-note Prompt for a note and add it with template `org-log-note-headings'
-
-This option can also be set with on a per-file-basis with
-
- #+STARTUP: nologrefile
- #+STARTUP: logrefile
- #+STARTUP: lognoterefile
-
-You can have local logging settings for a subtree by setting the LOGGING
-property to one or more of these keywords.
-
-When bulk-refiling from the agenda, the value `note' is forbidden and
-will temporarily be changed to `time'."
- :group 'org-refile
- :group 'org-progress
- :type '(choice
- (const :tag "No logging" nil)
- (const :tag "Record timestamp" time)
- (const :tag "Record timestamp with note." note)))
-
-(defcustom org-refile-targets nil
- "Targets for refiling entries with \\[org-refile].
-This is list of cons cells. Each cell contains:
-- a specification of the files to be considered, either a list of files,
- or a symbol whose function or variable value will be used to retrieve
- a file name or a list of file names. If you use `org-agenda-files' for
- that, all agenda files will be scanned for targets. Nil means consider
- headings in the current buffer.
-- A specification of how to find candidate refile targets. This may be
- any of:
- - a cons cell (:tag . \"TAG\") to identify refile targets by a tag.
- This tag has to be present in all target headlines, inheritance will
- not be considered.
- - a cons cell (:todo . \"KEYWORD\") to identify refile targets by
- todo keyword.
- - a cons cell (:regexp . \"REGEXP\") with a regular expression matching
- headlines that are refiling targets.
- - a cons cell (:level . N). Any headline of level N is considered a target.
- Note that, when `org-odd-levels-only' is set, level corresponds to
- order in hierarchy, not to the number of stars.
- - a cons cell (:maxlevel . N). Any headline with level <= N is a target.
- Note that, when `org-odd-levels-only' is set, level corresponds to
- order in hierarchy, not to the number of stars.
-
-You can set the variable `org-refile-target-verify-function' to a function
-to verify each headline found by the simple criteria above.
-
-When this variable is nil, all top-level headlines in the current buffer
-are used, equivalent to the value `((nil . (:level . 1))'."
- :group 'org-refile
- :type '(repeat
- (cons
- (choice :value org-agenda-files
- (const :tag "All agenda files" org-agenda-files)
- (const :tag "Current buffer" nil)
- (function) (variable) (file))
- (choice :tag "Identify target headline by"
- (cons :tag "Specific tag" (const :value :tag) (string))
- (cons :tag "TODO keyword" (const :value :todo) (string))
- (cons :tag "Regular expression" (const :value :regexp) (regexp))
- (cons :tag "Level number" (const :value :level) (integer))
- (cons :tag "Max Level number" (const :value :maxlevel) (integer))))))
-
-(defcustom org-refile-target-verify-function nil
- "Function to verify if the headline at point should be a refile target.
-The function will be called without arguments, with point at the
-beginning of the headline. It should return t and leave point
-where it is if the headline is a valid target for refiling.
-
-If the target should not be selected, the function must return nil.
-In addition to this, it may move point to a place from where the search
-should be continued. For example, the function may decide that the entire
-subtree of the current entry should be excluded and move point to the end
-of the subtree."
- :group 'org-refile
- :type 'function)
-
-(defcustom org-refile-use-cache nil
- "Non-nil means cache refile targets to speed up the process.
-The cache for a particular file will be updated automatically when
-the buffer has been killed, or when any of the marker used for flagging
-refile targets no longer points at a live buffer.
-If you have added new entries to a buffer that might themselves be targets,
-you need to clear the cache manually by pressing `C-0 C-c C-w' or, if you
-find that easier, `C-u C-u C-u C-c C-w'."
- :group 'org-refile
- :type 'boolean)
-
-(defcustom org-refile-use-outline-path nil
- "Non-nil means provide refile targets as paths.
-So a level 3 headline will be available as level1/level2/level3.
-
-When the value is `file', also include the file name (without directory)
-into the path. In this case, you can also stop the completion after
-the file name, to get entries inserted as top level in the file.
-
- When `full-file-path', include the full file path."
- :group 'org-refile
- :type '(choice
- (const :tag "Not" nil)
- (const :tag "Yes" t)
- (const :tag "Start with file name" file)
- (const :tag "Start with full file path" full-file-path)))
-
-(defcustom org-outline-path-complete-in-steps t
- "Non-nil means complete the outline path in hierarchical steps.
-When Org-mode uses the refile interface to select an outline path
-\(see variable `org-refile-use-outline-path'), the completion of
-the path can be done is a single go, or if can be done in steps down
-the headline hierarchy. Going in steps is probably the best if you
-do not use a special completion package like `ido' or `icicles'.
-However, when using these packages, going in one step can be very
-fast, while still showing the whole path to the entry."
- :group 'org-refile
- :type 'boolean)
-
-(defcustom org-refile-allow-creating-parent-nodes nil
- "Non-nil means allow to create new nodes as refile targets.
-New nodes are then created by adding \"/new node name\" to the completion
-of an existing node. When the value of this variable is `confirm',
-new node creation must be confirmed by the user (recommended)
-When nil, the completion must match an existing entry.
-
-Note that, if the new heading is not seen by the criteria
-listed in `org-refile-targets', multiple instances of the same
-heading would be created by trying again to file under the new
-heading."
- :group 'org-refile
- :type '(choice
- (const :tag "Never" nil)
- (const :tag "Always" t)
- (const :tag "Prompt for confirmation" confirm)))
-
-(defgroup org-todo nil
- "Options concerning TODO items in Org-mode."
- :tag "Org TODO"
- :group 'org)
-
-(defgroup org-progress nil
- "Options concerning Progress logging in Org-mode."
- :tag "Org Progress"
- :group 'org-time)
-
-(defvar org-todo-interpretation-widgets
- '(
- (:tag "Sequence (cycling hits every state)" sequence)
- (:tag "Type (cycling directly to DONE)" type))
- "The available interpretation symbols for customizing `org-todo-keywords'.
-Interested libraries should add to this list.")
-
-(defcustom org-todo-keywords '((sequence "TODO" "DONE"))
- "List of TODO entry keyword sequences and their interpretation.
-\\<org-mode-map>This is a list of sequences.
-
-Each sequence starts with a symbol, either `sequence' or `type',
-indicating if the keywords should be interpreted as a sequence of
-action steps, or as different types of TODO items. The first
-keywords are states requiring action - these states will select a headline
-for inclusion into the global TODO list Org-mode produces. If one of
-the \"keywords\" is the vertical bar, \"|\", the remaining keywords
-signify that no further action is necessary. If \"|\" is not found,
-the last keyword is treated as the only DONE state of the sequence.
-
-The command \\[org-todo] cycles an entry through these states, and one
-additional state where no keyword is present. For details about this
-cycling, see the manual.
-
-TODO keywords and interpretation can also be set on a per-file basis with
-the special #+SEQ_TODO and #+TYP_TODO lines.
-
-Each keyword can optionally specify a character for fast state selection
-\(in combination with the variable `org-use-fast-todo-selection')
-and specifiers for state change logging, using the same syntax
-that is used in the \"#+TODO:\" lines. For example, \"WAIT(w)\" says
-that the WAIT state can be selected with the \"w\" key. \"WAIT(w!)\"
-indicates to record a time stamp each time this state is selected.
-
-Each keyword may also specify if a timestamp or a note should be
-recorded when entering or leaving the state, by adding additional
-characters in the parenthesis after the keyword. This looks like this:
-\"WAIT(w@/!)\". \"@\" means to add a note (with time), \"!\" means to
-record only the time of the state change. With X and Y being either
-\"@\" or \"!\", \"X/Y\" means use X when entering the state, and use
-Y when leaving the state if and only if the *target* state does not
-define X. You may omit any of the fast-selection key or X or /Y,
-so WAIT(w@), WAIT(w/@) and WAIT(@/@) are all valid.
-
-For backward compatibility, this variable may also be just a list
-of keywords - in this case the interpretation (sequence or type) will be
-taken from the (otherwise obsolete) variable `org-todo-interpretation'."
- :group 'org-todo
- :group 'org-keywords
- :type '(choice
- (repeat :tag "Old syntax, just keywords"
- (string :tag "Keyword"))
- (repeat :tag "New syntax"
- (cons
- (choice
- :tag "Interpretation"
- ;;Quick and dirty way to see
- ;;`org-todo-interpretations'. This takes the
- ;;place of item arguments
- :convert-widget
- (lambda (widget)
- (widget-put widget
- :args (mapcar
- #'(lambda (x)
- (widget-convert
- (cons 'const x)))
- org-todo-interpretation-widgets))
- widget))
- (repeat
- (string :tag "Keyword"))))))
-
-(defvar org-todo-keywords-1 nil
- "All TODO and DONE keywords active in a buffer.")
-(make-variable-buffer-local 'org-todo-keywords-1)
-(defvar org-todo-keywords-for-agenda nil)
-(defvar org-done-keywords-for-agenda nil)
-(defvar org-drawers-for-agenda nil)
-(defvar org-todo-keyword-alist-for-agenda nil)
-(defvar org-tag-alist-for-agenda nil)
-(defvar org-agenda-contributing-files nil)
-(defvar org-not-done-keywords nil)
-(make-variable-buffer-local 'org-not-done-keywords)
-(defvar org-done-keywords nil)
-(make-variable-buffer-local 'org-done-keywords)
-(defvar org-todo-heads nil)
-(make-variable-buffer-local 'org-todo-heads)
-(defvar org-todo-sets nil)
-(make-variable-buffer-local 'org-todo-sets)
-(defvar org-todo-log-states nil)
-(make-variable-buffer-local 'org-todo-log-states)
-(defvar org-todo-kwd-alist nil)
-(make-variable-buffer-local 'org-todo-kwd-alist)
-(defvar org-todo-key-alist nil)
-(make-variable-buffer-local 'org-todo-key-alist)
-(defvar org-todo-key-trigger nil)
-(make-variable-buffer-local 'org-todo-key-trigger)
-
-(defcustom org-todo-interpretation 'sequence
- "Controls how TODO keywords are interpreted.
-This variable is in principle obsolete and is only used for
-backward compatibility, if the interpretation of todo keywords is
-not given already in `org-todo-keywords'. See that variable for
-more information."
- :group 'org-todo
- :group 'org-keywords
- :type '(choice (const sequence)
- (const type)))
-
-(defcustom org-use-fast-todo-selection t
- "Non-nil means use the fast todo selection scheme with C-c C-t.
-This variable describes if and under what circumstances the cycling
-mechanism for TODO keywords will be replaced by a single-key, direct
-selection scheme.
-
-When nil, fast selection is never used.
-
-When the symbol `prefix', it will be used when `org-todo' is called with
-a prefix argument, i.e. `C-u C-c C-t' in an Org-mode buffer, and `C-u t'
-in an agenda buffer.
-
-When t, fast selection is used by default. In this case, the prefix
-argument forces cycling instead.
-
-In all cases, the special interface is only used if access keys have actually
-been assigned by the user, i.e. if keywords in the configuration are followed
-by a letter in parenthesis, like TODO(t)."
- :group 'org-todo
- :type '(choice
- (const :tag "Never" nil)
- (const :tag "By default" t)
- (const :tag "Only with C-u C-c C-t" prefix)))
-
-(defcustom org-provide-todo-statistics t
- "Non-nil means update todo statistics after insert and toggle.
-ALL-HEADLINES means update todo statistics by including headlines
-with no TODO keyword as well, counting them as not done.
-A list of TODO keywords means the same, but skip keywords that are
-not in this list.
-
-When this is set, todo statistics is updated in the parent of the
-current entry each time a todo state is changed."
- :group 'org-todo
- :type '(choice
- (const :tag "Yes, only for TODO entries" t)
- (const :tag "Yes, including all entries" 'all-headlines)
- (repeat :tag "Yes, for TODOs in this list"
- (string :tag "TODO keyword"))
- (other :tag "No TODO statistics" nil)))
-
-(defcustom org-hierarchical-todo-statistics t
- "Non-nil means TODO statistics covers just direct children.
-When nil, all entries in the subtree are considered.
-This has only an effect if `org-provide-todo-statistics' is set.
-To set this to nil for only a single subtree, use a COOKIE_DATA
-property and include the word \"recursive\" into the value."
- :group 'org-todo
- :type 'boolean)
-
-(defcustom org-after-todo-state-change-hook nil
- "Hook which is run after the state of a TODO item was changed.
-The new state (a string with a TODO keyword, or nil) is available in the
-Lisp variable `state'."
- :group 'org-todo
- :type 'hook)
-
-(defvar org-blocker-hook nil
- "Hook for functions that are allowed to block a state change.
-
-Each function gets as its single argument a property list, see
-`org-trigger-hook' for more information about this list.
-
-If any of the functions in this hook returns nil, the state change
-is blocked.")
-
-(defvar org-trigger-hook nil
- "Hook for functions that are triggered by a state change.
-
-Each function gets as its single argument a property list with at least
-the following elements:
-
- (:type type-of-change :position pos-at-entry-start
- :from old-state :to new-state)
-
-Depending on the type, more properties may be present.
-
-This mechanism is currently implemented for:
-
-TODO state changes
-------------------
-:type todo-state-change
-:from previous state (keyword as a string), or nil, or a symbol
- 'todo' or 'done', to indicate the general type of state.
-:to new state, like in :from")
-
-(defcustom org-enforce-todo-dependencies nil
- "Non-nil means undone TODO entries will block switching the parent to DONE.
-Also, if a parent has an :ORDERED: property, switching an entry to DONE will
-be blocked if any prior sibling is not yet done.
-Finally, if the parent is blocked because of ordered siblings of its own,
-the child will also be blocked.
-This variable needs to be set before org.el is loaded, and you need to
-restart Emacs after a change to make the change effective. The only way
-to change is while Emacs is running is through the customize interface."
- :set (lambda (var val)
- (set var val)
- (if val
- (add-hook 'org-blocker-hook
- 'org-block-todo-from-children-or-siblings-or-parent)
- (remove-hook 'org-blocker-hook
- 'org-block-todo-from-children-or-siblings-or-parent)))
- :group 'org-todo
- :type 'boolean)
-
-(defcustom org-enforce-todo-checkbox-dependencies nil
- "Non-nil means unchecked boxes will block switching the parent to DONE.
-When this is nil, checkboxes have no influence on switching TODO states.
-When non-nil, you first need to check off all check boxes before the TODO
-entry can be switched to DONE.
-This variable needs to be set before org.el is loaded, and you need to
-restart Emacs after a change to make the change effective. The only way
-to change is while Emacs is running is through the customize interface."
- :set (lambda (var val)
- (set var val)
- (if val
- (add-hook 'org-blocker-hook
- 'org-block-todo-from-checkboxes)
- (remove-hook 'org-blocker-hook
- 'org-block-todo-from-checkboxes)))
- :group 'org-todo
- :type 'boolean)
-
-(defcustom org-treat-insert-todo-heading-as-state-change nil
- "Non-nil means inserting a TODO heading is treated as state change.
-So when the command \\[org-insert-todo-heading] is used, state change
-logging will apply if appropriate. When nil, the new TODO item will
-be inserted directly, and no logging will take place."
- :group 'org-todo
- :type 'boolean)
-
-(defcustom org-treat-S-cursor-todo-selection-as-state-change t
- "Non-nil means switching TODO states with S-cursor counts as state change.
-This is the default behavior. However, setting this to nil allows a
-convenient way to select a TODO state and bypass any logging associated
-with that."
- :group 'org-todo
- :type 'boolean)
-
-(defcustom org-todo-state-tags-triggers nil
- "Tag changes that should be triggered by TODO state changes.
-This is a list. Each entry is
-
- (state-change (tag . flag) .......)
-
-State-change can be a string with a state, and empty string to indicate the
-state that has no TODO keyword, or it can be one of the symbols `todo'
-or `done', meaning any not-done or done state, respectively."
- :group 'org-todo
- :group 'org-tags
- :type '(repeat
- (cons (choice :tag "When changing to"
- (const :tag "Not-done state" todo)
- (const :tag "Done state" done)
- (string :tag "State"))
- (repeat
- (cons :tag "Tag action"
- (string :tag "Tag")
- (choice (const :tag "Add" t) (const :tag "Remove" nil)))))))
-
-(defcustom org-log-done nil
- "Information to record when a task moves to the DONE state.
-
-Possible values are:
-
-nil Don't add anything, just change the keyword
-time Add a time stamp to the task
-note Prompt for a note and add it with template `org-log-note-headings'
-
-This option can also be set with on a per-file-basis with
-
- #+STARTUP: nologdone
- #+STARTUP: logdone
- #+STARTUP: lognotedone
-
-You can have local logging settings for a subtree by setting the LOGGING
-property to one or more of these keywords."
- :group 'org-todo
- :group 'org-progress
- :type '(choice
- (const :tag "No logging" nil)
- (const :tag "Record CLOSED timestamp" time)
- (const :tag "Record CLOSED timestamp with note." note)))
-
-;; Normalize old uses of org-log-done.
-(cond
- ((eq org-log-done t) (setq org-log-done 'time))
- ((and (listp org-log-done) (memq 'done org-log-done))
- (setq org-log-done 'note)))
-
-(defcustom org-log-reschedule nil
- "Information to record when the scheduling date of a tasks is modified.
-
-Possible values are:
-
-nil Don't add anything, just change the date
-time Add a time stamp to the task
-note Prompt for a note and add it with template `org-log-note-headings'
-
-This option can also be set with on a per-file-basis with
-
- #+STARTUP: nologreschedule
- #+STARTUP: logreschedule
- #+STARTUP: lognotereschedule"
- :group 'org-todo
- :group 'org-progress
- :type '(choice
- (const :tag "No logging" nil)
- (const :tag "Record timestamp" time)
- (const :tag "Record timestamp with note." note)))
-
-(defcustom org-log-redeadline nil
- "Information to record when the deadline date of a tasks is modified.
-
-Possible values are:
-
-nil Don't add anything, just change the date
-time Add a time stamp to the task
-note Prompt for a note and add it with template `org-log-note-headings'
-
-This option can also be set with on a per-file-basis with
-
- #+STARTUP: nologredeadline
- #+STARTUP: logredeadline
- #+STARTUP: lognoteredeadline
-
-You can have local logging settings for a subtree by setting the LOGGING
-property to one or more of these keywords."
- :group 'org-todo
- :group 'org-progress
- :type '(choice
- (const :tag "No logging" nil)
- (const :tag "Record timestamp" time)
- (const :tag "Record timestamp with note." note)))
-
-(defcustom org-log-note-clock-out nil
- "Non-nil means record a note when clocking out of an item.
-This can also be configured on a per-file basis by adding one of
-the following lines anywhere in the buffer:
-
- #+STARTUP: lognoteclock-out
- #+STARTUP: nolognoteclock-out"
- :group 'org-todo
- :group 'org-progress
- :type 'boolean)
-
-(defcustom org-log-done-with-time t
- "Non-nil means the CLOSED time stamp will contain date and time.
-When nil, only the date will be recorded."
- :group 'org-progress
- :type 'boolean)
-
-(defcustom org-log-note-headings
- '((done . "CLOSING NOTE %t")
- (state . "State %-12s from %-12S %t")
- (note . "Note taken on %t")
- (reschedule . "Rescheduled from %S on %t")
- (delschedule . "Not scheduled, was %S on %t")
- (redeadline . "New deadline from %S on %t")
- (deldeadline . "Removed deadline, was %S on %t")
- (refile . "Refiled on %t")
- (clock-out . ""))
- "Headings for notes added to entries.
-The value is an alist, with the car being a symbol indicating the note
-context, and the cdr is the heading to be used. The heading may also be the
-empty string.
-%t in the heading will be replaced by a time stamp.
-%T will be an active time stamp instead the default inactive one
-%s will be replaced by the new TODO state, in double quotes.
-%S will be replaced by the old TODO state, in double quotes.
-%u will be replaced by the user name.
-%U will be replaced by the full user name.
-
-In fact, it is not a good idea to change the `state' entry, because
-agenda log mode depends on the format of these entries."
- :group 'org-todo
- :group 'org-progress
- :type '(list :greedy t
- (cons (const :tag "Heading when closing an item" done) string)
- (cons (const :tag
- "Heading when changing todo state (todo sequence only)"
- state) string)
- (cons (const :tag "Heading when just taking a note" note) string)
- (cons (const :tag "Heading when clocking out" clock-out) string)
- (cons (const :tag "Heading when an item is no longer scheduled" delschedule) string)
- (cons (const :tag "Heading when rescheduling" reschedule) string)
- (cons (const :tag "Heading when changing deadline" redeadline) string)
- (cons (const :tag "Heading when deleting a deadline" deldeadline) string)
- (cons (const :tag "Heading when refiling" refile) string)))
-
-(unless (assq 'note org-log-note-headings)
- (push '(note . "%t") org-log-note-headings))
-
-(defcustom org-log-into-drawer nil
- "Non-nil means insert state change notes and time stamps into a drawer.
-When nil, state changes notes will be inserted after the headline and
-any scheduling and clock lines, but not inside a drawer.
-
-The value of this variable should be the name of the drawer to use.
-LOGBOOK is proposed at the default drawer for this purpose, you can
-also set this to a string to define the drawer of your choice.
-
-A value of t is also allowed, representing \"LOGBOOK\".
-
-If this variable is set, `org-log-state-notes-insert-after-drawers'
-will be ignored.
-
-You can set the property LOG_INTO_DRAWER to overrule this setting for
-a subtree."
- :group 'org-todo
- :group 'org-progress
- :type '(choice
- (const :tag "Not into a drawer" nil)
- (const :tag "LOGBOOK" t)
- (string :tag "Other")))
-
-(if (fboundp 'defvaralias)
- (defvaralias 'org-log-state-notes-into-drawer 'org-log-into-drawer))
-
-(defun org-log-into-drawer ()
- "Return the value of `org-log-into-drawer', but let properties overrule.
-If the current entry has or inherits a LOG_INTO_DRAWER property, it will be
-used instead of the default value."
- (let ((p (ignore-errors (org-entry-get nil "LOG_INTO_DRAWER" 'inherit))))
- (cond
- ((or (not p) (equal p "nil")) org-log-into-drawer)
- ((equal p "t") "LOGBOOK")
- (t p))))
-
-(defcustom org-log-state-notes-insert-after-drawers nil
- "Non-nil means insert state change notes after any drawers in entry.
-Only the drawers that *immediately* follow the headline and the
-deadline/scheduled line are skipped.
-When nil, insert notes right after the heading and perhaps the line
-with deadline/scheduling if present.
-
-This variable will have no effect if `org-log-into-drawer' is
-set."
- :group 'org-todo
- :group 'org-progress
- :type 'boolean)
-
-(defcustom org-log-states-order-reversed t
- "Non-nil means the latest state note will be directly after heading.
-When nil, the state change notes will be ordered according to time."
- :group 'org-todo
- :group 'org-progress
- :type 'boolean)
-
-(defcustom org-todo-repeat-to-state nil
- "The TODO state to which a repeater should return the repeating task.
-By default this is the first task in a TODO sequence, or the previous state
-in a TODO_TYP set. But you can specify another task here.
-alternatively, set the :REPEAT_TO_STATE: property of the entry."
- :group 'org-todo
- :type '(choice (const :tag "Head of sequence" nil)
- (string :tag "Specific state")))
-
-(defcustom org-log-repeat 'time
- "Non-nil means record moving through the DONE state when triggering repeat.
-An auto-repeating task is immediately switched back to TODO when
-marked DONE. If you are not logging state changes (by adding \"@\"
-or \"!\" to the TODO keyword definition), or set `org-log-done' to
-record a closing note, there will be no record of the task moving
-through DONE. This variable forces taking a note anyway.
-
-nil Don't force a record
-time Record a time stamp
-note Record a note
-
-This option can also be set with on a per-file-basis with
-
- #+STARTUP: logrepeat
- #+STARTUP: lognoterepeat
- #+STARTUP: nologrepeat
-
-You can have local logging settings for a subtree by setting the LOGGING
-property to one or more of these keywords."
- :group 'org-todo
- :group 'org-progress
- :type '(choice
- (const :tag "Don't force a record" nil)
- (const :tag "Force recording the DONE state" time)
- (const :tag "Force recording a note with the DONE state" note)))
-
-
-(defgroup org-priorities nil
- "Priorities in Org-mode."
- :tag "Org Priorities"
- :group 'org-todo)
-
-(defcustom org-enable-priority-commands t
- "Non-nil means priority commands are active.
-When nil, these commands will be disabled, so that you never accidentally
-set a priority."
- :group 'org-priorities
- :type 'boolean)
-
-(defcustom org-highest-priority ?A
- "The highest priority of TODO items. A character like ?A, ?B etc.
-Must have a smaller ASCII number than `org-lowest-priority'."
- :group 'org-priorities
- :type 'character)
-
-(defcustom org-lowest-priority ?C
- "The lowest priority of TODO items. A character like ?A, ?B etc.
-Must have a larger ASCII number than `org-highest-priority'."
- :group 'org-priorities
- :type 'character)
-
-(defcustom org-default-priority ?B
- "The default priority of TODO items.
-This is the priority an item get if no explicit priority is given."
- :group 'org-priorities
- :type 'character)
-
-(defcustom org-priority-start-cycle-with-default t
- "Non-nil means start with default priority when starting to cycle.
-When this is nil, the first step in the cycle will be (depending on the
-command used) one higher or lower that the default priority."
- :group 'org-priorities
- :type 'boolean)
-
-(defcustom org-get-priority-function nil
- "Function to extract the priority from a string.
-The string is normally the headline. If this is nil Org computes the
-priority from the priority cookie like [#A] in the headline. It returns
-an integer, increasing by 1000 for each priority level.
-The user can set a different function here, which should take a string
-as an argument and return the numeric priority."
- :group 'org-priorities
- :type 'function)
-
-(defgroup org-time nil
- "Options concerning time stamps and deadlines in Org-mode."
- :tag "Org Time"
- :group 'org)
-
-(defcustom org-insert-labeled-timestamps-at-point nil
- "Non-nil means SCHEDULED and DEADLINE timestamps are inserted at point.
-When nil, these labeled time stamps are forces into the second line of an
-entry, just after the headline. When scheduling from the global TODO list,
-the time stamp will always be forced into the second line."
- :group 'org-time
- :type 'boolean)
-
-(defconst org-time-stamp-formats '("<%Y-%m-%d %a>" . "<%Y-%m-%d %a %H:%M>")
- "Formats for `format-time-string' which are used for time stamps.
-It is not recommended to change this constant.")
-
-(defcustom org-time-stamp-rounding-minutes '(0 5)
- "Number of minutes to round time stamps to.
-These are two values, the first applies when first creating a time stamp.
-The second applies when changing it with the commands `S-up' and `S-down'.
-When changing the time stamp, this means that it will change in steps
-of N minutes, as given by the second value.
-
-When a setting is 0 or 1, insert the time unmodified. Useful rounding
-numbers should be factors of 60, so for example 5, 10, 15.
-
-When this is larger than 1, you can still force an exact time stamp by using
-a double prefix argument to a time stamp command like `C-c .' or `C-c !',
-and by using a prefix arg to `S-up/down' to specify the exact number
-of minutes to shift."
- :group 'org-time
- :get '(lambda (var) ; Make sure both elements are there
- (if (integerp (default-value var))
- (list (default-value var) 5)
- (default-value var)))
- :type '(list
- (integer :tag "when inserting times")
- (integer :tag "when modifying times")))
-
-;; Normalize old customizations of this variable.
-(when (integerp org-time-stamp-rounding-minutes)
- (setq org-time-stamp-rounding-minutes
- (list org-time-stamp-rounding-minutes
- org-time-stamp-rounding-minutes)))
-
-(defcustom org-display-custom-times nil
- "Non-nil means overlay custom formats over all time stamps.
-The formats are defined through the variable `org-time-stamp-custom-formats'.
-To turn this on on a per-file basis, insert anywhere in the file:
- #+STARTUP: customtime"
- :group 'org-time
- :set 'set-default
- :type 'sexp)
-(make-variable-buffer-local 'org-display-custom-times)
-
-(defcustom org-time-stamp-custom-formats
- '("<%m/%d/%y %a>" . "<%m/%d/%y %a %H:%M>") ; american
- "Custom formats for time stamps. See `format-time-string' for the syntax.
-These are overlayed over the default ISO format if the variable
-`org-display-custom-times' is set. Time like %H:%M should be at the
-end of the second format. The custom formats are also honored by export
-commands, if custom time display is turned on at the time of export."
- :group 'org-time
- :type 'sexp)
-
-(defun org-time-stamp-format (&optional long inactive)
- "Get the right format for a time string."
- (let ((f (if long (cdr org-time-stamp-formats)
- (car org-time-stamp-formats))))
- (if inactive
- (concat "[" (substring f 1 -1) "]")
- f)))
-
-(defcustom org-time-clocksum-format "%d:%02d"
- "The format string used when creating CLOCKSUM lines.
-This is also used when org-mode generates a time duration."
- :group 'org-time
- :type 'string)
-
-(defcustom org-time-clocksum-use-fractional nil
- "If non-nil, \\[org-clock-display] uses fractional times.
-org-mode generates a time duration."
- :group 'org-time
- :type 'boolean)
-
-(defcustom org-time-clocksum-fractional-format "%.2f"
- "The format string used when creating CLOCKSUM lines, or when
-org-mode generates a time duration."
- :group 'org-time
- :type 'string)
-
-(defcustom org-deadline-warning-days 14
- "No. of days before expiration during which a deadline becomes active.
-This variable governs the display in sparse trees and in the agenda.
-When 0 or negative, it means use this number (the absolute value of it)
-even if a deadline has a different individual lead time specified.
-
-Custom commands can set this variable in the options section."
- :group 'org-time
- :group 'org-agenda-daily/weekly
- :type 'integer)
-
-(defcustom org-read-date-prefer-future t
- "Non-nil means assume future for incomplete date input from user.
-This affects the following situations:
-1. The user gives a month but not a year.
- For example, if it is April and you enter \"feb 2\", this will be read
- as Feb 2, *next* year. \"May 5\", however, will be this year.
-2. The user gives a day, but no month.
- For example, if today is the 15th, and you enter \"3\", Org-mode will
- read this as the third of *next* month. However, if you enter \"17\",
- it will be considered as *this* month.
-
-If you set this variable to the symbol `time', then also the following
-will work:
-
-3. If the user gives a time, but no day. If the time is before now,
- to will be interpreted as tomorrow.
-
-Currently none of this works for ISO week specifications.
-
-When this option is nil, the current day, month and year will always be
-used as defaults.
-
-See also `org-agenda-jump-prefer-future'."
- :group 'org-time
- :type '(choice
- (const :tag "Never" nil)
- (const :tag "Check month and day" t)
- (const :tag "Check month, day, and time" time)))
-
-(defcustom org-agenda-jump-prefer-future 'org-read-date-prefer-future
- "Should the agenda jump command prefer the future for incomplete dates?
-The default is to do the same as configured in `org-read-date-prefer-future'.
-But you can alse set a deviating value here.
-This may t or nil, or the symbol `org-read-date-prefer-future'."
- :group 'org-agenda
- :group 'org-time
- :type '(choice
- (const :tag "Use org-read-date-prefer-future"
- org-read-date-prefer-future)
- (const :tag "Never" nil)
- (const :tag "Always" t)))
-
-(defcustom org-read-date-display-live t
- "Non-nil means display current interpretation of date prompt live.
-This display will be in an overlay, in the minibuffer."
- :group 'org-time
- :type 'boolean)
-
-(defcustom org-read-date-popup-calendar t
- "Non-nil means pop up a calendar when prompting for a date.
-In the calendar, the date can be selected with mouse-1. However, the
-minibuffer will also be active, and you can simply enter the date as well.
-When nil, only the minibuffer will be available."
- :group 'org-time
- :type 'boolean)
-(if (fboundp 'defvaralias)
- (defvaralias 'org-popup-calendar-for-date-prompt
- 'org-read-date-popup-calendar))
-
-(defcustom org-read-date-minibuffer-setup-hook nil
- "Hook to be used to set up keys for the date/time interface.
-Add key definitions to `minibuffer-local-map', which will be a temporary
-copy."
- :group 'org-time
- :type 'hook)
-
-(defcustom org-extend-today-until 0
- "The hour when your day really ends. Must be an integer.
-This has influence for the following applications:
-- When switching the agenda to \"today\". It it is still earlier than
- the time given here, the day recognized as TODAY is actually yesterday.
-- When a date is read from the user and it is still before the time given
- here, the current date and time will be assumed to be yesterday, 23:59.
- Also, timestamps inserted in remember templates follow this rule.
-
-IMPORTANT: This is a feature whose implementation is and likely will
-remain incomplete. Really, it is only here because past midnight seems to
-be the favorite working time of John Wiegley :-)"
- :group 'org-time
- :type 'integer)
-
-(defcustom org-edit-timestamp-down-means-later nil
- "Non-nil means S-down will increase the time in a time stamp.
-When nil, S-up will increase."
- :group 'org-time
- :type 'boolean)
-
-(defcustom org-calendar-follow-timestamp-change t
- "Non-nil means make the calendar window follow timestamp changes.
-When a timestamp is modified and the calendar window is visible, it will be
-moved to the new date."
- :group 'org-time
- :type 'boolean)
-
-(defgroup org-tags nil
- "Options concerning tags in Org-mode."
- :tag "Org Tags"
- :group 'org)
-
-(defcustom org-tag-alist nil
- "List of tags allowed in Org-mode files.
-When this list is nil, Org-mode will base TAG input on what is already in the
-buffer.
-The value of this variable is an alist, the car of each entry must be a
-keyword as a string, the cdr may be a character that is used to select
-that tag through the fast-tag-selection interface.
-See the manual for details."
- :group 'org-tags
- :type '(repeat
- (choice
- (cons (string :tag "Tag name")
- (character :tag "Access char"))
- (list :tag "Start radio group"
- (const :startgroup)
- (option (string :tag "Group description")))
- (list :tag "End radio group"
- (const :endgroup)
- (option (string :tag "Group description")))
- (const :tag "New line" (:newline)))))
-
-(defcustom org-tag-persistent-alist nil
- "List of tags that will always appear in all Org-mode files.
-This is in addition to any in buffer settings or customizations
-of `org-tag-alist'.
-When this list is nil, Org-mode will base TAG input on `org-tag-alist'.
-The value of this variable is an alist, the car of each entry must be a
-keyword as a string, the cdr may be a character that is used to select
-that tag through the fast-tag-selection interface.
-See the manual for details.
-To disable these tags on a per-file basis, insert anywhere in the file:
- #+STARTUP: noptag"
- :group 'org-tags
- :type '(repeat
- (choice
- (cons (string :tag "Tag name")
- (character :tag "Access char"))
- (const :tag "Start radio group" (:startgroup))
- (const :tag "End radio group" (:endgroup))
- (const :tag "New line" (:newline)))))
-
-(defcustom org-complete-tags-always-offer-all-agenda-tags nil
- "If non-nil, always offer completion for all tags of all agenda files.
-Instead of customizing this variable directly, you might want to
-set it locally for capture buffers, because there no list of
-tags in that file can be created dynamically (there are none).
-
- (add-hook 'org-capture-mode-hook
- (lambda ()
- (set (make-local-variable
- 'org-complete-tags-always-offer-all-agenda-tags)
- t)))"
- :group 'org-tags
- :type 'boolean)
-
-(defvar org-file-tags nil
- "List of tags that can be inherited by all entries in the file.
-The tags will be inherited if the variable `org-use-tag-inheritance'
-says they should be.
-This variable is populated from #+FILETAGS lines.")
-
-(defcustom org-use-fast-tag-selection 'auto
- "Non-nil means use fast tag selection scheme.
-This is a special interface to select and deselect tags with single keys.
-When nil, fast selection is never used.
-When the symbol `auto', fast selection is used if and only if selection
-characters for tags have been configured, either through the variable
-`org-tag-alist' or through a #+TAGS line in the buffer.
-When t, fast selection is always used and selection keys are assigned
-automatically if necessary."
- :group 'org-tags
- :type '(choice
- (const :tag "Always" t)
- (const :tag "Never" nil)
- (const :tag "When selection characters are configured" 'auto)))
-
-(defcustom org-fast-tag-selection-single-key nil
- "Non-nil means fast tag selection exits after first change.
-When nil, you have to press RET to exit it.
-During fast tag selection, you can toggle this flag with `C-c'.
-This variable can also have the value `expert'. In this case, the window
-displaying the tags menu is not even shown, until you press C-c again."
- :group 'org-tags
- :type '(choice
- (const :tag "No" nil)
- (const :tag "Yes" t)
- (const :tag "Expert" expert)))
-
-(defvar org-fast-tag-selection-include-todo nil
- "Non-nil means fast tags selection interface will also offer TODO states.
-This is an undocumented feature, you should not rely on it.")
-
-(defcustom org-tags-column (if (featurep 'xemacs) -76 -77)
- "The column to which tags should be indented in a headline.
-If this number is positive, it specifies the column. If it is negative,
-it means that the tags should be flushright to that column. For example,
--80 works well for a normal 80 character screen."
- :group 'org-tags
- :type 'integer)
-
-(defcustom org-auto-align-tags t
- "Non-nil means realign tags after pro/demotion of TODO state change.
-These operations change the length of a headline and therefore shift
-the tags around. With this options turned on, after each such operation
-the tags are again aligned to `org-tags-column'."
- :group 'org-tags
- :type 'boolean)
-
-(defcustom org-use-tag-inheritance t
- "Non-nil means tags in levels apply also for sublevels.
-When nil, only the tags directly given in a specific line apply there.
-This may also be a list of tags that should be inherited, or a regexp that
-matches tags that should be inherited. Additional control is possible
-with the variable `org-tags-exclude-from-inheritance' which gives an
-explicit list of tags to be excluded from inheritance., even if the value of
-`org-use-tag-inheritance' would select it for inheritance.
-
-If this option is t, a match early-on in a tree can lead to a large
-number of matches in the subtree when constructing the agenda or creating
-a sparse tree. If you only want to see the first match in a tree during
-a search, check out the variable `org-tags-match-list-sublevels'."
- :group 'org-tags
- :type '(choice
- (const :tag "Not" nil)
- (const :tag "Always" t)
- (repeat :tag "Specific tags" (string :tag "Tag"))
- (regexp :tag "Tags matched by regexp")))
-
-(defcustom org-tags-exclude-from-inheritance nil
- "List of tags that should never be inherited.
-This is a way to exclude a few tags from inheritance. For way to do
-the opposite, to actively allow inheritance for selected tags,
-see the variable `org-use-tag-inheritance'."
- :group 'org-tags
- :type '(repeat (string :tag "Tag")))
-
-(defun org-tag-inherit-p (tag)
- "Check if TAG is one that should be inherited."
- (cond
- ((member tag org-tags-exclude-from-inheritance) nil)
- ((eq org-use-tag-inheritance t) t)
- ((not org-use-tag-inheritance) nil)
- ((stringp org-use-tag-inheritance)
- (string-match org-use-tag-inheritance tag))
- ((listp org-use-tag-inheritance)
- (member tag org-use-tag-inheritance))
- (t (error "Invalid setting of `org-use-tag-inheritance'"))))
-
-(defcustom org-tags-match-list-sublevels t
- "Non-nil means list also sublevels of headlines matching a search.
-This variable applies to tags/property searches, and also to stuck
-projects because this search is based on a tags match as well.
-
-When set to the symbol `indented', sublevels are indented with
-leading dots.
-
-Because of tag inheritance (see variable `org-use-tag-inheritance'),
-the sublevels of a headline matching a tag search often also match
-the same search. Listing all of them can create very long lists.
-Setting this variable to nil causes subtrees of a match to be skipped.
-
-This variable is semi-obsolete and probably should always be true. It
-is better to limit inheritance to certain tags using the variables
-`org-use-tag-inheritance' and `org-tags-exclude-from-inheritance'."
- :group 'org-tags
- :type '(choice
- (const :tag "No, don't list them" nil)
- (const :tag "Yes, do list them" t)
- (const :tag "List them, indented with leading dots" indented)))
-
-(defcustom org-tags-sort-function nil
- "When set, tags are sorted using this function as a comparator."
- :group 'org-tags
- :type '(choice
- (const :tag "No sorting" nil)
- (const :tag "Alphabetical" string<)
- (const :tag "Reverse alphabetical" string>)
- (function :tag "Custom function" nil)))
-
-(defvar org-tags-history nil
- "History of minibuffer reads for tags.")
-(defvar org-last-tags-completion-table nil
- "The last used completion table for tags.")
-(defvar org-after-tags-change-hook nil
- "Hook that is run after the tags in a line have changed.")
-
-(defgroup org-properties nil
- "Options concerning properties in Org-mode."
- :tag "Org Properties"
- :group 'org)
-
-(defcustom org-property-format "%-10s %s"
- "How property key/value pairs should be formatted by `indent-line'.
-When `indent-line' hits a property definition, it will format the line
-according to this format, mainly to make sure that the values are
-lined-up with respect to each other."
- :group 'org-properties
- :type 'string)
-
-(defcustom org-use-property-inheritance nil
- "Non-nil means properties apply also for sublevels.
-
-This setting is chiefly used during property searches. Turning it on can
-cause significant overhead when doing a search, which is why it is not
-on by default.
-
-When nil, only the properties directly given in the current entry count.
-When t, every property is inherited. The value may also be a list of
-properties that should have inheritance, or a regular expression matching
-properties that should be inherited.
-
-However, note that some special properties use inheritance under special
-circumstances (not in searches). Examples are CATEGORY, ARCHIVE, COLUMNS,
-and the properties ending in \"_ALL\" when they are used as descriptor
-for valid values of a property.
-
-Note for programmers:
-When querying an entry with `org-entry-get', you can control if inheritance
-should be used. By default, `org-entry-get' looks only at the local
-properties. You can request inheritance by setting the inherit argument
-to t (to force inheritance) or to `selective' (to respect the setting
-in this variable)."
- :group 'org-properties
- :type '(choice
- (const :tag "Not" nil)
- (const :tag "Always" t)
- (repeat :tag "Specific properties" (string :tag "Property"))
- (regexp :tag "Properties matched by regexp")))
-
-(defun org-property-inherit-p (property)
- "Check if PROPERTY is one that should be inherited."
- (cond
- ((eq org-use-property-inheritance t) t)
- ((not org-use-property-inheritance) nil)
- ((stringp org-use-property-inheritance)
- (string-match org-use-property-inheritance property))
- ((listp org-use-property-inheritance)
- (member property org-use-property-inheritance))
- (t (error "Invalid setting of `org-use-property-inheritance'"))))
-
-(defcustom org-columns-default-format "%25ITEM %TODO %3PRIORITY %TAGS"
- "The default column format, if no other format has been defined.
-This variable can be set on the per-file basis by inserting a line
-
-#+COLUMNS: %25ITEM ....."
- :group 'org-properties
- :type 'string)
-
-(defcustom org-columns-ellipses ".."
- "The ellipses to be used when a field in column view is truncated.
-When this is the empty string, as many characters as possible are shown,
-but then there will be no visual indication that the field has been truncated.
-When this is a string of length N, the last N characters of a truncated
-field are replaced by this string. If the column is narrower than the
-ellipses string, only part of the ellipses string will be shown."
- :group 'org-properties
- :type 'string)
-
-(defcustom org-columns-modify-value-for-display-function nil
- "Function that modifies values for display in column view.
-For example, it can be used to cut out a certain part from a time stamp.
-The function must take 2 arguments:
-
-column-title The title of the column (*not* the property name)
-value The value that should be modified.
-
-The function should return the value that should be displayed,
-or nil if the normal value should be used."
- :group 'org-properties
- :type 'function)
-
-(defcustom org-effort-property "Effort"
- "The property that is being used to keep track of effort estimates.
-Effort estimates given in this property need to have the format H:MM."
- :group 'org-properties
- :group 'org-progress
- :type '(string :tag "Property"))
-
-(defconst org-global-properties-fixed
- '(("VISIBILITY_ALL" . "folded children content all")
- ("CLOCK_MODELINE_TOTAL_ALL" . "current today repeat all auto"))
- "List of property/value pairs that can be inherited by any entry.
-
-These are fixed values, for the preset properties. The user variable
-that can be used to add to this list is `org-global-properties'.
-
-The entries in this list are cons cells where the car is a property
-name and cdr is a string with the value. If the value represents
-multiple items like an \"_ALL\" property, separate the items by
-spaces.")
-
-(defcustom org-global-properties nil
- "List of property/value pairs that can be inherited by any entry.
-
-This list will be combined with the constant `org-global-properties-fixed'.
-
-The entries in this list are cons cells where the car is a property
-name and cdr is a string with the value.
-
-You can set buffer-local values for the same purpose in the variable
-`org-file-properties' this by adding lines like
-
-#+PROPERTY: NAME VALUE"
- :group 'org-properties
- :type '(repeat
- (cons (string :tag "Property")
- (string :tag "Value"))))
-
-(defvar org-file-properties nil
- "List of property/value pairs that can be inherited by any entry.
-Valid for the current buffer.
-This variable is populated from #+PROPERTY lines.")
-(make-variable-buffer-local 'org-file-properties)
-
-(defgroup org-agenda nil
- "Options concerning agenda views in Org-mode."
- :tag "Org Agenda"
- :group 'org)
-
-(defvar org-category nil
- "Variable used by org files to set a category for agenda display.
-Such files should use a file variable to set it, for example
-
-# -*- mode: org; org-category: \"ELisp\"
-
-or contain a special line
-
-#+CATEGORY: ELisp
-
-If the file does not specify a category, then file's base name
-is used instead.")
-(make-variable-buffer-local 'org-category)
-(put 'org-category 'safe-local-variable '(lambda (x) (or (symbolp x) (stringp x))))
-
-(defcustom org-agenda-files nil
- "The files to be used for agenda display.
-Entries may be added to this list with \\[org-agenda-file-to-front] and removed with
-\\[org-remove-file]. You can also use customize to edit the list.
-
-If an entry is a directory, all files in that directory that are matched by
-`org-agenda-file-regexp' will be part of the file list.
-
-If the value of the variable is not a list but a single file name, then
-the list of agenda files is actually stored and maintained in that file, one
-agenda file per line. In this file paths can be given relative to
-`org-directory'. Tilde expansion and environment variable substitution
-are also made."
- :group 'org-agenda
- :type '(choice
- (repeat :tag "List of files and directories" file)
- (file :tag "Store list in a file\n" :value "~/.agenda_files")))
-
-(defcustom org-agenda-file-regexp "\\`[^.].*\\.org\\'"
- "Regular expression to match files for `org-agenda-files'.
-If any element in the list in that variable contains a directory instead
-of a normal file, all files in that directory that are matched by this
-regular expression will be included."
- :group 'org-agenda
- :type 'regexp)
-
-(defcustom org-agenda-text-search-extra-files nil
- "List of extra files to be searched by text search commands.
-These files will be search in addition to the agenda files by the
-commands `org-search-view' (`C-c a s') and `org-occur-in-agenda-files'.
-Note that these files will only be searched for text search commands,
-not for the other agenda views like todo lists, tag searches or the weekly
-agenda. This variable is intended to list notes and possibly archive files
-that should also be searched by these two commands.
-In fact, if the first element in the list is the symbol `agenda-archives',
-than all archive files of all agenda files will be added to the search
-scope."
- :group 'org-agenda
- :type '(set :greedy t
- (const :tag "Agenda Archives" agenda-archives)
- (repeat :inline t (file))))
-
-(if (fboundp 'defvaralias)
- (defvaralias 'org-agenda-multi-occur-extra-files
- 'org-agenda-text-search-extra-files))
-
-(defcustom org-agenda-skip-unavailable-files nil
- "Non-nil means to just skip non-reachable files in `org-agenda-files'.
-A nil value means to remove them, after a query, from the list."
- :group 'org-agenda
- :type 'boolean)
-
-(defcustom org-calendar-to-agenda-key [?c]
- "The key to be installed in `calendar-mode-map' for switching to the agenda.
-The command `org-calendar-goto-agenda' will be bound to this key. The
-default is the character `c' because then `c' can be used to switch back and
-forth between agenda and calendar."
- :group 'org-agenda
- :type 'sexp)
-
-(defcustom org-calendar-agenda-action-key [?k]
- "The key to be installed in `calendar-mode-map' for agenda-action.
-The command `org-agenda-action' will be bound to this key. The
-default is the character `k' because we use the same key in the agenda."
- :group 'org-agenda
- :type 'sexp)
-
-(defcustom org-calendar-insert-diary-entry-key [?i]
- "The key to be installed in `calendar-mode-map' for adding diary entries.
-This option is irrelevant until `org-agenda-diary-file' has been configured
-to point to an Org-mode file. When that is the case, the command
-`org-agenda-diary-entry' will be bound to the key given here, by default
-`i'. In the calendar, `i' normally adds entries to `diary-file'. So
-if you want to continue doing this, you need to change this to a different
-key."
- :group 'org-agenda
- :type 'sexp)
-
-(defcustom org-agenda-diary-file 'diary-file
- "File to which to add new entries with the `i' key in agenda and calendar.
-When this is the symbol `diary-file', the functionality in the Emacs
-calendar will be used to add entries to the `diary-file'. But when this
-points to a file, `org-agenda-diary-entry' will be used instead."
- :group 'org-agenda
- :type '(choice
- (const :tag "The standard Emacs diary file" diary-file)
- (file :tag "Special Org file diary entries")))
-
-(eval-after-load "calendar"
- '(progn
- (org-defkey calendar-mode-map org-calendar-to-agenda-key
- 'org-calendar-goto-agenda)
- (org-defkey calendar-mode-map org-calendar-agenda-action-key
- 'org-agenda-action)
- (add-hook 'calendar-mode-hook
- (lambda ()
- (unless (eq org-agenda-diary-file 'diary-file)
- (define-key calendar-mode-map
- org-calendar-insert-diary-entry-key
- 'org-agenda-diary-entry))))))
-
-(defgroup org-latex nil
- "Options for embedding LaTeX code into Org-mode."
- :tag "Org LaTeX"
- :group 'org)
-
-(defcustom org-format-latex-options
- '(:foreground default :background default :scale 1.0
- :html-foreground "Black" :html-background "Transparent"
- :html-scale 1.0 :matchers ("begin" "$1" "$" "$$" "\\(" "\\["))
- "Options for creating images from LaTeX fragments.
-This is a property list with the following properties:
-:foreground the foreground color for images embedded in Emacs, e.g. \"Black\".
- `default' means use the foreground of the default face.
-:background the background color, or \"Transparent\".
- `default' means use the background of the default face.
-:scale a scaling factor for the size of the images, to get more pixels
-:html-foreground, :html-background, :html-scale
- the same numbers for HTML export.
-:matchers a list indicating which matchers should be used to
- find LaTeX fragments. Valid members of this list are:
- \"begin\" find environments
- \"$1\" find single characters surrounded by $.$
- \"$\" find math expressions surrounded by $...$
- \"$$\" find math expressions surrounded by $$....$$
- \"\\(\" find math expressions surrounded by \\(...\\)
- \"\\ [\" find math expressions surrounded by \\ [...\\]"
- :group 'org-latex
- :type 'plist)
-
-(defcustom org-format-latex-signal-error t
- "Non-nil means signal an error when image creation of LaTeX snippets fails.
-When nil, just push out a message."
- :group 'org-latex
- :type 'boolean)
-
-(defcustom org-format-latex-header "\\documentclass{article}
-\\usepackage[usenames]{color}
-\\usepackage{amsmath}
-\\usepackage[mathscr]{eucal}
-\\pagestyle{empty} % do not remove
-\[PACKAGES]
-\[DEFAULT-PACKAGES]
-% The settings below are copied from fullpage.sty
-\\setlength{\\textwidth}{\\paperwidth}
-\\addtolength{\\textwidth}{-3cm}
-\\setlength{\\oddsidemargin}{1.5cm}
-\\addtolength{\\oddsidemargin}{-2.54cm}
-\\setlength{\\evensidemargin}{\\oddsidemargin}
-\\setlength{\\textheight}{\\paperheight}
-\\addtolength{\\textheight}{-\\headheight}
-\\addtolength{\\textheight}{-\\headsep}
-\\addtolength{\\textheight}{-\\footskip}
-\\addtolength{\\textheight}{-3cm}
-\\setlength{\\topmargin}{1.5cm}
-\\addtolength{\\topmargin}{-2.54cm}"
- "The document header used for processing LaTeX fragments.
-It is imperative that this header make sure that no page number
-appears on the page. The package defined in the variables
-`org-export-latex-default-packages-alist' and `org-export-latex-packages-alist'
-will either replace the placeholder \"[PACKAGES]\" in this header, or they
-will be appended."
- :group 'org-latex
- :type 'string)
-
-(defvar org-format-latex-header-extra nil)
-
-(defun org-set-packages-alist (var val)
- "Set the packages alist and make sure it has 3 elements per entry."
- (set var (mapcar (lambda (x)
- (if (and (consp x) (= (length x) 2))
- (list (car x) (nth 1 x) t)
- x))
- val)))
-
-(defun org-get-packages-alist (var)
-
- "Get the packages alist and make sure it has 3 elements per entry."
- (mapcar (lambda (x)
- (if (and (consp x) (= (length x) 2))
- (list (car x) (nth 1 x) t)
- x))
- (default-value var)))
-
-;; The following variables are defined here because is it also used
-;; when formatting latex fragments. Originally it was part of the
-;; LaTeX exporter, which is why the name includes "export".
-(defcustom org-export-latex-default-packages-alist
- '(("AUTO" "inputenc" t)
- ("T1" "fontenc" t)
- ("" "fixltx2e" nil)
- ("" "graphicx" t)
- ("" "longtable" nil)
- ("" "float" nil)
- ("" "wrapfig" nil)
- ("" "soul" t)
- ("" "textcomp" t)
- ("" "marvosym" t)
- ("" "wasysym" t)
- ("" "latexsym" t)
- ("" "amssymb" t)
- ("" "hyperref" nil)
- "\\tolerance=1000"
- )
- "Alist of default packages to be inserted in the header.
-Change this only if one of the packages here causes an incompatibility
-with another package you are using.
-The packages in this list are needed by one part or another of Org-mode
-to function properly.
-
-- inputenc, fontenc: for basic font and character selection
-- textcomp, marvosymb, wasysym, latexsym, amssym: for various symbols used
- for interpreting the entities in `org-entities'. You can skip some of these
- packages if you don't use any of the symbols in it.
-- graphicx: for including images
-- float, wrapfig: for figure placement
-- longtable: for long tables
-- hyperref: for cross references
-
-Therefore you should not modify this variable unless you know what you
-are doing. The one reason to change it anyway is that you might be loading
-some other package that conflicts with one of the default packages.
-Each cell is of the format \( \"options\" \"package\" snippet-flag\).
-If SNIPPET-FLAG is t, the package also needs to be included when
-compiling LaTeX snippets into images for inclusion into HTML."
- :group 'org-export-latex
- :set 'org-set-packages-alist
- :get 'org-get-packages-alist
- :type '(repeat
- (choice
- (list :tag "options/package pair"
- (string :tag "options")
- (string :tag "package")
- (boolean :tag "Snippet"))
- (string :tag "A line of LaTeX"))))
-
-(defcustom org-export-latex-packages-alist nil
- "Alist of packages to be inserted in every LaTeX header.
-These will be inserted after `org-export-latex-default-packages-alist'.
-Each cell is of the format \( \"options\" \"package\" snippet-flag \).
-SNIPPET-FLAG, when t, indicates that this package is also needed when
-turning LaTeX snippets into images for inclusion into HTML.
-Make sure that you only list packages here which:
-- you want in every file
-- do not conflict with the default packages in
- `org-export-latex-default-packages-alist'
-- do not conflict with the setup in `org-format-latex-header'."
- :group 'org-export-latex
- :set 'org-set-packages-alist
- :get 'org-get-packages-alist
- :type '(repeat
- (choice
- (list :tag "options/package pair"
- (string :tag "options")
- (string :tag "package")
- (boolean :tag "Snippet"))
- (string :tag "A line of LaTeX"))))
-
-
-(defgroup org-appearance nil
- "Settings for Org-mode appearance."
- :tag "Org Appearance"
- :group 'org)
-
-(defcustom org-level-color-stars-only nil
- "Non-nil means fontify only the stars in each headline.
-When nil, the entire headline is fontified.
-Changing it requires restart of `font-lock-mode' to become effective
-also in regions already fontified."
- :group 'org-appearance
- :type 'boolean)
-
-(defcustom org-hide-leading-stars nil
- "Non-nil means hide the first N-1 stars in a headline.
-This works by using the face `org-hide' for these stars. This
-face is white for a light background, and black for a dark
-background. You may have to customize the face `org-hide' to
-make this work.
-Changing it requires restart of `font-lock-mode' to become effective
-also in regions already fontified.
-You may also set this on a per-file basis by adding one of the following
-lines to the buffer:
-
- #+STARTUP: hidestars
- #+STARTUP: showstars"
- :group 'org-appearance
- :type 'boolean)
-
-(defcustom org-hidden-keywords nil
- "List of keywords that should be hidden when typed in the org buffer.
-For example, add #+TITLE to this list in order to make the
-document title appear in the buffer without the initial #+TITLE:
-keyword."
- :group 'org-appearance
- :type '(set (const :tag "#+AUTHOR" author)
- (const :tag "#+DATE" date)
- (const :tag "#+EMAIL" email)
- (const :tag "#+TITLE" title)))
-
-(defcustom org-fontify-done-headline nil
- "Non-nil means change the face of a headline if it is marked DONE.
-Normally, only the TODO/DONE keyword indicates the state of a headline.
-When this is non-nil, the headline after the keyword is set to the
-`org-headline-done' as an additional indication."
- :group 'org-appearance
- :type 'boolean)
-
-(defcustom org-fontify-emphasized-text t
- "Non-nil means fontify *bold*, /italic/ and _underlined_ text.
-Changing this variable requires a restart of Emacs to take effect."
- :group 'org-appearance
- :type 'boolean)
-
-(defcustom org-fontify-whole-heading-line nil
- "Non-nil means fontify the whole line for headings.
-This is useful when setting a background color for the
-org-level-* faces."
- :group 'org-appearance
- :type 'boolean)
-
-(defcustom org-highlight-latex-fragments-and-specials nil
- "Non-nil means fontify what is treated specially by the exporters."
- :group 'org-appearance
- :type 'boolean)
-
-(defcustom org-hide-emphasis-markers nil
- "Non-nil mean font-lock should hide the emphasis marker characters."
- :group 'org-appearance
- :type 'boolean)
-
-(defcustom org-pretty-entities nil
- "Non-nil means show entities as UTF8 characters.
-When nil, the \\name form remains in the buffer."
- :group 'org-appearance
- :type 'boolean)
-
-(defcustom org-pretty-entities-include-sub-superscripts t
- "Non-nil means, pretty entity display includes formatting sub/superscripts."
- :group 'org-appearance
- :type 'boolean)
-
-(defvar org-emph-re nil
- "Regular expression for matching emphasis.
-After a match, the match groups contain these elements:
-0 The match of the full regular expression, including the characters
- before and after the proper match
-1 The character before the proper match, or empty at beginning of line
-2 The proper match, including the leading and trailing markers
-3 The leading marker like * or /, indicating the type of highlighting
-4 The text between the emphasis markers, not including the markers
-5 The character after the match, empty at the end of a line")
-(defvar org-verbatim-re nil
- "Regular expression for matching verbatim text.")
-(defvar org-emphasis-regexp-components) ; defined just below
-(defvar org-emphasis-alist) ; defined just below
-(defun org-set-emph-re (var val)
- "Set variable and compute the emphasis regular expression."
- (set var val)
- (when (and (boundp 'org-emphasis-alist)
- (boundp 'org-emphasis-regexp-components)
- org-emphasis-alist org-emphasis-regexp-components)
- (let* ((e org-emphasis-regexp-components)
- (pre (car e))
- (post (nth 1 e))
- (border (nth 2 e))
- (body (nth 3 e))
- (nl (nth 4 e))
- (body1 (concat body "*?"))
- (markers (mapconcat 'car org-emphasis-alist ""))
- (vmarkers (mapconcat
- (lambda (x) (if (eq (nth 4 x) 'verbatim) (car x) ""))
- org-emphasis-alist "")))
- ;; make sure special characters appear at the right position in the class
- (if (string-match "\\^" markers)
- (setq markers (concat (replace-match "" t t markers) "^")))
- (if (string-match "-" markers)
- (setq markers (concat (replace-match "" t t markers) "-")))
- (if (string-match "\\^" vmarkers)
- (setq vmarkers (concat (replace-match "" t t vmarkers) "^")))
- (if (string-match "-" vmarkers)
- (setq vmarkers (concat (replace-match "" t t vmarkers) "-")))
- (if (> nl 0)
- (setq body1 (concat body1 "\\(?:\n" body "*?\\)\\{0,"
- (int-to-string nl) "\\}")))
- ;; Make the regexp
- (setq org-emph-re
- (concat "\\([" pre "]\\|^\\)"
- "\\("
- "\\([" markers "]\\)"
- "\\("
- "[^" border "]\\|"
- "[^" border "]"
- body1
- "[^" border "]"
- "\\)"
- "\\3\\)"
- "\\([" post "]\\|$\\)"))
- (setq org-verbatim-re
- (concat "\\([" pre "]\\|^\\)"
- "\\("
- "\\([" vmarkers "]\\)"
- "\\("
- "[^" border "]\\|"
- "[^" border "]"
- body1
- "[^" border "]"
- "\\)"
- "\\3\\)"
- "\\([" post "]\\|$\\)")))))
-
-(defcustom org-emphasis-regexp-components
- '(" \t('\"{" "- \t.,:!?;'\")}\\" " \t\r\n,\"'" "." 1)
- "Components used to build the regular expression for emphasis.
-This is a list with five entries. Terminology: In an emphasis string
-like \" *strong word* \", we call the initial space PREMATCH, the final
-space POSTMATCH, the stars MARKERS, \"s\" and \"d\" are BORDER characters
-and \"trong wor\" is the body. The different components in this variable
-specify what is allowed/forbidden in each part:
-
-pre Chars allowed as prematch. Beginning of line will be allowed too.
-post Chars allowed as postmatch. End of line will be allowed too.
-border The chars *forbidden* as border characters.
-body-regexp A regexp like \".\" to match a body character. Don't use
- non-shy groups here, and don't allow newline here.
-newline The maximum number of newlines allowed in an emphasis exp.
-
-Use customize to modify this, or restart Emacs after changing it."
- :group 'org-appearance
- :set 'org-set-emph-re
- :type '(list
- (sexp :tag "Allowed chars in pre ")
- (sexp :tag "Allowed chars in post ")
- (sexp :tag "Forbidden chars in border ")
- (sexp :tag "Regexp for body ")
- (integer :tag "number of newlines allowed")
- (option (boolean :tag "Please ignore this button"))))
-
-(defcustom org-emphasis-alist
- `(("*" bold "<b>" "</b>")
- ("/" italic "<i>" "</i>")
- ("_" underline "<span style=\"text-decoration:underline;\">" "</span>")
- ("=" org-code "<code>" "</code>" verbatim)
- ("~" org-verbatim "<code>" "</code>" verbatim)
- ("+" ,(if (featurep 'xemacs) 'org-table '(:strike-through t))
- "<del>" "</del>")
- )
- "Special syntax for emphasized text.
-Text starting and ending with a special character will be emphasized, for
-example *bold*, _underlined_ and /italic/. This variable sets the marker
-characters, the face to be used by font-lock for highlighting in Org-mode
-Emacs buffers, and the HTML tags to be used for this.
-For LaTeX export, see the variable `org-export-latex-emphasis-alist'.
-For DocBook export, see the variable `org-export-docbook-emphasis-alist'.
-Use customize to modify this, or restart Emacs after changing it."
- :group 'org-appearance
- :set 'org-set-emph-re
- :type '(repeat
- (list
- (string :tag "Marker character")
- (choice
- (face :tag "Font-lock-face")
- (plist :tag "Face property list"))
- (string :tag "HTML start tag")
- (string :tag "HTML end tag")
- (option (const verbatim)))))
-
-(defvar org-protecting-blocks
- '("src" "example" "latex" "ascii" "html" "docbook" "ditaa" "dot" "r" "R")
- "Blocks that contain text that is quoted, i.e. not processed as Org syntax.
-This is needed for font-lock setup.")
-
-;;; Miscellaneous options
-
-(defgroup org-completion nil
- "Completion in Org-mode."
- :tag "Org Completion"
- :group 'org)
-
-(defcustom org-completion-use-ido nil
- "Non-nil means use ido completion wherever possible.
-Note that `ido-mode' must be active for this variable to be relevant.
-If you decide to turn this variable on, you might well want to turn off
-`org-outline-path-complete-in-steps'.
-See also `org-completion-use-iswitchb'."
- :group 'org-completion
- :type 'boolean)
-
-(defcustom org-completion-use-iswitchb nil
- "Non-nil means use iswitchb completion wherever possible.
-Note that `iswitchb-mode' must be active for this variable to be relevant.
-If you decide to turn this variable on, you might well want to turn off
-`org-outline-path-complete-in-steps'.
-Note that this variable has only an effect if `org-completion-use-ido' is nil."
- :group 'org-completion
- :type 'boolean)
-
-(defcustom org-completion-fallback-command 'hippie-expand
- "The expansion command called by \\[pcomplete] in normal context.
-Normal means, no org-mode-specific context."
- :group 'org-completion
- :type 'function)
-
-;;; Functions and variables from their packages
-;; Declared here to avoid compiler warnings
-
-;; XEmacs only
-(defvar outline-mode-menu-heading)
-(defvar outline-mode-menu-show)
-(defvar outline-mode-menu-hide)
-(defvar zmacs-regions) ; XEmacs regions
-
-;; Emacs only
-(defvar mark-active)
-
-;; Various packages
-(declare-function calendar-absolute-from-iso "cal-iso" (date))
-(declare-function calendar-forward-day "cal-move" (arg))
-(declare-function calendar-goto-date "cal-move" (date))
-(declare-function calendar-goto-today "cal-move" ())
-(declare-function calendar-iso-from-absolute "cal-iso" (date))
-(defvar calc-embedded-close-formula)
-(defvar calc-embedded-open-formula)
-(declare-function cdlatex-tab "ext:cdlatex" ())
-(declare-function dired-get-filename "dired" (&optional localp no-error-if-not-filep))
-(defvar font-lock-unfontify-region-function)
-(declare-function iswitchb-read-buffer "iswitchb"
- (prompt &optional default require-match start matches-set))
-(defvar iswitchb-temp-buflist)
-(declare-function org-gnus-follow-link "org-gnus" (&optional group article))
-(defvar org-agenda-tags-todo-honor-ignore-options)
-(declare-function org-agenda-skip "org-agenda" ())
-(declare-function
- org-format-agenda-item "org-agenda"
- (extra txt &optional category tags dotime noprefix remove-re habitp))
-(declare-function org-agenda-new-marker "org-agenda" (&optional pos))
-(declare-function org-agenda-change-all-lines "org-agenda"
- (newhead hdmarker &optional fixface just-this))
-(declare-function org-agenda-set-restriction-lock "org-agenda" (&optional type))
-(declare-function org-agenda-maybe-redo "org-agenda" ())
-(declare-function org-agenda-save-markers-for-cut-and-paste "org-agenda"
- (beg end))
-(declare-function org-agenda-copy-local-variable "org-agenda" (var))
-(declare-function org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item
- "org-agenda" (&optional end))
-(declare-function org-inlinetask-remove-END-maybe "org-inlinetask" ())
-(declare-function org-inlinetask-in-task-p "org-inlinetask" ())
-(declare-function org-inlinetask-goto-beginning "org-inlinetask" ())
-(declare-function org-inlinetask-goto-end "org-inlinetask" ())
-(declare-function org-indent-mode "org-indent" (&optional arg))
-(declare-function parse-time-string "parse-time" (string))
-(declare-function org-attach-reveal "org-attach" (&optional if-exists))
-(declare-function org-export-latex-fix-inputenc "org-latex" ())
-(declare-function orgtbl-send-table "org-table" (&optional maybe))
-(defvar remember-data-file)
-(defvar texmathp-why)
-(declare-function speedbar-line-directory "speedbar" (&optional depth))
-(declare-function table--at-cell-p "table" (position &optional object at-column))
-
-(defvar w3m-current-url)
-(defvar w3m-current-title)
-
-(defvar org-latex-regexps)
-
-;;; Autoload and prepare some org modules
-
-;; Some table stuff that needs to be defined here, because it is used
-;; by the functions setting up org-mode or checking for table context.
-
-(defconst org-table-any-line-regexp "^[ \t]*\\(|\\|\\+-[-+]\\)"
- "Detect an org-type or table-type table.")
-(defconst org-table-line-regexp "^[ \t]*|"
- "Detect an org-type table line.")
-(defconst org-table-dataline-regexp "^[ \t]*|[^-]"
- "Detect an org-type table line.")
-(defconst org-table-hline-regexp "^[ \t]*|-"
- "Detect an org-type table hline.")
-(defconst org-table1-hline-regexp "^[ \t]*\\+-[-+]"
- "Detect a table-type table hline.")
-(defconst org-table-any-border-regexp "^[ \t]*[^|+ \t]"
- "Detect the first line outside a table when searching from within it.
-This works for both table types.")
-
-;; Autoload the functions in org-table.el that are needed by functions here.
-
-(eval-and-compile
- (org-autoload "org-table"
- '(org-table-align org-table-begin org-table-blank-field
- org-table-convert org-table-convert-region org-table-copy-down
- org-table-copy-region org-table-create
- org-table-create-or-convert-from-region
- org-table-create-with-table.el org-table-current-dline
- org-table-cut-region org-table-delete-column org-table-edit-field
- org-table-edit-formulas org-table-end org-table-eval-formula
- org-table-export org-table-field-info
- org-table-get-stored-formulas org-table-goto-column
- org-table-hline-and-move org-table-import org-table-insert-column
- org-table-insert-hline org-table-insert-row org-table-iterate
- org-table-justify-field-maybe org-table-kill-row
- org-table-maybe-eval-formula org-table-maybe-recalculate-line
- org-table-move-column org-table-move-column-left
- org-table-move-column-right org-table-move-row
- org-table-move-row-down org-table-move-row-up
- org-table-next-field org-table-next-row org-table-paste-rectangle
- org-table-previous-field org-table-recalculate
- org-table-rotate-recalc-marks org-table-sort-lines org-table-sum
- org-table-toggle-coordinate-overlays
- org-table-toggle-formula-debugger org-table-wrap-region
- orgtbl-mode turn-on-orgtbl org-table-to-lisp
- orgtbl-to-generic orgtbl-to-tsv orgtbl-to-csv orgtbl-to-latex
- orgtbl-to-orgtbl orgtbl-to-html orgtbl-to-texinfo)))
-
-(defun org-at-table-p (&optional table-type)
- "Return t if the cursor is inside an org-type table.
-If TABLE-TYPE is non-nil, also check for table.el-type tables."
- (if org-enable-table-editor
- (save-excursion
- (beginning-of-line 1)
- (looking-at (if table-type org-table-any-line-regexp
- org-table-line-regexp)))
- nil))
-(defsubst org-table-p () (org-at-table-p))
-
-(defun org-at-table.el-p ()
- "Return t if and only if we are at a table.el table."
- (and (org-at-table-p 'any)
- (save-excursion
- (goto-char (org-table-begin 'any))
- (looking-at org-table1-hline-regexp))))
-(defun org-table-recognize-table.el ()
- "If there is a table.el table nearby, recognize it and move into it."
- (if org-table-tab-recognizes-table.el
- (if (org-at-table.el-p)
- (progn
- (beginning-of-line 1)
- (if (looking-at org-table-dataline-regexp)
- nil
- (if (looking-at org-table1-hline-regexp)
- (progn
- (beginning-of-line 2)
- (if (looking-at org-table-any-border-regexp)
- (beginning-of-line -1)))))
- (if (re-search-forward "|" (org-table-end t) t)
- (progn
- (require 'table)
- (if (table--at-cell-p (point))
- t
- (message "recognizing table.el table...")
- (table-recognize-table)
- (message "recognizing table.el table...done")))
- (error "This should not happen"))
- t)
- nil)
- nil))
-
-(defun org-at-table-hline-p ()
- "Return t if the cursor is inside a hline in a table."
- (if org-enable-table-editor
- (save-excursion
- (beginning-of-line 1)
- (looking-at org-table-hline-regexp))
- nil))
-
-(defvar org-table-clean-did-remove-column nil)
-
-(defun org-table-map-tables (function &optional quietly)
- "Apply FUNCTION to the start of all tables in the buffer."
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (while (re-search-forward org-table-any-line-regexp nil t)
- (unless quietly
- (message "Mapping tables: %d%%" (/ (* 100.0 (point)) (buffer-size))))
- (beginning-of-line 1)
- (when (looking-at org-table-line-regexp)
- (save-excursion (funcall function))
- (or (looking-at org-table-line-regexp)
- (forward-char 1)))
- (re-search-forward org-table-any-border-regexp nil 1))))
- (unless quietly (message "Mapping tables: done")))
-
-;; Declare and autoload functions from org-exp.el & Co
-
-(declare-function org-default-export-plist "org-exp")
-(declare-function org-infile-export-plist "org-exp")
-(declare-function org-get-current-options "org-exp")
-(eval-and-compile
- (org-autoload "org-exp"
- '(org-export org-export-visible
- org-insert-export-options-template
- org-table-clean-before-export))
- (org-autoload "org-ascii"
- '(org-export-as-ascii org-export-ascii-preprocess
- org-export-as-ascii-to-buffer org-replace-region-by-ascii
- org-export-region-as-ascii))
- (org-autoload "org-latex"
- '(org-export-as-latex-batch org-export-as-latex-to-buffer
- org-replace-region-by-latex org-export-region-as-latex
- org-export-as-latex org-export-as-pdf
- org-export-as-pdf-and-open))
- (org-autoload "org-html"
- '(org-export-as-html-and-open
- org-export-as-html-batch org-export-as-html-to-buffer
- org-replace-region-by-html org-export-region-as-html
- org-export-as-html))
- (org-autoload "org-docbook"
- '(org-export-as-docbook-batch org-export-as-docbook-to-buffer
- org-replace-region-by-docbook org-export-region-as-docbook
- org-export-as-docbook-pdf org-export-as-docbook-pdf-and-open
- org-export-as-docbook))
- (org-autoload "org-icalendar"
- '(org-export-icalendar-this-file
- org-export-icalendar-all-agenda-files
- org-export-icalendar-combine-agenda-files))
- (org-autoload "org-xoxo" '(org-export-as-xoxo))
- (org-autoload "org-beamer" '(org-beamer-mode org-beamer-sectioning)))
-
-;; Declare and autoload functions from org-agenda.el
-
-(eval-and-compile
- (org-autoload "org-agenda"
- '(org-agenda org-agenda-list org-search-view
- org-todo-list org-tags-view org-agenda-list-stuck-projects
- org-diary org-agenda-to-appt
- org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item)))
-
-;; Autoload org-remember
-
-(eval-and-compile
- (org-autoload "org-remember"
- '(org-remember-insinuate org-remember-annotation
- org-remember-apply-template org-remember org-remember-handler)))
-
-(eval-and-compile
- (org-autoload "org-capture"
- '(org-capture org-capture-insert-template-here
- org-capture-import-remember-templates)))
-
-;; Autoload org-clock.el
-
-(declare-function org-clock-save-markers-for-cut-and-paste "org-clock"
- (beg end))
-(declare-function org-clock-update-mode-line "org-clock" ())
-(declare-function org-resolve-clocks "org-clock"
- (&optional also-non-dangling-p prompt last-valid))
-(defvar org-clock-start-time)
-(defvar org-clock-marker (make-marker)
- "Marker recording the last clock-in.")
-(defvar org-clock-hd-marker (make-marker)
- "Marker recording the last clock-in, but the headline position.")
-(defvar org-clock-heading ""
- "The heading of the current clock entry.")
-(defun org-clock-is-active ()
- "Return non-nil if clock is currently running.
-The return value is actually the clock marker."
- (marker-buffer org-clock-marker))
-
-(eval-and-compile
- (org-autoload
- "org-clock"
- '(org-clock-in org-clock-out org-clock-cancel
- org-clock-goto org-clock-sum org-clock-display
- org-clock-remove-overlays org-clock-report
- org-clocktable-shift org-dblock-write:clocktable
- org-get-clocktable org-resolve-clocks)))
-
-(defun org-clock-update-time-maybe ()
- "If this is a CLOCK line, update it and return t.
-Otherwise, return nil."
- (interactive)
- (save-excursion
- (beginning-of-line 1)
- (skip-chars-forward " \t")
- (when (looking-at org-clock-string)
- (let ((re (concat "[ \t]*" org-clock-string
- " *[[<]\\([^]>]+\\)[]>]\\(-+[[<]\\([^]>]+\\)[]>]"
- "\\([ \t]*=>.*\\)?\\)?"))
- ts te h m s neg)
- (cond
- ((not (looking-at re))
- nil)
- ((not (match-end 2))
- (when (and (equal (marker-buffer org-clock-marker) (current-buffer))
- (> org-clock-marker (point))
- (<= org-clock-marker (point-at-eol)))
- ;; The clock is running here
- (setq org-clock-start-time
- (apply 'encode-time
- (org-parse-time-string (match-string 1))))
- (org-clock-update-mode-line)))
- (t
- (and (match-end 4) (delete-region (match-beginning 4) (match-end 4)))
- (end-of-line 1)
- (setq ts (match-string 1)
- te (match-string 3))
- (setq s (- (org-float-time
- (apply 'encode-time (org-parse-time-string te)))
- (org-float-time
- (apply 'encode-time (org-parse-time-string ts))))
- neg (< s 0)
- s (abs s)
- h (floor (/ s 3600))
- s (- s (* 3600 h))
- m (floor (/ s 60))
- s (- s (* 60 s)))
- (insert " => " (format (if neg "-%d:%02d" "%2d:%02d") h m))
- t))))))
-
-(defun org-check-running-clock ()
- "Check if the current buffer contains the running clock.
-If yes, offer to stop it and to save the buffer with the changes."
- (when (and (equal (marker-buffer org-clock-marker) (current-buffer))
- (y-or-n-p (format "Clock-out in buffer %s before killing it? "
- (buffer-name))))
- (org-clock-out)
- (when (y-or-n-p "Save changed buffer?")
- (save-buffer))))
-
-(defun org-clocktable-try-shift (dir n)
- "Check if this line starts a clock table, if yes, shift the time block."
- (when (org-match-line "#\\+BEGIN: clocktable\\>")
- (org-clocktable-shift dir n)))
-
-;; Autoload org-timer.el
-
-(eval-and-compile
- (org-autoload
- "org-timer"
- '(org-timer-start org-timer org-timer-item
- org-timer-change-times-in-region
- org-timer-set-timer
- org-timer-reset-timers
- org-timer-show-remaining-time)))
-
-;; Autoload org-feed.el
-
-(eval-and-compile
- (org-autoload
- "org-feed"
- '(org-feed-update org-feed-update-all org-feed-goto-inbox)))
-
-
-;; Autoload org-indent.el
-
-;; Define the variable already here, to make sure we have it.
-(defvar org-indent-mode nil
- "Non-nil if Org-Indent mode is enabled.
-Use the command `org-indent-mode' to change this variable.")
-
-(eval-and-compile
- (org-autoload
- "org-indent"
- '(org-indent-mode)))
-
-;; Autoload org-mobile.el
-
-(eval-and-compile
- (org-autoload
- "org-mobile"
- '(org-mobile-push org-mobile-pull org-mobile-create-sumo-agenda)))
-
-;; Autoload archiving code
-;; The stuff that is needed for cycling and tags has to be defined here.
-
-(defgroup org-archive nil
- "Options concerning archiving in Org-mode."
- :tag "Org Archive"
- :group 'org-structure)
-
-(defcustom org-archive-location "%s_archive::"
- "The location where subtrees should be archived.
-
-The value of this variable is a string, consisting of two parts,
-separated by a double-colon. The first part is a filename and
-the second part is a headline.
-
-When the filename is omitted, archiving happens in the same file.
-%s in the filename will be replaced by the current file
-name (without the directory part). Archiving to a different file
-is useful to keep archived entries from contributing to the
-Org-mode Agenda.
-
-The archived entries will be filed as subtrees of the specified
-headline. When the headline is omitted, the subtrees are simply
-filed away at the end of the file, as top-level entries. Also in
-the heading you can use %s to represent the file name, this can be
-useful when using the same archive for a number of different files.
-
-Here are a few examples:
-\"%s_archive::\"
- If the current file is Projects.org, archive in file
- Projects.org_archive, as top-level trees. This is the default.
-
-\"::* Archived Tasks\"
- Archive in the current file, under the top-level headline
- \"* Archived Tasks\".
-
-\"~/org/archive.org::\"
- Archive in file ~/org/archive.org (absolute path), as top-level trees.
-
-\"~/org/archive.org::From %s\"
- Archive in file ~/org/archive.org (absolute path), under headlines
- \"From FILENAME\" where file name is the current file name.
-
-\"basement::** Finished Tasks\"
- Archive in file ./basement (relative path), as level 3 trees
- below the level 2 heading \"** Finished Tasks\".
-
-You may set this option on a per-file basis by adding to the buffer a
-line like
-
-#+ARCHIVE: basement::** Finished Tasks
-
-You may also define it locally for a subtree by setting an ARCHIVE property
-in the entry. If such a property is found in an entry, or anywhere up
-the hierarchy, it will be used."
- :group 'org-archive
- :type 'string)
-
-(defcustom org-archive-tag "ARCHIVE"
- "The tag that marks a subtree as archived.
-An archived subtree does not open during visibility cycling, and does
-not contribute to the agenda listings.
-After changing this, font-lock must be restarted in the relevant buffers to
-get the proper fontification."
- :group 'org-archive
- :group 'org-keywords
- :type 'string)
-
-(defcustom org-agenda-skip-archived-trees t
- "Non-nil means the agenda will skip any items located in archived trees.
-An archived tree is a tree marked with the tag ARCHIVE. The use of this
-variable is no longer recommended, you should leave it at the value t.
-Instead, use the key `v' to cycle the archives-mode in the agenda."
- :group 'org-archive
- :group 'org-agenda-skip
- :type 'boolean)
-
-(defcustom org-columns-skip-archived-trees t
- "Non-nil means ignore archived trees when creating column view."
- :group 'org-archive
- :group 'org-properties
- :type 'boolean)
-
-(defcustom org-cycle-open-archived-trees nil
- "Non-nil means `org-cycle' will open archived trees.
-An archived tree is a tree marked with the tag ARCHIVE.
-When nil, archived trees will stay folded. You can still open them with
-normal outline commands like `show-all', but not with the cycling commands."
- :group 'org-archive
- :group 'org-cycle
- :type 'boolean)
-
-(defcustom org-sparse-tree-open-archived-trees nil
- "Non-nil means sparse tree construction shows matches in archived trees.
-When nil, matches in these trees are highlighted, but the trees are kept in
-collapsed state."
- :group 'org-archive
- :group 'org-sparse-trees
- :type 'boolean)
-
-(defun org-cycle-hide-archived-subtrees (state)
- "Re-hide all archived subtrees after a visibility state change."
- (when (and (not org-cycle-open-archived-trees)
- (not (memq state '(overview folded))))
- (save-excursion
- (let* ((globalp (memq state '(contents all)))
- (beg (if globalp (point-min) (point)))
- (end (if globalp (point-max) (org-end-of-subtree t))))
- (org-hide-archived-subtrees beg end)
- (goto-char beg)
- (if (looking-at (concat ".*:" org-archive-tag ":"))
- (message "%s" (substitute-command-keys
- "Subtree is archived and stays closed. Use \\[org-force-cycle-archived] to cycle it anyway.")))))))
-
-(defun org-force-cycle-archived ()
- "Cycle subtree even if it is archived."
- (interactive)
- (setq this-command 'org-cycle)
- (let ((org-cycle-open-archived-trees t))
- (call-interactively 'org-cycle)))
-
-(defun org-hide-archived-subtrees (beg end)
- "Re-hide all archived subtrees after a visibility state change."
- (save-excursion
- (let* ((re (concat ":" org-archive-tag ":")))
- (goto-char beg)
- (while (re-search-forward re end t)
- (when (org-on-heading-p)
- (org-flag-subtree t)
- (org-end-of-subtree t))))))
-
-(defun org-flag-subtree (flag)
- (save-excursion
- (org-back-to-heading t)
- (outline-end-of-heading)
- (outline-flag-region (point)
- (progn (org-end-of-subtree t) (point))
- flag)))
-
-(defalias 'org-advertized-archive-subtree 'org-archive-subtree)
-
-(eval-and-compile
- (org-autoload "org-archive"
- '(org-add-archive-files org-archive-subtree
- org-archive-to-archive-sibling org-toggle-archive-tag
- org-archive-subtree-default
- org-archive-subtree-default-with-confirmation)))
-
-;; Autoload Column View Code
-
-(declare-function org-columns-number-to-string "org-colview")
-(declare-function org-columns-get-format-and-top-level "org-colview")
-(declare-function org-columns-compute "org-colview")
-
-(org-autoload (if (featurep 'xemacs) "org-colview-xemacs" "org-colview")
- '(org-columns-number-to-string org-columns-get-format-and-top-level
- org-columns-compute org-agenda-columns org-columns-remove-overlays
- org-columns org-insert-columns-dblock org-dblock-write:columnview))
-
-;; Autoload ID code
-
-(declare-function org-id-store-link "org-id")
-(declare-function org-id-locations-load "org-id")
-(declare-function org-id-locations-save "org-id")
-(defvar org-id-track-globally)
-(org-autoload "org-id"
- '(org-id-get-create org-id-new org-id-copy org-id-get
- org-id-get-with-outline-path-completion
- org-id-get-with-outline-drilling org-id-store-link
- org-id-goto org-id-find org-id-store-link))
-
-;; Autoload Plotting Code
-
-(org-autoload "org-plot"
- '(org-plot/gnuplot))
-
-;;; Variables for pre-computed regular expressions, all buffer local
-
-(defvar org-drawer-regexp nil
- "Matches first line of a hidden block.")
-(make-variable-buffer-local 'org-drawer-regexp)
-(defvar org-todo-regexp nil
- "Matches any of the TODO state keywords.")
-(make-variable-buffer-local 'org-todo-regexp)
-(defvar org-not-done-regexp nil
- "Matches any of the TODO state keywords except the last one.")
-(make-variable-buffer-local 'org-not-done-regexp)
-(defvar org-not-done-heading-regexp nil
- "Matches a TODO headline that is not done.")
-(make-variable-buffer-local 'org-not-done-regexp)
-(defvar org-todo-line-regexp nil
- "Matches a headline and puts TODO state into group 2 if present.")
-(make-variable-buffer-local 'org-todo-line-regexp)
-(defvar org-complex-heading-regexp nil
- "Matches a headline and puts everything into groups:
-group 1: the stars
-group 2: The todo keyword, maybe
-group 3: Priority cookie
-group 4: True headline
-group 5: Tags")
-(make-variable-buffer-local 'org-complex-heading-regexp)
-(defvar org-complex-heading-regexp-format nil
- "Printf format to make regexp to match an exact headline.
-This regexp will match the headline of any node which hase the exact
-headline text that is put into the format, but may have any TODO state,
-priority and tags.")
-(make-variable-buffer-local 'org-complex-heading-regexp-format)
-(defvar org-todo-line-tags-regexp nil
- "Matches a headline and puts TODO state into group 2 if present.
-Also put tags into group 4 if tags are present.")
-(make-variable-buffer-local 'org-todo-line-tags-regexp)
-(defvar org-nl-done-regexp nil
- "Matches newline followed by a headline with the DONE keyword.")
-(make-variable-buffer-local 'org-nl-done-regexp)
-(defvar org-looking-at-done-regexp nil
- "Matches the DONE keyword a point.")
-(make-variable-buffer-local 'org-looking-at-done-regexp)
-(defvar org-ds-keyword-length 12
- "Maximum length of the Deadline and SCHEDULED keywords.")
-(make-variable-buffer-local 'org-ds-keyword-length)
-(defvar org-deadline-regexp nil
- "Matches the DEADLINE keyword.")
-(make-variable-buffer-local 'org-deadline-regexp)
-(defvar org-deadline-time-regexp nil
- "Matches the DEADLINE keyword together with a time stamp.")
-(make-variable-buffer-local 'org-deadline-time-regexp)
-(defvar org-deadline-line-regexp nil
- "Matches the DEADLINE keyword and the rest of the line.")
-(make-variable-buffer-local 'org-deadline-line-regexp)
-(defvar org-scheduled-regexp nil
- "Matches the SCHEDULED keyword.")
-(make-variable-buffer-local 'org-scheduled-regexp)
-(defvar org-scheduled-time-regexp nil
- "Matches the SCHEDULED keyword together with a time stamp.")
-(make-variable-buffer-local 'org-scheduled-time-regexp)
-(defvar org-closed-time-regexp nil
- "Matches the CLOSED keyword together with a time stamp.")
-(make-variable-buffer-local 'org-closed-time-regexp)
-
-(defvar org-keyword-time-regexp nil
- "Matches any of the 4 keywords, together with the time stamp.")
-(make-variable-buffer-local 'org-keyword-time-regexp)
-(defvar org-keyword-time-not-clock-regexp nil
- "Matches any of the 3 keywords, together with the time stamp.")
-(make-variable-buffer-local 'org-keyword-time-not-clock-regexp)
-(defvar org-maybe-keyword-time-regexp nil
- "Matches a timestamp, possibly preceded by a keyword.")
-(make-variable-buffer-local 'org-maybe-keyword-time-regexp)
-(defvar org-planning-or-clock-line-re nil
- "Matches a line with planning or clock info.")
-(make-variable-buffer-local 'org-planning-or-clock-line-re)
-(defvar org-all-time-keywords nil
- "List of time keywords.")
-(make-variable-buffer-local 'org-all-time-keywords)
-
-(defconst org-plain-time-of-day-regexp
- (concat
- "\\(\\<[012]?[0-9]"
- "\\(\\(:\\([0-5][0-9]\\([AaPp][Mm]\\)?\\)\\)\\|\\([AaPp][Mm]\\)\\)\\>\\)"
- "\\(--?"
- "\\(\\<[012]?[0-9]"
- "\\(\\(:\\([0-5][0-9]\\([AaPp][Mm]\\)?\\)\\)\\|\\([AaPp][Mm]\\)\\)\\>\\)"
- "\\)?")
- "Regular expression to match a plain time or time range.
-Examples: 11:45 or 8am-13:15 or 2:45-2:45pm. After a match, the following
-groups carry important information:
-0 the full match
-1 the first time, range or not
-8 the second time, if it is a range.")
-
-(defconst org-plain-time-extension-regexp
- (concat
- "\\(\\<[012]?[0-9]"
- "\\(\\(:\\([0-5][0-9]\\([AaPp][Mm]\\)?\\)\\)\\|\\([AaPp][Mm]\\)\\)\\>\\)"
- "\\+\\([0-9]+\\)\\(:\\([0-5][0-9]\\)\\)?")
- "Regular expression to match a time range like 13:30+2:10 = 13:30-15:40.
-Examples: 11:45 or 8am-13:15 or 2:45-2:45pm. After a match, the following
-groups carry important information:
-0 the full match
-7 hours of duration
-9 minutes of duration")
-
-(defconst org-stamp-time-of-day-regexp
- (concat
- "<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} +\\sw+ +\\)"
- "\\([012][0-9]:[0-5][0-9]\\(-\\([012][0-9]:[0-5][0-9]\\)\\)?[^\n\r>]*?\\)>"
- "\\(--?"
- "<\\1\\([012][0-9]:[0-5][0-9]\\)>\\)?")
- "Regular expression to match a timestamp time or time range.
-After a match, the following groups carry important information:
-0 the full match
-1 date plus weekday, for back referencing to make sure both times are on the same day
-2 the first time, range or not
-4 the second time, if it is a range.")
-
-(defconst org-startup-options
- '(("fold" org-startup-folded t)
- ("overview" org-startup-folded t)
- ("nofold" org-startup-folded nil)
- ("showall" org-startup-folded nil)
- ("showeverything" org-startup-folded showeverything)
- ("content" org-startup-folded content)
- ("indent" org-startup-indented t)
- ("noindent" org-startup-indented nil)
- ("hidestars" org-hide-leading-stars t)
- ("showstars" org-hide-leading-stars nil)
- ("odd" org-odd-levels-only t)
- ("oddeven" org-odd-levels-only nil)
- ("align" org-startup-align-all-tables t)
- ("noalign" org-startup-align-all-tables nil)
- ("inlineimages" org-startup-with-inline-images t)
- ("noinlineimages" org-startup-with-inline-images nil)
- ("customtime" org-display-custom-times t)
- ("logdone" org-log-done time)
- ("lognotedone" org-log-done note)
- ("nologdone" org-log-done nil)
- ("lognoteclock-out" org-log-note-clock-out t)
- ("nolognoteclock-out" org-log-note-clock-out nil)
- ("logrepeat" org-log-repeat state)
- ("lognoterepeat" org-log-repeat note)
- ("nologrepeat" org-log-repeat nil)
- ("logreschedule" org-log-reschedule time)
- ("lognotereschedule" org-log-reschedule note)
- ("nologreschedule" org-log-reschedule nil)
- ("logredeadline" org-log-redeadline time)
- ("lognoteredeadline" org-log-redeadline note)
- ("nologredeadline" org-log-redeadline nil)
- ("logrefile" org-log-refile time)
- ("lognoterefile" org-log-refile note)
- ("nologrefile" org-log-refile nil)
- ("fninline" org-footnote-define-inline t)
- ("nofninline" org-footnote-define-inline nil)
- ("fnlocal" org-footnote-section nil)
- ("fnauto" org-footnote-auto-label t)
- ("fnprompt" org-footnote-auto-label nil)
- ("fnconfirm" org-footnote-auto-label confirm)
- ("fnplain" org-footnote-auto-label plain)
- ("fnadjust" org-footnote-auto-adjust t)
- ("nofnadjust" org-footnote-auto-adjust nil)
- ("constcgs" constants-unit-system cgs)
- ("constSI" constants-unit-system SI)
- ("noptag" org-tag-persistent-alist nil)
- ("hideblocks" org-hide-block-startup t)
- ("nohideblocks" org-hide-block-startup nil)
- ("beamer" org-startup-with-beamer-mode t)
- ("entitiespretty" org-pretty-entities t)
- ("entitiesplain" org-pretty-entities nil))
- "Variable associated with STARTUP options for org-mode.
-Each element is a list of three items: The startup options as written
-in the #+STARTUP line, the corresponding variable, and the value to
-set this variable to if the option is found. An optional forth element PUSH
-means to push this value onto the list in the variable.")
-
-(defun org-set-regexps-and-options ()
- "Precompute regular expressions for current buffer."
- (when (org-mode-p)
- (org-set-local 'org-todo-kwd-alist nil)
- (org-set-local 'org-todo-key-alist nil)
- (org-set-local 'org-todo-key-trigger nil)
- (org-set-local 'org-todo-keywords-1 nil)
- (org-set-local 'org-done-keywords nil)
- (org-set-local 'org-todo-heads nil)
- (org-set-local 'org-todo-sets nil)
- (org-set-local 'org-todo-log-states nil)
- (org-set-local 'org-file-properties nil)
- (org-set-local 'org-file-tags nil)
- (let ((re (org-make-options-regexp
- '("CATEGORY" "TODO" "COLUMNS"
- "STARTUP" "ARCHIVE" "FILETAGS" "TAGS" "LINK" "PRIORITIES"
- "CONSTANTS" "PROPERTY" "DRAWERS" "SETUPFILE" "LATEX_CLASS"
- "OPTIONS")
- "\\(?:[a-zA-Z][0-9a-zA-Z_]*_TODO\\)"))
- (splitre "[ \t]+")
- (scripts org-use-sub-superscripts)
- kwds kws0 kwsa key log value cat arch tags const links hw dws
- tail sep kws1 prio props ftags drawers beamer-p
- ext-setup-or-nil setup-contents (start 0))
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (while (or (and ext-setup-or-nil
- (string-match re ext-setup-or-nil start)
- (setq start (match-end 0)))
- (and (setq ext-setup-or-nil nil start 0)
- (re-search-forward re nil t)))
- (setq key (upcase (match-string 1 ext-setup-or-nil))
- value (org-match-string-no-properties 2 ext-setup-or-nil))
- (if (stringp value) (setq value (org-trim value)))
- (cond
- ((equal key "CATEGORY")
- (setq cat value))
- ((member key '("SEQ_TODO" "TODO"))
- (push (cons 'sequence (org-split-string value splitre)) kwds))
- ((equal key "TYP_TODO")
- (push (cons 'type (org-split-string value splitre)) kwds))
- ((string-match "\\`\\([a-zA-Z][0-9a-zA-Z_]*\\)_TODO\\'" key)
- ;; general TODO-like setup
- (push (cons (intern (downcase (match-string 1 key)))
- (org-split-string value splitre)) kwds))
- ((equal key "TAGS")
- (setq tags (append tags (if tags '("\\n") nil)
- (org-split-string value splitre))))
- ((equal key "COLUMNS")
- (org-set-local 'org-columns-default-format value))
- ((equal key "LINK")
- (when (string-match "^\\(\\S-+\\)[ \t]+\\(.+\\)" value)
- (push (cons (match-string 1 value)
- (org-trim (match-string 2 value)))
- links)))
- ((equal key "PRIORITIES")
- (setq prio (org-split-string value " +")))
- ((equal key "PROPERTY")
- (when (string-match "\\(\\S-+\\)\\s-+\\(.*\\)" value)
- (push (cons (match-string 1 value) (match-string 2 value))
- props)))
- ((equal key "FILETAGS")
- (when (string-match "\\S-" value)
- (setq ftags
- (append
- ftags
- (apply 'append
- (mapcar (lambda (x) (org-split-string x ":"))
- (org-split-string value)))))))
- ((equal key "DRAWERS")
- (setq drawers (org-split-string value splitre)))
- ((equal key "CONSTANTS")
- (setq const (append const (org-split-string value splitre))))
- ((equal key "STARTUP")
- (let ((opts (org-split-string value splitre))
- l var val)
- (while (setq l (pop opts))
- (when (setq l (assoc l org-startup-options))
- (setq var (nth 1 l) val (nth 2 l))
- (if (not (nth 3 l))
- (set (make-local-variable var) val)
- (if (not (listp (symbol-value var)))
- (set (make-local-variable var) nil))
- (set (make-local-variable var) (symbol-value var))
- (add-to-list var val))))))
- ((equal key "ARCHIVE")
- (setq arch value)
- (remove-text-properties 0 (length arch)
- '(face t fontified t) arch))
- ((equal key "LATEX_CLASS")
- (setq beamer-p (equal value "beamer")))
- ((equal key "OPTIONS")
- (if (string-match "\\([ \t]\\|\\`\\)\\^:\\(t\\|nil\\|{}\\)" value)
- (setq scripts (read (match-string 2 value)))))
- ((equal key "SETUPFILE")
- (setq setup-contents (org-file-contents
- (expand-file-name
- (org-remove-double-quotes value))
- 'noerror))
- (if (not ext-setup-or-nil)
- (setq ext-setup-or-nil setup-contents start 0)
- (setq ext-setup-or-nil
- (concat (substring ext-setup-or-nil 0 start)
- "\n" setup-contents "\n"
- (substring ext-setup-or-nil start)))))
- ))))
- (org-set-local 'org-use-sub-superscripts scripts)
- (when cat
- (org-set-local 'org-category (intern cat))
- (push (cons "CATEGORY" cat) props))
- (when prio
- (if (< (length prio) 3) (setq prio '("A" "C" "B")))
- (setq prio (mapcar 'string-to-char prio))
- (org-set-local 'org-highest-priority (nth 0 prio))
- (org-set-local 'org-lowest-priority (nth 1 prio))
- (org-set-local 'org-default-priority (nth 2 prio)))
- (and props (org-set-local 'org-file-properties (nreverse props)))
- (and ftags (org-set-local 'org-file-tags
- (mapcar 'org-add-prop-inherited ftags)))
- (and drawers (org-set-local 'org-drawers drawers))
- (and arch (org-set-local 'org-archive-location arch))
- (and links (setq org-link-abbrev-alist-local (nreverse links)))
- ;; Process the TODO keywords
- (unless kwds
- ;; Use the global values as if they had been given locally.
- (setq kwds (default-value 'org-todo-keywords))
- (if (stringp (car kwds))
- (setq kwds (list (cons org-todo-interpretation
- (default-value 'org-todo-keywords)))))
- (setq kwds (reverse kwds)))
- (setq kwds (nreverse kwds))
- (let (inter kws kw)
- (while (setq kws (pop kwds))
- (let ((kws (or
- (run-hook-with-args-until-success
- 'org-todo-setup-filter-hook kws)
- kws)))
- (setq inter (pop kws) sep (member "|" kws)
- kws0 (delete "|" (copy-sequence kws))
- kwsa nil
- kws1 (mapcar
- (lambda (x)
- ;; 1 2
- (if (string-match "^\\(.*?\\)\\(?:(\\([^!@/]\\)?.*?)\\)?$" x)
- (progn
- (setq kw (match-string 1 x)
- key (and (match-end 2) (match-string 2 x))
- log (org-extract-log-state-settings x))
- (push (cons kw (and key (string-to-char key))) kwsa)
- (and log (push log org-todo-log-states))
- kw)
- (error "Invalid TODO keyword %s" x)))
- kws0)
- kwsa (if kwsa (append '((:startgroup))
- (nreverse kwsa)
- '((:endgroup))))
- hw (car kws1)
- dws (if sep (org-remove-keyword-keys (cdr sep)) (last kws1))
- tail (list inter hw (car dws) (org-last dws))))
- (add-to-list 'org-todo-heads hw 'append)
- (push kws1 org-todo-sets)
- (setq org-done-keywords (append org-done-keywords dws nil))
- (setq org-todo-key-alist (append org-todo-key-alist kwsa))
- (mapc (lambda (x) (push (cons x tail) org-todo-kwd-alist)) kws1)
- (setq org-todo-keywords-1 (append org-todo-keywords-1 kws1 nil)))
- (setq org-todo-sets (nreverse org-todo-sets)
- org-todo-kwd-alist (nreverse org-todo-kwd-alist)
- org-todo-key-trigger (delq nil (mapcar 'cdr org-todo-key-alist))
- org-todo-key-alist (org-assign-fast-keys org-todo-key-alist)))
- ;; Process the constants
- (when const
- (let (e cst)
- (while (setq e (pop const))
- (if (string-match "^\\([a-zA-Z0][_a-zA-Z0-9]*\\)=\\(.*\\)" e)
- (push (cons (match-string 1 e) (match-string 2 e)) cst)))
- (setq org-table-formula-constants-local cst)))
-
- ;; Process the tags.
- (when tags
- (let (e tgs)
- (while (setq e (pop tags))
- (cond
- ((equal e "{") (push '(:startgroup) tgs))
- ((equal e "}") (push '(:endgroup) tgs))
- ((equal e "\\n") (push '(:newline) tgs))
- ((string-match (org-re "^\\([[:alnum:]_@#%]+\\)(\\(.\\))$") e)
- (push (cons (match-string 1 e)
- (string-to-char (match-string 2 e)))
- tgs))
- (t (push (list e) tgs))))
- (org-set-local 'org-tag-alist nil)
- (while (setq e (pop tgs))
- (or (and (stringp (car e))
- (assoc (car e) org-tag-alist))
- (push e org-tag-alist)))))
-
- ;; Compute the regular expressions and other local variables
- (if (not org-done-keywords)
- (setq org-done-keywords (and org-todo-keywords-1
- (list (org-last org-todo-keywords-1)))))
- (setq org-ds-keyword-length (+ 2 (max (length org-deadline-string)
- (length org-scheduled-string)
- (length org-clock-string)
- (length org-closed-string)))
- org-drawer-regexp
- (concat "^[ \t]*:\\("
- (mapconcat 'regexp-quote org-drawers "\\|")
- "\\):[ \t]*$")
- org-not-done-keywords
- (org-delete-all org-done-keywords (copy-sequence org-todo-keywords-1))
- org-todo-regexp
- (concat "\\<\\(" (mapconcat 'regexp-quote org-todo-keywords-1
- "\\|") "\\)\\>")
- org-not-done-regexp
- (concat "\\<\\("
- (mapconcat 'regexp-quote org-not-done-keywords "\\|")
- "\\)\\>")
- org-not-done-heading-regexp
- (concat "^\\(\\*+\\)[ \t]+\\("
- (mapconcat 'regexp-quote org-not-done-keywords "\\|")
- "\\)\\>")
- org-todo-line-regexp
- (concat "^\\(\\*+\\)[ \t]+\\(?:\\("
- (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
- "\\)\\>\\)?[ \t]*\\(.*\\)")
- org-complex-heading-regexp
- (concat "^\\(\\*+\\)[ \t]+\\(?:\\("
- (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
- "\\)\\>\\)?\\(?:[ \t]*\\(\\[#.\\]\\)\\)?[ \t]*\\(.*?\\)"
- "\\(?:[ \t]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ \t]*$")
- org-complex-heading-regexp-format
- (concat "^\\(\\*+\\)[ \t]+\\(?:\\("
- (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
- "\\)\\>\\)?"
- "\\(?:[ \t]*\\(\\[#.\\]\\)\\)?"
- "\\(?:[ \t]*\\(?:\\[[0-9%%/]+\\]\\)\\)?" ;; stats cookie
- "[ \t]*\\(%s\\)"
- "\\(?:[ \t]*\\(?:\\[[0-9%%/]+\\]\\)\\)?" ;; stats cookie
- "\\(?:[ \t]+\\(:[[:alnum:]_@#%%:]+:\\)\\)?[ \t]*$")
- org-nl-done-regexp
- (concat "\n\\*+[ \t]+"
- "\\(?:" (mapconcat 'regexp-quote org-done-keywords "\\|")
- "\\)" "\\>")
- org-todo-line-tags-regexp
- (concat "^\\(\\*+\\)[ \t]+\\(?:\\("
- (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
- (org-re
- "\\)\\>\\)? *\\(.*?\\([ \t]:[[:alnum:]:_@#%]+:[ \t]*\\)?$\\)"))
- org-looking-at-done-regexp
- (concat "^" "\\(?:"
- (mapconcat 'regexp-quote org-done-keywords "\\|") "\\)"
- "\\>")
- org-deadline-regexp (concat "\\<" org-deadline-string)
- org-deadline-time-regexp
- (concat "\\<" org-deadline-string " *<\\([^>]+\\)>")
- org-deadline-line-regexp
- (concat "\\<\\(" org-deadline-string "\\).*")
- org-scheduled-regexp
- (concat "\\<" org-scheduled-string)
- org-scheduled-time-regexp
- (concat "\\<" org-scheduled-string " *<\\([^>]+\\)>")
- org-closed-time-regexp
- (concat "\\<" org-closed-string " *\\[\\([^]]+\\)\\]")
- org-keyword-time-regexp
- (concat "\\<\\(" org-scheduled-string
- "\\|" org-deadline-string
- "\\|" org-closed-string
- "\\|" org-clock-string "\\)"
- " *[[<]\\([^]>]+\\)[]>]")
- org-keyword-time-not-clock-regexp
- (concat "\\<\\(" org-scheduled-string
- "\\|" org-deadline-string
- "\\|" org-closed-string
- "\\)"
- " *[[<]\\([^]>]+\\)[]>]")
- org-maybe-keyword-time-regexp
- (concat "\\(\\<\\(" org-scheduled-string
- "\\|" org-deadline-string
- "\\|" org-closed-string
- "\\|" org-clock-string "\\)\\)?"
- " *\\([[<][0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [^]\r\n>]*?[]>]\\|<%%([^\r\n>]*>\\)")
- org-planning-or-clock-line-re
- (concat "\\(?:^[ \t]*\\(" org-scheduled-string
- "\\|" org-deadline-string
- "\\|" org-closed-string "\\|" org-clock-string
- "\\)\\>\\)")
- org-all-time-keywords
- (mapcar (lambda (w) (substring w 0 -1))
- (list org-scheduled-string org-deadline-string
- org-clock-string org-closed-string))
- )
- (org-compute-latex-and-specials-regexp)
- (org-set-font-lock-defaults))))
-
-(defun org-file-contents (file &optional noerror)
- "Return the contents of FILE, as a string."
- (if (or (not file)
- (not (file-readable-p file)))
- (if noerror
- (progn
- (message "Cannot read file \"%s\"" file)
- (ding) (sit-for 2)
- "")
- (error "Cannot read file \"%s\"" file))
- (with-temp-buffer
- (insert-file-contents file)
- (buffer-string))))
-
-(defun org-extract-log-state-settings (x)
- "Extract the log state setting from a TODO keyword string.
-This will extract info from a string like \"WAIT(w@/!)\"."
- (let (kw key log1 log2)
- (when (string-match "^\\(.*?\\)\\(?:(\\([^!@/]\\)?\\([!@]\\)?\\(?:/\\([!@]\\)\\)?)\\)?$" x)
- (setq kw (match-string 1 x)
- key (and (match-end 2) (match-string 2 x))
- log1 (and (match-end 3) (match-string 3 x))
- log2 (and (match-end 4) (match-string 4 x)))
- (and (or log1 log2)
- (list kw
- (and log1 (if (equal log1 "!") 'time 'note))
- (and log2 (if (equal log2 "!") 'time 'note)))))))
-
-(defun org-remove-keyword-keys (list)
- "Remove a pair of parenthesis at the end of each string in LIST."
- (mapcar (lambda (x)
- (if (string-match "(.*)$" x)
- (substring x 0 (match-beginning 0))
- x))
- list))
-
-(defun org-assign-fast-keys (alist)
- "Assign fast keys to a keyword-key alist.
-Respect keys that are already there."
- (let (new e (alt ?0))
- (while (setq e (pop alist))
- (if (or (memq (car e) '(:newline :endgroup :startgroup))
- (cdr e)) ;; Key already assigned.
- (push e new)
- (let ((clist (string-to-list (downcase (car e))))
- (used (append new alist)))
- (when (= (car clist) ?@)
- (pop clist))
- (while (and clist (rassoc (car clist) used))
- (pop clist))
- (unless clist
- (while (rassoc alt used)
- (incf alt)))
- (push (cons (car e) (or (car clist) alt)) new))))
- (nreverse new)))
-
-;;; Some variables used in various places
-
-(defvar org-window-configuration nil
- "Used in various places to store a window configuration.")
-(defvar org-selected-window nil
- "Used in various places to store a window configuration.")
-(defvar org-finish-function nil
- "Function to be called when `C-c C-c' is used.
-This is for getting out of special buffers like remember.")
-
-
-;; FIXME: Occasionally check by commenting these, to make sure
-;; no other functions uses these, forgetting to let-bind them.
-(defvar entry)
-(defvar last-state)
-(defvar date)
-
-;; Defined somewhere in this file, but used before definition.
-(defvar org-entities) ;; defined in org-entities.el
-(defvar org-struct-menu)
-(defvar org-org-menu)
-(defvar org-tbl-menu)
-
-;;;; Define the Org-mode
-
-(if (and (not (keymapp outline-mode-map)) (featurep 'allout))
- (error "Conflict with outdated version of allout.el. Load org.el before allout.el, or upgrade to newer allout, for example by switching to Emacs 22"))
-
-
-;; We use a before-change function to check if a table might need
-;; an update.
-(defvar org-table-may-need-update t
- "Indicates that a table might need an update.
-This variable is set by `org-before-change-function'.
-`org-table-align' sets it back to nil.")
-(defun org-before-change-function (beg end)
- "Every change indicates that a table might need an update."
- (setq org-table-may-need-update t))
-(defvar org-mode-map)
-(defvar org-inhibit-startup nil) ; Dynamically-scoped param.
-(defvar org-inhibit-startup-visibility-stuff nil) ; Dynamically-scoped param.
-(defvar org-agenda-keep-modes nil) ; Dynamically-scoped param.
-(defvar org-inhibit-logging nil) ; Dynamically-scoped param.
-(defvar org-inhibit-blocking nil) ; Dynamically-scoped param.
-(defvar org-table-buffer-is-an nil)
-(defconst org-outline-regexp "\\*+ ")
-
-;;;###autoload
-(define-derived-mode org-mode outline-mode "Org"
- "Outline-based notes management and organizer, alias
-\"Carsten's outline-mode for keeping track of everything.\"
-
-Org-mode develops organizational tasks around a NOTES file which
-contains information about projects as plain text. Org-mode is
-implemented on top of outline-mode, which is ideal to keep the content
-of large files well structured. It supports ToDo items, deadlines and
-time stamps, which magically appear in the diary listing of the Emacs
-calendar. Tables are easily created with a built-in table editor.
-Plain text URL-like links connect to websites, emails (VM), Usenet
-messages (Gnus), BBDB entries, and any files related to the project.
-For printing and sharing of notes, an Org-mode file (or a part of it)
-can be exported as a structured ASCII or HTML file.
-
-The following commands are available:
-
-\\{org-mode-map}"
-
- ;; Get rid of Outline menus, they are not needed
- ;; Need to do this here because define-derived-mode sets up
- ;; the keymap so late. Still, it is a waste to call this each time
- ;; we switch another buffer into org-mode.
- (if (featurep 'xemacs)
- (when (boundp 'outline-mode-menu-heading)
- ;; Assume this is Greg's port, it uses easymenu
- (easy-menu-remove outline-mode-menu-heading)
- (easy-menu-remove outline-mode-menu-show)
- (easy-menu-remove outline-mode-menu-hide))
- (define-key org-mode-map [menu-bar headings] 'undefined)
- (define-key org-mode-map [menu-bar hide] 'undefined)
- (define-key org-mode-map [menu-bar show] 'undefined))
-
- (org-load-modules-maybe)
- (easy-menu-add org-org-menu)
- (easy-menu-add org-tbl-menu)
- (org-install-agenda-files-menu)
- (if org-descriptive-links (add-to-invisibility-spec '(org-link)))
- (add-to-invisibility-spec '(org-cwidth))
- (add-to-invisibility-spec '(org-hide-block . t))
- (when (featurep 'xemacs)
- (org-set-local 'line-move-ignore-invisible t))
- (org-set-local 'outline-regexp org-outline-regexp)
- (org-set-local 'outline-level 'org-outline-level)
- (when (and org-ellipsis
- (fboundp 'set-display-table-slot) (boundp 'buffer-display-table)
- (fboundp 'make-glyph-code))
- (unless org-display-table
- (setq org-display-table (make-display-table)))
- (set-display-table-slot
- org-display-table 4
- (vconcat (mapcar
- (lambda (c) (make-glyph-code c (and (not (stringp org-ellipsis))
- org-ellipsis)))
- (if (stringp org-ellipsis) org-ellipsis "..."))))
- (setq buffer-display-table org-display-table))
- (org-set-regexps-and-options)
- (when (and org-tag-faces (not org-tags-special-faces-re))
- ;; tag faces set outside customize.... force initialization.
- (org-set-tag-faces 'org-tag-faces org-tag-faces))
- ;; Calc embedded
- (org-set-local 'calc-embedded-open-mode "# ")
- (modify-syntax-entry ?@ "w")
- (if org-startup-truncated (setq truncate-lines t))
- (org-set-local 'font-lock-unfontify-region-function
- 'org-unfontify-region)
- ;; Activate before-change-function
- (org-set-local 'org-table-may-need-update t)
- (org-add-hook 'before-change-functions 'org-before-change-function nil
- 'local)
- ;; Check for running clock before killing a buffer
- (org-add-hook 'kill-buffer-hook 'org-check-running-clock nil 'local)
- ;; Paragraphs and auto-filling
- (org-set-autofill-regexps)
- (setq indent-line-function 'org-indent-line-function)
- (org-update-radio-target-regexp)
- ;; Beginning/end of defun
- (org-set-local 'beginning-of-defun-function 'org-beginning-of-defun)
- (org-set-local 'end-of-defun-function 'org-end-of-defun)
- ;; Make sure dependence stuff works reliably, even for users who set it
- ;; too late :-(
- (if org-enforce-todo-dependencies
- (add-hook 'org-blocker-hook
- 'org-block-todo-from-children-or-siblings-or-parent)
- (remove-hook 'org-blocker-hook
- 'org-block-todo-from-children-or-siblings-or-parent))
- (if org-enforce-todo-checkbox-dependencies
- (add-hook 'org-blocker-hook
- 'org-block-todo-from-checkboxes)
- (remove-hook 'org-blocker-hook
- 'org-block-todo-from-checkboxes))
-
- ;; Comment characters
- (org-set-local 'comment-start "#")
- (org-set-local 'comment-padding " ")
-
- ;; Align options lines
- (org-set-local
- 'align-mode-rules-list
- '((org-in-buffer-settings
- (regexp . "^#\\+[A-Z_]+:\\(\\s-*\\)\\S-+")
- (modes . '(org-mode)))))
-
- ;; Imenu
- (org-set-local 'imenu-create-index-function
- 'org-imenu-get-tree)
-
- ;; Make isearch reveal context
- (if (or (featurep 'xemacs)
- (not (boundp 'outline-isearch-open-invisible-function)))
- ;; Emacs 21 and XEmacs make use of the hook
- (org-add-hook 'isearch-mode-end-hook 'org-isearch-end 'append 'local)
- ;; Emacs 22 deals with this through a special variable
- (org-set-local 'outline-isearch-open-invisible-function
- (lambda (&rest ignore) (org-show-context 'isearch))))
-
- ;; Turn on org-beamer-mode?
- (and org-startup-with-beamer-mode (org-beamer-mode 1))
-
- ;; Setup the pcomplete hooks
- (set (make-local-variable 'pcomplete-command-completion-function)
- 'org-complete-initial)
- (set (make-local-variable 'pcomplete-command-name-function)
- 'org-command-at-point)
- (set (make-local-variable 'pcomplete-default-completion-function)
- 'ignore)
- (set (make-local-variable 'pcomplete-parse-arguments-function)
- 'org-parse-arguments)
- (set (make-local-variable 'pcomplete-termination-string) "")
-
- ;; If empty file that did not turn on org-mode automatically, make it to.
- (if (and org-insert-mode-line-in-empty-file
- (interactive-p)
- (= (point-min) (point-max)))
- (insert "# -*- mode: org -*-\n\n"))
- (unless org-inhibit-startup
- (when org-startup-align-all-tables
- (let ((bmp (buffer-modified-p)))
- (org-table-map-tables 'org-table-align 'quietly)
- (set-buffer-modified-p bmp)))
- (when org-startup-with-inline-images
- (org-display-inline-images))
- (when org-startup-indented
- (require 'org-indent)
- (org-indent-mode 1))
- (unless org-inhibit-startup-visibility-stuff
- (org-set-startup-visibility))))
-
-(when (fboundp 'abbrev-table-put)
- (abbrev-table-put org-mode-abbrev-table
- :parents (list text-mode-abbrev-table)))
-
-(put 'org-mode 'flyspell-mode-predicate 'org-mode-flyspell-verify)
-
-(defun org-current-time ()
- "Current time, possibly rounded to `org-time-stamp-rounding-minutes'."
- (if (> (car org-time-stamp-rounding-minutes) 1)
- (let ((r (car org-time-stamp-rounding-minutes))
- (time (decode-time)))
- (apply 'encode-time
- (append (list 0 (* r (floor (+ .5 (/ (float (nth 1 time)) r)))))
- (nthcdr 2 time))))
- (current-time)))
-
-(defun org-today ()
- "Return today date, considering `org-extend-today-until'."
- (time-to-days
- (time-subtract (current-time)
- (list 0 (* 3600 org-extend-today-until) 0))))
-
-;;;; Font-Lock stuff, including the activators
-
-(defvar org-mouse-map (make-sparse-keymap))
-(org-defkey org-mouse-map [mouse-2] 'org-open-at-mouse)
-(org-defkey org-mouse-map [mouse-3] 'org-find-file-at-mouse)
-(when org-mouse-1-follows-link
- (org-defkey org-mouse-map [follow-link] 'mouse-face))
-(when org-tab-follows-link
- (org-defkey org-mouse-map [(tab)] 'org-open-at-point)
- (org-defkey org-mouse-map "\C-i" 'org-open-at-point))
-
-(require 'font-lock)
-
-(defconst org-non-link-chars "]\t\n\r<>")
-(defvar org-link-types '("http" "https" "ftp" "mailto" "file" "news"
- "shell" "elisp" "doi" "message"))
-(defvar org-link-types-re nil
- "Matches a link that has a url-like prefix like \"http:\"")
-(defvar org-link-re-with-space nil
- "Matches a link with spaces, optional angular brackets around it.")
-(defvar org-link-re-with-space2 nil
- "Matches a link with spaces, optional angular brackets around it.")
-(defvar org-link-re-with-space3 nil
- "Matches a link with spaces, only for internal part in bracket links.")
-(defvar org-angle-link-re nil
- "Matches link with angular brackets, spaces are allowed.")
-(defvar org-plain-link-re nil
- "Matches plain link, without spaces.")
-(defvar org-bracket-link-regexp nil
- "Matches a link in double brackets.")
-(defvar org-bracket-link-analytic-regexp nil
- "Regular expression used to analyze links.
-Here is what the match groups contain after a match:
-1: http:
-2: http
-3: path
-4: [desc]
-5: desc")
-(defvar org-bracket-link-analytic-regexp++ nil
- "Like `org-bracket-link-analytic-regexp', but include coderef internal type.")
-(defvar org-any-link-re nil
- "Regular expression matching any link.")
-
-(defcustom org-match-sexp-depth 3
- "Number of stacked braces for sub/superscript matching.
-This has to be set before loading org.el to be effective."
- :group 'org-export-translation ; ??????????????????????????/
- :type 'integer)
-
-(defun org-create-multibrace-regexp (left right n)
- "Create a regular expression which will match a balanced sexp.
-Opening delimiter is LEFT, and closing delimiter is RIGHT, both given
-as single character strings.
-The regexp returned will match the entire expression including the
-delimiters. It will also define a single group which contains the
-match except for the outermost delimiters. The maximum depth of
-stacked delimiters is N. Escaping delimiters is not possible."
- (let* ((nothing (concat "[^" left right "]*?"))
- (or "\\|")
- (re nothing)
- (next (concat "\\(?:" nothing left nothing right "\\)+" nothing)))
- (while (> n 1)
- (setq n (1- n)
- re (concat re or next)
- next (concat "\\(?:" nothing left next right "\\)+" nothing)))
- (concat left "\\(" re "\\)" right)))
-
-(defvar org-match-substring-regexp
- (concat
- "\\([^\\]\\)\\([_^]\\)\\("
- "\\(" (org-create-multibrace-regexp "{" "}" org-match-sexp-depth) "\\)"
- "\\|"
- "\\(" (org-create-multibrace-regexp "(" ")" org-match-sexp-depth) "\\)"
- "\\|"
- "\\(\\(?:\\*\\|[-+]?[^-+*!@#$%^_ \t\r\n,:\"?<>~;./{}=()]+\\)\\)\\)")
- "The regular expression matching a sub- or superscript.")
-
-(defvar org-match-substring-with-braces-regexp
- (concat
- "\\([^\\]\\)\\([_^]\\)\\("
- "\\(" (org-create-multibrace-regexp "{" "}" org-match-sexp-depth) "\\)"
- "\\)")
- "The regular expression matching a sub- or superscript, forcing braces.")
-
-(defun org-make-link-regexps ()
- "Update the link regular expressions.
-This should be called after the variable `org-link-types' has changed."
- (setq org-link-types-re
- (concat
- "\\`\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):")
- org-link-re-with-space
- (concat
- "<?\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
- "\\([^" org-non-link-chars " ]"
- "[^" org-non-link-chars "]*"
- "[^" org-non-link-chars " ]\\)>?")
- org-link-re-with-space2
- (concat
- "<?\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
- "\\([^" org-non-link-chars " ]"
- "[^\t\n\r]*"
- "[^" org-non-link-chars " ]\\)>?")
- org-link-re-with-space3
- (concat
- "<?\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
- "\\([^" org-non-link-chars " ]"
- "[^\t\n\r]*\\)")
- org-angle-link-re
- (concat
- "<\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
- "\\([^" org-non-link-chars " ]"
- "[^" org-non-link-chars "]*"
- "\\)>")
- org-plain-link-re
- (concat
- "\\<\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):"
- (org-re "\\([^ \t\n()<>]+\\(?:([[:word:]0-9_]+)\\|\\([^[:punct:] \t\n]\\|/\\)\\)\\)"))
- ;; "\\([^]\t\n\r<>() ]+[^]\t\n\r<>,.;() ]\\)")
- org-bracket-link-regexp
- "\\[\\[\\([^][]+\\)\\]\\(\\[\\([^][]+\\)\\]\\)?\\]"
- org-bracket-link-analytic-regexp
- (concat
- "\\[\\["
- "\\(\\(" (mapconcat 'regexp-quote org-link-types "\\|") "\\):\\)?"
- "\\([^]]+\\)"
- "\\]"
- "\\(\\[" "\\([^]]+\\)" "\\]\\)?"
- "\\]")
- org-bracket-link-analytic-regexp++
- (concat
- "\\[\\["
- "\\(\\(" (mapconcat 'regexp-quote (cons "coderef" org-link-types) "\\|") "\\):\\)?"
- "\\([^]]+\\)"
- "\\]"
- "\\(\\[" "\\([^]]+\\)" "\\]\\)?"
- "\\]")
- org-any-link-re
- (concat "\\(" org-bracket-link-regexp "\\)\\|\\("
- org-angle-link-re "\\)\\|\\("
- org-plain-link-re "\\)")))
-
-(org-make-link-regexps)
-
-(defconst org-ts-regexp "<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [^\r\n>]*?\\)>"
- "Regular expression for fast time stamp matching.")
-(defconst org-ts-regexp-both "[[<]\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [^\r\n>]*?\\)[]>]"
- "Regular expression for fast time stamp matching.")
-(defconst org-ts-regexp0 "\\(\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\) *\\([^]-+0-9>\r\n ]*\\)\\( \\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)"
- "Regular expression matching time strings for analysis.
-This one does not require the space after the date, so it can be used
-on a string that terminates immediately after the date.")
-(defconst org-ts-regexp1 "\\(\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\) +\\([^]-+0-9>\r\n ]*\\)\\( \\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)"
- "Regular expression matching time strings for analysis.")
-(defconst org-ts-regexp2 (concat "<" org-ts-regexp1 "[^>\n]\\{0,16\\}>")
- "Regular expression matching time stamps, with groups.")
-(defconst org-ts-regexp3 (concat "[[<]" org-ts-regexp1 "[^]>\n]\\{0,16\\}[]>]")
- "Regular expression matching time stamps (also [..]), with groups.")
-(defconst org-tr-regexp (concat org-ts-regexp "--?-?" org-ts-regexp)
- "Regular expression matching a time stamp range.")
-(defconst org-tr-regexp-both
- (concat org-ts-regexp-both "--?-?" org-ts-regexp-both)
- "Regular expression matching a time stamp range.")
-(defconst org-tsr-regexp (concat org-ts-regexp "\\(--?-?"
- org-ts-regexp "\\)?")
- "Regular expression matching a time stamp or time stamp range.")
-(defconst org-tsr-regexp-both (concat org-ts-regexp-both "\\(--?-?"
- org-ts-regexp-both "\\)?")
- "Regular expression matching a time stamp or time stamp range.
-The time stamps may be either active or inactive.")
-
-(defvar org-emph-face nil)
-
-(defun org-do-emphasis-faces (limit)
- "Run through the buffer and add overlays to links."
- (let (rtn a)
- (while (and (not rtn) (re-search-forward org-emph-re limit t))
- (if (not (= (char-after (match-beginning 3))
- (char-after (match-beginning 4))))
- (progn
- (setq rtn t)
- (setq a (assoc (match-string 3) org-emphasis-alist))
- (font-lock-prepend-text-property (match-beginning 2) (match-end 2)
- 'face
- (nth 1 a))
- (and (nth 4 a)
- (org-remove-flyspell-overlays-in
- (match-beginning 0) (match-end 0)))
- (add-text-properties (match-beginning 2) (match-end 2)
- '(font-lock-multiline t org-emphasis t))
- (when org-hide-emphasis-markers
- (add-text-properties (match-end 4) (match-beginning 5)
- '(invisible org-link))
- (add-text-properties (match-beginning 3) (match-end 3)
- '(invisible org-link)))))
- (backward-char 1))
- rtn))
-
-(defun org-emphasize (&optional char)
- "Insert or change an emphasis, i.e. a font like bold or italic.
-If there is an active region, change that region to a new emphasis.
-If there is no region, just insert the marker characters and position
-the cursor between them.
-CHAR should be either the marker character, or the first character of the
-HTML tag associated with that emphasis. If CHAR is a space, the means
-to remove the emphasis of the selected region.
-If char is not given (for example in an interactive call) it
-will be prompted for."
- (interactive)
- (let ((eal org-emphasis-alist) e det
- (erc org-emphasis-regexp-components)
- (prompt "")
- (string "") beg end move tag c s)
- (if (org-region-active-p)
- (setq beg (region-beginning) end (region-end)
- string (buffer-substring beg end))
- (setq move t))
-
- (while (setq e (pop eal))
- (setq tag (car (org-split-string (nth 2 e) "[ <>/]+"))
- c (aref tag 0))
- (push (cons c (string-to-char (car e))) det)
- (setq prompt (concat prompt (format " [%s%c]%s" (car e) c
- (substring tag 1)))))
- (setq det (nreverse det))
- (unless char
- (message "%s" (concat "Emphasis marker or tag:" prompt))
- (setq char (read-char-exclusive)))
- (setq char (or (cdr (assoc char det)) char))
- (if (equal char ?\ )
- (setq s "" move nil)
- (unless (assoc (char-to-string char) org-emphasis-alist)
- (error "No such emphasis marker: \"%c\"" char))
- (setq s (char-to-string char)))
- (while (and (> (length string) 1)
- (equal (substring string 0 1) (substring string -1))
- (assoc (substring string 0 1) org-emphasis-alist))
- (setq string (substring string 1 -1)))
- (setq string (concat s string s))
- (if beg (delete-region beg end))
- (unless (or (bolp)
- (string-match (concat "[" (nth 0 erc) "\n]")
- (char-to-string (char-before (point)))))
- (insert " "))
- (unless (or (eobp)
- (string-match (concat "[" (nth 1 erc) "\n]")
- (char-to-string (char-after (point)))))
- (insert " ") (backward-char 1))
- (insert string)
- (and move (backward-char 1))))
-
-(defconst org-nonsticky-props
- '(mouse-face highlight keymap invisible intangible help-echo org-linked-text))
-
-(defsubst org-rear-nonsticky-at (pos)
- (add-text-properties (1- pos) pos (list 'rear-nonsticky org-nonsticky-props)))
-
-(defun org-activate-plain-links (limit)
- "Run through the buffer and add overlays to links."
- (catch 'exit
- (let (f)
- (if (re-search-forward org-plain-link-re limit t)
- (progn
- (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
- (setq f (get-text-property (match-beginning 0) 'face))
- (if (or (eq f 'org-tag)
- (and (listp f) (memq 'org-tag f)))
- nil
- (add-text-properties (match-beginning 0) (match-end 0)
- (list 'mouse-face 'highlight
- 'face 'org-link
- 'keymap org-mouse-map))
- (org-rear-nonsticky-at (match-end 0)))
- t)))))
-
-(defun org-activate-code (limit)
- (if (re-search-forward "^[ \t]*\\(: .*\n?\\)" limit t)
- (progn
- (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
- (remove-text-properties (match-beginning 0) (match-end 0)
- '(display t invisible t intangible t))
- t)))
-
-(defcustom org-src-fontify-natively nil
- "When non-nil, fontify code in code blocks."
- :type 'boolean
- :group 'org-appearance
- :group 'org-babel)
-
-(defun org-fontify-meta-lines-and-blocks (limit)
- "Fontify #+ lines and blocks, in the correct ways."
- (let ((case-fold-search t))
- (if (re-search-forward
- "^\\([ \t]*#\\+\\(\\([a-zA-Z]+:?\\| \\|$\\)\\(_\\([a-zA-Z]+\\)\\)?\\)[ \t]*\\(\\([^ \t\n]*\\)[ \t]*\\(.*\\)\\)\\)"
- limit t)
- (let ((beg (match-beginning 0))
- (block-start (match-end 0))
- (block-end nil)
- (lang (match-string 7))
- (beg1 (line-beginning-position 2))
- (dc1 (downcase (match-string 2)))
- (dc3 (downcase (match-string 3)))
- end end1 quoting block-type)
- (cond
- ((member dc1 '("html:" "ascii:" "latex:" "docbook:"))
- ;; a single line of backend-specific content
- (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
- (remove-text-properties (match-beginning 0) (match-end 0)
- '(display t invisible t intangible t))
- (add-text-properties (match-beginning 1) (match-end 3)
- '(font-lock-fontified t face org-meta-line))
- (add-text-properties (match-beginning 6) (+ (match-end 6) 1)
- '(font-lock-fontified t face org-block))
- ; for backend-specific code
- t)
- ((and (match-end 4) (equal dc3 "begin"))
- ;; Truly a block
- (setq block-type (downcase (match-string 5))
- quoting (member block-type org-protecting-blocks))
- (when (re-search-forward
- (concat "^[ \t]*#\\+end" (match-string 4) "\\>.*")
- nil t) ;; on purpose, we look further than LIMIT
- (setq end (match-end 0) end1 (1- (match-beginning 0)))
- (setq block-end (match-beginning 0))
- (when quoting
- (remove-text-properties beg end
- '(display t invisible t intangible t)))
- (add-text-properties
- beg end
- '(font-lock-fontified t font-lock-multiline t))
- (add-text-properties beg beg1 '(face org-meta-line))
- (add-text-properties end1 (+ end 1) '(face org-meta-line))
- ; for end_src
- (cond
- ((and lang org-src-fontify-natively)
- (org-src-font-lock-fontify-block lang block-start block-end))
- (quoting
- (add-text-properties beg1 (+ end1 1) '(face
- org-block)))
- ; end of source block
- ((not org-fontify-quote-and-verse-blocks))
- ((string= block-type "quote")
- (add-text-properties beg1 end1 '(face org-quote)))
- ((string= block-type "verse")
- (add-text-properties beg1 end1 '(face org-verse))))
- t))
- ((member dc1 '("title:" "author:" "email:" "date:"))
- (add-text-properties
- beg (match-end 3)
- (if (member (intern (substring dc1 0 -1)) org-hidden-keywords)
- '(font-lock-fontified t invisible t)
- '(font-lock-fontified t face org-document-info-keyword)))
- (add-text-properties
- (match-beginning 6) (match-end 6)
- (if (string-equal dc1 "title:")
- '(font-lock-fontified t face org-document-title)
- '(font-lock-fontified t face org-document-info))))
- ((not (member (char-after beg) '(?\ ?\t)))
- ;; just any other in-buffer setting, but not indented
- (add-text-properties
- beg (match-end 0)
- '(font-lock-fontified t face org-meta-line))
- t)
- ((or (member dc1 '("begin:" "end:" "caption:" "label:"
- "orgtbl:" "tblfm:" "tblname:" "result:"
- "results:" "source:" "srcname:" "call:"))
- (and (match-end 4) (equal dc3 "attr")))
- (add-text-properties
- beg (match-end 0)
- '(font-lock-fontified t face org-meta-line))
- t)
- ((member dc3 '(" " ""))
- (add-text-properties
- beg (match-end 0)
- '(font-lock-fontified t face font-lock-comment-face)))
- (t nil))))))
-
-(defun org-activate-angle-links (limit)
- "Run through the buffer and add overlays to links."
- (if (re-search-forward org-angle-link-re limit t)
- (progn
- (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
- (add-text-properties (match-beginning 0) (match-end 0)
- (list 'mouse-face 'highlight
- 'keymap org-mouse-map))
- (org-rear-nonsticky-at (match-end 0))
- t)))
-
-(defun org-activate-footnote-links (limit)
- "Run through the buffer and add overlays to links."
- (if (re-search-forward "\\(^\\|[^][]\\)\\(\\[\\([0-9]+\\]\\|fn:[^ \t\r\n:]+?[]:]\\)\\)"
- limit t)
- (progn
- (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
- (add-text-properties (match-beginning 2) (match-end 2)
- (list 'mouse-face 'highlight
- 'keymap org-mouse-map
- 'help-echo
- (if (= (point-at-bol) (match-beginning 2))
- "Footnote definition"
- "Footnote reference")
- ))
- (org-rear-nonsticky-at (match-end 2))
- t)))
-
-(defun org-activate-bracket-links (limit)
- "Run through the buffer and add overlays to bracketed links."
- (if (re-search-forward org-bracket-link-regexp limit t)
- (let* ((help (concat "LINK: "
- (org-match-string-no-properties 1)))
- ;; FIXME: above we should remove the escapes.
- ;; but that requires another match, protecting match data,
- ;; a lot of overhead for font-lock.
- (ip (org-maybe-intangible
- (list 'invisible 'org-link
- 'keymap org-mouse-map 'mouse-face 'highlight
- 'font-lock-multiline t 'help-echo help)))
- (vp (list 'keymap org-mouse-map 'mouse-face 'highlight
- 'font-lock-multiline t 'help-echo help)))
- ;; We need to remove the invisible property here. Table narrowing
- ;; may have made some of this invisible.
- (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
- (remove-text-properties (match-beginning 0) (match-end 0)
- '(invisible nil))
- (if (match-end 3)
- (progn
- (add-text-properties (match-beginning 0) (match-beginning 3) ip)
- (org-rear-nonsticky-at (match-beginning 3))
- (add-text-properties (match-beginning 3) (match-end 3) vp)
- (org-rear-nonsticky-at (match-end 3))
- (add-text-properties (match-end 3) (match-end 0) ip)
- (org-rear-nonsticky-at (match-end 0)))
- (add-text-properties (match-beginning 0) (match-beginning 1) ip)
- (org-rear-nonsticky-at (match-beginning 1))
- (add-text-properties (match-beginning 1) (match-end 1) vp)
- (org-rear-nonsticky-at (match-end 1))
- (add-text-properties (match-end 1) (match-end 0) ip)
- (org-rear-nonsticky-at (match-end 0)))
- t)))
-
-(defun org-activate-dates (limit)
- "Run through the buffer and add overlays to dates."
- (if (re-search-forward org-tsr-regexp-both limit t)
- (progn
- (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
- (add-text-properties (match-beginning 0) (match-end 0)
- (list 'mouse-face 'highlight
- 'keymap org-mouse-map))
- (org-rear-nonsticky-at (match-end 0))
- (when org-display-custom-times
- (if (match-end 3)
- (org-display-custom-time (match-beginning 3) (match-end 3)))
- (org-display-custom-time (match-beginning 1) (match-end 1)))
- t)))
-
-(defvar org-target-link-regexp nil
- "Regular expression matching radio targets in plain text.")
-(make-variable-buffer-local 'org-target-link-regexp)
-(defvar org-target-regexp "<<\\([^<>\n\r]+\\)>>"
- "Regular expression matching a link target.")
-(defvar org-radio-target-regexp "<<<\\([^<>\n\r]+\\)>>>"
- "Regular expression matching a radio target.")
-(defvar org-any-target-regexp "<<<?\\([^<>\n\r]+\\)>>>?" ; FIXME, not exact, would match <<<aaa>> as a radio target.
- "Regular expression matching any target.")
-
-(defun org-activate-target-links (limit)
- "Run through the buffer and add overlays to target matches."
- (when org-target-link-regexp
- (let ((case-fold-search t))
- (if (re-search-forward org-target-link-regexp limit t)
- (progn
- (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))
- (add-text-properties (match-beginning 0) (match-end 0)
- (list 'mouse-face 'highlight
- 'keymap org-mouse-map
- 'help-echo "Radio target link"
- 'org-linked-text t))
- (org-rear-nonsticky-at (match-end 0))
- t)))))
-
-(defun org-update-radio-target-regexp ()
- "Find all radio targets in this file and update the regular expression."
- (interactive)
- (when (memq 'radio org-activate-links)
- (setq org-target-link-regexp
- (org-make-target-link-regexp (org-all-targets 'radio)))
- (org-restart-font-lock)))
-
-(defun org-hide-wide-columns (limit)
- (let (s e)
- (setq s (text-property-any (point) (or limit (point-max))
- 'org-cwidth t))
- (when s
- (setq e (next-single-property-change s 'org-cwidth))
- (add-text-properties s e (org-maybe-intangible '(invisible org-cwidth)))
- (goto-char e)
- t)))
-
-(defvar org-latex-and-specials-regexp nil
- "Regular expression for highlighting export special stuff.")
-(defvar org-match-substring-regexp)
-(defvar org-match-substring-with-braces-regexp)
-
-;; This should be with the exporter code, but we also use if for font-locking
-(defconst org-export-html-special-string-regexps
- '(("\\\\-" . "&shy;")
- ("---\\([^-]\\)" . "&mdash;\\1")
- ("--\\([^-]\\)" . "&ndash;\\1")
- ("\\.\\.\\." . "&hellip;"))
- "Regular expressions for special string conversion.")
-
-
-(defun org-compute-latex-and-specials-regexp ()
- "Compute regular expression for stuff treated specially by exporters."
- (if (not org-highlight-latex-fragments-and-specials)
- (org-set-local 'org-latex-and-specials-regexp nil)
- (require 'org-exp)
- (let*
- ((matchers (plist-get org-format-latex-options :matchers))
- (latexs (delq nil (mapcar (lambda (x) (if (member (car x) matchers) x))
- org-latex-regexps)))
- (org-export-allow-BIND nil)
- (options (org-combine-plists (org-default-export-plist)
- (org-infile-export-plist)))
- (org-export-with-sub-superscripts (plist-get options :sub-superscript))
- (org-export-with-LaTeX-fragments (plist-get options :LaTeX-fragments))
- (org-export-with-TeX-macros (plist-get options :TeX-macros))
- (org-export-html-expand (plist-get options :expand-quoted-html))
- (org-export-with-special-strings (plist-get options :special-strings))
- (re-sub
- (cond
- ((equal org-export-with-sub-superscripts '{})
- (list org-match-substring-with-braces-regexp))
- (org-export-with-sub-superscripts
- (list org-match-substring-regexp))
- (t nil)))
- (re-latex
- (if org-export-with-LaTeX-fragments
- (mapcar (lambda (x) (nth 1 x)) latexs)))
- (re-macros
- (if org-export-with-TeX-macros
- (list (concat "\\\\"
- (regexp-opt
- (append
-
- (delq nil
- (mapcar 'car-safe
- (append org-entities-user
- org-entities)))
- (if (boundp 'org-latex-entities)
- (mapcar (lambda (x)
- (or (car-safe x) x))
- org-latex-entities)
- nil))
- 'words))) ; FIXME
- ))
- ;; (list "\\\\\\(?:[a-zA-Z]+\\)")))
- (re-special (if org-export-with-special-strings
- (mapcar (lambda (x) (car x))
- org-export-html-special-string-regexps)))
- (re-rest
- (delq nil
- (list
- (if org-export-html-expand "@<[^>\n]+>")
- ))))
- (org-set-local
- 'org-latex-and-specials-regexp
- (mapconcat 'identity (append re-latex re-sub re-macros re-special
- re-rest) "\\|")))))
-
-(defun org-do-latex-and-special-faces (limit)
- "Run through the buffer and add overlays to links."
- (when org-latex-and-specials-regexp
- (let (rtn d)
- (while (and (not rtn) (re-search-forward org-latex-and-specials-regexp
- limit t))
- (if (not (memq (car-safe (get-text-property (1+ (match-beginning 0))
- 'face))
- '(org-code org-verbatim underline)))
- (progn
- (setq rtn t
- d (cond ((member (char-after (1+ (match-beginning 0)))
- '(?_ ?^)) 1)
- (t 0)))
- (font-lock-prepend-text-property
- (+ d (match-beginning 0)) (match-end 0)
- 'face 'org-latex-and-export-specials)
- (add-text-properties (+ d (match-beginning 0)) (match-end 0)
- '(font-lock-multiline t)))))
- rtn)))
-
-(defun org-restart-font-lock ()
- "Restart `font-lock-mode', to force refontification."
- (when (and (boundp 'font-lock-mode) font-lock-mode)
- (font-lock-mode -1)
- (font-lock-mode 1)))
-
-(defun org-all-targets (&optional radio)
- "Return a list of all targets in this file.
-With optional argument RADIO, only find radio targets."
- (let ((re (if radio org-radio-target-regexp org-target-regexp))
- rtn)
- (save-excursion
- (goto-char (point-min))
- (while (re-search-forward re nil t)
- (add-to-list 'rtn (downcase (org-match-string-no-properties 1))))
- rtn)))
-
-(defun org-make-target-link-regexp (targets)
- "Make regular expression matching all strings in TARGETS.
-The regular expression finds the targets also if there is a line break
-between words."
- (and targets
- (concat
- "\\<\\("
- (mapconcat
- (lambda (x)
- (while (string-match " +" x)
- (setq x (replace-match "\\s-+" t t x)))
- x)
- targets
- "\\|")
- "\\)\\>")))
-
-(defun org-activate-tags (limit)
- (if (re-search-forward (org-re "^\\*+.*[ \t]\\(:[[:alnum:]_@#%:]+:\\)[ \r\n]") limit t)
- (progn
- (org-remove-flyspell-overlays-in (match-beginning 1) (match-end 1))
- (add-text-properties (match-beginning 1) (match-end 1)
- (list 'mouse-face 'highlight
- 'keymap org-mouse-map))
- (org-rear-nonsticky-at (match-end 1))
- t)))
-
-(defun org-outline-level ()
- "Compute the outline level of the heading at point.
-This function assumes that the cursor is at the beginning of a line matched
-by `outline-regexp'. Otherwise it returns garbage.
-If this is called at a normal headline, the level is the number of stars.
-Use `org-reduced-level' to remove the effect of `org-odd-levels'.
-For plain list items, if they are matched by `outline-regexp', this returns
-1000 plus the line indentation."
- (save-excursion
- (looking-at outline-regexp)
- (if (match-beginning 1)
- (+ (org-get-string-indentation (match-string 1)) 1000)
- (1- (- (match-end 0) (match-beginning 0))))))
-
-(defvar org-font-lock-keywords nil)
-
-(defconst org-property-re (org-re "^[ \t]*\\(:\\([-[:alnum:]_]+\\):\\)[ \t]*\\([^ \t\r\n].*\\)")
- "Regular expression matching a property line.")
-
-(defvar org-font-lock-hook nil
- "Functions to be called for special font lock stuff.")
-
-(defvar org-font-lock-set-keywords-hook nil
- "Functions that can manipulate `org-font-lock-extra-keywords'.
-This is calles after `org-font-lock-extra-keywords' is defined, but before
-it is installed to be used by font lock. This can be useful if something
-needs to be inserted at a specific position in the font-lock sequence.")
-
-(defun org-font-lock-hook (limit)
- (run-hook-with-args 'org-font-lock-hook limit))
-
-(defun org-set-font-lock-defaults ()
- (let* ((em org-fontify-emphasized-text)
- (lk org-activate-links)
- (org-font-lock-extra-keywords
- (list
- ;; Call the hook
- '(org-font-lock-hook)
- ;; Headlines
- `(,(if org-fontify-whole-heading-line
- "^\\(\\**\\)\\(\\* \\)\\(.*\n?\\)"
- "^\\(\\**\\)\\(\\* \\)\\(.*\\)")
- (1 (org-get-level-face 1))
- (2 (org-get-level-face 2))
- (3 (org-get-level-face 3)))
- ;; Table lines
- '("^[ \t]*\\(\\(|\\|\\+-[-+]\\).*\\S-\\)"
- (1 'org-table t))
- ;; Table internals
- '("^[ \t]*|\\(?:.*?|\\)? *\\(:?=[^|\n]*\\)" (1 'org-formula t))
- '("^[ \t]*| *\\([#*]\\) *|" (1 'org-formula t))
- '("^[ \t]*|\\( *\\([$!_^/]\\) *|.*\\)|" (1 'org-formula t))
- '("| *\\(<[lrc]?[0-9]*>\\)" (1 'org-formula t))
- ;; Drawers
- (list org-drawer-regexp '(0 'org-special-keyword t))
- (list "^[ \t]*:END:" '(0 'org-special-keyword t))
- ;; Properties
- (list org-property-re
- '(1 'org-special-keyword t)
- '(3 'org-property-value t))
- ;; Links
- (if (memq 'tag lk) '(org-activate-tags (1 'org-tag prepend)))
- (if (memq 'angle lk) '(org-activate-angle-links (0 'org-link t)))
- (if (memq 'plain lk) '(org-activate-plain-links))
- (if (memq 'bracket lk) '(org-activate-bracket-links (0 'org-link t)))
- (if (memq 'radio lk) '(org-activate-target-links (0 'org-link t)))
- (if (memq 'date lk) '(org-activate-dates (0 'org-date t)))
- (if (memq 'footnote lk) '(org-activate-footnote-links
- (2 'org-footnote t)))
- '("^&?%%(.*\\|<%%([^>\n]*?>" (0 'org-sexp-date t))
- '(org-hide-wide-columns (0 nil append))
- ;; TODO lines
- (list (concat "^\\*+[ \t]+" org-todo-regexp "\\([ \t]\\|$\\)")
- '(1 (org-get-todo-face 1) t))
- ;; DONE
- (if org-fontify-done-headline
- (list (concat "^[*]+ +\\<\\("
- (mapconcat 'regexp-quote org-done-keywords "\\|")
- "\\)\\(.*\\)")
- '(2 'org-headline-done t))
- nil)
- ;; Priorities
- '(org-font-lock-add-priority-faces)
- ;; Tags
- '(org-font-lock-add-tag-faces)
- ;; Special keywords
- (list (concat "\\<" org-deadline-string) '(0 'org-special-keyword t))
- (list (concat "\\<" org-scheduled-string) '(0 'org-special-keyword t))
- (list (concat "\\<" org-closed-string) '(0 'org-special-keyword t))
- (list (concat "\\<" org-clock-string) '(0 'org-special-keyword t))
- ;; Emphasis
- (if em
- (if (featurep 'xemacs)
- '(org-do-emphasis-faces (0 nil append))
- '(org-do-emphasis-faces)))
- ;; Checkboxes
- '("^[ \t]*\\(?:[-+*]\\|[0-9]+[.)]\\)[ \t]+\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\(\\[[- X]\\]\\)"
- 1 'org-checkbox prepend)
- (if (cdr (assq 'checkbox org-list-automatic-rules))
- '("\\[\\([0-9]*%\\)\\]\\|\\[\\([0-9]*\\)/\\([0-9]*\\)\\]"
- (0 (org-get-checkbox-statistics-face) t)))
- ;; Description list items
- '("^[ \t]*\\([-+*]\\|[0-9]+[.)]\\)[ \t]+\\(.*? ::\\)"
- 2 'bold prepend)
- ;; ARCHIVEd headings
- (list (concat "^\\*+ \\(.*:" org-archive-tag ":.*\\)")
- '(1 'org-archived prepend))
- ;; Specials
- '(org-do-latex-and-special-faces)
- '(org-fontify-entities)
- '(org-raise-scripts)
- ;; Code
- '(org-activate-code (1 'org-code t))
- ;; COMMENT
- (list (concat "^\\*+[ \t]+\\<\\(" org-comment-string
- "\\|" org-quote-string "\\)\\>")
- '(1 'org-special-keyword t))
- '("^#.*" (0 'font-lock-comment-face t))
- ;; Blocks and meta lines
- '(org-fontify-meta-lines-and-blocks)
- )))
- (setq org-font-lock-extra-keywords (delq nil org-font-lock-extra-keywords))
- (run-hooks 'org-font-lock-set-keywords-hook)
- ;; Now set the full font-lock-keywords
- (org-set-local 'org-font-lock-keywords org-font-lock-extra-keywords)
- (org-set-local 'font-lock-defaults
- '(org-font-lock-keywords t nil nil backward-paragraph))
- (kill-local-variable 'font-lock-keywords) nil))
-
-(defun org-toggle-pretty-entities ()
- "Toggle the composition display of entities as UTF8 characters."
- (interactive)
- (org-set-local 'org-pretty-entities (not org-pretty-entities))
- (org-restart-font-lock)
- (if org-pretty-entities
- (message "Entities are displayed as UTF8 characers")
- (save-restriction
- (widen)
- (org-decompose-region (point-min) (point-max))
- (message "Entities are displayed plain"))))
-
-(defun org-fontify-entities (limit)
- "Find an entity to fontify."
- (let (ee)
- (when org-pretty-entities
- (catch 'match
- (while (re-search-forward
- "\\\\\\([a-zA-Z][a-zA-Z0-9]*\\)\\($\\|[^[:alnum:]\n]\\)"
- limit t)
- (if (and (not (org-in-indented-comment-line))
- (setq ee (org-entity-get (match-string 1)))
- (= (length (nth 6 ee)) 1))
- (progn
- (add-text-properties
- (match-beginning 0) (match-end 1)
- (list 'font-lock-fontified t))
- (compose-region (match-beginning 0) (match-end 1)
- (nth 6 ee) nil)
- (backward-char 1)
- (throw 'match t))))
- nil))))
-
-(defun org-fontify-like-in-org-mode (s &optional odd-levels)
- "Fontify string S like in Org-mode."
- (with-temp-buffer
- (insert s)
- (let ((org-odd-levels-only odd-levels))
- (org-mode)
- (font-lock-fontify-buffer)
- (buffer-string))))
-
-(defvar org-m nil)
-(defvar org-l nil)
-(defvar org-f nil)
-(defun org-get-level-face (n)
- "Get the right face for match N in font-lock matching of headlines."
- (setq org-l (- (match-end 2) (match-beginning 1) 1))
- (if org-odd-levels-only (setq org-l (1+ (/ org-l 2))))
- (if org-cycle-level-faces
- (setq org-f (nth (% (1- org-l) org-n-level-faces) org-level-faces))
- (setq org-f (nth (1- (min org-l org-n-level-faces)) org-level-faces)))
- (cond
- ((eq n 1) (if org-hide-leading-stars 'org-hide org-f))
- ((eq n 2) org-f)
- (t (if org-level-color-stars-only nil org-f))))
-
-
-(defun org-get-todo-face (kwd)
- "Get the right face for a TODO keyword KWD.
-If KWD is a number, get the corresponding match group."
- (if (numberp kwd) (setq kwd (match-string kwd)))
- (or (org-face-from-face-or-color
- 'todo 'org-todo (cdr (assoc kwd org-todo-keyword-faces)))
- (and (member kwd org-done-keywords) 'org-done)
- 'org-todo))
-
-(defun org-face-from-face-or-color (context inherit face-or-color)
- "Create a face list that inherits INHERIT, but sets the foreground color.
-When FACE-OR-COLOR is not a string, just return it."
- (if (stringp face-or-color)
- (list :inherit inherit
- (cdr (assoc context org-faces-easy-properties))
- face-or-color)
- face-or-color))
-
-(defun org-font-lock-add-tag-faces (limit)
- "Add the special tag faces."
- (when (and org-tag-faces org-tags-special-faces-re)
- (while (re-search-forward org-tags-special-faces-re limit t)
- (add-text-properties (match-beginning 1) (match-end 1)
- (list 'face (org-get-tag-face 1)
- 'font-lock-fontified t))
- (backward-char 1))))
-
-(defun org-font-lock-add-priority-faces (limit)
- "Add the special priority faces."
- (while (re-search-forward "\\[#\\([A-Z0-9]\\)\\]" limit t)
- (add-text-properties
- (match-beginning 0) (match-end 0)
- (list 'face (or (org-face-from-face-or-color
- 'priority 'org-special-keyword
- (cdr (assoc (char-after (match-beginning 1))
- org-priority-faces)))
- 'org-special-keyword)
- 'font-lock-fontified t))))
-
-(defun org-get-tag-face (kwd)
- "Get the right face for a TODO keyword KWD.
-If KWD is a number, get the corresponding match group."
- (if (numberp kwd) (setq kwd (match-string kwd)))
- (or (org-face-from-face-or-color
- 'tag 'org-tag (cdr (assoc kwd org-tag-faces)))
- 'org-tag))
-
-(defun org-unfontify-region (beg end &optional maybe_loudly)
- "Remove fontification and activation overlays from links."
- (font-lock-default-unfontify-region beg end)
- (let* ((buffer-undo-list t)
- (inhibit-read-only t) (inhibit-point-motion-hooks t)
- (inhibit-modification-hooks t)
- deactivate-mark buffer-file-name buffer-file-truename)
- (org-decompose-region beg end)
- (remove-text-properties
- beg end
- (if org-indent-mode
- ;; also remove line-prefix and wrap-prefix properties
- '(mouse-face t keymap t org-linked-text t
- invisible t intangible t
- line-prefix t wrap-prefix t
- org-no-flyspell t org-emphasis t)
- '(mouse-face t keymap t org-linked-text t
- invisible t intangible t
- org-no-flyspell t org-emphasis t)))
- (org-remove-font-lock-display-properties beg end)))
-
-(defconst org-script-display '(((raise -0.3) (height 0.7))
- ((raise 0.3) (height 0.7))
- ((raise -0.5))
- ((raise 0.5)))
- "Display properties for showing superscripts and subscripts.")
-
-(defun org-remove-font-lock-display-properties (beg end)
- "Remove specific display properties that have been added by font lock.
-The will remove the raise properties that are used to show superscripts
-and subscripts."
- (let (next prop)
- (while (< beg end)
- (setq next (next-single-property-change beg 'display nil end)
- prop (get-text-property beg 'display))
- (if (member prop org-script-display)
- (put-text-property beg next 'display nil))
- (setq beg next))))
-
-(defun org-raise-scripts (limit)
- "Add raise properties to sub/superscripts."
- (when (and org-pretty-entities org-pretty-entities-include-sub-superscripts)
- (if (re-search-forward
- (if (eq org-use-sub-superscripts t)
- org-match-substring-regexp
- org-match-substring-with-braces-regexp)
- limit t)
- (let* ((pos (point)) table-p comment-p
- (mpos (match-beginning 3))
- (emph-p (get-text-property mpos 'org-emphasis))
- (link-p (get-text-property mpos 'mouse-face))
- (keyw-p (eq 'org-special-keyword (get-text-property mpos 'face))))
- (goto-char (point-at-bol))
- (setq table-p (org-looking-at-p org-table-dataline-regexp)
- comment-p (org-looking-at-p "[ \t]*#"))
- (goto-char pos)
- ;; FIXME: Should we go back one character here, for a_b^c
- ;; (goto-char (1- pos)) ;????????????????????
- (if (or comment-p emph-p link-p keyw-p)
- t
- (put-text-property (match-beginning 3) (match-end 0)
- 'display
- (if (equal (char-after (match-beginning 2)) ?^)
- (nth (if table-p 3 1) org-script-display)
- (nth (if table-p 2 0) org-script-display)))
- (add-text-properties (match-beginning 2) (match-end 2)
- (list 'invisible t
- 'org-dwidth t 'org-dwidth-n 1))
- (if (and (eq (char-after (match-beginning 3)) ?{)
- (eq (char-before (match-end 3)) ?}))
- (progn
- (add-text-properties
- (match-beginning 3) (1+ (match-beginning 3))
- (list 'invisible t 'org-dwidth t 'org-dwidth-n 1))
- (add-text-properties
- (1- (match-end 3)) (match-end 3)
- (list 'invisible t 'org-dwidth t 'org-dwidth-n 1))))
- t)))))
-
-;;;; Visibility cycling, including org-goto and indirect buffer
-
-;;; Cycling
-
-(defvar org-cycle-global-status nil)
-(make-variable-buffer-local 'org-cycle-global-status)
-(defvar org-cycle-subtree-status nil)
-(make-variable-buffer-local 'org-cycle-subtree-status)
-
-;;;###autoload
-
-(defvar org-inlinetask-min-level)
-
-(defun org-cycle (&optional arg)
- "TAB-action and visibility cycling for Org-mode.
-
-This is the command invoked in Org-mode by the TAB key. Its main purpose
-is outline visibility cycling, but it also invokes other actions
-in special contexts.
-
-- When this function is called with a prefix argument, rotate the entire
- buffer through 3 states (global cycling)
- 1. OVERVIEW: Show only top-level headlines.
- 2. CONTENTS: Show all headlines of all levels, but no body text.
- 3. SHOW ALL: Show everything.
- When called with two `C-u C-u' prefixes, switch to the startup visibility,
- determined by the variable `org-startup-folded', and by any VISIBILITY
- properties in the buffer.
- When called with three `C-u C-u C-u' prefixed, show the entire buffer,
- including any drawers.
-
-- When inside a table, re-align the table and move to the next field.
-
-- When point is at the beginning of a headline, rotate the subtree started
- by this line through 3 different states (local cycling)
- 1. FOLDED: Only the main headline is shown.
- 2. CHILDREN: The main headline and the direct children are shown.
- From this state, you can move to one of the children
- and zoom in further.
- 3. SUBTREE: Show the entire subtree, including body text.
- If there is no subtree, switch directly from CHILDREN to FOLDED.
-
-- When point is at the beginning of an empty headline and the variable
- `org-cycle-level-after-item/entry-creation' is set, cycle the level
- of the headline by demoting and promoting it to likely levels. This
- speeds up creation document structure by pressing TAB once or several
- times right after creating a new headline.
-
-- When there is a numeric prefix, go up to a heading with level ARG, do
- a `show-subtree' and return to the previous cursor position. If ARG
- is negative, go up that many levels.
-
-- When point is not at the beginning of a headline, execute the global
- binding for TAB, which is re-indenting the line. See the option
- `org-cycle-emulate-tab' for details.
-
-- Special case: if point is at the beginning of the buffer and there is
- no headline in line 1, this function will act as if called with prefix arg
- (C-u TAB, same as S-TAB) also when called without prefix arg.
- But only if also the variable `org-cycle-global-at-bob' is t."
- (interactive "P")
- (org-load-modules-maybe)
- (unless (or (run-hook-with-args-until-success 'org-tab-first-hook)
- (and org-cycle-level-after-item/entry-creation
- (or (org-cycle-level)
- (org-cycle-item-indentation))))
- (let* ((limit-level
- (or org-cycle-max-level
- (and (boundp 'org-inlinetask-min-level)
- org-inlinetask-min-level
- (1- org-inlinetask-min-level))))
- (nstars (and limit-level
- (if org-odd-levels-only
- (and limit-level (1- (* limit-level 2)))
- limit-level)))
- (outline-regexp
- (cond
- ((not (org-mode-p)) outline-regexp)
- ((or (eq org-cycle-include-plain-lists 'integrate)
- (and org-cycle-include-plain-lists (org-at-item-p)))
- (concat "\\(?:\\*"
- (if nstars (format "\\{1,%d\\}" nstars) "+")
- " \\|\\([ \t]*\\)\\([-+*]\\|[0-9]+[.)]\\) \\)"))
- (t (concat "\\*" (if nstars (format "\\{1,%d\\} " nstars) "+ ")))))
- (bob-special (and org-cycle-global-at-bob (not arg) (bobp)
- (not (looking-at outline-regexp))))
- (org-cycle-hook
- (if bob-special
- (delq 'org-optimize-window-after-visibility-change
- (copy-sequence org-cycle-hook))
- org-cycle-hook))
- (pos (point)))
-
- (if (or bob-special (equal arg '(4)))
- ;; special case: use global cycling
- (setq arg t))
-
- (cond
-
- ((equal arg '(16))
- (setq last-command 'dummy)
- (org-set-startup-visibility)
- (message "Startup visibility, plus VISIBILITY properties"))
-
- ((equal arg '(64))
- (show-all)
- (message "Entire buffer visible, including drawers"))
-
- ((org-at-table-p 'any)
- ;; Enter the table or move to the next field in the table
- (if (org-at-table.el-p)
- (message "Use C-c ' to edit table.el tables")
- (if arg (org-table-edit-field t)
- (org-table-justify-field-maybe)
- (call-interactively 'org-table-next-field))))
-
- ((run-hook-with-args-until-success
- 'org-tab-after-check-for-table-hook))
-
- ((eq arg t) ;; Global cycling
- (org-cycle-internal-global))
-
- ((and org-drawers org-drawer-regexp
- (save-excursion
- (beginning-of-line 1)
- (looking-at org-drawer-regexp)))
- ;; Toggle block visibility
- (org-flag-drawer
- (not (get-char-property (match-end 0) 'invisible))))
-
- ((integerp arg)
- ;; Show-subtree, ARG levels up from here.
- (save-excursion
- (org-back-to-heading)
- (outline-up-heading (if (< arg 0) (- arg)
- (- (funcall outline-level) arg)))
- (org-show-subtree)))
-
- ((and (save-excursion (beginning-of-line 1) (looking-at outline-regexp))
- (or (bolp) (not (eq org-cycle-emulate-tab 'exc-hl-bol))))
-
- (org-cycle-internal-local))
-
- ;; TAB emulation and template completion
- (buffer-read-only (org-back-to-heading))
-
- ((run-hook-with-args-until-success
- 'org-tab-after-check-for-cycling-hook))
-
- ((org-try-structure-completion))
-
- ((org-try-cdlatex-tab))
-
- ((run-hook-with-args-until-success
- 'org-tab-before-tab-emulation-hook))
-
- ((and (eq org-cycle-emulate-tab 'exc-hl-bol)
- (or (not (bolp))
- (not (looking-at outline-regexp))))
- (call-interactively (global-key-binding "\t")))
-
- ((if (and (memq org-cycle-emulate-tab '(white whitestart))
- (save-excursion (beginning-of-line 1) (looking-at "[ \t]*"))
- (or (and (eq org-cycle-emulate-tab 'white)
- (= (match-end 0) (point-at-eol)))
- (and (eq org-cycle-emulate-tab 'whitestart)
- (>= (match-end 0) pos))))
- t
- (eq org-cycle-emulate-tab t))
- (call-interactively (global-key-binding "\t")))
-
- (t (save-excursion
- (org-back-to-heading)
- (org-cycle)))))))
-
-(defun org-cycle-internal-global ()
- "Do the global cycling action."
- (cond
- ((and (eq last-command this-command)
- (eq org-cycle-global-status 'overview))
- ;; We just created the overview - now do table of contents
- ;; This can be slow in very large buffers, so indicate action
- (run-hook-with-args 'org-pre-cycle-hook 'contents)
- (message "CONTENTS...")
- (org-content)
- (message "CONTENTS...done")
- (setq org-cycle-global-status 'contents)
- (run-hook-with-args 'org-cycle-hook 'contents))
-
- ((and (eq last-command this-command)
- (eq org-cycle-global-status 'contents))
- ;; We just showed the table of contents - now show everything
- (run-hook-with-args 'org-pre-cycle-hook 'all)
- (show-all)
- (message "SHOW ALL")
- (setq org-cycle-global-status 'all)
- (run-hook-with-args 'org-cycle-hook 'all))
-
- (t
- ;; Default action: go to overview
- (run-hook-with-args 'org-pre-cycle-hook 'overview)
- (org-overview)
- (message "OVERVIEW")
- (setq org-cycle-global-status 'overview)
- (run-hook-with-args 'org-cycle-hook 'overview))))
-
-(defun org-cycle-internal-local ()
- "Do the local cycling action."
- (let ((goal-column 0) eoh eol eos level has-children children-skipped)
- ;; First, some boundaries
- (save-excursion
- (org-back-to-heading)
- (setq level (funcall outline-level))
- (save-excursion
- (beginning-of-line 2)
- (if (or (featurep 'xemacs) (<= emacs-major-version 21))
- ; XEmacs does not have `next-single-char-property-change'
- ; I'm not sure about Emacs 21.
- (while (and (not (eobp)) ;; this is like `next-line'
- (get-char-property (1- (point)) 'invisible))
- (beginning-of-line 2))
- (while (and (not (eobp)) ;; this is like `next-line'
- (get-char-property (1- (point)) 'invisible))
- (goto-char (next-single-char-property-change (point) 'invisible))
- (and (eolp) (beginning-of-line 2))))
- (setq eol (point)))
- (outline-end-of-heading) (setq eoh (point))
- (save-excursion
- (outline-next-heading)
- (setq has-children (and (org-at-heading-p t)
- (> (funcall outline-level) level))))
- ;; if we're in a list, org-end-of-subtree is in fact org-end-of-item.
- (if (org-at-item-p)
- (setq eos (if (and (org-end-of-item) (bolp))
- (1- (point))
- (point)))
- (org-end-of-subtree t)
- (unless (eobp)
- (skip-chars-forward " \t\n"))
- (setq eos (if (eobp) (point) (1- (point))))))
- ;; Find out what to do next and set `this-command'
- (cond
- ((= eos eoh)
- ;; Nothing is hidden behind this heading
- (run-hook-with-args 'org-pre-cycle-hook 'empty)
- (message "EMPTY ENTRY")
- (setq org-cycle-subtree-status nil)
- (save-excursion
- (goto-char eos)
- (outline-next-heading)
- (if (org-invisible-p) (org-flag-heading nil))))
- ((and (or (>= eol eos)
- (not (string-match "\\S-" (buffer-substring eol eos))))
- (or has-children
- (not (setq children-skipped
- org-cycle-skip-children-state-if-no-children))))
- ;; Entire subtree is hidden in one line: children view
- (run-hook-with-args 'org-pre-cycle-hook 'children)
- (org-show-entry)
- (show-children)
- (message "CHILDREN")
- (save-excursion
- (goto-char eos)
- (outline-next-heading)
- (if (org-invisible-p) (org-flag-heading nil)))
- (setq org-cycle-subtree-status 'children)
- (run-hook-with-args 'org-cycle-hook 'children))
- ((or children-skipped
- (and (eq last-command this-command)
- (eq org-cycle-subtree-status 'children)))
- ;; We just showed the children, or no children are there,
- ;; now show everything.
- (run-hook-with-args 'org-pre-cycle-hook 'subtree)
- (outline-flag-region eoh eos nil)
- (message (if children-skipped "SUBTREE (NO CHILDREN)" "SUBTREE"))
- (setq org-cycle-subtree-status 'subtree)
- (run-hook-with-args 'org-cycle-hook 'subtree))
- (t
- ;; Default action: hide the subtree.
- (run-hook-with-args 'org-pre-cycle-hook 'folded)
- (outline-flag-region eoh eos t)
- (message "FOLDED")
- (setq org-cycle-subtree-status 'folded)
- (run-hook-with-args 'org-cycle-hook 'folded)))))
-
-;;;###autoload
-(defun org-global-cycle (&optional arg)
- "Cycle the global visibility. For details see `org-cycle'.
-With \\[universal-argument] prefix arg, switch to startup visibility.
-With a numeric prefix, show all headlines up to that level."
- (interactive "P")
- (let ((org-cycle-include-plain-lists
- (if (org-mode-p) org-cycle-include-plain-lists nil)))
- (cond
- ((integerp arg)
- (show-all)
- (hide-sublevels arg)
- (setq org-cycle-global-status 'contents))
- ((equal arg '(4))
- (org-set-startup-visibility)
- (message "Startup visibility, plus VISIBILITY properties."))
- (t
- (org-cycle '(4))))))
-
-(defun org-set-startup-visibility ()
- "Set the visibility required by startup options and properties."
- (cond
- ((eq org-startup-folded t)
- (org-cycle '(4)))
- ((eq org-startup-folded 'content)
- (let ((this-command 'org-cycle) (last-command 'org-cycle))
- (org-cycle '(4)) (org-cycle '(4)))))
- (unless (eq org-startup-folded 'showeverything)
- (if org-hide-block-startup (org-hide-block-all))
- (org-set-visibility-according-to-property 'no-cleanup)
- (org-cycle-hide-archived-subtrees 'all)
- (org-cycle-hide-drawers 'all)
- (org-cycle-show-empty-lines t)))
-
-(defun org-set-visibility-according-to-property (&optional no-cleanup)
- "Switch subtree visibilities according to :VISIBILITY: property."
- (interactive)
- (let (org-show-entry-below state)
- (save-excursion
- (goto-char (point-min))
- (while (re-search-forward
- "^[ \t]*:VISIBILITY:[ \t]+\\([a-z]+\\)"
- nil t)
- (setq state (match-string 1))
- (save-excursion
- (org-back-to-heading t)
- (hide-subtree)
- (org-reveal)
- (cond
- ((equal state '("fold" "folded"))
- (hide-subtree))
- ((equal state "children")
- (org-show-hidden-entry)
- (show-children))
- ((equal state "content")
- (save-excursion
- (save-restriction
- (org-narrow-to-subtree)
- (org-content))))
- ((member state '("all" "showall"))
- (show-subtree)))))
- (unless no-cleanup
- (org-cycle-hide-archived-subtrees 'all)
- (org-cycle-hide-drawers 'all)
- (org-cycle-show-empty-lines 'all)))))
-
-(defun org-overview ()
- "Switch to overview mode, showing only top-level headlines.
-Really, this shows all headlines with level equal or greater than the level
-of the first headline in the buffer. This is important, because if the
-first headline is not level one, then (hide-sublevels 1) gives confusing
-results."
- (interactive)
- (let ((level (save-excursion
- (goto-char (point-min))
- (if (re-search-forward (concat "^" outline-regexp) nil t)
- (progn
- (goto-char (match-beginning 0))
- (funcall outline-level))))))
- (and level (hide-sublevels level))))
-
-(defun org-content (&optional arg)
- "Show all headlines in the buffer, like a table of contents.
-With numerical argument N, show content up to level N."
- (interactive "P")
- (save-excursion
- ;; Visit all headings and show their offspring
- (and (integerp arg) (org-overview))
- (goto-char (point-max))
- (catch 'exit
- (while (and (progn (condition-case nil
- (outline-previous-visible-heading 1)
- (error (goto-char (point-min))))
- t)
- (looking-at outline-regexp))
- (if (integerp arg)
- (show-children (1- arg))
- (show-branches))
- (if (bobp) (throw 'exit nil))))))
-
-
-(defun org-optimize-window-after-visibility-change (state)
- "Adjust the window after a change in outline visibility.
-This function is the default value of the hook `org-cycle-hook'."
- (when (get-buffer-window (current-buffer))
- (cond
- ((eq state 'content) nil)
- ((eq state 'all) nil)
- ((eq state 'folded) nil)
- ((eq state 'children) (or (org-subtree-end-visible-p) (recenter 1)))
- ((eq state 'subtree) (or (org-subtree-end-visible-p) (recenter 1))))))
-
-(defun org-remove-empty-overlays-at (pos)
- "Remove outline overlays that do not contain non-white stuff."
- (mapc
- (lambda (o)
- (and (eq 'outline (overlay-get o 'invisible))
- (not (string-match "\\S-" (buffer-substring (overlay-start o)
- (overlay-end o))))
- (delete-overlay o)))
- (overlays-at pos)))
-
-(defun org-clean-visibility-after-subtree-move ()
- "Fix visibility issues after moving a subtree."
- ;; First, find a reasonable region to look at:
- ;; Start two siblings above, end three below
- (let* ((beg (save-excursion
- (and (org-get-last-sibling)
- (org-get-last-sibling))
- (point)))
- (end (save-excursion
- (and (org-get-next-sibling)
- (org-get-next-sibling)
- (org-get-next-sibling))
- (if (org-at-heading-p)
- (point-at-eol)
- (point))))
- (level (looking-at "\\*+"))
- (re (if level (concat "^" (regexp-quote (match-string 0)) " "))))
- (save-excursion
- (save-restriction
- (narrow-to-region beg end)
- (when re
- ;; Properly fold already folded siblings
- (goto-char (point-min))
- (while (re-search-forward re nil t)
- (if (and (not (org-invisible-p))
- (save-excursion
- (goto-char (point-at-eol)) (org-invisible-p)))
- (hide-entry))))
- (org-cycle-show-empty-lines 'overview)
- (org-cycle-hide-drawers 'overview)))))
-
-(defun org-cycle-show-empty-lines (state)
- "Show empty lines above all visible headlines.
-The region to be covered depends on STATE when called through
-`org-cycle-hook'. Lisp program can use t for STATE to get the
-entire buffer covered. Note that an empty line is only shown if there
-are at least `org-cycle-separator-lines' empty lines before the headline."
- (when (not (= org-cycle-separator-lines 0))
- (save-excursion
- (let* ((n (abs org-cycle-separator-lines))
- (re (cond
- ((= n 1) "\\(\n[ \t]*\n\\*+\\) ")
- ((= n 2) "^[ \t]*\\(\n[ \t]*\n\\*+\\) ")
- (t (let ((ns (number-to-string (- n 2))))
- (concat "^\\(?:[ \t]*\n\\)\\{" ns "," ns "\\}"
- "[ \t]*\\(\n[ \t]*\n\\*+\\) ")))))
- beg end b e)
- (cond
- ((memq state '(overview contents t))
- (setq beg (point-min) end (point-max)))
- ((memq state '(children folded))
- (setq beg (point) end (progn (org-end-of-subtree t t)
- (beginning-of-line 2)
- (point)))))
- (when beg
- (goto-char beg)
- (while (re-search-forward re end t)
- (unless (get-char-property (match-end 1) 'invisible)
- (setq e (match-end 1))
- (if (< org-cycle-separator-lines 0)
- (setq b (save-excursion
- (goto-char (match-beginning 0))
- (org-back-over-empty-lines)
- (if (save-excursion
- (goto-char (max (point-min) (1- (point))))
- (org-on-heading-p))
- (1- (point))
- (point))))
- (setq b (match-beginning 1)))
- (outline-flag-region b e nil)))))))
- ;; Never hide empty lines at the end of the file.
- (save-excursion
- (goto-char (point-max))
- (outline-previous-heading)
- (outline-end-of-heading)
- (if (and (looking-at "[ \t\n]+")
- (= (match-end 0) (point-max)))
- (outline-flag-region (point) (match-end 0) nil))))
-
-(defun org-show-empty-lines-in-parent ()
- "Move to the parent and re-show empty lines before visible headlines."
- (save-excursion
- (let ((context (if (org-up-heading-safe) 'children 'overview)))
- (org-cycle-show-empty-lines context))))
-
-(defun org-files-list ()
- "Return `org-agenda-files' list, plus all open org-mode files.
-This is useful for operations that need to scan all of a user's
-open and agenda-wise Org files."
- (let ((files (mapcar 'expand-file-name (org-agenda-files))))
- (dolist (buf (buffer-list))
- (with-current-buffer buf
- (if (and (eq major-mode 'org-mode) (buffer-file-name))
- (let ((file (expand-file-name (buffer-file-name))))
- (unless (member file files)
- (push file files))))))
- files))
-
-(defsubst org-entry-beginning-position ()
- "Return the beginning position of the current entry."
- (save-excursion (outline-back-to-heading t) (point)))
-
-(defsubst org-entry-end-position ()
- "Return the end position of the current entry."
- (save-excursion (outline-next-heading) (point)))
-
-(defun org-cycle-hide-drawers (state)
- "Re-hide all drawers after a visibility state change."
- (when (and (org-mode-p)
- (not (memq state '(overview folded contents))))
- (save-excursion
- (let* ((globalp (memq state '(contents all)))
- (beg (if globalp (point-min) (point)))
- (end (if globalp (point-max)
- (if (eq state 'children)
- (save-excursion (outline-next-heading) (point))
- (org-end-of-subtree t)))))
- (goto-char beg)
- (while (re-search-forward org-drawer-regexp end t)
- (org-flag-drawer t))))))
-
-(defun org-flag-drawer (flag)
- (save-excursion
- (beginning-of-line 1)
- (when (looking-at "^[ \t]*:[a-zA-Z][a-zA-Z0-9]*:")
- (let ((b (match-end 0))
- (outline-regexp org-outline-regexp))
- (if (re-search-forward
- "^[ \t]*:END:"
- (save-excursion (outline-next-heading) (point)) t)
- (outline-flag-region b (point-at-eol) flag)
- (error ":END: line missing at position %s" b))))))
-
-(defun org-subtree-end-visible-p ()
- "Is the end of the current subtree visible?"
- (pos-visible-in-window-p
- (save-excursion (org-end-of-subtree t) (point))))
-
-(defun org-first-headline-recenter (&optional N)
- "Move cursor to the first headline and recenter the headline.
-Optional argument N means put the headline into the Nth line of the window."
- (goto-char (point-min))
- (when (re-search-forward (concat "^\\(" outline-regexp "\\)") nil t)
- (beginning-of-line)
- (recenter (prefix-numeric-value N))))
-
-;;; Saving and restoring visibility
-
-(defun org-outline-overlay-data (&optional use-markers)
- "Return a list of the locations of all outline overlays.
-These are overlays with the `invisible' property value `outline'.
-The return value is a list of cons cells, with start and stop
-positions for each overlay.
-If USE-MARKERS is set, return the positions as markers."
- (let (beg end)
- (save-excursion
- (save-restriction
- (widen)
- (delq nil
- (mapcar (lambda (o)
- (when (eq (overlay-get o 'invisible) 'outline)
- (setq beg (overlay-start o)
- end (overlay-end o))
- (and beg end (> end beg)
- (if use-markers
- (cons (move-marker (make-marker) beg)
- (move-marker (make-marker) end))
- (cons beg end)))))
- (overlays-in (point-min) (point-max))))))))
-
-(defun org-set-outline-overlay-data (data)
- "Create visibility overlays for all positions in DATA.
-DATA should have been made by `org-outline-overlay-data'."
- (let (o)
- (save-excursion
- (save-restriction
- (widen)
- (show-all)
- (mapc (lambda (c)
- (setq o (make-overlay (car c) (cdr c)))
- (overlay-put o 'invisible 'outline))
- data)))))
-
-;;; Folding of blocks
-
-(defconst org-block-regexp
-
- "^[ \t]*#\\+begin_\\([^ \n]+\\)\\(\\([^\n]+\\)\\)?\n\\([^\000]+?\\)#\\+end_\\1[ \t]*$"
- "Regular expression for hiding blocks.")
-
-(defvar org-hide-block-overlays nil
- "Overlays hiding blocks.")
-(make-variable-buffer-local 'org-hide-block-overlays)
-
-(defun org-block-map (function &optional start end)
- "Call FUNCTION at the head of all source blocks in the current buffer.
-Optional arguments START and END can be used to limit the range."
- (let ((start (or start (point-min)))
- (end (or end (point-max))))
- (save-excursion
- (goto-char start)
- (while (and (< (point) end) (re-search-forward org-block-regexp end t))
- (save-excursion
- (save-match-data
- (goto-char (match-beginning 0))
- (funcall function)))))))
-
-(defun org-hide-block-toggle-all ()
- "Toggle the visibility of all blocks in the current buffer."
- (org-block-map #'org-hide-block-toggle))
-
-(defun org-hide-block-all ()
- "Fold all blocks in the current buffer."
- (interactive)
- (org-show-block-all)
- (org-block-map #'org-hide-block-toggle-maybe))
-
-(defun org-show-block-all ()
- "Unfold all blocks in the current buffer."
- (interactive)
- (mapc 'delete-overlay org-hide-block-overlays)
- (setq org-hide-block-overlays nil))
-
-(defun org-hide-block-toggle-maybe ()
- "Toggle visibility of block at point."
- (interactive)
- (let ((case-fold-search t))
- (if (save-excursion
- (beginning-of-line 1)
- (looking-at org-block-regexp))
- (progn (org-hide-block-toggle)
- t) ;; to signal that we took action
- nil))) ;; to signal that we did not
-
-(defun org-hide-block-toggle (&optional force)
- "Toggle the visibility of the current block."
- (interactive)
- (save-excursion
- (beginning-of-line)
- (if (re-search-forward org-block-regexp nil t)
- (let ((start (- (match-beginning 4) 1)) ;; beginning of body
- (end (match-end 0)) ;; end of entire body
- ov)
- (if (memq t (mapcar (lambda (overlay)
- (eq (overlay-get overlay 'invisible)
- 'org-hide-block))
- (overlays-at start)))
- (if (or (not force) (eq force 'off))
- (mapc (lambda (ov)
- (when (member ov org-hide-block-overlays)
- (setq org-hide-block-overlays
- (delq ov org-hide-block-overlays)))
- (when (eq (overlay-get ov 'invisible)
- 'org-hide-block)
- (delete-overlay ov)))
- (overlays-at start)))
- (setq ov (make-overlay start end))
- (overlay-put ov 'invisible 'org-hide-block)
- ;; make the block accessible to isearch
- (overlay-put
- ov 'isearch-open-invisible
- (lambda (ov)
- (when (member ov org-hide-block-overlays)
- (setq org-hide-block-overlays
- (delq ov org-hide-block-overlays)))
- (when (eq (overlay-get ov 'invisible)
- 'org-hide-block)
- (delete-overlay ov))))
- (push ov org-hide-block-overlays)))
- (error "Not looking at a source block"))))
-
-;; org-tab-after-check-for-cycling-hook
-(add-hook 'org-tab-first-hook 'org-hide-block-toggle-maybe)
-;; Remove overlays when changing major mode
-(add-hook 'org-mode-hook
- (lambda () (org-add-hook 'change-major-mode-hook
- 'org-show-block-all 'append 'local)))
-
-;;; Org-goto
-
-(defvar org-goto-window-configuration nil)
-(defvar org-goto-marker nil)
-(defvar org-goto-map
- (let ((map (make-sparse-keymap)))
- (let ((cmds '(isearch-forward isearch-backward kill-ring-save set-mark-command mouse-drag-region universal-argument org-occur)) cmd)
- (while (setq cmd (pop cmds))
- (substitute-key-definition cmd cmd map global-map)))
- (suppress-keymap map)
- (org-defkey map "\C-m" 'org-goto-ret)
- (org-defkey map [(return)] 'org-goto-ret)
- (org-defkey map [(left)] 'org-goto-left)
- (org-defkey map [(right)] 'org-goto-right)
- (org-defkey map [(control ?g)] 'org-goto-quit)
- (org-defkey map "\C-i" 'org-cycle)
- (org-defkey map [(tab)] 'org-cycle)
- (org-defkey map [(down)] 'outline-next-visible-heading)
- (org-defkey map [(up)] 'outline-previous-visible-heading)
- (if org-goto-auto-isearch
- (if (fboundp 'define-key-after)
- (define-key-after map [t] 'org-goto-local-auto-isearch)
- nil)
- (org-defkey map "q" 'org-goto-quit)
- (org-defkey map "n" 'outline-next-visible-heading)
- (org-defkey map "p" 'outline-previous-visible-heading)
- (org-defkey map "f" 'outline-forward-same-level)
- (org-defkey map "b" 'outline-backward-same-level)
- (org-defkey map "u" 'outline-up-heading))
- (org-defkey map "/" 'org-occur)
- (org-defkey map "\C-c\C-n" 'outline-next-visible-heading)
- (org-defkey map "\C-c\C-p" 'outline-previous-visible-heading)
- (org-defkey map "\C-c\C-f" 'outline-forward-same-level)
- (org-defkey map "\C-c\C-b" 'outline-backward-same-level)
- (org-defkey map "\C-c\C-u" 'outline-up-heading)
- map))
-
-(defconst org-goto-help
-"Browse buffer copy, to find location or copy text. Just type for auto-isearch.
-RET=jump to location [Q]uit and return to previous location
-\[Up]/[Down]=next/prev headline TAB=cycle visibility [/] org-occur")
-
-(defvar org-goto-start-pos) ; dynamically scoped parameter
-
-;; FIXME: Docstring does not mention both interfaces
-(defun org-goto (&optional alternative-interface)
- "Look up a different location in the current file, keeping current visibility.
-
-When you want look-up or go to a different location in a document, the
-fastest way is often to fold the entire buffer and then dive into the tree.
-This method has the disadvantage, that the previous location will be folded,
-which may not be what you want.
-
-This command works around this by showing a copy of the current buffer
-in an indirect buffer, in overview mode. You can dive into the tree in
-that copy, use org-occur and incremental search to find a location.
-When pressing RET or `Q', the command returns to the original buffer in
-which the visibility is still unchanged. After RET is will also jump to
-the location selected in the indirect buffer and expose the
-the headline hierarchy above."
- (interactive "P")
- (let* ((org-refile-targets `((nil . (:maxlevel . ,org-goto-max-level))))
- (org-refile-use-outline-path t)
- (org-refile-target-verify-function nil)
- (interface
- (if (not alternative-interface)
- org-goto-interface
- (if (eq org-goto-interface 'outline)
- 'outline-path-completion
- 'outline)))
- (org-goto-start-pos (point))
- (selected-point
- (if (eq interface 'outline)
- (car (org-get-location (current-buffer) org-goto-help))
- (let ((pa (org-refile-get-location "Goto: ")))
- (org-refile-check-position pa)
- (nth 3 pa)))))
- (if selected-point
- (progn
- (org-mark-ring-push org-goto-start-pos)
- (goto-char selected-point)
- (if (or (org-invisible-p) (org-invisible-p2))
- (org-show-context 'org-goto)))
- (message "Quit"))))
-
-(defvar org-goto-selected-point nil) ; dynamically scoped parameter
-(defvar org-goto-exit-command nil) ; dynamically scoped parameter
-(defvar org-goto-local-auto-isearch-map) ; defined below
-
-(defun org-get-location (buf help)
- "Let the user select a location in the Org-mode buffer BUF.
-This function uses a recursive edit. It returns the selected position
-or nil."
- (let ((isearch-mode-map org-goto-local-auto-isearch-map)
- (isearch-hide-immediately nil)
- (isearch-search-fun-function
- (lambda () 'org-goto-local-search-headings))
- (org-goto-selected-point org-goto-exit-command)
- (pop-up-frames nil)
- (special-display-buffer-names nil)
- (special-display-regexps nil)
- (special-display-function nil))
- (save-excursion
- (save-window-excursion
- (delete-other-windows)
- (and (get-buffer "*org-goto*") (kill-buffer "*org-goto*"))
- (switch-to-buffer
- (condition-case nil
- (make-indirect-buffer (current-buffer) "*org-goto*")
- (error (make-indirect-buffer (current-buffer) "*org-goto*"))))
- (with-output-to-temp-buffer "*Help*"
- (princ help))
- (org-fit-window-to-buffer (get-buffer-window "*Help*"))
- (setq buffer-read-only nil)
- (let ((org-startup-truncated t)
- (org-startup-folded nil)
- (org-startup-align-all-tables nil))
- (org-mode)
- (org-overview))
- (setq buffer-read-only t)
- (if (and (boundp 'org-goto-start-pos)
- (integer-or-marker-p org-goto-start-pos))
- (let ((org-show-hierarchy-above t)
- (org-show-siblings t)
- (org-show-following-heading t))
- (goto-char org-goto-start-pos)
- (and (org-invisible-p) (org-show-context)))
- (goto-char (point-min)))
- (let (org-special-ctrl-a/e) (org-beginning-of-line))
- (message "Select location and press RET")
- (use-local-map org-goto-map)
- (recursive-edit)
- ))
- (kill-buffer "*org-goto*")
- (cons org-goto-selected-point org-goto-exit-command)))
-
-(defvar org-goto-local-auto-isearch-map (make-sparse-keymap))
-(set-keymap-parent org-goto-local-auto-isearch-map isearch-mode-map)
-(define-key org-goto-local-auto-isearch-map "\C-i" 'isearch-other-control-char)
-(define-key org-goto-local-auto-isearch-map "\C-m" 'isearch-other-control-char)
-
-(defun org-goto-local-search-headings (string bound noerror)
- "Search and make sure that any matches are in headlines."
- (catch 'return
- (while (if isearch-forward
- (search-forward string bound noerror)
- (search-backward string bound noerror))
- (when (let ((context (mapcar 'car (save-match-data (org-context)))))
- (and (member :headline context)
- (not (member :tags context))))
- (throw 'return (point))))))
-
-(defun org-goto-local-auto-isearch ()
- "Start isearch."
- (interactive)
- (goto-char (point-min))
- (let ((keys (this-command-keys)))
- (when (eq (lookup-key isearch-mode-map keys) 'isearch-printing-char)
- (isearch-mode t)
- (isearch-process-search-char (string-to-char keys)))))
-
-(defun org-goto-ret (&optional arg)
- "Finish `org-goto' by going to the new location."
- (interactive "P")
- (setq org-goto-selected-point (point)
- org-goto-exit-command 'return)
- (throw 'exit nil))
-
-(defun org-goto-left ()
- "Finish `org-goto' by going to the new location."
- (interactive)
- (if (org-on-heading-p)
- (progn
- (beginning-of-line 1)
- (setq org-goto-selected-point (point)
- org-goto-exit-command 'left)
- (throw 'exit nil))
- (error "Not on a heading")))
-
-(defun org-goto-right ()
- "Finish `org-goto' by going to the new location."
- (interactive)
- (if (org-on-heading-p)
- (progn
- (setq org-goto-selected-point (point)
- org-goto-exit-command 'right)
- (throw 'exit nil))
- (error "Not on a heading")))
-
-(defun org-goto-quit ()
- "Finish `org-goto' without cursor motion."
- (interactive)
- (setq org-goto-selected-point nil)
- (setq org-goto-exit-command 'quit)
- (throw 'exit nil))
-
-;;; Indirect buffer display of subtrees
-
-(defvar org-indirect-dedicated-frame nil
- "This is the frame being used for indirect tree display.")
-(defvar org-last-indirect-buffer nil)
-
-(defun org-tree-to-indirect-buffer (&optional arg)
- "Create indirect buffer and narrow it to current subtree.
-With numerical prefix ARG, go up to this level and then take that tree.
-If ARG is negative, go up that many levels.
-If `org-indirect-buffer-display' is not `new-frame', the command removes the
-indirect buffer previously made with this command, to avoid proliferation of
-indirect buffers. However, when you call the command with a \
-\\[universal-argument] prefix, or
-when `org-indirect-buffer-display' is `new-frame', the last buffer
-is kept so that you can work with several indirect buffers at the same time.
-If `org-indirect-buffer-display' is `dedicated-frame', the \
-\\[universal-argument] prefix also
-requests that a new frame be made for the new buffer, so that the dedicated
-frame is not changed."
- (interactive "P")
- (let ((cbuf (current-buffer))
- (cwin (selected-window))
- (pos (point))
- beg end level heading ibuf)
- (save-excursion
- (org-back-to-heading t)
- (when (numberp arg)
- (setq level (org-outline-level))
- (if (< arg 0) (setq arg (+ level arg)))
- (while (> (setq level (org-outline-level)) arg)
- (outline-up-heading 1 t)))
- (setq beg (point)
- heading (org-get-heading))
- (org-end-of-subtree t t)
- (if (org-on-heading-p) (backward-char 1))
- (setq end (point)))
- (if (and (buffer-live-p org-last-indirect-buffer)
- (not (eq org-indirect-buffer-display 'new-frame))
- (not arg))
- (kill-buffer org-last-indirect-buffer))
- (setq ibuf (org-get-indirect-buffer cbuf)
- org-last-indirect-buffer ibuf)
- (cond
- ((or (eq org-indirect-buffer-display 'new-frame)
- (and arg (eq org-indirect-buffer-display 'dedicated-frame)))
- (select-frame (make-frame))
- (delete-other-windows)
- (switch-to-buffer ibuf)
- (org-set-frame-title heading))
- ((eq org-indirect-buffer-display 'dedicated-frame)
- (raise-frame
- (select-frame (or (and org-indirect-dedicated-frame
- (frame-live-p org-indirect-dedicated-frame)
- org-indirect-dedicated-frame)
- (setq org-indirect-dedicated-frame (make-frame)))))
- (delete-other-windows)
- (switch-to-buffer ibuf)
- (org-set-frame-title (concat "Indirect: " heading)))
- ((eq org-indirect-buffer-display 'current-window)
- (switch-to-buffer ibuf))
- ((eq org-indirect-buffer-display 'other-window)
- (pop-to-buffer ibuf))
- (t (error "Invalid value")))
- (if (featurep 'xemacs)
- (save-excursion (org-mode) (turn-on-font-lock)))
- (narrow-to-region beg end)
- (show-all)
- (goto-char pos)
- (and (window-live-p cwin) (select-window cwin))))
-
-(defun org-get-indirect-buffer (&optional buffer)
- (setq buffer (or buffer (current-buffer)))
- (let ((n 1) (base (buffer-name buffer)) bname)
- (while (buffer-live-p
- (get-buffer (setq bname (concat base "-" (number-to-string n)))))
- (setq n (1+ n)))
- (condition-case nil
- (make-indirect-buffer buffer bname 'clone)
- (error (make-indirect-buffer buffer bname)))))
-
-(defun org-set-frame-title (title)
- "Set the title of the current frame to the string TITLE."
- ;; FIXME: how to name a single frame in XEmacs???
- (unless (featurep 'xemacs)
- (modify-frame-parameters (selected-frame) (list (cons 'name title)))))
-
-;;;; Structure editing
-
-;;; Inserting headlines
-
-(defun org-previous-line-empty-p ()
- (save-excursion
- (and (not (bobp))
- (or (beginning-of-line 0) t)
- (save-match-data
- (looking-at "[ \t]*$")))))
-
-(defun org-insert-heading (&optional force-heading invisible-ok)
- "Insert a new heading or item with same depth at point.
-If point is in a plain list and FORCE-HEADING is nil, create a new list item.
-If point is at the beginning of a headline, insert a sibling before the
-current headline. If point is not at the beginning, split the line,
-create the new headline with the text in the current line after point
-\(but see also the variable `org-M-RET-may-split-line').
-
-When INVISIBLE-OK is set, stop at invisible headlines when going back.
-This is important for non-interactive uses of the command."
- (interactive "P")
- (if (or (= (buffer-size) 0)
- (and (not (save-excursion
- (and (ignore-errors (org-back-to-heading invisible-ok))
- (org-on-heading-p))))
- (not (org-in-item-p))))
- (progn
- (insert "\n* ")
- (run-hooks 'org-insert-heading-hook))
- (when (or force-heading (not (org-insert-item)))
- (let* ((empty-line-p nil)
- (level nil)
- (on-heading (org-on-heading-p))
- (head (save-excursion
- (condition-case nil
- (progn
- (org-back-to-heading invisible-ok)
- (when (and (not on-heading)
- (featurep 'org-inlinetask)
- (integerp org-inlinetask-min-level)
- (>= (length (match-string 0))
- org-inlinetask-min-level))
- ;; Find a heading level before the inline task
- (while (and (setq level (org-up-heading-safe))
- (>= level org-inlinetask-min-level)))
- (if (org-on-heading-p)
- (org-back-to-heading invisible-ok)
- (error "This should not happen")))
- (setq empty-line-p (org-previous-line-empty-p))
- (match-string 0))
- (error "*"))))
- (blank-a (cdr (assq 'heading org-blank-before-new-entry)))
- (blank (if (eq blank-a 'auto) empty-line-p blank-a))
- pos hide-previous previous-pos)
- (cond
- ((and (org-on-heading-p) (bolp)
- (or (bobp)
- (save-excursion (backward-char 1) (not (org-invisible-p)))))
- ;; insert before the current line
- (open-line (if blank 2 1)))
- ((and (bolp)
- (not org-insert-heading-respect-content)
- (or (bobp)
- (save-excursion
- (backward-char 1) (not (org-invisible-p)))))
- ;; insert right here
- nil)
- (t
- ;; somewhere in the line
- (save-excursion
- (setq previous-pos (point-at-bol))
- (end-of-line)
- (setq hide-previous (org-invisible-p)))
- (and org-insert-heading-respect-content (org-show-subtree))
- (let ((split
- (and (org-get-alist-option org-M-RET-may-split-line 'headline)
- (save-excursion
- (let ((p (point)))
- (goto-char (point-at-bol))
- (and (looking-at org-complex-heading-regexp)
- (> p (match-beginning 4)))))))
- tags pos)
- (cond
- (org-insert-heading-respect-content
- (org-end-of-subtree nil t)
- (when (featurep 'org-inlinetask)
- (while (and (not (eobp))
- (looking-at "\\(\\*+\\)[ \t]+")
- (>= (length (match-string 1))
- org-inlinetask-min-level))
- (org-end-of-subtree nil t)))
- (or (bolp) (newline))
- (or (org-previous-line-empty-p)
- (and blank (newline)))
- (open-line 1))
- ((org-on-heading-p)
- (when hide-previous
- (show-children)
- (org-show-entry))
- (looking-at ".*?\\([ \t]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ \t]*$")
- (setq tags (and (match-end 2) (match-string 2)))
- (and (match-end 1)
- (delete-region (match-beginning 1) (match-end 1)))
- (setq pos (point-at-bol))
- (or split (end-of-line 1))
- (delete-horizontal-space)
- (if (string-match "\\`\\*+\\'"
- (buffer-substring (point-at-bol) (point)))
- (insert " "))
- (newline (if blank 2 1))
- (when tags
- (save-excursion
- (goto-char pos)
- (end-of-line 1)
- (insert " " tags)
- (org-set-tags nil 'align))))
- (t
- (or split (end-of-line 1))
- (newline (if blank 2 1)))))))
- (insert head) (just-one-space)
- (setq pos (point))
- (end-of-line 1)
- (unless (= (point) pos) (just-one-space) (backward-delete-char 1))
- (when (and org-insert-heading-respect-content hide-previous)
- (save-excursion
- (goto-char previous-pos)
- (hide-subtree)))
- (run-hooks 'org-insert-heading-hook)))))
-
-(defun org-get-heading (&optional no-tags)
- "Return the heading of the current entry, without the stars."
- (save-excursion
- (org-back-to-heading t)
- (if (looking-at
- (if no-tags
- (org-re "\\*+[ \t]+\\([^\n\r]*?\\)\\([ \t]+:[[:alnum:]:_@#%]+:[ \t]*\\)?$")
- "\\*+[ \t]+\\([^\r\n]*\\)"))
- (match-string 1) "")))
-
-(defun org-heading-components ()
- "Return the components of the current heading.
-This is a list with the following elements:
-- the level as an integer
-- the reduced level, different if `org-odd-levels-only' is set.
-- the TODO keyword, or nil
-- the priority character, like ?A, or nil if no priority is given
-- the headline text itself, or the tags string if no headline text
-- the tags string, or nil."
- (save-excursion
- (org-back-to-heading t)
- (if (let (case-fold-search) (looking-at org-complex-heading-regexp))
- (list (length (match-string 1))
- (org-reduced-level (length (match-string 1)))
- (org-match-string-no-properties 2)
- (and (match-end 3) (aref (match-string 3) 2))
- (org-match-string-no-properties 4)
- (org-match-string-no-properties 5)))))
-
-(defun org-get-entry ()
- "Get the entry text, after heading, entire subtree."
- (save-excursion
- (org-back-to-heading t)
- (buffer-substring (point-at-bol 2) (org-end-of-subtree t))))
-
-(defun org-insert-heading-after-current ()
- "Insert a new heading with same level as current, after current subtree."
- (interactive)
- (org-back-to-heading)
- (org-insert-heading)
- (org-move-subtree-down)
- (end-of-line 1))
-
-(defun org-insert-heading-respect-content ()
- (interactive)
- (let ((org-insert-heading-respect-content t))
- (org-insert-heading t)))
-
-(defun org-insert-todo-heading-respect-content (&optional force-state)
- (interactive "P")
- (let ((org-insert-heading-respect-content t))
- (org-insert-todo-heading force-state t)))
-
-(defun org-insert-todo-heading (arg &optional force-heading)
- "Insert a new heading with the same level and TODO state as current heading.
-If the heading has no TODO state, or if the state is DONE, use the first
-state (TODO by default). Also with prefix arg, force first state."
- (interactive "P")
- (when (or force-heading (not (org-insert-item 'checkbox)))
- (org-insert-heading force-heading)
- (save-excursion
- (org-back-to-heading)
- (outline-previous-heading)
- (looking-at org-todo-line-regexp))
- (let*
- ((new-mark-x
- (if (or arg
- (not (match-beginning 2))
- (member (match-string 2) org-done-keywords))
- (car org-todo-keywords-1)
- (match-string 2)))
- (new-mark
- (or
- (run-hook-with-args-until-success
- 'org-todo-get-default-hook new-mark-x nil)
- new-mark-x)))
- (beginning-of-line 1)
- (and (looking-at "\\*+ ") (goto-char (match-end 0))
- (if org-treat-insert-todo-heading-as-state-change
- (org-todo new-mark)
- (insert new-mark " "))))
- (when org-provide-todo-statistics
- (org-update-parent-todo-statistics))))
-
-(defun org-insert-subheading (arg)
- "Insert a new subheading and demote it.
-Works for outline headings and for plain lists alike."
- (interactive "P")
- (org-insert-heading arg)
- (cond
- ((org-on-heading-p) (org-do-demote))
- ((org-at-item-p) (org-indent-item))))
-
-(defun org-insert-todo-subheading (arg)
- "Insert a new subheading with TODO keyword or checkbox and demote it.
-Works for outline headings and for plain lists alike."
- (interactive "P")
- (org-insert-todo-heading arg)
- (cond
- ((org-on-heading-p) (org-do-demote))
- ((org-at-item-p) (org-indent-item))))
-
-;;; Promotion and Demotion
-
-(defvar org-after-demote-entry-hook nil
- "Hook run after an entry has been demoted.
-The cursor will be at the beginning of the entry.
-When a subtree is being demoted, the hook will be called for each node.")
-
-(defvar org-after-promote-entry-hook nil
- "Hook run after an entry has been promoted.
-The cursor will be at the beginning of the entry.
-When a subtree is being promoted, the hook will be called for each node.")
-
-(defun org-promote-subtree ()
- "Promote the entire subtree.
-See also `org-promote'."
- (interactive)
- (save-excursion
- (org-map-tree 'org-promote))
- (org-fix-position-after-promote))
-
-(defun org-demote-subtree ()
- "Demote the entire subtree. See `org-demote'.
-See also `org-promote'."
- (interactive)
- (save-excursion
- (org-map-tree 'org-demote))
- (org-fix-position-after-promote))
-
-
-(defun org-do-promote ()
- "Promote the current heading higher up the tree.
-If the region is active in `transient-mark-mode', promote all headings
-in the region."
- (interactive)
- (save-excursion
- (if (org-region-active-p)
- (org-map-region 'org-promote (region-beginning) (region-end))
- (org-promote)))
- (org-fix-position-after-promote))
-
-(defun org-do-demote ()
- "Demote the current heading lower down the tree.
-If the region is active in `transient-mark-mode', demote all headings
-in the region."
- (interactive)
- (save-excursion
- (if (org-region-active-p)
- (org-map-region 'org-demote (region-beginning) (region-end))
- (org-demote)))
- (org-fix-position-after-promote))
-
-(defun org-fix-position-after-promote ()
- "Make sure that after pro/demotion cursor position is right."
- (let ((pos (point)))
- (when (save-excursion
- (beginning-of-line 1)
- (looking-at org-todo-line-regexp)
- (or (equal pos (match-end 1)) (equal pos (match-end 2))))
- (cond ((eobp) (insert " "))
- ((eolp) (insert " "))
- ((equal (char-after) ?\ ) (forward-char 1))))))
-
-(defun org-current-level ()
- "Return the level of the current entry, or nil if before the first headline.
-The level is the number of stars at the beginning of the headline."
- (save-excursion
- (let ((outline-regexp (org-get-limited-outline-regexp)))
- (condition-case nil
- (progn
- (org-back-to-heading t)
- (funcall outline-level))
- (error nil)))))
-
-(defun org-get-previous-line-level ()
- "Return the outline depth of the last headline before the current line.
-Returns 0 for the first headline in the buffer, and nil if before the
-first headline."
- (let ((current-level (org-current-level))
- (prev-level (when (> (line-number-at-pos) 1)
- (save-excursion
- (beginning-of-line 0)
- (org-current-level)))))
- (cond ((null current-level) nil) ; Before first headline
- ((null prev-level) 0) ; At first headline
- (prev-level))))
-
-(defun org-reduced-level (l)
- "Compute the effective level of a heading.
-This takes into account the setting of `org-odd-levels-only'."
- (if org-odd-levels-only (1+ (floor (/ l 2))) l))
-
-(defun org-level-increment ()
- "Return the number of stars that will be added or removed at a
-time to headlines when structure editing, based on the value of
-`org-odd-levels-only'."
- (if org-odd-levels-only 2 1))
-
-(defun org-get-valid-level (level &optional change)
- "Rectify a level change under the influence of `org-odd-levels-only'
-LEVEL is a current level, CHANGE is by how much the level should be
-modified. Even if CHANGE is nil, LEVEL may be returned modified because
-even level numbers will become the next higher odd number."
- (if org-odd-levels-only
- (cond ((or (not change) (= 0 change)) (1+ (* 2 (/ level 2))))
- ((> change 0) (1+ (* 2 (/ (+ level (* 2 change)) 2))))
- ((< change 0) (max 1 (1+ (* 2 (/ (+ level (* 2 change)) 2))))))
- (max 1 (+ level (or change 0)))))
-
-(if (boundp 'define-obsolete-function-alias)
- (if (or (featurep 'xemacs) (< emacs-major-version 23))
- (define-obsolete-function-alias 'org-get-legal-level
- 'org-get-valid-level)
- (define-obsolete-function-alias 'org-get-legal-level
- 'org-get-valid-level "23.1")))
-
-(defun org-promote ()
- "Promote the current heading higher up the tree.
-If the region is active in `transient-mark-mode', promote all headings
-in the region."
- (org-back-to-heading t)
- (let* ((level (save-match-data (funcall outline-level)))
- (up-head (concat (make-string (org-get-valid-level level -1) ?*) " "))
- (diff (abs (- level (length up-head) -1))))
- (if (= level 1) (error "Cannot promote to level 0. UNDO to recover if necessary"))
- (replace-match up-head nil t)
- ;; Fixup tag positioning
- (and org-auto-align-tags (org-set-tags nil t))
- (if org-adapt-indentation (org-fixup-indentation (- diff)))
- (run-hooks 'org-after-promote-entry-hook)))
-
-(defun org-demote ()
- "Demote the current heading lower down the tree.
-If the region is active in `transient-mark-mode', demote all headings
-in the region."
- (org-back-to-heading t)
- (let* ((level (save-match-data (funcall outline-level)))
- (down-head (concat (make-string (org-get-valid-level level 1) ?*) " "))
- (diff (abs (- level (length down-head) -1))))
- (replace-match down-head nil t)
- ;; Fixup tag positioning
- (and org-auto-align-tags (org-set-tags nil t))
- (if org-adapt-indentation (org-fixup-indentation diff))
- (run-hooks 'org-after-demote-entry-hook)))
-
-(defun org-cycle-level ()
- "Cycle the level of an empty headline through possible states.
-This goes first to child, then to parent, level, then up the hierarchy.
-After top level, it switches back to sibling level."
- (interactive)
- (let ((org-adapt-indentation nil))
- (when (org-point-at-end-of-empty-headline)
- (setq this-command 'org-cycle-level) ; Only needed for caching
- (let ((cur-level (org-current-level))
- (prev-level (org-get-previous-line-level)))
- (cond
- ;; If first headline in file, promote to top-level.
- ((= prev-level 0)
- (loop repeat (/ (- cur-level 1) (org-level-increment))
- do (org-do-promote)))
- ;; If same level as prev, demote one.
- ((= prev-level cur-level)
- (org-do-demote))
- ;; If parent is top-level, promote to top level if not already.
- ((= prev-level 1)
- (loop repeat (/ (- cur-level 1) (org-level-increment))
- do (org-do-promote)))
- ;; If top-level, return to prev-level.
- ((= cur-level 1)
- (loop repeat (/ (- prev-level 1) (org-level-increment))
- do (org-do-demote)))
- ;; If less than prev-level, promote one.
- ((< cur-level prev-level)
- (org-do-promote))
- ;; If deeper than prev-level, promote until higher than
- ;; prev-level.
- ((> cur-level prev-level)
- (loop repeat (+ 1 (/ (- cur-level prev-level) (org-level-increment)))
- do (org-do-promote))))
- t))))
-
-(defun org-map-tree (fun)
- "Call FUN for every heading underneath the current one."
- (org-back-to-heading)
- (let ((level (funcall outline-level)))
- (save-excursion
- (funcall fun)
- (while (and (progn
- (outline-next-heading)
- (> (funcall outline-level) level))
- (not (eobp)))
- (funcall fun)))))
-
-(defun org-map-region (fun beg end)
- "Call FUN for every heading between BEG and END."
- (let ((org-ignore-region t))
- (save-excursion
- (setq end (copy-marker end))
- (goto-char beg)
- (if (and (re-search-forward (concat "^" outline-regexp) nil t)
- (< (point) end))
- (funcall fun))
- (while (and (progn
- (outline-next-heading)
- (< (point) end))
- (not (eobp)))
- (funcall fun)))))
-
-(defun org-fixup-indentation (diff)
- "Change the indentation in the current entry by DIFF.
-However, if any line in the current entry has no indentation, or if it
-would end up with no indentation after the change, nothing at all is done."
- (save-excursion
- (let ((end (save-excursion (outline-next-heading)
- (point-marker)))
- (prohibit (if (> diff 0)
- "^\\S-"
- (concat "^ \\{0," (int-to-string (- diff)) "\\}\\S-")))
- col)
- (unless (save-excursion (end-of-line 1)
- (re-search-forward prohibit end t))
- (while (and (< (point) end)
- (re-search-forward "^[ \t]+" end t))
- (goto-char (match-end 0))
- (setq col (current-column))
- (if (< diff 0) (replace-match ""))
- (org-indent-to-column (+ diff col))))
- (move-marker end nil))))
-
-(defun org-convert-to-odd-levels ()
- "Convert an org-mode file with all levels allowed to one with odd levels.
-This will leave level 1 alone, convert level 2 to level 3, level 3 to
-level 5 etc."
- (interactive)
- (when (yes-or-no-p "Are you sure you want to globally change levels to odd? ")
- (let ((outline-regexp org-outline-regexp)
- (outline-level 'org-outline-level)
- (org-odd-levels-only nil) n)
- (save-excursion
- (goto-char (point-min))
- (while (re-search-forward "^\\*\\*+ " nil t)
- (setq n (- (length (match-string 0)) 2))
- (while (>= (setq n (1- n)) 0)
- (org-demote))
- (end-of-line 1))))))
-
-(defun org-convert-to-oddeven-levels ()
- "Convert an org-mode file with only odd levels to one with odd/even levels.
-This promotes level 3 to level 2, level 5 to level 3 etc. If the
-file contains a section with an even level, conversion would
-destroy the structure of the file. An error is signaled in this
-case."
- (interactive)
- (goto-char (point-min))
- ;; First check if there are no even levels
- (when (re-search-forward "^\\(\\*\\*\\)+ " nil t)
- (org-show-context t)
- (error "Not all levels are odd in this file. Conversion not possible"))
- (when (yes-or-no-p "Are you sure you want to globally change levels to odd-even? ")
- (let ((outline-regexp org-outline-regexp)
- (outline-level 'org-outline-level)
- (org-odd-levels-only nil) n)
- (save-excursion
- (goto-char (point-min))
- (while (re-search-forward "^\\*\\*+ " nil t)
- (setq n (/ (1- (length (match-string 0))) 2))
- (while (>= (setq n (1- n)) 0)
- (org-promote))
- (end-of-line 1))))))
-
-(defun org-tr-level (n)
- "Make N odd if required."
- (if org-odd-levels-only (1+ (/ n 2)) n))
-
-;;; Vertical tree motion, cutting and pasting of subtrees
-
-(defun org-move-subtree-up (&optional arg)
- "Move the current subtree up past ARG headlines of the same level."
- (interactive "p")
- (org-move-subtree-down (- (prefix-numeric-value arg))))
-
-(defun org-move-subtree-down (&optional arg)
- "Move the current subtree down past ARG headlines of the same level."
- (interactive "p")
- (setq arg (prefix-numeric-value arg))
- (let ((movfunc (if (> arg 0) 'org-get-next-sibling
- 'org-get-last-sibling))
- (ins-point (make-marker))
- (cnt (abs arg))
- beg beg0 end txt folded ne-beg ne-end ne-ins ins-end)
- ;; Select the tree
- (org-back-to-heading)
- (setq beg0 (point))
- (save-excursion
- (setq ne-beg (org-back-over-empty-lines))
- (setq beg (point)))
- (save-match-data
- (save-excursion (outline-end-of-heading)
- (setq folded (org-invisible-p)))
- (outline-end-of-subtree))
- (outline-next-heading)
- (setq ne-end (org-back-over-empty-lines))
- (setq end (point))
- (goto-char beg0)
- (when (and (> arg 0) (org-first-sibling-p) (< ne-end ne-beg))
- ;; include less whitespace
- (save-excursion
- (goto-char beg)
- (forward-line (- ne-beg ne-end))
- (setq beg (point))))
- ;; Find insertion point, with error handling
- (while (> cnt 0)
- (or (and (funcall movfunc) (looking-at outline-regexp))
- (progn (goto-char beg0)
- (error "Cannot move past superior level or buffer limit")))
- (setq cnt (1- cnt)))
- (if (> arg 0)
- ;; Moving forward - still need to move over subtree
- (progn (org-end-of-subtree t t)
- (save-excursion
- (org-back-over-empty-lines)
- (or (bolp) (newline)))))
- (setq ne-ins (org-back-over-empty-lines))
- (move-marker ins-point (point))
- (setq txt (buffer-substring beg end))
- (org-save-markers-in-region beg end)
- (delete-region beg end)
- (org-remove-empty-overlays-at beg)
- (or (= beg (point-min)) (outline-flag-region (1- beg) beg nil))
- (or (bobp) (outline-flag-region (1- (point)) (point) nil))
- (and (not (bolp)) (looking-at "\n") (forward-char 1))
- (let ((bbb (point)))
- (insert-before-markers txt)
- (org-reinstall-markers-in-region bbb)
- (move-marker ins-point bbb))
- (or (bolp) (insert "\n"))
- (setq ins-end (point))
- (goto-char ins-point)
- (org-skip-whitespace)
- (when (and (< arg 0)
- (org-first-sibling-p)
- (> ne-ins ne-beg))
- ;; Move whitespace back to beginning
- (save-excursion
- (goto-char ins-end)
- (let ((kill-whole-line t))
- (kill-line (- ne-ins ne-beg)) (point)))
- (insert (make-string (- ne-ins ne-beg) ?\n)))
- (move-marker ins-point nil)
- (if folded
- (hide-subtree)
- (org-show-entry)
- (show-children)
- (org-cycle-hide-drawers 'children))
- (org-clean-visibility-after-subtree-move)))
-
-(defvar org-subtree-clip ""
- "Clipboard for cut and paste of subtrees.
-This is actually only a copy of the kill, because we use the normal kill
-ring. We need it to check if the kill was created by `org-copy-subtree'.")
-
-(defvar org-subtree-clip-folded nil
- "Was the last copied subtree folded?
-This is used to fold the tree back after pasting.")
-
-(defun org-cut-subtree (&optional n)
- "Cut the current subtree into the clipboard.
-With prefix arg N, cut this many sequential subtrees.
-This is a short-hand for marking the subtree and then cutting it."
- (interactive "p")
- (org-copy-subtree n 'cut))
-
-(defun org-copy-subtree (&optional n cut force-store-markers)
- "Cut the current subtree into the clipboard.
-With prefix arg N, cut this many sequential subtrees.
-This is a short-hand for marking the subtree and then copying it.
-If CUT is non-nil, actually cut the subtree.
-If FORCE-STORE-MARKERS is non-nil, store the relative locations
-of some markers in the region, even if CUT is non-nil. This is
-useful if the caller implements cut-and-paste as copy-then-paste-then-cut."
- (interactive "p")
- (let (beg end folded (beg0 (point)))
- (if (interactive-p)
- (org-back-to-heading nil) ; take what looks like a subtree
- (org-back-to-heading t)) ; take what is really there
- (org-back-over-empty-lines)
- (setq beg (point))
- (skip-chars-forward " \t\r\n")
- (save-match-data
- (save-excursion (outline-end-of-heading)
- (setq folded (org-invisible-p)))
- (condition-case nil
- (org-forward-same-level (1- n) t)
- (error nil))
- (org-end-of-subtree t t))
- (org-back-over-empty-lines)
- (setq end (point))
- (goto-char beg0)
- (when (> end beg)
- (setq org-subtree-clip-folded folded)
- (when (or cut force-store-markers)
- (org-save-markers-in-region beg end))
- (if cut (kill-region beg end) (copy-region-as-kill beg end))
- (setq org-subtree-clip (current-kill 0))
- (message "%s: Subtree(s) with %d characters"
- (if cut "Cut" "Copied")
- (length org-subtree-clip)))))
-
-(defun org-paste-subtree (&optional level tree for-yank)
- "Paste the clipboard as a subtree, with modification of headline level.
-The entire subtree is promoted or demoted in order to match a new headline
-level.
-
-If the cursor is at the beginning of a headline, the same level as
-that headline is used to paste the tree
-
-If not, the new level is derived from the *visible* headings
-before and after the insertion point, and taken to be the inferior headline
-level of the two. So if the previous visible heading is level 3 and the
-next is level 4 (or vice versa), level 4 will be used for insertion.
-This makes sure that the subtree remains an independent subtree and does
-not swallow low level entries.
-
-You can also force a different level, either by using a numeric prefix
-argument, or by inserting the heading marker by hand. For example, if the
-cursor is after \"*****\", then the tree will be shifted to level 5.
-
-If optional TREE is given, use this text instead of the kill ring.
-
-When FOR-YANK is set, this is called by `org-yank'. In this case, do not
-move back over whitespace before inserting, and move point to the end of
-the inserted text when done."
- (interactive "P")
- (setq tree (or tree (and kill-ring (current-kill 0))))
- (unless (org-kill-is-subtree-p tree)
- (error "%s"
- (substitute-command-keys
- "The kill is not a (set of) tree(s) - please use \\[yank] to yank anyway")))
- (let* ((visp (not (org-invisible-p)))
- (txt tree)
- (^re (concat "^\\(" outline-regexp "\\)"))
- (re (concat "\\(" outline-regexp "\\)"))
- (^re_ (concat "\\(\\*+\\)[ \t]*"))
-
- (old-level (if (string-match ^re txt)
- (- (match-end 0) (match-beginning 0) 1)
- -1))
- (force-level (cond (level (prefix-numeric-value level))
- ((and (looking-at "[ \t]*$")
- (string-match
- ^re_ (buffer-substring
- (point-at-bol) (point))))
- (- (match-end 1) (match-beginning 1)))
- ((and (bolp)
- (looking-at org-outline-regexp))
- (- (match-end 0) (point) 1))
- (t nil)))
- (previous-level (save-excursion
- (condition-case nil
- (progn
- (outline-previous-visible-heading 1)
- (if (looking-at re)
- (- (match-end 0) (match-beginning 0) 1)
- 1))
- (error 1))))
- (next-level (save-excursion
- (condition-case nil
- (progn
- (or (looking-at outline-regexp)
- (outline-next-visible-heading 1))
- (if (looking-at re)
- (- (match-end 0) (match-beginning 0) 1)
- 1))
- (error 1))))
- (new-level (or force-level (max previous-level next-level)))
- (shift (if (or (= old-level -1)
- (= new-level -1)
- (= old-level new-level))
- 0
- (- new-level old-level)))
- (delta (if (> shift 0) -1 1))
- (func (if (> shift 0) 'org-demote 'org-promote))
- (org-odd-levels-only nil)
- beg end newend)
- ;; Remove the forced level indicator
- (if force-level
- (delete-region (point-at-bol) (point)))
- ;; Paste
- (beginning-of-line 1)
- (unless for-yank (org-back-over-empty-lines))
- (setq beg (point))
- (and (fboundp 'org-id-paste-tracker) (org-id-paste-tracker txt))
- (insert-before-markers txt)
- (unless (string-match "\n\\'" txt) (insert "\n"))
- (setq newend (point))
- (org-reinstall-markers-in-region beg)
- (setq end (point))
- (goto-char beg)
- (skip-chars-forward " \t\n\r")
- (setq beg (point))
- (if (and (org-invisible-p) visp)
- (save-excursion (outline-show-heading)))
- ;; Shift if necessary
- (unless (= shift 0)
- (save-restriction
- (narrow-to-region beg end)
- (while (not (= shift 0))
- (org-map-region func (point-min) (point-max))
- (setq shift (+ delta shift)))
- (goto-char (point-min))
- (setq newend (point-max))))
- (when (or (interactive-p) for-yank)
- (message "Clipboard pasted as level %d subtree" new-level))
- (if (and (not for-yank) ; in this case, org-yank will decide about folding
- kill-ring
- (eq org-subtree-clip (current-kill 0))
- org-subtree-clip-folded)
- ;; The tree was folded before it was killed/copied
- (hide-subtree))
- (and for-yank (goto-char newend))))
-
-(defun org-kill-is-subtree-p (&optional txt)
- "Check if the current kill is an outline subtree, or a set of trees.
-Returns nil if kill does not start with a headline, or if the first
-headline level is not the largest headline level in the tree.
-So this will actually accept several entries of equal levels as well,
-which is OK for `org-paste-subtree'.
-If optional TXT is given, check this string instead of the current kill."
- (let* ((kill (or txt (and kill-ring (current-kill 0)) ""))
- (start-level (and kill
- (string-match (concat "\\`\\([ \t\n\r]*?\n\\)?\\("
- org-outline-regexp "\\)")
- kill)
- (- (match-end 2) (match-beginning 2) 1)))
- (re (concat "^" org-outline-regexp))
- (start (1+ (or (match-beginning 2) -1))))
- (if (not start-level)
- (progn
- nil) ;; does not even start with a heading
- (catch 'exit
- (while (setq start (string-match re kill (1+ start)))
- (when (< (- (match-end 0) (match-beginning 0) 1) start-level)
- (throw 'exit nil)))
- t))))
-
-(defvar org-markers-to-move nil
- "Markers that should be moved with a cut-and-paste operation.
-Those markers are stored together with their positions relative to
-the start of the region.")
-
-(defun org-save-markers-in-region (beg end)
- "Check markers in region.
-If these markers are between BEG and END, record their position relative
-to BEG, so that after moving the block of text, we can put the markers back
-into place.
-This function gets called just before an entry or tree gets cut from the
-buffer. After re-insertion, `org-reinstall-markers-in-region' must be
-called immediately, to move the markers with the entries."
- (setq org-markers-to-move nil)
- (when (featurep 'org-clock)
- (org-clock-save-markers-for-cut-and-paste beg end))
- (when (featurep 'org-agenda)
- (org-agenda-save-markers-for-cut-and-paste beg end)))
-
-(defun org-check-and-save-marker (marker beg end)
- "Check if MARKER is between BEG and END.
-If yes, remember the marker and the distance to BEG."
- (when (and (marker-buffer marker)
- (equal (marker-buffer marker) (current-buffer)))
- (if (and (>= marker beg) (< marker end))
- (push (cons marker (- marker beg)) org-markers-to-move))))
-
-(defun org-reinstall-markers-in-region (beg)
- "Move all remembered markers to their position relative to BEG."
- (mapc (lambda (x)
- (move-marker (car x) (+ beg (cdr x))))
- org-markers-to-move)
- (setq org-markers-to-move nil))
-
-(defun org-narrow-to-subtree ()
- "Narrow buffer to the current subtree."
- (interactive)
- (save-excursion
- (save-match-data
- (narrow-to-region
- (progn (org-back-to-heading t) (point))
- (progn (org-end-of-subtree t t)
- (if (and (org-on-heading-p) (not (eobp))) (backward-char 1))
- (point))))))
-
-(eval-when-compile
- (defvar org-property-drawer-re))
-
-(defvar org-property-start-re) ;; defined below
-(defun org-clone-subtree-with-time-shift (n &optional shift)
- "Clone the task (subtree) at point N times.
-The clones will be inserted as siblings.
-
-In interactive use, the user will be prompted for the number of
-clones to be produced, and for a time SHIFT, which may be a
-repeater as used in time stamps, for example `+3d'.
-
-When a valid repeater is given and the entry contains any time
-stamps, the clones will become a sequence in time, with time
-stamps in the subtree shifted for each clone produced. If SHIFT
-is nil or the empty string, time stamps will be left alone. The
-ID property of the original subtree is removed.
-
-If the original subtree did contain time stamps with a repeater,
-the following will happen:
-- the repeater will be removed in each clone
-- an additional clone will be produced, with the current, unshifted
- date(s) in the entry.
-- the original entry will be placed *after* all the clones, with
- repeater intact.
-- the start days in the repeater in the original entry will be shifted
- to past the last clone.
-I this way you can spell out a number of instances of a repeating task,
-and still retain the repeater to cover future instances of the task."
- (interactive "nNumber of clones to produce: \nsDate shift per clone (e.g. +1w, empty to copy unchanged): ")
- (let (beg end template task idprop
- shift-n shift-what doshift nmin nmax (n-no-remove -1))
- (if (not (and (integerp n) (> n 0)))
- (error "Invalid number of replications %s" n))
- (if (and (setq doshift (and (stringp shift) (string-match "\\S-" shift)))
- (not (string-match "\\`[ \t]*\\+?\\([0-9]+\\)\\([dwmy]\\)[ \t]*\\'"
- shift)))
- (error "Invalid shift specification %s" shift))
- (when doshift
- (setq shift-n (string-to-number (match-string 1 shift))
- shift-what (cdr (assoc (match-string 2 shift)
- '(("d" . day) ("w" . week)
- ("m" . month) ("y" . year))))))
- (if (eq shift-what 'week) (setq shift-n (* 7 shift-n) shift-what 'day))
- (setq nmin 1 nmax n)
- (org-back-to-heading t)
- (setq beg (point))
- (setq idprop (org-entry-get nil "ID"))
- (org-end-of-subtree t t)
- (or (bolp) (insert "\n"))
- (setq end (point))
- (setq template (buffer-substring beg end))
- (when (and doshift
- (string-match "<[^<>\n]+ \\+[0-9]+[dwmy][^<>\n]*>" template))
- (delete-region beg end)
- (setq end beg)
- (setq nmin 0 nmax (1+ nmax) n-no-remove nmax))
- (goto-char end)
- (loop for n from nmin to nmax do
- ;; prepare clone
- (with-temp-buffer
- (insert template)
- (org-mode)
- (goto-char (point-min))
- (and idprop (if org-clone-delete-id
- (org-entry-delete nil "ID")
- (org-id-get-create t)))
- (while (re-search-forward org-property-start-re nil t)
- (org-remove-empty-drawer-at "PROPERTIES" (point)))
- (goto-char (point-min))
- (when doshift
- (while (re-search-forward org-ts-regexp-both nil t)
- (org-timestamp-change (* n shift-n) shift-what))
- (unless (= n n-no-remove)
- (goto-char (point-min))
- (while (re-search-forward org-ts-regexp nil t)
- (save-excursion
- (goto-char (match-beginning 0))
- (if (looking-at "<[^<>\n]+\\( +\\+[0-9]+[dwmy]\\)")
- (delete-region (match-beginning 1) (match-end 1)))))))
- (setq task (buffer-string)))
- (insert task))
- (goto-char beg)))
-
-;;; Outline Sorting
-
-(defun org-sort (with-case)
- "Call `org-sort-entries', `org-table-sort-lines' or `org-sort-list'.
-Optional argument WITH-CASE means sort case-sensitively.
-With a double prefix argument, also remove duplicate entries."
- (interactive "P")
- (cond
- ((org-at-table-p) (org-call-with-arg 'org-table-sort-lines with-case))
- ((org-at-item-p) (org-call-with-arg 'org-sort-list with-case))
- (t
- (org-call-with-arg 'org-sort-entries with-case))))
-
-(defun org-sort-remove-invisible (s)
- (remove-text-properties 0 (length s) org-rm-props s)
- (while (string-match org-bracket-link-regexp s)
- (setq s (replace-match (if (match-end 2)
- (match-string 3 s)
- (match-string 1 s)) t t s)))
- s)
-
-(defvar org-priority-regexp) ; defined later in the file
-
-(defvar org-after-sorting-entries-or-items-hook nil
- "Hook that is run after a bunch of entries or items have been sorted.
-When children are sorted, the cursor is in the parent line when this
-hook gets called. When a region or a plain list is sorted, the cursor
-will be in the first entry of the sorted region/list.")
-
-(defun org-sort-entries
- (&optional with-case sorting-type getkey-func compare-func property)
- "Sort entries on a certain level of an outline tree.
-If there is an active region, the entries in the region are sorted.
-Else, if the cursor is before the first entry, sort the top-level items.
-Else, the children of the entry at point are sorted.
-
-Sorting can be alphabetically, numerically, by date/time as given by
-a time stamp, by a property or by priority.
-
-The command prompts for the sorting type unless it has been given to the
-function through the SORTING-TYPE argument, which needs to be a character,
-\(?n ?N ?a ?A ?t ?T ?s ?S ?d ?D ?p ?P ?r ?R ?f ?F). Here is the
-precise meaning of each character:
-
-n Numerically, by converting the beginning of the entry/item to a number.
-a Alphabetically, ignoring the TODO keyword and the priority, if any.
-t By date/time, either the first active time stamp in the entry, or, if
- none exist, by the first inactive one.
-s By the scheduled date/time.
-d By deadline date/time.
-c By creation time, which is assumed to be the first inactive time stamp
- at the beginning of a line.
-p By priority according to the cookie.
-r By the value of a property.
-
-Capital letters will reverse the sort order.
-
-If the SORTING-TYPE is ?f or ?F, then GETKEY-FUNC specifies a function to be
-called with point at the beginning of the record. It must return either
-a string or a number that should serve as the sorting key for that record.
-
-Comparing entries ignores case by default. However, with an optional argument
-WITH-CASE, the sorting considers case as well."
- (interactive "P")
- (let ((case-func (if with-case 'identity 'downcase))
- start beg end stars re re2
- txt what tmp)
- ;; Find beginning and end of region to sort
- (cond
- ((org-region-active-p)
- ;; we will sort the region
- (setq end (region-end)
- what "region")
- (goto-char (region-beginning))
- (if (not (org-on-heading-p)) (outline-next-heading))
- (setq start (point)))
- ((or (org-on-heading-p)
- (condition-case nil (progn (org-back-to-heading) t) (error nil)))
- ;; we will sort the children of the current headline
- (org-back-to-heading)
- (setq start (point)
- end (progn (org-end-of-subtree t t)
- (or (bolp) (insert "\n"))
- (org-back-over-empty-lines)
- (point))
- what "children")
- (goto-char start)
- (show-subtree)
- (outline-next-heading))
- (t
- ;; we will sort the top-level entries in this file
- (goto-char (point-min))
- (or (org-on-heading-p) (outline-next-heading))
- (setq start (point))
- (goto-char (point-max))
- (beginning-of-line 1)
- (when (looking-at ".*?\\S-")
- ;; File ends in a non-white line
- (end-of-line 1)
- (insert "\n"))
- (setq end (point-max))
- (setq what "top-level")
- (goto-char start)
- (show-all)))
-
- (setq beg (point))
- (if (>= beg end) (error "Nothing to sort"))
-
- (looking-at "\\(\\*+\\)")
- (setq stars (match-string 1)
- re (concat "^" (regexp-quote stars) " +")
- re2 (concat "^" (regexp-quote (substring stars 0 -1)) "[^*]")
- txt (buffer-substring beg end))
- (if (not (equal (substring txt -1) "\n")) (setq txt (concat txt "\n")))
- (if (and (not (equal stars "*")) (string-match re2 txt))
- (error "Region to sort contains a level above the first entry"))
-
- (unless sorting-type
- (message
- "Sort %s: [a]lpha [n]umeric [p]riority p[r]operty todo[o]rder [f]unc
- [t]ime [s]cheduled [d]eadline [c]reated
- A/N/T/S/D/C/P/O/F means reversed:"
- what)
- (setq sorting-type (read-char-exclusive))
-
- (and (= (downcase sorting-type) ?f)
- (setq getkey-func
- (org-icompleting-read "Sort using function: "
- obarray 'fboundp t nil nil))
- (setq getkey-func (intern getkey-func)))
-
- (and (= (downcase sorting-type) ?r)
- (setq property
- (org-icompleting-read "Property: "
- (mapcar 'list (org-buffer-property-keys t))
- nil t))))
-
- (message "Sorting entries...")
-
- (save-restriction
- (narrow-to-region start end)
- (let ((dcst (downcase sorting-type))
- (case-fold-search nil)
- (now (current-time)))
- (sort-subr
- (/= dcst sorting-type)
- ;; This function moves to the beginning character of the "record" to
- ;; be sorted.
- (lambda nil
- (if (re-search-forward re nil t)
- (goto-char (match-beginning 0))
- (goto-char (point-max))))
- ;; This function moves to the last character of the "record" being
- ;; sorted.
- (lambda nil
- (save-match-data
- (condition-case nil
- (outline-forward-same-level 1)
- (error
- (goto-char (point-max))))))
- ;; This function returns the value that gets sorted against.
- (lambda nil
- (cond
- ((= dcst ?n)
- (if (looking-at org-complex-heading-regexp)
- (string-to-number (match-string 4))
- nil))
- ((= dcst ?a)
- (if (looking-at org-complex-heading-regexp)
- (funcall case-func (match-string 4))
- nil))
- ((= dcst ?t)
- (let ((end (save-excursion (outline-next-heading) (point))))
- (if (or (re-search-forward org-ts-regexp end t)
- (re-search-forward org-ts-regexp-both end t))
- (org-time-string-to-seconds (match-string 0))
- (org-float-time now))))
- ((= dcst ?c)
- (let ((end (save-excursion (outline-next-heading) (point))))
- (if (re-search-forward
- (concat "^[ \t]*\\[" org-ts-regexp1 "\\]")
- end t)
- (org-time-string-to-seconds (match-string 0))
- (org-float-time now))))
- ((= dcst ?s)
- (let ((end (save-excursion (outline-next-heading) (point))))
- (if (re-search-forward org-scheduled-time-regexp end t)
- (org-time-string-to-seconds (match-string 1))
- (org-float-time now))))
- ((= dcst ?d)
- (let ((end (save-excursion (outline-next-heading) (point))))
- (if (re-search-forward org-deadline-time-regexp end t)
- (org-time-string-to-seconds (match-string 1))
- (org-float-time now))))
- ((= dcst ?p)
- (if (re-search-forward org-priority-regexp (point-at-eol) t)
- (string-to-char (match-string 2))
- org-default-priority))
- ((= dcst ?r)
- (or (org-entry-get nil property) ""))
- ((= dcst ?o)
- (if (looking-at org-complex-heading-regexp)
- (- 9999 (length (member (match-string 2)
- org-todo-keywords-1)))))
- ((= dcst ?f)
- (if getkey-func
- (progn
- (setq tmp (funcall getkey-func))
- (if (stringp tmp) (setq tmp (funcall case-func tmp)))
- tmp)
- (error "Invalid key function `%s'" getkey-func)))
- (t (error "Invalid sorting type `%c'" sorting-type))))
- nil
- (cond
- ((= dcst ?a) 'string<)
- ((= dcst ?f) compare-func)
- ((member dcst '(?p ?t ?s ?d ?c)) '<)
- (t nil)))))
- (run-hooks 'org-after-sorting-entries-or-items-hook)
- (message "Sorting entries...done")))
-
-(defun org-do-sort (table what &optional with-case sorting-type)
- "Sort TABLE of WHAT according to SORTING-TYPE.
-The user will be prompted for the SORTING-TYPE if the call to this
-function does not specify it. WHAT is only for the prompt, to indicate
-what is being sorted. The sorting key will be extracted from
-the car of the elements of the table.
-If WITH-CASE is non-nil, the sorting will be case-sensitive."
- (unless sorting-type
- (message
- "Sort %s: [a]lphabetic. [n]umeric. [t]ime. A/N/T means reversed:"
- what)
- (setq sorting-type (read-char-exclusive)))
- (let ((dcst (downcase sorting-type))
- extractfun comparefun)
- ;; Define the appropriate functions
- (cond
- ((= dcst ?n)
- (setq extractfun 'string-to-number
- comparefun (if (= dcst sorting-type) '< '>)))
- ((= dcst ?a)
- (setq extractfun (if with-case (lambda(x) (org-sort-remove-invisible x))
- (lambda(x) (downcase (org-sort-remove-invisible x))))
- comparefun (if (= dcst sorting-type)
- 'string<
- (lambda (a b) (and (not (string< a b))
- (not (string= a b)))))))
- ((= dcst ?t)
- (setq extractfun
- (lambda (x)
- (if (or (string-match org-ts-regexp x)
- (string-match org-ts-regexp-both x))
- (org-float-time
- (org-time-string-to-time (match-string 0 x)))
- 0))
- comparefun (if (= dcst sorting-type) '< '>)))
- (t (error "Invalid sorting type `%c'" sorting-type)))
-
- (sort (mapcar (lambda (x) (cons (funcall extractfun (car x)) (cdr x)))
- table)
- (lambda (a b) (funcall comparefun (car a) (car b))))))
-
-
-;;; The orgstruct minor mode
-
-;; Define a minor mode which can be used in other modes in order to
-;; integrate the org-mode structure editing commands.
-
-;; This is really a hack, because the org-mode structure commands use
-;; keys which normally belong to the major mode. Here is how it
-;; works: The minor mode defines all the keys necessary to operate the
-;; structure commands, but wraps the commands into a function which
-;; tests if the cursor is currently at a headline or a plain list
-;; item. If that is the case, the structure command is used,
-;; temporarily setting many Org-mode variables like regular
-;; expressions for filling etc. However, when any of those keys is
-;; used at a different location, function uses `key-binding' to look
-;; up if the key has an associated command in another currently active
-;; keymap (minor modes, major mode, global), and executes that
-;; command. There might be problems if any of the keys is otherwise
-;; used as a prefix key.
-
-;; Another challenge is that the key binding for TAB can be tab or \C-i,
-;; likewise the binding for RET can be return or \C-m. Orgtbl-mode
-;; addresses this by checking explicitly for both bindings.
-
-(defvar orgstruct-mode-map (make-sparse-keymap)
- "Keymap for the minor `orgstruct-mode'.")
-
-(defvar org-local-vars nil
- "List of local variables, for use by `orgstruct-mode'.")
-
-;;;###autoload
-(define-minor-mode orgstruct-mode
- "Toggle the minor mode `orgstruct-mode'.
-This mode is for using Org-mode structure commands in other
-modes. The following keys behave as if Org-mode were active, if
-the cursor is on a headline, or on a plain list item (both as
-defined by Org-mode).
-
-M-up Move entry/item up
-M-down Move entry/item down
-M-left Promote
-M-right Demote
-M-S-up Move entry/item up
-M-S-down Move entry/item down
-M-S-left Promote subtree
-M-S-right Demote subtree
-M-q Fill paragraph and items like in Org-mode
-C-c ^ Sort entries
-C-c - Cycle list bullet
-TAB Cycle item visibility
-M-RET Insert new heading/item
-S-M-RET Insert new TODO heading / Checkbox item
-C-c C-c Set tags / toggle checkbox"
- nil " OrgStruct" nil
- (org-load-modules-maybe)
- (and (orgstruct-setup) (defun orgstruct-setup () nil)))
-
-;;;###autoload
-(defun turn-on-orgstruct ()
- "Unconditionally turn on `orgstruct-mode'."
- (orgstruct-mode 1))
-
-(defun orgstruct++-mode (&optional arg)
- "Toggle `orgstruct-mode', the enhanced version of it.
-In addition to setting orgstruct-mode, this also exports all indentation
-and autofilling variables from org-mode into the buffer. It will also
-recognize item context in multiline items.
-Note that turning off orgstruct-mode will *not* remove the
-indentation/paragraph settings. This can only be done by refreshing the
-major mode, for example with \\[normal-mode]."
- (interactive "P")
- (setq arg (prefix-numeric-value (or arg (if orgstruct-mode -1 1))))
- (if (< arg 1)
- (orgstruct-mode -1)
- (orgstruct-mode 1)
- (let (var val)
- (mapc
- (lambda (x)
- (when (string-match
- "^\\(paragraph-\\|auto-fill\\|fill-paragraph\\|adaptive-fill\\|indent-\\)"
- (symbol-name (car x)))
- (setq var (car x) val (nth 1 x))
- (org-set-local var (if (eq (car-safe val) 'quote) (nth 1 val) val))))
- org-local-vars)
- (org-set-local 'orgstruct-is-++ t))))
-
-(defvar orgstruct-is-++ nil
- "Is `orgstruct-mode' in ++ version in the current-buffer?")
-(make-variable-buffer-local 'orgstruct-is-++)
-
-;;;###autoload
-(defun turn-on-orgstruct++ ()
- "Unconditionally turn on `orgstruct++-mode'."
- (orgstruct++-mode 1))
-
-(defun orgstruct-error ()
- "Error when there is no default binding for a structure key."
- (interactive)
- (error "This key has no function outside structure elements"))
-
-(defun orgstruct-setup ()
- "Setup orgstruct keymaps."
- (let ((nfunc 0)
- (bindings
- (list
- '([(meta up)] org-metaup)
- '([(meta down)] org-metadown)
- '([(meta left)] org-metaleft)
- '([(meta right)] org-metaright)
- '([(meta shift up)] org-shiftmetaup)
- '([(meta shift down)] org-shiftmetadown)
- '([(meta shift left)] org-shiftmetaleft)
- '([(meta shift right)] org-shiftmetaright)
- '([?\e (up)] org-metaup)
- '([?\e (down)] org-metadown)
- '([?\e (left)] org-metaleft)
- '([?\e (right)] org-metaright)
- '([?\e (shift up)] org-shiftmetaup)
- '([?\e (shift down)] org-shiftmetadown)
- '([?\e (shift left)] org-shiftmetaleft)
- '([?\e (shift right)] org-shiftmetaright)
- '([(shift up)] org-shiftup)
- '([(shift down)] org-shiftdown)
- '([(shift left)] org-shiftleft)
- '([(shift right)] org-shiftright)
- '("\C-c\C-c" org-ctrl-c-ctrl-c)
- '("\M-q" fill-paragraph)
- '("\C-c^" org-sort)
- '("\C-c-" org-cycle-list-bullet)))
- elt key fun cmd)
- (while (setq elt (pop bindings))
- (setq nfunc (1+ nfunc))
- (setq key (org-key (car elt))
- fun (nth 1 elt)
- cmd (orgstruct-make-binding fun nfunc key))
- (org-defkey orgstruct-mode-map key cmd))
-
- ;; Special treatment needed for TAB and RET
- (org-defkey orgstruct-mode-map [(tab)]
- (orgstruct-make-binding 'org-cycle 102 [(tab)] "\C-i"))
- (org-defkey orgstruct-mode-map "\C-i"
- (orgstruct-make-binding 'org-cycle 103 "\C-i" [(tab)]))
-
- (org-defkey orgstruct-mode-map "\M-\C-m"
- (orgstruct-make-binding 'org-insert-heading 105
- "\M-\C-m" [(meta return)]))
- (org-defkey orgstruct-mode-map [(meta return)]
- (orgstruct-make-binding 'org-insert-heading 106
- [(meta return)] "\M-\C-m"))
-
- (org-defkey orgstruct-mode-map [(shift meta return)]
- (orgstruct-make-binding 'org-insert-todo-heading 107
- [(meta return)] "\M-\C-m"))
-
- (org-defkey orgstruct-mode-map "\e\C-m"
- (orgstruct-make-binding 'org-insert-heading 108
- "\e\C-m" [?\e (return)]))
- (org-defkey orgstruct-mode-map [?\e (return)]
- (orgstruct-make-binding 'org-insert-heading 109
- [?\e (return)] "\e\C-m"))
- (org-defkey orgstruct-mode-map [?\e (shift return)]
- (orgstruct-make-binding 'org-insert-todo-heading 110
- [?\e (return)] "\e\C-m"))
-
- (unless org-local-vars
- (setq org-local-vars (org-get-local-variables)))
-
- t))
-
-(defun orgstruct-make-binding (fun n &rest keys)
- "Create a function for binding in the structure minor mode.
-FUN is the command to call inside a table. N is used to create a unique
-command name. KEYS are keys that should be checked in for a command
-to execute outside of tables."
- (eval
- (list 'defun
- (intern (concat "orgstruct-hijacker-command-" (int-to-string n)))
- '(arg)
- (concat "In Structure, run `" (symbol-name fun) "'.\n"
- "Outside of structure, run the binding of `"
- (mapconcat (lambda (x) (format "%s" x)) keys "' or `")
- "'.")
- '(interactive "p")
- (list 'if
- `(org-context-p 'headline 'item
- (and orgstruct-is-++
- ,(and (memq fun '(org-insert-heading org-insert-todo-heading)) t)
- 'item-body))
- (list 'org-run-like-in-org-mode (list 'quote fun))
- (list 'let '(orgstruct-mode)
- (list 'call-interactively
- (append '(or)
- (mapcar (lambda (k)
- (list 'key-binding k))
- keys)
- '('orgstruct-error))))))))
-
-(defun org-context-p (&rest contexts)
- "Check if local context is any of CONTEXTS.
-Possible values in the list of contexts are `table', `headline', and `item'."
- (let ((pos (point)))
- (goto-char (point-at-bol))
- (prog1 (or (and (memq 'table contexts)
- (looking-at "[ \t]*|"))
- (and (memq 'headline contexts)
-;;????????? (looking-at "\\*+"))
- (looking-at outline-regexp))
- (and (memq 'item contexts)
- (looking-at "[ \t]*\\([-+*] \\|[0-9]+[.)] \\)"))
- (and (memq 'item-body contexts)
- (org-in-item-p)))
- (goto-char pos))))
-
-(defun org-get-local-variables ()
- "Return a list of all local variables in an org-mode buffer."
- (let (varlist)
- (with-current-buffer (get-buffer-create "*Org tmp*")
- (erase-buffer)
- (org-mode)
- (setq varlist (buffer-local-variables)))
- (kill-buffer "*Org tmp*")
- (delq nil
- (mapcar
- (lambda (x)
- (setq x
- (if (symbolp x)
- (list x)
- (list (car x) (list 'quote (cdr x)))))
- (if (string-match
- "^\\(org-\\|orgtbl-\\|outline-\\|comment-\\|paragraph-\\|auto-fill\\|fill-paragraph\\|adaptive-fill\\|indent-\\)"
- (symbol-name (car x)))
- x nil))
- varlist))))
-
-;;;###autoload
-(defun org-run-like-in-org-mode (cmd)
- "Run a command, pretending that the current buffer is in Org-mode.
-This will temporarily bind local variables that are typically bound in
-Org-mode to the values they have in Org-mode, and then interactively
-call CMD."
- (org-load-modules-maybe)
- (unless org-local-vars
- (setq org-local-vars (org-get-local-variables)))
- (eval (list 'let org-local-vars
- (list 'call-interactively (list 'quote cmd)))))
-
-;;;; Archiving
-
-(defun org-get-category (&optional pos)
- "Get the category applying to position POS."
- (get-text-property (or pos (point)) 'org-category))
-
-(defun org-refresh-category-properties ()
- "Refresh category text properties in the buffer."
- (let ((def-cat (cond
- ((null org-category)
- (if buffer-file-name
- (file-name-sans-extension
- (file-name-nondirectory buffer-file-name))
- "???"))
- ((symbolp org-category) (symbol-name org-category))
- (t org-category)))
- beg end cat pos optionp)
- (org-unmodified
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (put-text-property (point) (point-max) 'org-category def-cat)
- (while (re-search-forward
- "^\\(#\\+CATEGORY:\\|[ \t]*:CATEGORY:\\)\\(.*\\)" nil t)
- (setq pos (match-end 0)
- optionp (equal (char-after (match-beginning 0)) ?#)
- cat (org-trim (match-string 2)))
- (if optionp
- (setq beg (point-at-bol) end (point-max))
- (org-back-to-heading t)
- (setq beg (point) end (org-end-of-subtree t t)))
- (put-text-property beg end 'org-category cat)
- (goto-char pos)))))))
-
-
-;;;; Link Stuff
-
-;;; Link abbreviations
-
-(defun org-link-expand-abbrev (link)
- "Apply replacements as defined in `org-link-abbrev-alist."
- (if (string-match "^\\([a-zA-Z][-_a-zA-Z0-9]*\\)\\(::?\\(.*\\)\\)?$" link)
- (let* ((key (match-string 1 link))
- (as (or (assoc key org-link-abbrev-alist-local)
- (assoc key org-link-abbrev-alist)))
- (tag (and (match-end 2) (match-string 3 link)))
- rpl)
- (if (not as)
- link
- (setq rpl (cdr as))
- (cond
- ((symbolp rpl) (funcall rpl tag))
- ((string-match "%s" rpl) (replace-match (or tag "") t t rpl))
- ((string-match "%h" rpl)
- (replace-match (url-hexify-string (or tag "")) t t rpl))
- (t (concat rpl tag)))))
- link))
-
-;;; Storing and inserting links
-
-(defvar org-insert-link-history nil
- "Minibuffer history for links inserted with `org-insert-link'.")
-
-(defvar org-stored-links nil
- "Contains the links stored with `org-store-link'.")
-
-(defvar org-store-link-plist nil
- "Plist with info about the most recently link created with `org-store-link'.")
-
-(defvar org-link-protocols nil
- "Link protocols added to Org-mode using `org-add-link-type'.")
-
-(defvar org-store-link-functions nil
- "List of functions that are called to create and store a link.
-Each function will be called in turn until one returns a non-nil
-value. Each function should check if it is responsible for creating
-this link (for example by looking at the major mode).
-If not, it must exit and return nil.
-If yes, it should return a non-nil value after a calling
-`org-store-link-props' with a list of properties and values.
-Special properties are:
-
-:type The link prefix, like \"http\". This must be given.
-:link The link, like \"http://www.astro.uva.nl/~dominik\".
- This is obligatory as well.
-:description Optional default description for the second pair
- of brackets in an Org-mode link. The user can still change
- this when inserting this link into an Org-mode buffer.
-
-In addition to these, any additional properties can be specified
-and then used in remember templates.")
-
-(defun org-add-link-type (type &optional follow export)
- "Add TYPE to the list of `org-link-types'.
-Re-compute all regular expressions depending on `org-link-types'
-
-FOLLOW and EXPORT are two functions.
-
-FOLLOW should take the link path as the single argument and do whatever
-is necessary to follow the link, for example find a file or display
-a mail message.
-
-EXPORT should format the link path for export to one of the export formats.
-It should be a function accepting three arguments:
-
- path the path of the link, the text after the prefix (like \"http:\")
- desc the description of the link, if any, nil if there was no description
- format the export format, a symbol like `html' or `latex' or `ascii'..
-
-The function may use the FORMAT information to return different values
-depending on the format. The return value will be put literally into
-the exported file. If the return value is nil, this means Org should
-do what it normally does with links which do not have EXPORT defined.
-
-Org-mode has a built-in default for exporting links. If you are happy with
-this default, there is no need to define an export function for the link
-type. For a simple example of an export function, see `org-bbdb.el'."
- (add-to-list 'org-link-types type t)
- (org-make-link-regexps)
- (if (assoc type org-link-protocols)
- (setcdr (assoc type org-link-protocols) (list follow export))
- (push (list type follow export) org-link-protocols)))
-
-(defvar org-agenda-buffer-name)
-
-;;;###autoload
-(defun org-store-link (arg)
- "\\<org-mode-map>Store an org-link to the current location.
-This link is added to `org-stored-links' and can later be inserted
-into an org-buffer with \\[org-insert-link].
-
-For some link types, a prefix arg is interpreted:
-For links to usenet articles, arg negates `org-gnus-prefer-web-links'.
-For file links, arg negates `org-context-in-file-links'."
- (interactive "P")
- (org-load-modules-maybe)
- (setq org-store-link-plist nil) ; reset
- (let ((outline-regexp (org-get-limited-outline-regexp))
- link cpltxt desc description search txt custom-id agenda-link)
- (cond
-
- ((run-hook-with-args-until-success 'org-store-link-functions)
- (setq link (plist-get org-store-link-plist :link)
- desc (or (plist-get org-store-link-plist :description) link)))
-
- ((equal (buffer-name) "*Org Edit Src Example*")
- (let (label gc)
- (while (or (not label)
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (re-search-forward
- (regexp-quote (format org-coderef-label-format label))
- nil t))))
- (when label (message "Label exists already") (sit-for 2))
- (setq label (read-string "Code line label: " label)))
- (end-of-line 1)
- (setq link (format org-coderef-label-format label))
- (setq gc (- 79 (length link)))
- (if (< (current-column) gc) (org-move-to-column gc t) (insert " "))
- (insert link)
- (setq link (concat "(" label ")") desc nil)))
-
- ((equal (org-bound-and-true-p org-agenda-buffer-name) (buffer-name))
- ;; We are in the agenda, link to referenced location
- (let ((m (or (get-text-property (point) 'org-hd-marker)
- (get-text-property (point) 'org-marker))))
- (when m
- (org-with-point-at m
- (setq agenda-link
- (if (interactive-p)
- (call-interactively 'org-store-link)
- (org-store-link nil)))))))
-
- ((eq major-mode 'calendar-mode)
- (let ((cd (calendar-cursor-to-date)))
- (setq link
- (format-time-string
- (car org-time-stamp-formats)
- (apply 'encode-time
- (list 0 0 0 (nth 1 cd) (nth 0 cd) (nth 2 cd)
- nil nil nil))))
- (org-store-link-props :type "calendar" :date cd)))
-
- ((eq major-mode 'w3-mode)
- (setq cpltxt (if (and (buffer-name)
- (not (string-match "Untitled" (buffer-name))))
- (buffer-name)
- (url-view-url t))
- link (org-make-link (url-view-url t)))
- (org-store-link-props :type "w3" :url (url-view-url t)))
-
- ((eq major-mode 'w3m-mode)
- (setq cpltxt (or w3m-current-title w3m-current-url)
- link (org-make-link w3m-current-url))
- (org-store-link-props :type "w3m" :url (url-view-url t)))
-
- ((setq search (run-hook-with-args-until-success
- 'org-create-file-search-functions))
- (setq link (concat "file:" (abbreviate-file-name buffer-file-name)
- "::" search))
- (setq cpltxt (or description link)))
-
- ((eq major-mode 'image-mode)
- (setq cpltxt (concat "file:"
- (abbreviate-file-name buffer-file-name))
- link (org-make-link cpltxt))
- (org-store-link-props :type "image" :file buffer-file-name))
-
- ((eq major-mode 'dired-mode)
- ;; link to the file in the current line
- (let ((file (dired-get-filename nil t)))
- (setq file (if file
- (abbreviate-file-name
- (expand-file-name (dired-get-filename nil t)))
- ;; otherwise, no file so use current directory.
- default-directory))
- (setq cpltxt (concat "file:" file)
- link (org-make-link cpltxt))))
-
- ((and (buffer-file-name (buffer-base-buffer)) (org-mode-p))
- (setq custom-id (ignore-errors (org-entry-get nil "CUSTOM_ID")))
- (cond
- ((org-in-regexp "<<\\(.*?\\)>>")
- (setq cpltxt
- (concat "file:"
- (abbreviate-file-name
- (buffer-file-name (buffer-base-buffer)))
- "::" (match-string 1))
- link (org-make-link cpltxt)))
- ((and (featurep 'org-id)
- (or (eq org-link-to-org-use-id t)
- (and (eq org-link-to-org-use-id 'create-if-interactive)
- (interactive-p))
- (and (eq org-link-to-org-use-id 'create-if-interactive-and-no-custom-id)
- (interactive-p)
- (not custom-id))
- (and org-link-to-org-use-id
- (condition-case nil
- (org-entry-get nil "ID")
- (error nil)))))
- ;; We can make a link using the ID.
- (setq link (condition-case nil
- (prog1 (org-id-store-link)
- (setq desc (plist-get org-store-link-plist
- :description)))
- (error
- ;; probably before first headline, link to file only
- (concat "file:"
- (abbreviate-file-name
- (buffer-file-name (buffer-base-buffer))))))))
- (t
- ;; Just link to current headline
- (setq cpltxt (concat "file:"
- (abbreviate-file-name
- (buffer-file-name (buffer-base-buffer)))))
- ;; Add a context search string
- (when (org-xor org-context-in-file-links arg)
- (setq txt (cond
- ((org-on-heading-p) nil)
- ((org-region-active-p)
- (buffer-substring (region-beginning) (region-end)))
- (t nil)))
- (when (or (null txt) (string-match "\\S-" txt))
- (setq cpltxt
- (concat cpltxt "::"
- (condition-case nil
- (org-make-org-heading-search-string txt)
- (error "")))
- desc (or (nth 4 (ignore-errors
- (org-heading-components))) "NONE"))))
- (if (string-match "::\\'" cpltxt)
- (setq cpltxt (substring cpltxt 0 -2)))
- (setq link (org-make-link cpltxt)))))
-
- ((buffer-file-name (buffer-base-buffer))
- ;; Just link to this file here.
- (setq cpltxt (concat "file:"
- (abbreviate-file-name
- (buffer-file-name (buffer-base-buffer)))))
- ;; Add a context string
- (when (org-xor org-context-in-file-links arg)
- (setq txt (if (org-region-active-p)
- (buffer-substring (region-beginning) (region-end))
- (buffer-substring (point-at-bol) (point-at-eol))))
- ;; Only use search option if there is some text.
- (when (string-match "\\S-" txt)
- (setq cpltxt
- (concat cpltxt "::" (org-make-org-heading-search-string txt))
- desc "NONE")))
- (setq link (org-make-link cpltxt)))
-
- ((interactive-p)
- (error "Cannot link to a buffer which is not visiting a file"))
-
- (t (setq link nil)))
-
- (if (consp link) (setq cpltxt (car link) link (cdr link)))
- (setq link (or link cpltxt)
- desc (or desc cpltxt))
- (if (equal desc "NONE") (setq desc nil))
-
- (if (and (or (interactive-p) executing-kbd-macro) link)
- (progn
- (setq org-stored-links
- (cons (list link desc) org-stored-links))
- (message "Stored: %s" (or desc link))
- (when custom-id
- (setq link (concat "file:" (abbreviate-file-name (buffer-file-name))
- "::#" custom-id))
- (setq org-stored-links
- (cons (list link desc) org-stored-links))))
- (or agenda-link (and link (org-make-link-string link desc))))))
-
-(defun org-store-link-props (&rest plist)
- "Store link properties, extract names and addresses."
- (let (x adr)
- (when (setq x (plist-get plist :from))
- (setq adr (mail-extract-address-components x))
- (setq plist (plist-put plist :fromname (car adr)))
- (setq plist (plist-put plist :fromaddress (nth 1 adr))))
- (when (setq x (plist-get plist :to))
- (setq adr (mail-extract-address-components x))
- (setq plist (plist-put plist :toname (car adr)))
- (setq plist (plist-put plist :toaddress (nth 1 adr)))))
- (let ((from (plist-get plist :from))
- (to (plist-get plist :to)))
- (when (and from to org-from-is-user-regexp)
- (setq plist
- (plist-put plist :fromto
- (if (string-match org-from-is-user-regexp from)
- (concat "to %t")
- (concat "from %f"))))))
- (setq org-store-link-plist plist))
-
-(defun org-add-link-props (&rest plist)
- "Add these properties to the link property list."
- (let (key value)
- (while plist
- (setq key (pop plist) value (pop plist))
- (setq org-store-link-plist
- (plist-put org-store-link-plist key value)))))
-
-(defun org-email-link-description (&optional fmt)
- "Return the description part of an email link.
-This takes information from `org-store-link-plist' and formats it
-according to FMT (default from `org-email-link-description-format')."
- (setq fmt (or fmt org-email-link-description-format))
- (let* ((p org-store-link-plist)
- (to (plist-get p :toaddress))
- (from (plist-get p :fromaddress))
- (table
- (list
- (cons "%c" (plist-get p :fromto))
- (cons "%F" (plist-get p :from))
- (cons "%f" (or (plist-get p :fromname) (plist-get p :fromaddress) "?"))
- (cons "%T" (plist-get p :to))
- (cons "%t" (or (plist-get p :toname) (plist-get p :toaddress) "?"))
- (cons "%s" (plist-get p :subject))
- (cons "%m" (plist-get p :message-id)))))
- (when (string-match "%c" fmt)
- ;; Check if the user wrote this message
- (if (and org-from-is-user-regexp from to
- (save-match-data (string-match org-from-is-user-regexp from)))
- (setq fmt (replace-match "to %t" t t fmt))
- (setq fmt (replace-match "from %f" t t fmt))))
- (org-replace-escapes fmt table)))
-
-(defun org-make-org-heading-search-string (&optional string heading)
- "Make search string for STRING or current headline."
- (interactive)
- (let ((s (or string (org-get-heading)))
- (lines org-context-in-file-links))
- (unless (and string (not heading))
- ;; We are using a headline, clean up garbage in there.
- (if (string-match org-todo-regexp s)
- (setq s (replace-match "" t t s)))
- (if (string-match (org-re ":[[:alnum:]_@#%:]+:[ \t]*$") s)
- (setq s (replace-match "" t t s)))
- (setq s (org-trim s))
- (if (string-match (concat "^\\(" org-quote-string "\\|"
- org-comment-string "\\)") s)
- (setq s (replace-match "" t t s)))
- (while (string-match org-ts-regexp s)
- (setq s (replace-match "" t t s))))
- (or string (setq s (concat "*" s))) ; Add * for headlines
- (when (and string (integerp lines) (> lines 0))
- (let ((slines (org-split-string s "\n")))
- (when (< lines (length slines))
- (setq s (mapconcat
- 'identity
- (reverse (nthcdr (- (length slines) lines)
- (reverse slines))) "\n")))))
- (mapconcat 'identity (org-split-string s "[ \t]+") " ")))
-
-(defun org-make-link (&rest strings)
- "Concatenate STRINGS."
- (apply 'concat strings))
-
-(defun org-make-link-string (link &optional description)
- "Make a link with brackets, consisting of LINK and DESCRIPTION."
- (unless (string-match "\\S-" link)
- (error "Empty link"))
- (when (and description
- (stringp description)
- (not (string-match "\\S-" description)))
- (setq description nil))
- (when (stringp description)
- ;; Remove brackets from the description, they are fatal.
- (while (string-match "\\[" description)
- (setq description (replace-match "{" t t description)))
- (while (string-match "\\]" description)
- (setq description (replace-match "}" t t description))))
- (when (equal (org-link-escape link) description)
- ;; No description needed, it is identical
- (setq description nil))
- (when (and (not description)
- (not (equal link (org-link-escape link))))
- (setq description (org-extract-attributes link)))
- (setq link (if (string-match org-link-types-re link)
- (concat (match-string 1 link)
- (org-link-escape (substring link (match-end 1))))
- (org-link-escape link)))
- (concat "[[" link "]"
- (if description (concat "[" description "]") "")
- "]"))
-
-(defconst org-link-escape-chars
- '((?\ . "%20")
- (?\[ . "%5B")
- (?\] . "%5D")
- (?\340 . "%E0") ; `a
- (?\342 . "%E2") ; ^a
- (?\347 . "%E7") ; ,c
- (?\350 . "%E8") ; `e
- (?\351 . "%E9") ; 'e
- (?\352 . "%EA") ; ^e
- (?\356 . "%EE") ; ^i
- (?\364 . "%F4") ; ^o
- (?\371 . "%F9") ; `u
- (?\373 . "%FB") ; ^u
- (?\; . "%3B")
-;; (?? . "%3F")
- (?= . "%3D")
- (?+ . "%2B")
- )
- "Association list of escapes for some characters problematic in links.
-This is the list that is used for internal purposes.")
-
-(defvar org-url-encoding-use-url-hexify nil)
-
-(defconst org-link-escape-chars-browser
- '((?\ . "%20")) ; 32 for the SPC char
- "Association list of escapes for some characters problematic in links.
-This is the list that is used before handing over to the browser.")
-
-(defun org-link-escape (text &optional table)
- "Escape characters in TEXT that are problematic for links."
- (if (and org-url-encoding-use-url-hexify (not table))
- (url-hexify-string text)
- (setq table (or table org-link-escape-chars))
- (when text
- (let ((re (mapconcat (lambda (x) (regexp-quote
- (char-to-string (car x))))
- table "\\|")))
- (while (string-match re text)
- (setq text
- (replace-match
- (cdr (assoc (string-to-char (match-string 0 text))
- table))
- t t text)))
- text))))
-
-(defun org-link-unescape (text &optional table)
- "Reverse the action of `org-link-escape'."
- (if (and org-url-encoding-use-url-hexify (not table))
- (url-unhex-string text)
- (setq table (or table org-link-escape-chars))
- (when text
- (let ((case-fold-search t)
- (re (mapconcat (lambda (x) (regexp-quote (downcase (cdr x))))
- table "\\|")))
- (while (string-match re text)
- (setq text
- (replace-match
- (char-to-string (car (rassoc (upcase (match-string 0 text))
- table)))
- t t text)))
- text))))
-
-(defun org-xor (a b)
- "Exclusive or."
- (if a (not b) b))
-
-(defun org-fixup-message-id-for-http (s)
- "Replace special characters in a message id, so it can be used in an http query."
- (when (string-match "%" s)
- (setq s (mapconcat (lambda (c)
- (if (eq c ?%)
- "%25"
- (char-to-string c)))
- s "")))
- (while (string-match "<" s)
- (setq s (replace-match "%3C" t t s)))
- (while (string-match ">" s)
- (setq s (replace-match "%3E" t t s)))
- (while (string-match "@" s)
- (setq s (replace-match "%40" t t s)))
- s)
-
-;;;###autoload
-(defun org-insert-link-global ()
- "Insert a link like Org-mode does.
-This command can be called in any mode to insert a link in Org-mode syntax."
- (interactive)
- (org-load-modules-maybe)
- (org-run-like-in-org-mode 'org-insert-link))
-
-(defun org-insert-link (&optional complete-file link-location)
- "Insert a link. At the prompt, enter the link.
-
-Completion can be used to insert any of the link protocol prefixes like
-http or ftp in use.
-
-The history can be used to select a link previously stored with
-`org-store-link'. When the empty string is entered (i.e. if you just
-press RET at the prompt), the link defaults to the most recently
-stored link. As SPC triggers completion in the minibuffer, you need to
-use M-SPC or C-q SPC to force the insertion of a space character.
-
-You will also be prompted for a description, and if one is given, it will
-be displayed in the buffer instead of the link.
-
-If there is already a link at point, this command will allow you to edit link
-and description parts.
-
-With a \\[universal-argument] prefix, prompts for a file to link to. The file name can
-be selected using completion. The path to the file will be relative to the
-current directory if the file is in the current directory or a subdirectory.
-Otherwise, the link will be the absolute path as completed in the minibuffer
-\(i.e. normally ~/path/to/file). You can configure this behavior using the
-option `org-link-file-path-type'.
-
-With two \\[universal-argument] prefixes, enforce an absolute path even if the file is in
-the current directory or below.
-
-With three \\[universal-argument] prefixes, negate the meaning of
-`org-keep-stored-link-after-insertion'.
-
-If `org-make-link-description-function' is non-nil, this function will be
-called with the link target, and the result will be the default
-link description.
-
-If the LINK-LOCATION parameter is non-nil, this value will be
-used as the link location instead of reading one interactively."
- (interactive "P")
- (let* ((wcf (current-window-configuration))
- (region (if (org-region-active-p)
- (buffer-substring (region-beginning) (region-end))))
- (remove (and region (list (region-beginning) (region-end))))
- (desc region)
- tmphist ; byte-compile incorrectly complains about this
- (link link-location)
- entry file all-prefixes)
- (cond
- (link-location) ; specified by arg, just use it.
- ((org-in-regexp org-bracket-link-regexp 1)
- ;; We do have a link at point, and we are going to edit it.
- (setq remove (list (match-beginning 0) (match-end 0)))
- (setq desc (if (match-end 3) (org-match-string-no-properties 3)))
- (setq link (read-string "Link: "
- (org-link-unescape
- (org-match-string-no-properties 1)))))
- ((or (org-in-regexp org-angle-link-re)
- (org-in-regexp org-plain-link-re))
- ;; Convert to bracket link
- (setq remove (list (match-beginning 0) (match-end 0))
- link (read-string "Link: "
- (org-remove-angle-brackets (match-string 0)))))
- ((member complete-file '((4) (16)))
- ;; Completing read for file names.
- (setq link (org-file-complete-link complete-file)))
- (t
- ;; Read link, with completion for stored links.
- (with-output-to-temp-buffer "*Org Links*"
- (princ "Insert a link.
-Use TAB to complete link prefixes, then RET for type-specific completion support\n")
- (when org-stored-links
- (princ "\nStored links are available with <up>/<down> or M-p/n (most recent with RET):\n\n")
- (princ (mapconcat
- (lambda (x)
- (if (nth 1 x) (concat (car x) " (" (nth 1 x) ")") (car x)))
- (reverse org-stored-links) "\n"))))
- (let ((cw (selected-window)))
- (select-window (get-buffer-window "*Org Links*" 'visible))
- (setq truncate-lines t)
- (unless (pos-visible-in-window-p (point-max))
- (org-fit-window-to-buffer))
- (and (window-live-p cw) (select-window cw)))
- ;; Fake a link history, containing the stored links.
- (setq tmphist (append (mapcar 'car org-stored-links)
- org-insert-link-history))
- (setq all-prefixes (append (mapcar 'car org-link-abbrev-alist-local)
- (mapcar 'car org-link-abbrev-alist)
- org-link-types))
- (unwind-protect
- (progn
- (setq link
- (let ((org-completion-use-ido nil)
- (org-completion-use-iswitchb nil))
- (org-completing-read
- "Link: "
- (append
- (mapcar (lambda (x) (list (concat x ":")))
- all-prefixes)
- (mapcar 'car org-stored-links))
- nil nil nil
- 'tmphist
- (car (car org-stored-links)))))
- (if (not (string-match "\\S-" link))
- (error "No link selected"))
- (if (or (member link all-prefixes)
- (and (equal ":" (substring link -1))
- (member (substring link 0 -1) all-prefixes)
- (setq link (substring link 0 -1))))
- (setq link (org-link-try-special-completion link))))
- (set-window-configuration wcf)
- (kill-buffer "*Org Links*"))
- (setq entry (assoc link org-stored-links))
- (or entry (push link org-insert-link-history))
- (if (funcall (if (equal complete-file '(64)) 'not 'identity)
- (not org-keep-stored-link-after-insertion))
- (setq org-stored-links (delq (assoc link org-stored-links)
- org-stored-links)))
- (setq desc (or desc (nth 1 entry)))))
-
- (if (string-match org-plain-link-re link)
- ;; URL-like link, normalize the use of angular brackets.
- (setq link (org-make-link (org-remove-angle-brackets link))))
-
- ;; Check if we are linking to the current file with a search option
- ;; If yes, simplify the link by using only the search option.
- (when (and buffer-file-name
- (string-match "^file:\\(.+?\\)::\\([^>]+\\)" link))
- (let* ((path (match-string 1 link))
- (case-fold-search nil)
- (search (match-string 2 link)))
- (save-match-data
- (if (equal (file-truename buffer-file-name) (file-truename path))
- ;; We are linking to this same file, with a search option
- (setq link search)))))
-
- ;; Check if we can/should use a relative path. If yes, simplify the link
- (when (string-match "^\\(file:\\|docview:\\)\\(.*\\)" link)
- (let* ((type (match-string 1 link))
- (path (match-string 2 link))
- (origpath path)
- (case-fold-search nil))
- (cond
- ((or (eq org-link-file-path-type 'absolute)
- (equal complete-file '(16)))
- (setq path (abbreviate-file-name (expand-file-name path))))
- ((eq org-link-file-path-type 'noabbrev)
- (setq path (expand-file-name path)))
- ((eq org-link-file-path-type 'relative)
- (setq path (file-relative-name path)))
- (t
- (save-match-data
- (if (string-match (concat "^" (regexp-quote
- (expand-file-name
- (file-name-as-directory
- default-directory))))
- (expand-file-name path))
- ;; We are linking a file with relative path name.
- (setq path (substring (expand-file-name path)
- (match-end 0)))
- (setq path (abbreviate-file-name (expand-file-name path)))))))
- (setq link (concat type path))
- (if (equal desc origpath)
- (setq desc path))))
-
- (if org-make-link-description-function
- (setq desc (funcall org-make-link-description-function link desc)))
-
- (setq desc (read-string "Description: " desc))
- (unless (string-match "\\S-" desc) (setq desc nil))
- (if remove (apply 'delete-region remove))
- (insert (org-make-link-string link desc))))
-
-(defun org-link-try-special-completion (type)
- "If there is completion support for link type TYPE, offer it."
- (let ((fun (intern (concat "org-" type "-complete-link"))))
- (if (functionp fun)
- (funcall fun)
- (read-string "Link (no completion support): " (concat type ":")))))
-
-(defun org-file-complete-link (&optional arg)
- "Create a file link using completion."
- (let (file link)
- (setq file (read-file-name "File: "))
- (let ((pwd (file-name-as-directory (expand-file-name ".")))
- (pwd1 (file-name-as-directory (abbreviate-file-name
- (expand-file-name ".")))))
- (cond
- ((equal arg '(16))
- (setq link (org-make-link
- "file:"
- (abbreviate-file-name (expand-file-name file)))))
- ((string-match (concat "^" (regexp-quote pwd1) "\\(.+\\)") file)
- (setq link (org-make-link "file:" (match-string 1 file))))
- ((string-match (concat "^" (regexp-quote pwd) "\\(.+\\)")
- (expand-file-name file))
- (setq link (org-make-link
- "file:" (match-string 1 (expand-file-name file)))))
- (t (setq link (org-make-link "file:" file)))))
- link))
-
-(defun org-completing-read (&rest args)
- "Completing-read with SPACE being a normal character."
- (let ((minibuffer-local-completion-map
- (copy-keymap minibuffer-local-completion-map)))
- (org-defkey minibuffer-local-completion-map " " 'self-insert-command)
- (org-defkey minibuffer-local-completion-map "?" 'self-insert-command)
- (apply 'org-icompleting-read args)))
-
-(defun org-completing-read-no-i (&rest args)
- (let (org-completion-use-ido org-completion-use-iswitchb)
- (apply 'org-completing-read args)))
-
-(defun org-iswitchb-completing-read (prompt choices &rest args)
- "Use iswitch as a completing-read replacement to choose from choices.
-PROMPT is a string to prompt with. CHOICES is a list of strings to choose
-from."
- (let* ((iswitchb-use-virtual-buffers nil)
- (iswitchb-make-buflist-hook
- (lambda ()
- (setq iswitchb-temp-buflist choices))))
- (iswitchb-read-buffer prompt)))
-
-(defun org-icompleting-read (&rest args)
- "Completing-read using `ido-mode' or `iswitchb' speedups if available."
- (org-without-partial-completion
- (if (and org-completion-use-ido
- (fboundp 'ido-completing-read)
- (boundp 'ido-mode) ido-mode
- (listp (second args)))
- (let ((ido-enter-matching-directory nil))
- (apply 'ido-completing-read (concat (car args))
- (if (consp (car (nth 1 args)))
- (mapcar (lambda (x) (car x)) (nth 1 args))
- (nth 1 args))
- (cddr args)))
- (if (and org-completion-use-iswitchb
- (boundp 'iswitchb-mode) iswitchb-mode
- (listp (second args)))
- (apply 'org-iswitchb-completing-read (concat (car args))
- (if (consp (car (nth 1 args)))
- (mapcar (lambda (x) (car x)) (nth 1 args))
- (nth 1 args))
- (cddr args))
- (apply 'completing-read args)))))
-
-(defun org-extract-attributes (s)
- "Extract the attributes cookie from a string and set as text property."
- (let (a attr (start 0) key value)
- (save-match-data
- (when (string-match "{{\\([^}]+\\)}}$" s)
- (setq a (match-string 1 s) s (substring s 0 (match-beginning 0)))
- (while (string-match "\\([a-zA-Z]+\\)=\"\\([^\"]*\\)\"" a start)
- (setq key (match-string 1 a) value (match-string 2 a)
- start (match-end 0)
- attr (plist-put attr (intern key) value))))
- (org-add-props s nil 'org-attr attr))
- s))
-
-(defun org-extract-attributes-from-string (tag)
- (let (key value attr)
- (while (string-match "\\([a-zA-Z]+\\)=\"\\([^\"]*\\)\"\\s-?" tag)
- (setq key (match-string 1 tag) value (match-string 2 tag)
- tag (replace-match "" t t tag)
- attr (plist-put attr (intern key) value)))
- (cons tag attr)))
-
-(defun org-attributes-to-string (plist)
- "Format a property list into an HTML attribute list."
- (let ((s "") key value)
- (while plist
- (setq key (pop plist) value (pop plist))
- (and value
- (setq s (concat s " " (symbol-name key) "=\"" value "\""))))
- s))
-
-;;; Opening/following a link
-
-(defvar org-link-search-failed nil)
-
-(defvar org-open-link-functions nil
- "Hook for functions finding a plain text link.
-These functions must take a single argument, the link content.
-They will be called for links that look like [[link text][description]]
-when LINK TEXT does not have a protocol like \"http:\" and does not look
-like a filename (e.g. \"./blue.png\").
-
-These functions will be called *before* Org attempts to resolve the
-link by doing text searches in the current buffer - so if you want a
-link \"[[target]]\" to still find \"<<target>>\", your function should
-handle this as a special case.
-
-When the function does handle the link, it must return a non-nil value.
-If it decides that it is not responsible for this link, it must return
-nil to indicate that that Org-mode can continue with other options
-like exact and fuzzy text search.")
-
-(defun org-next-link ()
- "Move forward to the next link.
-If the link is in hidden text, expose it."
- (interactive)
- (when (and org-link-search-failed (eq this-command last-command))
- (goto-char (point-min))
- (message "Link search wrapped back to beginning of buffer"))
- (setq org-link-search-failed nil)
- (let* ((pos (point))
- (ct (org-context))
- (a (assoc :link ct)))
- (if a (goto-char (nth 2 a)))
- (if (re-search-forward org-any-link-re nil t)
- (progn
- (goto-char (match-beginning 0))
- (if (org-invisible-p) (org-show-context)))
- (goto-char pos)
- (setq org-link-search-failed t)
- (error "No further link found"))))
-
-(defun org-previous-link ()
- "Move backward to the previous link.
-If the link is in hidden text, expose it."
- (interactive)
- (when (and org-link-search-failed (eq this-command last-command))
- (goto-char (point-max))
- (message "Link search wrapped back to end of buffer"))
- (setq org-link-search-failed nil)
- (let* ((pos (point))
- (ct (org-context))
- (a (assoc :link ct)))
- (if a (goto-char (nth 1 a)))
- (if (re-search-backward org-any-link-re nil t)
- (progn
- (goto-char (match-beginning 0))
- (if (org-invisible-p) (org-show-context)))
- (goto-char pos)
- (setq org-link-search-failed t)
- (error "No further link found"))))
-
-(defun org-translate-link (s)
- "Translate a link string if a translation function has been defined."
- (if (and org-link-translation-function
- (fboundp org-link-translation-function)
- (string-match "\\([a-zA-Z0-9]+\\):\\(.*\\)" s))
- (progn
- (setq s (funcall org-link-translation-function
- (match-string 1) (match-string 2)))
- (concat (car s) ":" (cdr s)))
- s))
-
-(defun org-translate-link-from-planner (type path)
- "Translate a link from Emacs Planner syntax so that Org can follow it.
-This is still an experimental function, your mileage may vary."
- (cond
- ((member type '("http" "https" "news" "ftp"))
- ;; standard Internet links are the same.
- nil)
- ((and (equal type "irc") (string-match "^//" path))
- ;; Planner has two / at the beginning of an irc link, we have 1.
- ;; We should have zero, actually....
- (setq path (substring path 1)))
- ((and (equal type "lisp") (string-match "^/" path))
- ;; Planner has a slash, we do not.
- (setq type "elisp" path (substring path 1)))
- ((string-match "^//\\(.?*\\)/\\(<.*>\\)$" path)
- ;; A typical message link. Planner has the id after the final slash,
- ;; we separate it with a hash mark
- (setq path (concat (match-string 1 path) "#"
- (org-remove-angle-brackets (match-string 2 path)))))
- )
- (cons type path))
-
-(defun org-find-file-at-mouse (ev)
- "Open file link or URL at mouse."
- (interactive "e")
- (mouse-set-point ev)
- (org-open-at-point 'in-emacs))
-
-(defun org-open-at-mouse (ev)
- "Open file link or URL at mouse."
- (interactive "e")
- (mouse-set-point ev)
- (if (eq major-mode 'org-agenda-mode)
- (org-agenda-copy-local-variable 'org-link-abbrev-alist-local))
- (org-open-at-point))
-
-(defvar org-window-config-before-follow-link nil
- "The window configuration before following a link.
-This is saved in case the need arises to restore it.")
-
-(defvar org-open-link-marker (make-marker)
- "Marker pointing to the location where `org-open-at-point; was called.")
-
-;;;###autoload
-(defun org-open-at-point-global ()
- "Follow a link like Org-mode does.
-This command can be called in any mode to follow a link that has
-Org-mode syntax."
- (interactive)
- (org-run-like-in-org-mode 'org-open-at-point))
-
-;;;###autoload
-(defun org-open-link-from-string (s &optional arg reference-buffer)
- "Open a link in the string S, as if it was in Org-mode."
- (interactive "sLink: \nP")
- (let ((reference-buffer (or reference-buffer (current-buffer))))
- (with-temp-buffer
- (let ((org-inhibit-startup t))
- (org-mode)
- (insert s)
- (goto-char (point-min))
- (when reference-buffer
- (setq org-link-abbrev-alist-local
- (with-current-buffer reference-buffer
- org-link-abbrev-alist-local)))
- (org-open-at-point arg reference-buffer)))))
-
-(defvar org-open-at-point-functions nil
- "Hook that is run when following a link at point.
-
-Functions in this hook must return t if they identify and follow
-a link at point. If they don't find anything interesting at point,
-they must return nil.")
-
-(defun org-open-at-point (&optional in-emacs reference-buffer)
- "Open link at or after point.
-If there is no link at point, this function will search forward up to
-the end of the current line.
-Normally, files will be opened by an appropriate application. If the
-optional argument IN-EMACS is non-nil, Emacs will visit the file.
-With a double prefix argument, try to open outside of Emacs, in the
-application the system uses for this file type."
- (interactive "P")
- ;; if in a code block, then open the block's results
- (unless (call-interactively #'org-babel-open-src-block-result)
- (org-load-modules-maybe)
- (move-marker org-open-link-marker (point))
- (setq org-window-config-before-follow-link (current-window-configuration))
- (org-remove-occur-highlights nil nil t)
- (cond
- ((and (org-on-heading-p)
- (not (org-in-regexp
- (concat org-plain-link-re "\\|"
- org-bracket-link-regexp "\\|"
- org-angle-link-re "\\|"
- "[ \t]:[^ \t\n]+:[ \t]*$")))
- (not (get-text-property (point) 'org-linked-text)))
- (or (org-offer-links-in-entry in-emacs)
- (progn (require 'org-attach) (org-attach-reveal 'if-exists))))
- ((run-hook-with-args-until-success 'org-open-at-point-functions))
- ((org-at-timestamp-p t) (org-follow-timestamp-link))
- ((and (or (org-footnote-at-reference-p) (org-footnote-at-definition-p))
- (not (org-in-regexp org-bracket-link-regexp)))
- (org-footnote-action))
- (t
- (let (type path link line search (pos (point)))
- (catch 'match
- (save-excursion
- (skip-chars-forward "^]\n\r")
- (when (org-in-regexp org-bracket-link-regexp 1)
- (setq link (org-extract-attributes
- (org-link-unescape (org-match-string-no-properties 1))))
- (while (string-match " *\n *" link)
- (setq link (replace-match " " t t link)))
- (setq link (org-link-expand-abbrev link))
- (cond
- ((or (file-name-absolute-p link)
- (string-match "^\\.\\.?/" link))
- (setq type "file" path link))
- ((string-match org-link-re-with-space3 link)
- (setq type (match-string 1 link) path (match-string 2 link)))
- (t (setq type "thisfile" path link)))
- (throw 'match t)))
-
- (when (get-text-property (point) 'org-linked-text)
- (setq type "thisfile"
- pos (if (get-text-property (1+ (point)) 'org-linked-text)
- (1+ (point)) (point))
- path (buffer-substring
- (previous-single-property-change pos 'org-linked-text)
- (next-single-property-change pos 'org-linked-text)))
- (throw 'match t))
-
- (save-excursion
- (when (or (org-in-regexp org-angle-link-re)
- (org-in-regexp org-plain-link-re))
- (setq type (match-string 1) path (match-string 2))
- (throw 'match t)))
- (save-excursion
- (when (org-in-regexp (org-re "\\(:[[:alnum:]_@#%:]+\\):[ \t]*$"))
- (setq type "tags"
- path (match-string 1))
- (while (string-match ":" path)
- (setq path (replace-match "+" t t path)))
- (throw 'match t)))
- (when (org-in-regexp "<\\([^><\n]+\\)>")
- (setq type "tree-match"
- path (match-string 1))
- (throw 'match t)))
- (unless path
- (error "No link found"))
-
- ;; switch back to reference buffer
- ;; needed when if called in a temporary buffer through
- ;; org-open-link-from-string
- (with-current-buffer (or reference-buffer (current-buffer))
-
- ;; Remove any trailing spaces in path
- (if (string-match " +\\'" path)
- (setq path (replace-match "" t t path)))
- (if (and org-link-translation-function
- (fboundp org-link-translation-function))
- ;; Check if we need to translate the link
- (let ((tmp (funcall org-link-translation-function type path)))
- (setq type (car tmp) path (cdr tmp))))
-
- (cond
-
- ((assoc type org-link-protocols)
- (funcall (nth 1 (assoc type org-link-protocols)) path))
-
- ((equal type "mailto")
- (let ((cmd (car org-link-mailto-program))
- (args (cdr org-link-mailto-program)) args1
- (address path) (subject "") a)
- (if (string-match "\\(.*\\)::\\(.*\\)" path)
- (setq address (match-string 1 path)
- subject (org-link-escape (match-string 2 path))))
- (while args
- (cond
- ((not (stringp (car args))) (push (pop args) args1))
- (t (setq a (pop args))
- (if (string-match "%a" a)
- (setq a (replace-match address t t a)))
- (if (string-match "%s" a)
- (setq a (replace-match subject t t a)))
- (push a args1))))
- (apply cmd (nreverse args1))))
-
- ((member type '("http" "https" "ftp" "news"))
- (browse-url (concat type ":" (org-link-escape
- path org-link-escape-chars-browser))))
-
- ((string= type "doi")
- (browse-url (concat "http://dx.doi.org/"
- (org-link-escape
- path org-link-escape-chars-browser))))
-
- ((member type '("message"))
- (browse-url (concat type ":" path)))
-
- ((string= type "tags")
- (org-tags-view in-emacs path))
-
- ((string= type "tree-match")
- (org-occur (concat "\\[" (regexp-quote path) "\\]")))
-
- ((string= type "file")
- (if (string-match "::\\([0-9]+\\)\\'" path)
- (setq line (string-to-number (match-string 1 path))
- path (substring path 0 (match-beginning 0)))
- (if (string-match "::\\(.+\\)\\'" path)
- (setq search (match-string 1 path)
- path (substring path 0 (match-beginning 0)))))
- (if (string-match "[*?{]" (file-name-nondirectory path))
- (dired path)
- (org-open-file path in-emacs line search)))
-
- ((string= type "shell")
- (let ((cmd path))
- (if (or (not org-confirm-shell-link-function)
- (funcall org-confirm-shell-link-function
- (format "Execute \"%s\" in shell? "
- (org-add-props cmd nil
- 'face 'org-warning))))
- (progn
- (message "Executing %s" cmd)
- (shell-command cmd))
- (error "Abort"))))
-
- ((string= type "elisp")
- (let ((cmd path))
- (if (or (not org-confirm-elisp-link-function)
- (funcall org-confirm-elisp-link-function
- (format "Execute \"%s\" as elisp? "
- (org-add-props cmd nil
- 'face 'org-warning))))
- (message "%s => %s" cmd
- (if (equal (string-to-char cmd) ?\()
- (eval (read cmd))
- (call-interactively (read cmd))))
- (error "Abort"))))
-
- ((and (string= type "thisfile")
- (run-hook-with-args-until-success
- 'org-open-link-functions path)))
-
- ((string= type "thisfile")
- (if in-emacs
- (switch-to-buffer-other-window
- (org-get-buffer-for-internal-link (current-buffer)))
- (org-mark-ring-push))
- (let ((cmd `(org-link-search
- ,path
- ,(cond ((equal in-emacs '(4)) 'occur)
- ((equal in-emacs '(16)) 'org-occur)
- (t nil))
- ,pos)))
- (condition-case nil (eval cmd)
- (error (progn (widen) (eval cmd))))))
-
- (t
- (browse-url-at-point)))))))
- (move-marker org-open-link-marker nil)
- (run-hook-with-args 'org-follow-link-hook)))
-
-(defun org-offer-links-in-entry (&optional nth zero)
- "Offer links in the current entry and follow the selected link.
-If there is only one link, follow it immediately as well.
-If NTH is an integer, immediately pick the NTH link found.
-If ZERO is a string, check also this string for a link, and if
-there is one, offer it as link number zero."
- (let ((re (concat "\\(" org-bracket-link-regexp "\\)\\|"
- "\\(" org-angle-link-re "\\)\\|"
- "\\(" org-plain-link-re "\\)"))
- (cnt ?0)
- (in-emacs (if (integerp nth) nil nth))
- have-zero end links link c)
- (when (and (stringp zero) (string-match org-bracket-link-regexp zero))
- (push (match-string 0 zero) links)
- (setq cnt (1- cnt) have-zero t))
- (save-excursion
- (org-back-to-heading t)
- (setq end (save-excursion (outline-next-heading) (point)))
- (while (re-search-forward re end t)
- (push (match-string 0) links))
- (setq links (org-uniquify (reverse links))))
-
- (cond
- ((null links)
- (message "No links"))
- ((equal (length links) 1)
- (setq link (list (car links))))
- ((and (integerp nth) (>= (length links) (if have-zero (1+ nth) nth)))
- (setq link (nth (if have-zero nth (1- nth)) links)))
- (t ; we have to select a link
- (save-excursion
- (save-window-excursion
- (delete-other-windows)
- (with-output-to-temp-buffer "*Select Link*"
- (mapc (lambda (l)
- (if (not (string-match org-bracket-link-regexp l))
- (princ (format "[%c] %s\n" (incf cnt)
- (org-remove-angle-brackets l)))
- (if (match-end 3)
- (princ (format "[%c] %s (%s)\n" (incf cnt)
- (match-string 3 l) (match-string 1 l)))
- (princ (format "[%c] %s\n" (incf cnt)
- (match-string 1 l))))))
- links))
- (org-fit-window-to-buffer (get-buffer-window "*Select Link*"))
- (message "Select link to open, RET to open all:")
- (setq c (read-char-exclusive))
- (and (get-buffer "*Select Link*") (kill-buffer "*Select Link*"))))
- (when (equal c ?q) (error "Abort"))
- (if (equal c ?\C-m)
- (setq link links)
- (setq nth (- c ?0))
- (if have-zero (setq nth (1+ nth)))
- (unless (and (integerp nth) (>= (length links) nth))
- (error "Invalid link selection"))
- (setq link (list (nth (1- nth) links))))))
- (if link
- (let ((buf (current-buffer)))
- (dolist (l link)
- (org-open-link-from-string l in-emacs buf))
- t)
- nil)))
-
-;; Add special file links that specify the way of opening
-
-(org-add-link-type "file+sys" 'org-open-file-with-system)
-(org-add-link-type "file+emacs" 'org-open-file-with-emacs)
-(defun org-open-file-with-system (path)
- "Open file at PATH using the system way of opening it."
- (org-open-file path 'system))
-(defun org-open-file-with-emacs (path)
- "Open file at PATH in Emacs."
- (org-open-file path 'emacs))
-(defun org-remove-file-link-modifiers ()
- "Remove the file link modifiers in `file+sys:' and `file+emacs:' links."
- (goto-char (point-min))
- (while (re-search-forward "\\<file\\+\\(sys\\|emacs\\):" nil t)
- (org-if-unprotected
- (replace-match "file:" t t))))
-(eval-after-load "org-exp"
- '(add-hook 'org-export-preprocess-before-normalizing-links-hook
- 'org-remove-file-link-modifiers))
-
-;;;; Time estimates
-
-(defun org-get-effort (&optional pom)
- "Get the effort estimate for the current entry."
- (org-entry-get pom org-effort-property))
-
-;;; File search
-
-(defvar org-create-file-search-functions nil
- "List of functions to construct the right search string for a file link.
-These functions are called in turn with point at the location to
-which the link should point.
-
-A function in the hook should first test if it would like to
-handle this file type, for example by checking the `major-mode'
-or the file extension. If it decides not to handle this file, it
-should just return nil to give other functions a chance. If it
-does handle the file, it must return the search string to be used
-when following the link. The search string will be part of the
-file link, given after a double colon, and `org-open-at-point'
-will automatically search for it. If special measures must be
-taken to make the search successful, another function should be
-added to the companion hook `org-execute-file-search-functions',
-which see.
-
-A function in this hook may also use `setq' to set the variable
-`description' to provide a suggestion for the descriptive text to
-be used for this link when it gets inserted into an Org-mode
-buffer with \\[org-insert-link].")
-
-(defvar org-execute-file-search-functions nil
- "List of functions to execute a file search triggered by a link.
-
-Functions added to this hook must accept a single argument, the
-search string that was part of the file link, the part after the
-double colon. The function must first check if it would like to
-handle this search, for example by checking the `major-mode' or
-the file extension. If it decides not to handle this search, it
-should just return nil to give other functions a chance. If it
-does handle the search, it must return a non-nil value to keep
-other functions from trying.
-
-Each function can access the current prefix argument through the
-variable `current-prefix-argument'. Note that a single prefix is
-used to force opening a link in Emacs, so it may be good to only
-use a numeric or double prefix to guide the search function.
-
-In case this is needed, a function in this hook can also restore
-the window configuration before `org-open-at-point' was called using:
-
- (set-window-configuration org-window-config-before-follow-link)")
-
-(defvar org-link-search-inhibit-query nil) ;; dynamically scoped
-(defun org-link-search (s &optional type avoid-pos)
- "Search for a link search option.
-If S is surrounded by forward slashes, it is interpreted as a
-regular expression. In org-mode files, this will create an `org-occur'
-sparse tree. In ordinary files, `occur' will be used to list matches.
-If the current buffer is in `dired-mode', grep will be used to search
-in all files. If AVOID-POS is given, ignore matches near that position."
- (let ((case-fold-search t)
- (s0 (mapconcat 'identity (org-split-string s "[ \t\r\n]+") " "))
- (markers (concat "\\(?:" (mapconcat (lambda (x) (regexp-quote (car x)))
- (append '(("") (" ") ("\t") ("\n"))
- org-emphasis-alist)
- "\\|") "\\)"))
- (pos (point))
- (pre nil) (post nil)
- words re0 re1 re2 re3 re4_ re4 re5 re2a re2a_ reall)
- (cond
- ;; First check if there are any special search functions
- ((run-hook-with-args-until-success 'org-execute-file-search-functions s))
- ;; Now try the builtin stuff
- ((and (equal (string-to-char s0) ?#)
- (> (length s0) 1)
- (save-excursion
- (goto-char (point-min))
- (and
- (re-search-forward
- (concat "^[ \t]*:CUSTOM_ID:[ \t]+" (regexp-quote (substring s0 1)) "[ \t]*$") nil t)
- (setq type 'dedicated
- pos (match-beginning 0))))
- ;; There is an exact target for this
- (goto-char pos)
- (org-back-to-heading t)))
- ((save-excursion
- (goto-char (point-min))
- (and
- (re-search-forward
- (concat "<<" (regexp-quote s0) ">>") nil t)
- (setq type 'dedicated
- pos (match-beginning 0))))
- ;; There is an exact target for this
- (goto-char pos))
- ((and (string-match "^(\\(.*\\))$" s0)
- (save-excursion
- (goto-char (point-min))
- (and
- (re-search-forward
- (concat "[^[]" (regexp-quote
- (format org-coderef-label-format
- (match-string 1 s0))))
- nil t)
- (setq type 'dedicated
- pos (1+ (match-beginning 0))))))
- ;; There is a coderef target for this
- (goto-char pos))
- ((string-match "^/\\(.*\\)/$" s)
- ;; A regular expression
- (cond
- ((org-mode-p)
- (org-occur (match-string 1 s)))
- ;;((eq major-mode 'dired-mode)
- ;; (grep (concat "grep -n -e '" (match-string 1 s) "' *")))
- (t (org-do-occur (match-string 1 s)))))
- ((and (org-mode-p) org-link-search-must-match-exact-headline)
- (and (equal (string-to-char s) ?*) (setq s (substring s 1)))
- (goto-char (point-min))
- (cond
- ((let (case-fold-search)
- (re-search-forward (format org-complex-heading-regexp-format
- (regexp-quote s))
- nil t))
- ;; OK, found a match
- (setq type 'dedicated)
- (goto-char (match-beginning 0)))
- ((and (not org-link-search-inhibit-query)
- (eq org-link-search-must-match-exact-headline 'query-to-create)
- (y-or-n-p "No match - create this as a new heading? "))
- (goto-char (point-max))
- (or (bolp) (newline))
- (insert "* " s "\n")
- (beginning-of-line 0))
- (t
- (goto-char pos)
- (error "No match"))))
- (t
- ;; A normal search string
- (when (equal (string-to-char s) ?*)
- ;; Anchor on headlines, post may include tags.
- (setq pre "^\\*+[ \t]+\\(?:\\sw+\\)?[ \t]*"
- post (org-re "[ \t]*\\(?:[ \t]+:[[:alnum:]_@#%:+]:[ \t]*\\)?$")
- s (substring s 1)))
- (remove-text-properties
- 0 (length s)
- '(face nil mouse-face nil keymap nil fontified nil) s)
- ;; Make a series of regular expressions to find a match
- (setq words (org-split-string s "[ \n\r\t]+")
-
- re0 (concat "\\(<<" (regexp-quote s0) ">>\\)")
- re2 (concat markers "\\(" (mapconcat 'downcase words "[ \t]+")
- "\\)" markers)
- re2a_ (concat "\\(" (mapconcat 'downcase words "[ \t\r\n]+") "\\)[ \t\r\n]")
- re2a (concat "[ \t\r\n]" re2a_)
- re4_ (concat "\\(" (mapconcat 'downcase words "[^a-zA-Z_\r\n]+") "\\)[^a-zA-Z_]")
- re4 (concat "[^a-zA-Z_]" re4_)
-
- re1 (concat pre re2 post)
- re3 (concat pre (if pre re4_ re4) post)
- re5 (concat pre ".*" re4)
- re2 (concat pre re2)
- re2a (concat pre (if pre re2a_ re2a))
- re4 (concat pre (if pre re4_ re4))
- reall (concat "\\(" re0 "\\)\\|\\(" re1 "\\)\\|\\(" re2
- "\\)\\|\\(" re3 "\\)\\|\\(" re4 "\\)\\|\\("
- re5 "\\)"
- ))
- (cond
- ((eq type 'org-occur) (org-occur reall))
- ((eq type 'occur) (org-do-occur (downcase reall) 'cleanup))
- (t (goto-char (point-min))
- (setq type 'fuzzy)
- (if (or (and (org-search-not-self 1 re0 nil t) (setq type 'dedicated))
- (org-search-not-self 1 re1 nil t)
- (org-search-not-self 1 re2 nil t)
- (org-search-not-self 1 re2a nil t)
- (org-search-not-self 1 re3 nil t)
- (org-search-not-self 1 re4 nil t)
- (org-search-not-self 1 re5 nil t)
- )
- (goto-char (match-beginning 1))
- (goto-char pos)
- (error "No match"))))))
- (and (org-mode-p) (org-show-context 'link-search))
- type))
-
-(defun org-search-not-self (group &rest args)
- "Execute `re-search-forward', but only accept matches that do not
-enclose the position of `org-open-link-marker'."
- (let ((m org-open-link-marker))
- (catch 'exit
- (while (apply 're-search-forward args)
- (unless (get-text-property (match-end group) 'intangible) ; Emacs 21
- (goto-char (match-end group))
- (if (and (or (not (eq (marker-buffer m) (current-buffer)))
- (> (match-beginning 0) (marker-position m))
- (< (match-end 0) (marker-position m)))
- (save-match-data
- (or (not (org-in-regexp
- org-bracket-link-analytic-regexp 1))
- (not (match-end 4)) ; no description
- (and (<= (match-beginning 4) (point))
- (>= (match-end 4) (point))))))
- (throw 'exit (point))))))))
-
-(defun org-get-buffer-for-internal-link (buffer)
- "Return a buffer to be used for displaying the link target of internal links."
- (cond
- ((not org-display-internal-link-with-indirect-buffer)
- buffer)
- ((string-match "(Clone)$" (buffer-name buffer))
- (message "Buffer is already a clone, not making another one")
- ;; we also do not modify visibility in this case
- buffer)
- (t ; make a new indirect buffer for displaying the link
- (let* ((bn (buffer-name buffer))
- (ibn (concat bn "(Clone)"))
- (ib (or (get-buffer ibn) (make-indirect-buffer buffer ibn 'clone))))
- (with-current-buffer ib (org-overview))
- ib))))
-
-(defun org-do-occur (regexp &optional cleanup)
- "Call the Emacs command `occur'.
-If CLEANUP is non-nil, remove the printout of the regular expression
-in the *Occur* buffer. This is useful if the regex is long and not useful
-to read."
- (occur regexp)
- (when cleanup
- (let ((cwin (selected-window)) win beg end)
- (when (setq win (get-buffer-window "*Occur*"))
- (select-window win))
- (goto-char (point-min))
- (when (re-search-forward "match[a-z]+" nil t)
- (setq beg (match-end 0))
- (if (re-search-forward "^[ \t]*[0-9]+" nil t)
- (setq end (1- (match-beginning 0)))))
- (and beg end (let ((inhibit-read-only t)) (delete-region beg end)))
- (goto-char (point-min))
- (select-window cwin))))
-
-;;; The mark ring for links jumps
-
-(defvar org-mark-ring nil
- "Mark ring for positions before jumps in Org-mode.")
-(defvar org-mark-ring-last-goto nil
- "Last position in the mark ring used to go back.")
-;; Fill and close the ring
-(setq org-mark-ring nil org-mark-ring-last-goto nil) ;; in case file is reloaded
-(loop for i from 1 to org-mark-ring-length do
- (push (make-marker) org-mark-ring))
-(setcdr (nthcdr (1- org-mark-ring-length) org-mark-ring)
- org-mark-ring)
-
-(defun org-mark-ring-push (&optional pos buffer)
- "Put the current position or POS into the mark ring and rotate it."
- (interactive)
- (setq pos (or pos (point)))
- (setq org-mark-ring (nthcdr (1- org-mark-ring-length) org-mark-ring))
- (move-marker (car org-mark-ring)
- (or pos (point))
- (or buffer (current-buffer)))
- (message "%s"
- (substitute-command-keys
- "Position saved to mark ring, go back with \\[org-mark-ring-goto].")))
-
-(defun org-mark-ring-goto (&optional n)
- "Jump to the previous position in the mark ring.
-With prefix arg N, jump back that many stored positions. When
-called several times in succession, walk through the entire ring.
-Org-mode commands jumping to a different position in the current file,
-or to another Org-mode file, automatically push the old position
-onto the ring."
- (interactive "p")
- (let (p m)
- (if (eq last-command this-command)
- (setq p (nthcdr n (or org-mark-ring-last-goto org-mark-ring)))
- (setq p org-mark-ring))
- (setq org-mark-ring-last-goto p)
- (setq m (car p))
- (switch-to-buffer (marker-buffer m))
- (goto-char m)
- (if (or (org-invisible-p) (org-invisible-p2)) (org-show-context 'mark-goto))))
-
-(defun org-remove-angle-brackets (s)
- (if (equal (substring s 0 1) "<") (setq s (substring s 1)))
- (if (equal (substring s -1) ">") (setq s (substring s 0 -1)))
- s)
-(defun org-add-angle-brackets (s)
- (if (equal (substring s 0 1) "<") nil (setq s (concat "<" s)))
- (if (equal (substring s -1) ">") nil (setq s (concat s ">")))
- s)
-(defun org-remove-double-quotes (s)
- (if (equal (substring s 0 1) "\"") (setq s (substring s 1)))
- (if (equal (substring s -1) "\"") (setq s (substring s 0 -1)))
- s)
-
-;;; Following specific links
-
-(defun org-follow-timestamp-link ()
- (cond
- ((org-at-date-range-p t)
- (let ((org-agenda-start-on-weekday)
- (t1 (match-string 1))
- (t2 (match-string 2)))
- (setq t1 (time-to-days (org-time-string-to-time t1))
- t2 (time-to-days (org-time-string-to-time t2)))
- (org-agenda-list nil t1 (1+ (- t2 t1)))))
- ((org-at-timestamp-p t)
- (org-agenda-list nil (time-to-days (org-time-string-to-time
- (substring (match-string 1) 0 10)))
- 1))
- (t (error "This should not happen"))))
-
-
-;;; Following file links
-(defvar org-wait nil)
-(defun org-open-file (path &optional in-emacs line search)
- "Open the file at PATH.
-First, this expands any special file name abbreviations. Then the
-configuration variable `org-file-apps' is checked if it contains an
-entry for this file type, and if yes, the corresponding command is launched.
-
-If no application is found, Emacs simply visits the file.
-
-With optional prefix argument IN-EMACS, Emacs will visit the file.
-With a double \\[universal-argument] \\[universal-argument] \
-prefix arg, Org tries to avoid opening in Emacs
-and to use an external application to visit the file.
-
-Optional LINE specifies a line to go to, optional SEARCH a string
-to search for. If LINE or SEARCH is given, the file will be
-opened in Emacs, unless an entry from org-file-apps that makes
-use of groups in a regexp matches.
-If the file does not exist, an error is thrown."
- (let* ((file (if (equal path "")
- buffer-file-name
- (substitute-in-file-name (expand-file-name path))))
- (file-apps (append org-file-apps (org-default-apps)))
- (apps (org-remove-if
- 'org-file-apps-entry-match-against-dlink-p file-apps))
- (apps-dlink (org-remove-if-not
- 'org-file-apps-entry-match-against-dlink-p file-apps))
- (remp (and (assq 'remote apps) (org-file-remote-p file)))
- (dirp (if remp nil (file-directory-p file)))
- (file (if (and dirp org-open-directory-means-index-dot-org)
- (concat (file-name-as-directory file) "index.org")
- file))
- (a-m-a-p (assq 'auto-mode apps))
- (dfile (downcase file))
- ;; reconstruct the original file: link from the PATH, LINE and SEARCH args
- (link (cond ((and (eq line nil)
- (eq search nil))
- file)
- (line
- (concat file "::" (number-to-string line)))
- (search
- (concat file "::" search))))
- (dlink (downcase link))
- (old-buffer (current-buffer))
- (old-pos (point))
- (old-mode major-mode)
- ext cmd link-match-data)
- (if (string-match "^.*\\.\\([a-zA-Z0-9]+\\.gz\\)$" dfile)
- (setq ext (match-string 1 dfile))
- (if (string-match "^.*\\.\\([a-zA-Z0-9]+\\)$" dfile)
- (setq ext (match-string 1 dfile))))
- (cond
- ((member in-emacs '((16) system))
- (setq cmd (cdr (assoc 'system apps))))
- (in-emacs (setq cmd 'emacs))
- (t
- (setq cmd (or (and remp (cdr (assoc 'remote apps)))
- (and dirp (cdr (assoc 'directory apps)))
- ; first, try matching against apps-dlink
- ; if we get a match here, store the match data for later
- (let ((match (assoc-default dlink apps-dlink
- 'string-match)))
- (if match
- (progn (setq link-match-data (match-data))
- match)
- (progn (setq in-emacs (or in-emacs line search))
- nil))) ; if we have no match in apps-dlink,
- ; always open the file in emacs if line or search
- ; is given (for backwards compatibility)
- (assoc-default dfile (org-apps-regexp-alist apps a-m-a-p)
- 'string-match)
- (cdr (assoc ext apps))
- (cdr (assoc t apps))))))
- (when (eq cmd 'system)
- (setq cmd (cdr (assoc 'system apps))))
- (when (eq cmd 'default)
- (setq cmd (cdr (assoc t apps))))
- (when (eq cmd 'mailcap)
- (require 'mailcap)
- (mailcap-parse-mailcaps)
- (let* ((mime-type (mailcap-extension-to-mime (or ext "")))
- (command (mailcap-mime-info mime-type)))
- (if (stringp command)
- (setq cmd command)
- (setq cmd 'emacs))))
- (if (and (not (eq cmd 'emacs)) ; Emacs has no problems with non-ex files
- (not (file-exists-p file))
- (not org-open-non-existing-files))
- (error "No such file: %s" file))
- (cond
- ((and (stringp cmd) (not (string-match "^\\s-*$" cmd)))
- ;; Remove quotes around the file name - we'll use shell-quote-argument.
- (while (string-match "['\"]%s['\"]" cmd)
- (setq cmd (replace-match "%s" t t cmd)))
- (while (string-match "%s" cmd)
- (setq cmd (replace-match
- (save-match-data
- (shell-quote-argument
- (convert-standard-filename file)))
- t t cmd)))
-
- ;; Replace "%1", "%2" etc. in command with group matches from regex
- (save-match-data
- (let ((match-index 1)
- (number-of-groups (- (/ (length link-match-data) 2) 1)))
- (set-match-data link-match-data)
- (while (<= match-index number-of-groups)
- (let ((regex (concat "%" (number-to-string match-index)))
- (replace-with (match-string match-index dlink)))
- (while (string-match regex cmd)
- (setq cmd (replace-match replace-with t t cmd))))
- (setq match-index (+ match-index 1)))))
-
- (save-window-excursion
- (start-process-shell-command cmd nil cmd)
- (and (boundp 'org-wait) (numberp org-wait) (sit-for org-wait))
- ))
- ((or (stringp cmd)
- (eq cmd 'emacs))
- (funcall (cdr (assq 'file org-link-frame-setup)) file)
- (widen)
- (if line (org-goto-line line)
- (if search (org-link-search search))))
- ((consp cmd)
- (let ((file (convert-standard-filename file)))
- (save-match-data
- (set-match-data link-match-data)
- (eval cmd))))
- (t (funcall (cdr (assq 'file org-link-frame-setup)) file)))
- (and (org-mode-p) (eq old-mode 'org-mode)
- (or (not (equal old-buffer (current-buffer)))
- (not (equal old-pos (point))))
- (org-mark-ring-push old-pos old-buffer))))
-
-(defun org-file-apps-entry-match-against-dlink-p (entry)
- "This function returns non-nil if `entry' uses a regular
-expression which should be matched against the whole link by
-org-open-file.
-
-It assumes that is the case when the entry uses a regular
-expression which has at least one grouping construct and the
-action is either a lisp form or a command string containing
-'%1', i.e. using at least one subexpression match as a
-parameter."
- (let ((selector (car entry))
- (action (cdr entry)))
- (if (stringp selector)
- (and (> (regexp-opt-depth selector) 0)
- (or (and (stringp action)
- (string-match "%[0-9]" action))
- (consp action)))
- nil)))
-
-(defun org-default-apps ()
- "Return the default applications for this operating system."
- (cond
- ((eq system-type 'darwin)
- org-file-apps-defaults-macosx)
- ((eq system-type 'windows-nt)
- org-file-apps-defaults-windowsnt)
- (t org-file-apps-defaults-gnu)))
-
-(defun org-apps-regexp-alist (list &optional add-auto-mode)
- "Convert extensions to regular expressions in the cars of LIST.
-Also, weed out any non-string entries, because the return value is used
-only for regexp matching.
-When ADD-AUTO-MODE is set, make all matches in `auto-mode-alist'
-point to the symbol `emacs', indicating that the file should
-be opened in Emacs."
- (append
- (delq nil
- (mapcar (lambda (x)
- (if (not (stringp (car x)))
- nil
- (if (string-match "\\W" (car x))
- x
- (cons (concat "\\." (car x) "\\'") (cdr x)))))
- list))
- (if add-auto-mode
- (mapcar (lambda (x) (cons (car x) 'emacs)) auto-mode-alist))))
-
-(defvar ange-ftp-name-format) ; to silence the XEmacs compiler.
-(defun org-file-remote-p (file)
- "Test whether FILE specifies a location on a remote system.
-Return non-nil if the location is indeed remote.
-
-For example, the filename \"/user@host:/foo\" specifies a location
-on the system \"/user@host:\"."
- (cond ((fboundp 'file-remote-p)
- (file-remote-p file))
- ((fboundp 'tramp-handle-file-remote-p)
- (tramp-handle-file-remote-p file))
- ((and (boundp 'ange-ftp-name-format)
- (string-match (car ange-ftp-name-format) file))
- t)
- (t nil)))
-
-
-;;;; Refiling
-
-(defun org-get-org-file ()
- "Read a filename, with default directory `org-directory'."
- (let ((default (or org-default-notes-file remember-data-file)))
- (read-file-name (format "File name [%s]: " default)
- (file-name-as-directory org-directory)
- default)))
-
-(defun org-notes-order-reversed-p ()
- "Check if the current file should receive notes in reversed order."
- (cond
- ((not org-reverse-note-order) nil)
- ((eq t org-reverse-note-order) t)
- ((not (listp org-reverse-note-order)) nil)
- (t (catch 'exit
- (let ((all org-reverse-note-order)
- entry)
- (while (setq entry (pop all))
- (if (string-match (car entry) buffer-file-name)
- (throw 'exit (cdr entry))))
- nil)))))
-
-(defvar org-refile-target-table nil
- "The list of refile targets, created by `org-refile'.")
-
-(defvar org-agenda-new-buffers nil
- "Buffers created to visit agenda files.")
-
-(defvar org-refile-cache nil
- "Cache for refile targets.")
-
-
-(defvar org-refile-markers nil
- "All the markers used for caching refile locations.")
-
-(defun org-refile-marker (pos)
- "Get a new refile marker, but only if caching is in use."
- (if (not org-refile-use-cache)
- pos
- (let ((m (make-marker)))
- (move-marker m pos)
- (push m org-refile-markers)
- m)))
-
-(defun org-refile-cache-clear ()
- "Clear the refile cache and disable all the markers."
- (mapc (lambda (m) (move-marker m nil)) org-refile-markers)
- (setq org-refile-markers nil)
- (setq org-refile-cache nil)
- (message "Refile cache has been cleared"))
-
-(defun org-refile-cache-check-set (set)
- "Check if all the markers in the cache still have live buffers."
- (let (marker)
- (catch 'exit
- (while (and set (setq marker (nth 3 (pop set))))
- ;; if org-refile-use-outline-path is 'file, marker may be nil
- (when (and marker (null (marker-buffer marker)))
- (message "not found") (sit-for 3)
- (throw 'exit nil)))
- t)))
-
-(defun org-refile-cache-put (set &rest identifiers)
- "Push the refile targets SET into the cache, under IDENTIFIERS."
- (let* ((key (sha1 (prin1-to-string identifiers)))
- (entry (assoc key org-refile-cache)))
- (if entry
- (setcdr entry set)
- (push (cons key set) org-refile-cache))))
-
-(defun org-refile-cache-get (&rest identifiers)
- "Retrieve the cached value for refile targets given by IDENTIFIERS."
- (cond
- ((not org-refile-cache) nil)
- ((not org-refile-use-cache) (org-refile-cache-clear) nil)
- (t
- (let ((set (cdr (assoc (sha1 (prin1-to-string identifiers))
- org-refile-cache))))
- (and set (org-refile-cache-check-set set) set)))))
-
-(defun org-get-refile-targets (&optional default-buffer)
- "Produce a table with refile targets."
- (let ((case-fold-search nil)
- ;; otherwise org confuses "TODO" as a kw and "Todo" as a word
- (entries (or org-refile-targets '((nil . (:level . 1)))))
- targets tgs txt re files f desc descre fast-path-p level pos0)
- (message "Getting targets...")
- (with-current-buffer (or default-buffer (current-buffer))
- (while (setq entry (pop entries))
- (setq files (car entry) desc (cdr entry))
- (setq fast-path-p nil)
- (cond
- ((null files) (setq files (list (current-buffer))))
- ((eq files 'org-agenda-files)
- (setq files (org-agenda-files 'unrestricted)))
- ((and (symbolp files) (fboundp files))
- (setq files (funcall files)))
- ((and (symbolp files) (boundp files))
- (setq files (symbol-value files))))
- (if (stringp files) (setq files (list files)))
- (cond
- ((eq (car desc) :tag)
- (setq descre (concat "^\\*+[ \t]+.*?:" (regexp-quote (cdr desc)) ":")))
- ((eq (car desc) :todo)
- (setq descre (concat "^\\*+[ \t]+" (regexp-quote (cdr desc)) "[ \t]")))
- ((eq (car desc) :regexp)
- (setq descre (cdr desc)))
- ((eq (car desc) :level)
- (setq descre (concat "^\\*\\{" (number-to-string
- (if org-odd-levels-only
- (1- (* 2 (cdr desc)))
- (cdr desc)))
- "\\}[ \t]")))
- ((eq (car desc) :maxlevel)
- (setq fast-path-p t)
- (setq descre (concat "^\\*\\{1," (number-to-string
- (if org-odd-levels-only
- (1- (* 2 (cdr desc)))
- (cdr desc)))
- "\\}[ \t]")))
- (t (error "Bad refiling target description %s" desc)))
- (while (setq f (pop files))
- (with-current-buffer
- (if (bufferp f) f (org-get-agenda-file-buffer f))
- (or
- (setq tgs (org-refile-cache-get (buffer-file-name) descre))
- (progn
- (if (bufferp f) (setq f (buffer-file-name
- (buffer-base-buffer f))))
- (setq f (and f (expand-file-name f)))
- (if (eq org-refile-use-outline-path 'file)
- (push (list (file-name-nondirectory f) f nil nil) tgs))
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (while (re-search-forward descre nil t)
- (goto-char (setq pos0 (point-at-bol)))
- (catch 'next
- (when org-refile-target-verify-function
- (save-match-data
- (or (funcall org-refile-target-verify-function)
- (throw 'next t))))
- (when (looking-at org-complex-heading-regexp)
- (setq level (org-reduced-level
- (- (match-end 1) (match-beginning 1)))
- txt (org-link-display-format (match-string 4))
- txt (replace-regexp-in-string "\\( *\[[0-9]+/?[0-9]*%?\]\\)+$" "" txt)
- re (format org-complex-heading-regexp-format
- (regexp-quote (match-string 4))))
- (when org-refile-use-outline-path
- (setq txt (mapconcat
- 'org-protect-slash
- (append
- (if (eq org-refile-use-outline-path
- 'file)
- (list (file-name-nondirectory
- (buffer-file-name
- (buffer-base-buffer))))
- (if (eq org-refile-use-outline-path
- 'full-file-path)
- (list (buffer-file-name
- (buffer-base-buffer)))))
- (org-get-outline-path fast-path-p
- level txt)
- (list txt))
- "/")))
- (push (list txt f re (org-refile-marker (point)))
- tgs)))
- (when (= (point) pos0)
- ;; verification function has not moved point
- (goto-char (point-at-eol))))))))
- (when org-refile-use-cache
- (org-refile-cache-put tgs (buffer-file-name) descre))
- (setq targets (append tgs targets))
- ))))
- (message "Getting targets...done")
- (nreverse targets)))
-
-(defun org-protect-slash (s)
- (while (string-match "/" s)
- (setq s (replace-match "\\" t t s)))
- s)
-
-(defvar org-olpa (make-vector 20 nil))
-
-(defun org-get-outline-path (&optional fastp level heading)
- "Return the outline path to the current entry, as a list.
-
-The parameters FASTP, LEVEL, and HEADING are for use by a scanner
-routine which makes outline path derivations for an entire file,
-avoiding backtracing. Refile target collection makes use of that."
- (if fastp
- (progn
- (if (> level 19)
- (error "Outline path failure, more than 19 levels"))
- (loop for i from level upto 19 do
- (aset org-olpa i nil))
- (prog1
- (delq nil (append org-olpa nil))
- (aset org-olpa level heading)))
- (let (rtn case-fold-search)
- (save-excursion
- (save-restriction
- (widen)
- (while (org-up-heading-safe)
- (when (looking-at org-complex-heading-regexp)
- (push (org-match-string-no-properties 4) rtn)))
- rtn)))))
-
-(defun org-format-outline-path (path &optional width prefix)
- "Format the outline path PATH for display.
-Width is the maximum number of characters that is available.
-Prefix is a prefix to be included in the returned string,
-such as the file name."
- (setq width (or width 79))
- (if prefix (setq width (- width (length prefix))))
- (if (not path)
- (or prefix "")
- (let* ((nsteps (length path))
- (total-width (+ nsteps (apply '+ (mapcar 'length path))))
- (maxwidth (if (<= total-width width)
- 10000 ;; everything fits
- ;; we need to shorten the level headings
- (/ (- width nsteps) nsteps)))
- (org-odd-levels-only nil)
- (n 0)
- (total (1+ (length prefix))))
- (setq maxwidth (max maxwidth 10))
- (concat prefix
- (mapconcat
- (lambda (h)
- (setq n (1+ n))
- (if (and (= n nsteps) (< maxwidth 10000))
- (setq maxwidth (- total-width total)))
- (if (< (length h) maxwidth)
- (progn (setq total (+ total (length h) 1)) h)
- (setq h (substring h 0 (- maxwidth 2))
- total (+ total maxwidth 1))
- (if (string-match "[ \t]+\\'" h)
- (setq h (substring h 0 (match-beginning 0))))
- (setq h (concat h "..")))
- (org-add-props h nil 'face
- (nth (% (1- n) org-n-level-faces)
- org-level-faces))
- h)
- path "/")))))
-
-(defun org-display-outline-path (&optional file current)
- "Display the current outline path in the echo area."
- (interactive "P")
- (let* ((bfn (buffer-file-name (buffer-base-buffer)))
- (case-fold-search nil)
- (path (and (org-mode-p) (org-get-outline-path))))
- (if current (setq path (append path
- (save-excursion
- (org-back-to-heading t)
- (if (looking-at org-complex-heading-regexp)
- (list (match-string 4)))))))
- (message "%s"
- (org-format-outline-path
- path
- (1- (frame-width))
- (and file bfn (concat (file-name-nondirectory bfn) "/"))))))
-
-(defvar org-refile-history nil
- "History for refiling operations.")
-
-(defvar org-after-refile-insert-hook nil
- "Hook run after `org-refile' has inserted its stuff at the new location.
-Note that this is still *before* the stuff will be removed from
-the *old* location.")
-
-(defvar org-capture-last-stored-marker)
-(defun org-refile (&optional goto default-buffer rfloc)
- "Move the entry at point to another heading.
-The list of target headings is compiled using the information in
-`org-refile-targets', which see. This list is created before each use
-and will therefore always be up-to-date.
-
-At the target location, the entry is filed as a subitem of the target heading.
-Depending on `org-reverse-note-order', the new subitem will either be the
-first or the last subitem.
-
-If there is an active region, all entries in that region will be moved.
-However, the region must fulfill the requirement that the first heading
-is the first one sets the top-level of the moved text - at most siblings
-below it are allowed.
-
-With prefix arg GOTO, the command will only visit the target location,
-not actually move anything.
-With a double prefix arg \\[universal-argument] \\[universal-argument], \
-go to the location where the last refiling
-operation has put the subtree.
-With a prefix argument of `2', refile to the running clock.
-
-RFLOC can be a refile location obtained in a different way.
-
-See also `org-refile-use-outline-path' and `org-completion-use-ido'.
-
-If you are using target caching (see `org-refile-use-cache'),
-You have to clear the target cache in order to find new targets.
-This can be done with a 0 prefix: `C-0 C-c C-w'"
- (interactive "P")
- (if (member goto '(0 (64)))
- (org-refile-cache-clear)
- (let* ((cbuf (current-buffer))
- (regionp (org-region-active-p))
- (region-start (and regionp (region-beginning)))
- (region-end (and regionp (region-end)))
- (region-length (and regionp (- region-end region-start)))
- (filename (buffer-file-name (buffer-base-buffer cbuf)))
- pos it nbuf file re level reversed)
- (setq last-command nil)
- (when regionp
- (goto-char region-start)
- (or (bolp) (goto-char (point-at-bol)))
- (setq region-start (point))
- (unless (org-kill-is-subtree-p
- (buffer-substring region-start region-end))
- (error "The region is not a (sequence of) subtree(s)")))
- (if (equal goto '(16))
- (org-refile-goto-last-stored)
- (when (or
- (and (equal goto 2)
- org-clock-hd-marker (marker-buffer org-clock-hd-marker)
- (prog1
- (setq it (list (or org-clock-heading "running clock")
- (buffer-file-name
- (marker-buffer org-clock-hd-marker))
- ""
- (marker-position org-clock-hd-marker)))
- (setq goto nil)))
- (setq it (or rfloc
- (save-excursion
- (org-refile-get-location
- (if goto "Goto: " "Refile to: ") default-buffer
- org-refile-allow-creating-parent-nodes)))))
- (setq file (nth 1 it)
- re (nth 2 it)
- pos (nth 3 it))
- (if (and (not goto)
- pos
- (equal (buffer-file-name) file)
- (if regionp
- (and (>= pos region-start)
- (<= pos region-end))
- (and (>= pos (point))
- (< pos (save-excursion
- (org-end-of-subtree t t))))))
- (error "Cannot refile to position inside the tree or region"))
-
- (setq nbuf (or (find-buffer-visiting file)
- (find-file-noselect file)))
- (if goto
- (progn
- (switch-to-buffer nbuf)
- (goto-char pos)
- (org-show-context 'org-goto))
- (if regionp
- (progn
- (org-kill-new (buffer-substring region-start region-end))
- (org-save-markers-in-region region-start region-end))
- (org-copy-subtree 1 nil t))
- (with-current-buffer (setq nbuf (or (find-buffer-visiting file)
- (find-file-noselect file)))
- (setq reversed (org-notes-order-reversed-p))
- (save-excursion
- (save-restriction
- (widen)
- (if pos
- (progn
- (goto-char pos)
- (looking-at outline-regexp)
- (setq level (org-get-valid-level (funcall outline-level) 1))
- (goto-char
- (if reversed
- (or (outline-next-heading) (point-max))
- (or (save-excursion (org-get-next-sibling))
- (org-end-of-subtree t t)
- (point-max)))))
- (setq level 1)
- (if (not reversed)
- (goto-char (point-max))
- (goto-char (point-min))
- (or (outline-next-heading) (goto-char (point-max)))))
- (if (not (bolp)) (newline))
- (org-paste-subtree level)
- (when org-log-refile
- (org-add-log-setup 'refile nil nil 'findpos
- org-log-refile)
- (unless (eq org-log-refile 'note)
- (save-excursion (org-add-log-note))))
- (and org-auto-align-tags (org-set-tags nil t))
- (bookmark-set "org-refile-last-stored")
- ;; If we are refiling for capture, make sure that the
- ;; last-capture pointers point here
- (when (org-bound-and-true-p org-refile-for-capture)
- (bookmark-set "org-capture-last-stored-marker")
- (move-marker org-capture-last-stored-marker (point)))
- (if (fboundp 'deactivate-mark) (deactivate-mark))
- (run-hooks 'org-after-refile-insert-hook))))
- (if regionp
- (delete-region (point) (+ (point) region-length))
- (org-cut-subtree))
- (when (featurep 'org-inlinetask)
- (org-inlinetask-remove-END-maybe))
- (setq org-markers-to-move nil)
- (message "Refiled to \"%s\" in file %s" (car it) file)))))))
-
-(defun org-refile-goto-last-stored ()
- "Go to the location where the last refile was stored."
- (interactive)
- (bookmark-jump "org-refile-last-stored")
- (message "This is the location of the last refile"))
-
-(defun org-refile-get-location (&optional prompt default-buffer new-nodes)
- "Prompt the user for a refile location, using PROMPT."
- (let ((org-refile-targets org-refile-targets)
- (org-refile-use-outline-path org-refile-use-outline-path))
- (setq org-refile-target-table (org-get-refile-targets default-buffer)))
- (unless org-refile-target-table
- (error "No refile targets"))
- (let* ((cbuf (current-buffer))
- (partial-completion-mode nil)
- (cfn (buffer-file-name (buffer-base-buffer cbuf)))
- (cfunc (if (and org-refile-use-outline-path
- org-outline-path-complete-in-steps)
- 'org-olpath-completing-read
- 'org-icompleting-read))
- (extra (if org-refile-use-outline-path "/" ""))
- (filename (and cfn (expand-file-name cfn)))
- (tbl (mapcar
- (lambda (x)
- (if (and (not (member org-refile-use-outline-path
- '(file full-file-path)))
- (not (equal filename (nth 1 x))))
- (cons (concat (car x) extra " ("
- (file-name-nondirectory (nth 1 x)) ")")
- (cdr x))
- (cons (concat (car x) extra) (cdr x))))
- org-refile-target-table))
- (completion-ignore-case t)
- pa answ parent-target child parent old-hist)
- (setq old-hist org-refile-history)
- (setq answ (funcall cfunc prompt tbl nil (not new-nodes)
- nil 'org-refile-history))
- (setq pa (or (assoc answ tbl) (assoc (concat answ "/") tbl)))
- (org-refile-check-position pa)
- (if pa
- (progn
- (when (or (not org-refile-history)
- (not (eq old-hist org-refile-history))
- (not (equal (car pa) (car org-refile-history))))
- (setq org-refile-history
- (cons (car pa) (if (assoc (car org-refile-history) tbl)
- org-refile-history
- (cdr org-refile-history))))
- (if (equal (car org-refile-history) (nth 1 org-refile-history))
- (pop org-refile-history)))
- pa)
- (if (string-match "\\`\\(.*\\)/\\([^/]+\\)\\'" answ)
- (progn
- (setq parent (match-string 1 answ)
- child (match-string 2 answ))
- (setq parent-target (or (assoc parent tbl)
- (assoc (concat parent "/") tbl)))
- (when (and parent-target
- (or (eq new-nodes t)
- (and (eq new-nodes 'confirm)
- (y-or-n-p (format "Create new node \"%s\"? "
- child)))))
- (org-refile-new-child parent-target child)))
- (error "Invalid target location")))))
-
-(defun org-refile-check-position (refile-pointer)
- "Check if the refile pointer matches the readline to which it points."
- (let* ((file (nth 1 refile-pointer))
- (re (nth 2 refile-pointer))
- (pos (nth 3 refile-pointer))
- buffer)
- (when (org-string-nw-p re)
- (setq buffer (if (markerp pos)
- (marker-buffer pos)
- (or (find-buffer-visiting file)
- (find-file-noselect file))))
- (with-current-buffer buffer
- (save-excursion
- (save-restriction
- (widen)
- (goto-char pos)
- (beginning-of-line 1)
- (unless (org-looking-at-p re)
- (error "Invalid refile position, please rebuild the cache"))))))))
-
-(defun org-refile-new-child (parent-target child)
- "Use refile target PARENT-TARGET to add new CHILD below it."
- (unless parent-target
- (error "Cannot find parent for new node"))
- (let ((file (nth 1 parent-target))
- (pos (nth 3 parent-target))
- level)
- (with-current-buffer (or (find-buffer-visiting file)
- (find-file-noselect file))
- (save-excursion
- (save-restriction
- (widen)
- (if pos
- (goto-char pos)
- (goto-char (point-max))
- (if (not (bolp)) (newline)))
- (when (looking-at outline-regexp)
- (setq level (funcall outline-level))
- (org-end-of-subtree t t))
- (org-back-over-empty-lines)
- (insert "\n" (make-string
- (if pos (org-get-valid-level level 1) 1) ?*)
- " " child "\n")
- (beginning-of-line 0)
- (list (concat (car parent-target) "/" child) file "" (point)))))))
-
-(defun org-olpath-completing-read (prompt collection &rest args)
- "Read an outline path like a file name."
- (let ((thetable collection)
- (org-completion-use-ido nil) ; does not work with ido.
- (org-completion-use-iswitchb nil)) ; or iswitchb
- (apply
- 'org-icompleting-read prompt
- (lambda (string predicate &optional flag)
- (let (rtn r f (l (length string)))
- (cond
- ((eq flag nil)
- ;; try completion
- (try-completion string thetable))
- ((eq flag t)
- ;; all-completions
- (setq rtn (all-completions string thetable predicate))
- (mapcar
- (lambda (x)
- (setq r (substring x l))
- (if (string-match " ([^)]*)$" x)
- (setq f (match-string 0 x))
- (setq f ""))
- (if (string-match "/" r)
- (concat string (substring r 0 (match-end 0)) f)
- x))
- rtn))
- ((eq flag 'lambda)
- ;; exact match?
- (assoc string thetable)))
- ))
- args)))
-
-;;;; Dynamic blocks
-
-(defun org-find-dblock (name)
- "Find the first dynamic block with name NAME in the buffer.
-If not found, stay at current position and return nil."
- (let (pos)
- (save-excursion
- (goto-char (point-min))
- (setq pos (and (re-search-forward (concat "^#\\+BEGIN:[ \t]+" name "\\>")
- nil t)
- (match-beginning 0))))
- (if pos (goto-char pos))
- pos))
-
-(defconst org-dblock-start-re
- "^[ \t]*#\\+BEGIN:[ \t]+\\(\\S-+\\)\\([ \t]+\\(.*\\)\\)?"
- "Matches the start line of a dynamic block, with parameters.")
-
-(defconst org-dblock-end-re "^[ \t]*#\\+END\\([: \t\r\n]\\|$\\)"
- "Matches the end of a dynamic block.")
-
-(defun org-create-dblock (plist)
- "Create a dynamic block section, with parameters taken from PLIST.
-PLIST must contain a :name entry which is used as name of the block."
- (when (string-match "\\S-" (buffer-substring (point-at-bol) (point-at-eol)))
- (end-of-line 1)
- (newline))
- (let ((col (current-column))
- (name (plist-get plist :name)))
- (insert "#+BEGIN: " name)
- (while plist
- (if (eq (car plist) :name)
- (setq plist (cddr plist))
- (insert " " (prin1-to-string (pop plist)))))
- (insert "\n\n" (make-string col ?\ ) "#+END:\n")
- (beginning-of-line -2)))
-
-(defun org-prepare-dblock ()
- "Prepare dynamic block for refresh.
-This empties the block, puts the cursor at the insert position and returns
-the property list including an extra property :name with the block name."
- (unless (looking-at org-dblock-start-re)
- (error "Not at a dynamic block"))
- (let* ((begdel (1+ (match-end 0)))
- (name (org-no-properties (match-string 1)))
- (params (append (list :name name)
- (read (concat "(" (match-string 3) ")")))))
- (save-excursion
- (beginning-of-line 1)
- (skip-chars-forward " \t")
- (setq params (plist-put params :indentation-column (current-column))))
- (unless (re-search-forward org-dblock-end-re nil t)
- (error "Dynamic block not terminated"))
- (setq params
- (append params
- (list :content (buffer-substring
- begdel (match-beginning 0)))))
- (delete-region begdel (match-beginning 0))
- (goto-char begdel)
- (open-line 1)
- params))
-
-(defun org-map-dblocks (&optional command)
- "Apply COMMAND to all dynamic blocks in the current buffer.
-If COMMAND is not given, use `org-update-dblock'."
- (let ((cmd (or command 'org-update-dblock)))
- (save-excursion
- (goto-char (point-min))
- (while (re-search-forward org-dblock-start-re nil t)
- (goto-char (match-beginning 0))
- (save-excursion
- (condition-case nil
- (funcall cmd)
- (error (message "Error during update of dynamic block"))))
- (unless (re-search-forward org-dblock-end-re nil t)
- (error "Dynamic block not terminated"))))))
-
-(defun org-dblock-update (&optional arg)
- "User command for updating dynamic blocks.
-Update the dynamic block at point. With prefix ARG, update all dynamic
-blocks in the buffer."
- (interactive "P")
- (if arg
- (org-update-all-dblocks)
- (or (looking-at org-dblock-start-re)
- (org-beginning-of-dblock))
- (org-update-dblock)))
-
-(defun org-update-dblock ()
- "Update the dynamic block at point.
-This means to empty the block, parse for parameters and then call
-the correct writing function."
- (interactive)
- (save-window-excursion
- (let* ((pos (point))
- (line (org-current-line))
- (params (org-prepare-dblock))
- (name (plist-get params :name))
- (indent (plist-get params :indentation-column))
- (cmd (intern (concat "org-dblock-write:" name))))
- (message "Updating dynamic block `%s' at line %d..." name line)
- (funcall cmd params)
- (message "Updating dynamic block `%s' at line %d...done" name line)
- (goto-char pos)
- (when (and indent (> indent 0))
- (setq indent (make-string indent ?\ ))
- (save-excursion
- (org-beginning-of-dblock)
- (forward-line 1)
- (while (not (looking-at org-dblock-end-re))
- (insert indent)
- (beginning-of-line 2))
- (when (looking-at org-dblock-end-re)
- (and (looking-at "[ \t]+")
- (replace-match ""))
- (insert indent)))))))
-
-(defun org-beginning-of-dblock ()
- "Find the beginning of the dynamic block at point.
-Error if there is no such block at point."
- (let ((pos (point))
- beg)
- (end-of-line 1)
- (if (and (re-search-backward org-dblock-start-re nil t)
- (setq beg (match-beginning 0))
- (re-search-forward org-dblock-end-re nil t)
- (> (match-end 0) pos))
- (goto-char beg)
- (goto-char pos)
- (error "Not in a dynamic block"))))
-
-(defun org-update-all-dblocks ()
- "Update all dynamic blocks in the buffer.
-This function can be used in a hook."
- (interactive)
- (when (org-mode-p)
- (org-map-dblocks 'org-update-dblock)))
-
-
-;;;; Completion
-
-(defconst org-additional-option-like-keywords
- '("BEGIN_HTML" "END_HTML" "HTML:" "ATTR_HTML:"
- "BEGIN_DocBook" "END_DocBook" "DocBook:" "ATTR_DocBook:"
- "BEGIN_LaTeX" "END_LaTeX" "LaTeX:" "LATEX_HEADER:"
- "LATEX_CLASS:" "LATEX_CLASS_OPTIONS:" "ATTR_LaTeX:"
- "BEGIN:" "END:"
- "ORGTBL" "TBLFM:" "TBLNAME:"
- "BEGIN_EXAMPLE" "END_EXAMPLE"
- "BEGIN_QUOTE" "END_QUOTE"
- "BEGIN_VERSE" "END_VERSE"
- "BEGIN_CENTER" "END_CENTER"
- "BEGIN_SRC" "END_SRC"
- "BEGIN_RESULT" "END_RESULT"
- "SOURCE:" "SRCNAME:" "FUNCTION:"
- "RESULTS:"
- "HEADER:" "HEADERS:"
- "BABEL:"
- "CATEGORY:" "COLUMNS:" "PROPERTY:"
- "CAPTION:" "LABEL:"
- "SETUPFILE:"
- "INCLUDE:"
- "BIND:"
- "MACRO:"))
-
-(defcustom org-structure-template-alist
- '(
- ("s" "#+begin_src ?\n\n#+end_src"
- "<src lang=\"?\">\n\n</src>")
- ("e" "#+begin_example\n?\n#+end_example"
- "<example>\n?\n</example>")
- ("q" "#+begin_quote\n?\n#+end_quote"
- "<quote>\n?\n</quote>")
- ("v" "#+begin_verse\n?\n#+end_verse"
- "<verse>\n?\n/verse>")
- ("c" "#+begin_center\n?\n#+end_center"
- "<center>\n?\n/center>")
- ("l" "#+begin_latex\n?\n#+end_latex"
- "<literal style=\"latex\">\n?\n</literal>")
- ("L" "#+latex: "
- "<literal style=\"latex\">?</literal>")
- ("h" "#+begin_html\n?\n#+end_html"
- "<literal style=\"html\">\n?\n</literal>")
- ("H" "#+html: "
- "<literal style=\"html\">?</literal>")
- ("a" "#+begin_ascii\n?\n#+end_ascii")
- ("A" "#+ascii: ")
- ("i" "#+include %file ?"
- "<include file=%file markup=\"?\">")
- )
- "Structure completion elements.
-This is a list of abbreviation keys and values. The value gets inserted
-if you type `<' followed by the key and then press the completion key,
-usually `M-TAB'. %file will be replaced by a file name after prompting
-for the file using completion.
-There are two templates for each key, the first uses the original Org syntax,
-the second uses Emacs Muse-like syntax tags. These Muse-like tags become
-the default when the /org-mtags.el/ module has been loaded. See also the
-variable `org-mtags-prefer-muse-templates'.
-This is an experimental feature, it is undecided if it is going to stay in."
- :group 'org-completion
- :type '(repeat
- (string :tag "Key")
- (string :tag "Template")
- (string :tag "Muse Template")))
-
-(defun org-try-structure-completion ()
- "Try to complete a structure template before point.
-This looks for strings like \"<e\" on an otherwise empty line and
-expands them."
- (let ((l (buffer-substring (point-at-bol) (point)))
- a)
- (when (and (looking-at "[ \t]*$")
- (string-match "^[ \t]*<\\([a-z]+\\)$"l)
- (setq a (assoc (match-string 1 l) org-structure-template-alist)))
- (org-complete-expand-structure-template (+ -1 (point-at-bol)
- (match-beginning 1)) a)
- t)))
-
-(defun org-complete-expand-structure-template (start cell)
- "Expand a structure template."
- (let* ((musep (org-bound-and-true-p org-mtags-prefer-muse-templates))
- (rpl (nth (if musep 2 1) cell))
- (ind ""))
- (delete-region start (point))
- (when (string-match "\\`#\\+" rpl)
- (cond
- ((bolp))
- ((not (string-match "\\S-" (buffer-substring (point-at-bol) (point))))
- (setq ind (buffer-substring (point-at-bol) (point))))
- (t (newline))))
- (setq start (point))
- (if (string-match "%file" rpl)
- (setq rpl (replace-match
- (concat
- "\""
- (save-match-data
- (abbreviate-file-name (read-file-name "Include file: ")))
- "\"")
- t t rpl)))
- (setq rpl (mapconcat 'identity (split-string rpl "\n")
- (concat "\n" ind)))
- (insert rpl)
- (if (re-search-backward "\\?" start t) (delete-char 1))))
-
-;;;; TODO, DEADLINE, Comments
-
-(defun org-toggle-comment ()
- "Change the COMMENT state of an entry."
- (interactive)
- (save-excursion
- (org-back-to-heading)
- (let (case-fold-search)
- (if (looking-at (concat outline-regexp
- "\\( *\\<" org-comment-string "\\>[ \t]*\\)"))
- (replace-match "" t t nil 1)
- (if (looking-at outline-regexp)
- (progn
- (goto-char (match-end 0))
- (insert org-comment-string " ")))))))
-
-(defvar org-last-todo-state-is-todo nil
- "This is non-nil when the last TODO state change led to a TODO state.
-If the last change removed the TODO tag or switched to DONE, then
-this is nil.")
-
-(defvar org-setting-tags nil) ; dynamically skipped
-
-(defvar org-todo-setup-filter-hook nil
- "Hook for functions that pre-filter todo specs.
-Each function takes a todo spec and returns either nil or the spec
-transformed into canonical form." )
-
-(defvar org-todo-get-default-hook nil
- "Hook for functions that get a default item for todo.
-Each function takes arguments (NEW-MARK OLD-MARK) and returns either
-nil or a string to be used for the todo mark." )
-
-(defvar org-agenda-headline-snapshot-before-repeat)
-
-(defun org-todo (&optional arg)
- "Change the TODO state of an item.
-The state of an item is given by a keyword at the start of the heading,
-like
- *** TODO Write paper
- *** DONE Call mom
-
-The different keywords are specified in the variable `org-todo-keywords'.
-By default the available states are \"TODO\" and \"DONE\".
-So for this example: when the item starts with TODO, it is changed to DONE.
-When it starts with DONE, the DONE is removed. And when neither TODO nor
-DONE are present, add TODO at the beginning of the heading.
-
-With \\[universal-argument] prefix arg, use completion to determine the new \
-state.
-With numeric prefix arg, switch to that state.
-With a double \\[universal-argument] prefix, switch to the next set of TODO \
-keywords (nextset).
-With a triple \\[universal-argument] prefix, circumvent any state blocking.
-
-For calling through lisp, arg is also interpreted in the following way:
-'none -> empty state
-\"\"(empty string) -> switch to empty state
-'done -> switch to DONE
-'nextset -> switch to the next set of keywords
-'previousset -> switch to the previous set of keywords
-\"WAITING\" -> switch to the specified keyword, but only if it
- really is a member of `org-todo-keywords'."
- (interactive "P")
- (if (equal arg '(16)) (setq arg 'nextset))
- (let ((org-blocker-hook org-blocker-hook)
- (case-fold-search nil))
- (when (equal arg '(64))
- (setq arg nil org-blocker-hook nil))
- (when (and org-blocker-hook
- (or org-inhibit-blocking
- (org-entry-get nil "NOBLOCKING")))
- (setq org-blocker-hook nil))
- (save-excursion
- (catch 'exit
- (org-back-to-heading t)
- (if (looking-at outline-regexp) (goto-char (1- (match-end 0))))
- (or (looking-at (concat " +" org-todo-regexp "\\( +\\|$\\)"))
- (looking-at " *"))
- (let* ((match-data (match-data))
- (startpos (point-at-bol))
- (logging (save-match-data (org-entry-get nil "LOGGING" t t)))
- (org-log-done org-log-done)
- (org-log-repeat org-log-repeat)
- (org-todo-log-states org-todo-log-states)
- (this (match-string 1))
- (hl-pos (match-beginning 0))
- (head (org-get-todo-sequence-head this))
- (ass (assoc head org-todo-kwd-alist))
- (interpret (nth 1 ass))
- (done-word (nth 3 ass))
- (final-done-word (nth 4 ass))
- (last-state (or this ""))
- (completion-ignore-case t)
- (member (member this org-todo-keywords-1))
- (tail (cdr member))
- (state (cond
- ((and org-todo-key-trigger
- (or (and (equal arg '(4))
- (eq org-use-fast-todo-selection 'prefix))
- (and (not arg) org-use-fast-todo-selection
- (not (eq org-use-fast-todo-selection
- 'prefix)))))
- ;; Use fast selection
- (org-fast-todo-selection))
- ((and (equal arg '(4))
- (or (not org-use-fast-todo-selection)
- (not org-todo-key-trigger)))
- ;; Read a state with completion
- (org-icompleting-read
- "State: " (mapcar (lambda(x) (list x))
- org-todo-keywords-1)
- nil t))
- ((eq arg 'right)
- (if this
- (if tail (car tail) nil)
- (car org-todo-keywords-1)))
- ((eq arg 'left)
- (if (equal member org-todo-keywords-1)
- nil
- (if this
- (nth (- (length org-todo-keywords-1)
- (length tail) 2)
- org-todo-keywords-1)
- (org-last org-todo-keywords-1))))
- ((and (eq org-use-fast-todo-selection t) (equal arg '(4))
- (setq arg nil))) ; hack to fall back to cycling
- (arg
- ;; user or caller requests a specific state
- (cond
- ((equal arg "") nil)
- ((eq arg 'none) nil)
- ((eq arg 'done) (or done-word (car org-done-keywords)))
- ((eq arg 'nextset)
- (or (car (cdr (member head org-todo-heads)))
- (car org-todo-heads)))
- ((eq arg 'previousset)
- (let ((org-todo-heads (reverse org-todo-heads)))
- (or (car (cdr (member head org-todo-heads)))
- (car org-todo-heads))))
- ((car (member arg org-todo-keywords-1)))
- ((stringp arg)
- (error "State `%s' not valid in this file" arg))
- ((nth (1- (prefix-numeric-value arg))
- org-todo-keywords-1))))
- ((null member) (or head (car org-todo-keywords-1)))
- ((equal this final-done-word) nil) ;; -> make empty
- ((null tail) nil) ;; -> first entry
- ((memq interpret '(type priority))
- (if (eq this-command last-command)
- (car tail)
- (if (> (length tail) 0)
- (or done-word (car org-done-keywords))
- nil)))
- (t
- (car tail))))
- (state (or
- (run-hook-with-args-until-success
- 'org-todo-get-default-hook state last-state)
- state))
- (next (if state (concat " " state " ") " "))
- (change-plist (list :type 'todo-state-change :from this :to state
- :position startpos))
- dolog now-done-p)
- (when org-blocker-hook
- (setq org-last-todo-state-is-todo
- (not (member this org-done-keywords)))
- (unless (save-excursion
- (save-match-data
- (run-hook-with-args-until-failure
- 'org-blocker-hook change-plist)))
- (if (interactive-p)
- (error "TODO state change from %s to %s blocked" this state)
- ;; fail silently
- (message "TODO state change from %s to %s blocked" this state)
- (throw 'exit nil))))
- (store-match-data match-data)
- (replace-match next t t)
- (unless (pos-visible-in-window-p hl-pos)
- (message "TODO state changed to %s" (org-trim next)))
- (unless head
- (setq head (org-get-todo-sequence-head state)
- ass (assoc head org-todo-kwd-alist)
- interpret (nth 1 ass)
- done-word (nth 3 ass)
- final-done-word (nth 4 ass)))
- (when (memq arg '(nextset previousset))
- (message "Keyword-Set %d/%d: %s"
- (- (length org-todo-sets) -1
- (length (memq (assoc state org-todo-sets) org-todo-sets)))
- (length org-todo-sets)
- (mapconcat 'identity (assoc state org-todo-sets) " ")))
- (setq org-last-todo-state-is-todo
- (not (member state org-done-keywords)))
- (setq now-done-p (and (member state org-done-keywords)
- (not (member this org-done-keywords))))
- (and logging (org-local-logging logging))
- (when (and (or org-todo-log-states org-log-done)
- (not (eq org-inhibit-logging t))
- (not (memq arg '(nextset previousset))))
- ;; we need to look at recording a time and note
- (setq dolog (or (nth 1 (assoc state org-todo-log-states))
- (nth 2 (assoc this org-todo-log-states))))
- (if (and (eq dolog 'note) (eq org-inhibit-logging 'note))
- (setq dolog 'time))
- (when (and state
- (member state org-not-done-keywords)
- (not (member this org-not-done-keywords)))
- ;; This is now a todo state and was not one before
- ;; If there was a CLOSED time stamp, get rid of it.
- (org-add-planning-info nil nil 'closed))
- (when (and now-done-p org-log-done)
- ;; It is now done, and it was not done before
- (org-add-planning-info 'closed (org-current-time))
- (if (and (not dolog) (eq 'note org-log-done))
- (org-add-log-setup 'done state this 'findpos 'note)))
- (when (and state dolog)
- ;; This is a non-nil state, and we need to log it
- (org-add-log-setup 'state state this 'findpos dolog)))
- ;; Fixup tag positioning
- (org-todo-trigger-tag-changes state)
- (and org-auto-align-tags (not org-setting-tags) (org-set-tags nil t))
- (when org-provide-todo-statistics
- (org-update-parent-todo-statistics))
- (run-hooks 'org-after-todo-state-change-hook)
- (if (and arg (not (member state org-done-keywords)))
- (setq head (org-get-todo-sequence-head state)))
- (put-text-property (point-at-bol) (point-at-eol) 'org-todo-head head)
- ;; Do we need to trigger a repeat?
- (when now-done-p
- (when (boundp 'org-agenda-headline-snapshot-before-repeat)
- ;; This is for the agenda, take a snapshot of the headline.
- (save-match-data
- (setq org-agenda-headline-snapshot-before-repeat
- (org-get-heading))))
- (org-auto-repeat-maybe state))
- ;; Fixup cursor location if close to the keyword
- (if (and (outline-on-heading-p)
- (not (bolp))
- (save-excursion (beginning-of-line 1)
- (looking-at org-todo-line-regexp))
- (< (point) (+ 2 (or (match-end 2) (match-end 1)))))
- (progn
- (goto-char (or (match-end 2) (match-end 1)))
- (and (looking-at " ") (just-one-space))))
- (when org-trigger-hook
- (save-excursion
- (run-hook-with-args 'org-trigger-hook change-plist))))))))
-
-(defun org-block-todo-from-children-or-siblings-or-parent (change-plist)
- "Block turning an entry into a TODO, using the hierarchy.
-This checks whether the current task should be blocked from state
-changes. Such blocking occurs when:
-
- 1. The task has children which are not all in a completed state.
-
- 2. A task has a parent with the property :ORDERED:, and there
- are siblings prior to the current task with incomplete
- status.
-
- 3. The parent of the task is blocked because it has siblings that should
- be done first, or is child of a block grandparent TODO entry."
-
- (if (not org-enforce-todo-dependencies)
- t ; if locally turned off don't block
- (catch 'dont-block
- ;; If this is not a todo state change, or if this entry is already DONE,
- ;; do not block
- (when (or (not (eq (plist-get change-plist :type) 'todo-state-change))
- (member (plist-get change-plist :from)
- (cons 'done org-done-keywords))
- (member (plist-get change-plist :to)
- (cons 'todo org-not-done-keywords))
- (not (plist-get change-plist :to)))
- (throw 'dont-block t))
- ;; If this task has children, and any are undone, it's blocked
- (save-excursion
- (org-back-to-heading t)
- (let ((this-level (funcall outline-level)))
- (outline-next-heading)
- (let ((child-level (funcall outline-level)))
- (while (and (not (eobp))
- (> child-level this-level))
- ;; this todo has children, check whether they are all
- ;; completed
- (if (and (not (org-entry-is-done-p))
- (org-entry-is-todo-p))
- (throw 'dont-block nil))
- (outline-next-heading)
- (setq child-level (funcall outline-level))))))
- ;; Otherwise, if the task's parent has the :ORDERED: property, and
- ;; any previous siblings are undone, it's blocked
- (save-excursion
- (org-back-to-heading t)
- (let* ((pos (point))
- (parent-pos (and (org-up-heading-safe) (point))))
- (if (not parent-pos) (throw 'dont-block t)) ; no parent
- (when (and (org-not-nil (org-entry-get (point) "ORDERED"))
- (forward-line 1)
- (re-search-forward org-not-done-heading-regexp pos t))
- (throw 'dont-block nil)) ; block, there is an older sibling not done.
- ;; Search further up the hierarchy, to see if an anchestor is blocked
- (while t
- (goto-char parent-pos)
- (if (not (looking-at org-not-done-heading-regexp))
- (throw 'dont-block t)) ; do not block, parent is not a TODO
- (setq pos (point))
- (setq parent-pos (and (org-up-heading-safe) (point)))
- (if (not parent-pos) (throw 'dont-block t)) ; no parent
- (when (and (org-not-nil (org-entry-get (point) "ORDERED"))
- (forward-line 1)
- (re-search-forward org-not-done-heading-regexp pos t))
- (throw 'dont-block nil)))))))) ; block, older sibling not done.
-
-(defcustom org-track-ordered-property-with-tag nil
- "Should the ORDERED property also be shown as a tag?
-The ORDERED property decides if an entry should require subtasks to be
-completed in sequence. Since a property is not very visible, setting
-this option means that toggling the ORDERED property with the command
-`org-toggle-ordered-property' will also toggle a tag ORDERED. That tag is
-not relevant for the behavior, but it makes things more visible.
-
-Note that toggling the tag with tags commands will not change the property
-and therefore not influence behavior!
-
-This can be t, meaning the tag ORDERED should be used, It can also be a
-string to select a different tag for this task."
- :group 'org-todo
- :type '(choice
- (const :tag "No tracking" nil)
- (const :tag "Track with ORDERED tag" t)
- (string :tag "Use other tag")))
-
-(defun org-toggle-ordered-property ()
- "Toggle the ORDERED property of the current entry.
-For better visibility, you can track the value of this property with a tag.
-See variable `org-track-ordered-property-with-tag'."
- (interactive)
- (let* ((t1 org-track-ordered-property-with-tag)
- (tag (and t1 (if (stringp t1) t1 "ORDERED"))))
- (save-excursion
- (org-back-to-heading)
- (if (org-entry-get nil "ORDERED")
- (progn
- (org-delete-property "ORDERED")
- (and tag (org-toggle-tag tag 'off))
- (message "Subtasks can be completed in arbitrary order"))
- (org-entry-put nil "ORDERED" "t")
- (and tag (org-toggle-tag tag 'on))
- (message "Subtasks must be completed in sequence")))))
-
-(defvar org-blocked-by-checkboxes) ; dynamically scoped
-(defun org-block-todo-from-checkboxes (change-plist)
- "Block turning an entry into a TODO, using checkboxes.
-This checks whether the current task should be blocked from state
-changes because there are unchecked boxes in this entry."
- (if (not org-enforce-todo-checkbox-dependencies)
- t ; if locally turned off don't block
- (catch 'dont-block
- ;; If this is not a todo state change, or if this entry is already DONE,
- ;; do not block
- (when (or (not (eq (plist-get change-plist :type) 'todo-state-change))
- (member (plist-get change-plist :from)
- (cons 'done org-done-keywords))
- (member (plist-get change-plist :to)
- (cons 'todo org-not-done-keywords))
- (not (plist-get change-plist :to)))
- (throw 'dont-block t))
- ;; If this task has checkboxes that are not checked, it's blocked
- (save-excursion
- (org-back-to-heading t)
- (let ((beg (point)) end)
- (outline-next-heading)
- (setq end (point))
- (goto-char beg)
- (if (re-search-forward "^[ \t]*\\([-+*]\\|[0-9]+[.)]\\)[ \t]+\\[[- ]\\]"
- end t)
- (progn
- (if (boundp 'org-blocked-by-checkboxes)
- (setq org-blocked-by-checkboxes t))
- (throw 'dont-block nil)))))
- t))) ; do not block
-
-(defun org-entry-blocked-p ()
- "Is the current entry blocked?"
- (if (org-entry-get nil "NOBLOCKING")
- nil ;; Never block this entry
- (not
- (run-hook-with-args-until-failure
- 'org-blocker-hook
- (list :type 'todo-state-change
- :position (point)
- :from 'todo
- :to 'done)))))
-
-(defun org-update-statistics-cookies (all)
- "Update the statistics cookie, either from TODO or from checkboxes.
-This should be called with the cursor in a line with a statistics cookie."
- (interactive "P")
- (if all
- (progn
- (org-update-checkbox-count 'all)
- (org-map-entries 'org-update-parent-todo-statistics))
- (if (not (org-on-heading-p))
- (org-update-checkbox-count)
- (let ((pos (move-marker (make-marker) (point)))
- end l1 l2)
- (ignore-errors (org-back-to-heading t))
- (if (not (org-on-heading-p))
- (org-update-checkbox-count)
- (setq l1 (org-outline-level))
- (setq end (save-excursion
- (outline-next-heading)
- (if (org-on-heading-p) (setq l2 (org-outline-level)))
- (point)))
- (if (and (save-excursion
- (re-search-forward
- "^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) \\[[- X]\\]" end t))
- (not (save-excursion (re-search-forward
- ":COOKIE_DATA:.*\\<todo\\>" end t))))
- (org-update-checkbox-count)
- (if (and l2 (> l2 l1))
- (progn
- (goto-char end)
- (org-update-parent-todo-statistics))
- (goto-char pos)
- (beginning-of-line 1)
- (while (re-search-forward
- "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)"
- (point-at-eol) t)
- (replace-match (if (match-end 2) "[100%]" "[0/0]") t t)))))
- (goto-char pos)
- (move-marker pos nil)))))
-
-(defvar org-entry-property-inherited-from) ;; defined below
-(defun org-update-parent-todo-statistics ()
- "Update any statistics cookie in the parent of the current headline.
-When `org-hierarchical-todo-statistics' is nil, statistics will cover
-the entire subtree and this will travel up the hierarchy and update
-statistics everywhere."
- (interactive)
- (let* ((lim 0) prop
- (recursive (or (not org-hierarchical-todo-statistics)
- (string-match
- "\\<recursive\\>"
- (or (setq prop (org-entry-get
- nil "COOKIE_DATA" 'inherit)) ""))))
- (lim (or (and prop (marker-position
- org-entry-property-inherited-from))
- lim))
- (first t)
- (box-re "\\(\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)\\)")
- level ltoggle l1 new ndel
- (cnt-all 0) (cnt-done 0) is-percent kwd cookie-present)
- (catch 'exit
- (save-excursion
- (beginning-of-line 1)
- (if (org-at-heading-p)
- (setq ltoggle (funcall outline-level))
- (error "This should not happen"))
- (while (and (setq level (org-up-heading-safe))
- (or recursive first)
- (>= (point) lim))
- (setq first nil cookie-present nil)
- (unless (and level
- (not (string-match
- "\\<checkbox\\>"
- (downcase
- (or (org-entry-get
- nil "COOKIE_DATA")
- "")))))
- (throw 'exit nil))
- (while (re-search-forward box-re (point-at-eol) t)
- (setq cnt-all 0 cnt-done 0 cookie-present t)
- (setq is-percent (match-end 2))
- (save-match-data
- (unless (outline-next-heading) (throw 'exit nil))
- (while (and (looking-at org-complex-heading-regexp)
- (> (setq l1 (length (match-string 1))) level))
- (setq kwd (and (or recursive (= l1 ltoggle))
- (match-string 2)))
- (if (or (eq org-provide-todo-statistics 'all-headlines)
- (and (listp org-provide-todo-statistics)
- (or (member kwd org-provide-todo-statistics)
- (member kwd org-done-keywords))))
- (setq cnt-all (1+ cnt-all))
- (if (eq org-provide-todo-statistics t)
- (and kwd (setq cnt-all (1+ cnt-all)))))
- (and (member kwd org-done-keywords)
- (setq cnt-done (1+ cnt-done)))
- (outline-next-heading)))
- (setq new
- (if is-percent
- (format "[%d%%]" (/ (* 100 cnt-done) (max 1 cnt-all)))
- (format "[%d/%d]" cnt-done cnt-all))
- ndel (- (match-end 0) (match-beginning 0)))
- (goto-char (match-beginning 0))
- (insert new)
- (delete-region (point) (+ (point) ndel)))
- (when cookie-present
- (run-hook-with-args 'org-after-todo-statistics-hook
- cnt-done (- cnt-all cnt-done))))))
- (run-hooks 'org-todo-statistics-hook)))
-
-(defvar org-after-todo-statistics-hook nil
- "Hook that is called after a TODO statistics cookie has been updated.
-Each function is called with two arguments: the number of not-done entries
-and the number of done entries.
-
-For example, the following function, when added to this hook, will switch
-an entry to DONE when all children are done, and back to TODO when new
-entries are set to a TODO status. Note that this hook is only called
-when there is a statistics cookie in the headline!
-
- (defun org-summary-todo (n-done n-not-done)
- \"Switch entry to DONE when all subentries are done, to TODO otherwise.\"
- (let (org-log-done org-log-states) ; turn off logging
- (org-todo (if (= n-not-done 0) \"DONE\" \"TODO\"))))
-")
-
-(defvar org-todo-statistics-hook nil
- "Hook that is run whenever Org thinks TODO statistics should be updated.
-This hook runs even if there is no statistics cookie present, in which case
-`org-after-todo-statistics-hook' would not run.")
-
-(defun org-todo-trigger-tag-changes (state)
- "Apply the changes defined in `org-todo-state-tags-triggers'."
- (let ((l org-todo-state-tags-triggers)
- changes)
- (when (or (not state) (equal state ""))
- (setq changes (append changes (cdr (assoc "" l)))))
- (when (and (stringp state) (> (length state) 0))
- (setq changes (append changes (cdr (assoc state l)))))
- (when (member state org-not-done-keywords)
- (setq changes (append changes (cdr (assoc 'todo l)))))
- (when (member state org-done-keywords)
- (setq changes (append changes (cdr (assoc 'done l)))))
- (dolist (c changes)
- (org-toggle-tag (car c) (if (cdr c) 'on 'off)))))
-
-(defun org-local-logging (value)
- "Get logging settings from a property VALUE."
- (let* (words w a)
- ;; directly set the variables, they are already local.
- (setq org-log-done nil
- org-log-repeat nil
- org-todo-log-states nil)
- (setq words (org-split-string value))
- (while (setq w (pop words))
- (cond
- ((setq a (assoc w org-startup-options))
- (and (member (nth 1 a) '(org-log-done org-log-repeat))
- (set (nth 1 a) (nth 2 a))))
- ((setq a (org-extract-log-state-settings w))
- (and (member (car a) org-todo-keywords-1)
- (push a org-todo-log-states)))))))
-
-(defun org-get-todo-sequence-head (kwd)
- "Return the head of the TODO sequence to which KWD belongs.
-If KWD is not set, check if there is a text property remembering the
-right sequence."
- (let (p)
- (cond
- ((not kwd)
- (or (get-text-property (point-at-bol) 'org-todo-head)
- (progn
- (setq p (next-single-property-change (point-at-bol) 'org-todo-head
- nil (point-at-eol)))
- (get-text-property p 'org-todo-head))))
- ((not (member kwd org-todo-keywords-1))
- (car org-todo-keywords-1))
- (t (nth 2 (assoc kwd org-todo-kwd-alist))))))
-
-(defun org-fast-todo-selection ()
- "Fast TODO keyword selection with single keys.
-Returns the new TODO keyword, or nil if no state change should occur."
- (let* ((fulltable org-todo-key-alist)
- (done-keywords org-done-keywords) ;; needed for the faces.
- (maxlen (apply 'max (mapcar
- (lambda (x)
- (if (stringp (car x)) (string-width (car x)) 0))
- fulltable)))
- (expert nil)
- (fwidth (+ maxlen 3 1 3))
- (ncol (/ (- (window-width) 4) fwidth))
- tg cnt e c tbl
- groups ingroup)
- (save-excursion
- (save-window-excursion
- (if expert
- (set-buffer (get-buffer-create " *Org todo*"))
- (org-switch-to-buffer-other-window (get-buffer-create " *Org todo*")))
- (erase-buffer)
- (org-set-local 'org-done-keywords done-keywords)
- (setq tbl fulltable cnt 0)
- (while (setq e (pop tbl))
- (cond
- ((equal e '(:startgroup))
- (push '() groups) (setq ingroup t)
- (when (not (= cnt 0))
- (setq cnt 0)
- (insert "\n"))
- (insert "{ "))
- ((equal e '(:endgroup))
- (setq ingroup nil cnt 0)
- (insert "}\n"))
- ((equal e '(:newline))
- (when (not (= cnt 0))
- (setq cnt 0)
- (insert "\n")
- (setq e (car tbl))
- (while (equal (car tbl) '(:newline))
- (insert "\n")
- (setq tbl (cdr tbl)))))
- (t
- (setq tg (car e) c (cdr e))
- (if ingroup (push tg (car groups)))
- (setq tg (org-add-props tg nil 'face
- (org-get-todo-face tg)))
- (if (and (= cnt 0) (not ingroup)) (insert " "))
- (insert "[" c "] " tg (make-string
- (- fwidth 4 (length tg)) ?\ ))
- (when (= (setq cnt (1+ cnt)) ncol)
- (insert "\n")
- (if ingroup (insert " "))
- (setq cnt 0)))))
- (insert "\n")
- (goto-char (point-min))
- (if (not expert) (org-fit-window-to-buffer))
- (message "[a-z..]:Set [SPC]:clear")
- (setq c (let ((inhibit-quit t)) (read-char-exclusive)))
- (cond
- ((or (= c ?\C-g)
- (and (= c ?q) (not (rassoc c fulltable))))
- (setq quit-flag t))
- ((= c ?\ ) nil)
- ((setq e (rassoc c fulltable) tg (car e))
- tg)
- (t (setq quit-flag t)))))))
-
-(defun org-entry-is-todo-p ()
- (member (org-get-todo-state) org-not-done-keywords))
-
-(defun org-entry-is-done-p ()
- (member (org-get-todo-state) org-done-keywords))
-
-(defun org-get-todo-state ()
- (save-excursion
- (org-back-to-heading t)
- (and (looking-at org-todo-line-regexp)
- (match-end 2)
- (match-string 2))))
-
-(defun org-at-date-range-p (&optional inactive-ok)
- "Is the cursor inside a date range?"
- (interactive)
- (save-excursion
- (catch 'exit
- (let ((pos (point)))
- (skip-chars-backward "^[<\r\n")
- (skip-chars-backward "<[")
- (and (looking-at (if inactive-ok org-tr-regexp-both org-tr-regexp))
- (>= (match-end 0) pos)
- (throw 'exit t))
- (skip-chars-backward "^<[\r\n")
- (skip-chars-backward "<[")
- (and (looking-at (if inactive-ok org-tr-regexp-both org-tr-regexp))
- (>= (match-end 0) pos)
- (throw 'exit t)))
- nil)))
-
-(defun org-get-repeat (&optional tagline)
- "Check if there is a deadline/schedule with repeater in this entry."
- (save-match-data
- (save-excursion
- (org-back-to-heading t)
- (and (re-search-forward (if tagline
- (concat tagline "\\s-*" org-repeat-re)
- org-repeat-re)
- (org-entry-end-position) t)
- (match-string-no-properties 1)))))
-
-(defvar org-last-changed-timestamp)
-(defvar org-last-inserted-timestamp)
-(defvar org-log-post-message)
-(defvar org-log-note-purpose)
-(defvar org-log-note-how)
-(defvar org-log-note-extra)
-(defun org-auto-repeat-maybe (done-word)
- "Check if the current headline contains a repeated deadline/schedule.
-If yes, set TODO state back to what it was and change the base date
-of repeating deadline/scheduled time stamps to new date.
-This function is run automatically after each state change to a DONE state."
- ;; last-state is dynamically scoped into this function
- (let* ((repeat (org-get-repeat))
- (aa (assoc last-state org-todo-kwd-alist))
- (interpret (nth 1 aa))
- (head (nth 2 aa))
- (whata '(("d" . day) ("m" . month) ("y" . year)))
- (msg "Entry repeats: ")
- (org-log-done nil)
- (org-todo-log-states nil)
- re type n what ts time to-state)
- (when repeat
- (if (eq org-log-repeat t) (setq org-log-repeat 'state))
- (setq to-state (or (org-entry-get nil "REPEAT_TO_STATE")
- org-todo-repeat-to-state))
- (unless (and to-state (member to-state org-todo-keywords-1))
- (setq to-state (if (eq interpret 'type) last-state head)))
- (org-todo to-state)
- (when (or org-log-repeat (org-entry-get nil "CLOCK"))
- (org-entry-put nil "LAST_REPEAT" (format-time-string
- (org-time-stamp-format t t))))
- (when org-log-repeat
- (if (or (memq 'org-add-log-note (default-value 'post-command-hook))
- (memq 'org-add-log-note post-command-hook))
- ;; OK, we are already setup for some record
- (if (eq org-log-repeat 'note)
- ;; make sure we take a note, not only a time stamp
- (setq org-log-note-how 'note))
- ;; Set up for taking a record
- (org-add-log-setup 'state (or done-word (car org-done-keywords))
- last-state
- 'findpos org-log-repeat)))
- (org-back-to-heading t)
- (org-add-planning-info nil nil 'closed)
- (setq re (concat "\\(" org-scheduled-time-regexp "\\)\\|\\("
- org-deadline-time-regexp "\\)\\|\\("
- org-ts-regexp "\\)"))
- (while (re-search-forward
- re (save-excursion (outline-next-heading) (point)) t)
- (setq type (if (match-end 1) org-scheduled-string
- (if (match-end 3) org-deadline-string "Plain:"))
- ts (match-string (if (match-end 2) 2 (if (match-end 4) 4 0))))
- (when (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([dwmy]\\)" ts)
- (setq n (string-to-number (match-string 2 ts))
- what (match-string 3 ts))
- (if (equal what "w") (setq n (* n 7) what "d"))
- ;; Preparation, see if we need to modify the start date for the change
- (when (match-end 1)
- (setq time (save-match-data (org-time-string-to-time ts)))
- (cond
- ((equal (match-string 1 ts) ".")
- ;; Shift starting date to today
- (org-timestamp-change
- (- (time-to-days (current-time)) (time-to-days time))
- 'day))
- ((equal (match-string 1 ts) "+")
- (let ((nshiftmax 10) (nshift 0))
- (while (or (= nshift 0)
- (<= (time-to-days time)
- (time-to-days (current-time))))
- (when (= (incf nshift) nshiftmax)
- (or (y-or-n-p (message "%d repeater intervals were not enough to shift date past today. Continue? " nshift))
- (error "Abort")))
- (org-timestamp-change n (cdr (assoc what whata)))
- (org-at-timestamp-p t)
- (setq ts (match-string 1))
- (setq time (save-match-data (org-time-string-to-time ts)))))
- (org-timestamp-change (- n) (cdr (assoc what whata)))
- ;; rematch, so that we have everything in place for the real shift
- (org-at-timestamp-p t)
- (setq ts (match-string 1))
- (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([dwmy]\\)" ts))))
- (org-timestamp-change n (cdr (assoc what whata)))
- (setq msg (concat msg type " " org-last-changed-timestamp " "))))
- (setq org-log-post-message msg)
- (message "%s" msg))))
-
-(defun org-show-todo-tree (arg)
- "Make a compact tree which shows all headlines marked with TODO.
-The tree will show the lines where the regexp matches, and all higher
-headlines above the match.
-With a \\[universal-argument] prefix, prompt for a regexp to match.
-With a numeric prefix N, construct a sparse tree for the Nth element
-of `org-todo-keywords-1'."
- (interactive "P")
- (let ((case-fold-search nil)
- (kwd-re
- (cond ((null arg) org-not-done-regexp)
- ((equal arg '(4))
- (let ((kwd (org-icompleting-read "Keyword (or KWD1|KWD2|...): "
- (mapcar 'list org-todo-keywords-1))))
- (concat "\\("
- (mapconcat 'identity (org-split-string kwd "|") "\\|")
- "\\)\\>")))
- ((<= (prefix-numeric-value arg) (length org-todo-keywords-1))
- (regexp-quote (nth (1- (prefix-numeric-value arg))
- org-todo-keywords-1)))
- (t (error "Invalid prefix argument: %s" arg)))))
- (message "%d TODO entries found"
- (org-occur (concat "^" outline-regexp " *" kwd-re )))))
-
-(defun org-deadline (&optional remove time)
- "Insert the \"DEADLINE:\" string with a timestamp to make a deadline.
-With argument REMOVE, remove any deadline from the item.
-When TIME is set, it should be an internal time specification, and the
-scheduling will use the corresponding date."
- (interactive "P")
- (let* ((old-date (org-entry-get nil "DEADLINE"))
- (repeater (and old-date
- (string-match "\\([.+]+[0-9]+[dwmy]\\) ?" old-date)
- (match-string 1 old-date))))
- (if remove
- (progn
- (when (and old-date org-log-redeadline)
- (org-add-log-setup 'deldeadline nil old-date 'findpos
- org-log-redeadline))
- (org-remove-timestamp-with-keyword org-deadline-string)
- (message "Item no longer has a deadline."))
- (org-add-planning-info 'deadline time 'closed)
- (when (and old-date org-log-redeadline
- (not (equal old-date
- (substring org-last-inserted-timestamp 1 -1))))
- (org-add-log-setup 'redeadline nil old-date 'findpos
- org-log-redeadline))
- (when repeater
- (save-excursion
- (org-back-to-heading t)
- (when (re-search-forward (concat org-deadline-string " "
- org-last-inserted-timestamp)
- (save-excursion
- (outline-next-heading) (point)) t)
- (goto-char (1- (match-end 0)))
- (insert " " repeater)
- (setq org-last-inserted-timestamp
- (concat (substring org-last-inserted-timestamp 0 -1)
- " " repeater
- (substring org-last-inserted-timestamp -1))))))
- (message "Deadline on %s" org-last-inserted-timestamp))))
-
-(defun org-schedule (&optional remove time)
- "Insert the SCHEDULED: string with a timestamp to schedule a TODO item.
-With argument REMOVE, remove any scheduling date from the item.
-When TIME is set, it should be an internal time specification, and the
-scheduling will use the corresponding date."
- (interactive "P")
- (let* ((old-date (org-entry-get nil "SCHEDULED"))
- (repeater (and old-date
- (string-match "\\([.+]+[0-9]+[dwmy]\\) ?" old-date)
- (match-string 1 old-date))))
- (if remove
- (progn
- (when (and old-date org-log-reschedule)
- (org-add-log-setup 'delschedule nil old-date 'findpos
- org-log-reschedule))
- (org-remove-timestamp-with-keyword org-scheduled-string)
- (message "Item is no longer scheduled."))
- (org-add-planning-info 'scheduled time 'closed)
- (when (and old-date org-log-reschedule
- (not (equal old-date
- (substring org-last-inserted-timestamp 1 -1))))
- (org-add-log-setup 'reschedule nil old-date 'findpos
- org-log-reschedule))
- (when repeater
- (save-excursion
- (org-back-to-heading t)
- (when (re-search-forward (concat org-scheduled-string " "
- org-last-inserted-timestamp)
- (save-excursion
- (outline-next-heading) (point)) t)
- (goto-char (1- (match-end 0)))
- (insert " " repeater)
- (setq org-last-inserted-timestamp
- (concat (substring org-last-inserted-timestamp 0 -1)
- " " repeater
- (substring org-last-inserted-timestamp -1))))))
- (message "Scheduled to %s" org-last-inserted-timestamp))))
-
-(defun org-get-scheduled-time (pom &optional inherit)
- "Get the scheduled time as a time tuple, of a format suitable
-for calling org-schedule with, or if there is no scheduling,
-returns nil."
- (let ((time (org-entry-get pom "SCHEDULED" inherit)))
- (when time
- (apply 'encode-time (org-parse-time-string time)))))
-
-(defun org-get-deadline-time (pom &optional inherit)
- "Get the deadline as a time tuple, of a format suitable for
-calling org-deadline with, or if there is no scheduling, returns
-nil."
- (let ((time (org-entry-get pom "DEADLINE" inherit)))
- (when time
- (apply 'encode-time (org-parse-time-string time)))))
-
-(defun org-remove-timestamp-with-keyword (keyword)
- "Remove all time stamps with KEYWORD in the current entry."
- (let ((re (concat "\\<" (regexp-quote keyword) " +<[^>\n]+>[ \t]*"))
- beg)
- (save-excursion
- (org-back-to-heading t)
- (setq beg (point))
- (outline-next-heading)
- (while (re-search-backward re beg t)
- (replace-match "")
- (if (and (string-match "\\S-" (buffer-substring (point-at-bol) (point)))
- (equal (char-before) ?\ ))
- (backward-delete-char 1)
- (if (string-match "^[ \t]*$" (buffer-substring
- (point-at-bol) (point-at-eol)))
- (delete-region (point-at-bol)
- (min (point-max) (1+ (point-at-eol))))))))))
-
-(defun org-add-planning-info (what &optional time &rest remove)
- "Insert new timestamp with keyword in the line directly after the headline.
-WHAT indicates what kind of time stamp to add. TIME indicated the time to use.
-If non is given, the user is prompted for a date.
-REMOVE indicates what kind of entries to remove. An old WHAT entry will also
-be removed."
- (interactive)
- (let (org-time-was-given org-end-time-was-given ts
- end default-time default-input)
-
- (catch 'exit
- (when (and (not time) (memq what '(scheduled deadline)))
- ;; Try to get a default date/time from existing timestamp
- (save-excursion
- (org-back-to-heading t)
- (setq end (save-excursion (outline-next-heading) (point)))
- (when (re-search-forward (if (eq what 'scheduled)
- org-scheduled-time-regexp
- org-deadline-time-regexp)
- end t)
- (setq ts (match-string 1)
- default-time
- (apply 'encode-time (org-parse-time-string ts))
- default-input (and ts (org-get-compact-tod ts))))))
- (when what
- ;; If necessary, get the time from the user
- (setq time (or time (org-read-date nil 'to-time nil nil
- default-time default-input))))
-
- (when (and org-insert-labeled-timestamps-at-point
- (member what '(scheduled deadline)))
- (insert
- (if (eq what 'scheduled) org-scheduled-string org-deadline-string) " ")
- (org-insert-time-stamp time org-time-was-given
- nil nil nil (list org-end-time-was-given))
- (setq what nil))
- (save-excursion
- (save-restriction
- (let (col list elt ts buffer-invisibility-spec)
- (org-back-to-heading t)
- (looking-at (concat outline-regexp "\\( *\\)[^\r\n]*"))
- (goto-char (match-end 1))
- (setq col (current-column))
- (goto-char (match-end 0))
- (if (eobp) (insert "\n") (forward-char 1))
- (when (and (not what)
- (not (looking-at
- (concat "[ \t]*"
- org-keyword-time-not-clock-regexp))))
- ;; Nothing to add, nothing to remove...... :-)
- (throw 'exit nil))
- (if (and (not (looking-at outline-regexp))
- (looking-at (concat "[^\r\n]*?" org-keyword-time-regexp
- "[^\r\n]*"))
- (not (equal (match-string 1) org-clock-string)))
- (narrow-to-region (match-beginning 0) (match-end 0))
- (insert-before-markers "\n")
- (backward-char 1)
- (narrow-to-region (point) (point))
- (and org-adapt-indentation (org-indent-to-column col)))
- ;; Check if we have to remove something.
- (setq list (cons what remove))
- (while list
- (setq elt (pop list))
- (goto-char (point-min))
- (when (or (and (eq elt 'scheduled)
- (re-search-forward org-scheduled-time-regexp nil t))
- (and (eq elt 'deadline)
- (re-search-forward org-deadline-time-regexp nil t))
- (and (eq elt 'closed)
- (re-search-forward org-closed-time-regexp nil t)))
- (replace-match "")
- (if (looking-at "--+<[^>]+>") (replace-match ""))
- (skip-chars-backward " ")
- (if (looking-at " +") (replace-match ""))))
- (goto-char (point-max))
- (and org-adapt-indentation (bolp) (org-indent-to-column col))
- (when what
- (insert
- (if (not (or (bolp) (eq (char-before) ?\ ))) " " "")
- (cond ((eq what 'scheduled) org-scheduled-string)
- ((eq what 'deadline) org-deadline-string)
- ((eq what 'closed) org-closed-string))
- " ")
- (setq ts (org-insert-time-stamp
- time
- (or org-time-was-given
- (and (eq what 'closed) org-log-done-with-time))
- (eq what 'closed)
- nil nil (list org-end-time-was-given)))
- (end-of-line 1))
- (goto-char (point-min))
- (widen)
- (if (and (looking-at "[ \t]*\n")
- (equal (char-before) ?\n))
- (delete-region (1- (point)) (point-at-eol)))
- ts))))))
-
-(defvar org-log-note-marker (make-marker))
-(defvar org-log-note-purpose nil)
-(defvar org-log-note-state nil)
-(defvar org-log-note-previous-state nil)
-(defvar org-log-note-how nil)
-(defvar org-log-note-extra nil)
-(defvar org-log-note-window-configuration nil)
-(defvar org-log-note-return-to (make-marker))
-(defvar org-log-post-message nil
- "Message to be displayed after a log note has been stored.
-The auto-repeater uses this.")
-
-(defun org-add-note ()
- "Add a note to the current entry.
-This is done in the same way as adding a state change note."
- (interactive)
- (org-add-log-setup 'note nil nil 'findpos nil))
-
-(defvar org-property-end-re)
-(defun org-add-log-setup (&optional purpose state prev-state
- findpos how extra)
- "Set up the post command hook to take a note.
-If this is about to TODO state change, the new state is expected in STATE.
-When FINDPOS is non-nil, find the correct position for the note in
-the current entry. If not, assume that it can be inserted at point.
-HOW is an indicator what kind of note should be created.
-EXTRA is additional text that will be inserted into the notes buffer."
- (let* ((org-log-into-drawer (org-log-into-drawer))
- (drawer (cond ((stringp org-log-into-drawer)
- org-log-into-drawer)
- (org-log-into-drawer "LOGBOOK")
- (t nil))))
- (save-restriction
- (save-excursion
- (when findpos
- (org-back-to-heading t)
- (narrow-to-region (point) (save-excursion
- (outline-next-heading) (point)))
- (looking-at (concat outline-regexp "\\( *\\)[^\r\n]*"
- "\\(\n[^\r\n]*?" org-keyword-time-not-clock-regexp
- "[^\r\n]*\\)?"))
- (goto-char (match-end 0))
- (cond
- (drawer
- (if (re-search-forward (concat "^[ \t]*:" drawer ":[ \t]*$")
- nil t)
- (progn
- (goto-char (match-end 0))
- (or org-log-states-order-reversed
- (and (re-search-forward org-property-end-re nil t)
- (goto-char (1- (match-beginning 0))))))
- (insert "\n:" drawer ":\n:END:")
- (beginning-of-line 0)
- (org-indent-line-function)
- (beginning-of-line 2)
- (org-indent-line-function)
- (end-of-line 0)))
- ((and org-log-state-notes-insert-after-drawers
- (save-excursion
- (forward-line) (looking-at org-drawer-regexp)))
- (forward-line)
- (while (looking-at org-drawer-regexp)
- (goto-char (match-end 0))
- (re-search-forward org-property-end-re (point-max) t)
- (forward-line))
- (forward-line -1)))
- (unless org-log-states-order-reversed
- (and (= (char-after) ?\n) (forward-char 1))
- (org-skip-over-state-notes)
- (skip-chars-backward " \t\n\r")))
- (move-marker org-log-note-marker (point))
- (setq org-log-note-purpose purpose
- org-log-note-state state
- org-log-note-previous-state prev-state
- org-log-note-how how
- org-log-note-extra extra)
- (add-hook 'post-command-hook 'org-add-log-note 'append)))))
-
-(defun org-skip-over-state-notes ()
- "Skip past the list of State notes in an entry."
- (if (looking-at "\n[ \t]*- State") (forward-char 1))
- (when (org-in-item-p)
- (let ((limit (org-list-bottom-point)))
- (while (looking-at "[ \t]*- State")
- (goto-char (or (org-get-next-item (point) limit)
- (org-get-end-of-item limit)))))))
-
-(defun org-add-log-note (&optional purpose)
- "Pop up a window for taking a note, and add this note later at point."
- (remove-hook 'post-command-hook 'org-add-log-note)
- (setq org-log-note-window-configuration (current-window-configuration))
- (delete-other-windows)
- (move-marker org-log-note-return-to (point))
- (switch-to-buffer (marker-buffer org-log-note-marker))
- (goto-char org-log-note-marker)
- (org-switch-to-buffer-other-window "*Org Note*")
- (erase-buffer)
- (if (memq org-log-note-how '(time state))
- (let (current-prefix-arg) (org-store-log-note))
- (let ((org-inhibit-startup t)) (org-mode))
- (insert (format "# Insert note for %s.
-# Finish with C-c C-c, or cancel with C-c C-k.\n\n"
- (cond
- ((eq org-log-note-purpose 'clock-out) "stopped clock")
- ((eq org-log-note-purpose 'done) "closed todo item")
- ((eq org-log-note-purpose 'state)
- (format "state change from \"%s\" to \"%s\""
- (or org-log-note-previous-state "")
- (or org-log-note-state "")))
- ((eq org-log-note-purpose 'reschedule)
- "rescheduling")
- ((eq org-log-note-purpose 'delschedule)
- "no longer scheduled")
- ((eq org-log-note-purpose 'redeadline)
- "changing deadline")
- ((eq org-log-note-purpose 'deldeadline)
- "removing deadline")
- ((eq org-log-note-purpose 'refile)
- "refiling")
- ((eq org-log-note-purpose 'note)
- "this entry")
- (t (error "This should not happen")))))
- (if org-log-note-extra (insert org-log-note-extra))
- (org-set-local 'org-finish-function 'org-store-log-note)))
-
-(defvar org-note-abort nil) ; dynamically scoped
-(defun org-store-log-note ()
- "Finish taking a log note, and insert it to where it belongs."
- (let ((txt (buffer-string))
- (note (cdr (assq org-log-note-purpose org-log-note-headings)))
- lines ind bul)
- (kill-buffer (current-buffer))
- (while (string-match "\\`#.*\n[ \t\n]*" txt)
- (setq txt (replace-match "" t t txt)))
- (if (string-match "\\s-+\\'" txt)
- (setq txt (replace-match "" t t txt)))
- (setq lines (org-split-string txt "\n"))
- (when (and note (string-match "\\S-" note))
- (setq note
- (org-replace-escapes
- note
- (list (cons "%u" (user-login-name))
- (cons "%U" user-full-name)
- (cons "%t" (format-time-string
- (org-time-stamp-format 'long 'inactive)
- (current-time)))
- (cons "%T" (format-time-string
- (org-time-stamp-format 'long nil)
- (current-time)))
- (cons "%s" (if org-log-note-state
- (concat "\"" org-log-note-state "\"")
- ""))
- (cons "%S" (if org-log-note-previous-state
- (concat "\"" org-log-note-previous-state "\"")
- "\"\"")))))
- (if lines (setq note (concat note " \\\\")))
- (push note lines))
- (when (or current-prefix-arg org-note-abort)
- (when org-log-into-drawer
- (org-remove-empty-drawer-at
- (if (stringp org-log-into-drawer) org-log-into-drawer "LOGBOOK")
- org-log-note-marker))
- (setq lines nil))
- (when lines
- (with-current-buffer (marker-buffer org-log-note-marker)
- (save-excursion
- (goto-char org-log-note-marker)
- (move-marker org-log-note-marker nil)
- (end-of-line 1)
- (if (not (bolp)) (let ((inhibit-read-only t)) (insert "\n")))
- (setq ind (save-excursion
- (if (org-in-item-p)
- (progn
- (goto-char (org-list-top-point))
- (org-get-indentation))
- (skip-chars-backward " \r\t\n")
- (cond
- ((and (org-at-heading-p)
- org-adapt-indentation)
- (1+ (org-current-level)))
- ((org-at-heading-p) 0)
- (t (org-get-indentation))))))
- (setq bul (org-list-bullet-string "-"))
- (org-indent-line-to ind)
- (insert bul (pop lines))
- (let ((ind-body (+ (length bul) ind)))
- (while lines
- (insert "\n")
- (org-indent-line-to ind-body)
- (insert (pop lines))))
- (message "Note stored")
- (org-back-to-heading t)
- (org-cycle-hide-drawers 'children)))))
- (set-window-configuration org-log-note-window-configuration)
- (with-current-buffer (marker-buffer org-log-note-return-to)
- (goto-char org-log-note-return-to))
- (move-marker org-log-note-return-to nil)
- (and org-log-post-message (message "%s" org-log-post-message)))
-
-(defun org-remove-empty-drawer-at (drawer pos)
- "Remove an empty drawer DRAWER at position POS.
-POS may also be a marker."
- (with-current-buffer (if (markerp pos) (marker-buffer pos) (current-buffer))
- (save-excursion
- (save-restriction
- (widen)
- (goto-char pos)
- (if (org-in-regexp
- (concat "^[ \t]*:" drawer ":[ \t]*\n[ \t]*:END:[ \t]*\n?") 2)
- (replace-match ""))))))
-
-(defun org-sparse-tree (&optional arg)
- "Create a sparse tree, prompt for the details.
-This command can create sparse trees. You first need to select the type
-of match used to create the tree:
-
-t Show all TODO entries.
-T Show entries with a specific TODO keyword.
-m Show entries selected by a tags/property match.
-p Enter a property name and its value (both with completion on existing
- names/values) and show entries with that property.
-r Show entries matching a regular expression (`/' can be used as well)
-d Show deadlines due within `org-deadline-warning-days'.
-b Show deadlines and scheduled items before a date.
-a Show deadlines and scheduled items after a date."
- (interactive "P")
- (let (ans kwd value)
- (message "Sparse tree: [r]egexp [/]regexp [t]odo [T]odo-kwd [m]atch [p]roperty\n [d]eadlines [b]efore-date [a]fter-date")
- (setq ans (read-char-exclusive))
- (cond
- ((equal ans ?d)
- (call-interactively 'org-check-deadlines))
- ((equal ans ?b)
- (call-interactively 'org-check-before-date))
- ((equal ans ?a)
- (call-interactively 'org-check-after-date))
- ((equal ans ?t)
- (org-show-todo-tree nil))
- ((equal ans ?T)
- (org-show-todo-tree '(4)))
- ((member ans '(?T ?m))
- (call-interactively 'org-match-sparse-tree))
- ((member ans '(?p ?P))
- (setq kwd (org-icompleting-read "Property: "
- (mapcar 'list (org-buffer-property-keys))))
- (setq value (org-icompleting-read "Value: "
- (mapcar 'list (org-property-values kwd))))
- (unless (string-match "\\`{.*}\\'" value)
- (setq value (concat "\"" value "\"")))
- (org-match-sparse-tree arg (concat kwd "=" value)))
- ((member ans '(?r ?R ?/))
- (call-interactively 'org-occur))
- (t (error "No such sparse tree command \"%c\"" ans)))))
-
-(defvar org-occur-highlights nil
- "List of overlays used for occur matches.")
-(make-variable-buffer-local 'org-occur-highlights)
-(defvar org-occur-parameters nil
- "Parameters of the active org-occur calls.
-This is a list, each call to org-occur pushes as cons cell,
-containing the regular expression and the callback, onto the list.
-The list can contain several entries if `org-occur' has been called
-several time with the KEEP-PREVIOUS argument. Otherwise, this list
-will only contain one set of parameters. When the highlights are
-removed (for example with `C-c C-c', or with the next edit (depending
-on `org-remove-highlights-with-change'), this variable is emptied
-as well.")
-(make-variable-buffer-local 'org-occur-parameters)
-
-(defun org-occur (regexp &optional keep-previous callback)
- "Make a compact tree which shows all matches of REGEXP.
-The tree will show the lines where the regexp matches, and all higher
-headlines above the match. It will also show the heading after the match,
-to make sure editing the matching entry is easy.
-If KEEP-PREVIOUS is non-nil, highlighting and exposing done by a previous
-call to `org-occur' will be kept, to allow stacking of calls to this
-command.
-If CALLBACK is non-nil, it is a function which is called to confirm
-that the match should indeed be shown."
- (interactive "sRegexp: \nP")
- (when (equal regexp "")
- (error "Regexp cannot be empty"))
- (unless keep-previous
- (org-remove-occur-highlights nil nil t))
- (push (cons regexp callback) org-occur-parameters)
- (let ((cnt 0))
- (save-excursion
- (goto-char (point-min))
- (if (or (not keep-previous) ; do not want to keep
- (not org-occur-highlights)) ; no previous matches
- ;; hide everything
- (org-overview))
- (while (re-search-forward regexp nil t)
- (when (or (not callback)
- (save-match-data (funcall callback)))
- (setq cnt (1+ cnt))
- (when org-highlight-sparse-tree-matches
- (org-highlight-new-match (match-beginning 0) (match-end 0)))
- (org-show-context 'occur-tree))))
- (when org-remove-highlights-with-change
- (org-add-hook 'before-change-functions 'org-remove-occur-highlights
- nil 'local))
- (unless org-sparse-tree-open-archived-trees
- (org-hide-archived-subtrees (point-min) (point-max)))
- (run-hooks 'org-occur-hook)
- (if (interactive-p)
- (message "%d match(es) for regexp %s" cnt regexp))
- cnt))
-
-(defun org-show-context (&optional key)
- "Make sure point and context are visible.
-How much context is shown depends upon the variables
-`org-show-hierarchy-above', `org-show-following-heading'. and
-`org-show-siblings'."
- (let ((heading-p (org-on-heading-p t))
- (hierarchy-p (org-get-alist-option org-show-hierarchy-above key))
- (following-p (org-get-alist-option org-show-following-heading key))
- (entry-p (org-get-alist-option org-show-entry-below key))
- (siblings-p (org-get-alist-option org-show-siblings key)))
- (catch 'exit
- ;; Show heading or entry text
- (if (and heading-p (not entry-p))
- (org-flag-heading nil) ; only show the heading
- (and (or entry-p (org-invisible-p) (org-invisible-p2))
- (org-show-hidden-entry))) ; show entire entry
- (when following-p
- ;; Show next sibling, or heading below text
- (save-excursion
- (and (if heading-p (org-goto-sibling) (outline-next-heading))
- (org-flag-heading nil))))
- (when siblings-p (org-show-siblings))
- (when hierarchy-p
- ;; show all higher headings, possibly with siblings
- (save-excursion
- (while (and (condition-case nil
- (progn (org-up-heading-all 1) t)
- (error nil))
- (not (bobp)))
- (org-flag-heading nil)
- (when siblings-p (org-show-siblings))))))))
-
-(defvar org-reveal-start-hook nil
- "Hook run before revealing a location.")
-
-(defun org-reveal (&optional siblings)
- "Show current entry, hierarchy above it, and the following headline.
-This can be used to show a consistent set of context around locations
-exposed with `org-show-hierarchy-above' or `org-show-following-heading'
-not t for the search context.
-
-With optional argument SIBLINGS, on each level of the hierarchy all
-siblings are shown. This repairs the tree structure to what it would
-look like when opened with hierarchical calls to `org-cycle'.
-With double optional argument \\[universal-argument] \\[universal-argument], \
-go to the parent and show the
-entire tree."
- (interactive "P")
- (run-hooks 'org-reveal-start-hook)
- (let ((org-show-hierarchy-above t)
- (org-show-following-heading t)
- (org-show-siblings (if siblings t org-show-siblings)))
- (org-show-context nil))
- (when (equal siblings '(16))
- (save-excursion
- (when (org-up-heading-safe)
- (org-show-subtree)
- (run-hook-with-args 'org-cycle-hook 'subtree)))))
-
-(defun org-highlight-new-match (beg end)
- "Highlight from BEG to END and mark the highlight is an occur headline."
- (let ((ov (make-overlay beg end)))
- (overlay-put ov 'face 'secondary-selection)
- (push ov org-occur-highlights)))
-
-(defun org-remove-occur-highlights (&optional beg end noremove)
- "Remove the occur highlights from the buffer.
-BEG and END are ignored. If NOREMOVE is nil, remove this function
-from the `before-change-functions' in the current buffer."
- (interactive)
- (unless org-inhibit-highlight-removal
- (mapc 'delete-overlay org-occur-highlights)
- (setq org-occur-highlights nil)
- (setq org-occur-parameters nil)
- (unless noremove
- (remove-hook 'before-change-functions
- 'org-remove-occur-highlights 'local))))
-
-;;;; Priorities
-
-(defvar org-priority-regexp ".*?\\(\\[#\\([A-Z0-9]\\)\\] ?\\)"
- "Regular expression matching the priority indicator.")
-
-(defvar org-remove-priority-next-time nil)
-
-(defun org-priority-up ()
- "Increase the priority of the current item."
- (interactive)
- (org-priority 'up))
-
-(defun org-priority-down ()
- "Decrease the priority of the current item."
- (interactive)
- (org-priority 'down))
-
-(defun org-priority (&optional action)
- "Change the priority of an item by ARG.
-ACTION can be `set', `up', `down', or a character."
- (interactive)
- (unless org-enable-priority-commands
- (error "Priority commands are disabled"))
- (setq action (or action 'set))
- (let (current new news have remove)
- (save-excursion
- (org-back-to-heading t)
- (if (looking-at org-priority-regexp)
- (setq current (string-to-char (match-string 2))
- have t)
- (setq current org-default-priority))
- (cond
- ((eq action 'remove)
- (setq remove t new ?\ ))
- ((or (eq action 'set)
- (if (featurep 'xemacs) (characterp action) (integerp action)))
- (if (not (eq action 'set))
- (setq new action)
- (message "Priority %c-%c, SPC to remove: "
- org-highest-priority org-lowest-priority)
- (save-match-data
- (setq new (read-char-exclusive))))
- (if (and (= (upcase org-highest-priority) org-highest-priority)
- (= (upcase org-lowest-priority) org-lowest-priority))
- (setq new (upcase new)))
- (cond ((equal new ?\ ) (setq remove t))
- ((or (< (upcase new) org-highest-priority) (> (upcase new) org-lowest-priority))
- (error "Priority must be between `%c' and `%c'"
- org-highest-priority org-lowest-priority))))
- ((eq action 'up)
- (if (and (not have) (eq last-command this-command))
- (setq new org-lowest-priority)
- (setq new (if (and org-priority-start-cycle-with-default (not have))
- org-default-priority (1- current)))))
- ((eq action 'down)
- (if (and (not have) (eq last-command this-command))
- (setq new org-highest-priority)
- (setq new (if (and org-priority-start-cycle-with-default (not have))
- org-default-priority (1+ current)))))
- (t (error "Invalid action")))
- (if (or (< (upcase new) org-highest-priority)
- (> (upcase new) org-lowest-priority))
- (setq remove t))
- (setq news (format "%c" new))
- (if have
- (if remove
- (replace-match "" t t nil 1)
- (replace-match news t t nil 2))
- (if remove
- (error "No priority cookie found in line")
- (let ((case-fold-search nil))
- (looking-at org-todo-line-regexp))
- (if (match-end 2)
- (progn
- (goto-char (match-end 2))
- (insert " [#" news "]"))
- (goto-char (match-beginning 3))
- (insert "[#" news "] "))))
- (org-preserve-lc (org-set-tags nil 'align)))
- (if remove
- (message "Priority removed")
- (message "Priority of current item set to %s" news))))
-
-(defun org-get-priority (s)
- "Find priority cookie and return priority."
- (if (functionp org-get-priority-function)
- (funcall org-get-priority-function)
- (save-match-data
- (if (not (string-match org-priority-regexp s))
- (* 1000 (- org-lowest-priority org-default-priority))
- (* 1000 (- org-lowest-priority
- (string-to-char (match-string 2 s))))))))
-
-;;;; Tags
-
-(defvar org-agenda-archives-mode)
-(defvar org-map-continue-from nil
- "Position from where mapping should continue.
-Can be set by the action argument to `org-scan-tag's and `org-map-entries'.")
-
-(defvar org-scanner-tags nil
- "The current tag list while the tags scanner is running.")
-(defvar org-trust-scanner-tags nil
- "Should `org-get-tags-at' use the tags fro the scanner.
-This is for internal dynamical scoping only.
-When this is non-nil, the function `org-get-tags-at' will return the value
-of `org-scanner-tags' instead of building the list by itself. This
-can lead to large speed-ups when the tags scanner is used in a file with
-many entries, and when the list of tags is retrieved, for example to
-obtain a list of properties. Building the tags list for each entry in such
-a file becomes an N^2 operation - but with this variable set, it scales
-as N.")
-
-(defun org-scan-tags (action matcher &optional todo-only)
- "Scan headline tags with inheritance and produce output ACTION.
-
-ACTION can be `sparse-tree' to produce a sparse tree in the current buffer,
-or `agenda' to produce an entry list for an agenda view. It can also be
-a Lisp form or a function that should be called at each matched headline, in
-this case the return value is a list of all return values from these calls.
-
-MATCHER is a Lisp form to be evaluated, testing if a given set of tags
-qualifies a headline for inclusion. When TODO-ONLY is non-nil,
-only lines with a TODO keyword are included in the output."
- (require 'org-agenda)
- (let* ((re (concat "^" outline-regexp " *\\(\\<\\("
- (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
- (org-re
- "\\>\\)\\)? *\\(.*?\\)\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*$")))
- (props (list 'face 'default
- 'done-face 'org-agenda-done
- 'undone-face 'default
- 'mouse-face 'highlight
- 'org-not-done-regexp org-not-done-regexp
- 'org-todo-regexp org-todo-regexp
- 'help-echo
- (format "mouse-2 or RET jump to org file %s"
- (abbreviate-file-name
- (or (buffer-file-name (buffer-base-buffer))
- (buffer-name (buffer-base-buffer)))))))
- (case-fold-search nil)
- (org-map-continue-from nil)
- lspos tags tags-list
- (tags-alist (list (cons 0 org-file-tags)))
- (llast 0) rtn rtn1 level category i txt
- todo marker entry priority)
- (when (not (or (member action '(agenda sparse-tree)) (functionp action)))
- (setq action (list 'lambda nil action)))
- (save-excursion
- (goto-char (point-min))
- (when (eq action 'sparse-tree)
- (org-overview)
- (org-remove-occur-highlights))
- (while (re-search-forward re nil t)
- (catch :skip
- (setq todo (if (match-end 1) (org-match-string-no-properties 2))
- tags (if (match-end 4) (org-match-string-no-properties 4)))
- (goto-char (setq lspos (match-beginning 0)))
- (setq level (org-reduced-level (funcall outline-level))
- category (org-get-category))
- (setq i llast llast level)
- ;; remove tag lists from same and sublevels
- (while (>= i level)
- (when (setq entry (assoc i tags-alist))
- (setq tags-alist (delete entry tags-alist)))
- (setq i (1- i)))
- ;; add the next tags
- (when tags
- (setq tags (org-split-string tags ":")
- tags-alist
- (cons (cons level tags) tags-alist)))
- ;; compile tags for current headline
- (setq tags-list
- (if org-use-tag-inheritance
- (apply 'append (mapcar 'cdr (reverse tags-alist)))
- tags)
- org-scanner-tags tags-list)
- (when org-use-tag-inheritance
- (setcdr (car tags-alist)
- (mapcar (lambda (x)
- (setq x (copy-sequence x))
- (org-add-prop-inherited x))
- (cdar tags-alist))))
- (when (and tags org-use-tag-inheritance
- (or (not (eq t org-use-tag-inheritance))
- org-tags-exclude-from-inheritance))
- ;; selective inheritance, remove uninherited ones
- (setcdr (car tags-alist)
- (org-remove-uniherited-tags (cdar tags-alist))))
- (when (and (or (not todo-only)
- (and (member todo org-not-done-keywords)
- (or (not org-agenda-tags-todo-honor-ignore-options)
- (not (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item)))))
- (let ((case-fold-search t)) (eval matcher))
- (or
- (not (member org-archive-tag tags-list))
- ;; we have an archive tag, should we use this anyway?
- (or (not org-agenda-skip-archived-trees)
- (and (eq action 'agenda) org-agenda-archives-mode))))
- (unless (eq action 'sparse-tree) (org-agenda-skip))
-
- ;; select this headline
-
- (cond
- ((eq action 'sparse-tree)
- (and org-highlight-sparse-tree-matches
- (org-get-heading) (match-end 0)
- (org-highlight-new-match
- (match-beginning 0) (match-beginning 1)))
- (org-show-context 'tags-tree))
- ((eq action 'agenda)
- (setq txt (org-format-agenda-item
- ""
- (concat
- (if (eq org-tags-match-list-sublevels 'indented)
- (make-string (1- level) ?.) "")
- (org-get-heading))
- category
- tags-list
- )
- priority (org-get-priority txt))
- (goto-char lspos)
- (setq marker (org-agenda-new-marker))
- (org-add-props txt props
- 'org-marker marker 'org-hd-marker marker 'org-category category
- 'todo-state todo
- 'priority priority 'type "tagsmatch")
- (push txt rtn))
- ((functionp action)
- (setq org-map-continue-from nil)
- (save-excursion
- (setq rtn1 (funcall action))
- (push rtn1 rtn)))
- (t (error "Invalid action")))
-
- ;; if we are to skip sublevels, jump to end of subtree
- (unless org-tags-match-list-sublevels
- (org-end-of-subtree t)
- (backward-char 1))))
- ;; Get the correct position from where to continue
- (if org-map-continue-from
- (goto-char org-map-continue-from)
- (and (= (point) lspos) (end-of-line 1)))))
- (when (and (eq action 'sparse-tree)
- (not org-sparse-tree-open-archived-trees))
- (org-hide-archived-subtrees (point-min) (point-max)))
- (nreverse rtn)))
-
-(defun org-remove-uniherited-tags (tags)
- "Remove all tags that are not inherited from the list TAGS."
- (cond
- ((eq org-use-tag-inheritance t)
- (if org-tags-exclude-from-inheritance
- (org-delete-all org-tags-exclude-from-inheritance tags)
- tags))
- ((not org-use-tag-inheritance) nil)
- ((stringp org-use-tag-inheritance)
- (delq nil (mapcar
- (lambda (x)
- (if (and (string-match org-use-tag-inheritance x)
- (not (member x org-tags-exclude-from-inheritance)))
- x nil))
- tags)))
- ((listp org-use-tag-inheritance)
- (delq nil (mapcar
- (lambda (x)
- (if (member x org-use-tag-inheritance) x nil))
- tags)))))
-
-(defvar todo-only) ;; dynamically scoped
-
-(defun org-match-sparse-tree (&optional todo-only match)
- "Create a sparse tree according to tags string MATCH.
-MATCH can contain positive and negative selection of tags, like
-\"+WORK+URGENT-WITHBOSS\".
-If optional argument TODO-ONLY is non-nil, only select lines that are
-also TODO lines."
- (interactive "P")
- (org-prepare-agenda-buffers (list (current-buffer)))
- (org-scan-tags 'sparse-tree (cdr (org-make-tags-matcher match)) todo-only))
-
-(defalias 'org-tags-sparse-tree 'org-match-sparse-tree)
-
-(defvar org-cached-props nil)
-(defun org-cached-entry-get (pom property)
- (if (or (eq t org-use-property-inheritance)
- (and (stringp org-use-property-inheritance)
- (string-match org-use-property-inheritance property))
- (and (listp org-use-property-inheritance)
- (member property org-use-property-inheritance)))
- ;; Caching is not possible, check it directly
- (org-entry-get pom property 'inherit)
- ;; Get all properties, so that we can do complicated checks easily
- (cdr (assoc property (or org-cached-props
- (setq org-cached-props
- (org-entry-properties pom)))))))
-
-(defun org-global-tags-completion-table (&optional files)
- "Return the list of all tags in all agenda buffer/files."
- (save-excursion
- (org-uniquify
- (delq nil
- (apply 'append
- (mapcar
- (lambda (file)
- (set-buffer (find-file-noselect file))
- (append (org-get-buffer-tags)
- (mapcar (lambda (x) (if (stringp (car-safe x))
- (list (car-safe x)) nil))
- org-tag-alist)))
- (if (and files (car files))
- files
- (org-agenda-files))))))))
-
-(defun org-make-tags-matcher (match)
- "Create the TAGS//TODO matcher form for the selection string MATCH."
- ;; todo-only is scoped dynamically into this function, and the function
- ;; may change it if the matcher asks for it.
- (unless match
- ;; Get a new match request, with completion
- (let ((org-last-tags-completion-table
- (org-global-tags-completion-table)))
- (setq match (org-completing-read-no-i
- "Match: " 'org-tags-completion-function nil nil nil
- 'org-tags-history))))
-
- ;; Parse the string and create a lisp form
- (let ((match0 match)
- (re (org-re "^&?\\([-+:]\\)?\\({[^}]+}\\|LEVEL\\([<=>]\\{1,2\\}\\)\\([0-9]+\\)\\|\\(\\(?:[[:alnum:]_]+\\(?:\\\\-\\)*\\)+\\)\\([<>=]\\{1,2\\}\\)\\({[^}]+}\\|\"[^\"]*\"\\|-?[.0-9]+\\(?:[eE][-+]?[0-9]+\\)?\\)\\|[[:alnum:]_@#%]+\\)"))
- minus tag mm
- tagsmatch todomatch tagsmatcher todomatcher kwd matcher
- orterms term orlist re-p str-p level-p level-op time-p
- prop-p pn pv po gv rest)
- (if (string-match "/+" match)
- ;; match contains also a todo-matching request
- (progn
- (setq tagsmatch (substring match 0 (match-beginning 0))
- todomatch (substring match (match-end 0)))
- (if (string-match "^!" todomatch)
- (setq todo-only t todomatch (substring todomatch 1)))
- (if (string-match "^\\s-*$" todomatch)
- (setq todomatch nil)))
- ;; only matching tags
- (setq tagsmatch match todomatch nil))
-
- ;; Make the tags matcher
- (if (or (not tagsmatch) (not (string-match "\\S-" tagsmatch)))
- (setq tagsmatcher t)
- (setq orterms (org-split-string tagsmatch "|") orlist nil)
- (while (setq term (pop orterms))
- (while (and (equal (substring term -1) "\\") orterms)
- (setq term (concat term "|" (pop orterms)))) ; repair bad split
- (while (string-match re term)
- (setq rest (substring term (match-end 0))
- minus (and (match-end 1)
- (equal (match-string 1 term) "-"))
- tag (save-match-data (replace-regexp-in-string
- "\\\\-" "-"
- (match-string 2 term)))
- re-p (equal (string-to-char tag) ?{)
- level-p (match-end 4)
- prop-p (match-end 5)
- mm (cond
- (re-p `(org-match-any-p ,(substring tag 1 -1) tags-list))
- (level-p
- (setq level-op (org-op-to-function (match-string 3 term)))
- `(,level-op level ,(string-to-number
- (match-string 4 term))))
- (prop-p
- (setq pn (match-string 5 term)
- po (match-string 6 term)
- pv (match-string 7 term)
- re-p (equal (string-to-char pv) ?{)
- str-p (equal (string-to-char pv) ?\")
- time-p (save-match-data
- (string-match "^\"[[<].*[]>]\"$" pv))
- pv (if (or re-p str-p) (substring pv 1 -1) pv))
- (if time-p (setq pv (org-matcher-time pv)))
- (setq po (org-op-to-function po (if time-p 'time str-p)))
- (cond
- ((equal pn "CATEGORY")
- (setq gv '(get-text-property (point) 'org-category)))
- ((equal pn "TODO")
- (setq gv 'todo))
- (t
- (setq gv `(org-cached-entry-get nil ,pn))))
- (if re-p
- (if (eq po 'org<>)
- `(not (string-match ,pv (or ,gv "")))
- `(string-match ,pv (or ,gv "")))
- (if str-p
- `(,po (or ,gv "") ,pv)
- `(,po (string-to-number (or ,gv ""))
- ,(string-to-number pv) ))))
- (t `(member ,tag tags-list)))
- mm (if minus (list 'not mm) mm)
- term rest)
- (push mm tagsmatcher))
- (push (if (> (length tagsmatcher) 1)
- (cons 'and tagsmatcher)
- (car tagsmatcher))
- orlist)
- (setq tagsmatcher nil))
- (setq tagsmatcher (if (> (length orlist) 1) (cons 'or orlist) (car orlist)))
- (setq tagsmatcher
- (list 'progn '(setq org-cached-props nil) tagsmatcher)))
- ;; Make the todo matcher
- (if (or (not todomatch) (not (string-match "\\S-" todomatch)))
- (setq todomatcher t)
- (setq orterms (org-split-string todomatch "|") orlist nil)
- (while (setq term (pop orterms))
- (while (string-match re term)
- (setq minus (and (match-end 1)
- (equal (match-string 1 term) "-"))
- kwd (match-string 2 term)
- re-p (equal (string-to-char kwd) ?{)
- term (substring term (match-end 0))
- mm (if re-p
- `(string-match ,(substring kwd 1 -1) todo)
- (list 'equal 'todo kwd))
- mm (if minus (list 'not mm) mm))
- (push mm todomatcher))
- (push (if (> (length todomatcher) 1)
- (cons 'and todomatcher)
- (car todomatcher))
- orlist)
- (setq todomatcher nil))
- (setq todomatcher (if (> (length orlist) 1)
- (cons 'or orlist) (car orlist))))
-
- ;; Return the string and lisp forms of the matcher
- (setq matcher (if todomatcher
- (list 'and tagsmatcher todomatcher)
- tagsmatcher))
- (cons match0 matcher)))
-
-(defun org-op-to-function (op &optional stringp)
- "Turn an operator into the appropriate function."
- (setq op
- (cond
- ((equal op "<" ) '(< string< org-time<))
- ((equal op ">" ) '(> org-string> org-time>))
- ((member op '("<=" "=<")) '(<= org-string<= org-time<=))
- ((member op '(">=" "=>")) '(>= org-string>= org-time>=))
- ((member op '("=" "==")) '(= string= org-time=))
- ((member op '("<>" "!=")) '(org<> org-string<> org-time<>))))
- (nth (if (eq stringp 'time) 2 (if stringp 1 0)) op))
-
-(defun org<> (a b) (not (= a b)))
-(defun org-string<= (a b) (or (string= a b) (string< a b)))
-(defun org-string>= (a b) (not (string< a b)))
-(defun org-string> (a b) (and (not (string= a b)) (not (string< a b))))
-(defun org-string<> (a b) (not (string= a b)))
-(defun org-time= (a b) (setq a (org-2ft a) b (org-2ft b)) (and (> a 0) (> b 0) (= a b)))
-(defun org-time< (a b) (setq a (org-2ft a) b (org-2ft b)) (and (> a 0) (> b 0) (< a b)))
-(defun org-time<= (a b) (setq a (org-2ft a) b (org-2ft b)) (and (> a 0) (> b 0) (<= a b)))
-(defun org-time> (a b) (setq a (org-2ft a) b (org-2ft b)) (and (> a 0) (> b 0) (> a b)))
-(defun org-time>= (a b) (setq a (org-2ft a) b (org-2ft b)) (and (> a 0) (> b 0) (>= a b)))
-(defun org-time<> (a b) (setq a (org-2ft a) b (org-2ft b)) (and (> a 0) (> b 0) (org<> a b)))
-(defun org-2ft (s)
- "Convert S to a floating point time.
-If S is already a number, just return it. If it is a string, parse
-it as a time string and apply `float-time' to it. If S is nil, just return 0."
- (cond
- ((numberp s) s)
- ((stringp s)
- (condition-case nil
- (float-time (apply 'encode-time (org-parse-time-string s)))
- (error 0.)))
- (t 0.)))
-
-(defun org-time-today ()
- "Time in seconds today at 0:00.
-Returns the float number of seconds since the beginning of the
-epoch to the beginning of today (00:00)."
- (float-time (apply 'encode-time
- (append '(0 0 0) (nthcdr 3 (decode-time))))))
-
-(defun org-matcher-time (s)
- "Interpret a time comparison value."
- (save-match-data
- (cond
- ((string= s "<now>") (float-time))
- ((string= s "<today>") (org-time-today))
- ((string= s "<tomorrow>") (+ 86400.0 (org-time-today)))
- ((string= s "<yesterday>") (- (org-time-today) 86400.0))
- ((string-match "^<\\([-+][0-9]+\\)\\([dwmy]\\)>$" s)
- (+ (org-time-today)
- (* (string-to-number (match-string 1 s))
- (cdr (assoc (match-string 2 s)
- '(("d" . 86400.0) ("w" . 604800.0)
- ("m" . 2678400.0) ("y" . 31557600.0)))))))
- (t (org-2ft s)))))
-
-(defun org-match-any-p (re list)
- "Does re match any element of list?"
- (setq list (mapcar (lambda (x) (string-match re x)) list))
- (delq nil list))
-
-(defvar org-add-colon-after-tag-completion nil) ;; dynamically scoped param
-(defvar org-tags-overlay (make-overlay 1 1))
-(org-detach-overlay org-tags-overlay)
-
-(defun org-get-local-tags-at (&optional pos)
- "Get a list of tags defined in the current headline."
- (org-get-tags-at pos 'local))
-
-(defun org-get-local-tags ()
- "Get a list of tags defined in the current headline."
- (org-get-tags-at nil 'local))
-
-(defun org-get-tags-at (&optional pos local)
- "Get a list of all headline tags applicable at POS.
-POS defaults to point. If tags are inherited, the list contains
-the targets in the same sequence as the headlines appear, i.e.
-the tags of the current headline come last.
-When LOCAL is non-nil, only return tags from the current headline,
-ignore inherited ones."
- (interactive)
- (if (and org-trust-scanner-tags
- (or (not pos) (equal pos (point)))
- (not local))
- org-scanner-tags
- (let (tags ltags lastpos parent)
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (or pos (point)))
- (save-match-data
- (catch 'done
- (condition-case nil
- (progn
- (org-back-to-heading t)
- (while (not (equal lastpos (point)))
- (setq lastpos (point))
- (when (looking-at
- (org-re "[^\r\n]+?:\\([[:alnum:]_@#%:]+\\):[ \t]*$"))
- (setq ltags (org-split-string
- (org-match-string-no-properties 1) ":"))
- (when parent
- (setq ltags (mapcar 'org-add-prop-inherited ltags)))
- (setq tags (append
- (if parent
- (org-remove-uniherited-tags ltags)
- ltags)
- tags)))
- (or org-use-tag-inheritance (throw 'done t))
- (if local (throw 'done t))
- (or (org-up-heading-safe) (error nil))
- (setq parent t)))
- (error nil)))))
- (append (org-remove-uniherited-tags org-file-tags) tags)))))
-
-(defun org-add-prop-inherited (s)
- (add-text-properties 0 (length s) '(inherited t) s)
- s)
-
-(defun org-toggle-tag (tag &optional onoff)
- "Toggle the tag TAG for the current line.
-If ONOFF is `on' or `off', don't toggle but set to this state."
- (let (res current)
- (save-excursion
- (org-back-to-heading t)
- (if (re-search-forward (org-re "[ \t]:\\([[:alnum:]_@#%:]+\\):[ \t]*$")
- (point-at-eol) t)
- (progn
- (setq current (match-string 1))
- (replace-match ""))
- (setq current ""))
- (setq current (nreverse (org-split-string current ":")))
- (cond
- ((eq onoff 'on)
- (setq res t)
- (or (member tag current) (push tag current)))
- ((eq onoff 'off)
- (or (not (member tag current)) (setq current (delete tag current))))
- (t (if (member tag current)
- (setq current (delete tag current))
- (setq res t)
- (push tag current))))
- (end-of-line 1)
- (if current
- (progn
- (insert " :" (mapconcat 'identity (nreverse current) ":") ":")
- (org-set-tags nil t))
- (delete-horizontal-space))
- (run-hooks 'org-after-tags-change-hook))
- res))
-
-(defun org-align-tags-here (to-col)
- ;; Assumes that this is a headline
- (let ((pos (point)) (col (current-column)) ncol tags-l p)
- (beginning-of-line 1)
- (if (and (looking-at (org-re ".*?\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$"))
- (< pos (match-beginning 2)))
- (progn
- (setq tags-l (- (match-end 2) (match-beginning 2)))
- (goto-char (match-beginning 1))
- (insert " ")
- (delete-region (point) (1+ (match-beginning 2)))
- (setq ncol (max (1+ (current-column))
- (1+ col)
- (if (> to-col 0)
- to-col
- (- (abs to-col) tags-l))))
- (setq p (point))
- (insert (make-string (- ncol (current-column)) ?\ ))
- (setq ncol (current-column))
- (when indent-tabs-mode (tabify p (point-at-eol)))
- (org-move-to-column (min ncol col) t))
- (goto-char pos))))
-
-(defun org-set-tags-command (&optional arg just-align)
- "Call the set-tags command for the current entry."
- (interactive "P")
- (if (org-on-heading-p)
- (org-set-tags arg just-align)
- (save-excursion
- (org-back-to-heading t)
- (org-set-tags arg just-align))))
-
-(defun org-set-tags-to (data)
- "Set the tags of the current entry to DATA, replacing the current tags.
-DATA may be a tags string like :aa:bb:cc:, or a list of tags.
-If DATA is nil or the empty string, any tags will be removed."
- (interactive "sTags: ")
- (setq data
- (cond
- ((eq data nil) "")
- ((equal data "") "")
- ((stringp data)
- (concat ":" (mapconcat 'identity (org-split-string data ":+") ":")
- ":"))
- ((listp data)
- (concat ":" (mapconcat 'identity data ":") ":"))
- (t nil)))
- (when data
- (save-excursion
- (org-back-to-heading t)
- (when (looking-at org-complex-heading-regexp)
- (if (match-end 5)
- (progn
- (goto-char (match-beginning 5))
- (insert data)
- (delete-region (point) (point-at-eol))
- (org-set-tags nil 'align))
- (goto-char (point-at-eol))
- (insert " " data)
- (org-set-tags nil 'align)))
- (beginning-of-line 1)
- (if (looking-at ".*?\\([ \t]+\\)$")
- (delete-region (match-beginning 1) (match-end 1))))))
-
-(defun org-align-all-tags ()
- "Align the tags i all headings."
- (interactive)
- (save-excursion
- (or (ignore-errors (org-back-to-heading t))
- (outline-next-heading))
- (if (org-on-heading-p)
- (org-set-tags t)
- (message "No headings"))))
-
-(defvar org-indent-indentation-per-level)
-(defun org-set-tags (&optional arg just-align)
- "Set the tags for the current headline.
-With prefix ARG, realign all tags in headings in the current buffer."
- (interactive "P")
- (let* ((re (concat "^" outline-regexp))
- (current (org-get-tags-string))
- (col (current-column))
- (org-setting-tags t)
- table current-tags inherited-tags ; computed below when needed
- tags p0 c0 c1 rpl di tc level)
- (if arg
- (save-excursion
- (goto-char (point-min))
- (let ((buffer-invisibility-spec (org-inhibit-invisibility)))
- (while (re-search-forward re nil t)
- (org-set-tags nil t)
- (end-of-line 1)))
- (message "All tags realigned to column %d" org-tags-column))
- (if just-align
- (setq tags current)
- ;; Get a new set of tags from the user
- (save-excursion
- (setq table (append org-tag-persistent-alist
- (or org-tag-alist (org-get-buffer-tags))
- (and
- org-complete-tags-always-offer-all-agenda-tags
- (org-global-tags-completion-table
- (org-agenda-files))))
- org-last-tags-completion-table table
- current-tags (org-split-string current ":")
- inherited-tags (nreverse
- (nthcdr (length current-tags)
- (nreverse (org-get-tags-at))))
- tags
- (if (or (eq t org-use-fast-tag-selection)
- (and org-use-fast-tag-selection
- (delq nil (mapcar 'cdr table))))
- (org-fast-tag-selection
- current-tags inherited-tags table
- (if org-fast-tag-selection-include-todo
- org-todo-key-alist))
- (let ((org-add-colon-after-tag-completion t))
- (org-trim
- (org-without-partial-completion
- (org-icompleting-read "Tags: "
- 'org-tags-completion-function
- nil nil current 'org-tags-history)))))))
- (while (string-match "[-+&]+" tags)
- ;; No boolean logic, just a list
- (setq tags (replace-match ":" t t tags))))
-
- (setq tags (replace-regexp-in-string "[ ,]" ":" tags))
-
- (if org-tags-sort-function
- (setq tags (mapconcat 'identity
- (sort (org-split-string
- tags (org-re "[^[:alnum:]_@#%]+"))
- org-tags-sort-function) ":")))
-
- (if (string-match "\\`[\t ]*\\'" tags)
- (setq tags "")
- (unless (string-match ":$" tags) (setq tags (concat tags ":")))
- (unless (string-match "^:" tags) (setq tags (concat ":" tags))))
-
- ;; Insert new tags at the correct column
- (beginning-of-line 1)
- (setq level (or (and (looking-at org-outline-regexp)
- (- (match-end 0) (point) 1))
- 1))
- (cond
- ((and (equal current "") (equal tags "")))
- ((re-search-forward
- (concat "\\([ \t]*" (regexp-quote current) "\\)[ \t]*$")
- (point-at-eol) t)
- (if (equal tags "")
- (setq rpl "")
- (goto-char (match-beginning 0))
- (setq c0 (current-column)
- ;; compute offset for the case of org-indent-mode active
- di (if org-indent-mode
- (* (1- org-indent-indentation-per-level) (1- level))
- 0)
- p0 (if (equal (char-before) ?*) (1+ (point)) (point))
- tc (+ org-tags-column (if (> org-tags-column 0) (- di) di))
- c1 (max (1+ c0) (if (> tc 0) tc (- (- tc) (length tags))))
- rpl (concat (make-string (max 0 (- c1 c0)) ?\ ) tags)))
- (replace-match rpl t t)
- (and (not (featurep 'xemacs)) c0 indent-tabs-mode (tabify p0 (point)))
- tags)
- (t (error "Tags alignment failed")))
- (org-move-to-column col)
- (unless just-align
- (run-hooks 'org-after-tags-change-hook)))))
-
-(defun org-change-tag-in-region (beg end tag off)
- "Add or remove TAG for each entry in the region.
-This works in the agenda, and also in an org-mode buffer."
- (interactive
- (list (region-beginning) (region-end)
- (let ((org-last-tags-completion-table
- (if (org-mode-p)
- (org-get-buffer-tags)
- (org-global-tags-completion-table))))
- (org-icompleting-read
- "Tag: " 'org-tags-completion-function nil nil nil
- 'org-tags-history))
- (progn
- (message "[s]et or [r]emove? ")
- (equal (read-char-exclusive) ?r))))
- (if (fboundp 'deactivate-mark) (deactivate-mark))
- (let ((agendap (equal major-mode 'org-agenda-mode))
- l1 l2 m buf pos newhead (cnt 0))
- (goto-char end)
- (setq l2 (1- (org-current-line)))
- (goto-char beg)
- (setq l1 (org-current-line))
- (loop for l from l1 to l2 do
- (org-goto-line l)
- (setq m (get-text-property (point) 'org-hd-marker))
- (when (or (and (org-mode-p) (org-on-heading-p))
- (and agendap m))
- (setq buf (if agendap (marker-buffer m) (current-buffer))
- pos (if agendap m (point)))
- (with-current-buffer buf
- (save-excursion
- (save-restriction
- (goto-char pos)
- (setq cnt (1+ cnt))
- (org-toggle-tag tag (if off 'off 'on))
- (setq newhead (org-get-heading)))))
- (and agendap (org-agenda-change-all-lines newhead m))))
- (message "Tag :%s: %s in %d headings" tag (if off "removed" "set") cnt)))
-
-(defun org-tags-completion-function (string predicate &optional flag)
- (let (s1 s2 rtn (ctable org-last-tags-completion-table)
- (confirm (lambda (x) (stringp (car x)))))
- (if (string-match "^\\(.*[-+:&,|]\\)\\([^-+:&,|]*\\)$" string)
- (setq s1 (match-string 1 string)
- s2 (match-string 2 string))
- (setq s1 "" s2 string))
- (cond
- ((eq flag nil)
- ;; try completion
- (setq rtn (try-completion s2 ctable confirm))
- (if (stringp rtn)
- (setq rtn
- (concat s1 s2 (substring rtn (length s2))
- (if (and org-add-colon-after-tag-completion
- (assoc rtn ctable))
- ":" ""))))
- rtn)
- ((eq flag t)
- ;; all-completions
- (all-completions s2 ctable confirm)
- )
- ((eq flag 'lambda)
- ;; exact match?
- (assoc s2 ctable)))
- ))
-
-(defun org-fast-tag-insert (kwd tags face &optional end)
- "Insert KDW, and the TAGS, the latter with face FACE. Also insert END."
- (insert (format "%-12s" (concat kwd ":"))
- (org-add-props (mapconcat 'identity tags " ") nil 'face face)
- (or end "")))
-
-(defun org-fast-tag-show-exit (flag)
- (save-excursion
- (org-goto-line 3)
- (if (re-search-forward "[ \t]+Next change exits" (point-at-eol) t)
- (replace-match ""))
- (when flag
- (end-of-line 1)
- (org-move-to-column (- (window-width) 19) t)
- (insert (org-add-props " Next change exits" nil 'face 'org-warning)))))
-
-(defun org-set-current-tags-overlay (current prefix)
- (let ((s (concat ":" (mapconcat 'identity current ":") ":")))
- (if (featurep 'xemacs)
- (org-overlay-display org-tags-overlay (concat prefix s)
- 'secondary-selection)
- (put-text-property 0 (length s) 'face '(secondary-selection org-tag) s)
- (org-overlay-display org-tags-overlay (concat prefix s)))))
-
-(defvar org-last-tag-selection-key nil)
-(defun org-fast-tag-selection (current inherited table &optional todo-table)
- "Fast tag selection with single keys.
-CURRENT is the current list of tags in the headline, INHERITED is the
-list of inherited tags, and TABLE is an alist of tags and corresponding keys,
-possibly with grouping information. TODO-TABLE is a similar table with
-TODO keywords, should these have keys assigned to them.
-If the keys are nil, a-z are automatically assigned.
-Returns the new tags string, or nil to not change the current settings."
- (let* ((fulltable (append table todo-table))
- (maxlen (apply 'max (mapcar
- (lambda (x)
- (if (stringp (car x)) (string-width (car x)) 0))
- fulltable)))
- (buf (current-buffer))
- (expert (eq org-fast-tag-selection-single-key 'expert))
- (buffer-tags nil)
- (fwidth (+ maxlen 3 1 3))
- (ncol (/ (- (window-width) 4) fwidth))
- (i-face 'org-done)
- (c-face 'org-todo)
- tg cnt e c char c1 c2 ntable tbl rtn
- ov-start ov-end ov-prefix
- (exit-after-next org-fast-tag-selection-single-key)
- (done-keywords org-done-keywords)
- groups ingroup)
- (save-excursion
- (beginning-of-line 1)
- (if (looking-at
- (org-re ".*[ \t]\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$"))
- (setq ov-start (match-beginning 1)
- ov-end (match-end 1)
- ov-prefix "")
- (setq ov-start (1- (point-at-eol))
- ov-end (1+ ov-start))
- (skip-chars-forward "^\n\r")
- (setq ov-prefix
- (concat
- (buffer-substring (1- (point)) (point))
- (if (> (current-column) org-tags-column)
- " "
- (make-string (- org-tags-column (current-column)) ?\ ))))))
- (move-overlay org-tags-overlay ov-start ov-end)
- (save-window-excursion
- (if expert
- (set-buffer (get-buffer-create " *Org tags*"))
- (delete-other-windows)
- (split-window-vertically)
- (org-switch-to-buffer-other-window (get-buffer-create " *Org tags*")))
- (erase-buffer)
- (org-set-local 'org-done-keywords done-keywords)
- (org-fast-tag-insert "Inherited" inherited i-face "\n")
- (org-fast-tag-insert "Current" current c-face "\n\n")
- (org-fast-tag-show-exit exit-after-next)
- (org-set-current-tags-overlay current ov-prefix)
- (setq tbl fulltable char ?a cnt 0)
- (while (setq e (pop tbl))
- (cond
- ((equal (car e) :startgroup)
- (push '() groups) (setq ingroup t)
- (when (not (= cnt 0))
- (setq cnt 0)
- (insert "\n"))
- (insert (if (cdr e) (format "%s: " (cdr e)) "") "{ "))
- ((equal (car e) :endgroup)
- (setq ingroup nil cnt 0)
- (insert "}" (if (cdr e) (format " (%s) " (cdr e)) "") "\n"))
- ((equal e '(:newline))
- (when (not (= cnt 0))
- (setq cnt 0)
- (insert "\n")
- (setq e (car tbl))
- (while (equal (car tbl) '(:newline))
- (insert "\n")
- (setq tbl (cdr tbl)))))
- (t
- (setq tg (copy-sequence (car e)) c2 nil)
- (if (cdr e)
- (setq c (cdr e))
- ;; automatically assign a character.
- (setq c1 (string-to-char
- (downcase (substring
- tg (if (= (string-to-char tg) ?@) 1 0)))))
- (if (or (rassoc c1 ntable) (rassoc c1 table))
- (while (or (rassoc char ntable) (rassoc char table))
- (setq char (1+ char)))
- (setq c2 c1))
- (setq c (or c2 char)))
- (if ingroup (push tg (car groups)))
- (setq tg (org-add-props tg nil 'face
- (cond
- ((not (assoc tg table))
- (org-get-todo-face tg))
- ((member tg current) c-face)
- ((member tg inherited) i-face)
- (t nil))))
- (if (and (= cnt 0) (not ingroup)) (insert " "))
- (insert "[" c "] " tg (make-string
- (- fwidth 4 (length tg)) ?\ ))
- (push (cons tg c) ntable)
- (when (= (setq cnt (1+ cnt)) ncol)
- (insert "\n")
- (if ingroup (insert " "))
- (setq cnt 0)))))
- (setq ntable (nreverse ntable))
- (insert "\n")
- (goto-char (point-min))
- (if (not expert) (org-fit-window-to-buffer))
- (setq rtn
- (catch 'exit
- (while t
- (message "[a-z..]:Toggle [SPC]:clear [RET]:accept [TAB]:free [!] %sgroups%s"
- (if (not groups) "no " "")
- (if expert " [C-c]:window" (if exit-after-next " [C-c]:single" " [C-c]:multi")))
- (setq c (let ((inhibit-quit t)) (read-char-exclusive)))
- (setq org-last-tag-selection-key c)
- (cond
- ((= c ?\r) (throw 'exit t))
- ((= c ?!)
- (setq groups (not groups))
- (goto-char (point-min))
- (while (re-search-forward "[{}]" nil t) (replace-match " ")))
- ((= c ?\C-c)
- (if (not expert)
- (org-fast-tag-show-exit
- (setq exit-after-next (not exit-after-next)))
- (setq expert nil)
- (delete-other-windows)
- (split-window-vertically)
- (org-switch-to-buffer-other-window " *Org tags*")
- (org-fit-window-to-buffer)))
- ((or (= c ?\C-g)
- (and (= c ?q) (not (rassoc c ntable))))
- (org-detach-overlay org-tags-overlay)
- (setq quit-flag t))
- ((= c ?\ )
- (setq current nil)
- (if exit-after-next (setq exit-after-next 'now)))
- ((= c ?\t)
- (condition-case nil
- (setq tg (org-icompleting-read
- "Tag: "
- (or buffer-tags
- (with-current-buffer buf
- (org-get-buffer-tags)))))
- (quit (setq tg "")))
- (when (string-match "\\S-" tg)
- (add-to-list 'buffer-tags (list tg))
- (if (member tg current)
- (setq current (delete tg current))
- (push tg current)))
- (if exit-after-next (setq exit-after-next 'now)))
- ((setq e (rassoc c todo-table) tg (car e))
- (with-current-buffer buf
- (save-excursion (org-todo tg)))
- (if exit-after-next (setq exit-after-next 'now)))
- ((setq e (rassoc c ntable) tg (car e))
- (if (member tg current)
- (setq current (delete tg current))
- (loop for g in groups do
- (if (member tg g)
- (mapc (lambda (x)
- (setq current (delete x current)))
- g)))
- (push tg current))
- (if exit-after-next (setq exit-after-next 'now))))
-
- ;; Create a sorted list
- (setq current
- (sort current
- (lambda (a b)
- (assoc b (cdr (memq (assoc a ntable) ntable))))))
- (if (eq exit-after-next 'now) (throw 'exit t))
- (goto-char (point-min))
- (beginning-of-line 2)
- (delete-region (point) (point-at-eol))
- (org-fast-tag-insert "Current" current c-face)
- (org-set-current-tags-overlay current ov-prefix)
- (while (re-search-forward
- (org-re "\\[.\\] \\([[:alnum:]_@#%]+\\)") nil t)
- (setq tg (match-string 1))
- (add-text-properties
- (match-beginning 1) (match-end 1)
- (list 'face
- (cond
- ((member tg current) c-face)
- ((member tg inherited) i-face)
- (t (get-text-property (match-beginning 1) 'face))))))
- (goto-char (point-min)))))
- (org-detach-overlay org-tags-overlay)
- (if rtn
- (mapconcat 'identity current ":")
- nil))))
-
-(defun org-get-tags-string ()
- "Get the TAGS string in the current headline."
- (unless (org-on-heading-p t)
- (error "Not on a heading"))
- (save-excursion
- (beginning-of-line 1)
- (if (looking-at (org-re ".*[ \t]\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$"))
- (org-match-string-no-properties 1)
- "")))
-
-(defun org-get-tags ()
- "Get the list of tags specified in the current headline."
- (org-split-string (org-get-tags-string) ":"))
-
-(defun org-get-buffer-tags ()
- "Get a table of all tags used in the buffer, for completion."
- (let (tags)
- (save-excursion
- (goto-char (point-min))
- (while (re-search-forward
- (org-re "[ \t]:\\([[:alnum:]_@#%:]+\\):[ \t\r\n]") nil t)
- (when (equal (char-after (point-at-bol 0)) ?*)
- (mapc (lambda (x) (add-to-list 'tags x))
- (org-split-string (org-match-string-no-properties 1) ":")))))
- (mapc (lambda (s) (add-to-list 'tags s)) org-file-tags)
- (mapcar 'list tags)))
-
-;;;; The mapping API
-
-;;;###autoload
-(defun org-map-entries (func &optional match scope &rest skip)
- "Call FUNC at each headline selected by MATCH in SCOPE.
-
-FUNC is a function or a lisp form. The function will be called without
-arguments, with the cursor positioned at the beginning of the headline.
-The return values of all calls to the function will be collected and
-returned as a list.
-
-The call to FUNC will be wrapped into a save-excursion form, so FUNC
-does not need to preserve point. After evaluation, the cursor will be
-moved to the end of the line (presumably of the headline of the
-processed entry) and search continues from there. Under some
-circumstances, this may not produce the wanted results. For example,
-if you have removed (e.g. archived) the current (sub)tree it could
-mean that the next entry will be skipped entirely. In such cases, you
-can specify the position from where search should continue by making
-FUNC set the variable `org-map-continue-from' to the desired buffer
-position.
-
-MATCH is a tags/property/todo match as it is used in the agenda tags view.
-Only headlines that are matched by this query will be considered during
-the iteration. When MATCH is nil or t, all headlines will be
-visited by the iteration.
-
-SCOPE determines the scope of this command. It can be any of:
-
-nil The current buffer, respecting the restriction if any
-tree The subtree started with the entry at point
-file The current buffer, without restriction
-file-with-archives
- The current buffer, and any archives associated with it
-agenda All agenda files
-agenda-with-archives
- All agenda files with any archive files associated with them
-\(file1 file2 ...)
- If this is a list, all files in the list will be scanned
-
-The remaining args are treated as settings for the skipping facilities of
-the scanner. The following items can be given here:
-
- archive skip trees with the archive tag.
- comment skip trees with the COMMENT keyword
- function or Emacs Lisp form:
- will be used as value for `org-agenda-skip-function', so whenever
- the function returns t, FUNC will not be called for that
- entry and search will continue from the point where the
- function leaves it.
-
-If your function needs to retrieve the tags including inherited tags
-at the *current* entry, you can use the value of the variable
-`org-scanner-tags' which will be much faster than getting the value
-with `org-get-tags-at'. If your function gets properties with
-`org-entry-properties' at the *current* entry, bind `org-trust-scanner-tags'
-to t around the call to `org-entry-properties' to get the same speedup.
-Note that if your function moves around to retrieve tags and properties at
-a *different* entry, you cannot use these techniques."
- (let* ((org-agenda-archives-mode nil) ; just to make sure
- (org-agenda-skip-archived-trees (memq 'archive skip))
- (org-agenda-skip-comment-trees (memq 'comment skip))
- (org-agenda-skip-function
- (car (org-delete-all '(comment archive) skip)))
- (org-tags-match-list-sublevels t)
- matcher file res
- org-todo-keywords-for-agenda
- org-done-keywords-for-agenda
- org-todo-keyword-alist-for-agenda
- org-drawers-for-agenda
- org-tag-alist-for-agenda)
-
- (cond
- ((eq match t) (setq matcher t))
- ((eq match nil) (setq matcher t))
- (t (setq matcher (if match (cdr (org-make-tags-matcher match)) t))))
-
- (save-excursion
- (save-restriction
- (when (eq scope 'tree)
- (org-back-to-heading t)
- (org-narrow-to-subtree)
- (setq scope nil))
-
- (if (not scope)
- (progn
- (org-prepare-agenda-buffers
- (list (buffer-file-name (current-buffer))))
- (setq res (org-scan-tags func matcher)))
- ;; Get the right scope
- (cond
- ((and scope (listp scope) (symbolp (car scope)))
- (setq scope (eval scope)))
- ((eq scope 'agenda)
- (setq scope (org-agenda-files t)))
- ((eq scope 'agenda-with-archives)
- (setq scope (org-agenda-files t))
- (setq scope (org-add-archive-files scope)))
- ((eq scope 'file)
- (setq scope (list (buffer-file-name))))
- ((eq scope 'file-with-archives)
- (setq scope (org-add-archive-files (list (buffer-file-name))))))
- (org-prepare-agenda-buffers scope)
- (while (setq file (pop scope))
- (with-current-buffer (org-find-base-buffer-visiting file)
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (setq res (append res (org-scan-tags func matcher))))))))))
- res))
-
-;;;; Properties
-
-;;; Setting and retrieving properties
-
-(defconst org-special-properties
- '("TODO" "TAGS" "ALLTAGS" "DEADLINE" "SCHEDULED" "CLOCK" "CLOSED" "PRIORITY"
- "TIMESTAMP" "TIMESTAMP_IA" "BLOCKED")
- "The special properties valid in Org-mode.
-
-These are properties that are not defined in the property drawer,
-but in some other way.")
-
-(defconst org-default-properties
- '("ARCHIVE" "CATEGORY" "SUMMARY" "DESCRIPTION" "CUSTOM_ID"
- "LOCATION" "LOGGING" "COLUMNS" "VISIBILITY"
- "TABLE_EXPORT_FORMAT" "TABLE_EXPORT_FILE"
- "EXPORT_FILE_NAME" "EXPORT_TITLE" "EXPORT_AUTHOR" "EXPORT_DATE"
- "ORDERED" "NOBLOCKING" "COOKIE_DATA" "LOG_INTO_DRAWER" "REPEAT_TO_STATE"
- "CLOCK_MODELINE_TOTAL" "STYLE" "HTML_CONTAINER_CLASS")
- "Some properties that are used by Org-mode for various purposes.
-Being in this list makes sure that they are offered for completion.")
-
-(defconst org-property-start-re "^[ \t]*:PROPERTIES:[ \t]*$"
- "Regular expression matching the first line of a property drawer.")
-
-(defconst org-property-end-re "^[ \t]*:END:[ \t]*$"
- "Regular expression matching the last line of a property drawer.")
-
-(defconst org-clock-drawer-start-re "^[ \t]*:CLOCK:[ \t]*$"
- "Regular expression matching the first line of a property drawer.")
-
-(defconst org-clock-drawer-end-re "^[ \t]*:END:[ \t]*$"
- "Regular expression matching the first line of a property drawer.")
-
-(defconst org-property-drawer-re
- (concat "\\(" org-property-start-re "\\)[^\000]*\\("
- org-property-end-re "\\)\n?")
- "Matches an entire property drawer.")
-
-(defconst org-clock-drawer-re
- (concat "\\(" org-clock-drawer-start-re "\\)[^\000]*\\("
- org-property-end-re "\\)\n?")
- "Matches an entire clock drawer.")
-
-(defun org-property-action ()
- "Do an action on properties."
- (interactive)
- (let (c)
- (org-at-property-p)
- (message "Property Action: [s]et [d]elete [D]elete globally [c]ompute")
- (setq c (read-char-exclusive))
- (cond
- ((equal c ?s)
- (call-interactively 'org-set-property))
- ((equal c ?d)
- (call-interactively 'org-delete-property))
- ((equal c ?D)
- (call-interactively 'org-delete-property-globally))
- ((equal c ?c)
- (call-interactively 'org-compute-property-at-point))
- (t (error "No such property action %c" c)))))
-
-(defun org-set-effort (&optional value)
- "Set the effort property of the current entry.
-With numerical prefix arg, use the nth allowed value, 0 stands for the 10th
-allowed value."
- (interactive "P")
- (if (equal value 0) (setq value 10))
- (let* ((completion-ignore-case t)
- (prop org-effort-property)
- (cur (org-entry-get nil prop))
- (allowed (org-property-get-allowed-values nil prop 'table))
- (existing (mapcar 'list (org-property-values prop)))
- rpl
- (val (cond
- ((stringp value) value)
- ((and allowed (integerp value))
- (or (car (nth (1- value) allowed))
- (car (org-last allowed))))
- (allowed
- (message "Select 1-9,0, [RET%s]: %s"
- (if cur (concat "=" cur) "")
- (mapconcat 'car allowed " "))
- (setq rpl (read-char-exclusive))
- (if (equal rpl ?\r)
- cur
- (setq rpl (- rpl ?0))
- (if (equal rpl 0) (setq rpl 10))
- (if (and (> rpl 0) (<= rpl (length allowed)))
- (car (nth (1- rpl) allowed))
- (org-completing-read "Effort: " allowed nil))))
- (t
- (let (org-completion-use-ido org-completion-use-iswitchb)
- (org-completing-read
- (concat "Effort " (if (and cur (string-match "\\S-" cur))
- (concat "[" cur "]") "")
- ": ")
- existing nil nil "" nil cur))))))
- (unless (equal (org-entry-get nil prop) val)
- (org-entry-put nil prop val))
- (message "%s is now %s" prop val)))
-
-(defun org-at-property-p ()
- "Is cursor inside a property drawer?"
- (save-excursion
- (beginning-of-line 1)
- (when (looking-at (org-re "^[ \t]*\\(:\\([[:alpha:]][[:alnum:]_-]*\\):\\)[ \t]*\\(.*\\)"))
- (save-match-data ;; Used by calling procedures
- (let ((p (point))
- (range (unless (org-before-first-heading-p)
- (org-get-property-block))))
- (and range (<= (car range) p) (< p (cdr range))))))))
-
-(defun org-get-property-block (&optional beg end force)
- "Return the (beg . end) range of the body of the property drawer.
-BEG and END can be beginning and end of subtree, if not given
-they will be found.
-If the drawer does not exist and FORCE is non-nil, create the drawer."
- (catch 'exit
- (save-excursion
- (let* ((beg (or beg (progn (org-back-to-heading t) (point))))
- (end (or end (progn (outline-next-heading) (point)))))
- (goto-char beg)
- (if (re-search-forward org-property-start-re end t)
- (setq beg (1+ (match-end 0)))
- (if force
- (save-excursion
- (org-insert-property-drawer)
- (setq end (progn (outline-next-heading) (point))))
- (throw 'exit nil))
- (goto-char beg)
- (if (re-search-forward org-property-start-re end t)
- (setq beg (1+ (match-end 0)))))
- (if (re-search-forward org-property-end-re end t)
- (setq end (match-beginning 0))
- (or force (throw 'exit nil))
- (goto-char beg)
- (setq end beg)
- (org-indent-line-function)
- (insert ":END:\n"))
- (cons beg end)))))
-
-(defun org-entry-properties (&optional pom which specific)
- "Get all properties of the entry at point-or-marker POM.
-This includes the TODO keyword, the tags, time strings for deadline,
-scheduled, and clocking, and any additional properties defined in the
-entry. The return value is an alist, keys may occur multiple times
-if the property key was used several times.
-POM may also be nil, in which case the current entry is used.
-If WHICH is nil or `all', get all properties. If WHICH is
-`special' or `standard', only get that subclass. If WHICH
-is a string only get exactly this property. SPECIFIC can be a string, the
-specific property we are interested in. Specifying it can speed
-things up because then unnecessary parsing is avoided."
- (setq which (or which 'all))
- (org-with-point-at pom
- (let ((clockstr (substring org-clock-string 0 -1))
- (excluded '("TODO" "TAGS" "ALLTAGS" "PRIORITY" "BLOCKED"))
- (case-fold-search nil)
- beg end range props sum-props key key1 value string clocksum)
- (save-excursion
- (when (condition-case nil
- (and (org-mode-p) (org-back-to-heading t))
- (error nil))
- (setq beg (point))
- (setq sum-props (get-text-property (point) 'org-summaries))
- (setq clocksum (get-text-property (point) :org-clock-minutes))
- (outline-next-heading)
- (setq end (point))
- (when (memq which '(all special))
- ;; Get the special properties, like TODO and tags
- (goto-char beg)
- (when (and (or (not specific) (string= specific "TODO"))
- (looking-at org-todo-line-regexp) (match-end 2))
- (push (cons "TODO" (org-match-string-no-properties 2)) props))
- (when (and (or (not specific) (string= specific "PRIORITY"))
- (looking-at org-priority-regexp))
- (push (cons "PRIORITY" (org-match-string-no-properties 2)) props))
- (when (and (or (not specific) (string= specific "TAGS"))
- (setq value (org-get-tags-string))
- (string-match "\\S-" value))
- (push (cons "TAGS" value) props))
- (when (and (or (not specific) (string= specific "ALLTAGS"))
- (setq value (org-get-tags-at)))
- (push (cons "ALLTAGS" (concat ":" (mapconcat 'identity value ":")
- ":"))
- props))
- (when (or (not specific) (string= specific "BLOCKED"))
- (push (cons "BLOCKED" (if (org-entry-blocked-p) "t" "")) props))
- (when (or (not specific)
- (member specific
- '("SCHEDULED" "DEADLINE" "CLOCK" "CLOSED"
- "TIMESTAMP" "TIMESTAMP_IA")))
- (while (re-search-forward org-maybe-keyword-time-regexp end t)
- (setq key (if (match-end 1)
- (substring (org-match-string-no-properties 1)
- 0 -1))
- string (if (equal key clockstr)
- (org-no-properties
- (org-trim
- (buffer-substring
- (match-beginning 3) (goto-char
- (point-at-eol)))))
- (substring (org-match-string-no-properties 3)
- 1 -1)))
- ;; Get the correct property name from the key. This is
- ;; necessary if the user has configured time keywords.
- (setq key1 (concat key ":"))
- (cond
- ((not key)
- (setq key
- (if (= (char-after (match-beginning 3)) ?\[)
- "TIMESTAMP_IA" "TIMESTAMP")))
- ((equal key1 org-scheduled-string) (setq key "SCHEDULED"))
- ((equal key1 org-deadline-string) (setq key "DEADLINE"))
- ((equal key1 org-closed-string) (setq key "CLOSED"))
- ((equal key1 org-clock-string) (setq key "CLOCK")))
- (when (or (equal key "CLOCK") (not (assoc key props)))
- (push (cons key string) props))))
- )
-
- (when (memq which '(all standard))
- ;; Get the standard properties, like :PROP: ...
- (setq range (org-get-property-block beg end))
- (when range
- (goto-char (car range))
- (while (re-search-forward
- (org-re "^[ \t]*:\\([[:alpha:]][[:alnum:]_-]*\\):[ \t]*\\(\\S-.*\\)?")
- (cdr range) t)
- (setq key (org-match-string-no-properties 1)
- value (org-trim (or (org-match-string-no-properties 2) "")))
- (unless (member key excluded)
- (push (cons key (or value "")) props)))))
- (if clocksum
- (push (cons "CLOCKSUM"
- (org-columns-number-to-string (/ (float clocksum) 60.)
- 'add_times))
- props))
- (unless (assoc "CATEGORY" props)
- (setq value (or (org-get-category)
- (progn (org-refresh-category-properties)
- (org-get-category))))
- (push (cons "CATEGORY" value) props))
- (append sum-props (nreverse props)))))))
-
-(defun org-entry-get (pom property &optional inherit literal-nil)
- "Get value of PROPERTY for entry at point-or-marker POM.
-If INHERIT is non-nil and the entry does not have the property,
-then also check higher levels of the hierarchy.
-If INHERIT is the symbol `selective', use inheritance only if the setting
-in `org-use-property-inheritance' selects PROPERTY for inheritance.
-If the property is present but empty, the return value is the empty string.
-If the property is not present at all, nil is returned.
-
-If LITERAL-NIL is set, return the string value \"nil\" as a string,
-do not interpret it as the list atom nil. This is used for inheritance
-when a \"nil\" value can supersede a non-nil value higher up the hierarchy."
- (org-with-point-at pom
- (if (and inherit (if (eq inherit 'selective)
- (org-property-inherit-p property)
- t))
- (org-entry-get-with-inheritance property literal-nil)
- (if (member property org-special-properties)
- ;; We need a special property. Use `org-entry-properties' to
- ;; retrieve it, but specify the wanted property
- (cdr (assoc property (org-entry-properties nil 'special property)))
- (let ((range (org-get-property-block)))
- (if (and range
- (goto-char (car range))
- (re-search-forward
- (concat "^[ \t]*:" property ":[ \t]*\\(.*[^ \t\r\n\f\v]\\)?")
- (cdr range) t))
- ;; Found the property, return it.
- (if (match-end 1)
- (if literal-nil
- (org-match-string-no-properties 1)
- (org-not-nil (org-match-string-no-properties 1)))
- "")))))))
-
-(defun org-property-or-variable-value (var &optional inherit)
- "Check if there is a property fixing the value of VAR.
-If yes, return this value. If not, return the current value of the variable."
- (let ((prop (org-entry-get nil (symbol-name var) inherit)))
- (if (and prop (stringp prop) (string-match "\\S-" prop))
- (read prop)
- (symbol-value var))))
-
-(defun org-entry-delete (pom property)
- "Delete the property PROPERTY from entry at point-or-marker POM."
- (org-with-point-at pom
- (if (member property org-special-properties)
- nil ; cannot delete these properties.
- (let ((range (org-get-property-block)))
- (if (and range
- (goto-char (car range))
- (re-search-forward
- (concat "^[ \t]*:" property ":[ \t]*\\(.*[^ \t\r\n\f\v]\\)")
- (cdr range) t))
- (progn
- (delete-region (match-beginning 0) (1+ (point-at-eol)))
- t)
- nil)))))
-
-;; Multi-values properties are properties that contain multiple values
-;; These values are assumed to be single words, separated by whitespace.
-(defun org-entry-add-to-multivalued-property (pom property value)
- "Add VALUE to the words in the PROPERTY in entry at point-or-marker POM."
- (let* ((old (org-entry-get pom property))
- (values (and old (org-split-string old "[ \t]"))))
- (setq value (org-entry-protect-space value))
- (unless (member value values)
- (setq values (cons value values))
- (org-entry-put pom property
- (mapconcat 'identity values " ")))))
-
-(defun org-entry-remove-from-multivalued-property (pom property value)
- "Remove VALUE from words in the PROPERTY in entry at point-or-marker POM."
- (let* ((old (org-entry-get pom property))
- (values (and old (org-split-string old "[ \t]"))))
- (setq value (org-entry-protect-space value))
- (when (member value values)
- (setq values (delete value values))
- (org-entry-put pom property
- (mapconcat 'identity values " ")))))
-
-(defun org-entry-member-in-multivalued-property (pom property value)
- "Is VALUE one of the words in the PROPERTY in entry at point-or-marker POM?"
- (let* ((old (org-entry-get pom property))
- (values (and old (org-split-string old "[ \t]"))))
- (setq value (org-entry-protect-space value))
- (member value values)))
-
-(defun org-entry-get-multivalued-property (pom property)
- "Return a list of values in a multivalued property."
- (let* ((value (org-entry-get pom property))
- (values (and value (org-split-string value "[ \t]"))))
- (mapcar 'org-entry-restore-space values)))
-
-(defun org-entry-put-multivalued-property (pom property &rest values)
- "Set multivalued PROPERTY at point-or-marker POM to VALUES.
-VALUES should be a list of strings. Spaces will be protected."
- (org-entry-put pom property
- (mapconcat 'org-entry-protect-space values " "))
- (let* ((value (org-entry-get pom property))
- (values (and value (org-split-string value "[ \t]"))))
- (mapcar 'org-entry-restore-space values)))
-
-(defun org-entry-protect-space (s)
- "Protect spaces and newline in string S."
- (while (string-match " " s)
- (setq s (replace-match "%20" t t s)))
- (while (string-match "\n" s)
- (setq s (replace-match "%0A" t t s)))
- s)
-
-(defun org-entry-restore-space (s)
- "Restore spaces and newline in string S."
- (while (string-match "%20" s)
- (setq s (replace-match " " t t s)))
- (while (string-match "%0A" s)
- (setq s (replace-match "\n" t t s)))
- s)
-
-(defvar org-entry-property-inherited-from (make-marker)
- "Marker pointing to the entry from where a property was inherited.
-Each call to `org-entry-get-with-inheritance' will set this marker to the
-location of the entry where the inheritance search matched. If there was
-no match, the marker will point nowhere.
-Note that also `org-entry-get' calls this function, if the INHERIT flag
-is set.")
-
-(defun org-entry-get-with-inheritance (property &optional literal-nil)
- "Get entry property, and search higher levels if not present.
-The search will stop at the first ancestor which has the property defined.
-If the value found is \"nil\", return nil to show that the property
-should be considered as undefined (this is the meaning of nil here).
-However, if LITERAL-NIL is set, return the string value \"nil\" instead."
- (move-marker org-entry-property-inherited-from nil)
- (let (tmp)
- (save-excursion
- (save-restriction
- (widen)
- (catch 'ex
- (while t
- (when (setq tmp (org-entry-get nil property nil 'literal-nil))
- (org-back-to-heading t)
- (move-marker org-entry-property-inherited-from (point))
- (throw 'ex tmp))
- (or (org-up-heading-safe) (throw 'ex nil)))))
- (setq tmp (or tmp
- (cdr (assoc property org-file-properties))
- (cdr (assoc property org-global-properties))
- (cdr (assoc property org-global-properties-fixed))))
- (if literal-nil tmp (org-not-nil tmp)))))
-
-(defvar org-property-changed-functions nil
- "Hook called when the value of a property has changed.
-Each hook function should accept two arguments, the name of the property
-and the new value.")
-
-(defun org-entry-put (pom property value)
- "Set PROPERTY to VALUE for entry at point-or-marker POM."
- (org-with-point-at pom
- (org-back-to-heading t)
- (let ((beg (point)) (end (save-excursion (outline-next-heading) (point)))
- range)
- (cond
- ((equal property "TODO")
- (when (and (stringp value) (string-match "\\S-" value)
- (not (member value org-todo-keywords-1)))
- (error "\"%s\" is not a valid TODO state" value))
- (if (or (not value)
- (not (string-match "\\S-" value)))
- (setq value 'none))
- (org-todo value)
- (org-set-tags nil 'align))
- ((equal property "PRIORITY")
- (org-priority (if (and value (stringp value) (string-match "\\S-" value))
- (string-to-char value) ?\ ))
- (org-set-tags nil 'align))
- ((equal property "SCHEDULED")
- (if (re-search-forward org-scheduled-time-regexp end t)
- (cond
- ((eq value 'earlier) (org-timestamp-change -1 'day))
- ((eq value 'later) (org-timestamp-change 1 'day))
- (t (call-interactively 'org-schedule)))
- (call-interactively 'org-schedule)))
- ((equal property "DEADLINE")
- (if (re-search-forward org-deadline-time-regexp end t)
- (cond
- ((eq value 'earlier) (org-timestamp-change -1 'day))
- ((eq value 'later) (org-timestamp-change 1 'day))
- (t (call-interactively 'org-deadline)))
- (call-interactively 'org-deadline)))
- ((member property org-special-properties)
- (error "The %s property can not yet be set with `org-entry-put'"
- property))
- (t ; a non-special property
- (let ((buffer-invisibility-spec (org-inhibit-invisibility))) ; Emacs 21
- (setq range (org-get-property-block beg end 'force))
- (goto-char (car range))
- (if (re-search-forward
- (concat "^[ \t]*:" property ":\\(.*\\)") (cdr range) t)
- (progn
- (delete-region (match-beginning 1) (match-end 1))
- (goto-char (match-beginning 1)))
- (goto-char (cdr range))
- (insert "\n")
- (backward-char 1)
- (org-indent-line-function)
- (insert ":" property ":"))
- (and value (insert " " value))
- (org-indent-line-function)))))
- (run-hook-with-args 'org-property-changed-functions property value)))
-
-(defun org-buffer-property-keys (&optional include-specials include-defaults include-columns)
- "Get all property keys in the current buffer.
-With INCLUDE-SPECIALS, also list the special properties that reflect things
-like tags and TODO state.
-With INCLUDE-DEFAULTS, also include properties that has special meaning
-internally: ARCHIVE, CATEGORY, SUMMARY, DESCRIPTION, LOCATION, and LOGGING.
-With INCLUDE-COLUMNS, also include property names given in COLUMN
-formats in the current buffer."
- (let (rtn range cfmt s p)
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (while (re-search-forward org-property-start-re nil t)
- (setq range (org-get-property-block))
- (goto-char (car range))
- (while (re-search-forward
- (org-re "^[ \t]*:\\([-[:alnum:]_]+\\):")
- (cdr range) t)
- (add-to-list 'rtn (org-match-string-no-properties 1)))
- (outline-next-heading))))
-
- (when include-specials
- (setq rtn (append org-special-properties rtn)))
-
- (when include-defaults
- (mapc (lambda (x) (add-to-list 'rtn x)) org-default-properties)
- (add-to-list 'rtn org-effort-property))
-
- (when include-columns
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (while (re-search-forward
- "^\\(#\\+COLUMNS:\\|[ \t]*:COLUMNS:\\)[ \t]*\\(.*\\)"
- nil t)
- (setq cfmt (match-string 2) s 0)
- (while (string-match (org-re "%[0-9]*\\([-[:alnum:]_]+\\)")
- cfmt s)
- (setq s (match-end 0)
- p (match-string 1 cfmt))
- (unless (or (equal p "ITEM")
- (member p org-special-properties))
- (add-to-list 'rtn (match-string 1 cfmt))))))))
-
- (sort rtn (lambda (a b) (string< (upcase a) (upcase b))))))
-
-(defun org-property-values (key)
- "Return a list of all values of property KEY."
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (let ((re (concat "^[ \t]*:" key ":[ \t]*\\(\\S-.*\\)"))
- values)
- (while (re-search-forward re nil t)
- (add-to-list 'values (org-trim (match-string 1))))
- (delete "" values)))))
-
-(defun org-insert-property-drawer ()
- "Insert a property drawer into the current entry."
- (interactive)
- (org-back-to-heading t)
- (looking-at outline-regexp)
- (let ((indent (if org-adapt-indentation
- (- (match-end 0)(match-beginning 0))
- 0))
- (beg (point))
- (re (concat "^[ \t]*" org-keyword-time-regexp))
- end hiddenp)
- (outline-next-heading)
- (setq end (point))
- (goto-char beg)
- (while (re-search-forward re end t))
- (setq hiddenp (org-invisible-p))
- (end-of-line 1)
- (and (equal (char-after) ?\n) (forward-char 1))
- (while (looking-at "^[ \t]*\\(:CLOCK:\\|:LOGBOOK:\\|CLOCK:\\|:END:\\)")
- (if (member (match-string 1) '("CLOCK:" ":END:"))
- ;; just skip this line
- (beginning-of-line 2)
- ;; Drawer start, find the end
- (re-search-forward "^\\*+ \\|^[ \t]*:END:" nil t)
- (beginning-of-line 1)))
- (org-skip-over-state-notes)
- (skip-chars-backward " \t\n\r")
- (if (eq (char-before) ?*) (forward-char 1))
- (let ((inhibit-read-only t)) (insert "\n:PROPERTIES:\n:END:"))
- (beginning-of-line 0)
- (org-indent-to-column indent)
- (beginning-of-line 2)
- (org-indent-to-column indent)
- (beginning-of-line 0)
- (if hiddenp
- (save-excursion
- (org-back-to-heading t)
- (hide-entry))
- (org-flag-drawer t))))
-
-(defun org-set-property (property value)
- "In the current entry, set PROPERTY to VALUE.
-When called interactively, this will prompt for a property name, offering
-completion on existing and default properties. And then it will prompt
-for a value, offering completion either on allowed values (via an inherited
-xxx_ALL property) or on existing values in other instances of this property
-in the current file."
- (interactive
- (let* ((completion-ignore-case t)
- (keys (org-buffer-property-keys nil t t))
- (prop0 (org-icompleting-read "Property: " (mapcar 'list keys)))
- (prop (if (member prop0 keys)
- prop0
- (or (cdr (assoc (downcase prop0)
- (mapcar (lambda (x) (cons (downcase x) x))
- keys)))
- prop0)))
- (cur (org-entry-get nil prop))
- (prompt (concat prop " value"
- (if (and cur (string-match "\\S-" cur))
- (concat " [" cur "]") "") ": "))
- (allowed (org-property-get-allowed-values nil prop 'table))
- (existing (mapcar 'list (org-property-values prop)))
- (val (if allowed
- (org-completing-read prompt allowed nil
- (not (get-text-property 0 'org-unrestricted
- (caar allowed))))
- (let (org-completion-use-ido org-completion-use-iswitchb)
- (org-completing-read prompt existing nil nil "" nil cur)))))
- (list prop (if (equal val "") cur val))))
- (unless (equal (org-entry-get nil property) value)
- (org-entry-put nil property value)))
-
-(defun org-delete-property (property)
- "In the current entry, delete PROPERTY."
- (interactive
- (let* ((completion-ignore-case t)
- (prop (org-icompleting-read "Property: "
- (org-entry-properties nil 'standard))))
- (list prop)))
- (message "Property %s %s" property
- (if (org-entry-delete nil property)
- "deleted"
- "was not present in the entry")))
-
-(defun org-delete-property-globally (property)
- "Remove PROPERTY globally, from all entries."
- (interactive
- (let* ((completion-ignore-case t)
- (prop (org-icompleting-read
- "Globally remove property: "
- (mapcar 'list (org-buffer-property-keys)))))
- (list prop)))
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (let ((cnt 0))
- (while (re-search-forward
- (concat "^[ \t]*:" (regexp-quote property) ":.*\n?")
- nil t)
- (setq cnt (1+ cnt))
- (replace-match ""))
- (message "Property \"%s\" removed from %d entries" property cnt)))))
-
-(defvar org-columns-current-fmt-compiled) ; defined in org-colview.el
-
-(defun org-compute-property-at-point ()
- "Compute the property at point.
-This looks for an enclosing column format, extracts the operator and
-then applies it to the property in the column format's scope."
- (interactive)
- (unless (org-at-property-p)
- (error "Not at a property"))
- (let ((prop (org-match-string-no-properties 2)))
- (org-columns-get-format-and-top-level)
- (unless (nth 3 (assoc prop org-columns-current-fmt-compiled))
- (error "No operator defined for property %s" prop))
- (org-columns-compute prop)))
-
-(defvar org-property-allowed-value-functions nil
- "Hook for functions supplying allowed values for a specific property.
-The functions must take a single argument, the name of the property, and
-return a flat list of allowed values. If \":ETC\" is one of
-the values, this means that these values are intended as defaults for
-completion, but that other values should be allowed too.
-The functions must return nil if they are not responsible for this
-property.")
-
-(defun org-property-get-allowed-values (pom property &optional table)
- "Get allowed values for the property PROPERTY.
-When TABLE is non-nil, return an alist that can directly be used for
-completion."
- (let (vals)
- (cond
- ((equal property "TODO")
- (setq vals (org-with-point-at pom
- (append org-todo-keywords-1 '("")))))
- ((equal property "PRIORITY")
- (let ((n org-lowest-priority))
- (while (>= n org-highest-priority)
- (push (char-to-string n) vals)
- (setq n (1- n)))))
- ((member property org-special-properties))
- ((setq vals (run-hook-with-args-until-success
- 'org-property-allowed-value-functions property)))
- (t
- (setq vals (org-entry-get pom (concat property "_ALL") 'inherit))
- (when (and vals (string-match "\\S-" vals))
- (setq vals (car (read-from-string (concat "(" vals ")"))))
- (setq vals (mapcar (lambda (x)
- (cond ((stringp x) x)
- ((numberp x) (number-to-string x))
- ((symbolp x) (symbol-name x))
- (t "???")))
- vals)))))
- (when (member ":ETC" vals)
- (setq vals (remove ":ETC" vals))
- (org-add-props (car vals) '(org-unrestricted t)))
- (if table (mapcar 'list vals) vals)))
-
-(defun org-property-previous-allowed-value (&optional previous)
- "Switch to the next allowed value for this property."
- (interactive)
- (org-property-next-allowed-value t))
-
-(defun org-property-next-allowed-value (&optional previous)
- "Switch to the next allowed value for this property."
- (interactive)
- (unless (org-at-property-p)
- (error "Not at a property"))
- (let* ((key (match-string 2))
- (value (match-string 3))
- (allowed (or (org-property-get-allowed-values (point) key)
- (and (member value '("[ ]" "[-]" "[X]"))
- '("[ ]" "[X]"))))
- nval)
- (unless allowed
- (error "Allowed values for this property have not been defined"))
- (if previous (setq allowed (reverse allowed)))
- (if (member value allowed)
- (setq nval (car (cdr (member value allowed)))))
- (setq nval (or nval (car allowed)))
- (if (equal nval value)
- (error "Only one allowed value for this property"))
- (org-at-property-p)
- (replace-match (concat " :" key ": " nval) t t)
- (org-indent-line-function)
- (beginning-of-line 1)
- (skip-chars-forward " \t")
- (run-hook-with-args 'org-property-changed-functions key nval)))
-
-(defun org-find-olp (path &optional this-buffer)
- "Return a marker pointing to the entry at outline path OLP.
-If anything goes wrong, throw an error.
-You can wrap this call to catch the error like this:
-
- (condition-case msg
- (org-mobile-locate-entry (match-string 4))
- (error (nth 1 msg)))
-
-The return value will then be either a string with the error message,
-or a marker if everything is OK.
-
-If THIS-BUFFER is set, the outline path does not contain a file,
-only headings."
- (let* ((file (if this-buffer buffer-file-name (pop path)))
- (buffer (if this-buffer (current-buffer) (find-file-noselect file)))
- (level 1)
- (lmin 1)
- (lmax 1)
- limit re end found pos heading cnt)
- (unless buffer (error "File not found :%s" file))
- (with-current-buffer buffer
- (save-excursion
- (save-restriction
- (widen)
- (setq limit (point-max))
- (goto-char (point-min))
- (while (setq heading (pop path))
- (setq re (format org-complex-heading-regexp-format
- (regexp-quote heading)))
- (setq cnt 0 pos (point))
- (while (re-search-forward re end t)
- (setq level (- (match-end 1) (match-beginning 1)))
- (if (and (>= level lmin) (<= level lmax))
- (setq found (match-beginning 0) cnt (1+ cnt))))
- (when (= cnt 0) (error "Heading not found on level %d: %s"
- lmax heading))
- (when (> cnt 1) (error "Heading not unique on level %d: %s"
- lmax heading))
- (goto-char found)
- (setq lmin (1+ level) lmax (+ lmin (if org-odd-levels-only 1 0)))
- (setq end (save-excursion (org-end-of-subtree t t))))
- (when (org-on-heading-p)
- (move-marker (make-marker) (point))))))))
-
-(defun org-find-exact-headline-in-buffer (heading &optional buffer pos-only)
- "Find node HEADING in BUFFER.
-Return a marker to the heading if it was found, or nil if not.
-If POS-ONLY is set, return just the position instead of a marker.
-
-The heading text must match exact, but it may have a TODO keyword,
-a priority cookie and tags in the standard locations."
- (with-current-buffer (or buffer (current-buffer))
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (let (case-fold-search)
- (if (re-search-forward
- (format org-complex-heading-regexp-format
- (regexp-quote heading)) nil t)
- (if pos-only
- (match-beginning 0)
- (move-marker (make-marker) (match-beginning 0)))))))))
-
-(defun org-find-exact-heading-in-directory (heading &optional dir)
- "Find Org node headline HEADING in all .org files in directory DIR.
-When the target headline is found, return a marker to this location."
- (let ((files (directory-files (or dir default-directory)
- nil "\\`[^.#].*\\.org\\'"))
- file visiting m buffer)
- (catch 'found
- (while (setq file (pop files))
- (message "trying %s" file)
- (setq visiting (org-find-base-buffer-visiting file))
- (setq buffer (or visiting (find-file-noselect file)))
- (setq m (org-find-exact-headline-in-buffer
- heading buffer))
- (when (and (not m) (not visiting)) (kill-buffer buffer))
- (and m (throw 'found m))))))
-
-(defun org-find-entry-with-id (ident)
- "Locate the entry that contains the ID property with exact value IDENT.
-IDENT can be a string, a symbol or a number, this function will search for
-the string representation of it.
-Return the position where this entry starts, or nil if there is no such entry."
- (interactive "sID: ")
- (let ((id (cond
- ((stringp ident) ident)
- ((symbol-name ident) (symbol-name ident))
- ((numberp ident) (number-to-string ident))
- (t (error "IDENT %s must be a string, symbol or number" ident))))
- (case-fold-search nil))
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (when (re-search-forward
- (concat "^[ \t]*:ID:[ \t]+" (regexp-quote id) "[ \t]*$")
- nil t)
- (org-back-to-heading t)
- (point))))))
-
-;;;; Timestamps
-
-(defvar org-last-changed-timestamp nil)
-(defvar org-last-inserted-timestamp nil
- "The last time stamp inserted with `org-insert-time-stamp'.")
-(defvar org-time-was-given) ; dynamically scoped parameter
-(defvar org-end-time-was-given) ; dynamically scoped parameter
-(defvar org-ts-what) ; dynamically scoped parameter
-
-(defun org-time-stamp (arg &optional inactive)
- "Prompt for a date/time and insert a time stamp.
-If the user specifies a time like HH:MM, or if this command is called
-with a prefix argument, the time stamp will contain date and time.
-Otherwise, only the date will be included. All parts of a date not
-specified by the user will be filled in from the current date/time.
-So if you press just return without typing anything, the time stamp
-will represent the current date/time. If there is already a timestamp
-at the cursor, it will be modified."
- (interactive "P")
- (let* ((ts nil)
- (default-time
- ;; Default time is either today, or, when entering a range,
- ;; the range start.
- (if (or (and (org-at-timestamp-p t) (setq ts (match-string 0)))
- (save-excursion
- (re-search-backward
- (concat org-ts-regexp "--?-?\\=") ; 1-3 minuses
- (- (point) 20) t)))
- (apply 'encode-time (org-parse-time-string (match-string 1)))
- (current-time)))
- (default-input (and ts (org-get-compact-tod ts)))
- org-time-was-given org-end-time-was-given time)
- (cond
- ((and (org-at-timestamp-p t)
- (memq last-command '(org-time-stamp org-time-stamp-inactive))
- (memq this-command '(org-time-stamp org-time-stamp-inactive)))
- (insert "--")
- (setq time (let ((this-command this-command))
- (org-read-date arg 'totime nil nil
- default-time default-input)))
- (org-insert-time-stamp time (or org-time-was-given arg) inactive))
- ((org-at-timestamp-p t)
- (setq time (let ((this-command this-command))
- (org-read-date arg 'totime nil nil default-time default-input)))
- (when (org-at-timestamp-p t) ; just to get the match data
-; (setq inactive (eq (char-after (match-beginning 0)) ?\[))
- (replace-match "")
- (setq org-last-changed-timestamp
- (org-insert-time-stamp
- time (or org-time-was-given arg)
- inactive nil nil (list org-end-time-was-given))))
- (message "Timestamp updated"))
- (t
- (setq time (let ((this-command this-command))
- (org-read-date arg 'totime nil nil default-time default-input)))
- (org-insert-time-stamp time (or org-time-was-given arg) inactive
- nil nil (list org-end-time-was-given))))))
-
-;; FIXME: can we use this for something else, like computing time differences?
-(defun org-get-compact-tod (s)
- (when (string-match "\\(\\([012]?[0-9]\\):\\([0-5][0-9]\\)\\)\\(-\\(\\([012]?[0-9]\\):\\([0-5][0-9]\\)\\)\\)?" s)
- (let* ((t1 (match-string 1 s))
- (h1 (string-to-number (match-string 2 s)))
- (m1 (string-to-number (match-string 3 s)))
- (t2 (and (match-end 4) (match-string 5 s)))
- (h2 (and t2 (string-to-number (match-string 6 s))))
- (m2 (and t2 (string-to-number (match-string 7 s))))
- dh dm)
- (if (not t2)
- t1
- (setq dh (- h2 h1) dm (- m2 m1))
- (if (< dm 0) (setq dm (+ dm 60) dh (1- dh)))
- (concat t1 "+" (number-to-string dh)
- (if (/= 0 dm) (concat ":" (number-to-string dm))))))))
-
-(defun org-time-stamp-inactive (&optional arg)
- "Insert an inactive time stamp.
-An inactive time stamp is enclosed in square brackets instead of angle
-brackets. It is inactive in the sense that it does not trigger agenda entries,
-does not link to the calendar and cannot be changed with the S-cursor keys.
-So these are more for recording a certain time/date."
- (interactive "P")
- (org-time-stamp arg 'inactive))
-
-(defvar org-date-ovl (make-overlay 1 1))
-(overlay-put org-date-ovl 'face 'org-warning)
-(org-detach-overlay org-date-ovl)
-
-(defvar org-ans1) ; dynamically scoped parameter
-(defvar org-ans2) ; dynamically scoped parameter
-
-(defvar org-plain-time-of-day-regexp) ; defined below
-
-(defvar org-overriding-default-time nil) ; dynamically scoped
-(defvar org-read-date-overlay nil)
-(defvar org-dcst nil) ; dynamically scoped
-(defvar org-read-date-history nil)
-(defvar org-read-date-final-answer nil)
-
-(defun org-read-date (&optional with-time to-time from-string prompt
- default-time default-input)
- "Read a date, possibly a time, and make things smooth for the user.
-The prompt will suggest to enter an ISO date, but you can also enter anything
-which will at least partially be understood by `parse-time-string'.
-Unrecognized parts of the date will default to the current day, month, year,
-hour and minute. If this command is called to replace a timestamp at point,
-of to enter the second timestamp of a range, the default time is taken
-from the existing stamp. Furthermore, the command prefers the future,
-so if you are giving a date where the year is not given, and the day-month
-combination is already past in the current year, it will assume you
-mean next year. For details, see the manual. A few examples:
-
- 3-2-5 --> 2003-02-05
- feb 15 --> currentyear-02-15
- 2/15 --> currentyear-02-15
- sep 12 9 --> 2009-09-12
- 12:45 --> today 12:45
- 22 sept 0:34 --> currentyear-09-22 0:34
- 12 --> currentyear-currentmonth-12
- Fri --> nearest Friday (today or later)
- etc.
-
-Furthermore you can specify a relative date by giving, as the *first* thing
-in the input: a plus/minus sign, a number and a letter [dwmy] to indicate
-change in days weeks, months, years.
-With a single plus or minus, the date is relative to today. With a double
-plus or minus, it is relative to the date in DEFAULT-TIME. E.g.
- +4d --> four days from today
- +4 --> same as above
- +2w --> two weeks from today
- ++5 --> five days from default date
-
-The function understands only English month and weekday abbreviations,
-but this can be configured with the variables `parse-time-months' and
-`parse-time-weekdays'.
-
-While prompting, a calendar is popped up - you can also select the
-date with the mouse (button 1). The calendar shows a period of three
-months. To scroll it to other months, use the keys `>' and `<'.
-If you don't like the calendar, turn it off with
- \(setq org-read-date-popup-calendar nil)
-
-With optional argument TO-TIME, the date will immediately be converted
-to an internal time.
-With an optional argument WITH-TIME, the prompt will suggest to also
-insert a time. Note that when WITH-TIME is not set, you can still
-enter a time, and this function will inform the calling routine about
-this change. The calling routine may then choose to change the format
-used to insert the time stamp into the buffer to include the time.
-With optional argument FROM-STRING, read from this string instead from
-the user. PROMPT can overwrite the default prompt. DEFAULT-TIME is
-the time/date that is used for everything that is not specified by the
-user."
- (require 'parse-time)
- (let* ((org-time-stamp-rounding-minutes
- (if (equal with-time '(16)) '(0 0) org-time-stamp-rounding-minutes))
- (org-dcst org-display-custom-times)
- (ct (org-current-time))
- (def (or org-overriding-default-time default-time ct))
- (defdecode (decode-time def))
- (dummy (progn
- (when (< (nth 2 defdecode) org-extend-today-until)
- (setcar (nthcdr 2 defdecode) -1)
- (setcar (nthcdr 1 defdecode) 59)
- (setq def (apply 'encode-time defdecode)
- defdecode (decode-time def)))))
- (calendar-frame-setup nil)
- (calendar-setup nil)
- (calendar-move-hook nil)
- (calendar-view-diary-initially-flag nil)
- (calendar-view-holidays-initially-flag nil)
- (timestr (format-time-string
- (if with-time "%Y-%m-%d %H:%M" "%Y-%m-%d") def))
- (prompt (concat (if prompt (concat prompt " ") "")
- (format "Date+time [%s]: " timestr)))
- ans (org-ans0 "") org-ans1 org-ans2 final)
-
- (cond
- (from-string (setq ans from-string))
- (org-read-date-popup-calendar
- (save-excursion
- (save-window-excursion
- (calendar)
- (calendar-forward-day (- (time-to-days def)
- (calendar-absolute-from-gregorian
- (calendar-current-date))))
- (org-eval-in-calendar nil t)
- (let* ((old-map (current-local-map))
- (map (copy-keymap calendar-mode-map))
- (minibuffer-local-map (copy-keymap minibuffer-local-map)))
- (org-defkey map (kbd "RET") 'org-calendar-select)
- (org-defkey map [mouse-1] 'org-calendar-select-mouse)
- (org-defkey map [mouse-2] 'org-calendar-select-mouse)
- (org-defkey minibuffer-local-map [(meta shift left)]
- (lambda () (interactive)
- (org-eval-in-calendar '(calendar-backward-month 1))))
- (org-defkey minibuffer-local-map [(meta shift right)]
- (lambda () (interactive)
- (org-eval-in-calendar '(calendar-forward-month 1))))
- (org-defkey minibuffer-local-map [(meta shift up)]
- (lambda () (interactive)
- (org-eval-in-calendar '(calendar-backward-year 1))))
- (org-defkey minibuffer-local-map [(meta shift down)]
- (lambda () (interactive)
- (org-eval-in-calendar '(calendar-forward-year 1))))
- (org-defkey minibuffer-local-map [?\e (shift left)]
- (lambda () (interactive)
- (org-eval-in-calendar '(calendar-backward-month 1))))
- (org-defkey minibuffer-local-map [?\e (shift right)]
- (lambda () (interactive)
- (org-eval-in-calendar '(calendar-forward-month 1))))
- (org-defkey minibuffer-local-map [?\e (shift up)]
- (lambda () (interactive)
- (org-eval-in-calendar '(calendar-backward-year 1))))
- (org-defkey minibuffer-local-map [?\e (shift down)]
- (lambda () (interactive)
- (org-eval-in-calendar '(calendar-forward-year 1))))
- (org-defkey minibuffer-local-map [(shift up)]
- (lambda () (interactive)
- (org-eval-in-calendar '(calendar-backward-week 1))))
- (org-defkey minibuffer-local-map [(shift down)]
- (lambda () (interactive)
- (org-eval-in-calendar '(calendar-forward-week 1))))
- (org-defkey minibuffer-local-map [(shift left)]
- (lambda () (interactive)
- (org-eval-in-calendar '(calendar-backward-day 1))))
- (org-defkey minibuffer-local-map [(shift right)]
- (lambda () (interactive)
- (org-eval-in-calendar '(calendar-forward-day 1))))
- (org-defkey minibuffer-local-map ">"
- (lambda () (interactive)
- (org-eval-in-calendar '(scroll-calendar-left 1))))
- (org-defkey minibuffer-local-map "<"
- (lambda () (interactive)
- (org-eval-in-calendar '(scroll-calendar-right 1))))
- (org-defkey minibuffer-local-map "\C-v"
- (lambda () (interactive)
- (org-eval-in-calendar
- '(calendar-scroll-left-three-months 1))))
- (org-defkey minibuffer-local-map "\M-v"
- (lambda () (interactive)
- (org-eval-in-calendar
- '(calendar-scroll-right-three-months 1))))
- (run-hooks 'org-read-date-minibuffer-setup-hook)
- (unwind-protect
- (progn
- (use-local-map map)
- (add-hook 'post-command-hook 'org-read-date-display)
- (setq org-ans0 (read-string prompt default-input
- 'org-read-date-history nil))
- ;; org-ans0: from prompt
- ;; org-ans1: from mouse click
- ;; org-ans2: from calendar motion
- (setq ans (concat org-ans0 " " (or org-ans1 org-ans2))))
- (remove-hook 'post-command-hook 'org-read-date-display)
- (use-local-map old-map)
- (when org-read-date-overlay
- (delete-overlay org-read-date-overlay)
- (setq org-read-date-overlay nil)))))))
-
- (t ; Naked prompt only
- (unwind-protect
- (setq ans (read-string prompt default-input
- 'org-read-date-history timestr))
- (when org-read-date-overlay
- (delete-overlay org-read-date-overlay)
- (setq org-read-date-overlay nil)))))
-
- (setq final (org-read-date-analyze ans def defdecode))
-
- ;; One round trip to get rid of 34th of August and stuff like that....
- (setq final (decode-time (apply 'encode-time final)))
-
- (setq org-read-date-final-answer ans)
-
- (if to-time
- (apply 'encode-time final)
- (if (and (boundp 'org-time-was-given) org-time-was-given)
- (format "%04d-%02d-%02d %02d:%02d"
- (nth 5 final) (nth 4 final) (nth 3 final)
- (nth 2 final) (nth 1 final))
- (format "%04d-%02d-%02d" (nth 5 final) (nth 4 final) (nth 3 final))))))
-
-(defvar def)
-(defvar defdecode)
-(defvar with-time)
-(defvar org-read-date-analyze-futurep nil)
-(defun org-read-date-display ()
- "Display the current date prompt interpretation in the minibuffer."
- (when org-read-date-display-live
- (when org-read-date-overlay
- (delete-overlay org-read-date-overlay))
- (let ((p (point)))
- (end-of-line 1)
- (while (not (equal (buffer-substring
- (max (point-min) (- (point) 4)) (point))
- " "))
- (insert " "))
- (goto-char p))
- (let* ((ans (concat (buffer-substring (point-at-bol) (point-max))
- " " (or org-ans1 org-ans2)))
- (org-end-time-was-given nil)
- (f (org-read-date-analyze ans def defdecode))
- (fmts (if org-dcst
- org-time-stamp-custom-formats
- org-time-stamp-formats))
- (fmt (if (or with-time
- (and (boundp 'org-time-was-given) org-time-was-given))
- (cdr fmts)
- (car fmts)))
- (txt (concat "=> " (format-time-string fmt (apply 'encode-time f)))))
- (when (and org-end-time-was-given
- (string-match org-plain-time-of-day-regexp txt))
- (setq txt (concat (substring txt 0 (match-end 0)) "-"
- org-end-time-was-given
- (substring txt (match-end 0)))))
- (when org-read-date-analyze-futurep
- (setq txt (concat txt " (=>F)")))
- (setq org-read-date-overlay
- (make-overlay (1- (point-at-eol)) (point-at-eol)))
- (org-overlay-display org-read-date-overlay txt 'secondary-selection))))
-
-(defun org-read-date-analyze (ans def defdecode)
- "Analyze the combined answer of the date prompt."
- ;; FIXME: cleanup and comment
- (let ((nowdecode (decode-time (current-time)))
- delta deltan deltaw deltadef year month day
- hour minute second wday pm h2 m2 tl wday1
- iso-year iso-weekday iso-week iso-year iso-date futurep kill-year)
- (setq org-read-date-analyze-futurep nil)
- (when (string-match "\\`[ \t]*\\.[ \t]*\\'" ans)
- (setq ans "+0"))
-
- (when (setq delta (org-read-date-get-relative ans (current-time) def))
- (setq ans (replace-match "" t t ans)
- deltan (car delta)
- deltaw (nth 1 delta)
- deltadef (nth 2 delta)))
-
- ;; Check if there is an iso week date in there
- ;; If yes, store the info and postpone interpreting it until the rest
- ;; of the parsing is done
- (when (string-match "\\<\\(?:\\([0-9]+\\)-\\)?[wW]\\([0-9]\\{1,2\\}\\)\\(?:-\\([0-6]\\)\\)?\\([ \t]\\|$\\)" ans)
- (setq iso-year (if (match-end 1)
- (org-small-year-to-year
- (string-to-number (match-string 1 ans))))
- iso-weekday (if (match-end 3)
- (string-to-number (match-string 3 ans)))
- iso-week (string-to-number (match-string 2 ans)))
- (setq ans (replace-match "" t t ans)))
-
- ;; Help matching ISO dates with single digit month or day, like 2006-8-11.
- (when (string-match
- "^ *\\(\\([0-9]+\\)-\\)?\\([0-1]?[0-9]\\)-\\([0-3]?[0-9]\\)\\([^-0-9]\\|$\\)" ans)
- (setq year (if (match-end 2)
- (string-to-number (match-string 2 ans))
- (progn (setq kill-year t)
- (string-to-number (format-time-string "%Y"))))
- month (string-to-number (match-string 3 ans))
- day (string-to-number (match-string 4 ans)))
- (if (< year 100) (setq year (+ 2000 year)))
- (setq ans (replace-match (format "%04d-%02d-%02d\\5" year month day)
- t nil ans)))
- ;; Help matching american dates, like 5/30 or 5/30/7
- (when (string-match
- "^ *\\(0?[1-9]\\|1[012]\\)/\\(0?[1-9]\\|[12][0-9]\\|3[01]\\)\\(/\\([0-9]+\\)\\)?\\([^/0-9]\\|$\\)" ans)
- (setq year (if (match-end 4)
- (string-to-number (match-string 4 ans))
- (progn (setq kill-year t)
- (string-to-number (format-time-string "%Y"))))
- month (string-to-number (match-string 1 ans))
- day (string-to-number (match-string 2 ans)))
- (if (< year 100) (setq year (+ 2000 year)))
- (setq ans (replace-match (format "%04d-%02d-%02d\\5" year month day)
- t nil ans)))
- ;; Help matching am/pm times, because `parse-time-string' does not do that.
- ;; If there is a time with am/pm, and *no* time without it, we convert
- ;; so that matching will be successful.
- (loop for i from 1 to 2 do ; twice, for end time as well
- (when (and (not (string-match "\\(\\`\\|[^+]\\)[012]?[0-9]:[0-9][0-9]\\([ \t\n]\\|$\\)" ans))
- (string-match "\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)?\\(am\\|AM\\|pm\\|PM\\)\\>" ans))
- (setq hour (string-to-number (match-string 1 ans))
- minute (if (match-end 3)
- (string-to-number (match-string 3 ans))
- 0)
- pm (equal ?p
- (string-to-char (downcase (match-string 4 ans)))))
- (if (and (= hour 12) (not pm))
- (setq hour 0)
- (if (and pm (< hour 12)) (setq hour (+ 12 hour))))
- (setq ans (replace-match (format "%02d:%02d" hour minute)
- t t ans))))
-
- ;; Check if a time range is given as a duration
- (when (string-match "\\([012]?[0-9]\\):\\([0-6][0-9]\\)\\+\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)?" ans)
- (setq hour (string-to-number (match-string 1 ans))
- h2 (+ hour (string-to-number (match-string 3 ans)))
- minute (string-to-number (match-string 2 ans))
- m2 (+ minute (if (match-end 5) (string-to-number
- (match-string 5 ans))0)))
- (if (>= m2 60) (setq h2 (1+ h2) m2 (- m2 60)))
- (setq ans (replace-match (format "%02d:%02d-%02d:%02d" hour minute h2 m2)
- t t ans)))
-
- ;; Check if there is a time range
- (when (boundp 'org-end-time-was-given)
- (setq org-time-was-given nil)
- (when (and (string-match org-plain-time-of-day-regexp ans)
- (match-end 8))
- (setq org-end-time-was-given (match-string 8 ans))
- (setq ans (concat (substring ans 0 (match-beginning 7))
- (substring ans (match-end 7))))))
-
- (setq tl (parse-time-string ans)
- day (or (nth 3 tl) (nth 3 defdecode))
- month (or (nth 4 tl)
- (if (and org-read-date-prefer-future
- (nth 3 tl) (< (nth 3 tl) (nth 3 nowdecode)))
- (prog1 (1+ (nth 4 nowdecode)) (setq futurep t))
- (nth 4 defdecode)))
- year (or (and (not kill-year) (nth 5 tl))
- (if (and org-read-date-prefer-future
- (nth 4 tl) (< (nth 4 tl) (nth 4 nowdecode)))
- (prog1 (1+ (nth 5 nowdecode)) (setq futurep t))
- (nth 5 defdecode)))
- hour (or (nth 2 tl) (nth 2 defdecode))
- minute (or (nth 1 tl) (nth 1 defdecode))
- second (or (nth 0 tl) 0)
- wday (nth 6 tl))
-
- (when (and (eq org-read-date-prefer-future 'time)
- (not (nth 3 tl)) (not (nth 4 tl)) (not (nth 5 tl))
- (equal day (nth 3 nowdecode))
- (equal month (nth 4 nowdecode))
- (equal year (nth 5 nowdecode))
- (nth 2 tl)
- (or (< (nth 2 tl) (nth 2 nowdecode))
- (and (= (nth 2 tl) (nth 2 nowdecode))
- (nth 1 tl)
- (< (nth 1 tl) (nth 1 nowdecode)))))
- (setq day (1+ day)
- futurep t))
-
- ;; Special date definitions below
- (cond
- (iso-week
- ;; There was an iso week
- (require 'cal-iso)
- (setq futurep nil)
- (setq year (or iso-year year)
- day (or iso-weekday wday 1)
- wday nil ; to make sure that the trigger below does not match
- iso-date (calendar-gregorian-from-absolute
- (calendar-absolute-from-iso
- (list iso-week day year))))
-; FIXME: Should we also push ISO weeks into the future?
-; (when (and org-read-date-prefer-future
-; (not iso-year)
-; (< (calendar-absolute-from-gregorian iso-date)
-; (time-to-days (current-time))))
-; (setq year (1+ year)
-; iso-date (calendar-gregorian-from-absolute
-; (calendar-absolute-from-iso
-; (list iso-week day year)))))
- (setq month (car iso-date)
- year (nth 2 iso-date)
- day (nth 1 iso-date)))
- (deltan
- (setq futurep nil)
- (unless deltadef
- (let ((now (decode-time (current-time))))
- (setq day (nth 3 now) month (nth 4 now) year (nth 5 now))))
- (cond ((member deltaw '("d" "")) (setq day (+ day deltan)))
- ((equal deltaw "w") (setq day (+ day (* 7 deltan))))
- ((equal deltaw "m") (setq month (+ month deltan)))
- ((equal deltaw "y") (setq year (+ year deltan)))))
- ((and wday (not (nth 3 tl)))
- (setq futurep nil)
- ;; Weekday was given, but no day, so pick that day in the week
- ;; on or after the derived date.
- (setq wday1 (nth 6 (decode-time (encode-time 0 0 0 day month year))))
- (unless (equal wday wday1)
- (setq day (+ day (% (- wday wday1 -7) 7))))))
- (if (and (boundp 'org-time-was-given)
- (nth 2 tl))
- (setq org-time-was-given t))
- (if (< year 100) (setq year (+ 2000 year)))
- (if (< year 1970) (setq year (nth 5 defdecode))) ; not representable
- (setq org-read-date-analyze-futurep futurep)
- (list second minute hour day month year)))
-
-(defvar parse-time-weekdays)
-
-(defun org-read-date-get-relative (s today default)
- "Check string S for special relative date string.
-TODAY and DEFAULT are internal times, for today and for a default.
-Return shift list (N what def-flag)
-WHAT is \"d\", \"w\", \"m\", or \"y\" for day, week, month, year.
-N is the number of WHATs to shift.
-DEF-FLAG is t when a double ++ or -- indicates shift relative to
- the DEFAULT date rather than TODAY."
- (when (and
- (string-match
- (concat
- "\\`[ \t]*\\([-+]\\{0,2\\}\\)"
- "\\([0-9]+\\)?"
- "\\([dwmy]\\|\\(" (mapconcat 'car parse-time-weekdays "\\|") "\\)\\)?"
- "\\([ \t]\\|$\\)") s)
- (or (> (match-end 1) (match-beginning 1)) (match-end 4)))
- (let* ((dir (if (> (match-end 1) (match-beginning 1))
- (string-to-char (substring (match-string 1 s) -1))
- ?+))
- (rel (and (match-end 1) (= 2 (- (match-end 1) (match-beginning 1)))))
- (n (if (match-end 2) (string-to-number (match-string 2 s)) 1))
- (what (if (match-end 3) (match-string 3 s) "d"))
- (wday1 (cdr (assoc (downcase what) parse-time-weekdays)))
- (date (if rel default today))
- (wday (nth 6 (decode-time date)))
- delta)
- (if wday1
- (progn
- (setq delta (mod (+ 7 (- wday1 wday)) 7))
- (if (= dir ?-) (setq delta (- delta 7)))
- (if (> n 1) (setq delta (+ delta (* (1- n) (if (= dir ?-) -7 7)))))
- (list delta "d" rel))
- (list (* n (if (= dir ?-) -1 1)) what rel)))))
-
-(defun org-order-calendar-date-args (arg1 arg2 arg3)
- "Turn a user-specified date into the internal representation.
-The internal representation needed by the calendar is (month day year).
-This is a wrapper to handle the brain-dead convention in calendar that
-user function argument order change dependent on argument order."
- (if (boundp 'calendar-date-style)
- (cond
- ((eq calendar-date-style 'american)
- (list arg1 arg2 arg3))
- ((eq calendar-date-style 'european)
- (list arg2 arg1 arg3))
- ((eq calendar-date-style 'iso)
- (list arg2 arg3 arg1)))
- (with-no-warnings ;; european-calendar-style is obsolete as of version 23.1
- (if (org-bound-and-true-p european-calendar-style)
- (list arg2 arg1 arg3)
- (list arg1 arg2 arg3)))))
-
-(defun org-eval-in-calendar (form &optional keepdate)
- "Eval FORM in the calendar window and return to current window.
-Also, store the cursor date in variable org-ans2."
- (let ((sf (selected-frame))
- (sw (selected-window)))
- (select-window (get-buffer-window "*Calendar*" t))
- (eval form)
- (when (and (not keepdate) (calendar-cursor-to-date))
- (let* ((date (calendar-cursor-to-date))
- (time (encode-time 0 0 0 (nth 1 date) (nth 0 date) (nth 2 date))))
- (setq org-ans2 (format-time-string "%Y-%m-%d" time))))
- (move-overlay org-date-ovl (1- (point)) (1+ (point)) (current-buffer))
- (select-window sw)
- (org-select-frame-set-input-focus sf)))
-
-(defun org-calendar-select ()
- "Return to `org-read-date' with the date currently selected.
-This is used by `org-read-date' in a temporary keymap for the calendar buffer."
- (interactive)
- (when (calendar-cursor-to-date)
- (let* ((date (calendar-cursor-to-date))
- (time (encode-time 0 0 0 (nth 1 date) (nth 0 date) (nth 2 date))))
- (setq org-ans1 (format-time-string "%Y-%m-%d" time)))
- (if (active-minibuffer-window) (exit-minibuffer))))
-
-(defun org-insert-time-stamp (time &optional with-hm inactive pre post extra)
- "Insert a date stamp for the date given by the internal TIME.
-WITH-HM means use the stamp format that includes the time of the day.
-INACTIVE means use square brackets instead of angular ones, so that the
-stamp will not contribute to the agenda.
-PRE and POST are optional strings to be inserted before and after the
-stamp.
-The command returns the inserted time stamp."
- (let ((fmt (funcall (if with-hm 'cdr 'car) org-time-stamp-formats))
- stamp)
- (if inactive (setq fmt (concat "[" (substring fmt 1 -1) "]")))
- (insert-before-markers (or pre ""))
- (when (listp extra)
- (setq extra (car extra))
- (if (and (stringp extra)
- (string-match "\\([0-9]+\\):\\([0-9]+\\)" extra))
- (setq extra (format "-%02d:%02d"
- (string-to-number (match-string 1 extra))
- (string-to-number (match-string 2 extra))))
- (setq extra nil)))
- (when extra
- (setq fmt (concat (substring fmt 0 -1) extra (substring fmt -1))))
- (insert-before-markers (setq stamp (format-time-string fmt time)))
- (insert-before-markers (or post ""))
- (setq org-last-inserted-timestamp stamp)))
-
-(defun org-toggle-time-stamp-overlays ()
- "Toggle the use of custom time stamp formats."
- (interactive)
- (setq org-display-custom-times (not org-display-custom-times))
- (unless org-display-custom-times
- (let ((p (point-min)) (bmp (buffer-modified-p)))
- (while (setq p (next-single-property-change p 'display))
- (if (and (get-text-property p 'display)
- (eq (get-text-property p 'face) 'org-date))
- (remove-text-properties
- p (setq p (next-single-property-change p 'display))
- '(display t))))
- (set-buffer-modified-p bmp)))
- (if (featurep 'xemacs)
- (remove-text-properties (point-min) (point-max) '(end-glyph t)))
- (org-restart-font-lock)
- (setq org-table-may-need-update t)
- (if org-display-custom-times
- (message "Time stamps are overlayed with custom format")
- (message "Time stamp overlays removed")))
-
-(defun org-display-custom-time (beg end)
- "Overlay modified time stamp format over timestamp between BEG and END."
- (let* ((ts (buffer-substring beg end))
- t1 w1 with-hm tf time str w2 (off 0))
- (save-match-data
- (setq t1 (org-parse-time-string ts t))
- (if (string-match "\\(-[0-9]+:[0-9]+\\)?\\( [.+]?\\+[0-9]+[dwmy]\\(/[0-9]+[dwmy]\\)?\\)?\\'" ts)
- (setq off (- (match-end 0) (match-beginning 0)))))
- (setq end (- end off))
- (setq w1 (- end beg)
- with-hm (and (nth 1 t1) (nth 2 t1))
- tf (funcall (if with-hm 'cdr 'car) org-time-stamp-custom-formats)
- time (org-fix-decoded-time t1)
- str (org-add-props
- (format-time-string
- (substring tf 1 -1) (apply 'encode-time time))
- nil 'mouse-face 'highlight)
- w2 (length str))
- (if (not (= w2 w1))
- (add-text-properties (1+ beg) (+ 2 beg)
- (list 'org-dwidth t 'org-dwidth-n (- w1 w2))))
- (if (featurep 'xemacs)
- (progn
- (put-text-property beg end 'invisible t)
- (put-text-property beg end 'end-glyph (make-glyph str)))
- (put-text-property beg end 'display str))))
-
-(defun org-translate-time (string)
- "Translate all timestamps in STRING to custom format.
-But do this only if the variable `org-display-custom-times' is set."
- (when org-display-custom-times
- (save-match-data
- (let* ((start 0)
- (re org-ts-regexp-both)
- t1 with-hm inactive tf time str beg end)
- (while (setq start (string-match re string start))
- (setq beg (match-beginning 0)
- end (match-end 0)
- t1 (save-match-data
- (org-parse-time-string (substring string beg end) t))
- with-hm (and (nth 1 t1) (nth 2 t1))
- inactive (equal (substring string beg (1+ beg)) "[")
- tf (funcall (if with-hm 'cdr 'car)
- org-time-stamp-custom-formats)
- time (org-fix-decoded-time t1)
- str (format-time-string
- (concat
- (if inactive "[" "<") (substring tf 1 -1)
- (if inactive "]" ">"))
- (apply 'encode-time time))
- string (replace-match str t t string)
- start (+ start (length str)))))))
- string)
-
-(defun org-fix-decoded-time (time)
- "Set 0 instead of nil for the first 6 elements of time.
-Don't touch the rest."
- (let ((n 0))
- (mapcar (lambda (x) (if (< (setq n (1+ n)) 7) (or x 0) x)) time)))
-
-(defun org-days-to-time (timestamp-string)
- "Difference between TIMESTAMP-STRING and now in days."
- (- (time-to-days (org-time-string-to-time timestamp-string))
- (time-to-days (current-time))))
-
-(defun org-deadline-close (timestamp-string &optional ndays)
- "Is the time in TIMESTAMP-STRING close to the current date?"
- (setq ndays (or ndays (org-get-wdays timestamp-string)))
- (and (< (org-days-to-time timestamp-string) ndays)
- (not (org-entry-is-done-p))))
-
-(defun org-get-wdays (ts)
- "Get the deadline lead time appropriate for timestring TS."
- (cond
- ((<= org-deadline-warning-days 0)
- ;; 0 or negative, enforce this value no matter what
- (- org-deadline-warning-days))
- ((string-match "-\\([0-9]+\\)\\([dwmy]\\)\\(\\'\\|>\\| \\)" ts)
- ;; lead time is specified.
- (floor (* (string-to-number (match-string 1 ts))
- (cdr (assoc (match-string 2 ts)
- '(("d" . 1) ("w" . 7)
- ("m" . 30.4) ("y" . 365.25)))))))
- ;; go for the default.
- (t org-deadline-warning-days)))
-
-(defun org-calendar-select-mouse (ev)
- "Return to `org-read-date' with the date currently selected.
-This is used by `org-read-date' in a temporary keymap for the calendar buffer."
- (interactive "e")
- (mouse-set-point ev)
- (when (calendar-cursor-to-date)
- (let* ((date (calendar-cursor-to-date))
- (time (encode-time 0 0 0 (nth 1 date) (nth 0 date) (nth 2 date))))
- (setq org-ans1 (format-time-string "%Y-%m-%d" time)))
- (if (active-minibuffer-window) (exit-minibuffer))))
-
-(defun org-check-deadlines (ndays)
- "Check if there are any deadlines due or past due.
-A deadline is considered due if it happens within `org-deadline-warning-days'
-days from today's date. If the deadline appears in an entry marked DONE,
-it is not shown. The prefix arg NDAYS can be used to test that many
-days. If the prefix is a raw \\[universal-argument] prefix, all deadlines are shown."
- (interactive "P")
- (let* ((org-warn-days
- (cond
- ((equal ndays '(4)) 100000)
- (ndays (prefix-numeric-value ndays))
- (t (abs org-deadline-warning-days))))
- (case-fold-search nil)
- (regexp (concat "\\<" org-deadline-string " *<\\([^>]+\\)>"))
- (callback
- (lambda () (org-deadline-close (match-string 1) org-warn-days))))
-
- (message "%d deadlines past-due or due within %d days"
- (org-occur regexp nil callback)
- org-warn-days)))
-
-(defun org-check-before-date (date)
- "Check if there are deadlines or scheduled entries before DATE."
- (interactive (list (org-read-date)))
- (let ((case-fold-search nil)
- (regexp (concat "\\<\\(" org-deadline-string
- "\\|" org-scheduled-string
- "\\) *<\\([^>]+\\)>"))
- (callback
- (lambda () (time-less-p
- (org-time-string-to-time (match-string 2))
- (org-time-string-to-time date)))))
- (message "%d entries before %s"
- (org-occur regexp nil callback) date)))
-
-(defun org-check-after-date (date)
- "Check if there are deadlines or scheduled entries after DATE."
- (interactive (list (org-read-date)))
- (let ((case-fold-search nil)
- (regexp (concat "\\<\\(" org-deadline-string
- "\\|" org-scheduled-string
- "\\) *<\\([^>]+\\)>"))
- (callback
- (lambda () (not
- (time-less-p
- (org-time-string-to-time (match-string 2))
- (org-time-string-to-time date))))))
- (message "%d entries after %s"
- (org-occur regexp nil callback) date)))
-
-(defun org-evaluate-time-range (&optional to-buffer)
- "Evaluate a time range by computing the difference between start and end.
-Normally the result is just printed in the echo area, but with prefix arg
-TO-BUFFER, the result is inserted just after the date stamp into the buffer.
-If the time range is actually in a table, the result is inserted into the
-next column.
-For time difference computation, a year is assumed to be exactly 365
-days in order to avoid rounding problems."
- (interactive "P")
- (or
- (org-clock-update-time-maybe)
- (save-excursion
- (unless (org-at-date-range-p t)
- (goto-char (point-at-bol))
- (re-search-forward org-tr-regexp-both (point-at-eol) t))
- (if (not (org-at-date-range-p t))
- (error "Not at a time-stamp range, and none found in current line")))
- (let* ((ts1 (match-string 1))
- (ts2 (match-string 2))
- (havetime (or (> (length ts1) 15) (> (length ts2) 15)))
- (match-end (match-end 0))
- (time1 (org-time-string-to-time ts1))
- (time2 (org-time-string-to-time ts2))
- (t1 (org-float-time time1))
- (t2 (org-float-time time2))
- (diff (abs (- t2 t1)))
- (negative (< (- t2 t1) 0))
- ;; (ys (floor (* 365 24 60 60)))
- (ds (* 24 60 60))
- (hs (* 60 60))
- (fy "%dy %dd %02d:%02d")
- (fy1 "%dy %dd")
- (fd "%dd %02d:%02d")
- (fd1 "%dd")
- (fh "%02d:%02d")
- y d h m align)
- (if havetime
- (setq ; y (floor (/ diff ys)) diff (mod diff ys)
- y 0
- d (floor (/ diff ds)) diff (mod diff ds)
- h (floor (/ diff hs)) diff (mod diff hs)
- m (floor (/ diff 60)))
- (setq ; y (floor (/ diff ys)) diff (mod diff ys)
- y 0
- d (floor (+ (/ diff ds) 0.5))
- h 0 m 0))
- (if (not to-buffer)
- (message "%s" (org-make-tdiff-string y d h m))
- (if (org-at-table-p)
- (progn
- (goto-char match-end)
- (setq align t)
- (and (looking-at " *|") (goto-char (match-end 0))))
- (goto-char match-end))
- (if (looking-at
- "\\( *-? *[0-9]+y\\)?\\( *[0-9]+d\\)? *[0-9][0-9]:[0-9][0-9]")
- (replace-match ""))
- (if negative (insert " -"))
- (if (> y 0) (insert " " (format (if havetime fy fy1) y d h m))
- (if (> d 0) (insert " " (format (if havetime fd fd1) d h m))
- (insert " " (format fh h m))))
- (if align (org-table-align))
- (message "Time difference inserted")))))
-
-(defun org-make-tdiff-string (y d h m)
- (let ((fmt "")
- (l nil))
- (if (> y 0) (setq fmt (concat fmt "%d year" (if (> y 1) "s" "") " ")
- l (push y l)))
- (if (> d 0) (setq fmt (concat fmt "%d day" (if (> d 1) "s" "") " ")
- l (push d l)))
- (if (> h 0) (setq fmt (concat fmt "%d hour" (if (> h 1) "s" "") " ")
- l (push h l)))
- (if (> m 0) (setq fmt (concat fmt "%d minute" (if (> m 1) "s" "") " ")
- l (push m l)))
- (apply 'format fmt (nreverse l))))
-
-(defun org-time-string-to-time (s)
- (apply 'encode-time (org-parse-time-string s)))
-(defun org-time-string-to-seconds (s)
- (org-float-time (org-time-string-to-time s)))
-
-(defun org-time-string-to-absolute (s &optional daynr prefer show-all)
- "Convert a time stamp to an absolute day number.
-If there is a specifier for a cyclic time stamp, get the closest date to
-DAYNR.
-PREFER and SHOW-ALL are passed through to `org-closest-date'.
-the variable date is bound by the calendar when this is called."
- (cond
- ((and daynr (string-match "\\`%%\\((.*)\\)" s))
- (if (org-diary-sexp-entry (match-string 1 s) "" date)
- daynr
- (+ daynr 1000)))
- ((and daynr (string-match "\\+[0-9]+[dwmy]" s))
- (org-closest-date s (if (and (boundp 'daynr) (integerp daynr)) daynr
- (time-to-days (current-time))) (match-string 0 s)
- prefer show-all))
- (t (time-to-days (apply 'encode-time (org-parse-time-string s))))))
-
-(defun org-days-to-iso-week (days)
- "Return the iso week number."
- (require 'cal-iso)
- (car (calendar-iso-from-absolute days)))
-
-(defun org-small-year-to-year (year)
- "Convert 2-digit years into 4-digit years.
-38-99 are mapped into 1938-1999. 1-37 are mapped into 2001-2007.
-The year 2000 cannot be abbreviated. Any year larger than 99
-is returned unchanged."
- (if (< year 38)
- (setq year (+ 2000 year))
- (if (< year 100)
- (setq year (+ 1900 year))))
- year)
-
-(defun org-time-from-absolute (d)
- "Return the time corresponding to date D.
-D may be an absolute day number, or a calendar-type list (month day year)."
- (if (numberp d) (setq d (calendar-gregorian-from-absolute d)))
- (encode-time 0 0 0 (nth 1 d) (car d) (nth 2 d)))
-
-(defun org-calendar-holiday ()
- "List of holidays, for Diary display in Org-mode."
- (require 'holidays)
- (let ((hl (funcall
- (if (fboundp 'calendar-check-holidays)
- 'calendar-check-holidays 'check-calendar-holidays) date)))
- (if hl (mapconcat 'identity hl "; "))))
-
-(defun org-diary-sexp-entry (sexp entry date)
- "Process a SEXP diary ENTRY for DATE."
- (require 'diary-lib)
- (let ((result (if calendar-debug-sexp
- (let ((stack-trace-on-error t))
- (eval (car (read-from-string sexp))))
- (condition-case nil
- (eval (car (read-from-string sexp)))
- (error
- (beep)
- (message "Bad sexp at line %d in %s: %s"
- (org-current-line)
- (buffer-file-name) sexp)
- (sleep-for 2))))))
- (cond ((stringp result) (split-string result "; "))
- ((and (consp result)
- (not (consp (cdr result)))
- (stringp (cdr result))) (cdr result))
- ((and (consp result)
- (stringp (car result))) result)
- (result entry)
- (t nil))))
-
-(defun org-diary-to-ical-string (frombuf)
- "Get iCalendar entries from diary entries in buffer FROMBUF.
-This uses the icalendar.el library."
- (let* ((tmpdir (if (featurep 'xemacs)
- (temp-directory)
- temporary-file-directory))
- (tmpfile (make-temp-name
- (expand-file-name "orgics" tmpdir)))
- buf rtn b e)
- (with-current-buffer frombuf
- (icalendar-export-region (point-min) (point-max) tmpfile)
- (setq buf (find-buffer-visiting tmpfile))
- (set-buffer buf)
- (goto-char (point-min))
- (if (re-search-forward "^BEGIN:VEVENT" nil t)
- (setq b (match-beginning 0)))
- (goto-char (point-max))
- (if (re-search-backward "^END:VEVENT" nil t)
- (setq e (match-end 0)))
- (setq rtn (if (and b e) (concat (buffer-substring b e) "\n") "")))
- (kill-buffer buf)
- (delete-file tmpfile)
- rtn))
-
-(defun org-closest-date (start current change prefer show-all)
- "Find the date closest to CURRENT that is consistent with START and CHANGE.
-When PREFER is `past' return a date that is either CURRENT or past.
-When PREFER is `future', return a date that is either CURRENT or future.
-When SHOW-ALL is nil, only return the current occurrence of a time stamp."
- ;; Make the proper lists from the dates
- (catch 'exit
- (let ((a1 '(("d" . day) ("w" . week) ("m" . month) ("y" . year)))
- dn dw sday cday n1 n2 n0
- d m y y1 y2 date1 date2 nmonths nm ny m2)
-
- (setq start (org-date-to-gregorian start)
- current (org-date-to-gregorian
- (if show-all
- current
- (time-to-days (current-time))))
- sday (calendar-absolute-from-gregorian start)
- cday (calendar-absolute-from-gregorian current))
-
- (if (<= cday sday) (throw 'exit sday))
-
- (if (string-match "\\(\\+[0-9]+\\)\\([dwmy]\\)" change)
- (setq dn (string-to-number (match-string 1 change))
- dw (cdr (assoc (match-string 2 change) a1)))
- (error "Invalid change specifier: %s" change))
- (if (eq dw 'week) (setq dw 'day dn (* 7 dn)))
- (cond
- ((eq dw 'day)
- (setq n1 (+ sday (* dn (floor (/ (- cday sday) dn))))
- n2 (+ n1 dn)))
- ((eq dw 'year)
- (setq d (nth 1 start) m (car start) y1 (nth 2 start) y2 (nth 2 current))
- (setq y1 (+ (* (floor (/ (- y2 y1) dn)) dn) y1))
- (setq date1 (list m d y1)
- n1 (calendar-absolute-from-gregorian date1)
- date2 (list m d (+ y1 (* (if (< n1 cday) 1 -1) dn)))
- n2 (calendar-absolute-from-gregorian date2)))
- ((eq dw 'month)
- ;; approx number of month between the two dates
- (setq nmonths (floor (/ (- cday sday) 30.436875)))
- ;; How often does dn fit in there?
- (setq d (nth 1 start) m (car start) y (nth 2 start)
- nm (* dn (max 0 (1- (floor (/ nmonths dn)))))
- m (+ m nm)
- ny (floor (/ m 12))
- y (+ y ny)
- m (- m (* ny 12)))
- (while (> m 12) (setq m (- m 12) y (1+ y)))
- (setq n1 (calendar-absolute-from-gregorian (list m d y)))
- (setq m2 (+ m dn) y2 y)
- (if (> m2 12) (setq y2 (1+ y2) m2 (- m2 12)))
- (setq n2 (calendar-absolute-from-gregorian (list m2 d y2)))
- (while (<= n2 cday)
- (setq n1 n2 m m2 y y2)
- (setq m2 (+ m dn) y2 y)
- (if (> m2 12) (setq y2 (1+ y2) m2 (- m2 12)))
- (setq n2 (calendar-absolute-from-gregorian (list m2 d y2))))))
- ;; Make sure n1 is the earlier date
- (setq n0 n1 n1 (min n1 n2) n2 (max n0 n2))
- (if show-all
- (cond
- ((eq prefer 'past) (if (= cday n2) n2 n1))
- ((eq prefer 'future) (if (= cday n1) n1 n2))
- (t (if (> (abs (- cday n1)) (abs (- cday n2))) n2 n1)))
- (cond
- ((eq prefer 'past) (if (= cday n2) n2 n1))
- ((eq prefer 'future) (if (= cday n1) n1 n2))
- (t (if (= cday n1) n1 n2)))))))
-
-(defun org-date-to-gregorian (date)
- "Turn any specification of DATE into a Gregorian date for the calendar."
- (cond ((integerp date) (calendar-gregorian-from-absolute date))
- ((and (listp date) (= (length date) 3)) date)
- ((stringp date)
- (setq date (org-parse-time-string date))
- (list (nth 4 date) (nth 3 date) (nth 5 date)))
- ((listp date)
- (list (nth 4 date) (nth 3 date) (nth 5 date)))))
-
-(defun org-parse-time-string (s &optional nodefault)
- "Parse the standard Org-mode time string.
-This should be a lot faster than the normal `parse-time-string'.
-If time is not given, defaults to 0:00. However, with optional NODEFAULT,
-hour and minute fields will be nil if not given."
- (if (string-match org-ts-regexp0 s)
- (list 0
- (if (or (match-beginning 8) (not nodefault))
- (string-to-number (or (match-string 8 s) "0")))
- (if (or (match-beginning 7) (not nodefault))
- (string-to-number (or (match-string 7 s) "0")))
- (string-to-number (match-string 4 s))
- (string-to-number (match-string 3 s))
- (string-to-number (match-string 2 s))
- nil nil nil)
- (error "Not a standard Org-mode time string: %s" s)))
-
-(defun org-timestamp-up (&optional arg)
- "Increase the date item at the cursor by one.
-If the cursor is on the year, change the year. If it is on the month or
-the day, change that.
-With prefix ARG, change by that many units."
- (interactive "p")
- (org-timestamp-change (prefix-numeric-value arg) nil 'updown))
-
-(defun org-timestamp-down (&optional arg)
- "Decrease the date item at the cursor by one.
-If the cursor is on the year, change the year. If it is on the month or
-the day, change that.
-With prefix ARG, change by that many units."
- (interactive "p")
- (org-timestamp-change (- (prefix-numeric-value arg)) nil 'updown))
-
-(defun org-timestamp-up-day (&optional arg)
- "Increase the date in the time stamp by one day.
-With prefix ARG, change that many days."
- (interactive "p")
- (if (and (not (org-at-timestamp-p t))
- (org-on-heading-p))
- (org-todo 'up)
- (org-timestamp-change (prefix-numeric-value arg) 'day 'updown)))
-
-(defun org-timestamp-down-day (&optional arg)
- "Decrease the date in the time stamp by one day.
-With prefix ARG, change that many days."
- (interactive "p")
- (if (and (not (org-at-timestamp-p t))
- (org-on-heading-p))
- (org-todo 'down)
- (org-timestamp-change (- (prefix-numeric-value arg)) 'day) 'updown))
-
-(defun org-at-timestamp-p (&optional inactive-ok)
- "Determine if the cursor is in or at a timestamp."
- (interactive)
- (let* ((tsr (if inactive-ok org-ts-regexp3 org-ts-regexp2))
- (pos (point))
- (ans (or (looking-at tsr)
- (save-excursion
- (skip-chars-backward "^[<\n\r\t")
- (if (> (point) (point-min)) (backward-char 1))
- (and (looking-at tsr)
- (> (- (match-end 0) pos) -1))))))
- (and ans
- (boundp 'org-ts-what)
- (setq org-ts-what
- (cond
- ((= pos (match-beginning 0)) 'bracket)
- ((= pos (1- (match-end 0))) 'bracket)
- ((org-pos-in-match-range pos 2) 'year)
- ((org-pos-in-match-range pos 3) 'month)
- ((org-pos-in-match-range pos 7) 'hour)
- ((org-pos-in-match-range pos 8) 'minute)
- ((or (org-pos-in-match-range pos 4)
- (org-pos-in-match-range pos 5)) 'day)
- ((and (> pos (or (match-end 8) (match-end 5)))
- (< pos (match-end 0)))
- (- pos (or (match-end 8) (match-end 5))))
- (t 'day))))
- ans))
-
-(defun org-toggle-timestamp-type ()
- "Toggle the type (<active> or [inactive]) of a time stamp."
- (interactive)
- (when (org-at-timestamp-p t)
- (let ((beg (match-beginning 0)) (end (match-end 0))
- (map '((?\[ . "<") (?\] . ">") (?< . "[") (?> . "]"))))
- (save-excursion
- (goto-char beg)
- (while (re-search-forward "[][<>]" end t)
- (replace-match (cdr (assoc (char-after (match-beginning 0)) map))
- t t)))
- (message "Timestamp is now %sactive"
- (if (equal (char-after beg) ?<) "" "in")))))
-
-(defun org-timestamp-change (n &optional what updown)
- "Change the date in the time stamp at point.
-The date will be changed by N times WHAT. WHAT can be `day', `month',
-`year', `minute', `second'. If WHAT is not given, the cursor position
-in the timestamp determines what will be changed."
- (let ((pos (point))
- with-hm inactive
- (dm (max (nth 1 org-time-stamp-rounding-minutes) 1))
- org-ts-what
- extra rem
- ts time time0)
- (if (not (org-at-timestamp-p t))
- (error "Not at a timestamp"))
- (if (and (not what) (eq org-ts-what 'bracket))
- (org-toggle-timestamp-type)
- (if (and (not what) (not (eq org-ts-what 'day))
- org-display-custom-times
- (get-text-property (point) 'display)
- (not (get-text-property (1- (point)) 'display)))
- (setq org-ts-what 'day))
- (setq org-ts-what (or what org-ts-what)
- inactive (= (char-after (match-beginning 0)) ?\[)
- ts (match-string 0))
- (replace-match "")
- (if (string-match
- "\\(\\(-[012][0-9]:[0-5][0-9]\\)?\\( +[.+]?[-+][0-9]+[dwmy]\\(/[0-9]+[dwmy]\\)?\\)*\\)[]>]"
- ts)
- (setq extra (match-string 1 ts)))
- (if (string-match "^.\\{10\\}.*?[0-9]+:[0-9][0-9]" ts)
- (setq with-hm t))
- (setq time0 (org-parse-time-string ts))
- (when (and updown
- (eq org-ts-what 'minute)
- (not current-prefix-arg))
- ;; This looks like s-up and s-down. Change by one rounding step.
- (setq n (* dm (cond ((> n 0) 1) ((< n 0) -1) (t 0))))
- (when (not (= 0 (setq rem (% (nth 1 time0) dm))))
- (setcar (cdr time0) (+ (nth 1 time0)
- (if (> n 0) (- rem) (- dm rem))))))
- (setq time
- (encode-time (or (car time0) 0)
- (+ (if (eq org-ts-what 'minute) n 0) (nth 1 time0))
- (+ (if (eq org-ts-what 'hour) n 0) (nth 2 time0))
- (+ (if (eq org-ts-what 'day) n 0) (nth 3 time0))
- (+ (if (eq org-ts-what 'month) n 0) (nth 4 time0))
- (+ (if (eq org-ts-what 'year) n 0) (nth 5 time0))
- (nthcdr 6 time0)))
- (when (and (member org-ts-what '(hour minute))
- extra
- (string-match "-\\([012][0-9]\\):\\([0-5][0-9]\\)" extra))
- (setq extra (org-modify-ts-extra
- extra
- (if (eq org-ts-what 'hour) 2 5)
- n dm)))
- (when (integerp org-ts-what)
- (setq extra (org-modify-ts-extra extra org-ts-what n dm)))
- (if (eq what 'calendar)
- (let ((cal-date (org-get-date-from-calendar)))
- (setcar (nthcdr 4 time0) (nth 0 cal-date)) ; month
- (setcar (nthcdr 3 time0) (nth 1 cal-date)) ; day
- (setcar (nthcdr 5 time0) (nth 2 cal-date)) ; year
- (setcar time0 (or (car time0) 0))
- (setcar (nthcdr 1 time0) (or (nth 1 time0) 0))
- (setcar (nthcdr 2 time0) (or (nth 2 time0) 0))
- (setq time (apply 'encode-time time0))))
- (setq org-last-changed-timestamp
- (org-insert-time-stamp time with-hm inactive nil nil extra))
- (org-clock-update-time-maybe)
- (goto-char pos)
- ;; Try to recenter the calendar window, if any
- (if (and org-calendar-follow-timestamp-change
- (get-buffer-window "*Calendar*" t)
- (memq org-ts-what '(day month year)))
- (org-recenter-calendar (time-to-days time))))))
-
-(defun org-modify-ts-extra (s pos n dm)
- "Change the different parts of the lead-time and repeat fields in timestamp."
- (let ((idx '(("d" . 0) ("w" . 1) ("m" . 2) ("y" . 3) ("d" . -1) ("y" . 4)))
- ng h m new rem)
- (when (string-match "\\(-\\([012][0-9]\\):\\([0-5][0-9]\\)\\)?\\( +\\+\\([0-9]+\\)\\([dmwy]\\)\\)?\\( +-\\([0-9]+\\)\\([dmwy]\\)\\)?" s)
- (cond
- ((or (org-pos-in-match-range pos 2)
- (org-pos-in-match-range pos 3))
- (setq m (string-to-number (match-string 3 s))
- h (string-to-number (match-string 2 s)))
- (if (org-pos-in-match-range pos 2)
- (setq h (+ h n))
- (setq n (* dm (org-no-warnings (signum n))))
- (when (not (= 0 (setq rem (% m dm))))
- (setq m (+ m (if (> n 0) (- rem) (- dm rem)))))
- (setq m (+ m n)))
- (if (< m 0) (setq m (+ m 60) h (1- h)))
- (if (> m 59) (setq m (- m 60) h (1+ h)))
- (setq h (min 24 (max 0 h)))
- (setq ng 1 new (format "-%02d:%02d" h m)))
- ((org-pos-in-match-range pos 6)
- (setq ng 6 new (car (rassoc (+ n (cdr (assoc (match-string 6 s) idx))) idx))))
- ((org-pos-in-match-range pos 5)
- (setq ng 5 new (format "%d" (max 1 (+ n (string-to-number (match-string 5 s)))))))
-
- ((org-pos-in-match-range pos 9)
- (setq ng 9 new (car (rassoc (+ n (cdr (assoc (match-string 9 s) idx))) idx))))
- ((org-pos-in-match-range pos 8)
- (setq ng 8 new (format "%d" (max 0 (+ n (string-to-number (match-string 8 s))))))))
-
- (when ng
- (setq s (concat
- (substring s 0 (match-beginning ng))
- new
- (substring s (match-end ng))))))
- s))
-
-(defun org-recenter-calendar (date)
- "If the calendar is visible, recenter it to DATE."
- (let* ((win (selected-window))
- (cwin (get-buffer-window "*Calendar*" t))
- (calendar-move-hook nil))
- (when cwin
- (select-window cwin)
- (calendar-goto-date (if (listp date) date
- (calendar-gregorian-from-absolute date)))
- (select-window win))))
-
-(defun org-goto-calendar (&optional arg)
- "Go to the Emacs calendar at the current date.
-If there is a time stamp in the current line, go to that date.
-A prefix ARG can be used to force the current date."
- (interactive "P")
- (let ((tsr org-ts-regexp) diff
- (calendar-move-hook nil)
- (calendar-view-holidays-initially-flag nil)
- (calendar-view-diary-initially-flag nil))
- (if (or (org-at-timestamp-p)
- (save-excursion
- (beginning-of-line 1)
- (looking-at (concat ".*" tsr))))
- (let ((d1 (time-to-days (current-time)))
- (d2 (time-to-days
- (org-time-string-to-time (match-string 1)))))
- (setq diff (- d2 d1))))
- (calendar)
- (calendar-goto-today)
- (if (and diff (not arg)) (calendar-forward-day diff))))
-
-(defun org-get-date-from-calendar ()
- "Return a list (month day year) of date at point in calendar."
- (with-current-buffer "*Calendar*"
- (save-match-data
- (calendar-cursor-to-date))))
-
-(defun org-date-from-calendar ()
- "Insert time stamp corresponding to cursor date in *Calendar* buffer.
-If there is already a time stamp at the cursor position, update it."
- (interactive)
- (if (org-at-timestamp-p t)
- (org-timestamp-change 0 'calendar)
- (let ((cal-date (org-get-date-from-calendar)))
- (org-insert-time-stamp
- (encode-time 0 0 0 (nth 1 cal-date) (car cal-date) (nth 2 cal-date))))))
-
-(defun org-minutes-to-hh:mm-string (m)
- "Compute H:MM from a number of minutes."
- (let ((h (/ m 60)))
- (setq m (- m (* 60 h)))
- (format org-time-clocksum-format h m)))
-
-(defun org-hh:mm-string-to-minutes (s)
- "Convert a string H:MM to a number of minutes.
-If the string is just a number, interpret it as minutes.
-In fact, the first hh:mm or number in the string will be taken,
-there can be extra stuff in the string.
-If no number is found, the return value is 0."
- (cond
- ((string-match "\\([0-9]+\\):\\([0-9]+\\)" s)
- (+ (* (string-to-number (match-string 1 s)) 60)
- (string-to-number (match-string 2 s))))
- ((string-match "\\([0-9]+\\)" s)
- (string-to-number (match-string 1 s)))
- (t 0)))
-
-;;;; Files
-
-(defun org-save-all-org-buffers ()
- "Save all Org-mode buffers without user confirmation."
- (interactive)
- (message "Saving all Org-mode buffers...")
- (save-some-buffers t 'org-mode-p)
- (when (featurep 'org-id) (org-id-locations-save))
- (message "Saving all Org-mode buffers... done"))
-
-(defun org-revert-all-org-buffers ()
- "Revert all Org-mode buffers.
-Prompt for confirmation when there are unsaved changes.
-Be sure you know what you are doing before letting this function
-overwrite your changes.
-
-This function is useful in a setup where one tracks org files
-with a version control system, to revert on one machine after pulling
-changes from another. I believe the procedure must be like this:
-
-1. M-x org-save-all-org-buffers
-2. Pull changes from the other machine, resolve conflicts
-3. M-x org-revert-all-org-buffers"
- (interactive)
- (unless (yes-or-no-p "Revert all Org buffers from their files? ")
- (error "Abort"))
- (save-excursion
- (save-window-excursion
- (mapc
- (lambda (b)
- (when (and (with-current-buffer b (org-mode-p))
- (with-current-buffer b buffer-file-name))
- (switch-to-buffer b)
- (revert-buffer t 'no-confirm)))
- (buffer-list))
- (when (and (featurep 'org-id) org-id-track-globally)
- (org-id-locations-load)))))
-
-;;;; Agenda files
-
-;;;###autoload
-(defun org-switchb (&optional arg)
- "Switch between Org buffers.
-With a prefix argument, restrict available to files.
-With two prefix arguments, restrict available buffers to agenda files.
-
-Defaults to `iswitchb' for buffer name completion.
-Set `org-completion-use-ido' to make it use ido instead."
- (interactive "P")
- (let ((blist (cond ((equal arg '(4)) (org-buffer-list 'files))
- ((equal arg '(16)) (org-buffer-list 'agenda))
- (t (org-buffer-list))))
- (org-completion-use-iswitchb org-completion-use-iswitchb)
- (org-completion-use-ido org-completion-use-ido))
- (unless (or org-completion-use-ido org-completion-use-iswitchb)
- (setq org-completion-use-iswitchb t))
- (switch-to-buffer
- (org-icompleting-read "Org buffer: "
- (mapcar 'list (mapcar 'buffer-name blist))
- nil t))))
-
-;;; Define some older names previously used for this functionality
-;;;###autoload
-(defalias 'org-ido-switchb 'org-switchb)
-;;;###autoload
-(defalias 'org-iswitchb 'org-switchb)
-
-(defun org-buffer-list (&optional predicate exclude-tmp)
- "Return a list of Org buffers.
-PREDICATE can be `export', `files' or `agenda'.
-
-export restrict the list to Export buffers.
-files restrict the list to buffers visiting Org files.
-agenda restrict the list to buffers visiting agenda files.
-
-If EXCLUDE-TMP is non-nil, ignore temporary buffers."
- (let* ((bfn nil)
- (agenda-files (and (eq predicate 'agenda)
- (mapcar 'file-truename (org-agenda-files t))))
- (filter
- (cond
- ((eq predicate 'files)
- (lambda (b) (with-current-buffer b (eq major-mode 'org-mode))))
- ((eq predicate 'export)
- (lambda (b) (string-match "\*Org .*Export" (buffer-name b))))
- ((eq predicate 'agenda)
- (lambda (b)
- (with-current-buffer b
- (and (eq major-mode 'org-mode)
- (setq bfn (buffer-file-name b))
- (member (file-truename bfn) agenda-files)))))
- (t (lambda (b) (with-current-buffer b
- (or (eq major-mode 'org-mode)
- (string-match "\*Org .*Export"
- (buffer-name b)))))))))
- (delq nil
- (mapcar
- (lambda(b)
- (if (and (funcall filter b)
- (or (not exclude-tmp)
- (not (string-match "tmp" (buffer-name b)))))
- b
- nil))
- (buffer-list)))))
-
-(defun org-agenda-files (&optional unrestricted archives)
- "Get the list of agenda files.
-Optional UNRESTRICTED means return the full list even if a restriction
-is currently in place.
-When ARCHIVES is t, include all archive files that are really being
-used by the agenda files. If ARCHIVE is `ifmode', do this only if
-`org-agenda-archives-mode' is t."
- (let ((files
- (cond
- ((and (not unrestricted) (get 'org-agenda-files 'org-restrict)))
- ((stringp org-agenda-files) (org-read-agenda-file-list))
- ((listp org-agenda-files) org-agenda-files)
- (t (error "Invalid value of `org-agenda-files'")))))
- (setq files (apply 'append
- (mapcar (lambda (f)
- (if (file-directory-p f)
- (directory-files
- f t org-agenda-file-regexp)
- (list f)))
- files)))
- (when org-agenda-skip-unavailable-files
- (setq files (delq nil
- (mapcar (function
- (lambda (file)
- (and (file-readable-p file) file)))
- files))))
- (when (or (eq archives t)
- (and (eq archives 'ifmode) (eq org-agenda-archives-mode t)))
- (setq files (org-add-archive-files files)))
- files))
-
-(defun org-agenda-file-p (&optional file)
- "Return non-nil, if FILE is an agenda file.
-If FILE is omitted, use the file associated with the current
-buffer."
- (member (or file (buffer-file-name))
- (org-agenda-files t)))
-
-(defun org-edit-agenda-file-list ()
- "Edit the list of agenda files.
-Depending on setup, this either uses customize to edit the variable
-`org-agenda-files', or it visits the file that is holding the list. In the
-latter case, the buffer is set up in a way that saving it automatically kills
-the buffer and restores the previous window configuration."
- (interactive)
- (if (stringp org-agenda-files)
- (let ((cw (current-window-configuration)))
- (find-file org-agenda-files)
- (org-set-local 'org-window-configuration cw)
- (org-add-hook 'after-save-hook
- (lambda ()
- (set-window-configuration
- (prog1 org-window-configuration
- (kill-buffer (current-buffer))))
- (org-install-agenda-files-menu)
- (message "New agenda file list installed"))
- nil 'local)
- (message "%s" (substitute-command-keys
- "Edit list and finish with \\[save-buffer]")))
- (customize-variable 'org-agenda-files)))
-
-(defun org-store-new-agenda-file-list (list)
- "Set new value for the agenda file list and save it correctly."
- (if (stringp org-agenda-files)
- (let ((fe (org-read-agenda-file-list t)) b u)
- (while (setq b (find-buffer-visiting org-agenda-files))
- (kill-buffer b))
- (with-temp-file org-agenda-files
- (insert
- (mapconcat
- (lambda (f) ;; Keep un-expanded entries.
- (if (setq u (assoc f fe))
- (cdr u)
- f))
- list "\n")
- "\n")))
- (let ((org-mode-hook nil) (org-inhibit-startup t)
- (org-insert-mode-line-in-empty-file nil))
- (setq org-agenda-files list)
- (customize-save-variable 'org-agenda-files org-agenda-files))))
-
-(defun org-read-agenda-file-list (&optional pair-with-expansion)
- "Read the list of agenda files from a file.
-If PAIR-WITH-EXPANSION is t return pairs with un-expanded
-filenames, used by `org-store-new-agenda-file-list' to write back
-un-expanded file names."
- (when (file-directory-p org-agenda-files)
- (error "`org-agenda-files' cannot be a single directory"))
- (when (stringp org-agenda-files)
- (with-temp-buffer
- (insert-file-contents org-agenda-files)
- (mapcar
- (lambda (f)
- (let ((e (expand-file-name (substitute-in-file-name f)
- org-directory)))
- (if pair-with-expansion
- (cons e f)
- e)))
- (org-split-string (buffer-string) "[ \t\r\n]*?[\r\n][ \t\r\n]*")))))
-
-;;;###autoload
-(defun org-cycle-agenda-files ()
- "Cycle through the files in `org-agenda-files'.
-If the current buffer visits an agenda file, find the next one in the list.
-If the current buffer does not, find the first agenda file."
- (interactive)
- (let* ((fs (org-agenda-files t))
- (files (append fs (list (car fs))))
- (tcf (if buffer-file-name (file-truename buffer-file-name)))
- file)
- (unless files (error "No agenda files"))
- (catch 'exit
- (while (setq file (pop files))
- (if (equal (file-truename file) tcf)
- (when (car files)
- (find-file (car files))
- (throw 'exit t))))
- (find-file (car fs)))
- (if (buffer-base-buffer) (switch-to-buffer (buffer-base-buffer)))))
-
-(defun org-agenda-file-to-front (&optional to-end)
- "Move/add the current file to the top of the agenda file list.
-If the file is not present in the list, it is added to the front. If it is
-present, it is moved there. With optional argument TO-END, add/move to the
-end of the list."
- (interactive "P")
- (let ((org-agenda-skip-unavailable-files nil)
- (file-alist (mapcar (lambda (x)
- (cons (file-truename x) x))
- (org-agenda-files t)))
- (ctf (file-truename buffer-file-name))
- x had)
- (setq x (assoc ctf file-alist) had x)
-
- (if (not x) (setq x (cons ctf (abbreviate-file-name buffer-file-name))))
- (if to-end
- (setq file-alist (append (delq x file-alist) (list x)))
- (setq file-alist (cons x (delq x file-alist))))
- (org-store-new-agenda-file-list (mapcar 'cdr file-alist))
- (org-install-agenda-files-menu)
- (message "File %s to %s of agenda file list"
- (if had "moved" "added") (if to-end "end" "front"))))
-
-(defun org-remove-file (&optional file)
- "Remove current file from the list of files in variable `org-agenda-files'.
-These are the files which are being checked for agenda entries.
-Optional argument FILE means use this file instead of the current."
- (interactive)
- (let* ((org-agenda-skip-unavailable-files nil)
- (file (or file buffer-file-name))
- (true-file (file-truename file))
- (afile (abbreviate-file-name file))
- (files (delq nil (mapcar
- (lambda (x)
- (if (equal true-file
- (file-truename x))
- nil x))
- (org-agenda-files t)))))
- (if (not (= (length files) (length (org-agenda-files t))))
- (progn
- (org-store-new-agenda-file-list files)
- (org-install-agenda-files-menu)
- (message "Removed file: %s" afile))
- (message "File was not in list: %s (not removed)" afile))))
-
-(defun org-file-menu-entry (file)
- (vector file (list 'find-file file) t))
-
-(defun org-check-agenda-file (file)
- "Make sure FILE exists. If not, ask user what to do."
- (when (not (file-exists-p file))
- (message "non-existent agenda file %s. [R]emove from list or [A]bort?"
- (abbreviate-file-name file))
- (let ((r (downcase (read-char-exclusive))))
- (cond
- ((equal r ?r)
- (org-remove-file file)
- (throw 'nextfile t))
- (t (error "Abort"))))))
-
-(defun org-get-agenda-file-buffer (file)
- "Get a buffer visiting FILE. If the buffer needs to be created, add
-it to the list of buffers which might be released later."
- (let ((buf (org-find-base-buffer-visiting file)))
- (if buf
- buf ; just return it
- ;; Make a new buffer and remember it
- (setq buf (find-file-noselect file))
- (if buf (push buf org-agenda-new-buffers))
- buf)))
-
-(defun org-release-buffers (blist)
- "Release all buffers in list, asking the user for confirmation when needed.
-When a buffer is unmodified, it is just killed. When modified, it is saved
-\(if the user agrees) and then killed."
- (let (buf file)
- (while (setq buf (pop blist))
- (setq file (buffer-file-name buf))
- (when (and (buffer-modified-p buf)
- file
- (y-or-n-p (format "Save file %s? " file)))
- (with-current-buffer buf (save-buffer)))
- (kill-buffer buf))))
-
-(defun org-prepare-agenda-buffers (files)
- "Create buffers for all agenda files, protect archived trees and comments."
- (interactive)
- (let ((pa '(:org-archived t))
- (pc '(:org-comment t))
- (pall '(:org-archived t :org-comment t))
- (inhibit-read-only t)
- (rea (concat ":" org-archive-tag ":"))
- bmp file re)
- (save-excursion
- (save-restriction
- (while (setq file (pop files))
- (catch 'nextfile
- (if (bufferp file)
- (set-buffer file)
- (org-check-agenda-file file)
- (set-buffer (org-get-agenda-file-buffer file)))
- (widen)
- (setq bmp (buffer-modified-p))
- (org-refresh-category-properties)
- (setq org-todo-keywords-for-agenda
- (append org-todo-keywords-for-agenda org-todo-keywords-1))
- (setq org-done-keywords-for-agenda
- (append org-done-keywords-for-agenda org-done-keywords))
- (setq org-todo-keyword-alist-for-agenda
- (append org-todo-keyword-alist-for-agenda org-todo-key-alist))
- (setq org-drawers-for-agenda
- (append org-drawers-for-agenda org-drawers))
- (setq org-tag-alist-for-agenda
- (append org-tag-alist-for-agenda org-tag-alist))
-
- (save-excursion
- (remove-text-properties (point-min) (point-max) pall)
- (when org-agenda-skip-archived-trees
- (goto-char (point-min))
- (while (re-search-forward rea nil t)
- (if (org-on-heading-p t)
- (add-text-properties (point-at-bol) (org-end-of-subtree t) pa))))
- (goto-char (point-min))
- (setq re (concat "^\\*+ +" org-comment-string "\\>"))
- (while (re-search-forward re nil t)
- (add-text-properties
- (match-beginning 0) (org-end-of-subtree t) pc)))
- (set-buffer-modified-p bmp)))))
- (setq org-todo-keywords-for-agenda
- (org-uniquify org-todo-keywords-for-agenda))
- (setq org-todo-keyword-alist-for-agenda
- (org-uniquify org-todo-keyword-alist-for-agenda)
- org-tag-alist-for-agenda (org-uniquify org-tag-alist-for-agenda))))
-
-;;;; Embedded LaTeX
-
-(defvar org-cdlatex-mode-map (make-sparse-keymap)
- "Keymap for the minor `org-cdlatex-mode'.")
-
-(org-defkey org-cdlatex-mode-map "_" 'org-cdlatex-underscore-caret)
-(org-defkey org-cdlatex-mode-map "^" 'org-cdlatex-underscore-caret)
-(org-defkey org-cdlatex-mode-map "`" 'cdlatex-math-symbol)
-(org-defkey org-cdlatex-mode-map "'" 'org-cdlatex-math-modify)
-(org-defkey org-cdlatex-mode-map "\C-c{" 'cdlatex-environment)
-
-(defvar org-cdlatex-texmathp-advice-is-done nil
- "Flag remembering if we have applied the advice to texmathp already.")
-
-(define-minor-mode org-cdlatex-mode
- "Toggle the minor `org-cdlatex-mode'.
-This mode supports entering LaTeX environment and math in LaTeX fragments
-in Org-mode.
-\\{org-cdlatex-mode-map}"
- nil " OCDL" nil
- (when org-cdlatex-mode (require 'cdlatex))
- (unless org-cdlatex-texmathp-advice-is-done
- (setq org-cdlatex-texmathp-advice-is-done t)
- (defadvice texmathp (around org-math-always-on activate)
- "Always return t in org-mode buffers.
-This is because we want to insert math symbols without dollars even outside
-the LaTeX math segments. If Orgmode thinks that point is actually inside
-an embedded LaTeX fragment, let texmathp do its job.
-\\[org-cdlatex-mode-map]"
- (interactive)
- (let (p)
- (cond
- ((not (org-mode-p)) ad-do-it)
- ((eq this-command 'cdlatex-math-symbol)
- (setq ad-return-value t
- texmathp-why '("cdlatex-math-symbol in org-mode" . 0)))
- (t
- (let ((p (org-inside-LaTeX-fragment-p)))
- (if (and p (member (car p) (plist-get org-format-latex-options :matchers)))
- (setq ad-return-value t
- texmathp-why '("Org-mode embedded math" . 0))
- (if p ad-do-it)))))))))
-
-(defun turn-on-org-cdlatex ()
- "Unconditionally turn on `org-cdlatex-mode'."
- (org-cdlatex-mode 1))
-
-(defun org-inside-LaTeX-fragment-p ()
- "Test if point is inside a LaTeX fragment.
-I.e. after a \\begin, \\(, \\[, $, or $$, without the corresponding closing
-sequence appearing also before point.
-Even though the matchers for math are configurable, this function assumes
-that \\begin, \\(, \\[, and $$ are always used. Only the single dollar
-delimiters are skipped when they have been removed by customization.
-The return value is nil, or a cons cell with the delimiter and
-and the position of this delimiter.
-
-This function does a reasonably good job, but can locally be fooled by
-for example currency specifications. For example it will assume being in
-inline math after \"$22.34\". The LaTeX fragment formatter will only format
-fragments that are properly closed, but during editing, we have to live
-with the uncertainty caused by missing closing delimiters. This function
-looks only before point, not after."
- (catch 'exit
- (let ((pos (point))
- (dodollar (member "$" (plist-get org-format-latex-options :matchers)))
- (lim (progn
- (re-search-backward (concat "^\\(" paragraph-start "\\)") nil t)
- (point)))
- dd-on str (start 0) m re)
- (goto-char pos)
- (when dodollar
- (setq str (concat (buffer-substring lim (point)) "\000 X$.")
- re (nth 1 (assoc "$" org-latex-regexps)))
- (while (string-match re str start)
- (cond
- ((= (match-end 0) (length str))
- (throw 'exit (cons "$" (+ lim (match-beginning 0) 1))))
- ((= (match-end 0) (- (length str) 5))
- (throw 'exit nil))
- (t (setq start (match-end 0))))))
- (when (setq m (re-search-backward "\\(\\\\begin{[^}]*}\\|\\\\(\\|\\\\\\[\\)\\|\\(\\\\end{[^}]*}\\|\\\\)\\|\\\\\\]\\)\\|\\(\\$\\$\\)" lim t))
- (goto-char pos)
- (and (match-beginning 1) (throw 'exit (cons (match-string 1) m)))
- (and (match-beginning 2) (throw 'exit nil))
- ;; count $$
- (while (re-search-backward "\\$\\$" lim t)
- (setq dd-on (not dd-on)))
- (goto-char pos)
- (if dd-on (cons "$$" m))))))
-
-(defun org-inside-latex-macro-p ()
- "Is point inside a LaTeX macro or its arguments?"
- (save-match-data
- (org-in-regexp
- "\\\\[a-zA-Z]+\\*?\\(\\(\\[[^][\n{}]*\\]\\)\\|\\({[^{}\n]*}\\)\\)*")))
-
-(defun org-try-cdlatex-tab ()
- "Check if it makes sense to execute `cdlatex-tab', and do it if yes.
-It makes sense to do so if `org-cdlatex-mode' is active and if the cursor is
- - inside a LaTeX fragment, or
- - after the first word in a line, where an abbreviation expansion could
- insert a LaTeX environment."
- (when org-cdlatex-mode
- (cond
- ((save-excursion
- (skip-chars-backward "a-zA-Z0-9*")
- (skip-chars-backward " \t")
- (bolp))
- (cdlatex-tab) t)
- ((org-inside-LaTeX-fragment-p)
- (cdlatex-tab) t)
- (t nil))))
-
-(defun org-cdlatex-underscore-caret (&optional arg)
- "Execute `cdlatex-sub-superscript' in LaTeX fragments.
-Revert to the normal definition outside of these fragments."
- (interactive "P")
- (if (org-inside-LaTeX-fragment-p)
- (call-interactively 'cdlatex-sub-superscript)
- (let (org-cdlatex-mode)
- (call-interactively (key-binding (vector last-input-event))))))
-
-(defun org-cdlatex-math-modify (&optional arg)
- "Execute `cdlatex-math-modify' in LaTeX fragments.
-Revert to the normal definition outside of these fragments."
- (interactive "P")
- (if (org-inside-LaTeX-fragment-p)
- (call-interactively 'cdlatex-math-modify)
- (let (org-cdlatex-mode)
- (call-interactively (key-binding (vector last-input-event))))))
-
-(defvar org-latex-fragment-image-overlays nil
- "List of overlays carrying the images of latex fragments.")
-(make-variable-buffer-local 'org-latex-fragment-image-overlays)
-
-(defun org-remove-latex-fragment-image-overlays ()
- "Remove all overlays with LaTeX fragment images in current buffer."
- (mapc 'delete-overlay org-latex-fragment-image-overlays)
- (setq org-latex-fragment-image-overlays nil))
-
-(defun org-preview-latex-fragment (&optional subtree)
- "Preview the LaTeX fragment at point, or all locally or globally.
-If the cursor is in a LaTeX fragment, create the image and overlay
-it over the source code. If there is no fragment at point, display
-all fragments in the current text, from one headline to the next. With
-prefix SUBTREE, display all fragments in the current subtree. With a
-double prefix arg \\[universal-argument] \\[universal-argument], or when \
-the cursor is before the first headline,
-display all fragments in the buffer.
-The images can be removed again with \\[org-ctrl-c-ctrl-c]."
- (interactive "P")
- (org-remove-latex-fragment-image-overlays)
- (save-excursion
- (save-restriction
- (let (beg end at msg)
- (cond
- ((or (equal subtree '(16))
- (not (save-excursion
- (re-search-backward (concat "^" outline-regexp) nil t))))
- (setq beg (point-min) end (point-max)
- msg "Creating images for buffer...%s"))
- ((equal subtree '(4))
- (org-back-to-heading)
- (setq beg (point) end (org-end-of-subtree t)
- msg "Creating images for subtree...%s"))
- (t
- (if (setq at (org-inside-LaTeX-fragment-p))
- (goto-char (max (point-min) (- (cdr at) 2)))
- (org-back-to-heading))
- (setq beg (point) end (progn (outline-next-heading) (point))
- msg (if at "Creating image...%s"
- "Creating images for entry...%s"))))
- (message msg "")
- (narrow-to-region beg end)
- (goto-char beg)
- (org-format-latex
- (concat "ltxpng/" (file-name-sans-extension
- (file-name-nondirectory
- buffer-file-name)))
- default-directory 'overlays msg at 'forbuffer 'dvipng)
- (message msg "done. Use `C-c C-c' to remove images.")))))
-
-(defvar org-latex-regexps
- '(("begin" "^[ \t]*\\(\\\\begin{\\([a-zA-Z0-9\\*]+\\)[^\000]+?\\\\end{\\2}\\)" 1 t)
- ;; ("$" "\\([ (]\\|^\\)\\(\\(\\([$]\\)\\([^ \r\n,.$].*?\\(\n.*?\\)\\{0,5\\}[^ \r\n,.$]\\)\\4\\)\\)\\([ .,?;:'\")]\\|$\\)" 2 nil)
- ;; \000 in the following regex is needed for org-inside-LaTeX-fragment-p
- ("$1" "\\([^$]\\)\\(\\$[^ \r\n,;.$]\\$\\)\\([- .,?;:'\")\000]\\|$\\)" 2 nil)
- ("$" "\\([^$]\\)\\(\\(\\$\\([^ \r\n,;.$][^$\n\r]*?\\(\n[^$\n\r]*?\\)\\{0,2\\}[^ \r\n,.$]\\)\\$\\)\\)\\([- .,?;:'\")\000]\\|$\\)" 2 nil)
- ("\\(" "\\\\([^\000]*?\\\\)" 0 nil)
- ("\\[" "\\\\\\[[^\000]*?\\\\\\]" 0 nil)
- ("$$" "\\$\\$[^\000]*?\\$\\$" 0 nil))
- "Regular expressions for matching embedded LaTeX.")
-
-(defvar org-export-have-math nil) ;; dynamic scoping
-(defun org-format-latex (prefix &optional dir overlays msg at
- forbuffer processing-type)
- "Replace LaTeX fragments with links to an image, and produce images.
-Some of the options can be changed using the variable
-`org-format-latex-options'."
- (if (and overlays (fboundp 'clear-image-cache)) (clear-image-cache))
- (let* ((prefixnodir (file-name-nondirectory prefix))
- (absprefix (expand-file-name prefix dir))
- (todir (file-name-directory absprefix))
- (opt org-format-latex-options)
- (matchers (plist-get opt :matchers))
- (re-list org-latex-regexps)
- (org-format-latex-header-extra
- (plist-get (org-infile-export-plist) :latex-header-extra))
- (cnt 0) txt hash link beg end re e checkdir
- executables-checked string
- m n block linkfile movefile ov)
- ;; Check the different regular expressions
- (while (setq e (pop re-list))
- (setq m (car e) re (nth 1 e) n (nth 2 e)
- block (if (nth 3 e) "\n\n" ""))
- (when (member m matchers)
- (goto-char (point-min))
- (while (re-search-forward re nil t)
- (when (and (or (not at) (equal (cdr at) (match-beginning n)))
- (not (get-text-property (match-beginning n)
- 'org-protected))
- (or (not overlays)
- (not (eq (get-char-property (match-beginning n)
- 'org-overlay-type)
- 'org-latex-overlay))))
- (setq org-export-have-math t)
- (cond
- ((eq processing-type 'verbatim)
- ;; Leave the text verbatim, just protect it
- (add-text-properties (match-beginning n) (match-end n)
- '(org-protected t)))
- ((eq processing-type 'mathjax)
- ;; Prepare for MathJax processing
- (setq string (match-string n))
- (if (member m '("$" "$1"))
- (save-excursion
- (delete-region (match-beginning n) (match-end n))
- (goto-char (match-beginning n))
- (insert (org-add-props (concat "\\(" (substring string 1 -1)
- "\\)")
- '(org-protected t))))
- (add-text-properties (match-beginning n) (match-end n)
- '(org-protected t))))
- ((or (eq processing-type 'dvipng) t)
- ;; Process to an image
- (setq txt (match-string n)
- beg (match-beginning n) end (match-end n)
- cnt (1+ cnt))
- (let (print-length print-level) ; make sure full list is printed
- (setq hash (sha1 (prin1-to-string
- (list org-format-latex-header
- org-format-latex-header-extra
- org-export-latex-default-packages-alist
- org-export-latex-packages-alist
- org-format-latex-options
- forbuffer txt)))
- linkfile (format "%s_%s.png" prefix hash)
- movefile (format "%s_%s.png" absprefix hash)))
- (setq link (concat block "[[file:" linkfile "]]" block))
- (if msg (message msg cnt))
- (goto-char beg)
- (unless checkdir ; make sure the directory exists
- (setq checkdir t)
- (or (file-directory-p todir) (make-directory todir t)))
-
- (unless executables-checked
- (org-check-external-command
- "latex" "needed to convert LaTeX fragments to images")
- (org-check-external-command
- "dvipng" "needed to convert LaTeX fragments to images")
- (setq executables-checked t))
-
- (unless (file-exists-p movefile)
- (org-create-formula-image
- txt movefile opt forbuffer))
- (if overlays
- (progn
- (mapc (lambda (o)
- (if (eq (overlay-get o 'org-overlay-type)
- 'org-latex-overlay)
- (delete-overlay o)))
- (overlays-in beg end))
- (setq ov (make-overlay beg end))
- (overlay-put ov 'org-overlay-type 'org-latex-overlay)
- (if (featurep 'xemacs)
- (progn
- (overlay-put ov 'invisible t)
- (overlay-put
- ov 'end-glyph
- (make-glyph (vector 'png :file movefile))))
- (overlay-put
- ov 'display
- (list 'image :type 'png :file movefile :ascent 'center)))
- (push ov org-latex-fragment-image-overlays)
- (goto-char end))
- (delete-region beg end)
- (insert (org-add-props link
- (list 'org-latex-src
- (replace-regexp-in-string
- "\"" "" txt)))))))))))))
-
-;; This function borrows from Ganesh Swami's latex2png.el
-(defun org-create-formula-image (string tofile options buffer)
- "This calls dvipng."
- (require 'org-latex)
- (let* ((tmpdir (if (featurep 'xemacs)
- (temp-directory)
- temporary-file-directory))
- (texfilebase (make-temp-name
- (expand-file-name "orgtex" tmpdir)))
- (texfile (concat texfilebase ".tex"))
- (dvifile (concat texfilebase ".dvi"))
- (pngfile (concat texfilebase ".png"))
- (fnh (if (featurep 'xemacs)
- (font-height (get-face-font 'default))
- (face-attribute 'default :height nil)))
- (scale (or (plist-get options (if buffer :scale :html-scale)) 1.0))
- (dpi (number-to-string (* scale (floor (* 0.9 (if buffer fnh 140.))))))
- (fg (or (plist-get options (if buffer :foreground :html-foreground))
- "Black"))
- (bg (or (plist-get options (if buffer :background :html-background))
- "Transparent")))
- (if (eq fg 'default) (setq fg (org-dvipng-color :foreground)))
- (if (eq bg 'default) (setq bg (org-dvipng-color :background)))
- (with-temp-file texfile
- (insert (org-splice-latex-header
- org-format-latex-header
- org-export-latex-default-packages-alist
- org-export-latex-packages-alist t
- org-format-latex-header-extra))
- (insert "\n\\begin{document}\n" string "\n\\end{document}\n")
- (require 'org-latex)
- (org-export-latex-fix-inputenc))
- (let ((dir default-directory))
- (condition-case nil
- (progn
- (cd tmpdir)
- (call-process "latex" nil nil nil texfile))
- (error nil))
- (cd dir))
- (if (not (file-exists-p dvifile))
- (progn (message "Failed to create dvi file from %s" texfile) nil)
- (condition-case nil
- (call-process "dvipng" nil nil nil
- "-fg" fg "-bg" bg
- "-D" dpi
- ;;"-x" scale "-y" scale
- "-T" "tight"
- "-o" pngfile
- dvifile)
- (error nil))
- (if (not (file-exists-p pngfile))
- (if org-format-latex-signal-error
- (error "Failed to create png file from %s" texfile)
- (message "Failed to create png file from %s" texfile)
- nil)
- ;; Use the requested file name and clean up
- (copy-file pngfile tofile 'replace)
- (loop for e in '(".dvi" ".tex" ".aux" ".log" ".png") do
- (delete-file (concat texfilebase e)))
- pngfile))))
-
-(defun org-splice-latex-header (tpl def-pkg pkg snippets-p &optional extra)
- "Fill a LaTeX header template TPL.
-In the template, the following place holders will be recognized:
-
- [DEFAULT-PACKAGES] \\usepackage statements for DEF-PKG
- [NO-DEFAULT-PACKAGES] do not include DEF-PKG
- [PACKAGES] \\usepackage statements for PKG
- [NO-PACKAGES] do not include PKG
- [EXTRA] the string EXTRA
- [NO-EXTRA] do not include EXTRA
-
-For backward compatibility, if both the positive and the negative place
-holder is missing, the positive one (without the \"NO-\") will be
-assumed to be present at the end of the template.
-DEF-PKG and PKG are assumed to be alists of options/packagename lists.
-EXTRA is a string.
-SNIPPETS-P indicates if this is run to create snippet images for HTML."
- (let (rpl (end ""))
- (if (string-match "^[ \t]*\\[\\(NO-\\)?DEFAULT-PACKAGES\\][ \t]*\n?" tpl)
- (setq rpl (if (or (match-end 1) (not def-pkg))
- "" (org-latex-packages-to-string def-pkg snippets-p t))
- tpl (replace-match rpl t t tpl))
- (if def-pkg (setq end (org-latex-packages-to-string def-pkg snippets-p))))
-
- (if (string-match "\\[\\(NO-\\)?PACKAGES\\][ \t]*\n?" tpl)
- (setq rpl (if (or (match-end 1) (not pkg))
- "" (org-latex-packages-to-string pkg snippets-p t))
- tpl (replace-match rpl t t tpl))
- (if pkg (setq end
- (concat end "\n"
- (org-latex-packages-to-string pkg snippets-p)))))
-
- (if (string-match "\\[\\(NO-\\)?EXTRA\\][ \t]*\n?" tpl)
- (setq rpl (if (or (match-end 1) (not extra))
- "" (concat extra "\n"))
- tpl (replace-match rpl t t tpl))
- (if (and extra (string-match "\\S-" extra))
- (setq end (concat end "\n" extra))))
-
- (if (string-match "\\S-" end)
- (concat tpl "\n" end)
- tpl)))
-
-(defun org-latex-packages-to-string (pkg &optional snippets-p newline)
- "Turn an alist of packages into a string with the \\usepackage macros."
- (setq pkg (mapconcat (lambda(p)
- (cond
- ((stringp p) p)
- ((and snippets-p (>= (length p) 3) (not (nth 2 p)))
- (format "%% Package %s omitted" (cadr p)))
- ((equal "" (car p))
- (format "\\usepackage{%s}" (cadr p)))
- (t
- (format "\\usepackage[%s]{%s}"
- (car p) (cadr p)))))
- pkg
- "\n"))
- (if newline (concat pkg "\n") pkg))
-
-(defun org-dvipng-color (attr)
- "Return an rgb color specification for dvipng."
- (apply 'format "rgb %s %s %s"
- (mapcar 'org-normalize-color
- (color-values (face-attribute 'default attr nil)))))
-
-(defun org-normalize-color (value)
- "Return string to be used as color value for an RGB component."
- (format "%g" (/ value 65535.0)))
-
-;; Image display
-
-
-(defvar org-inline-image-overlays nil)
-(make-variable-buffer-local 'org-inline-image-overlays)
-
-(defun org-toggle-inline-images (&optional include-linked)
- "Toggle the display of inline images.
-INCLUDE-LINKED is passed to `org-display-inline-images'."
- (interactive "P")
- (if org-inline-image-overlays
- (progn
- (org-remove-inline-images)
- (message "Inline image display turned off"))
- (org-display-inline-images include-linked)
- (if org-inline-image-overlays
- (message "%d images displayed inline"
- (length org-inline-image-overlays))
- (message "No images to display inline"))))
-
-(defun org-display-inline-images (&optional include-linked refresh beg end)
- "Display inline images.
-Normally only links without a description part are inlined, because this
-is how it will work for export. When INCLUDE-LINKED is set, also links
-with a description part will be inlined. This can be nice for a quick
-look at those images, but it does not reflect what exported files will look
-like.
-When REFRESH is set, refresh existing images between BEG and END.
-This will create new image displays only if necessary.
-BEG and END default to the buffer boundaries."
- (interactive "P")
- (unless refresh
- (org-remove-inline-images)
- (clear-image-cache))
- (save-excursion
- (save-restriction
- (widen)
- (setq beg (or beg (point-min)) end (or end (point-max)))
- (goto-char (point-min))
- (let ((re (concat "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?"
- (substring (org-image-file-name-regexp) 0 -2)
- "\\)\\]" (if include-linked "" "\\]")))
- old file ov img)
- (while (re-search-forward re end t)
- (setq old (get-char-property-and-overlay (match-beginning 1)
- 'org-image-overlay))
- (setq file (expand-file-name
- (concat (or (match-string 3) "") (match-string 4))))
- (when (file-exists-p file)
- (if (and (car-safe old) refresh)
- (image-refresh (overlay-get (cdr old) 'display))
- (setq img (save-match-data (create-image file)))
- (when img
- (setq ov (make-overlay (match-beginning 0) (match-end 0)))
- (overlay-put ov 'display img)
- (overlay-put ov 'face 'default)
- (overlay-put ov 'org-image-overlay t)
- (overlay-put ov 'modification-hooks
- (list 'org-display-inline-modification-hook))
- (push ov org-inline-image-overlays)))))))))
-
-(defun org-display-inline-modification-hook (ov after beg end &optional len)
- "Remove inline-display overlay if a corresponding region is modified."
- (let ((inhibit-modification-hooks t))
- (when (and ov after)
- (delete ov org-inline-image-overlays)
- (delete-overlay ov))))
-
-(defun org-remove-inline-images ()
- "Remove inline display of images."
- (interactive)
- (mapc 'delete-overlay org-inline-image-overlays)
- (setq org-inline-image-overlays nil))
-
-;;;; Key bindings
-
-;; Make `C-c C-x' a prefix key
-(org-defkey org-mode-map "\C-c\C-x" (make-sparse-keymap))
-
-;; TAB key with modifiers
-(org-defkey org-mode-map "\C-i" 'org-cycle)
-(org-defkey org-mode-map [(tab)] 'org-cycle)
-(org-defkey org-mode-map [(control tab)] 'org-force-cycle-archived)
-(org-defkey org-mode-map [(meta tab)] 'pcomplete)
-(org-defkey org-mode-map "\M-\t" 'pcomplete)
-(org-defkey org-mode-map "\M-\C-i" 'pcomplete)
-;; The following line is necessary under Suse GNU/Linux
-(unless (featurep 'xemacs)
- (org-defkey org-mode-map [S-iso-lefttab] 'org-shifttab))
-(org-defkey org-mode-map [(shift tab)] 'org-shifttab)
-(define-key org-mode-map [backtab] 'org-shifttab)
-
-(org-defkey org-mode-map [(shift return)] 'org-table-copy-down)
-(org-defkey org-mode-map [(meta shift return)] 'org-insert-todo-heading)
-(org-defkey org-mode-map [(meta return)] 'org-meta-return)
-
-;; Cursor keys with modifiers
-(org-defkey org-mode-map [(meta left)] 'org-metaleft)
-(org-defkey org-mode-map [(meta right)] 'org-metaright)
-(org-defkey org-mode-map [(meta up)] 'org-metaup)
-(org-defkey org-mode-map [(meta down)] 'org-metadown)
-
-(org-defkey org-mode-map [(meta shift left)] 'org-shiftmetaleft)
-(org-defkey org-mode-map [(meta shift right)] 'org-shiftmetaright)
-(org-defkey org-mode-map [(meta shift up)] 'org-shiftmetaup)
-(org-defkey org-mode-map [(meta shift down)] 'org-shiftmetadown)
-
-(org-defkey org-mode-map [(shift up)] 'org-shiftup)
-(org-defkey org-mode-map [(shift down)] 'org-shiftdown)
-(org-defkey org-mode-map [(shift left)] 'org-shiftleft)
-(org-defkey org-mode-map [(shift right)] 'org-shiftright)
-
-(org-defkey org-mode-map [(control shift right)] 'org-shiftcontrolright)
-(org-defkey org-mode-map [(control shift left)] 'org-shiftcontrolleft)
-
-;; Babel keys
-(define-key org-mode-map org-babel-key-prefix org-babel-map)
-(mapc (lambda (pair)
- (define-key org-babel-map (car pair) (cdr pair)))
- org-babel-key-bindings)
-
-;;; Extra keys for tty access.
-;; We only set them when really needed because otherwise the
-;; menus don't show the simple keys
-
-(when (or org-use-extra-keys
- (featurep 'xemacs) ;; because XEmacs supports multi-device stuff
- (not window-system))
- (org-defkey org-mode-map "\C-c\C-xc" 'org-table-copy-down)
- (org-defkey org-mode-map "\C-c\C-xM" 'org-insert-todo-heading)
- (org-defkey org-mode-map "\C-c\C-xm" 'org-meta-return)
- (org-defkey org-mode-map [?\e (return)] 'org-meta-return)
- (org-defkey org-mode-map [?\e (left)] 'org-metaleft)
- (org-defkey org-mode-map "\C-c\C-xl" 'org-metaleft)
- (org-defkey org-mode-map [?\e (right)] 'org-metaright)
- (org-defkey org-mode-map "\C-c\C-xr" 'org-metaright)
- (org-defkey org-mode-map [?\e (up)] 'org-metaup)
- (org-defkey org-mode-map "\C-c\C-xu" 'org-metaup)
- (org-defkey org-mode-map [?\e (down)] 'org-metadown)
- (org-defkey org-mode-map "\C-c\C-xd" 'org-metadown)
- (org-defkey org-mode-map "\C-c\C-xL" 'org-shiftmetaleft)
- (org-defkey org-mode-map "\C-c\C-xR" 'org-shiftmetaright)
- (org-defkey org-mode-map "\C-c\C-xU" 'org-shiftmetaup)
- (org-defkey org-mode-map "\C-c\C-xD" 'org-shiftmetadown)
- (org-defkey org-mode-map [?\C-c (up)] 'org-shiftup)
- (org-defkey org-mode-map [?\C-c (down)] 'org-shiftdown)
- (org-defkey org-mode-map [?\C-c (left)] 'org-shiftleft)
- (org-defkey org-mode-map [?\C-c (right)] 'org-shiftright)
- (org-defkey org-mode-map [?\C-c ?\C-x (right)] 'org-shiftcontrolright)
- (org-defkey org-mode-map [?\C-c ?\C-x (left)] 'org-shiftcontrolleft)
- (org-defkey org-mode-map [?\e (tab)] 'pcomplete)
- (org-defkey org-mode-map [?\e (shift return)] 'org-insert-todo-heading)
- (org-defkey org-mode-map [?\e (shift left)] 'org-shiftmetaleft)
- (org-defkey org-mode-map [?\e (shift right)] 'org-shiftmetaright)
- (org-defkey org-mode-map [?\e (shift up)] 'org-shiftmetaup)
- (org-defkey org-mode-map [?\e (shift down)] 'org-shiftmetadown))
-
- ;; All the other keys
-
-(org-defkey org-mode-map "\C-c\C-a" 'show-all) ; in case allout messed up.
-(org-defkey org-mode-map "\C-c\C-r" 'org-reveal)
-(if (boundp 'narrow-map)
- (org-defkey narrow-map "s" 'org-narrow-to-subtree)
- (org-defkey org-mode-map "\C-xns" 'org-narrow-to-subtree))
-(org-defkey org-mode-map "\C-c\C-f" 'org-forward-same-level)
-(org-defkey org-mode-map "\C-c\C-b" 'org-backward-same-level)
-(org-defkey org-mode-map "\C-c$" 'org-archive-subtree)
-(org-defkey org-mode-map "\C-c\C-x\C-s" 'org-advertized-archive-subtree)
-(org-defkey org-mode-map "\C-c\C-x\C-a" 'org-archive-subtree-default)
-(org-defkey org-mode-map "\C-c\C-xa" 'org-toggle-archive-tag)
-(org-defkey org-mode-map "\C-c\C-xA" 'org-archive-to-archive-sibling)
-(org-defkey org-mode-map "\C-c\C-xb" 'org-tree-to-indirect-buffer)
-(org-defkey org-mode-map "\C-c\C-j" 'org-goto)
-(org-defkey org-mode-map "\C-c\C-t" 'org-todo)
-(org-defkey org-mode-map "\C-c\C-q" 'org-set-tags-command)
-(org-defkey org-mode-map "\C-c\C-s" 'org-schedule)
-(org-defkey org-mode-map "\C-c\C-d" 'org-deadline)
-(org-defkey org-mode-map "\C-c;" 'org-toggle-comment)
-(org-defkey org-mode-map "\C-c\C-w" 'org-refile)
-(org-defkey org-mode-map "\C-c/" 'org-sparse-tree) ; Minor-mode reserved
-(org-defkey org-mode-map "\C-c\\" 'org-match-sparse-tree) ; Minor-mode res.
-(org-defkey org-mode-map "\C-c\C-m" 'org-ctrl-c-ret)
-(org-defkey org-mode-map "\M-\C-m" 'org-insert-heading)
-(org-defkey org-mode-map "\C-c\C-xc" 'org-clone-subtree-with-time-shift)
-(org-defkey org-mode-map [(control return)] 'org-insert-heading-respect-content)
-(org-defkey org-mode-map [(shift control return)] 'org-insert-todo-heading-respect-content)
-(org-defkey org-mode-map "\C-c\C-x\C-n" 'org-next-link)
-(org-defkey org-mode-map "\C-c\C-x\C-p" 'org-previous-link)
-(org-defkey org-mode-map "\C-c\C-l" 'org-insert-link)
-(org-defkey org-mode-map "\C-c\C-o" 'org-open-at-point)
-(org-defkey org-mode-map "\C-c%" 'org-mark-ring-push)
-(org-defkey org-mode-map "\C-c&" 'org-mark-ring-goto)
-(org-defkey org-mode-map "\C-c\C-z" 'org-add-note) ; Alternative binding
-(org-defkey org-mode-map "\C-c." 'org-time-stamp) ; Minor-mode reserved
-(org-defkey org-mode-map "\C-c!" 'org-time-stamp-inactive) ; Minor-mode r.
-(org-defkey org-mode-map "\C-c," 'org-priority) ; Minor-mode reserved
-(org-defkey org-mode-map "\C-c\C-y" 'org-evaluate-time-range)
-(org-defkey org-mode-map "\C-c>" 'org-goto-calendar)
-(org-defkey org-mode-map "\C-c<" 'org-date-from-calendar)
-(org-defkey org-mode-map [(control ?,)] 'org-cycle-agenda-files)
-(org-defkey org-mode-map [(control ?\')] 'org-cycle-agenda-files)
-(org-defkey org-mode-map "\C-c[" 'org-agenda-file-to-front)
-(org-defkey org-mode-map "\C-c]" 'org-remove-file)
-(org-defkey org-mode-map "\C-c\C-x<" 'org-agenda-set-restriction-lock)
-(org-defkey org-mode-map "\C-c\C-x>" 'org-agenda-remove-restriction-lock)
-(org-defkey org-mode-map "\C-c-" 'org-ctrl-c-minus)
-(org-defkey org-mode-map "\C-c*" 'org-ctrl-c-star)
-(org-defkey org-mode-map "\C-c^" 'org-sort)
-(org-defkey org-mode-map "\C-c\C-c" 'org-ctrl-c-ctrl-c)
-(org-defkey org-mode-map "\C-c\C-k" 'org-kill-note-or-show-branches)
-(org-defkey org-mode-map "\C-c#" 'org-update-statistics-cookies)
-(org-defkey org-mode-map "\C-m" 'org-return)
-(org-defkey org-mode-map "\C-j" 'org-return-indent)
-(org-defkey org-mode-map "\C-c?" 'org-table-field-info)
-(org-defkey org-mode-map "\C-c " 'org-table-blank-field)
-(org-defkey org-mode-map "\C-c+" 'org-table-sum)
-(org-defkey org-mode-map "\C-c=" 'org-table-eval-formula)
-(org-defkey org-mode-map "\C-c'" 'org-edit-special)
-(org-defkey org-mode-map "\C-c`" 'org-table-edit-field)
-(org-defkey org-mode-map "\C-c|" 'org-table-create-or-convert-from-region)
-(org-defkey org-mode-map [(control ?#)] 'org-table-rotate-recalc-marks)
-(org-defkey org-mode-map "\C-c~" 'org-table-create-with-table.el)
-(org-defkey org-mode-map "\C-c\C-a" 'org-attach)
-(org-defkey org-mode-map "\C-c}" 'org-table-toggle-coordinate-overlays)
-(org-defkey org-mode-map "\C-c{" 'org-table-toggle-formula-debugger)
-(org-defkey org-mode-map "\C-c\C-e" 'org-export)
-(org-defkey org-mode-map "\C-c:" 'org-toggle-fixed-width-section)
-(org-defkey org-mode-map "\C-c\C-x\C-f" 'org-emphasize)
-(org-defkey org-mode-map "\C-c\C-xf" 'org-footnote-action)
-(org-defkey org-mode-map "\C-c\C-x\C-mg" 'org-mobile-pull)
-(org-defkey org-mode-map "\C-c\C-x\C-mp" 'org-mobile-push)
-(org-defkey org-mode-map "\C-c@" 'org-mark-subtree)
-(org-defkey org-mode-map [?\C-c (control ?*)] 'org-list-make-subtree)
-;;(org-defkey org-mode-map [?\C-c (control ?-)] 'org-list-make-list-from-subtree)
-
-(org-defkey org-mode-map "\C-c\C-x\C-k" 'org-mark-entry-for-agenda-action)
-(org-defkey org-mode-map "\C-c\C-x\C-w" 'org-cut-special)
-(org-defkey org-mode-map "\C-c\C-x\M-w" 'org-copy-special)
-(org-defkey org-mode-map "\C-c\C-x\C-y" 'org-paste-special)
-
-(org-defkey org-mode-map "\C-c\C-x\C-t" 'org-toggle-time-stamp-overlays)
-(org-defkey org-mode-map "\C-c\C-x\C-i" 'org-clock-in)
-(org-defkey org-mode-map "\C-c\C-x\C-o" 'org-clock-out)
-(org-defkey org-mode-map "\C-c\C-x\C-j" 'org-clock-goto)
-(org-defkey org-mode-map "\C-c\C-x\C-x" 'org-clock-cancel)
-(org-defkey org-mode-map "\C-c\C-x\C-d" 'org-clock-display)
-(org-defkey org-mode-map "\C-c\C-x\C-r" 'org-clock-report)
-(org-defkey org-mode-map "\C-c\C-x\C-u" 'org-dblock-update)
-(org-defkey org-mode-map "\C-c\C-x\C-l" 'org-preview-latex-fragment)
-(org-defkey org-mode-map "\C-c\C-x\C-v" 'org-toggle-inline-images)
-(org-defkey org-mode-map "\C-c\C-x\\" 'org-toggle-pretty-entities)
-(org-defkey org-mode-map "\C-c\C-x\C-b" 'org-toggle-checkbox)
-(org-defkey org-mode-map "\C-c\C-xp" 'org-set-property)
-(org-defkey org-mode-map "\C-c\C-xe" 'org-set-effort)
-(org-defkey org-mode-map "\C-c\C-xo" 'org-toggle-ordered-property)
-(org-defkey org-mode-map "\C-c\C-xi" 'org-insert-columns-dblock)
-(org-defkey org-mode-map [(control ?c) (control ?x) ?\;] 'org-timer-set-timer)
-(org-defkey org-mode-map [(control ?c) (control ?x) ?\:] 'org-timer-cancel-timer)
-
-(org-defkey org-mode-map "\C-c\C-x." 'org-timer)
-(org-defkey org-mode-map "\C-c\C-x-" 'org-timer-item)
-(org-defkey org-mode-map "\C-c\C-x0" 'org-timer-start)
-(org-defkey org-mode-map "\C-c\C-x_" 'org-timer-stop)
-(org-defkey org-mode-map "\C-c\C-x," 'org-timer-pause-or-continue)
-
-(define-key org-mode-map "\C-c\C-x\C-c" 'org-columns)
-
-(define-key org-mode-map "\C-c\C-x!" 'org-reload)
-
-(define-key org-mode-map "\C-c\C-xg" 'org-feed-update-all)
-(define-key org-mode-map "\C-c\C-xG" 'org-feed-goto-inbox)
-
-(define-key org-mode-map "\C-c\C-x[" 'org-reftex-citation)
-
-
-(when (featurep 'xemacs)
- (org-defkey org-mode-map 'button3 'popup-mode-menu))
-
-
-(defconst org-speed-commands-default
- '(
- ("Outline Navigation")
- ("n" . (org-speed-move-safe 'outline-next-visible-heading))
- ("p" . (org-speed-move-safe 'outline-previous-visible-heading))
- ("f" . (org-speed-move-safe 'org-forward-same-level))
- ("b" . (org-speed-move-safe 'org-backward-same-level))
- ("u" . (org-speed-move-safe 'outline-up-heading))
- ("j" . org-goto)
- ("g" . (org-refile t))
- ("Outline Visibility")
- ("c" . org-cycle)
- ("C" . org-shifttab)
- (" " . org-display-outline-path)
- ("Outline Structure Editing")
- ("U" . org-shiftmetaup)
- ("D" . org-shiftmetadown)
- ("r" . org-metaright)
- ("l" . org-metaleft)
- ("R" . org-shiftmetaright)
- ("L" . org-shiftmetaleft)
- ("i" . (progn (forward-char 1) (call-interactively
- 'org-insert-heading-respect-content)))
- ("^" . org-sort)
- ("w" . org-refile)
- ("a" . org-archive-subtree-default-with-confirmation)
- ("." . org-mark-subtree)
- ("Clock Commands")
- ("I" . org-clock-in)
- ("O" . org-clock-out)
- ("Meta Data Editing")
- ("t" . org-todo)
- ("0" . (org-priority ?\ ))
- ("1" . (org-priority ?A))
- ("2" . (org-priority ?B))
- ("3" . (org-priority ?C))
- (";" . org-set-tags-command)
- ("e" . org-set-effort)
- ("Agenda Views etc")
- ("v" . org-agenda)
- ("/" . org-sparse-tree)
- ("Misc")
- ("o" . org-open-at-point)
- ("?" . org-speed-command-help)
- ("<" . (org-agenda-set-restriction-lock 'subtree))
- (">" . (org-agenda-remove-restriction-lock))
- )
- "The default speed commands.")
-
-(defun org-print-speed-command (e)
- (if (> (length (car e)) 1)
- (progn
- (princ "\n")
- (princ (car e))
- (princ "\n")
- (princ (make-string (length (car e)) ?-))
- (princ "\n"))
- (princ (car e))
- (princ " ")
- (if (symbolp (cdr e))
- (princ (symbol-name (cdr e)))
- (prin1 (cdr e)))
- (princ "\n")))
-
-(defun org-speed-command-help ()
- "Show the available speed commands."
- (interactive)
- (if (not org-use-speed-commands)
- (error "Speed commands are not activated, customize `org-use-speed-commands'")
- (with-output-to-temp-buffer "*Help*"
- (princ "User-defined Speed commands\n===========================\n")
- (mapc 'org-print-speed-command org-speed-commands-user)
- (princ "\n")
- (princ "Built-in Speed commands\n=======================\n")
- (mapc 'org-print-speed-command org-speed-commands-default))
- (with-current-buffer "*Help*"
- (setq truncate-lines t))))
-
-(defun org-speed-move-safe (cmd)
- "Execute CMD, but make sure that the cursor always ends up in a headline.
-If not, return to the original position and throw an error."
- (interactive)
- (let ((pos (point)))
- (call-interactively cmd)
- (unless (and (bolp) (org-on-heading-p))
- (goto-char pos)
- (error "Boundary reached while executing %s" cmd))))
-
-(defvar org-self-insert-command-undo-counter 0)
-
-(defvar org-table-auto-blank-field) ; defined in org-table.el
-(defvar org-speed-command nil)
-
-(defun org-speed-command-default-hook (keys)
- "Hook for activating single-letter speed commands.
-`org-speed-commands-default' specifies a minimal command set. Use
-`org-speed-commands-user' for further customization."
- (when (or (and (bolp) (looking-at outline-regexp))
- (and (functionp org-use-speed-commands)
- (funcall org-use-speed-commands)))
- (cdr (assoc keys (append org-speed-commands-user
- org-speed-commands-default)))))
-
-(defun org-babel-speed-command-hook (keys)
- "Hook for activating single-letter code block commands."
- (when (and (bolp) (looking-at org-babel-src-block-regexp))
- (cdr (assoc keys org-babel-key-bindings))))
-
-(defcustom org-speed-command-hook
- '(org-speed-command-default-hook org-babel-speed-command-hook)
- "Hook for activating speed commands at strategic locations.
-Hook functions are called in sequence until a valid handler is
-found.
-
-Each hook takes a single argument, a user-pressed command key
-which is also a `self-insert-command' from the global map.
-
-Within the hook, examine the cursor position and the command key
-and return nil or a valid handler as appropriate. Handler could
-be one of an interactive command, a function, or a form.
-
-Set `org-use-speed-commands' to non-nil value to enable this
-hook. The default setting is `org-speed-command-default-hook'."
- :group 'org-structure
- :type 'hook)
-
-(defun org-self-insert-command (N)
- "Like `self-insert-command', use overwrite-mode for whitespace in tables.
-If the cursor is in a table looking at whitespace, the whitespace is
-overwritten, and the table is not marked as requiring realignment."
- (interactive "p")
- (cond
- ((and org-use-speed-commands
- (setq org-speed-command
- (run-hook-with-args-until-success
- 'org-speed-command-hook (this-command-keys))))
- (cond
- ((commandp org-speed-command)
- (setq this-command org-speed-command)
- (call-interactively org-speed-command))
- ((functionp org-speed-command)
- (funcall org-speed-command))
- ((and org-speed-command (listp org-speed-command))
- (eval org-speed-command))
- (t (let (org-use-speed-commands)
- (call-interactively 'org-self-insert-command)))))
- ((and
- (org-table-p)
- (progn
- ;; check if we blank the field, and if that triggers align
- (and (featurep 'org-table) org-table-auto-blank-field
- (member last-command
- '(org-cycle org-return org-shifttab org-ctrl-c-ctrl-c yas/expand))
- (if (or (equal (char-after) ?\ ) (looking-at "[^|\n]* |"))
- ;; got extra space, this field does not determine column width
- (let (org-table-may-need-update) (org-table-blank-field))
- ;; no extra space, this field may determine column width
- (org-table-blank-field)))
- t)
- (eq N 1)
- (looking-at "[^|\n]* |"))
- (let (org-table-may-need-update)
- (goto-char (1- (match-end 0)))
- (delete-backward-char 1)
- (goto-char (match-beginning 0))
- (self-insert-command N)))
- (t
- (setq org-table-may-need-update t)
- (self-insert-command N)
- (org-fix-tags-on-the-fly)
- (if org-self-insert-cluster-for-undo
- (if (not (eq last-command 'org-self-insert-command))
- (setq org-self-insert-command-undo-counter 1)
- (if (>= org-self-insert-command-undo-counter 20)
- (setq org-self-insert-command-undo-counter 1)
- (and (> org-self-insert-command-undo-counter 0)
- buffer-undo-list
- (not (cadr buffer-undo-list)) ; remove nil entry
- (setcdr buffer-undo-list (cddr buffer-undo-list)))
- (setq org-self-insert-command-undo-counter
- (1+ org-self-insert-command-undo-counter))))))))
-
-(defun org-fix-tags-on-the-fly ()
- (when (and (equal (char-after (point-at-bol)) ?*)
- (org-on-heading-p))
- (org-align-tags-here org-tags-column)))
-
-(defun org-delete-backward-char (N)
- "Like `delete-backward-char', insert whitespace at field end in tables.
-When deleting backwards, in tables this function will insert whitespace in
-front of the next \"|\" separator, to keep the table aligned. The table will
-still be marked for re-alignment if the field did fill the entire column,
-because, in this case the deletion might narrow the column."
- (interactive "p")
- (if (and (org-table-p)
- (eq N 1)
- (string-match "|" (buffer-substring (point-at-bol) (point)))
- (looking-at ".*?|"))
- (let ((pos (point))
- (noalign (looking-at "[^|\n\r]* |"))
- (c org-table-may-need-update))
- (backward-delete-char N)
- (if (not overwrite-mode)
- (progn
- (skip-chars-forward "^|")
- (insert " ")
- (goto-char (1- pos))))
- ;; noalign: if there were two spaces at the end, this field
- ;; does not determine the width of the column.
- (if noalign (setq org-table-may-need-update c)))
- (backward-delete-char N)
- (org-fix-tags-on-the-fly)))
-
-(defun org-delete-char (N)
- "Like `delete-char', but insert whitespace at field end in tables.
-When deleting characters, in tables this function will insert whitespace in
-front of the next \"|\" separator, to keep the table aligned. The table will
-still be marked for re-alignment if the field did fill the entire column,
-because, in this case the deletion might narrow the column."
- (interactive "p")
- (if (and (org-table-p)
- (not (bolp))
- (not (= (char-after) ?|))
- (eq N 1))
- (if (looking-at ".*?|")
- (let ((pos (point))
- (noalign (looking-at "[^|\n\r]* |"))
- (c org-table-may-need-update))
- (replace-match (concat
- (substring (match-string 0) 1 -1)
- " |"))
- (goto-char pos)
- ;; noalign: if there were two spaces at the end, this field
- ;; does not determine the width of the column.
- (if noalign (setq org-table-may-need-update c)))
- (delete-char N))
- (delete-char N)
- (org-fix-tags-on-the-fly)))
-
-;; Make `delete-selection-mode' work with org-mode and orgtbl-mode
-(put 'org-self-insert-command 'delete-selection t)
-(put 'orgtbl-self-insert-command 'delete-selection t)
-(put 'org-delete-char 'delete-selection 'supersede)
-(put 'org-delete-backward-char 'delete-selection 'supersede)
-(put 'org-yank 'delete-selection 'yank)
-
-;; Make `flyspell-mode' delay after some commands
-(put 'org-self-insert-command 'flyspell-delayed t)
-(put 'orgtbl-self-insert-command 'flyspell-delayed t)
-(put 'org-delete-char 'flyspell-delayed t)
-(put 'org-delete-backward-char 'flyspell-delayed t)
-
-;; Make pabbrev-mode expand after org-mode commands
-(put 'org-self-insert-command 'pabbrev-expand-after-command t)
-(put 'orgtbl-self-insert-command 'pabbrev-expand-after-command t)
-
-;; How to do this: Measure non-white length of current string
-;; If equal to column width, we should realign.
-
-(defun org-remap (map &rest commands)
- "In MAP, remap the functions given in COMMANDS.
-COMMANDS is a list of alternating OLDDEF NEWDEF command names."
- (let (new old)
- (while commands
- (setq old (pop commands) new (pop commands))
- (if (fboundp 'command-remapping)
- (org-defkey map (vector 'remap old) new)
- (substitute-key-definition old new map global-map)))))
-
-(when (eq org-enable-table-editor 'optimized)
- ;; If the user wants maximum table support, we need to hijack
- ;; some standard editing functions
- (org-remap org-mode-map
- 'self-insert-command 'org-self-insert-command
- 'delete-char 'org-delete-char
- 'delete-backward-char 'org-delete-backward-char)
- (org-defkey org-mode-map "|" 'org-force-self-insert))
-
-(defvar org-ctrl-c-ctrl-c-hook nil
- "Hook for functions attaching themselves to `C-c C-c'.
-This can be used to add additional functionality to the C-c C-c key which
-executes context-dependent commands.
-Each function will be called with no arguments. The function must check
-if the context is appropriate for it to act. If yes, it should do its
-thing and then return a non-nil value. If the context is wrong,
-just do nothing and return nil.")
-
-(defvar org-tab-first-hook nil
- "Hook for functions to attach themselves to TAB.
-See `org-ctrl-c-ctrl-c-hook' for more information.
-This hook runs as the first action when TAB is pressed, even before
-`org-cycle' messes around with the `outline-regexp' to cater for
-inline tasks and plain list item folding.
-If any function in this hook returns t, any other actions that
-would have been caused by TAB (such as table field motion or visibility
-cycling) will not occur.")
-
-(defvar org-tab-after-check-for-table-hook nil
- "Hook for functions to attach themselves to TAB.
-See `org-ctrl-c-ctrl-c-hook' for more information.
-This hook runs after it has been established that the cursor is not in a
-table, but before checking if the cursor is in a headline or if global cycling
-should be done.
-If any function in this hook returns t, not other actions like visibility
-cycling will be done.")
-
-(defvar org-tab-after-check-for-cycling-hook nil
- "Hook for functions to attach themselves to TAB.
-See `org-ctrl-c-ctrl-c-hook' for more information.
-This hook runs after it has been established that not table field motion and
-not visibility should be done because of current context. This is probably
-the place where a package like yasnippets can hook in.")
-
-(defvar org-tab-before-tab-emulation-hook nil
- "Hook for functions to attach themselves to TAB.
-See `org-ctrl-c-ctrl-c-hook' for more information.
-This hook runs after every other options for TAB have been exhausted, but
-before indentation and \t insertion takes place.")
-
-(defvar org-metaleft-hook nil
- "Hook for functions attaching themselves to `M-left'.
-See `org-ctrl-c-ctrl-c-hook' for more information.")
-(defvar org-metaright-hook nil
- "Hook for functions attaching themselves to `M-right'.
-See `org-ctrl-c-ctrl-c-hook' for more information.")
-(defvar org-metaup-hook nil
- "Hook for functions attaching themselves to `M-up'.
-See `org-ctrl-c-ctrl-c-hook' for more information.")
-(defvar org-metadown-hook nil
- "Hook for functions attaching themselves to `M-down'.
-See `org-ctrl-c-ctrl-c-hook' for more information.")
-(defvar org-shiftmetaleft-hook nil
- "Hook for functions attaching themselves to `M-S-left'.
-See `org-ctrl-c-ctrl-c-hook' for more information.")
-(defvar org-shiftmetaright-hook nil
- "Hook for functions attaching themselves to `M-S-right'.
-See `org-ctrl-c-ctrl-c-hook' for more information.")
-(defvar org-shiftmetaup-hook nil
- "Hook for functions attaching themselves to `M-S-up'.
-See `org-ctrl-c-ctrl-c-hook' for more information.")
-(defvar org-shiftmetadown-hook nil
- "Hook for functions attaching themselves to `M-S-down'.
-See `org-ctrl-c-ctrl-c-hook' for more information.")
-(defvar org-metareturn-hook nil
- "Hook for functions attaching themselves to `M-RET'.
-See `org-ctrl-c-ctrl-c-hook' for more information.")
-(defvar org-shiftup-hook nil
- "Hook for functions attaching themselves to `S-up'.
-See `org-ctrl-c-ctrl-c-hook' for more information.")
-(defvar org-shiftup-final-hook nil
- "Hook for functions attaching themselves to `S-up'.
-This one runs after all other options except shift-select have been excluded.
-See `org-ctrl-c-ctrl-c-hook' for more information.")
-(defvar org-shiftdown-hook nil
- "Hook for functions attaching themselves to `S-down'.
-See `org-ctrl-c-ctrl-c-hook' for more information.")
-(defvar org-shiftdown-final-hook nil
- "Hook for functions attaching themselves to `S-down'.
-This one runs after all other options except shift-select have been excluded.
-See `org-ctrl-c-ctrl-c-hook' for more information.")
-(defvar org-shiftleft-hook nil
- "Hook for functions attaching themselves to `S-left'.
-See `org-ctrl-c-ctrl-c-hook' for more information.")
-(defvar org-shiftleft-final-hook nil
- "Hook for functions attaching themselves to `S-left'.
-This one runs after all other options except shift-select have been excluded.
-See `org-ctrl-c-ctrl-c-hook' for more information.")
-(defvar org-shiftright-hook nil
- "Hook for functions attaching themselves to `S-right'.
-See `org-ctrl-c-ctrl-c-hook' for more information.")
-(defvar org-shiftright-final-hook nil
- "Hook for functions attaching themselves to `S-right'.
-This one runs after all other options except shift-select have been excluded.
-See `org-ctrl-c-ctrl-c-hook' for more information.")
-
-(defun org-modifier-cursor-error ()
- "Throw an error, a modified cursor command was applied in wrong context."
- (error "This command is active in special context like tables, headlines or items"))
-
-(defun org-shiftselect-error ()
- "Throw an error because Shift-Cursor command was applied in wrong context."
- (if (and (boundp 'shift-select-mode) shift-select-mode)
- (error "To use shift-selection with Org-mode, customize `org-support-shift-select'")
- (error "This command works only in special context like headlines or timestamps")))
-
-(defun org-call-for-shift-select (cmd)
- (let ((this-command-keys-shift-translated t))
- (call-interactively cmd)))
-
-(defun org-shifttab (&optional arg)
- "Global visibility cycling or move to previous table field.
-Calls `org-cycle' with argument t, or `org-table-previous-field', depending
-on context.
-See the individual commands for more information."
- (interactive "P")
- (cond
- ((org-at-table-p) (call-interactively 'org-table-previous-field))
- ((integerp arg)
- (let ((arg2 (if org-odd-levels-only (1- (* 2 arg)) arg)))
- (message "Content view to level: %d" arg)
- (org-content (prefix-numeric-value arg2))
- (setq org-cycle-global-status 'overview)))
- (t (call-interactively 'org-global-cycle))))
-
-(defun org-shiftmetaleft ()
- "Promote subtree or delete table column.
-Calls `org-promote-subtree', `org-outdent-item',
-or `org-table-delete-column', depending on context.
-See the individual commands for more information."
- (interactive)
- (cond
- ((run-hook-with-args-until-success 'org-shiftmetaleft-hook))
- ((org-at-table-p) (call-interactively 'org-table-delete-column))
- ((org-on-heading-p) (call-interactively 'org-promote-subtree))
- ((org-at-item-p) (call-interactively 'org-outdent-item-tree))
- (t (org-modifier-cursor-error))))
-
-(defun org-shiftmetaright ()
- "Demote subtree or insert table column.
-Calls `org-demote-subtree', `org-indent-item',
-or `org-table-insert-column', depending on context.
-See the individual commands for more information."
- (interactive)
- (cond
- ((run-hook-with-args-until-success 'org-shiftmetaright-hook))
- ((org-at-table-p) (call-interactively 'org-table-insert-column))
- ((org-on-heading-p) (call-interactively 'org-demote-subtree))
- ((org-at-item-p) (call-interactively 'org-indent-item-tree))
- (t (org-modifier-cursor-error))))
-
-(defun org-shiftmetaup (&optional arg)
- "Move subtree up or kill table row.
-Calls `org-move-subtree-up' or `org-table-kill-row' or
-`org-move-item-up' depending on context. See the individual commands
-for more information."
- (interactive "P")
- (cond
- ((run-hook-with-args-until-success 'org-shiftmetaup-hook))
- ((org-at-table-p) (call-interactively 'org-table-kill-row))
- ((org-on-heading-p) (call-interactively 'org-move-subtree-up))
- ((org-at-item-p) (call-interactively 'org-move-item-up))
- (t (org-modifier-cursor-error))))
-
-(defun org-shiftmetadown (&optional arg)
- "Move subtree down or insert table row.
-Calls `org-move-subtree-down' or `org-table-insert-row' or
-`org-move-item-down', depending on context. See the individual
-commands for more information."
- (interactive "P")
- (cond
- ((run-hook-with-args-until-success 'org-shiftmetadown-hook))
- ((org-at-table-p) (call-interactively 'org-table-insert-row))
- ((org-on-heading-p) (call-interactively 'org-move-subtree-down))
- ((org-at-item-p) (call-interactively 'org-move-item-down))
- (t (org-modifier-cursor-error))))
-
-(defsubst org-hidden-tree-error ()
- (error
- "Hidden subtree, open with TAB or use subtree command M-S-<left>/<right>"))
-
-(defun org-metaleft (&optional arg)
- "Promote heading or move table column to left.
-Calls `org-do-promote' or `org-table-move-column', depending on context.
-With no specific context, calls the Emacs default `backward-word'.
-See the individual commands for more information."
- (interactive "P")
- (cond
- ((run-hook-with-args-until-success 'org-metaleft-hook))
- ((org-at-table-p) (org-call-with-arg 'org-table-move-column 'left))
- ((or (org-on-heading-p)
- (and (org-region-active-p)
- (save-excursion
- (goto-char (region-beginning))
- (org-on-heading-p))))
- (when (org-check-for-hidden 'headlines) (org-hidden-tree-error))
- (call-interactively 'org-do-promote))
- ((or (org-at-item-p)
- (and (org-region-active-p)
- (save-excursion
- (goto-char (region-beginning))
- (org-at-item-p))))
- (when (org-check-for-hidden 'items) (org-hidden-tree-error))
- (call-interactively 'org-outdent-item))
- (t (call-interactively 'backward-word))))
-
-(defun org-metaright (&optional arg)
- "Demote subtree or move table column to right.
-Calls `org-do-demote' or `org-table-move-column', depending on context.
-With no specific context, calls the Emacs default `forward-word'.
-See the individual commands for more information."
- (interactive "P")
- (cond
- ((run-hook-with-args-until-success 'org-metaright-hook))
- ((org-at-table-p) (call-interactively 'org-table-move-column))
- ((or (org-on-heading-p)
- (and (org-region-active-p)
- (save-excursion
- (goto-char (region-beginning))
- (org-on-heading-p))))
- (when (org-check-for-hidden 'headlines) (org-hidden-tree-error))
- (call-interactively 'org-do-demote))
- ((or (org-at-item-p)
- (and (org-region-active-p)
- (save-excursion
- (goto-char (region-beginning))
- (org-at-item-p))))
- (when (org-check-for-hidden 'items) (org-hidden-tree-error))
- (call-interactively 'org-indent-item))
- (t (call-interactively 'forward-word))))
-
-(defun org-check-for-hidden (what)
- "Check if there are hidden headlines/items in the current visual line.
-WHAT can be either `headlines' or `items'. If the current line is
-an outline or item heading and it has a folded subtree below it,
-this function returns t, nil otherwise."
- (let ((re (cond
- ((eq what 'headlines) (concat "^" org-outline-regexp))
- ((eq what 'items) (concat "^" (org-item-re t)))
- (t (error "This should not happen"))))
- beg end)
- (save-excursion
- (catch 'exit
- (unless (org-region-active-p)
- (setq beg (point-at-bol))
- (beginning-of-line 2)
- (while (and (not (eobp)) ;; this is like `next-line'
- (get-char-property (1- (point)) 'invisible))
- (beginning-of-line 2))
- (setq end (point))
- (goto-char beg)
- (goto-char (point-at-eol))
- (setq end (max end (point)))
- (while (re-search-forward re end t)
- (if (get-char-property (match-beginning 0) 'invisible)
- (throw 'exit t))))
- nil))))
-
-(defun org-metaup (&optional arg)
- "Move subtree up or move table row up.
-Calls `org-move-subtree-up' or `org-table-move-row' or
-`org-move-item-up', depending on context. See the individual commands
-for more information."
- (interactive "P")
- (cond
- ((run-hook-with-args-until-success 'org-metaup-hook))
- ((org-at-table-p) (org-call-with-arg 'org-table-move-row 'up))
- ((org-on-heading-p) (call-interactively 'org-move-subtree-up))
- ((org-at-item-p) (call-interactively 'org-move-item-up))
- (t (transpose-lines 1) (beginning-of-line -1))))
-
-(defun org-metadown (&optional arg)
- "Move subtree down or move table row down.
-Calls `org-move-subtree-down' or `org-table-move-row' or
-`org-move-item-down', depending on context. See the individual
-commands for more information."
- (interactive "P")
- (cond
- ((run-hook-with-args-until-success 'org-metadown-hook))
- ((org-at-table-p) (call-interactively 'org-table-move-row))
- ((org-on-heading-p) (call-interactively 'org-move-subtree-down))
- ((org-at-item-p) (call-interactively 'org-move-item-down))
- (t (beginning-of-line 2) (transpose-lines 1) (beginning-of-line 0))))
-
-(defun org-shiftup (&optional arg)
- "Increase item in timestamp or increase priority of current headline.
-Calls `org-timestamp-up' or `org-priority-up', or `org-previous-item',
-depending on context. See the individual commands for more information."
- (interactive "P")
- (cond
- ((run-hook-with-args-until-success 'org-shiftup-hook))
- ((and org-support-shift-select (org-region-active-p))
- (org-call-for-shift-select 'previous-line))
- ((org-at-timestamp-p t)
- (call-interactively (if org-edit-timestamp-down-means-later
- 'org-timestamp-down 'org-timestamp-up)))
- ((and (not (eq org-support-shift-select 'always))
- org-enable-priority-commands
- (org-on-heading-p))
- (call-interactively 'org-priority-up))
- ((and (not org-support-shift-select) (org-at-item-p))
- (call-interactively 'org-previous-item))
- ((org-clocktable-try-shift 'up arg))
- ((run-hook-with-args-until-success 'org-shiftup-final-hook))
- (org-support-shift-select
- (org-call-for-shift-select 'previous-line))
- (t (org-shiftselect-error))))
-
-(defun org-shiftdown (&optional arg)
- "Decrease item in timestamp or decrease priority of current headline.
-Calls `org-timestamp-down' or `org-priority-down', or `org-next-item'
-depending on context. See the individual commands for more information."
- (interactive "P")
- (cond
- ((run-hook-with-args-until-success 'org-shiftdown-hook))
- ((and org-support-shift-select (org-region-active-p))
- (org-call-for-shift-select 'next-line))
- ((org-at-timestamp-p t)
- (call-interactively (if org-edit-timestamp-down-means-later
- 'org-timestamp-up 'org-timestamp-down)))
- ((and (not (eq org-support-shift-select 'always))
- org-enable-priority-commands
- (org-on-heading-p))
- (call-interactively 'org-priority-down))
- ((and (not org-support-shift-select) (org-at-item-p))
- (call-interactively 'org-next-item))
- ((org-clocktable-try-shift 'down arg))
- ((run-hook-with-args-until-success 'org-shiftdown-final-hook))
- (org-support-shift-select
- (org-call-for-shift-select 'next-line))
- (t (org-shiftselect-error))))
-
-(defun org-shiftright (&optional arg)
- "Cycle the thing at point or in the current line, depending on context.
-Depending on context, this does one of the following:
-
-- switch a timestamp at point one day into the future
-- on a headline, switch to the next TODO keyword.
-- on an item, switch entire list to the next bullet type
-- on a property line, switch to the next allowed value
-- on a clocktable definition line, move time block into the future"
- (interactive "P")
- (cond
- ((run-hook-with-args-until-success 'org-shiftright-hook))
- ((and org-support-shift-select (org-region-active-p))
- (org-call-for-shift-select 'forward-char))
- ((org-at-timestamp-p t) (call-interactively 'org-timestamp-up-day))
- ((and (not (eq org-support-shift-select 'always))
- (org-on-heading-p))
- (let ((org-inhibit-logging
- (not org-treat-S-cursor-todo-selection-as-state-change))
- (org-inhibit-blocking
- (not org-treat-S-cursor-todo-selection-as-state-change)))
- (org-call-with-arg 'org-todo 'right)))
- ((or (and org-support-shift-select
- (not (eq org-support-shift-select 'always))
- (org-at-item-bullet-p))
- (and (not org-support-shift-select) (org-at-item-p)))
- (org-call-with-arg 'org-cycle-list-bullet nil))
- ((and (not (eq org-support-shift-select 'always))
- (org-at-property-p))
- (call-interactively 'org-property-next-allowed-value))
- ((org-clocktable-try-shift 'right arg))
- ((run-hook-with-args-until-success 'org-shiftright-final-hook))
- (org-support-shift-select
- (org-call-for-shift-select 'forward-char))
- (t (org-shiftselect-error))))
-
-(defun org-shiftleft (&optional arg)
- "Cycle the thing at point or in the current line, depending on context.
-Depending on context, this does one of the following:
-
-- switch a timestamp at point one day into the past
-- on a headline, switch to the previous TODO keyword.
-- on an item, switch entire list to the previous bullet type
-- on a property line, switch to the previous allowed value
-- on a clocktable definition line, move time block into the past"
- (interactive "P")
- (cond
- ((run-hook-with-args-until-success 'org-shiftleft-hook))
- ((and org-support-shift-select (org-region-active-p))
- (org-call-for-shift-select 'backward-char))
- ((org-at-timestamp-p t) (call-interactively 'org-timestamp-down-day))
- ((and (not (eq org-support-shift-select 'always))
- (org-on-heading-p))
- (let ((org-inhibit-logging
- (not org-treat-S-cursor-todo-selection-as-state-change))
- (org-inhibit-blocking
- (not org-treat-S-cursor-todo-selection-as-state-change)))
- (org-call-with-arg 'org-todo 'left)))
- ((or (and org-support-shift-select
- (not (eq org-support-shift-select 'always))
- (org-at-item-bullet-p))
- (and (not org-support-shift-select) (org-at-item-p)))
- (org-call-with-arg 'org-cycle-list-bullet 'previous))
- ((and (not (eq org-support-shift-select 'always))
- (org-at-property-p))
- (call-interactively 'org-property-previous-allowed-value))
- ((org-clocktable-try-shift 'left arg))
- ((run-hook-with-args-until-success 'org-shiftleft-final-hook))
- (org-support-shift-select
- (org-call-for-shift-select 'backward-char))
- (t (org-shiftselect-error))))
-
-(defun org-shiftcontrolright ()
- "Switch to next TODO set."
- (interactive)
- (cond
- ((and org-support-shift-select (org-region-active-p))
- (org-call-for-shift-select 'forward-word))
- ((and (not (eq org-support-shift-select 'always))
- (org-on-heading-p))
- (org-call-with-arg 'org-todo 'nextset))
- (org-support-shift-select
- (org-call-for-shift-select 'forward-word))
- (t (org-shiftselect-error))))
-
-(defun org-shiftcontrolleft ()
- "Switch to previous TODO set."
- (interactive)
- (cond
- ((and org-support-shift-select (org-region-active-p))
- (org-call-for-shift-select 'backward-word))
- ((and (not (eq org-support-shift-select 'always))
- (org-on-heading-p))
- (org-call-with-arg 'org-todo 'previousset))
- (org-support-shift-select
- (org-call-for-shift-select 'backward-word))
- (t (org-shiftselect-error))))
-
-(defun org-ctrl-c-ret ()
- "Call `org-table-hline-and-move' or `org-insert-heading' dep. on context."
- (interactive)
- (cond
- ((org-at-table-p) (call-interactively 'org-table-hline-and-move))
- (t (call-interactively 'org-insert-heading))))
-
-(defun org-copy-special ()
- "Copy region in table or copy current subtree.
-Calls `org-table-copy' or `org-copy-subtree', depending on context.
-See the individual commands for more information."
- (interactive)
- (call-interactively
- (if (org-at-table-p) 'org-table-copy-region 'org-copy-subtree)))
-
-(defun org-cut-special ()
- "Cut region in table or cut current subtree.
-Calls `org-table-copy' or `org-cut-subtree', depending on context.
-See the individual commands for more information."
- (interactive)
- (call-interactively
- (if (org-at-table-p) 'org-table-cut-region 'org-cut-subtree)))
-
-(defun org-paste-special (arg)
- "Paste rectangular region into table, or past subtree relative to level.
-Calls `org-table-paste-rectangle' or `org-paste-subtree', depending on context.
-See the individual commands for more information."
- (interactive "P")
- (if (org-at-table-p)
- (org-table-paste-rectangle)
- (org-paste-subtree arg)))
-
-(defun org-edit-special (&optional arg)
- "Call a special editor for the stuff at point.
-When at a table, call the formula editor with `org-table-edit-formulas'.
-When at the first line of an src example, call `org-edit-src-code'.
-When in an #+include line, visit the include file. Otherwise call
-`ffap' to visit the file at point."
- (interactive)
- ;; possibly prep session before editing source
- (when arg
- (let* ((info (org-babel-get-src-block-info))
- (lang (nth 0 info))
- (params (nth 2 info))
- (session (cdr (assoc :session params))))
- (when (and info session) ;; we are in a source-code block with a session
- (funcall
- (intern (concat "org-babel-prep-session:" lang)) session params))))
- (cond ;; proceed with `org-edit-special'
- ((save-excursion
- (beginning-of-line 1)
- (looking-at "\\(?:#\\+\\(?:setupfile\\|include\\):?[ \t]+\"?\\|[ \t]*<include\\>.*?file=\"\\)\\([^\"\n>]+\\)"))
- (find-file (org-trim (match-string 1))))
- ((org-edit-src-code))
- ((org-edit-fixed-width-region))
- ((org-at-table.el-p)
- (org-edit-src-code))
- ((or (org-at-table-p)
- (save-excursion
- (beginning-of-line 1)
- (looking-at "[ \t]*#\\+TBLFM:")))
- (call-interactively 'org-table-edit-formulas))
- (t (call-interactively 'ffap))))
-
-(defun org-ctrl-c-ctrl-c (&optional arg)
- "Set tags in headline, or update according to changed information at point.
-
-This command does many different things, depending on context:
-
-- If a function in `org-ctrl-c-ctrl-c-hook' recognizes this location,
- this is what we do.
-
-- If the cursor is on a statistics cookie, update it.
-
-- If the cursor is in a headline, prompt for tags and insert them
- into the current line, aligned to `org-tags-column'. When called
- with prefix arg, realign all tags in the current buffer.
-
-- If the cursor is in one of the special #+KEYWORD lines, this
- triggers scanning the buffer for these lines and updating the
- information.
-
-- If the cursor is inside a table, realign the table. This command
- works even if the automatic table editor has been turned off.
-
-- If the cursor is on a #+TBLFM line, re-apply the formulas to
- the entire table.
-
-- If the cursor is at a footnote reference or definition, jump to
- the corresponding definition or references, respectively.
-
-- If the cursor is a the beginning of a dynamic block, update it.
-
-- If the current buffer is a capture buffer, close note and file it.
-
-- If the cursor is on a <<<target>>>, update radio targets and
- corresponding links in this buffer.
-
-- If the cursor is on a numbered item in a plain list, renumber the
- ordered list.
-
-- If the cursor is on a checkbox, toggle it.
-
-- If the cursor is on a code block, evaluate it. The variable
- `org-confirm-babel-evaluate' can be used to control prompting
- before code block evaluation, by default every code block
- evaluation requires confirmation. Code block evaluation can be
- inhibited by setting `org-babel-no-eval-on-ctrl-c-ctrl-c'."
- (interactive "P")
- (let ((org-enable-table-editor t))
- (cond
- ((or (and (boundp 'org-clock-overlays) org-clock-overlays)
- org-occur-highlights
- org-latex-fragment-image-overlays)
- (and (boundp 'org-clock-overlays) (org-clock-remove-overlays))
- (org-remove-occur-highlights)
- (org-remove-latex-fragment-image-overlays)
- (message "Temporary highlights/overlays removed from current buffer"))
- ((and (local-variable-p 'org-finish-function (current-buffer))
- (fboundp org-finish-function))
- (funcall org-finish-function))
- ((run-hook-with-args-until-success 'org-ctrl-c-ctrl-c-hook))
- ((or (looking-at org-property-start-re)
- (org-at-property-p))
- (call-interactively 'org-property-action))
- ((org-on-target-p) (call-interactively 'org-update-radio-target-regexp))
- ((and (org-in-regexp "\\[\\([0-9]*%\\|[0-9]*/[0-9]*\\)\\]")
- (or (org-on-heading-p) (org-at-item-p)))
- (call-interactively 'org-update-statistics-cookies))
- ((org-on-heading-p) (call-interactively 'org-set-tags))
- ((org-at-table.el-p)
- (message "Use C-c ' to edit table.el tables"))
- ((org-at-table-p)
- (org-table-maybe-eval-formula)
- (if arg
- (call-interactively 'org-table-recalculate)
- (org-table-maybe-recalculate-line))
- (call-interactively 'org-table-align)
- (orgtbl-send-table 'maybe))
- ((or (org-footnote-at-reference-p)
- (org-footnote-at-definition-p))
- (call-interactively 'org-footnote-action))
- ((org-at-item-checkbox-p)
- (call-interactively 'org-list-repair)
- (call-interactively 'org-toggle-checkbox)
- (org-list-send-list 'maybe))
- ((org-at-item-p)
- (call-interactively 'org-list-repair)
- (when arg (call-interactively 'org-toggle-checkbox))
- (org-list-send-list 'maybe))
- ((save-excursion (beginning-of-line 1) (looking-at org-dblock-start-re))
- ;; Dynamic block
- (beginning-of-line 1)
- (save-excursion (org-update-dblock)))
- ((save-excursion
- (beginning-of-line 1)
- (looking-at "[ \t]*#\\+\\([A-Z]+\\)"))
- (cond
- ((equal (match-string 1) "TBLFM")
- ;; Recalculate the table before this line
- (save-excursion
- (beginning-of-line 1)
- (skip-chars-backward " \r\n\t")
- (if (org-at-table-p)
- (org-call-with-arg 'org-table-recalculate (or arg t)))))
- (t
- (let ((org-inhibit-startup-visibility-stuff t)
- (org-startup-align-all-tables nil))
- (org-save-outline-visibility 'use-markers (org-mode-restart)))
- (message "Local setup has been refreshed"))))
- ((org-clock-update-time-maybe))
- (t (error "C-c C-c can do nothing useful at this location")))))
-
-(defun org-mode-restart ()
- "Restart Org-mode, to scan again for special lines.
-Also updates the keyword regular expressions."
- (interactive)
- (org-mode)
- (message "Org-mode restarted"))
-
-(defun org-kill-note-or-show-branches ()
- "If this is a Note buffer, abort storing the note. Else call `show-branches'."
- (interactive)
- (if (not org-finish-function)
- (progn
- (hide-subtree)
- (call-interactively 'show-branches))
- (let ((org-note-abort t))
- (funcall org-finish-function))))
-
-(defun org-return (&optional indent)
- "Goto next table row or insert a newline.
-Calls `org-table-next-row' or `newline', depending on context.
-See the individual commands for more information."
- (interactive)
- (cond
- ((bobp) (if indent (newline-and-indent) (newline)))
- ((org-at-table-p)
- (org-table-justify-field-maybe)
- (call-interactively 'org-table-next-row))
- ((and org-return-follows-link
- (eq (get-text-property (point) 'face) 'org-link))
- (call-interactively 'org-open-at-point))
- ((and (org-at-heading-p)
- (looking-at
- (org-re "\\([ \t]+\\(:[[:alnum:]_@#%:]+:\\)\\)[ \t]*$")))
- (org-show-entry)
- (end-of-line 1)
- (newline))
- (t (if indent (newline-and-indent) (newline)))))
-
-(defun org-return-indent ()
- "Goto next table row or insert a newline and indent.
-Calls `org-table-next-row' or `newline-and-indent', depending on
-context. See the individual commands for more information."
- (interactive)
- (org-return t))
-
-(defun org-ctrl-c-star ()
- "Compute table, or change heading status of lines.
-Calls `org-table-recalculate' or `org-toggle-heading',
-depending on context."
- (interactive)
- (cond
- ((org-at-table-p)
- (call-interactively 'org-table-recalculate))
- (t
- ;; Convert all lines in region to list items
- (call-interactively 'org-toggle-heading))))
-
-(defun org-ctrl-c-minus ()
- "Insert separator line in table or modify bullet status of line.
-Also turns a plain line or a region of lines into list items.
-Calls `org-table-insert-hline', `org-toggle-item', or
-`org-cycle-list-bullet', depending on context."
- (interactive)
- (cond
- ((org-at-table-p)
- (call-interactively 'org-table-insert-hline))
- ((org-region-active-p)
- (call-interactively 'org-toggle-item))
- ((org-in-item-p)
- (call-interactively 'org-cycle-list-bullet))
- (t
- (call-interactively 'org-toggle-item))))
-
-(defun org-toggle-item ()
- "Convert headings or normal lines to items, items to normal lines.
-If there is no active region, only the current line is considered.
-
-If the first line in the region is a headline, convert all headlines to items.
-
-If the first line in the region is an item, convert all items to normal lines.
-
-If the first line is normal text, add an item bullet to each line."
- (interactive)
- (let (l2 l beg end)
- (if (org-region-active-p)
- (setq beg (region-beginning) end (region-end))
- (setq beg (point-at-bol)
- end (min (1+ (point-at-eol)) (point-max))))
- (save-excursion
- (goto-char end)
- (setq l2 (org-current-line))
- (goto-char beg)
- (beginning-of-line 1)
- (setq l (1- (org-current-line)))
- (if (org-at-item-p)
- ;; We already have items, de-itemize
- (while (< (setq l (1+ l)) l2)
- (when (org-at-item-p)
- (skip-chars-forward " \t")
- (delete-region (point) (match-end 0)))
- (beginning-of-line 2))
- (if (org-on-heading-p)
- ;; Headings, convert to items
- (while (< (setq l (1+ l)) l2)
- (if (looking-at org-outline-regexp)
- (replace-match (org-list-bullet-string "-") t t))
- (beginning-of-line 2))
- ;; normal lines, turn them into items
- (while (< (setq l (1+ l)) l2)
- (unless (org-at-item-p)
- (if (looking-at "\\([ \t]*\\)\\(\\S-\\)")
- (replace-match
- (concat "\\1" (org-list-bullet-string "-") "\\2"))))
- (beginning-of-line 2)))))))
-
-(defun org-toggle-heading (&optional nstars)
- "Convert headings to normal text, or items or text to headings.
-If there is no active region, only the current line is considered.
-
-If the first line is a heading, remove the stars from all headlines
-in the region.
-
-If the first line is a plain list item, turn all plain list items
-into headings.
-
-If the first line is a normal line, turn each and every line in the
-region into a heading.
-
-When converting a line into a heading, the number of stars is chosen
-such that the lines become children of the current entry. However,
-when a prefix argument is given, its value determines the number of
-stars to add."
- (interactive "P")
- (let (l2 l itemp beg end)
- (if (org-region-active-p)
- (setq beg (region-beginning) end (region-end))
- (setq beg (point-at-bol)
- end (min (1+ (point-at-eol)) (point-max))))
- (save-excursion
- (goto-char end)
- (setq l2 (org-current-line))
- (goto-char beg)
- (beginning-of-line 1)
- (setq l (1- (org-current-line)))
- (if (org-on-heading-p)
- ;; We already have headlines, de-star them
- (while (< (setq l (1+ l)) l2)
- (when (org-on-heading-p t)
- (and (looking-at outline-regexp) (replace-match "")))
- (beginning-of-line 2))
- (setq itemp (org-at-item-p))
- (let* ((stars
- (if nstars
- (make-string (prefix-numeric-value current-prefix-arg)
- ?*)
- (save-excursion
- (if (re-search-backward org-complex-heading-regexp nil t)
- (match-string 1) ""))))
- (add-stars (cond (nstars "")
- ((equal stars "") "*")
- (org-odd-levels-only "**")
- (t "*")))
- (rpl (concat stars add-stars " ")))
- (while (< (setq l (1+ l)) l2)
- (if itemp
- (and (org-at-item-p) (replace-match rpl t t))
- (unless (org-on-heading-p)
- (if (looking-at "\\([ \t]*\\)\\(\\S-\\)")
- (replace-match (concat rpl (match-string 2))))))
- (beginning-of-line 2)))))))
-
-(defun org-meta-return (&optional arg)
- "Insert a new heading or wrap a region in a table.
-Calls `org-insert-heading' or `org-table-wrap-region', depending on context.
-See the individual commands for more information."
- (interactive "P")
- (cond
- ((run-hook-with-args-until-success 'org-metareturn-hook))
- ((org-at-table-p)
- (call-interactively 'org-table-wrap-region))
- (t (call-interactively 'org-insert-heading))))
-
-;;; Menu entries
-
-;; Define the Org-mode menus
-(easy-menu-define org-tbl-menu org-mode-map "Tbl menu"
- '("Tbl"
- ["Align" org-ctrl-c-ctrl-c :active (org-at-table-p)]
- ["Next Field" org-cycle (org-at-table-p)]
- ["Previous Field" org-shifttab (org-at-table-p)]
- ["Next Row" org-return (org-at-table-p)]
- "--"
- ["Blank Field" org-table-blank-field (org-at-table-p)]
- ["Edit Field" org-table-edit-field (org-at-table-p)]
- ["Copy Field from Above" org-table-copy-down (org-at-table-p)]
- "--"
- ("Column"
- ["Move Column Left" org-metaleft (org-at-table-p)]
- ["Move Column Right" org-metaright (org-at-table-p)]
- ["Delete Column" org-shiftmetaleft (org-at-table-p)]
- ["Insert Column" org-shiftmetaright (org-at-table-p)])
- ("Row"
- ["Move Row Up" org-metaup (org-at-table-p)]
- ["Move Row Down" org-metadown (org-at-table-p)]
- ["Delete Row" org-shiftmetaup (org-at-table-p)]
- ["Insert Row" org-shiftmetadown (org-at-table-p)]
- ["Sort lines in region" org-table-sort-lines (org-at-table-p)]
- "--"
- ["Insert Hline" org-ctrl-c-minus (org-at-table-p)])
- ("Rectangle"
- ["Copy Rectangle" org-copy-special (org-at-table-p)]
- ["Cut Rectangle" org-cut-special (org-at-table-p)]
- ["Paste Rectangle" org-paste-special (org-at-table-p)]
- ["Fill Rectangle" org-table-wrap-region (org-at-table-p)])
- "--"
- ("Calculate"
- ["Set Column Formula" org-table-eval-formula (org-at-table-p)]
- ["Set Field Formula" (org-table-eval-formula '(4)) :active (org-at-table-p) :keys "C-u C-c ="]
- ["Edit Formulas" org-edit-special (org-at-table-p)]
- "--"
- ["Recalculate line" org-table-recalculate (org-at-table-p)]
- ["Recalculate all" (lambda () (interactive) (org-table-recalculate '(4))) :active (org-at-table-p) :keys "C-u C-c *"]
- ["Iterate all" (lambda () (interactive) (org-table-recalculate '(16))) :active (org-at-table-p) :keys "C-u C-u C-c *"]
- "--"
- ["Toggle Recalculate Mark" org-table-rotate-recalc-marks (org-at-table-p)]
- "--"
- ["Sum Column/Rectangle" org-table-sum
- (or (org-at-table-p) (org-region-active-p))]
- ["Which Column?" org-table-current-column (org-at-table-p)])
- ["Debug Formulas"
- org-table-toggle-formula-debugger
- :style toggle :selected (org-bound-and-true-p org-table-formula-debug)]
- ["Show Col/Row Numbers"
- org-table-toggle-coordinate-overlays
- :style toggle
- :selected (org-bound-and-true-p org-table-overlay-coordinates)]
- "--"
- ["Create" org-table-create (and (not (org-at-table-p))
- org-enable-table-editor)]
- ["Convert Region" org-table-convert-region (not (org-at-table-p 'any))]
- ["Import from File" org-table-import (not (org-at-table-p))]
- ["Export to File" org-table-export (org-at-table-p)]
- "--"
- ["Create/Convert from/to table.el" org-table-create-with-table.el t]))
-
-(easy-menu-define org-org-menu org-mode-map "Org menu"
- '("Org"
- ("Show/Hide"
- ["Cycle Visibility" org-cycle :active (or (bobp) (outline-on-heading-p))]
- ["Cycle Global Visibility" org-shifttab :active (not (org-at-table-p))]
- ["Sparse Tree..." org-sparse-tree t]
- ["Reveal Context" org-reveal t]
- ["Show All" show-all t]
- "--"
- ["Subtree to indirect buffer" org-tree-to-indirect-buffer t])
- "--"
- ["New Heading" org-insert-heading t]
- ("Navigate Headings"
- ["Up" outline-up-heading t]
- ["Next" outline-next-visible-heading t]
- ["Previous" outline-previous-visible-heading t]
- ["Next Same Level" outline-forward-same-level t]
- ["Previous Same Level" outline-backward-same-level t]
- "--"
- ["Jump" org-goto t])
- ("Edit Structure"
- ["Move Subtree Up" org-shiftmetaup (not (org-at-table-p))]
- ["Move Subtree Down" org-shiftmetadown (not (org-at-table-p))]
- "--"
- ["Copy Subtree" org-copy-special (not (org-at-table-p))]
- ["Cut Subtree" org-cut-special (not (org-at-table-p))]
- ["Paste Subtree" org-paste-special (not (org-at-table-p))]
- "--"
- ["Clone subtree, shift time" org-clone-subtree-with-time-shift t]
- "--"
- ["Promote Heading" org-metaleft (not (org-at-table-p))]
- ["Promote Subtree" org-shiftmetaleft (not (org-at-table-p))]
- ["Demote Heading" org-metaright (not (org-at-table-p))]
- ["Demote Subtree" org-shiftmetaright (not (org-at-table-p))]
- "--"
- ["Sort Region/Children" org-sort (not (org-at-table-p))]
- "--"
- ["Convert to odd levels" org-convert-to-odd-levels t]
- ["Convert to odd/even levels" org-convert-to-oddeven-levels t])
- ("Editing"
- ["Emphasis..." org-emphasize t]
- ["Edit Source Example" org-edit-special t]
- "--"
- ["Footnote new/jump" org-footnote-action t]
- ["Footnote extra" (org-footnote-action t) :active t :keys "C-u C-c C-x f"])
- ("Archive"
- ["Archive (default method)" org-archive-subtree-default t]
- "--"
- ["Move Subtree to Archive file" org-advertized-archive-subtree t]
- ["Toggle ARCHIVE tag" org-toggle-archive-tag t]
- ["Move subtree to Archive sibling" org-archive-to-archive-sibling t]
- )
- "--"
- ("Hyperlinks"
- ["Store Link (Global)" org-store-link t]
- ["Find existing link to here" org-occur-link-in-agenda-files t]
- ["Insert Link" org-insert-link t]
- ["Follow Link" org-open-at-point t]
- "--"
- ["Next link" org-next-link t]
- ["Previous link" org-previous-link t]
- "--"
- ["Descriptive Links"
- (progn (add-to-invisibility-spec '(org-link)) (org-restart-font-lock))
- :style radio
- :selected (member '(org-link) buffer-invisibility-spec)]
- ["Literal Links"
- (progn
- (org-remove-from-invisibility-spec '(org-link)) (org-restart-font-lock))
- :style radio
- :selected (not (member '(org-link) buffer-invisibility-spec))])
- "--"
- ("TODO Lists"
- ["TODO/DONE/-" org-todo t]
- ("Select keyword"
- ["Next keyword" org-shiftright (org-on-heading-p)]
- ["Previous keyword" org-shiftleft (org-on-heading-p)]
- ["Complete Keyword" pcomplete (assq :todo-keyword (org-context))]
- ["Next keyword set" org-shiftcontrolright (and (> (length org-todo-sets) 1) (org-on-heading-p))]
- ["Previous keyword set" org-shiftcontrolright (and (> (length org-todo-sets) 1) (org-on-heading-p))])
- ["Show TODO Tree" org-show-todo-tree :active t :keys "C-c / t"]
- ["Global TODO list" org-todo-list :active t :keys "C-c a t"]
- "--"
- ["Enforce dependencies" (customize-variable 'org-enforce-todo-dependencies)
- :selected org-enforce-todo-dependencies :style toggle :active t]
- "Settings for tree at point"
- ["Do Children sequentially" org-toggle-ordered-property :style radio
- :selected (ignore-errors (org-entry-get nil "ORDERED"))
- :active org-enforce-todo-dependencies :keys "C-c C-x o"]
- ["Do Children parallel" org-toggle-ordered-property :style radio
- :selected (ignore-errors (not (org-entry-get nil "ORDERED")))
- :active org-enforce-todo-dependencies :keys "C-c C-x o"]
- "--"
- ["Set Priority" org-priority t]
- ["Priority Up" org-shiftup t]
- ["Priority Down" org-shiftdown t]
- "--"
- ["Get news from all feeds" org-feed-update-all t]
- ["Go to the inbox of a feed..." org-feed-goto-inbox t]
- ["Customize feeds" (customize-variable 'org-feed-alist) t])
- ("TAGS and Properties"
- ["Set Tags" org-set-tags-command t]
- ["Change tag in region" org-change-tag-in-region (org-region-active-p)]
- "--"
- ["Set property" org-set-property t]
- ["Column view of properties" org-columns t]
- ["Insert Column View DBlock" org-insert-columns-dblock t])
- ("Dates and Scheduling"
- ["Timestamp" org-time-stamp t]
- ["Timestamp (inactive)" org-time-stamp-inactive t]
- ("Change Date"
- ["1 Day Later" org-shiftright t]
- ["1 Day Earlier" org-shiftleft t]
- ["1 ... Later" org-shiftup t]
- ["1 ... Earlier" org-shiftdown t])
- ["Compute Time Range" org-evaluate-time-range t]
- ["Schedule Item" org-schedule t]
- ["Deadline" org-deadline t]
- "--"
- ["Custom time format" org-toggle-time-stamp-overlays
- :style radio :selected org-display-custom-times]
- "--"
- ["Goto Calendar" org-goto-calendar t]
- ["Date from Calendar" org-date-from-calendar t]
- "--"
- ["Start/Restart Timer" org-timer-start t]
- ["Pause/Continue Timer" org-timer-pause-or-continue t]
- ["Stop Timer" org-timer-pause-or-continue :active t :keys "C-u C-c C-x ,"]
- ["Insert Timer String" org-timer t]
- ["Insert Timer Item" org-timer-item t])
- ("Logging work"
- ["Clock in" org-clock-in :active t :keys "C-c C-x C-i"]
- ["Switch task" (lambda () (interactive) (org-clock-in '(4))) :active t :keys "C-u C-c C-x C-i"]
- ["Clock out" org-clock-out t]
- ["Clock cancel" org-clock-cancel t]
- "--"
- ["Mark as default task" org-clock-mark-default-task t]
- ["Clock in, mark as default" (lambda () (interactive) (org-clock-in '(16))) :active t :keys "C-u C-u C-c C-x C-i"]
- ["Goto running clock" org-clock-goto t]
- "--"
- ["Display times" org-clock-display t]
- ["Create clock table" org-clock-report t]
- "--"
- ["Record DONE time"
- (progn (setq org-log-done (not org-log-done))
- (message "Switching to %s will %s record a timestamp"
- (car org-done-keywords)
- (if org-log-done "automatically" "not")))
- :style toggle :selected org-log-done])
- "--"
- ["Agenda Command..." org-agenda t]
- ["Set Restriction Lock" org-agenda-set-restriction-lock t]
- ("File List for Agenda")
- ("Special views current file"
- ["TODO Tree" org-show-todo-tree t]
- ["Check Deadlines" org-check-deadlines t]
- ["Timeline" org-timeline t]
- ["Tags/Property tree" org-match-sparse-tree t])
- "--"
- ["Export/Publish..." org-export t]
- ("LaTeX"
- ["Org CDLaTeX mode" org-cdlatex-mode :style toggle
- :selected org-cdlatex-mode]
- ["Insert Environment" cdlatex-environment (fboundp 'cdlatex-environment)]
- ["Insert math symbol" cdlatex-math-symbol (fboundp 'cdlatex-math-symbol)]
- ["Modify math symbol" org-cdlatex-math-modify
- (org-inside-LaTeX-fragment-p)]
- ["Insert citation" org-reftex-citation t]
- "--"
- ["Template for BEAMER" org-insert-beamer-options-template t])
- "--"
- ("MobileOrg"
- ["Push Files and Views" org-mobile-push t]
- ["Get Captured and Flagged" org-mobile-pull t]
- ["Find FLAGGED Tasks" (org-agenda nil "?") :active t :keys "C-c a ?"]
- "--"
- ["Setup" (progn (require 'org-mobile) (customize-group 'org-mobile)) t])
- "--"
- ("Documentation"
- ["Show Version" org-version t]
- ["Info Documentation" org-info t])
- ("Customize"
- ["Browse Org Group" org-customize t]
- "--"
- ["Expand This Menu" org-create-customize-menu
- (fboundp 'customize-menu-create)])
- ["Send bug report" org-submit-bug-report t]
- "--"
- ("Refresh/Reload"
- ["Refresh setup current buffer" org-mode-restart t]
- ["Reload Org (after update)" org-reload t]
- ["Reload Org uncompiled" (org-reload t) :active t :keys "C-u C-c C-x r"])
- ))
-
-(defun org-info (&optional node)
- "Read documentation for Org-mode in the info system.
-With optional NODE, go directly to that node."
- (interactive)
- (info (format "(org)%s" (or node ""))))
-
-;;;###autoload
-(defun org-submit-bug-report ()
- "Submit a bug report on Org-mode via mail.
-
-Don't hesitate to report any problems or inaccurate documentation.
-
-If you don't have setup sending mail from (X)Emacs, please copy the
-output buffer into your mail program, as it gives us important
-information about your Org-mode version and configuration."
- (interactive)
- (require 'reporter)
- (org-load-modules-maybe)
- (org-require-autoloaded-modules)
- (let ((reporter-prompt-for-summary-p "Bug report subject: "))
- (reporter-submit-bug-report
- "emacs-orgmode@gnu.org"
- (org-version)
- (let (list)
- (save-window-excursion
- (switch-to-buffer (get-buffer-create "*Warn about privacy*"))
- (delete-other-windows)
- (erase-buffer)
- (insert "You are about to submit a bug report to the Org-mode mailing list.
-
-We would like to add your full Org-mode and Outline configuration to the
-bug report. This greatly simplifies the work of the maintainer and
-other experts on the mailing list.
-
-HOWEVER, some variables you have customized may contain private
-information. The names of customers, colleagues, or friends, might
-appear in the form of file names, tags, todo states, or search strings.
-If you answer yes to the prompt, you might want to check and remove
-such private information before sending the email.")
- (add-text-properties (point-min) (point-max) '(face org-warning))
- (when (yes-or-no-p "Include your Org-mode configuration ")
- (mapatoms
- (lambda (v)
- (and (boundp v)
- (string-match "\\`\\(org-\\|outline-\\)" (symbol-name v))
- (or (and (symbol-value v)
- (string-match "\\(-hook\\|-function\\)\\'" (symbol-name v)))
- (and
- (get v 'custom-type) (get v 'standard-value)
- (not (equal (symbol-value v) (eval (car (get v 'standard-value)))))))
- (push v list)))))
- (kill-buffer (get-buffer "*Warn about privacy*"))
- list))
- nil nil
- "Remember to cover the basics, that is, what you expected to happen and
-what in fact did happen. You don't know how to make a good report? See
-
- http://orgmode.org/manual/Feedback.html#Feedback
-
-Your bug report will be posted to the Org-mode mailing list.
-------------------------------------------------------------------------")
- (save-excursion
- (if (re-search-backward "^\\(Subject: \\)Org-mode version \\(.*?\\);[ \t]*\\(.*\\)" nil t)
- (replace-match "\\1Bug: \\3 [\\2]")))))
-
-
-(defun org-install-agenda-files-menu ()
- (let ((bl (buffer-list)))
- (save-excursion
- (while bl
- (set-buffer (pop bl))
- (if (org-mode-p) (setq bl nil)))
- (when (org-mode-p)
- (easy-menu-change
- '("Org") "File List for Agenda"
- (append
- (list
- ["Edit File List" (org-edit-agenda-file-list) t]
- ["Add/Move Current File to Front of List" org-agenda-file-to-front t]
- ["Remove Current File from List" org-remove-file t]
- ["Cycle through agenda files" org-cycle-agenda-files t]
- ["Occur in all agenda files" org-occur-in-agenda-files t]
- "--")
- (mapcar 'org-file-menu-entry (org-agenda-files t))))))))
-
-;;;; Documentation
-
-;;;###autoload
-(defun org-require-autoloaded-modules ()
- (interactive)
- (mapc 'require
- '(org-agenda org-archive org-ascii org-attach org-clock org-colview
- org-docbook org-exp org-html org-icalendar
- org-id org-latex
- org-publish org-remember org-table
- org-timer org-xoxo)))
-
-;;;###autoload
-(defun org-reload (&optional uncompiled)
- "Reload all org lisp files.
-With prefix arg UNCOMPILED, load the uncompiled versions."
- (interactive "P")
- (require 'find-func)
- (let* ((file-re "^\\(org\\|orgtbl\\)\\(\\.el\\|-.*\\.el\\)")
- (dir-org (file-name-directory (org-find-library-name "org")))
- (dir-org-contrib (ignore-errors
- (file-name-directory
- (org-find-library-name "org-contribdir"))))
- (babel-files
- (mapcar (lambda (el) (concat "ob" (when el (format "-%s" el)) ".el"))
- (append (list nil "comint" "eval" "exp" "keys"
- "lob" "ref" "table" "tangle")
- (delq nil
- (mapcar
- (lambda (lang)
- (when (cdr lang) (symbol-name (car lang))))
- org-babel-load-languages)))))
- (files
- (append (directory-files dir-org t file-re)
- babel-files
- (and dir-org-contrib
- (directory-files dir-org-contrib t file-re))))
- (remove-re (concat (if (featurep 'xemacs)
- "org-colview" "org-colview-xemacs")
- "\\'")))
- (setq files (mapcar 'file-name-sans-extension files))
- (setq files (mapcar
- (lambda (x) (if (string-match remove-re x) nil x))
- files))
- (setq files (delq nil files))
- (mapc
- (lambda (f)
- (when (featurep (intern (file-name-nondirectory f)))
- (if (and (not uncompiled)
- (file-exists-p (concat f ".elc")))
- (load (concat f ".elc") nil nil t)
- (load (concat f ".el") nil nil t))))
- files))
- (org-version))
-
-;;;###autoload
-(defun org-customize ()
- "Call the customize function with org as argument."
- (interactive)
- (org-load-modules-maybe)
- (org-require-autoloaded-modules)
- (customize-browse 'org))
-
-(defun org-create-customize-menu ()
- "Create a full customization menu for Org-mode, insert it into the menu."
- (interactive)
- (org-load-modules-maybe)
- (org-require-autoloaded-modules)
- (if (fboundp 'customize-menu-create)
- (progn
- (easy-menu-change
- '("Org") "Customize"
- `(["Browse Org group" org-customize t]
- "--"
- ,(customize-menu-create 'org)
- ["Set" Custom-set t]
- ["Save" Custom-save t]
- ["Reset to Current" Custom-reset-current t]
- ["Reset to Saved" Custom-reset-saved t]
- ["Reset to Standard Settings" Custom-reset-standard t]))
- (message "\"Org\"-menu now contains full customization menu"))
- (error "Cannot expand menu (outdated version of cus-edit.el)")))
-
-;;;; Miscellaneous stuff
-
-;;; Generally useful functions
-
-(defun org-get-at-bol (property)
- "Get text property PROPERTY at beginning of line."
- (get-text-property (point-at-bol) property))
-
-(defun org-find-text-property-in-string (prop s)
- "Return the first non-nil value of property PROP in string S."
- (or (get-text-property 0 prop s)
- (get-text-property (or (next-single-property-change 0 prop s) 0)
- prop s)))
-
-(defun org-display-warning (message) ;; Copied from Emacs-Muse
- "Display the given MESSAGE as a warning."
- (if (fboundp 'display-warning)
- (display-warning 'org message
- (if (featurep 'xemacs) 'warning :warning))
- (let ((buf (get-buffer-create "*Org warnings*")))
- (with-current-buffer buf
- (goto-char (point-max))
- (insert "Warning (Org): " message)
- (unless (bolp)
- (newline)))
- (display-buffer buf)
- (sit-for 0))))
-
-(defun org-in-commented-line ()
- "Is point in a line starting with `#'?"
- (equal (char-after (point-at-bol)) ?#))
-
-(defun org-in-indented-comment-line ()
- "Is point in a line starting with `#' after some white space?"
- (save-excursion
- (save-match-data
- (goto-char (point-at-bol))
- (looking-at "[ \t]*#"))))
-
-(defun org-in-verbatim-emphasis ()
- (save-match-data
- (and (org-in-regexp org-emph-re 2) (member (match-string 3) '("=" "~")))))
-
-(defun org-goto-marker-or-bmk (marker &optional bookmark)
- "Go to MARKER, widen if necessary. When marker is not live, try BOOKMARK."
- (if (and marker (marker-buffer marker)
- (buffer-live-p (marker-buffer marker)))
- (progn
- (switch-to-buffer (marker-buffer marker))
- (if (or (> marker (point-max)) (< marker (point-min)))
- (widen))
- (goto-char marker)
- (org-show-context 'org-goto))
- (if bookmark
- (bookmark-jump bookmark)
- (error "Cannot find location"))))
-
-(defun org-quote-csv-field (s)
- "Quote field for inclusion in CSV material."
- (if (string-match "[\",]" s)
- (concat "\"" (mapconcat 'identity (split-string s "\"") "\"\"") "\"")
- s))
-
-(defun org-plist-delete (plist property)
- "Delete PROPERTY from PLIST.
-This is in contrast to merely setting it to 0."
- (let (p)
- (while plist
- (if (not (eq property (car plist)))
- (setq p (plist-put p (car plist) (nth 1 plist))))
- (setq plist (cddr plist)))
- p))
-
-(defun org-force-self-insert (N)
- "Needed to enforce self-insert under remapping."
- (interactive "p")
- (self-insert-command N))
-
-(defun org-string-width (s)
- "Compute width of string, ignoring invisible characters.
-This ignores character with invisibility property `org-link', and also
-characters with property `org-cwidth', because these will become invisible
-upon the next fontification round."
- (let (b l)
- (when (or (eq t buffer-invisibility-spec)
- (assq 'org-link buffer-invisibility-spec))
- (while (setq b (text-property-any 0 (length s)
- 'invisible 'org-link s))
- (setq s (concat (substring s 0 b)
- (substring s (or (next-single-property-change
- b 'invisible s) (length s)))))))
- (while (setq b (text-property-any 0 (length s) 'org-cwidth t s))
- (setq s (concat (substring s 0 b)
- (substring s (or (next-single-property-change
- b 'org-cwidth s) (length s))))))
- (setq l (string-width s) b -1)
- (while (setq b (text-property-any (1+ b) (length s) 'org-dwidth t s))
- (setq l (- l (get-text-property b 'org-dwidth-n s))))
- l))
-
-(defun org-shorten-string (s maxlength)
- "Shorten string S so tht it is no longer than MAXLENGTH characters.
-If the string is shorter or has length MAXLENGTH, just return the
-original string. If it is longer, the functions finds a space in the
-string, breaks this string off at that locations and adds three dots
-as ellipsis. Including the ellipsis, the string will not be longer
-than MAXLENGTH. If finding a good breaking point in the string does
-not work, the string is just chopped off in the middle of a word
-if necessary."
- (if (<= (length s) maxlength)
- s
- (let* ((n (max (- maxlength 4) 1))
- (re (concat "\\`\\(.\\{1," (int-to-string n) "\\}[^ ]\\)\\([ ]\\|\\'\\)")))
- (if (string-match re s)
- (concat (match-string 1 s) "...")
- (concat (substring s 0 (max (- maxlength 3) 0)) "...")))))
-
-(defun org-get-indentation (&optional line)
- "Get the indentation of the current line, interpreting tabs.
-When LINE is given, assume it represents a line and compute its indentation."
- (if line
- (if (string-match "^ *" (org-remove-tabs line))
- (match-end 0))
- (save-excursion
- (beginning-of-line 1)
- (skip-chars-forward " \t")
- (current-column))))
-
-(defun org-remove-tabs (s &optional width)
- "Replace tabulators in S with spaces.
-Assumes that s is a single line, starting in column 0."
- (setq width (or width tab-width))
- (while (string-match "\t" s)
- (setq s (replace-match
- (make-string
- (- (* width (/ (+ (match-beginning 0) width) width))
- (match-beginning 0)) ?\ )
- t t s)))
- s)
-
-(defun org-fix-indentation (line ind)
- "Fix indentation in LINE.
-IND is a cons cell with target and minimum indentation.
-If the current indentation in LINE is smaller than the minimum,
-leave it alone. If it is larger than ind, set it to the target."
- (let* ((l (org-remove-tabs line))
- (i (org-get-indentation l))
- (i1 (car ind)) (i2 (cdr ind)))
- (if (>= i i2) (setq l (substring line i2)))
- (if (> i1 0)
- (concat (make-string i1 ?\ ) l)
- l)))
-
-(defun org-remove-indentation (code &optional n)
- "Remove the maximum common indentation from the lines in CODE.
-N may optionally be the number of spaces to remove."
- (with-temp-buffer
- (insert code)
- (org-do-remove-indentation n)
- (buffer-string)))
-
-(defun org-do-remove-indentation (&optional n)
- "Remove the maximum common indentation from the buffer."
- (untabify (point-min) (point-max))
- (let ((min 10000) re)
- (if n
- (setq min n)
- (goto-char (point-min))
- (while (re-search-forward "^ *[^ \n]" nil t)
- (setq min (min min (1- (- (match-end 0) (match-beginning 0)))))))
- (unless (or (= min 0) (= min 10000))
- (setq re (format "^ \\{%d\\}" min))
- (goto-char (point-min))
- (while (re-search-forward re nil t)
- (replace-match "")
- (end-of-line 1))
- min)))
-
-(defun org-fill-template (template alist)
- "Find each %key of ALIST in TEMPLATE and replace it."
- (let ((case-fold-search nil)
- entry key value)
- (setq alist (sort (copy-sequence alist)
- (lambda (a b) (< (length (car a)) (length (car b))))))
- (while (setq entry (pop alist))
- (setq template
- (replace-regexp-in-string
- (concat "%" (regexp-quote (car entry)))
- (cdr entry) template t t)))
- template))
-
-(defun org-base-buffer (buffer)
- "Return the base buffer of BUFFER, if it has one. Else return the buffer."
- (if (not buffer)
- buffer
- (or (buffer-base-buffer buffer)
- buffer)))
-
-(defun org-trim (s)
- "Remove whitespace at beginning and end of string."
- (if (string-match "\\`[ \t\n\r]+" s) (setq s (replace-match "" t t s)))
- (if (string-match "[ \t\n\r]+\\'" s) (setq s (replace-match "" t t s)))
- s)
-
-(defun org-wrap (string &optional width lines)
- "Wrap string to either a number of lines, or a width in characters.
-If WIDTH is non-nil, the string is wrapped to that width, however many lines
-that costs. If there is a word longer than WIDTH, the text is actually
-wrapped to the length of that word.
-IF WIDTH is nil and LINES is non-nil, the string is forced into at most that
-many lines, whatever width that takes.
-The return value is a list of lines, without newlines at the end."
- (let* ((words (org-split-string string "[ \t\n]+"))
- (maxword (apply 'max (mapcar 'org-string-width words)))
- w ll)
- (cond (width
- (org-do-wrap words (max maxword width)))
- (lines
- (setq w maxword)
- (setq ll (org-do-wrap words maxword))
- (if (<= (length ll) lines)
- ll
- (setq ll words)
- (while (> (length ll) lines)
- (setq w (1+ w))
- (setq ll (org-do-wrap words w)))
- ll))
- (t (error "Cannot wrap this")))))
-
-(defun org-do-wrap (words width)
- "Create lines of maximum width WIDTH (in characters) from word list WORDS."
- (let (lines line)
- (while words
- (setq line (pop words))
- (while (and words (< (+ (length line) (length (car words))) width))
- (setq line (concat line " " (pop words))))
- (setq lines (push line lines)))
- (nreverse lines)))
-
-(defun org-split-string (string &optional separators)
- "Splits STRING into substrings at SEPARATORS.
-No empty strings are returned if there are matches at the beginning
-and end of string."
- (let ((rexp (or separators "[ \f\t\n\r\v]+"))
- (start 0)
- notfirst
- (list nil))
- (while (and (string-match rexp string
- (if (and notfirst
- (= start (match-beginning 0))
- (< start (length string)))
- (1+ start) start))
- (< (match-beginning 0) (length string)))
- (setq notfirst t)
- (or (eq (match-beginning 0) 0)
- (and (eq (match-beginning 0) (match-end 0))
- (eq (match-beginning 0) start))
- (setq list
- (cons (substring string start (match-beginning 0))
- list)))
- (setq start (match-end 0)))
- (or (eq start (length string))
- (setq list
- (cons (substring string start)
- list)))
- (nreverse list)))
-
-(defun org-quote-vert (s)
- "Replace \"|\" with \"\\vert\"."
- (while (string-match "|" s)
- (setq s (replace-match "\\vert" t t s)))
- s)
-
-(defun org-uuidgen-p (s)
- "Is S an ID created by UUIDGEN?"
- (string-match "\\`[0-9a-f]\\{8\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{4\\}-[0-9a-f]\\{12\\}\\'" (downcase s)))
-
-(defun org-context ()
- "Return a list of contexts of the current cursor position.
-If several contexts apply, all are returned.
-Each context entry is a list with a symbol naming the context, and
-two positions indicating start and end of the context. Possible
-contexts are:
-
-:headline anywhere in a headline
-:headline-stars on the leading stars in a headline
-:todo-keyword on a TODO keyword (including DONE) in a headline
-:tags on the TAGS in a headline
-:priority on the priority cookie in a headline
-:item on the first line of a plain list item
-:item-bullet on the bullet/number of a plain list item
-:checkbox on the checkbox in a plain list item
-:table in an org-mode table
-:table-special on a special filed in a table
-:table-table in a table.el table
-:link on a hyperlink
-:keyword on a keyword: SCHEDULED, DEADLINE, CLOSE,COMMENT, QUOTE.
-:target on a <<target>>
-:radio-target on a <<<radio-target>>>
-:latex-fragment on a LaTeX fragment
-:latex-preview on a LaTeX fragment with overlayed preview image
-
-This function expects the position to be visible because it uses font-lock
-faces as a help to recognize the following contexts: :table-special, :link,
-and :keyword."
- (let* ((f (get-text-property (point) 'face))
- (faces (if (listp f) f (list f)))
- (p (point)) clist o)
- ;; First the large context
- (cond
- ((org-on-heading-p t)
- (push (list :headline (point-at-bol) (point-at-eol)) clist)
- (when (progn
- (beginning-of-line 1)
- (looking-at org-todo-line-tags-regexp))
- (push (org-point-in-group p 1 :headline-stars) clist)
- (push (org-point-in-group p 2 :todo-keyword) clist)
- (push (org-point-in-group p 4 :tags) clist))
- (goto-char p)
- (skip-chars-backward "^[\n\r \t") (or (bobp) (backward-char 1))
- (if (looking-at "\\[#[A-Z0-9]\\]")
- (push (org-point-in-group p 0 :priority) clist)))
-
- ((org-at-item-p)
- (push (org-point-in-group p 2 :item-bullet) clist)
- (push (list :item (point-at-bol)
- (save-excursion (org-end-of-item) (point)))
- clist)
- (and (org-at-item-checkbox-p)
- (push (org-point-in-group p 0 :checkbox) clist)))
-
- ((org-at-table-p)
- (push (list :table (org-table-begin) (org-table-end)) clist)
- (if (memq 'org-formula faces)
- (push (list :table-special
- (previous-single-property-change p 'face)
- (next-single-property-change p 'face)) clist)))
- ((org-at-table-p 'any)
- (push (list :table-table) clist)))
- (goto-char p)
-
- ;; Now the small context
- (cond
- ((org-at-timestamp-p)
- (push (org-point-in-group p 0 :timestamp) clist))
- ((memq 'org-link faces)
- (push (list :link
- (previous-single-property-change p 'face)
- (next-single-property-change p 'face)) clist))
- ((memq 'org-special-keyword faces)
- (push (list :keyword
- (previous-single-property-change p 'face)
- (next-single-property-change p 'face)) clist))
- ((org-on-target-p)
- (push (org-point-in-group p 0 :target) clist)
- (goto-char (1- (match-beginning 0)))
- (if (looking-at org-radio-target-regexp)
- (push (org-point-in-group p 0 :radio-target) clist))
- (goto-char p))
- ((setq o (car (delq nil
- (mapcar
- (lambda (x)
- (if (memq x org-latex-fragment-image-overlays) x))
- (overlays-at (point))))))
- (push (list :latex-fragment
- (overlay-start o) (overlay-end o)) clist)
- (push (list :latex-preview
- (overlay-start o) (overlay-end o)) clist))
- ((org-inside-LaTeX-fragment-p)
- ;; FIXME: positions wrong.
- (push (list :latex-fragment (point) (point)) clist)))
-
- (setq clist (nreverse (delq nil clist)))
- clist))
-
-;; FIXME: Compare with at-regexp-p Do we need both?
-(defun org-in-regexp (re &optional nlines visually)
- "Check if point is inside a match of regexp.
-Normally only the current line is checked, but you can include NLINES extra
-lines both before and after point into the search.
-If VISUALLY is set, require that the cursor is not after the match but
-really on, so that the block visually is on the match."
- (catch 'exit
- (let ((pos (point))
- (eol (point-at-eol (+ 1 (or nlines 0))))
- (inc (if visually 1 0)))
- (save-excursion
- (beginning-of-line (- 1 (or nlines 0)))
- (while (re-search-forward re eol t)
- (if (and (<= (match-beginning 0) pos)
- (>= (+ inc (match-end 0)) pos))
- (throw 'exit (cons (match-beginning 0) (match-end 0)))))))))
-
-(defun org-at-regexp-p (regexp)
- "Is point inside a match of REGEXP in the current line?"
- (catch 'exit
- (save-excursion
- (let ((pos (point)) (end (point-at-eol)))
- (beginning-of-line 1)
- (while (re-search-forward regexp end t)
- (if (and (<= (match-beginning 0) pos)
- (>= (match-end 0) pos))
- (throw 'exit t)))
- nil))))
-
-(defun org-in-regexps-block-p (start-re end-re &optional bound)
- "Return t if the current point is between matches of START-RE and END-RE.
-This will also return t if point is on one of the two matches or
-in an unfinished block. END-RE can be a string or a form
-returning a string.
-
-An optional third argument bounds the search for START-RE. It
-defaults to previous heading or `point-min'."
- (let ((pos (point))
- (limit (or bound (save-excursion (outline-previous-heading)))))
- (save-excursion
- ;; we're on a block when point is on start-re...
- (or (org-at-regexp-p start-re)
- ;; ... or start-re can be found above...
- (and (re-search-backward start-re limit t)
- ;; ... but no end-re between start-re and point.
- (not (re-search-forward (eval end-re) pos t)))))))
-
-(defun org-occur-in-agenda-files (regexp &optional nlines)
- "Call `multi-occur' with buffers for all agenda files."
- (interactive "sOrg-files matching: \np")
- (let* ((files (org-agenda-files))
- (tnames (mapcar 'file-truename files))
- (extra org-agenda-text-search-extra-files)
- f)
- (when (eq (car extra) 'agenda-archives)
- (setq extra (cdr extra))
- (setq files (org-add-archive-files files)))
- (while (setq f (pop extra))
- (unless (member (file-truename f) tnames)
- (add-to-list 'files f 'append)
- (add-to-list 'tnames (file-truename f) 'append)))
- (multi-occur
- (mapcar (lambda (x)
- (with-current-buffer
- (or (get-file-buffer x) (find-file-noselect x))
- (widen)
- (current-buffer)))
- files)
- regexp)))
-
-(if (boundp 'occur-mode-find-occurrence-hook)
- ;; Emacs 23
- (add-hook 'occur-mode-find-occurrence-hook
- (lambda ()
- (when (org-mode-p)
- (org-reveal))))
- ;; Emacs 22
- (defadvice occur-mode-goto-occurrence
- (after org-occur-reveal activate)
- (and (org-mode-p) (org-reveal)))
- (defadvice occur-mode-goto-occurrence-other-window
- (after org-occur-reveal activate)
- (and (org-mode-p) (org-reveal)))
- (defadvice occur-mode-display-occurrence
- (after org-occur-reveal activate)
- (when (org-mode-p)
- (let ((pos (occur-mode-find-occurrence)))
- (with-current-buffer (marker-buffer pos)
- (save-excursion
- (goto-char pos)
- (org-reveal)))))))
-
-(defun org-occur-link-in-agenda-files ()
- "Create a link and search for it in the agendas.
-The link is not stored in `org-stored-links', it is just created
-for the search purpose."
- (interactive)
- (let ((link (condition-case nil
- (org-store-link nil)
- (error "Unable to create a link to here"))))
- (org-occur-in-agenda-files (regexp-quote link))))
-
-(defun org-uniquify (list)
- "Remove duplicate elements from LIST."
- (let (res)
- (mapc (lambda (x) (add-to-list 'res x 'append)) list)
- res))
-
-(defun org-delete-all (elts list)
- "Remove all elements in ELTS from LIST."
- (while elts
- (setq list (delete (pop elts) list)))
- list)
-
-(defun org-count (cl-item cl-seq)
- "Count the number of occurrences of ITEM in SEQ.
-Taken from `count' in cl-seq.el with all keyword arguments removed."
- (let ((cl-end (length cl-seq)) (cl-start 0) (cl-count 0) cl-x)
- (when (consp cl-seq) (setq cl-seq (nthcdr cl-start cl-seq)))
- (while (< cl-start cl-end)
- (setq cl-x (if (consp cl-seq) (pop cl-seq) (aref cl-seq cl-start)))
- (if (equal cl-item cl-x) (setq cl-count (1+ cl-count)))
- (setq cl-start (1+ cl-start)))
- cl-count))
-
-(defun org-remove-if (predicate seq)
- "Remove everything from SEQ that fulfills PREDICATE."
- (let (res e)
- (while seq
- (setq e (pop seq))
- (if (not (funcall predicate e)) (push e res)))
- (nreverse res)))
-
-(defun org-remove-if-not (predicate seq)
- "Remove everything from SEQ that does not fulfill PREDICATE."
- (let (res e)
- (while seq
- (setq e (pop seq))
- (if (funcall predicate e) (push e res)))
- (nreverse res)))
-
-(defun org-back-over-empty-lines ()
- "Move backwards over whitespace, to the beginning of the first empty line.
-Returns the number of empty lines passed."
- (let ((pos (point)))
- (skip-chars-backward " \t\n\r")
- (beginning-of-line 2)
- (goto-char (min (point) pos))
- (count-lines (point) pos)))
-
-(defun org-skip-whitespace ()
- (skip-chars-forward " \t\n\r"))
-
-(defun org-point-in-group (point group &optional context)
- "Check if POINT is in match-group GROUP.
-If CONTEXT is non-nil, return a list with CONTEXT and the boundaries of the
-match. If the match group does not exist or point is not inside it,
-return nil."
- (and (match-beginning group)
- (>= point (match-beginning group))
- (<= point (match-end group))
- (if context
- (list context (match-beginning group) (match-end group))
- t)))
-
-(defun org-switch-to-buffer-other-window (&rest args)
- "Switch to buffer in a second window on the current frame.
-In particular, do not allow pop-up frames.
-Returns the newly created buffer."
- (let (pop-up-frames special-display-buffer-names special-display-regexps
- special-display-function)
- (apply 'switch-to-buffer-other-window args)))
-
-(defun org-combine-plists (&rest plists)
- "Create a single property list from all plists in PLISTS.
-The process starts by copying the first list, and then setting properties
-from the other lists. Settings in the last list are the most significant
-ones and overrule settings in the other lists."
- (let ((rtn (copy-sequence (pop plists)))
- p v ls)
- (while plists
- (setq ls (pop plists))
- (while ls
- (setq p (pop ls) v (pop ls))
- (setq rtn (plist-put rtn p v))))
- rtn))
-
-(defun org-move-line-down (arg)
- "Move the current line down. With prefix argument, move it past ARG lines."
- (interactive "p")
- (let ((col (current-column))
- beg end pos)
- (beginning-of-line 1) (setq beg (point))
- (beginning-of-line 2) (setq end (point))
- (beginning-of-line (+ 1 arg))
- (setq pos (move-marker (make-marker) (point)))
- (insert (delete-and-extract-region beg end))
- (goto-char pos)
- (org-move-to-column col)))
-
-(defun org-move-line-up (arg)
- "Move the current line up. With prefix argument, move it past ARG lines."
- (interactive "p")
- (let ((col (current-column))
- beg end pos)
- (beginning-of-line 1) (setq beg (point))
- (beginning-of-line 2) (setq end (point))
- (beginning-of-line (- arg))
- (setq pos (move-marker (make-marker) (point)))
- (insert (delete-and-extract-region beg end))
- (goto-char pos)
- (org-move-to-column col)))
-
-(defun org-replace-escapes (string table)
- "Replace %-escapes in STRING with values in TABLE.
-TABLE is an association list with keys like \"%a\" and string values.
-The sequences in STRING may contain normal field width and padding information,
-for example \"%-5s\". Replacements happen in the sequence given by TABLE,
-so values can contain further %-escapes if they are define later in TABLE."
- (let ((tbl (copy-alist table))
- (case-fold-search nil)
- (pchg 0)
- e re rpl)
- (while (setq e (pop tbl))
- (setq re (concat "%-?[0-9.]*" (substring (car e) 1)))
- (when (and (cdr e) (string-match re (cdr e)))
- (let ((sref (substring (cdr e) (match-beginning 0) (match-end 0)))
- (safe "SREF"))
- (add-text-properties 0 3 (list 'sref sref) safe)
- (setcdr e (replace-match safe t t (cdr e)))))
- (while (string-match re string)
- (setq rpl (format (concat (substring (match-string 0 string) 0 -1) "s")
- (cdr e)))
- (setq string (replace-match rpl t t string))))
- (while (setq pchg (next-property-change pchg string))
- (let ((sref (get-text-property pchg 'sref string)))
- (when (and sref (string-match "SREF" string pchg))
- (setq string (replace-match sref t t string)))))
- string))
-
-(defun org-sublist (list start end)
- "Return a section of LIST, from START to END.
-Counting starts at 1."
- (let (rtn (c start))
- (setq list (nthcdr (1- start) list))
- (while (and list (<= c end))
- (push (pop list) rtn)
- (setq c (1+ c)))
- (nreverse rtn)))
-
-(defun org-find-base-buffer-visiting (file)
- "Like `find-buffer-visiting' but always return the base buffer and
-not an indirect buffer."
- (let ((buf (or (get-file-buffer file)
- (find-buffer-visiting file))))
- (if buf
- (or (buffer-base-buffer buf) buf)
- nil)))
-
-(defun org-image-file-name-regexp (&optional extensions)
- "Return regexp matching the file names of images.
-If EXTENSIONS is given, only match these."
- (if (and (not extensions) (fboundp 'image-file-name-regexp))
- (image-file-name-regexp)
- (let ((image-file-name-extensions
- (or extensions
- '("png" "jpeg" "jpg" "gif" "tiff" "tif"
- "xbm" "xpm" "pbm" "pgm" "ppm"))))
- (concat "\\."
- (regexp-opt (nconc (mapcar 'upcase
- image-file-name-extensions)
- image-file-name-extensions)
- t)
- "\\'"))))
-
-(defun org-file-image-p (file &optional extensions)
- "Return non-nil if FILE is an image."
- (save-match-data
- (string-match (org-image-file-name-regexp extensions) file)))
-
-(defun org-get-cursor-date ()
- "Return the date at cursor in as a time.
-This works in the calendar and in the agenda, anywhere else it just
-returns the current time."
- (let (date day defd)
- (cond
- ((eq major-mode 'calendar-mode)
- (setq date (calendar-cursor-to-date)
- defd (encode-time 0 0 0 (nth 1 date) (nth 0 date) (nth 2 date))))
- ((eq major-mode 'org-agenda-mode)
- (setq day (get-text-property (point) 'day))
- (if day
- (setq date (calendar-gregorian-from-absolute day)
- defd (encode-time 0 0 0 (nth 1 date) (nth 0 date)
- (nth 2 date))))))
- (or defd (current-time))))
-
-(defvar org-agenda-action-marker (make-marker)
- "Marker pointing to the entry for the next agenda action.")
-
-(defun org-mark-entry-for-agenda-action ()
- "Mark the current entry as target of an agenda action.
-Agenda actions are actions executed from the agenda with the key `k',
-which make use of the date at the cursor."
- (interactive)
- (move-marker org-agenda-action-marker
- (save-excursion (org-back-to-heading t) (point))
- (current-buffer))
- (message
- "Entry marked for action; press `k' at desired date in agenda or calendar"))
-
-(defun org-mark-subtree ()
- "Mark the current subtree.
-This puts point at the start of the current subtree, and mark at the end.
-
-If point is in an inline task, mark that task instead."
- (interactive)
- (let ((inline-task-p
- (and (featurep 'org-inlinetask)
- (org-inlinetask-in-task-p)))
- (beg))
- ;; Get beginning of subtree
- (cond
- (inline-task-p (org-inlinetask-goto-beginning))
- ((org-at-heading-p) (beginning-of-line))
- (t (let ((outline-regexp (org-get-limited-outline-regexp)))
- (outline-previous-visible-heading 1))))
- (setq beg (point))
- ;; Get end of it
- (if inline-task-p
- (org-inlinetask-goto-end)
- (org-end-of-subtree))
- ;; Mark zone
- (push-mark (point) nil t)
- (goto-char beg)))
-
-;;; Paragraph filling stuff.
-;; We want this to be just right, so use the full arsenal.
-
-(defun org-indent-line-function ()
- "Indent line depending on context."
- (interactive)
- (let* ((pos (point))
- (itemp (org-at-item-p))
- (case-fold-search t)
- (org-drawer-regexp (or org-drawer-regexp "\000"))
- (inline-task-p (and (featurep 'org-inlinetask)
- (org-inlinetask-in-task-p)))
- column bpos bcol tpos tcol)
- (beginning-of-line 1)
- (cond
- ;; Comments
- ((looking-at "# ") (setq column 0))
- ;; Headings
- ((looking-at "\\*+ ") (setq column 0))
- ;; Literal examples
- ((looking-at "[ \t]*:[ \t]")
- (setq column (org-get-indentation))) ; do nothing
- ;; Drawers
- ((and (looking-at "[ \t]*:END:")
- (save-excursion (re-search-backward org-drawer-regexp nil t)))
- (save-excursion
- (goto-char (1- (match-beginning 1)))
- (setq column (current-column))))
- ;; Special blocks
- ((and (looking-at "[ \t]*#\\+end_\\([a-z]+\\)")
- (save-excursion
- (re-search-backward
- (concat "^[ \t]*#\\+begin_" (downcase (match-string 1))) nil t)))
- (setq column (org-get-indentation (match-string 0))))
- ((and (not (looking-at "[ \t]*#\\+begin_"))
- (org-in-regexps-block-p "^[ \t]*#\\+begin_" "[ \t]*#\\+end_"))
- (save-excursion
- (re-search-backward "^[ \t]*#\\+begin_\\([a-z]+\\)" nil t))
- (setq column
- (if (equal (downcase (match-string 1)) "src")
- ;; src blocks: let `org-edit-src-exit' handle them
- (org-get-indentation)
- (org-get-indentation (match-string 0)))))
- ;; Lists
- ((org-in-item-p)
- (org-beginning-of-item)
- (looking-at "[ \t]*\\(\\S-+\\)[ \t]*\\(\\(:?\\[@\\(:?start:\\)?[0-9]+\\][ \t]*\\)?\\[[- X]\\][ \t]*\\|.*? :: \\)?")
- (setq bpos (match-beginning 1) tpos (match-end 0)
- bcol (progn (goto-char bpos) (current-column))
- tcol (progn (goto-char tpos) (current-column)))
- (if (> tcol (+ bcol org-description-max-indent))
- (setq tcol (+ bcol 5)))
- (goto-char pos)
- (setq column (if itemp (org-get-indentation) tcol)))
- ;; This line has nothing special, look at the previous relevant
- ;; line to compute indentation
- (t
- (beginning-of-line 0)
- (while (and (not (bobp))
- (not (looking-at org-drawer-regexp))
- ;; skip comments, verbatim, empty lines, tables,
- ;; inline tasks, lists, drawers and blocks
- (or (and (looking-at "[ \t]*:END:")
- (re-search-backward org-drawer-regexp nil t))
- (and (looking-at "[ \t]*#\\+end_")
- (re-search-backward "[ \t]*#\\+begin_"nil t))
- (looking-at "[ \t]*[\n:#|]")
- (and (org-in-item-p) (goto-char (org-list-top-point)))
- (and (not inline-task-p)
- (featurep 'org-inlinetask)
- (org-inlinetask-in-task-p)
- (or (org-inlinetask-goto-beginning) t))))
- (beginning-of-line 0))
- (cond
- ;; There was an heading above.
- ((looking-at "\\*+[ \t]+")
- (if (not org-adapt-indentation)
- (setq column 0)
- (goto-char (match-end 0))
- (setq column (current-column))))
- ;; A drawer had started and is unfinished
- ((looking-at org-drawer-regexp)
- (goto-char (1- (match-beginning 1)))
- (setq column (current-column)))
- ;; Else, nothing noticeable found: get indentation and go on.
- (t (setq column (org-get-indentation))))))
- ;; Now apply indentation and move cursor accordingly
- (goto-char pos)
- (if (<= (current-column) (current-indentation))
- (org-indent-line-to column)
- (save-excursion (org-indent-line-to column)))
- ;; Special polishing for properties, see `org-property-format'
- (setq column (current-column))
- (beginning-of-line 1)
- (if (looking-at
- "\\([ \t]+\\)\\(:[-_0-9a-zA-Z]+:\\)[ \t]*\\(\\S-.*\\(\\S-\\|$\\)\\)")
- (replace-match (concat (match-string 1)
- (format org-property-format
- (match-string 2) (match-string 3)))
- t t))
- (org-move-to-column column)))
-
-(defvar org-adaptive-fill-regexp-backup adaptive-fill-regexp
- "Variable to store copy of `adaptive-fill-regexp'.
-Since `adaptive-fill-regexp' is set to never match, we need to
-store a backup of its value before entering `org-mode' so that
-the functionality can be provided as a fall-back.")
-
-(defun org-set-autofill-regexps ()
- (interactive)
- ;; In the paragraph separator we include headlines, because filling
- ;; text in a line directly attached to a headline would otherwise
- ;; fill the headline as well.
- (org-set-local 'comment-start-skip "^#+[ \t]*")
- (org-set-local 'paragraph-separate "\f\\|\\*+ \\|[ ]*$\\|[ \t]*[:|#]")
- ;; The paragraph starter includes hand-formatted lists.
- (org-set-local
- 'paragraph-start
- (concat
- "\f" "\\|"
- "[ ]*$" "\\|"
- "\\*+ " "\\|"
- "[ \t]*#" "\\|"
- "[ \t]*\\([-+*][ \t]+\\|[0-9]+[.)][ \t]+\\)" "\\|"
- "[ \t]*[:|]" "\\|"
- "\\$\\$" "\\|"
- "\\\\\\(begin\\|end\\|[][]\\)"))
- ;; Inhibit auto-fill for headers, tables and fixed-width lines.
- ;; But only if the user has not turned off tables or fixed-width regions
- (org-set-local
- 'auto-fill-inhibit-regexp
- (concat "\\*+ \\|#\\+"
- "\\|[ \t]*" org-keyword-time-regexp
- (if (or org-enable-table-editor org-enable-fixed-width-editor)
- (concat
- "\\|[ \t]*["
- (if org-enable-table-editor "|" "")
- (if org-enable-fixed-width-editor ":" "")
- "]"))))
- ;; We use our own fill-paragraph function, to make sure that tables
- ;; and fixed-width regions are not wrapped. That function will pass
- ;; through to `fill-paragraph' when appropriate.
- (org-set-local 'fill-paragraph-function 'org-fill-paragraph)
- ;; Adaptive filling: To get full control, first make sure that
- ;; `adaptive-fill-regexp' never matches. Then install our own matcher.
- (unless (local-variable-p 'adaptive-fill-regexp (current-buffer))
- (org-set-local 'org-adaptive-fill-regexp-backup
- adaptive-fill-regexp))
- (org-set-local 'adaptive-fill-regexp "\000")
- (org-set-local 'adaptive-fill-function
- 'org-adaptive-fill-function)
- (org-set-local
- 'align-mode-rules-list
- '((org-in-buffer-settings
- (regexp . "^#\\+[A-Z_]+:\\(\\s-*\\)\\S-+")
- (modes . '(org-mode))))))
-
-(defun org-fill-paragraph (&optional justify)
- "Re-align a table, pass through to fill-paragraph if no table."
- (let ((table-p (org-at-table-p))
- (table.el-p (org-at-table.el-p)))
- (cond ((and (equal (char-after (point-at-bol)) ?*)
- (save-excursion (goto-char (point-at-bol))
- (looking-at outline-regexp)))
- t) ; skip headlines
- (table.el-p t) ; skip table.el tables
- (table-p (org-table-align) t) ; align org-mode tables
- (t nil)))) ; call paragraph-fill
-
-;; For reference, this is the default value of adaptive-fill-regexp
-;; "[ \t]*\\([-|#;>*]+[ \t]*\\|(?[0-9]+[.)][ \t]*\\)*"
-
-(defun org-adaptive-fill-function ()
- "Return a fill prefix for org-mode files.
-In particular, this makes sure hanging paragraphs for hand-formatted lists
-work correctly."
- (cond
- ;; Comment line
- ((looking-at "#[ \t]+")
- (match-string-no-properties 0))
- ;; Description list
- ((looking-at "[ \t]*\\([-*+] .*? :: \\)")
- (save-excursion
- (if (> (match-end 1) (+ (match-beginning 1)
- org-description-max-indent))
- (goto-char (+ (match-beginning 1) 5))
- (goto-char (match-end 0)))
- (make-string (current-column) ?\ )))
- ;; Ordered or unordered list
- ((looking-at "[ \t]*\\([-*+] \\|[0-9]+[.)] ?\\)")
- (save-excursion
- (goto-char (match-end 0))
- (make-string (current-column) ?\ )))
- ;; Other text
- ((looking-at org-adaptive-fill-regexp-backup)
- (match-string-no-properties 0))))
-
-;;; Other stuff.
-
-(defun org-toggle-fixed-width-section (arg)
- "Toggle the fixed-width export.
-If there is no active region, the QUOTE keyword at the current headline is
-inserted or removed. When present, it causes the text between this headline
-and the next to be exported as fixed-width text, and unmodified.
-If there is an active region, this command adds or removes a colon as the
-first character of this line. If the first character of a line is a colon,
-this line is also exported in fixed-width font."
- (interactive "P")
- (let* ((cc 0)
- (regionp (org-region-active-p))
- (beg (if regionp (region-beginning) (point)))
- (end (if regionp (region-end)))
- (nlines (or arg (if (and beg end) (count-lines beg end) 1)))
- (case-fold-search nil)
- (re "[ \t]*\\(: \\)")
- off)
- (if regionp
- (save-excursion
- (goto-char beg)
- (setq cc (current-column))
- (beginning-of-line 1)
- (setq off (looking-at re))
- (while (> nlines 0)
- (setq nlines (1- nlines))
- (beginning-of-line 1)
- (cond
- (arg
- (org-move-to-column cc t)
- (insert ": \n")
- (forward-line -1))
- ((and off (looking-at re))
- (replace-match "" t t nil 1))
- ((not off) (org-move-to-column cc t) (insert ": ")))
- (forward-line 1)))
- (save-excursion
- (org-back-to-heading)
- (if (looking-at (concat outline-regexp
- "\\( *\\<" org-quote-string "\\>[ \t]*\\)"))
- (replace-match "" t t nil 1)
- (if (looking-at outline-regexp)
- (progn
- (goto-char (match-end 0))
- (insert org-quote-string " "))))))))
-
-(defun org-reftex-citation ()
- "Use reftex-citation to insert a citation into the buffer.
-This looks for a line like
-
-#+BIBLIOGRAPHY: foo plain option:-d
-
-and derives from it that foo.bib is the bibliography file relevant
-for this document. It then installs the necessary environment for RefTeX
-to work in this buffer and calls `reftex-citation' to insert a citation
-into the buffer.
-
-Export of such citations to both LaTeX and HTML is handled by the contributed
-package org-exp-bibtex by Taru Karttunen."
- (interactive)
- (let ((reftex-docstruct-symbol 'rds)
- (reftex-cite-format "\\cite{%l}")
- rds bib)
- (save-excursion
- (save-restriction
- (widen)
- (let ((case-fold-search t)
- (re "^#\\+bibliography:[ \t]+\\([^ \t\n]+\\)"))
- (if (not (save-excursion
- (or (re-search-forward re nil t)
- (re-search-backward re nil t))))
- (error "No bibliography defined in file")
- (setq bib (concat (match-string 1) ".bib")
- rds (list (list 'bib bib)))))))
- (call-interactively 'reftex-citation)))
-
-;;;; Functions extending outline functionality
-
-(defun org-beginning-of-line (&optional arg)
- "Go to the beginning of the current line. If that is invisible, continue
-to a visible line beginning. This makes the function of C-a more intuitive.
-If this is a headline, and `org-special-ctrl-a/e' is set, ignore tags on the
-first attempt, and only move to after the tags when the cursor is already
-beyond the end of the headline."
- (interactive "P")
- (let ((pos (point))
- (special (if (consp org-special-ctrl-a/e)
- (car org-special-ctrl-a/e)
- org-special-ctrl-a/e))
- refpos)
- (if (org-bound-and-true-p line-move-visual)
- (beginning-of-visual-line 1)
- (beginning-of-line 1))
- (if (and arg (fboundp 'move-beginning-of-line))
- (call-interactively 'move-beginning-of-line)
- (if (bobp)
- nil
- (backward-char 1)
- (if (org-truely-invisible-p)
- (while (and (not (bobp)) (org-truely-invisible-p))
- (backward-char 1)
- (beginning-of-line 1))
- (forward-char 1))))
- (when special
- (cond
- ((and (looking-at org-complex-heading-regexp)
- (= (char-after (match-end 1)) ?\ ))
- (setq refpos (min (1+ (or (match-end 3) (match-end 2) (match-end 1)))
- (point-at-eol)))
- (goto-char
- (if (eq special t)
- (cond ((> pos refpos) refpos)
- ((= pos (point)) refpos)
- (t (point)))
- (cond ((> pos (point)) (point))
- ((not (eq last-command this-command)) (point))
- (t refpos)))))
- ((org-at-item-p)
- (goto-char
- (if (eq special t)
- (cond ((> pos (match-end 4)) (match-end 4))
- ((= pos (point)) (match-end 4))
- (t (point)))
- (cond ((> pos (point)) (point))
- ((not (eq last-command this-command)) (point))
- (t (match-end 4))))))))
- (org-no-warnings
- (and (featurep 'xemacs) (setq zmacs-region-stays t)))))
-
-(defun org-end-of-line (&optional arg)
- "Go to the end of the line.
-If this is a headline, and `org-special-ctrl-a/e' is set, ignore tags on the
-first attempt, and only move to after the tags when the cursor is already
-beyond the end of the headline."
- (interactive "P")
- (let ((special (if (consp org-special-ctrl-a/e)
- (cdr org-special-ctrl-a/e)
- org-special-ctrl-a/e)))
- (if (or (not special)
- (not (org-on-heading-p))
- arg)
- (call-interactively
- (cond ((org-bound-and-true-p line-move-visual) 'end-of-visual-line)
- ((fboundp 'move-end-of-line) 'move-end-of-line)
- (t 'end-of-line)))
- (let ((pos (point)))
- (beginning-of-line 1)
- (if (looking-at (org-re ".*?\\(?:\\([ \t]*\\)\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*\\)?$"))
- (if (eq special t)
- (if (or (< pos (match-beginning 1))
- (= pos (match-end 0)))
- (goto-char (match-beginning 1))
- (goto-char (match-end 0)))
- (if (or (< pos (match-end 0)) (not (eq this-command last-command)))
- (goto-char (match-end 0))
- (goto-char (match-beginning 1))))
- (call-interactively (if (fboundp 'move-end-of-line)
- 'move-end-of-line
- 'end-of-line)))))
- (org-no-warnings
- (and (featurep 'xemacs) (setq zmacs-region-stays t)))))
-
-(define-key org-mode-map "\C-a" 'org-beginning-of-line)
-(define-key org-mode-map "\C-e" 'org-end-of-line)
-
-(defun org-backward-sentence (&optional arg)
- "Go to beginning of sentence, or beginning of table field.
-This will call `backward-sentence' or `org-table-beginning-of-field',
-depending on context."
- (interactive "P")
- (cond
- ((org-at-table-p) (call-interactively 'org-table-beginning-of-field))
- (t (call-interactively 'backward-sentence))))
-
-(defun org-forward-sentence (&optional arg)
- "Go to end of sentence, or end of table field.
-This will call `forward-sentence' or `org-table-end-of-field',
-depending on context."
- (interactive "P")
- (cond
- ((org-at-table-p) (call-interactively 'org-table-end-of-field))
- (t (call-interactively 'forward-sentence))))
-
-(define-key org-mode-map "\M-a" 'org-backward-sentence)
-(define-key org-mode-map "\M-e" 'org-forward-sentence)
-
-(defun org-kill-line (&optional arg)
- "Kill line, to tags or end of line."
- (interactive "P")
- (cond
- ((or (not org-special-ctrl-k)
- (bolp)
- (not (org-on-heading-p)))
- (if (and (get-char-property (min (point-max) (point-at-eol)) 'invisible)
- org-ctrl-k-protect-subtree)
- (if (or (eq org-ctrl-k-protect-subtree 'error)
- (not (y-or-n-p "Kill hidden subtree along with headline? ")))
- (error "C-k aborted - would kill hidden subtree")))
- (call-interactively 'kill-line))
- ((looking-at (org-re ".*?\\S-\\([ \t]+\\(:[[:alnum:]_@#%:]+:\\)\\)[ \t]*$"))
- (kill-region (point) (match-beginning 1))
- (org-set-tags nil t))
- (t (kill-region (point) (point-at-eol)))))
-
-(define-key org-mode-map "\C-k" 'org-kill-line)
-
-(defun org-yank (&optional arg)
- "Yank. If the kill is a subtree, treat it specially.
-This command will look at the current kill and check if is a single
-subtree, or a series of subtrees[1]. If it passes the test, and if the
-cursor is at the beginning of a line or after the stars of a currently
-empty headline, then the yank is handled specially. How exactly depends
-on the value of the following variables, both set by default.
-
-org-yank-folded-subtrees
- When set, the subtree(s) will be folded after insertion, but only
- if doing so would now swallow text after the yanked text.
-
-org-yank-adjusted-subtrees
- When set, the subtree will be promoted or demoted in order to
- fit into the local outline tree structure, which means that the level
- will be adjusted so that it becomes the smaller one of the two
- *visible* surrounding headings.
-
-Any prefix to this command will cause `yank' to be called directly with
-no special treatment. In particular, a simple \\[universal-argument] prefix \
-will just
-plainly yank the text as it is.
-
-\[1] The test checks if the first non-white line is a heading
- and if there are no other headings with fewer stars."
- (interactive "P")
- (org-yank-generic 'yank arg))
-
-(defun org-yank-generic (command arg)
- "Perform some yank-like command.
-
-This function implements the behavior described in the `org-yank'
-documentation. However, it has been generalized to work for any
-interactive command with similar behavior."
-
- ;; pretend to be command COMMAND
- (setq this-command command)
-
- (if arg
- (call-interactively command)
-
- (let ((subtreep ; is kill a subtree, and the yank position appropriate?
- (and (org-kill-is-subtree-p)
- (or (bolp)
- (and (looking-at "[ \t]*$")
- (string-match
- "\\`\\*+\\'"
- (buffer-substring (point-at-bol) (point)))))))
- swallowp)
- (cond
- ((and subtreep org-yank-folded-subtrees)
- (let ((beg (point))
- end)
- (if (and subtreep org-yank-adjusted-subtrees)
- (org-paste-subtree nil nil 'for-yank)
- (call-interactively command))
-
- (setq end (point))
- (goto-char beg)
- (when (and (bolp) subtreep
- (not (setq swallowp
- (org-yank-folding-would-swallow-text beg end))))
- (or (looking-at outline-regexp)
- (re-search-forward (concat "^" outline-regexp) end t))
- (while (and (< (point) end) (looking-at outline-regexp))
- (hide-subtree)
- (org-cycle-show-empty-lines 'folded)
- (condition-case nil
- (outline-forward-same-level 1)
- (error (goto-char end)))))
- (when swallowp
- (message
- "Inserted text not folded because that would swallow text"))
-
- (goto-char end)
- (skip-chars-forward " \t\n\r")
- (beginning-of-line 1)
- (push-mark beg 'nomsg)))
- ((and subtreep org-yank-adjusted-subtrees)
- (let ((beg (point-at-bol)))
- (org-paste-subtree nil nil 'for-yank)
- (push-mark beg 'nomsg)))
- (t
- (call-interactively command))))))
-
-(defun org-yank-folding-would-swallow-text (beg end)
- "Would hide-subtree at BEG swallow any text after END?"
- (let (level)
- (save-excursion
- (goto-char beg)
- (when (or (looking-at outline-regexp)
- (re-search-forward (concat "^" outline-regexp) end t))
- (setq level (org-outline-level)))
- (goto-char end)
- (skip-chars-forward " \t\r\n\v\f")
- (if (or (eobp)
- (and (bolp) (looking-at org-outline-regexp)
- (<= (org-outline-level) level)))
- nil ; Nothing would be swallowed
- t)))) ; something would swallow
-
-(define-key org-mode-map "\C-y" 'org-yank)
-
-(defun org-invisible-p ()
- "Check if point is at a character currently not visible."
- ;; Early versions of noutline don't have `outline-invisible-p'.
- (if (fboundp 'outline-invisible-p)
- (outline-invisible-p)
- (get-char-property (point) 'invisible)))
-
-(defun org-truely-invisible-p ()
- "Check if point is at a character currently not visible.
-This version does not only check the character property, but also
-`visible-mode'."
- ;; Early versions of noutline don't have `outline-invisible-p'.
- (if (org-bound-and-true-p visible-mode)
- nil
- (if (fboundp 'outline-invisible-p)
- (outline-invisible-p)
- (get-char-property (point) 'invisible))))
-
-(defun org-invisible-p2 ()
- "Check if point is at a character currently not visible."
- (save-excursion
- (if (and (eolp) (not (bobp))) (backward-char 1))
- ;; Early versions of noutline don't have `outline-invisible-p'.
- (if (fboundp 'outline-invisible-p)
- (outline-invisible-p)
- (get-char-property (point) 'invisible))))
-
-(defun org-back-to-heading (&optional invisible-ok)
- "Call `outline-back-to-heading', but provide a better error message."
- (condition-case nil
- (outline-back-to-heading invisible-ok)
- (error (error "Before first headline at position %d in buffer %s"
- (point) (current-buffer)))))
-
-(defun org-beginning-of-defun ()
- "Go to the beginning of the subtree, i.e. back to the heading."
- (org-back-to-heading))
-(defun org-end-of-defun ()
- "Go to the end of the subtree."
- (org-end-of-subtree nil t))
-
-(defun org-before-first-heading-p ()
- "Before first heading?"
- (save-excursion
- (null (re-search-backward "^\\*+ " nil t))))
-
-(defun org-on-heading-p (&optional ignored)
- (outline-on-heading-p t))
-(defun org-at-heading-p (&optional ignored)
- (outline-on-heading-p t))
-
-(defun org-point-at-end-of-empty-headline ()
- "If point is at the end of an empty headline, return t, else nil.
-If the heading only contains a TODO keyword, it is still still considered
-empty."
- (and (looking-at "[ \t]*$")
- (save-excursion
- (beginning-of-line 1)
- (looking-at (concat "^\\(\\*+\\)[ \t]+\\(" org-todo-regexp
- "\\)?[ \t]*$")))))
-(defun org-at-heading-or-item-p ()
- (or (org-on-heading-p) (org-at-item-p)))
-
-(defun org-on-target-p ()
- (or (org-in-regexp org-radio-target-regexp)
- (org-in-regexp org-target-regexp)))
-
-(defun org-up-heading-all (arg)
- "Move to the heading line of which the present line is a subheading.
-This function considers both visible and invisible heading lines.
-With argument, move up ARG levels."
- (if (fboundp 'outline-up-heading-all)
- (outline-up-heading-all arg) ; emacs 21 version of outline.el
- (outline-up-heading arg t))) ; emacs 22 version of outline.el
-
-(defun org-up-heading-safe ()
- "Move to the heading line of which the present line is a subheading.
-This version will not throw an error. It will return the level of the
-headline found, or nil if no higher level is found.
-
-Also, this function will be a lot faster than `outline-up-heading',
-because it relies on stars being the outline starters. This can really
-make a significant difference in outlines with very many siblings."
- (let (start-level re)
- (org-back-to-heading t)
- (setq start-level (funcall outline-level))
- (if (equal start-level 1)
- nil
- (setq re (concat "^\\*\\{1," (number-to-string (1- start-level)) "\\} "))
- (if (re-search-backward re nil t)
- (funcall outline-level)))))
-
-(defun org-first-sibling-p ()
- "Is this heading the first child of its parents?"
- (interactive)
- (let ((re (concat "^" outline-regexp))
- level l)
- (unless (org-at-heading-p t)
- (error "Not at a heading"))
- (setq level (funcall outline-level))
- (save-excursion
- (if (not (re-search-backward re nil t))
- t
- (setq l (funcall outline-level))
- (< l level)))))
-
-(defun org-goto-sibling (&optional previous)
- "Goto the next sibling, even if it is invisible.
-When PREVIOUS is set, go to the previous sibling instead. Returns t
-when a sibling was found. When none is found, return nil and don't
-move point."
- (let ((fun (if previous 're-search-backward 're-search-forward))
- (pos (point))
- (re (concat "^" outline-regexp))
- level l)
- (when (condition-case nil (org-back-to-heading t) (error nil))
- (setq level (funcall outline-level))
- (catch 'exit
- (or previous (forward-char 1))
- (while (funcall fun re nil t)
- (setq l (funcall outline-level))
- (when (< l level) (goto-char pos) (throw 'exit nil))
- (when (= l level) (goto-char (match-beginning 0)) (throw 'exit t)))
- (goto-char pos)
- nil))))
-
-(defun org-show-siblings ()
- "Show all siblings of the current headline."
- (save-excursion
- (while (org-goto-sibling) (org-flag-heading nil)))
- (save-excursion
- (while (org-goto-sibling 'previous)
- (org-flag-heading nil))))
-
-(defun org-goto-first-child ()
- "Goto the first child, even if it is invisible.
-Return t when a child was found. Otherwise don't move point and
-return nil."
- (let (level (pos (point)) (re (concat "^" outline-regexp)))
- (when (condition-case nil (org-back-to-heading t) (error nil))
- (setq level (outline-level))
- (forward-char 1)
- (if (and (re-search-forward re nil t) (> (outline-level) level))
- (progn (goto-char (match-beginning 0)) t)
- (goto-char pos) nil))))
-
-(defun org-show-hidden-entry ()
- "Show an entry where even the heading is hidden."
- (save-excursion
- (org-show-entry)))
-
-(defun org-flag-heading (flag &optional entry)
- "Flag the current heading. FLAG non-nil means make invisible.
-When ENTRY is non-nil, show the entire entry."
- (save-excursion
- (org-back-to-heading t)
- ;; Check if we should show the entire entry
- (if entry
- (progn
- (org-show-entry)
- (save-excursion
- (and (outline-next-heading)
- (org-flag-heading nil))))
- (outline-flag-region (max (point-min) (1- (point)))
- (save-excursion (outline-end-of-heading) (point))
- flag))))
-
-(defun org-get-next-sibling ()
- "Move to next heading of the same level, and return point.
-If there is no such heading, return nil.
-This is like outline-next-sibling, but invisible headings are ok."
- (let ((level (funcall outline-level)))
- (outline-next-heading)
- (while (and (not (eobp)) (> (funcall outline-level) level))
- (outline-next-heading))
- (if (or (eobp) (< (funcall outline-level) level))
- nil
- (point))))
-
-(defun org-get-last-sibling ()
- "Move to previous heading of the same level, and return point.
-If there is no such heading, return nil."
- (let ((opoint (point))
- (level (funcall outline-level)))
- (outline-previous-heading)
- (when (and (/= (point) opoint) (outline-on-heading-p t))
- (while (and (> (funcall outline-level) level)
- (not (bobp)))
- (outline-previous-heading))
- (if (< (funcall outline-level) level)
- nil
- (point)))))
-
-(defun org-end-of-subtree (&optional invisible-OK to-heading)
- ;; This contains an exact copy of the original function, but it uses
- ;; `org-back-to-heading', to make it work also in invisible
- ;; trees. And is uses an invisible-OK argument.
- ;; Under Emacs this is not needed, but the old outline.el needs this fix.
- ;; Furthermore, when used inside Org, finding the end of a large subtree
- ;; with many children and grandchildren etc, this can be much faster
- ;; than the outline version.
- (org-back-to-heading invisible-OK)
- (let ((first t)
- (level (funcall outline-level)))
- (if (and (org-mode-p) (< level 1000))
- ;; A true heading (not a plain list item), in Org-mode
- ;; This means we can easily find the end by looking
- ;; only for the right number of stars. Using a regexp to do
- ;; this is so much faster than using a Lisp loop.
- (let ((re (concat "^\\*\\{1," (int-to-string level) "\\} ")))
- (forward-char 1)
- (and (re-search-forward re nil 'move) (beginning-of-line 1)))
- ;; something else, do it the slow way
- (while (and (not (eobp))
- (or first (> (funcall outline-level) level)))
- (setq first nil)
- (outline-next-heading)))
- (unless to-heading
- (if (memq (preceding-char) '(?\n ?\^M))
- (progn
- ;; Go to end of line before heading
- (forward-char -1)
- (if (memq (preceding-char) '(?\n ?\^M))
- ;; leave blank line before heading
- (forward-char -1))))))
- (point))
-
-(defadvice outline-end-of-subtree (around prefer-org-version activate compile)
- "Use Org version in org-mode, for dramatic speed-up."
- (if (eq major-mode 'org-mode)
- (progn
- (org-end-of-subtree nil t)
- (unless (eobp) (backward-char 1)))
- ad-do-it))
-
-(defun org-forward-same-level (arg &optional invisible-ok)
- "Move forward to the arg'th subheading at same level as this one.
-Stop at the first and last subheadings of a superior heading.
-Normally this only looks at visible headings, but when INVISIBLE-OK is non-nil
-it wil also look at invisible ones."
- (interactive "p")
- (org-back-to-heading invisible-ok)
- (org-on-heading-p)
- (let* ((level (- (match-end 0) (match-beginning 0) 1))
- (re (format "^\\*\\{1,%d\\} " level))
- l)
- (forward-char 1)
- (while (> arg 0)
- (while (and (re-search-forward re nil 'move)
- (setq l (- (match-end 0) (match-beginning 0) 1))
- (= l level)
- (not invisible-ok)
- (progn (backward-char 1) (org-invisible-p)))
- (if (< l level) (setq arg 1)))
- (setq arg (1- arg)))
- (beginning-of-line 1)))
-
-(defun org-backward-same-level (arg &optional invisible-ok)
- "Move backward to the arg'th subheading at same level as this one.
-Stop at the first and last subheadings of a superior heading."
- (interactive "p")
- (org-back-to-heading)
- (org-on-heading-p)
- (let* ((level (- (match-end 0) (match-beginning 0) 1))
- (re (format "^\\*\\{1,%d\\} " level))
- l)
- (while (> arg 0)
- (while (and (re-search-backward re nil 'move)
- (setq l (- (match-end 0) (match-beginning 0) 1))
- (= l level)
- (not invisible-ok)
- (org-invisible-p))
- (if (< l level) (setq arg 1)))
- (setq arg (1- arg)))))
-
-(defun org-show-subtree ()
- "Show everything after this heading at deeper levels."
- (outline-flag-region
- (point)
- (save-excursion
- (org-end-of-subtree t t))
- nil))
-
-(defun org-show-entry ()
- "Show the body directly following this heading.
-Show the heading too, if it is currently invisible."
- (interactive)
- (save-excursion
- (condition-case nil
- (progn
- (org-back-to-heading t)
- (outline-flag-region
- (max (point-min) (1- (point)))
- (save-excursion
- (if (re-search-forward
- (concat "[\r\n]\\(" outline-regexp "\\)") nil t)
- (match-beginning 1)
- (point-max)))
- nil)
- (org-cycle-hide-drawers 'children))
- (error nil))))
-
-(defun org-make-options-regexp (kwds &optional extra)
- "Make a regular expression for keyword lines."
- (concat
- "^"
- "#?[ \t]*\\+\\("
- (mapconcat 'regexp-quote kwds "\\|")
- (if extra (concat "\\|" extra))
- "\\):[ \t]*"
- "\\(.*\\)"))
-
-;; Make isearch reveal the necessary context
-(defun org-isearch-end ()
- "Reveal context after isearch exits."
- (when isearch-success ; only if search was successful
- (if (featurep 'xemacs)
- ;; Under XEmacs, the hook is run in the correct place,
- ;; we directly show the context.
- (org-show-context 'isearch)
- ;; In Emacs the hook runs *before* restoring the overlays.
- ;; So we have to use a one-time post-command-hook to do this.
- ;; (Emacs 22 has a special variable, see function `org-mode')
- (unless (and (boundp 'isearch-mode-end-hook-quit)
- isearch-mode-end-hook-quit)
- ;; Only when the isearch was not quitted.
- (org-add-hook 'post-command-hook 'org-isearch-post-command
- 'append 'local)))))
-
-(defun org-isearch-post-command ()
- "Remove self from hook, and show context."
- (remove-hook 'post-command-hook 'org-isearch-post-command 'local)
- (org-show-context 'isearch))
-
-
-;;;; Integration with and fixes for other packages
-
-;;; Imenu support
-
-(defvar org-imenu-markers nil
- "All markers currently used by Imenu.")
-(make-variable-buffer-local 'org-imenu-markers)
-
-(defun org-imenu-new-marker (&optional pos)
- "Return a new marker for use by Imenu, and remember the marker."
- (let ((m (make-marker)))
- (move-marker m (or pos (point)))
- (push m org-imenu-markers)
- m))
-
-(defun org-imenu-get-tree ()
- "Produce the index for Imenu."
- (mapc (lambda (x) (move-marker x nil)) org-imenu-markers)
- (setq org-imenu-markers nil)
- (let* ((n org-imenu-depth)
- (re (concat "^" outline-regexp))
- (subs (make-vector (1+ n) nil))
- (last-level 0)
- m level head)
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-max))
- (while (re-search-backward re nil t)
- (setq level (org-reduced-level (funcall outline-level)))
- (when (<= level n)
- (looking-at org-complex-heading-regexp)
- (setq head (org-link-display-format
- (org-match-string-no-properties 4))
- m (org-imenu-new-marker))
- (org-add-props head nil 'org-imenu-marker m 'org-imenu t)
- (if (>= level last-level)
- (push (cons head m) (aref subs level))
- (push (cons head (aref subs (1+ level))) (aref subs level))
- (loop for i from (1+ level) to n do (aset subs i nil)))
- (setq last-level level)))))
- (aref subs 1)))
-
-(eval-after-load "imenu"
- '(progn
- (add-hook 'imenu-after-jump-hook
- (lambda ()
- (if (eq major-mode 'org-mode)
- (org-show-context 'org-goto))))))
-
-(defun org-link-display-format (link)
- "Replace a link with either the description, or the link target
-if no description is present"
- (save-match-data
- (if (string-match org-bracket-link-analytic-regexp link)
- (replace-match (if (match-end 5)
- (match-string 5 link)
- (concat (match-string 1 link)
- (match-string 3 link)))
- nil t link)
- link)))
-
-;; Speedbar support
-
-(defvar org-speedbar-restriction-lock-overlay (make-overlay 1 1)
- "Overlay marking the agenda restriction line in speedbar.")
-(overlay-put org-speedbar-restriction-lock-overlay
- 'face 'org-agenda-restriction-lock)
-(overlay-put org-speedbar-restriction-lock-overlay
- 'help-echo "Agendas are currently limited to this item.")
-(org-detach-overlay org-speedbar-restriction-lock-overlay)
-
-(defun org-speedbar-set-agenda-restriction ()
- "Restrict future agenda commands to the location at point in speedbar.
-To get rid of the restriction, use \\[org-agenda-remove-restriction-lock]."
- (interactive)
- (require 'org-agenda)
- (let (p m tp np dir txt)
- (cond
- ((setq p (text-property-any (point-at-bol) (point-at-eol)
- 'org-imenu t))
- (setq m (get-text-property p 'org-imenu-marker))
- (with-current-buffer (marker-buffer m)
- (goto-char m)
- (org-agenda-set-restriction-lock 'subtree)))
- ((setq p (text-property-any (point-at-bol) (point-at-eol)
- 'speedbar-function 'speedbar-find-file))
- (setq tp (previous-single-property-change
- (1+ p) 'speedbar-function)
- np (next-single-property-change
- tp 'speedbar-function)
- dir (speedbar-line-directory)
- txt (buffer-substring-no-properties (or tp (point-min))
- (or np (point-max))))
- (with-current-buffer (find-file-noselect
- (let ((default-directory dir))
- (expand-file-name txt)))
- (unless (org-mode-p)
- (error "Cannot restrict to non-Org-mode file"))
- (org-agenda-set-restriction-lock 'file)))
- (t (error "Don't know how to restrict Org-mode's agenda")))
- (move-overlay org-speedbar-restriction-lock-overlay
- (point-at-bol) (point-at-eol))
- (setq current-prefix-arg nil)
- (org-agenda-maybe-redo)))
-
-(eval-after-load "speedbar"
- '(progn
- (speedbar-add-supported-extension ".org")
- (define-key speedbar-file-key-map "<" 'org-speedbar-set-agenda-restriction)
- (define-key speedbar-file-key-map "\C-c\C-x<" 'org-speedbar-set-agenda-restriction)
- (define-key speedbar-file-key-map ">" 'org-agenda-remove-restriction-lock)
- (define-key speedbar-file-key-map "\C-c\C-x>" 'org-agenda-remove-restriction-lock)
- (add-hook 'speedbar-visiting-tag-hook
- (lambda () (and (org-mode-p) (org-show-context 'org-goto))))))
-
-;;; Fixes and Hacks for problems with other packages
-
-;; Make flyspell not check words in links, to not mess up our keymap
-(defun org-mode-flyspell-verify ()
- "Don't let flyspell put overlays at active buttons."
- (and (not (get-text-property (max (1- (point)) (point-min)) 'keymap))
- (not (get-text-property (max (1- (point)) (point-min)) 'org-no-flyspell))))
-
-(defun org-remove-flyspell-overlays-in (beg end)
- "Remove flyspell overlays in region."
- (and (org-bound-and-true-p flyspell-mode)
- (fboundp 'flyspell-delete-region-overlays)
- (flyspell-delete-region-overlays beg end))
- (add-text-properties beg end '(org-no-flyspell t)))
-
-;; Make `bookmark-jump' shows the jump location if it was hidden.
-(eval-after-load "bookmark"
- '(if (boundp 'bookmark-after-jump-hook)
- ;; We can use the hook
- (add-hook 'bookmark-after-jump-hook 'org-bookmark-jump-unhide)
- ;; Hook not available, use advice
- (defadvice bookmark-jump (after org-make-visible activate)
- "Make the position visible."
- (org-bookmark-jump-unhide))))
-
-;; Make sure saveplace shows the location if it was hidden
-(eval-after-load "saveplace"
- '(defadvice save-place-find-file-hook (after org-make-visible activate)
- "Make the position visible."
- (org-bookmark-jump-unhide)))
-
-;; Make sure ecb shows the location if it was hidden
-(eval-after-load "ecb"
- '(defadvice ecb-method-clicked (after esf/org-show-context activate)
- "Make hierarchy visible when jumping into location from ECB tree buffer."
- (if (eq major-mode 'org-mode)
- (org-show-context))))
-
-(defun org-bookmark-jump-unhide ()
- "Unhide the current position, to show the bookmark location."
- (and (org-mode-p)
- (or (org-invisible-p)
- (save-excursion (goto-char (max (point-min) (1- (point))))
- (org-invisible-p)))
- (org-show-context 'bookmark-jump)))
-
-;; Make session.el ignore our circular variable
-(eval-after-load "session"
- '(add-to-list 'session-globals-exclude 'org-mark-ring))
-
-;;;; Experimental code
-
-(defun org-closed-in-range ()
- "Sparse tree of items closed in a certain time range.
-Still experimental, may disappear in the future."
- (interactive)
- ;; Get the time interval from the user.
- (let* ((time1 (org-float-time
- (org-read-date nil 'to-time nil "Starting date: ")))
- (time2 (org-float-time
- (org-read-date nil 'to-time nil "End date:")))
- ;; callback function
- (callback (lambda ()
- (let ((time
- (org-float-time
- (apply 'encode-time
- (org-parse-time-string
- (match-string 1))))))
- ;; check if time in interval
- (and (>= time time1) (<= time time2))))))
- ;; make tree, check each match with the callback
- (org-occur "CLOSED: +\\[\\(.*?\\)\\]" nil callback)))
-
-;;;; Finish up
-
-(provide 'org)
-
-(run-hooks 'org-load-hook)
-
-;; arch-tag: e77da1a7-acc7-4336-b19e-efa25af3f9fd
-
-;;; org.el ends here
diff --git a/.emacs.d/org-7.4/lisp/org.elc b/.emacs.d/org-7.4/lisp/org.elc
deleted file mode 100644
index de0a100..0000000
--- a/.emacs.d/org-7.4/lisp/org.elc
+++ /dev/null
Binary files differ
diff --git a/.emacs.d/org-7.4/request-assign-future.txt b/.emacs.d/org-7.4/request-assign-future.txt
deleted file mode 100644
index 8ee7747..0000000
--- a/.emacs.d/org-7.4/request-assign-future.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-Please email the following information to assign@gnu.org, and we
-will send you the assignment form for your past and future changes.
-
-Please use your full legal name (in ASCII characters) as the subject
-line of the message.
-----------------------------------------------------------------------
-REQUEST: SEND FORM FOR PAST AND FUTURE CHANGES
-
-[What is the name of the program or package you're contributing to?]
-
- Org-mode, which is part of Emacs
-
-[Did you copy any files or text written by someone else in these changes?
-Even if that material is free software, we need to know about it.]
-
-
-[Do you have an employer who might have a basis to claim to own
-your changes? Do you attend a school which might make such a claim?]
-
-
-[For the copyright registration, what country are you a citizen of?]
-
-
-[What year were you born?]
-
-
-[Please write your email address here.]
-
-
-[Please write your postal address here.]
-
-
-
-
-
-[Which files have you changed so far, and which new files have you written
-so far?]
-
-
-
-
-
-
-
diff --git a/.emacs.d/whitespace.el b/.emacs.d/whitespace.el
deleted file mode 100644
index 443f486..0000000
--- a/.emacs.d/whitespace.el
+++ /dev/null
@@ -1,2732 +0,0 @@
-;;; whitespace.el --- minor mode to visualize TAB, (HARD) SPACE, NEWLINE
-
-;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
-;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
-;; Keywords: data, wp
-;; Version: 13.2
-;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software: you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Introduction
-;; ------------
-;;
-;; This package is a minor mode to visualize blanks (TAB, (HARD) SPACE
-;; and NEWLINE).
-;;
-;; whitespace uses two ways to visualize blanks: faces and display
-;; table.
-;;
-;; * Faces are used to highlight the background with a color.
-;; whitespace uses font-lock to highlight blank characters.
-;;
-;; * Display table changes the way a character is displayed, that is,
-;; it provides a visual mark for characters, for example, at the end
-;; of line (?\xB6), at SPACEs (?\xB7) and at TABs (?\xBB).
-;;
-;; The `whitespace-style' variable selects which way blanks are
-;; visualized.
-;;
-;; Note that when whitespace is turned on, whitespace saves the
-;; font-lock state, that is, if font-lock is on or off. And
-;; whitespace restores the font-lock state when it is turned off. So,
-;; if whitespace is turned on and font-lock is off, whitespace also
-;; turns on the font-lock to highlight blanks, but the font-lock will
-;; be turned off when whitespace is turned off. Thus, turn on
-;; font-lock before whitespace is on, if you want that font-lock
-;; continues on after whitespace is turned off.
-;;
-;; When whitespace is on, it takes care of highlighting some special
-;; characters over the default mechanism of `nobreak-char-display'
-;; (which see) and `show-trailing-whitespace' (which see).
-;;
-;; The trailing spaces are not highlighted while point is at end of line.
-;; Also the spaces at beginning of buffer are not highlighted while point is at
-;; beginning of buffer; and the spaces at end of buffer are not highlighted
-;; while point is at end of buffer.
-;;
-;; There are two ways of using whitespace: local and global.
-;;
-;; * Local whitespace affects only the current buffer.
-;;
-;; * Global whitespace affects all current and future buffers. That
-;; is, if you turn on global whitespace and then create a new
-;; buffer, the new buffer will also have whitespace on. The
-;; `whitespace-global-modes' variable controls which major-mode will
-;; be automagically turned on.
-;;
-;; You can mix the local and global usage without any conflict. But
-;; local whitespace has priority over global whitespace. Whitespace
-;; mode is active in a buffer if you have enabled it in that buffer or
-;; if you have enabled it globally.
-;;
-;; When global and local whitespace are on:
-;;
-;; * if local whitespace is turned off, whitespace is turned off for
-;; the current buffer only.
-;;
-;; * if global whitespace is turned off, whitespace continues on only
-;; in the buffers in which local whitespace is on.
-;;
-;; To use whitespace, insert in your ~/.emacs:
-;;
-;; (require 'whitespace)
-;;
-;; Or autoload at least one of the commands`whitespace-mode',
-;; `whitespace-toggle-options', `global-whitespace-mode' or
-;; `global-whitespace-toggle-options'. For example:
-;;
-;; (autoload 'whitespace-mode "whitespace"
-;; "Toggle whitespace visualization." t)
-;; (autoload 'whitespace-toggle-options "whitespace"
-;; "Toggle local `whitespace-mode' options." t)
-;;
-;; whitespace was inspired by:
-;;
-;; whitespace.el Rajesh Vaidheeswarran <rv@gnu.org>
-;; Warn about and clean bogus whitespaces in the file
-;; (inspired the idea to warn and clean some blanks)
-;; This was the original `whitespace.el' which was replaced by
-;; `blank-mode.el'. And later `blank-mode.el' was renamed to
-;; `whitespace.el'.
-;;
-;; show-whitespace-mode.el Aurelien Tisne <aurelien.tisne@free.fr>
-;; Simple mode to highlight whitespaces
-;; (inspired the idea to use font-lock)
-;;
-;; whitespace-mode.el Lawrence Mitchell <wence@gmx.li>
-;; Major mode for editing Whitespace
-;; (inspired the idea to use display table)
-;;
-;; visws.el Miles Bader <miles@gnu.org>
-;; Make whitespace visible
-;; (handle display table, his code was modified, but the main
-;; idea was kept)
-;;
-;;
-;; Using whitespace
-;; ----------------
-;;
-;; There is no problem if you mix local and global minor mode usage.
-;;
-;; * LOCAL whitespace:
-;; + To toggle whitespace options locally, type:
-;;
-;; M-x whitespace-toggle-options RET
-;;
-;; + To activate whitespace locally, type:
-;;
-;; C-u 1 M-x whitespace-mode RET
-;;
-;; + To deactivate whitespace locally, type:
-;;
-;; C-u 0 M-x whitespace-mode RET
-;;
-;; + To toggle whitespace locally, type:
-;;
-;; M-x whitespace-mode RET
-;;
-;; * GLOBAL whitespace:
-;; + To toggle whitespace options globally, type:
-;;
-;; M-x global-whitespace-toggle-options RET
-;;
-;; + To activate whitespace globally, type:
-;;
-;; C-u 1 M-x global-whitespace-mode RET
-;;
-;; + To deactivate whitespace globally, type:
-;;
-;; C-u 0 M-x global-whitespace-mode RET
-;;
-;; + To toggle whitespace globally, type:
-;;
-;; M-x global-whitespace-mode RET
-;;
-;; There are also the following useful commands:
-;;
-;; `whitespace-newline-mode'
-;; Toggle NEWLINE minor mode visualization ("nl" on modeline).
-;;
-;; `global-whitespace-newline-mode'
-;; Toggle NEWLINE global minor mode visualization ("NL" on modeline).
-;;
-;; `whitespace-report'
-;; Report some blank problems in buffer.
-;;
-;; `whitespace-report-region'
-;; Report some blank problems in a region.
-;;
-;; `whitespace-cleanup'
-;; Cleanup some blank problems in all buffer or at region.
-;;
-;; `whitespace-cleanup-region'
-;; Cleanup some blank problems at region.
-;;
-;; The problems, which are cleaned up, are:
-;;
-;; 1. empty lines at beginning of buffer.
-;; 2. empty lines at end of buffer.
-;; If `whitespace-style' includes the value `empty', remove all
-;; empty lines at beginning and/or end of buffer.
-;;
-;; 3. 8 or more SPACEs at beginning of line.
-;; If `whitespace-style' includes the value `indentation':
-;; replace 8 or more SPACEs at beginning of line by TABs, if
-;; `indent-tabs-mode' is non-nil; otherwise, replace TABs by
-;; SPACEs.
-;; If `whitespace-style' includes the value `indentation::tab',
-;; replace 8 or more SPACEs at beginning of line by TABs.
-;; If `whitespace-style' includes the value `indentation::space',
-;; replace TABs by SPACEs.
-;;
-;; 4. SPACEs before TAB.
-;; If `whitespace-style' includes the value `space-before-tab':
-;; replace SPACEs by TABs, if `indent-tabs-mode' is non-nil;
-;; otherwise, replace TABs by SPACEs.
-;; If `whitespace-style' includes the value
-;; `space-before-tab::tab', replace SPACEs by TABs.
-;; If `whitespace-style' includes the value
-;; `space-before-tab::space', replace TABs by SPACEs.
-;;
-;; 5. SPACEs or TABs at end of line.
-;; If `whitespace-style' includes the value `trailing', remove all
-;; SPACEs or TABs at end of line.
-;;
-;; 6. 8 or more SPACEs after TAB.
-;; If `whitespace-style' includes the value `space-after-tab':
-;; replace SPACEs by TABs, if `indent-tabs-mode' is non-nil;
-;; otherwise, replace TABs by SPACEs.
-;; If `whitespace-style' includes the value `space-after-tab::tab',
-;; replace SPACEs by TABs.
-;; If `whitespace-style' includes the value
-;; `space-after-tab::space', replace TABs by SPACEs.
-;;
-;;
-;; Hooks
-;; -----
-;;
-;; whitespace has the following hook variables:
-;;
-;; `whitespace-mode-hook'
-;; It is evaluated always when whitespace is turned on locally.
-;;
-;; `global-whitespace-mode-hook'
-;; It is evaluated always when whitespace is turned on globally.
-;;
-;; `whitespace-load-hook'
-;; It is evaluated after whitespace package is loaded.
-;;
-;;
-;; Options
-;; -------
-;;
-;; Below it's shown a brief description of whitespace options, please,
-;; see the options declaration in the code for a long documentation.
-;;
-;; `whitespace-style' Specify which kind of blank is
-;; visualized.
-;;
-;; `whitespace-space' Face used to visualize SPACE.
-;;
-;; `whitespace-hspace' Face used to visualize HARD SPACE.
-;;
-;; `whitespace-tab' Face used to visualize TAB.
-;;
-;; `whitespace-newline' Face used to visualize NEWLINE char
-;; mapping.
-;;
-;; `whitespace-trailing' Face used to visualize trailing
-;; blanks.
-;;
-;; `whitespace-line' Face used to visualize "long" lines.
-;;
-;; `whitespace-space-before-tab' Face used to visualize SPACEs
-;; before TAB.
-;;
-;; `whitespace-indentation' Face used to visualize 8 or more
-;; SPACEs at beginning of line.
-;;
-;; `whitespace-empty' Face used to visualize empty lines at
-;; beginning and/or end of buffer.
-;;
-;; `whitespace-space-after-tab' Face used to visualize 8 or more
-;; SPACEs after TAB.
-;;
-;; `whitespace-space-regexp' Specify SPACE characters regexp.
-;;
-;; `whitespace-hspace-regexp' Specify HARD SPACE characters regexp.
-;;
-;; `whitespace-tab-regexp' Specify TAB characters regexp.
-;;
-;; `whitespace-trailing-regexp' Specify trailing characters regexp.
-;;
-;; `whitespace-space-before-tab-regexp' Specify SPACEs before TAB
-;; regexp.
-;;
-;; `whitespace-indentation-regexp' Specify regexp for 8 or more
-;; SPACEs at beginning of line.
-;;
-;; `whitespace-empty-at-bob-regexp' Specify regexp for empty lines
-;; at beginning of buffer.
-;;
-;; `whitespace-empty-at-eob-regexp' Specify regexp for empty lines
-;; at end of buffer.
-;;
-;; `whitespace-space-after-tab-regexp' Specify regexp for 8 or more
-;; SPACEs after TAB.
-;;
-;; `whitespace-line-column' Specify column beyond which the line
-;; is highlighted.
-;;
-;; `whitespace-display-mappings' Specify an alist of mappings
-;; for displaying characters.
-;;
-;; `whitespace-global-modes' Modes for which global
-;; `whitespace-mode' is automagically
-;; turned on.
-;;
-;; `whitespace-action' Specify which action is taken when a
-;; buffer is visited or written.
-;;
-;;
-;; Acknowledgements
-;; ----------------
-;;
-;; Thanks to David Reitter <david.reitter@gmail.com> for suggesting a
-;; `whitespace-newline' initialization with low contrast relative to
-;; the background color.
-;;
-;; Thanks to Stephen Deasey <sdeasey@gmail.com> for the
-;; `indent-tabs-mode' usage suggestion.
-;;
-;; Thanks to Eric Cooper <ecc@cmu.edu> for the suggestion to have hook
-;; actions when buffer is written as the original whitespace package
-;; had.
-;;
-;; Thanks to nschum (EmacsWiki) for the idea about highlight "long"
-;; lines tail. See EightyColumnRule (EmacsWiki).
-;;
-;; Thanks to Juri Linkov <juri@jurta.org> for suggesting:
-;; * `define-minor-mode'.
-;; * `global-whitespace-*' name for global commands.
-;;
-;; Thanks to Robert J. Chassell <bob@gnu.org> for doc fix and testing.
-;;
-;; Thanks to Drew Adams <drew.adams@oracle.com> for toggle commands
-;; suggestion.
-;;
-;; Thanks to Antti Kaihola <antti.kaihola@linux-aktivaattori.org> for
-;; helping to fix `find-file-hooks' reference.
-;;
-;; Thanks to Andreas Roehler <andreas.roehler@easy-emacs.de> for
-;; indicating defface byte-compilation warnings.
-;;
-;; Thanks to TimOCallaghan (EmacsWiki) for the idea about highlight
-;; "long" lines. See EightyColumnRule (EmacsWiki).
-;;
-;; Thanks to Yanghui Bian <yanghuibian@gmail.com> for indicating a new
-;; NEWLINE character mapping.
-;;
-;; Thanks to Pete Forman <pete.forman@westgeo.com> for indicating
-;; whitespace-mode.el on XEmacs.
-;;
-;; Thanks to Miles Bader <miles@gnu.org> for handling display table via
-;; visws.el (his code was modified, but the main idea was kept).
-;;
-;; Thanks to:
-;; Rajesh Vaidheeswarran <rv@gnu.org> (original) whitespace.el
-;; Aurelien Tisne <aurelien.tisne@free.fr> show-whitespace-mode.el
-;; Lawrence Mitchell <wence@gmx.li> whitespace-mode.el
-;; Miles Bader <miles@gnu.org> visws.el
-;; And to all people who contributed with them.
-;;
-;;
-;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-;;; code:
-
-
-(eval-and-compile
- (unless (fboundp 'with-current-buffer)
- ;; from `subr.el' (Emacs 23)
- (defmacro with-current-buffer (buffer-or-name &rest body)
- "Execute the forms in BODY with BUFFER-OR-NAME temporarily current.
-BUFFER-OR-NAME must be a buffer or the name of an existing buffer.
-The value returned is the value of the last form in BODY. See
-also `with-temp-buffer'."
- (declare (indent 1) (debug t))
- `(save-current-buffer
- (set-buffer ,buffer-or-name)
- ,@body))))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;; User Variables:
-
-
-;;; Interface to the command system
-
-
-(defgroup whitespace nil
- "Visualize blanks (TAB, (HARD) SPACE and NEWLINE)."
- :link '(emacs-library-link :tag "Source Lisp File" "whitespace.el")
- :version "23.1"
- :group 'convenience)
-
-
-(defcustom whitespace-style
- '(face
- tabs spaces trailing lines space-before-tab newline
- indentation empty space-after-tab
- space-mark tab-mark newline-mark)
- "Specify which kind of blank is visualized.
-
-It's a list containing some or all of the following values:
-
- face enable all visualization via faces (see below).
-
- trailing trailing blanks are visualized via faces.
- It has effect only if `face' (see above)
- is present in `whitespace-style'.
-
- tabs TABs are visualized via faces.
- It has effect only if `face' (see above)
- is present in `whitespace-style'.
-
- spaces SPACEs and HARD SPACEs are visualized via
- faces.
- It has effect only if `face' (see above)
- is present in `whitespace-style'.
-
- lines lines which have columns beyond
- `whitespace-line-column' are highlighted via
- faces.
- Whole line is highlighted.
- It has precedence over `lines-tail' (see
- below).
- It has effect only if `face' (see above)
- is present in `whitespace-style'.
-
- lines-tail lines which have columns beyond
- `whitespace-line-column' are highlighted via
- faces.
- But only the part of line which goes
- beyond `whitespace-line-column' column.
- It has effect only if `lines' (see above)
- is not present in `whitespace-style'
- and if `face' (see above) is present in
- `whitespace-style'.
-
- newline NEWLINEs are visualized via faces.
- It has effect only if `face' (see above)
- is present in `whitespace-style'.
-
- empty empty lines at beginning and/or end of buffer
- are visualized via faces.
- It has effect only if `face' (see above)
- is present in `whitespace-style'.
-
- indentation::tab 8 or more SPACEs at beginning of line are
- visualized via faces.
- It has effect only if `face' (see above)
- is present in `whitespace-style'.
-
- indentation::space TABs at beginning of line are visualized via
- faces.
- It has effect only if `face' (see above)
- is present in `whitespace-style'.
-
- indentation 8 or more SPACEs at beginning of line are
- visualized, if `indent-tabs-mode' (which see)
- is non-nil; otherwise, TABs at beginning of
- line are visualized via faces.
- It has effect only if `face' (see above)
- is present in `whitespace-style'.
-
- space-after-tab::tab 8 or more SPACEs after a TAB are
- visualized via faces.
- It has effect only if `face' (see above)
- is present in `whitespace-style'.
-
- space-after-tab::space TABs are visualized when 8 or more
- SPACEs occur after a TAB, via faces.
- It has effect only if `face' (see above)
- is present in `whitespace-style'.
-
- space-after-tab 8 or more SPACEs after a TAB are
- visualized, if `indent-tabs-mode'
- (which see) is non-nil; otherwise,
- the TABs are visualized via faces.
- It has effect only if `face' (see above)
- is present in `whitespace-style'.
-
- space-before-tab::tab SPACEs before TAB are visualized via
- faces.
- It has effect only if `face' (see above)
- is present in `whitespace-style'.
-
- space-before-tab::space TABs are visualized when SPACEs occur
- before TAB, via faces.
- It has effect only if `face' (see above)
- is present in `whitespace-style'.
-
- space-before-tab SPACEs before TAB are visualized, if
- `indent-tabs-mode' (which see) is
- non-nil; otherwise, the TABs are
- visualized via faces.
- It has effect only if `face' (see above)
- is present in `whitespace-style'.
-
- space-mark SPACEs and HARD SPACEs are visualized via
- display table.
-
- tab-mark TABs are visualized via display table.
-
- newline-mark NEWLINEs are visualized via display table.
-
-Any other value is ignored.
-
-If nil, don't visualize TABs, (HARD) SPACEs and NEWLINEs via faces and
-via display table.
-
-There is an evaluation order for some values, if they are
-included in `whitespace-style' list. For example, if
-indentation, indentation::tab and/or indentation::space are
-included in `whitespace-style' list. The evaluation order for
-these values is:
-
- * For indentation:
- 1. indentation
- 2. indentation::tab
- 3. indentation::space
-
- * For SPACEs after TABs:
- 1. space-after-tab
- 2. space-after-tab::tab
- 3. space-after-tab::space
-
- * For SPACEs before TABs:
- 1. space-before-tab
- 2. space-before-tab::tab
- 3. space-before-tab::space
-
-So, for example, if indentation and indentation::space are
-included in `whitespace-style' list, the indentation value is
-evaluated instead of indentation::space value.
-
-One reason for not visualize spaces via faces (if `face' is not
-included in `whitespace-style') is to use exclusively for
-cleanning up a buffer. See `whitespace-cleanup' and
-`whitespace-cleanup-region' for documentation.
-
-See also `whitespace-display-mappings' for documentation."
- :type '(repeat :tag "Kind of Blank"
- (choice :tag "Kind of Blank Face"
- (const :tag "(Face) Face visualization"
- face)
- (const :tag "(Face) Trailing TABs, SPACEs and HARD SPACEs"
- trailing)
- (const :tag "(Face) SPACEs and HARD SPACEs"
- spaces)
- (const :tag "(Face) TABs" tabs)
- (const :tag "(Face) Lines" lines)
- (const :tag "(Face) SPACEs before TAB"
- space-before-tab)
- (const :tag "(Face) NEWLINEs" newline)
- (const :tag "(Face) Indentation SPACEs"
- indentation)
- (const :tag "(Face) Empty Lines At BOB And/Or EOB"
- empty)
- (const :tag "(Face) SPACEs after TAB"
- space-after-tab)
- (const :tag "(Mark) SPACEs and HARD SPACEs"
- space-mark)
- (const :tag "(Mark) TABs" tab-mark)
- (const :tag "(Mark) NEWLINEs" newline-mark)))
- :group 'whitespace)
-
-
-(defcustom whitespace-space 'whitespace-space
- "Symbol face used to visualize SPACE.
-
-Used when `whitespace-style' includes the value `spaces'."
- :type 'face
- :group 'whitespace)
-
-
-(defface whitespace-space
- '((((class color) (background dark))
- (:background "grey20" :foreground "darkgray"))
- (((class color) (background light))
- (:background "LightYellow" :foreground "lightgray"))
- (t (:inverse-video t)))
- "Face used to visualize SPACE."
- :group 'whitespace)
-
-
-(defcustom whitespace-hspace 'whitespace-hspace
- "Symbol face used to visualize HARD SPACE.
-
-Used when `whitespace-style' includes the value `spaces'."
- :type 'face
- :group 'whitespace)
-
-
-(defface whitespace-hspace ; 'nobreak-space
- '((((class color) (background dark))
- (:background "grey24" :foreground "darkgray"))
- (((class color) (background light))
- (:background "LemonChiffon3" :foreground "lightgray"))
- (t (:inverse-video t)))
- "Face used to visualize HARD SPACE."
- :group 'whitespace)
-
-
-(defcustom whitespace-tab 'whitespace-tab
- "Symbol face used to visualize TAB.
-
-Used when `whitespace-style' includes the value `tabs'."
- :type 'face
- :group 'whitespace)
-
-
-(defface whitespace-tab
- '((((class color) (background dark))
- (:background "grey22" :foreground "darkgray"))
- (((class color) (background light))
- (:background "beige" :foreground "lightgray"))
- (t (:inverse-video t)))
- "Face used to visualize TAB."
- :group 'whitespace)
-
-
-(defcustom whitespace-newline 'whitespace-newline
- "Symbol face used to visualize NEWLINE char mapping.
-
-See `whitespace-display-mappings'.
-
-Used when `whitespace-style' includes the values `newline-mark'
-and `newline'."
- :type 'face
- :group 'whitespace)
-
-
-(defface whitespace-newline
- '((((class color) (background dark))
- (:foreground "darkgray" :bold nil))
- (((class color) (background light))
- (:foreground "lightgray" :bold nil))
- (t (:underline t :bold nil)))
- "Face used to visualize NEWLINE char mapping.
-
-See `whitespace-display-mappings'."
- :group 'whitespace)
-
-
-(defcustom whitespace-trailing 'whitespace-trailing
- "Symbol face used to visualize trailing blanks.
-
-Used when `whitespace-style' includes the value `trailing'."
- :type 'face
- :group 'whitespace)
-
-
-(defface whitespace-trailing ; 'trailing-whitespace
- '((((class mono)) (:inverse-video t :bold t :underline t))
- (t (:background "red1" :foreground "yellow" :bold t)))
- "Face used to visualize trailing blanks."
- :group 'whitespace)
-
-
-(defcustom whitespace-line 'whitespace-line
- "Symbol face used to visualize \"long\" lines.
-
-See `whitespace-line-column'.
-
-Used when `whitespace-style' includes the value `line'."
- :type 'face
- :group 'whitespace)
-
-
-(defface whitespace-line
- '((((class mono)) (:inverse-video t :bold t :underline t))
- (t (:background "gray20" :foreground "violet")))
- "Face used to visualize \"long\" lines.
-
-See `whitespace-line-column'."
- :group 'whitespace)
-
-
-(defcustom whitespace-space-before-tab 'whitespace-space-before-tab
- "Symbol face used to visualize SPACEs before TAB.
-
-Used when `whitespace-style' includes the value `space-before-tab'."
- :type 'face
- :group 'whitespace)
-
-
-(defface whitespace-space-before-tab
- '((((class mono)) (:inverse-video t :bold t :underline t))
- (t (:background "DarkOrange" :foreground "firebrick")))
- "Face used to visualize SPACEs before TAB."
- :group 'whitespace)
-
-
-(defcustom whitespace-indentation 'whitespace-indentation
- "Symbol face used to visualize 8 or more SPACEs at beginning of line.
-
-Used when `whitespace-style' includes the value `indentation'."
- :type 'face
- :group 'whitespace)
-
-
-(defface whitespace-indentation
- '((((class mono)) (:inverse-video t :bold t :underline t))
- (t (:background "yellow" :foreground "firebrick")))
- "Face used to visualize 8 or more SPACEs at beginning of line."
- :group 'whitespace)
-
-
-(defcustom whitespace-empty 'whitespace-empty
- "Symbol face used to visualize empty lines at beginning and/or end of buffer.
-
-Used when `whitespace-style' includes the value `empty'."
- :type 'face
- :group 'whitespace)
-
-
-(defface whitespace-empty
- '((((class mono)) (:inverse-video t :bold t :underline t))
- (t (:background "yellow" :foreground "firebrick")))
- "Face used to visualize empty lines at beginning and/or end of buffer."
- :group 'whitespace)
-
-
-(defcustom whitespace-space-after-tab 'whitespace-space-after-tab
- "Symbol face used to visualize 8 or more SPACEs after TAB.
-
-Used when `whitespace-style' includes the value `space-after-tab'."
- :type 'face
- :group 'whitespace)
-
-
-(defface whitespace-space-after-tab
- '((((class mono)) (:inverse-video t :bold t :underline t))
- (t (:background "yellow" :foreground "firebrick")))
- "Face used to visualize 8 or more SPACEs after TAB."
- :group 'whitespace)
-
-
-(defcustom whitespace-hspace-regexp
- "\\(\\(\xA0\\|\x8A0\\|\x920\\|\xE20\\|\xF20\\)+\\)"
- "Specify HARD SPACE characters regexp.
-
-If you're using `mule' package, there may be other characters besides:
-
- \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \"\\xF20\"
-
-that should be considered HARD SPACE.
-
-Here are some examples:
-
- \"\\\\(^\\xA0+\\\\)\" \
-visualize only leading HARD SPACEs.
- \"\\\\(\\xA0+$\\\\)\" \
-visualize only trailing HARD SPACEs.
- \"\\\\(^\\xA0+\\\\|\\xA0+$\\\\)\" \
-visualize leading and/or trailing HARD SPACEs.
- \"\\t\\\\(\\xA0+\\\\)\\t\" \
-visualize only HARD SPACEs between TABs.
-
-NOTE: Enclose always by \\\\( and \\\\) the elements to highlight.
- Use exactly one pair of enclosing \\\\( and \\\\).
-
-Used when `whitespace-style' includes `spaces'."
- :type '(regexp :tag "HARD SPACE Chars")
- :group 'whitespace)
-
-
-(defcustom whitespace-space-regexp "\\( +\\)"
- "Specify SPACE characters regexp.
-
-If you're using `mule' package, there may be other characters
-besides \" \" that should be considered SPACE.
-
-Here are some examples:
-
- \"\\\\(^ +\\\\)\" visualize only leading SPACEs.
- \"\\\\( +$\\\\)\" visualize only trailing SPACEs.
- \"\\\\(^ +\\\\| +$\\\\)\" \
-visualize leading and/or trailing SPACEs.
- \"\\t\\\\( +\\\\)\\t\" visualize only SPACEs between TABs.
-
-NOTE: Enclose always by \\\\( and \\\\) the elements to highlight.
- Use exactly one pair of enclosing \\\\( and \\\\).
-
-Used when `whitespace-style' includes `spaces'."
- :type '(regexp :tag "SPACE Chars")
- :group 'whitespace)
-
-
-(defcustom whitespace-tab-regexp "\\(\t+\\)"
- "Specify TAB characters regexp.
-
-If you're using `mule' package, there may be other characters
-besides \"\\t\" that should be considered TAB.
-
-Here are some examples:
-
- \"\\\\(^\\t+\\\\)\" visualize only leading TABs.
- \"\\\\(\\t+$\\\\)\" visualize only trailing TABs.
- \"\\\\(^\\t+\\\\|\\t+$\\\\)\" \
-visualize leading and/or trailing TABs.
- \" \\\\(\\t+\\\\) \" visualize only TABs between SPACEs.
-
-NOTE: Enclose always by \\\\( and \\\\) the elements to highlight.
- Use exactly one pair of enclosing \\\\( and \\\\).
-
-Used when `whitespace-style' includes `tabs'."
- :type '(regexp :tag "TAB Chars")
- :group 'whitespace)
-
-
-(defcustom whitespace-trailing-regexp
- "\\(\\(\t\\| \\|\xA0\\|\x8A0\\|\x920\\|\xE20\\|\xF20\\)+\\)$"
- "Specify trailing characters regexp.
-
-If you're using `mule' package, there may be other characters besides:
-
- \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \
-\"\\xF20\"
-
-that should be considered blank.
-
-NOTE: Enclose always by \"\\\\(\" and \"\\\\)$\" the elements to highlight.
- Use exactly one pair of enclosing elements above.
-
-Used when `whitespace-style' includes `trailing'."
- :type '(regexp :tag "Trailing Chars")
- :group 'whitespace)
-
-
-(defcustom whitespace-space-before-tab-regexp "\\( +\\)\\(\t+\\)"
- "Specify SPACEs before TAB regexp.
-
-If you're using `mule' package, there may be other characters besides:
-
- \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \
-\"\\xF20\"
-
-that should be considered blank.
-
-Used when `whitespace-style' includes `space-before-tab',
-`space-before-tab::tab' or `space-before-tab::space'."
- :type '(regexp :tag "SPACEs Before TAB")
- :group 'whitespace)
-
-
-(defcustom whitespace-indentation-regexp
- '("^\t*\\(\\( \\{%d\\}\\)+\\)[^\n\t]"
- . "^ *\\(\t+\\)[^\n]")
- "Specify regexp for 8 or more SPACEs at beginning of line.
-
-It is a cons where the cons car is used for SPACEs visualization
-and the cons cdr is used for TABs visualization.
-
-If you're using `mule' package, there may be other characters besides:
-
- \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \
-\"\\xF20\"
-
-that should be considered blank.
-
-Used when `whitespace-style' includes `indentation',
-`indentation::tab' or `indentation::space'."
- :type '(cons (regexp :tag "Indentation SPACEs")
- (regexp :tag "Indentation TABs"))
- :group 'whitespace)
-
-
-(defcustom whitespace-empty-at-bob-regexp "^\\(\\([ \t]*\n\\)+\\)"
- "Specify regexp for empty lines at beginning of buffer.
-
-If you're using `mule' package, there may be other characters besides:
-
- \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \
-\"\\xF20\"
-
-that should be considered blank.
-
-Used when `whitespace-style' includes `empty'."
- :type '(regexp :tag "Empty Lines At Beginning Of Buffer")
- :group 'whitespace)
-
-
-(defcustom whitespace-empty-at-eob-regexp "^\\([ \t\n]+\\)"
- "Specify regexp for empty lines at end of buffer.
-
-If you're using `mule' package, there may be other characters besides:
-
- \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \
-\"\\xF20\"
-
-that should be considered blank.
-
-Used when `whitespace-style' includes `empty'."
- :type '(regexp :tag "Empty Lines At End Of Buffer")
- :group 'whitespace)
-
-
-(defcustom whitespace-space-after-tab-regexp
- '("\t+\\(\\( \\{%d\\}\\)+\\)"
- . "\\(\t+\\) +")
- "Specify regexp for 8 or more SPACEs after TAB.
-
-It is a cons where the cons car is used for SPACEs visualization
-and the cons cdr is used for TABs visualization.
-
-If you're using `mule' package, there may be other characters besides:
-
- \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \
-\"\\xF20\"
-
-that should be considered blank.
-
-Used when `whitespace-style' includes `space-after-tab',
-`space-after-tab::tab' or `space-after-tab::space'."
- :type '(regexp :tag "SPACEs After TAB")
- :group 'whitespace)
-
-
-(defcustom whitespace-line-column 80
- "Specify column beyond which the line is highlighted.
-
-It must be an integer or nil. If nil, the `fill-column' variable value is
-used.
-
-Used when `whitespace-style' includes `lines' or `lines-tail'."
- :type '(choice :tag "Line Length Limit"
- (integer :tag "Line Length")
- (const :tag "Use fill-column" nil))
- :group 'whitespace)
-
-
-;; Hacked from `visible-whitespace-mappings' in visws.el
-(defcustom whitespace-display-mappings
- (if (>= emacs-major-version 23)
- ;; Emacs 23 and higher:
- '(
- (space-mark ?\ [?\u00B7] [?.]) ; space - centered dot
- (space-mark ?\xA0 [?\u00A4] [?_]) ; hard space - currency
- (space-mark ?\x8A0 [?\x8A4] [?_]) ; hard space - currency
- (space-mark ?\x920 [?\x924] [?_]) ; hard space - currency
- (space-mark ?\xE20 [?\xE24] [?_]) ; hard space - currency
- (space-mark ?\xF20 [?\xF24] [?_]) ; hard space - currency
- ;; NEWLINE is displayed using the face `whitespace-newline'
- (newline-mark ?\n [?$ ?\n]) ; eol - dollar sign
- ;; (newline-mark ?\n [?\u21B5 ?\n] [?$ ?\n]) ; eol - downwards arrow
- ;; (newline-mark ?\n [?\u00B6 ?\n] [?$ ?\n]) ; eol - pilcrow
- ;; (newline-mark ?\n [?\x8AF ?\n] [?$ ?\n]) ; eol - overscore
- ;; (newline-mark ?\n [?\x8AC ?\n] [?$ ?\n]) ; eol - negation
- ;; (newline-mark ?\n [?\x8B0 ?\n] [?$ ?\n]) ; eol - grade
- ;;
- ;; WARNING: the mapping below has a problem.
- ;; When a TAB occupies exactly one column, it will display the
- ;; character ?\xBB at that column followed by a TAB which goes to
- ;; the next TAB column.
- ;; If this is a problem for you, please, comment the line below.
- (tab-mark ?\t [?\u00BB ?\t] [?\\ ?\t]) ; tab - left quote mark
- )
- ;; Emacs 21 and 22:
- ;; Due to limitations of glyph representation, the char code can not
- ;; be above ?\x1FFFF. Probably, this will be fixed after Emacs
- ;; unicode merging.
- '(
- (space-mark ?\ [?\xB7] [?.]) ; space - centered dot
- (space-mark ?\xA0 [?\xA4] [?_]) ; hard space - currency
- (space-mark ?\x8A0 [?\x8A4] [?_]) ; hard space - currency
- (space-mark ?\x920 [?\x924] [?_]) ; hard space - currency
- (space-mark ?\xE20 [?\xE24] [?_]) ; hard space - currency
- (space-mark ?\xF20 [?\xF24] [?_]) ; hard space - currency
- ;; NEWLINE is displayed using the face `whitespace-newline'
- (newline-mark ?\n [?$ ?\n]) ; eol - dollar sign
- ;; (newline-mark ?\n [?\u21B5 ?\n] [?$ ?\n]) ; eol - downwards arrow
- ;; (newline-mark ?\n [?\xB6 ?\n] [?$ ?\n]) ; eol - pilcrow
- ;; (newline-mark ?\n [?\x8AF ?\n] [?$ ?\n]) ; eol - overscore
- ;; (newline-mark ?\n [?\x8AC ?\n] [?$ ?\n]) ; eol - negation
- ;; (newline-mark ?\n [?\x8B0 ?\n] [?$ ?\n]) ; eol - grade
- ;;
- ;; WARNING: the mapping below has a problem.
- ;; When a TAB occupies exactly one column, it will display the
- ;; character ?\xBB at that column followed by a TAB which goes to
- ;; the next TAB column.
- ;; If this is a problem for you, please, comment the line below.
- (tab-mark ?\t [?\xBB ?\t] [?\\ ?\t]) ; tab - left quote mark
- ))
- "Specify an alist of mappings for displaying characters.
-
-Each element has the following form:
-
- (KIND CHAR VECTOR...)
-
-Where:
-
-KIND is the kind of character.
- It can be one of the following symbols:
-
- tab-mark for TAB character
-
- space-mark for SPACE or HARD SPACE character
-
- newline-mark for NEWLINE character
-
-CHAR is the character to be mapped.
-
-VECTOR is a vector of characters to be displayed in place of CHAR.
- The first display vector that can be displayed is used;
- if no display vector for a mapping can be displayed, then
- that character is displayed unmodified.
-
-The NEWLINE character is displayed using the face given by
-`whitespace-newline' variable.
-
-Used when `whitespace-style' includes `tab-mark', `space-mark' or
-`newline-mark'."
- :type '(repeat
- (list :tag "Character Mapping"
- (choice :tag "Char Kind"
- (const :tag "Tab" tab-mark)
- (const :tag "Space" space-mark)
- (const :tag "Newline" newline-mark))
- (character :tag "Char")
- (repeat :inline t :tag "Vector List"
- (vector :tag ""
- (repeat :inline t
- :tag "Vector Characters"
- (character :tag "Char"))))))
- :group 'whitespace)
-
-
-(defcustom whitespace-global-modes t
- "Modes for which global `whitespace-mode' is automagically turned on.
-
-Global `whitespace-mode' is controlled by the command
-`global-whitespace-mode'.
-
-If nil, means no modes have `whitespace-mode' automatically
-turned on.
-
-If t, all modes that support `whitespace-mode' have it
-automatically turned on.
-
-Else it should be a list of `major-mode' symbol names for which
-`whitespace-mode' should be automatically turned on. The sense
-of the list is negated if it begins with `not'. For example:
-
- (c-mode c++-mode)
-
-means that `whitespace-mode' is turned on for buffers in C and
-C++ modes only."
- :type '(choice :tag "Global Modes"
- (const :tag "None" nil)
- (const :tag "All" t)
- (set :menu-tag "Mode Specific" :tag "Modes"
- :value (not)
- (const :tag "Except" not)
- (repeat :inline t
- (symbol :tag "Mode"))))
- :group 'whitespace)
-
-
-(defcustom whitespace-action nil
- "Specify which action is taken when a buffer is visited or written.
-
-It's a list containing some or all of the following values:
-
- nil no action is taken.
-
- cleanup cleanup any bogus whitespace always when local
- whitespace is turned on.
- See `whitespace-cleanup' and
- `whitespace-cleanup-region'.
-
- report-on-bogus report if there is any bogus whitespace always
- when local whitespace is turned on.
-
- auto-cleanup cleanup any bogus whitespace when buffer is
- written.
- See `whitespace-cleanup' and
- `whitespace-cleanup-region'.
-
- abort-on-bogus abort if there is any bogus whitespace and the
- buffer is written.
-
- warn-if-read-only give a warning if `cleanup' or `auto-cleanup'
- is included in `whitespace-action' and the
- buffer is read-only.
-
-Any other value is treated as nil."
- :type '(choice :tag "Actions"
- (const :tag "None" nil)
- (repeat :tag "Action List"
- (choice :tag "Action"
- (const :tag "Cleanup When On" cleanup)
- (const :tag "Report On Bogus" report-on-bogus)
- (const :tag "Auto Cleanup" auto-cleanup)
- (const :tag "Abort On Bogus" abort-on-bogus)
- (const :tag "Warn If Read-Only" warn-if-read-only))))
- :group 'whitespace)
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;; User commands - Local mode
-
-
-;;;###autoload
-(define-minor-mode whitespace-mode
- "Toggle whitespace minor mode visualization (\"ws\" on modeline).
-
-If ARG is null, toggle whitespace visualization.
-If ARG is a number greater than zero, turn on visualization;
-otherwise, turn off visualization.
-
-See also `whitespace-style', `whitespace-newline' and
-`whitespace-display-mappings'."
- :lighter " ws"
- :init-value nil
- :global nil
- :group 'whitespace
- (cond
- (noninteractive ; running a batch job
- (setq whitespace-mode nil))
- (whitespace-mode ; whitespace-mode on
- (whitespace-turn-on)
- (whitespace-action-when-on))
- (t ; whitespace-mode off
- (whitespace-turn-off))))
-
-
-;;;###autoload
-(define-minor-mode whitespace-newline-mode
- "Toggle NEWLINE minor mode visualization (\"nl\" on modeline).
-
-If ARG is null, toggle NEWLINE visualization.
-If ARG is a number greater than zero, turn on visualization;
-otherwise, turn off visualization.
-
-Use `whitespace-newline-mode' only for NEWLINE visualization
-exclusively. For other visualizations, including NEWLINE
-visualization together with (HARD) SPACEs and/or TABs, please,
-use `whitespace-mode'.
-
-See also `whitespace-newline' and `whitespace-display-mappings'."
- :lighter " nl"
- :init-value nil
- :global nil
- :group 'whitespace
- (let ((whitespace-style '(face newline-mark newline)))
- (whitespace-mode whitespace-newline-mode)
- ;; sync states (running a batch job)
- (setq whitespace-newline-mode whitespace-mode)))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;; User commands - Global mode
-
-
-;;;###autoload
-(define-minor-mode global-whitespace-mode
- "Toggle whitespace global minor mode visualization (\"WS\" on modeline).
-
-If ARG is null, toggle whitespace visualization.
-If ARG is a number greater than zero, turn on visualization;
-otherwise, turn off visualization.
-
-See also `whitespace-style', `whitespace-newline' and
-`whitespace-display-mappings'."
- :lighter " WS"
- :init-value nil
- :global t
- :group 'whitespace
- (cond
- (noninteractive ; running a batch job
- (setq global-whitespace-mode nil))
- (global-whitespace-mode ; global-whitespace-mode on
- (save-excursion
- (add-hook (if (boundp 'find-file-hook)
- 'find-file-hook
- 'find-file-hooks)
- 'whitespace-turn-on-if-enabled)
- (dolist (buffer (buffer-list)) ; adjust all local mode
- (set-buffer buffer)
- (unless whitespace-mode
- (whitespace-turn-on-if-enabled)))))
- (t ; global-whitespace-mode off
- (save-excursion
- (remove-hook (if (boundp 'find-file-hook)
- 'find-file-hook
- 'find-file-hooks)
- 'whitespace-turn-on-if-enabled)
- (dolist (buffer (buffer-list)) ; adjust all local mode
- (set-buffer buffer)
- (unless whitespace-mode
- (whitespace-turn-off)))))))
-
-
-(defun whitespace-turn-on-if-enabled ()
- (when (cond
- ((eq whitespace-global-modes t))
- ((listp whitespace-global-modes)
- (if (eq (car-safe whitespace-global-modes) 'not)
- (not (memq major-mode (cdr whitespace-global-modes)))
- (memq major-mode whitespace-global-modes)))
- (t nil))
- (let (inhibit-quit)
- ;; Don't turn on whitespace mode if...
- (or
- ;; ...we don't have a display (we're running a batch job)
- noninteractive
- ;; ...or if the buffer is invisible (name starts with a space)
- (eq (aref (buffer-name) 0) ?\ )
- ;; ...or if the buffer is temporary (name starts with *)
- (and (eq (aref (buffer-name) 0) ?*)
- ;; except the scratch buffer.
- (not (string= (buffer-name) "*scratch*")))
- ;; Otherwise, turn on whitespace mode.
- (whitespace-turn-on)))))
-
-
-;;;###autoload
-(define-minor-mode global-whitespace-newline-mode
- "Toggle NEWLINE global minor mode visualization (\"NL\" on modeline).
-
-If ARG is null, toggle NEWLINE visualization.
-If ARG is a number greater than zero, turn on visualization;
-otherwise, turn off visualization.
-
-Use `global-whitespace-newline-mode' only for NEWLINE
-visualization exclusively. For other visualizations, including
-NEWLINE visualization together with (HARD) SPACEs and/or TABs,
-please use `global-whitespace-mode'.
-
-See also `whitespace-newline' and `whitespace-display-mappings'."
- :lighter " NL"
- :init-value nil
- :global t
- :group 'whitespace
- (let ((whitespace-style '(newline-mark newline)))
- (global-whitespace-mode global-whitespace-newline-mode)
- ;; sync states (running a batch job)
- (setq global-whitespace-newline-mode global-whitespace-mode)))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;; User commands - Toggle
-
-
-(defconst whitespace-style-value-list
- '(face
- tabs
- spaces
- trailing
- lines
- lines-tail
- newline
- empty
- indentation
- indentation::tab
- indentation::space
- space-after-tab
- space-after-tab::tab
- space-after-tab::space
- space-before-tab
- space-before-tab::tab
- space-before-tab::space
- help-newline ; value used by `whitespace-insert-option-mark'
- tab-mark
- space-mark
- newline-mark
- )
- "List of valid `whitespace-style' values.")
-
-
-(defconst whitespace-toggle-option-alist
- '((?f . face)
- (?t . tabs)
- (?s . spaces)
- (?r . trailing)
- (?l . lines)
- (?L . lines-tail)
- (?n . newline)
- (?e . empty)
- (?\C-i . indentation)
- (?I . indentation::tab)
- (?i . indentation::space)
- (?\C-a . space-after-tab)
- (?A . space-after-tab::tab)
- (?a . space-after-tab::space)
- (?\C-b . space-before-tab)
- (?B . space-before-tab::tab)
- (?b . space-before-tab::space)
- (?T . tab-mark)
- (?S . space-mark)
- (?N . newline-mark)
- (?x . whitespace-style)
- )
- "Alist of toggle options.
-
-Each element has the form:
-
- (CHAR . SYMBOL)
-
-Where:
-
-CHAR is a char which the user will have to type.
-
-SYMBOL is a valid symbol associated with CHAR.
- See `whitespace-style-value-list'.")
-
-
-(defvar whitespace-active-style nil
- "Used to save locally `whitespace-style' value.")
-
-(defvar whitespace-indent-tabs-mode indent-tabs-mode
- "Used to save locally `indent-tabs-mode' value.")
-
-(defvar whitespace-tab-width tab-width
- "Used to save locally `tab-width' value.")
-
-(defvar whitespace-point (point)
- "Used to save locally current point value.
-Used by `whitespace-trailing-regexp' function (which see).")
-
-(defvar whitespace-font-lock-refontify nil
- "Used to save locally the font-lock refontify state.
-Used by `whitespace-post-command-hook' function (which see).")
-
-(defvar whitespace-bob-marker nil
- "Used to save locally the bob marker value.
-Used by `whitespace-post-command-hook' function (which see).")
-
-(defvar whitespace-eob-marker nil
- "Used to save locally the eob marker value.
-Used by `whitespace-post-command-hook' function (which see).")
-
-(defvar whitespace-buffer-changed nil
- "Used to indicate locally if buffer changed.
-Used by `whitespace-post-command-hook' and `whitespace-buffer-changed'
-functions (which see).")
-
-
-;;;###autoload
-(defun whitespace-toggle-options (arg)
- "Toggle local `whitespace-mode' options.
-
-If local whitespace-mode is off, toggle the option given by ARG
-and turn on local whitespace-mode.
-
-If local whitespace-mode is on, toggle the option given by ARG
-and restart local whitespace-mode.
-
-Interactively, it reads one of the following chars:
-
- CHAR MEANING
- (VIA FACES)
- f toggle face visualization
- t toggle TAB visualization
- s toggle SPACE and HARD SPACE visualization
- r toggle trailing blanks visualization
- l toggle \"long lines\" visualization
- L toggle \"long lines\" tail visualization
- n toggle NEWLINE visualization
- e toggle empty line at bob and/or eob visualization
- C-i toggle indentation SPACEs visualization (via `indent-tabs-mode')
- I toggle indentation SPACEs visualization
- i toggle indentation TABs visualization
- C-a toggle SPACEs after TAB visualization (via `indent-tabs-mode')
- A toggle SPACEs after TAB: SPACEs visualization
- a toggle SPACEs after TAB: TABs visualization
- C-b toggle SPACEs before TAB visualization (via `indent-tabs-mode')
- B toggle SPACEs before TAB: SPACEs visualization
- b toggle SPACEs before TAB: TABs visualization
-
- (VIA DISPLAY TABLE)
- T toggle TAB visualization
- S toggle SPACEs before TAB visualization
- N toggle NEWLINE visualization
-
- x restore `whitespace-style' value
- ? display brief help
-
-Non-interactively, ARG should be a symbol or a list of symbols.
-The valid symbols are:
-
- face toggle face visualization
- tabs toggle TAB visualization
- spaces toggle SPACE and HARD SPACE visualization
- trailing toggle trailing blanks visualization
- lines toggle \"long lines\" visualization
- lines-tail toggle \"long lines\" tail visualization
- newline toggle NEWLINE visualization
- empty toggle empty line at bob and/or eob visualization
- indentation toggle indentation SPACEs visualization
- indentation::tab toggle indentation SPACEs visualization
- indentation::space toggle indentation TABs visualization
- space-after-tab toggle SPACEs after TAB visualization
- space-after-tab::tab toggle SPACEs after TAB: SPACEs visualization
- space-after-tab::space toggle SPACEs after TAB: TABs visualization
- space-before-tab toggle SPACEs before TAB visualization
- space-before-tab::tab toggle SPACEs before TAB: SPACEs visualization
- space-before-tab::space toggle SPACEs before TAB: TABs visualization
-
- tab-mark toggle TAB visualization
- space-mark toggle SPACEs before TAB visualization
- newline-mark toggle NEWLINE visualization
-
- whitespace-style restore `whitespace-style' value
-
-See `whitespace-style' and `indent-tabs-mode' for documentation."
- (interactive (whitespace-interactive-char t))
- (let ((whitespace-style
- (whitespace-toggle-list t arg whitespace-active-style)))
- (whitespace-mode 0)
- (whitespace-mode 1)))
-
-
-(defvar whitespace-toggle-style nil
- "Used to toggle the global `whitespace-style' value.")
-
-
-;;;###autoload
-(defun global-whitespace-toggle-options (arg)
- "Toggle global `whitespace-mode' options.
-
-If global whitespace-mode is off, toggle the option given by ARG
-and turn on global whitespace-mode.
-
-If global whitespace-mode is on, toggle the option given by ARG
-and restart global whitespace-mode.
-
-Interactively, it accepts one of the following chars:
-
- CHAR MEANING
- (VIA FACES)
- f toggle face visualization
- t toggle TAB visualization
- s toggle SPACE and HARD SPACE visualization
- r toggle trailing blanks visualization
- l toggle \"long lines\" visualization
- L toggle \"long lines\" tail visualization
- n toggle NEWLINE visualization
- e toggle empty line at bob and/or eob visualization
- C-i toggle indentation SPACEs visualization (via `indent-tabs-mode')
- I toggle indentation SPACEs visualization
- i toggle indentation TABs visualization
- C-a toggle SPACEs after TAB visualization (via `indent-tabs-mode')
- A toggle SPACEs after TAB: SPACEs visualization
- a toggle SPACEs after TAB: TABs visualization
- C-b toggle SPACEs before TAB visualization (via `indent-tabs-mode')
- B toggle SPACEs before TAB: SPACEs visualization
- b toggle SPACEs before TAB: TABs visualization
-
- (VIA DISPLAY TABLE)
- T toggle TAB visualization
- S toggle SPACEs before TAB visualization
- N toggle NEWLINE visualization
-
- x restore `whitespace-style' value
- ? display brief help
-
-Non-interactively, ARG should be a symbol or a list of symbols.
-The valid symbols are:
-
- face toggle face visualization
- tabs toggle TAB visualization
- spaces toggle SPACE and HARD SPACE visualization
- trailing toggle trailing blanks visualization
- lines toggle \"long lines\" visualization
- lines-tail toggle \"long lines\" tail visualization
- newline toggle NEWLINE visualization
- empty toggle empty line at bob and/or eob visualization
- indentation toggle indentation SPACEs visualization
- indentation::tab toggle indentation SPACEs visualization
- indentation::space toggle indentation TABs visualization
- space-after-tab toggle SPACEs after TAB visualization
- space-after-tab::tab toggle SPACEs after TAB: SPACEs visualization
- space-after-tab::space toggle SPACEs after TAB: TABs visualization
- space-before-tab toggle SPACEs before TAB visualization
- space-before-tab::tab toggle SPACEs before TAB: SPACEs visualization
- space-before-tab::space toggle SPACEs before TAB: TABs visualization
-
- tab-mark toggle TAB visualization
- space-mark toggle SPACEs before TAB visualization
- newline-mark toggle NEWLINE visualization
-
- whitespace-style restore `whitespace-style' value
-
-See `whitespace-style' and `indent-tabs-mode' for documentation."
- (interactive (whitespace-interactive-char nil))
- (let ((whitespace-style
- (whitespace-toggle-list nil arg whitespace-toggle-style)))
- (setq whitespace-toggle-style whitespace-style)
- (global-whitespace-mode 0)
- (global-whitespace-mode 1)))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;; User commands - Cleanup
-
-
-;;;###autoload
-(defun whitespace-cleanup ()
- "Cleanup some blank problems in all buffer or at region.
-
-It usually applies to the whole buffer, but in transient mark
-mode when the mark is active, it applies to the region. It also
-applies to the region when it is not in transient mark mode, the
-mark is active and \\[universal-argument] was pressed just before
-calling `whitespace-cleanup' interactively.
-
-See also `whitespace-cleanup-region'.
-
-The problems cleaned up are:
-
-1. empty lines at beginning of buffer.
-2. empty lines at end of buffer.
- If `whitespace-style' includes the value `empty', remove all
- empty lines at beginning and/or end of buffer.
-
-3. 8 or more SPACEs at beginning of line.
- If `whitespace-style' includes the value `indentation':
- replace 8 or more SPACEs at beginning of line by TABs, if
- `indent-tabs-mode' is non-nil; otherwise, replace TABs by
- SPACEs.
- If `whitespace-style' includes the value `indentation::tab',
- replace 8 or more SPACEs at beginning of line by TABs.
- If `whitespace-style' includes the value `indentation::space',
- replace TABs by SPACEs.
-
-4. SPACEs before TAB.
- If `whitespace-style' includes the value `space-before-tab':
- replace SPACEs by TABs, if `indent-tabs-mode' is non-nil;
- otherwise, replace TABs by SPACEs.
- If `whitespace-style' includes the value
- `space-before-tab::tab', replace SPACEs by TABs.
- If `whitespace-style' includes the value
- `space-before-tab::space', replace TABs by SPACEs.
-
-5. SPACEs or TABs at end of line.
- If `whitespace-style' includes the value `trailing', remove
- all SPACEs or TABs at end of line.
-
-6. 8 or more SPACEs after TAB.
- If `whitespace-style' includes the value `space-after-tab':
- replace SPACEs by TABs, if `indent-tabs-mode' is non-nil;
- otherwise, replace TABs by SPACEs.
- If `whitespace-style' includes the value
- `space-after-tab::tab', replace SPACEs by TABs.
- If `whitespace-style' includes the value
- `space-after-tab::space', replace TABs by SPACEs.
-
-See `whitespace-style', `indent-tabs-mode' and `tab-width' for
-documentation."
- (interactive "@")
- (cond
- ;; read-only buffer
- (buffer-read-only
- (whitespace-warn-read-only "cleanup"))
- ;; region active
- ((and (or transient-mark-mode
- current-prefix-arg)
- mark-active)
- ;; PROBLEMs 1 and 2 are not handled in region
- ;; PROBLEM 3: 8 or more SPACEs at bol
- ;; PROBLEM 4: SPACEs before TAB
- ;; PROBLEM 5: SPACEs or TABs at eol
- ;; PROBLEM 6: 8 or more SPACEs after TAB
- (whitespace-cleanup-region (region-beginning) (region-end)))
- ;; whole buffer
- (t
- (save-excursion
- (save-match-data
- ;; PROBLEM 1: empty lines at bob
- ;; PROBLEM 2: empty lines at eob
- ;; ACTION: remove all empty lines at bob and/or eob
- (when (memq 'empty whitespace-style)
- (let (overwrite-mode) ; enforce no overwrite
- (goto-char (point-min))
- (when (re-search-forward
- (concat "\\`" whitespace-empty-at-bob-regexp) nil t)
- (delete-region (match-beginning 1) (match-end 1)))
- (when (re-search-forward
- (concat whitespace-empty-at-eob-regexp "\\'") nil t)
- (delete-region (match-beginning 1) (match-end 1)))))))
- ;; PROBLEM 3: 8 or more SPACEs at bol
- ;; PROBLEM 4: SPACEs before TAB
- ;; PROBLEM 5: SPACEs or TABs at eol
- ;; PROBLEM 6: 8 or more SPACEs after TAB
- (whitespace-cleanup-region (point-min) (point-max)))))
-
-
-;;;###autoload
-(defun whitespace-cleanup-region (start end)
- "Cleanup some blank problems at region.
-
-The problems cleaned up are:
-
-1. 8 or more SPACEs at beginning of line.
- If `whitespace-style' includes the value `indentation':
- replace 8 or more SPACEs at beginning of line by TABs, if
- `indent-tabs-mode' is non-nil; otherwise, replace TABs by
- SPACEs.
- If `whitespace-style' includes the value `indentation::tab',
- replace 8 or more SPACEs at beginning of line by TABs.
- If `whitespace-style' includes the value `indentation::space',
- replace TABs by SPACEs.
-
-2. SPACEs before TAB.
- If `whitespace-style' includes the value `space-before-tab':
- replace SPACEs by TABs, if `indent-tabs-mode' is non-nil;
- otherwise, replace TABs by SPACEs.
- If `whitespace-style' includes the value
- `space-before-tab::tab', replace SPACEs by TABs.
- If `whitespace-style' includes the value
- `space-before-tab::space', replace TABs by SPACEs.
-
-3. SPACEs or TABs at end of line.
- If `whitespace-style' includes the value `trailing', remove
- all SPACEs or TABs at end of line.
-
-4. 8 or more SPACEs after TAB.
- If `whitespace-style' includes the value `space-after-tab':
- replace SPACEs by TABs, if `indent-tabs-mode' is non-nil;
- otherwise, replace TABs by SPACEs.
- If `whitespace-style' includes the value
- `space-after-tab::tab', replace SPACEs by TABs.
- If `whitespace-style' includes the value
- `space-after-tab::space', replace TABs by SPACEs.
-
-See `whitespace-style', `indent-tabs-mode' and `tab-width' for
-documentation."
- (interactive "@r")
- (if buffer-read-only
- ;; read-only buffer
- (whitespace-warn-read-only "cleanup region")
- ;; non-read-only buffer
- (let ((rstart (min start end))
- (rend (copy-marker (max start end)))
- (indent-tabs-mode whitespace-indent-tabs-mode)
- (tab-width whitespace-tab-width)
- overwrite-mode ; enforce no overwrite
- tmp)
- (save-excursion
- (save-match-data
- ;; PROBLEM 1: 8 or more SPACEs at bol
- (cond
- ;; ACTION: replace 8 or more SPACEs at bol by TABs, if
- ;; `indent-tabs-mode' is non-nil; otherwise, replace TABs
- ;; by SPACEs.
- ((memq 'indentation whitespace-style)
- (let ((regexp (whitespace-indentation-regexp)))
- (goto-char rstart)
- (while (re-search-forward regexp rend t)
- (setq tmp (current-indentation))
- (goto-char (match-beginning 0))
- (delete-horizontal-space)
- (unless (eolp)
- (indent-to tmp)))))
- ;; ACTION: replace 8 or more SPACEs at bol by TABs.
- ((memq 'indentation::tab whitespace-style)
- (whitespace-replace-action
- 'tabify rstart rend
- (whitespace-indentation-regexp 'tab) 0))
- ;; ACTION: replace TABs by SPACEs.
- ((memq 'indentation::space whitespace-style)
- (whitespace-replace-action
- 'untabify rstart rend
- (whitespace-indentation-regexp 'space) 0)))
- ;; PROBLEM 3: SPACEs or TABs at eol
- ;; ACTION: remove all SPACEs or TABs at eol
- (when (memq 'trailing whitespace-style)
- (whitespace-replace-action
- 'delete-region rstart rend
- whitespace-trailing-regexp 1))
- ;; PROBLEM 4: 8 or more SPACEs after TAB
- (cond
- ;; ACTION: replace 8 or more SPACEs by TABs, if
- ;; `indent-tabs-mode' is non-nil; otherwise, replace TABs
- ;; by SPACEs.
- ((memq 'space-after-tab whitespace-style)
- (whitespace-replace-action
- (if whitespace-indent-tabs-mode 'tabify 'untabify)
- rstart rend (whitespace-space-after-tab-regexp) 1))
- ;; ACTION: replace 8 or more SPACEs by TABs.
- ((memq 'space-after-tab::tab whitespace-style)
- (whitespace-replace-action
- 'tabify rstart rend
- (whitespace-space-after-tab-regexp 'tab) 1))
- ;; ACTION: replace TABs by SPACEs.
- ((memq 'space-after-tab::space whitespace-style)
- (whitespace-replace-action
- 'untabify rstart rend
- (whitespace-space-after-tab-regexp 'space) 1)))
- ;; PROBLEM 2: SPACEs before TAB
- (cond
- ;; ACTION: replace SPACEs before TAB by TABs, if
- ;; `indent-tabs-mode' is non-nil; otherwise, replace TABs
- ;; by SPACEs.
- ((memq 'space-before-tab whitespace-style)
- (whitespace-replace-action
- (if whitespace-indent-tabs-mode 'tabify 'untabify)
- rstart rend whitespace-space-before-tab-regexp
- (if whitespace-indent-tabs-mode 0 2)))
- ;; ACTION: replace SPACEs before TAB by TABs.
- ((memq 'space-before-tab::tab whitespace-style)
- (whitespace-replace-action
- 'tabify rstart rend
- whitespace-space-before-tab-regexp 0))
- ;; ACTION: replace TABs by SPACEs.
- ((memq 'space-before-tab::space whitespace-style)
- (whitespace-replace-action
- 'untabify rstart rend
- whitespace-space-before-tab-regexp 2)))))
- (set-marker rend nil)))) ; point marker to nowhere
-
-
-(defun whitespace-replace-action (action rstart rend regexp index)
- "Do ACTION in the string matched by REGEXP between RSTART and REND.
-
-INDEX is the level group matched by REGEXP and used by ACTION.
-
-See also `tab-width'."
- (goto-char rstart)
- (while (re-search-forward regexp rend t)
- (goto-char (match-end index))
- (funcall action (match-beginning index) (match-end index))))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;; User command - report
-
-
-(defun whitespace-regexp (regexp &optional kind)
- "Return REGEXP depending on `whitespace-indent-tabs-mode'."
- (cond
- ((or (eq kind 'tab)
- whitespace-indent-tabs-mode)
- (format (car regexp) whitespace-tab-width))
- ((or (eq kind 'space)
- (not whitespace-indent-tabs-mode))
- (cdr regexp))))
-
-
-(defun whitespace-indentation-regexp (&optional kind)
- "Return the indentation regexp depending on `whitespace-indent-tabs-mode'."
- (whitespace-regexp whitespace-indentation-regexp kind))
-
-
-(defun whitespace-space-after-tab-regexp (&optional kind)
- "Return the space-after-tab regexp depending on `whitespace-indent-tabs-mode'."
- (whitespace-regexp whitespace-space-after-tab-regexp kind))
-
-
-(defconst whitespace-report-list
- (list
- (cons 'empty whitespace-empty-at-bob-regexp)
- (cons 'empty whitespace-empty-at-eob-regexp)
- (cons 'trailing whitespace-trailing-regexp)
- (cons 'indentation nil)
- (cons 'indentation::tab nil)
- (cons 'indentation::space nil)
- (cons 'space-before-tab whitespace-space-before-tab-regexp)
- (cons 'space-before-tab::tab whitespace-space-before-tab-regexp)
- (cons 'space-before-tab::space whitespace-space-before-tab-regexp)
- (cons 'space-after-tab nil)
- (cons 'space-after-tab::tab nil)
- (cons 'space-after-tab::space nil)
- )
- "List of whitespace bogus symbol and corresponding regexp.")
-
-
-(defconst whitespace-report-text
- '( ;; `indent-tabs-mode' has non-nil value
- "\
- Whitespace Report
-
- Current Setting Whitespace Problem
-
- empty [] [] empty lines at beginning of buffer
- empty [] [] empty lines at end of buffer
- trailing [] [] SPACEs or TABs at end of line
- indentation [] [] 8 or more SPACEs at beginning of line
- indentation::tab [] [] 8 or more SPACEs at beginning of line
- indentation::space [] [] TABs at beginning of line
- space-before-tab [] [] SPACEs before TAB
- space-before-tab::tab [] [] SPACEs before TAB: SPACEs
- space-before-tab::space [] [] SPACEs before TAB: TABs
- space-after-tab [] [] 8 or more SPACEs after TAB
- space-after-tab::tab [] [] 8 or more SPACEs after TAB: SPACEs
- space-after-tab::space [] [] 8 or more SPACEs after TAB: TABs
-
- indent-tabs-mode =
- tab-width = \n\n"
- . ;; `indent-tabs-mode' has nil value
- "\
- Whitespace Report
-
- Current Setting Whitespace Problem
-
- empty [] [] empty lines at beginning of buffer
- empty [] [] empty lines at end of buffer
- trailing [] [] SPACEs or TABs at end of line
- indentation [] [] TABs at beginning of line
- indentation::tab [] [] 8 or more SPACEs at beginning of line
- indentation::space [] [] TABs at beginning of line
- space-before-tab [] [] SPACEs before TAB
- space-before-tab::tab [] [] SPACEs before TAB: SPACEs
- space-before-tab::space [] [] SPACEs before TAB: TABs
- space-after-tab [] [] 8 or more SPACEs after TAB
- space-after-tab::tab [] [] 8 or more SPACEs after TAB: SPACEs
- space-after-tab::space [] [] 8 or more SPACEs after TAB: TABs
-
- indent-tabs-mode =
- tab-width = \n\n")
- "Text for whitespace bogus report.
-
-It is a cons of strings, where the car part is used when
-`indent-tabs-mode' is non-nil, and the cdr part is used when
-`indent-tabs-mode' is nil.")
-
-
-(defconst whitespace-report-buffer-name "*Whitespace Report*"
- "The buffer name for whitespace bogus report.")
-
-
-;;;###autoload
-(defun whitespace-report (&optional force report-if-bogus)
- "Report some whitespace problems in buffer.
-
-Return nil if there is no whitespace problem; otherwise, return
-non-nil.
-
-If FORCE is non-nil or \\[universal-argument] was pressed just
-before calling `whitespace-report' interactively, it forces
-`whitespace-style' to have:
-
- empty
- trailing
- indentation
- space-before-tab
- space-after-tab
-
-If REPORT-IF-BOGUS is non-nil, it reports only when there are any
-whitespace problems in buffer.
-
-Report if some of the following whitespace problems exist:
-
-* If `indent-tabs-mode' is non-nil:
- empty 1. empty lines at beginning of buffer.
- empty 2. empty lines at end of buffer.
- trailing 3. SPACEs or TABs at end of line.
- indentation 4. 8 or more SPACEs at beginning of line.
- space-before-tab 5. SPACEs before TAB.
- space-after-tab 6. 8 or more SPACEs after TAB.
-
-* If `indent-tabs-mode' is nil:
- empty 1. empty lines at beginning of buffer.
- empty 2. empty lines at end of buffer.
- trailing 3. SPACEs or TABs at end of line.
- indentation 4. TABS at beginning of line.
- space-before-tab 5. SPACEs before TAB.
- space-after-tab 6. 8 or more SPACEs after TAB.
-
-See `whitespace-style' for documentation.
-See also `whitespace-cleanup' and `whitespace-cleanup-region' for
-cleaning up these problems."
- (interactive (list current-prefix-arg))
- (whitespace-report-region (point-min) (point-max)
- force report-if-bogus))
-
-
-;;;###autoload
-(defun whitespace-report-region (start end &optional force report-if-bogus)
- "Report some whitespace problems in a region.
-
-Return nil if there is no whitespace problem; otherwise, return
-non-nil.
-
-If FORCE is non-nil or \\[universal-argument] was pressed just
-before calling `whitespace-report-region' interactively, it
-forces `whitespace-style' to have:
-
- empty
- indentation
- space-before-tab
- trailing
- space-after-tab
-
-If REPORT-IF-BOGUS is non-nil, it reports only when there are any
-whitespace problems in buffer.
-
-Report if some of the following whitespace problems exist:
-
-* If `indent-tabs-mode' is non-nil:
- empty 1. empty lines at beginning of buffer.
- empty 2. empty lines at end of buffer.
- trailing 3. SPACEs or TABs at end of line.
- indentation 4. 8 or more SPACEs at beginning of line.
- space-before-tab 5. SPACEs before TAB.
- space-after-tab 6. 8 or more SPACEs after TAB.
-
-* If `indent-tabs-mode' is nil:
- empty 1. empty lines at beginning of buffer.
- empty 2. empty lines at end of buffer.
- trailing 3. SPACEs or TABs at end of line.
- indentation 4. TABS at beginning of line.
- space-before-tab 5. SPACEs before TAB.
- space-after-tab 6. 8 or more SPACEs after TAB.
-
-See `whitespace-style' for documentation.
-See also `whitespace-cleanup' and `whitespace-cleanup-region' for
-cleaning up these problems."
- (interactive "r")
- (setq force (or current-prefix-arg force))
- (save-excursion
- (save-match-data
- (let* ((has-bogus nil)
- (rstart (min start end))
- (rend (max start end))
- (bogus-list
- (mapcar
- #'(lambda (option)
- (when force
- (add-to-list 'whitespace-style (car option)))
- (goto-char rstart)
- (let ((regexp
- (cond
- ((eq (car option) 'indentation)
- (whitespace-indentation-regexp))
- ((eq (car option) 'indentation::tab)
- (whitespace-indentation-regexp 'tab))
- ((eq (car option) 'indentation::space)
- (whitespace-indentation-regexp 'space))
- ((eq (car option) 'space-after-tab)
- (whitespace-space-after-tab-regexp))
- ((eq (car option) 'space-after-tab::tab)
- (whitespace-space-after-tab-regexp 'tab))
- ((eq (car option) 'space-after-tab::space)
- (whitespace-space-after-tab-regexp 'space))
- (t
- (cdr option)))))
- (and (re-search-forward regexp rend t)
- (setq has-bogus t))))
- whitespace-report-list)))
- (when (if report-if-bogus has-bogus t)
- (whitespace-kill-buffer whitespace-report-buffer-name)
- ;; `whitespace-indent-tabs-mode' is local to current buffer
- ;; `whitespace-tab-width' is local to current buffer
- (let ((ws-indent-tabs-mode whitespace-indent-tabs-mode)
- (ws-tab-width whitespace-tab-width))
- (with-current-buffer (get-buffer-create
- whitespace-report-buffer-name)
- (erase-buffer)
- (insert (if ws-indent-tabs-mode
- (car whitespace-report-text)
- (cdr whitespace-report-text)))
- (goto-char (point-min))
- (forward-line 3)
- (dolist (option whitespace-report-list)
- (forward-line 1)
- (whitespace-mark-x
- 27 (memq (car option) whitespace-style))
- (whitespace-mark-x 7 (car bogus-list))
- (setq bogus-list (cdr bogus-list)))
- (forward-line 1)
- (whitespace-insert-value ws-indent-tabs-mode)
- (whitespace-insert-value ws-tab-width)
- (when has-bogus
- (goto-char (point-max))
- (insert " Type `M-x whitespace-cleanup'"
- " to cleanup the buffer.\n\n"
- " Type `M-x whitespace-cleanup-region'"
- " to cleanup a region.\n\n"))
- (whitespace-display-window (current-buffer)))))
- has-bogus))))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;; Internal functions
-
-
-(defvar whitespace-font-lock-mode nil
- "Used to remember whether a buffer had font lock mode on or not.")
-
-(defvar whitespace-font-lock nil
- "Used to remember whether a buffer initially had font lock on or not.")
-
-(defvar whitespace-font-lock-keywords nil
- "Used to save locally `font-lock-keywords' value.")
-
-
-(defconst whitespace-help-text
- "\
- Whitespace Toggle Options | scroll up : SPC or > |
- | scroll down: M-SPC or < |
- FACES \\__________________________/
- [] f - toggle face visualization
- [] t - toggle TAB visualization
- [] s - toggle SPACE and HARD SPACE visualization
- [] r - toggle trailing blanks visualization
- [] l - toggle \"long lines\" visualization
- [] L - toggle \"long lines\" tail visualization
- [] n - toggle NEWLINE visualization
- [] e - toggle empty line at bob and/or eob visualization
- [] C-i - toggle indentation SPACEs visualization (via `indent-tabs-mode')
- [] I - toggle indentation SPACEs visualization
- [] i - toggle indentation TABs visualization
- [] C-a - toggle SPACEs after TAB visualization (via `indent-tabs-mode')
- [] A - toggle SPACEs after TAB: SPACEs visualization
- [] a - toggle SPACEs after TAB: TABs visualization
- [] C-b - toggle SPACEs before TAB visualization (via `indent-tabs-mode')
- [] B - toggle SPACEs before TAB: SPACEs visualization
- [] b - toggle SPACEs before TAB: TABs visualization
-
- DISPLAY TABLE
- [] T - toggle TAB visualization
- [] S - toggle SPACE and HARD SPACE visualization
- [] N - toggle NEWLINE visualization
-
- x - restore `whitespace-style' value
-
- ? - display this text\n\n"
- "Text for whitespace toggle options.")
-
-
-(defconst whitespace-help-buffer-name "*Whitespace Toggle Options*"
- "The buffer name for whitespace toggle options.")
-
-
-(defun whitespace-insert-value (value)
- "Insert VALUE at column 20 of next line."
- (forward-line 1)
- (move-to-column 20 t)
- (insert (format "%s" value)))
-
-
-(defun whitespace-mark-x (nchars condition)
- "Insert the mark ('X' or ' ') after NCHARS depending on CONDITION."
- (forward-char nchars)
- (insert (if condition "X" " ")))
-
-
-(defun whitespace-insert-option-mark (the-list the-value)
- "Insert the option mark ('X' or ' ') in toggle options buffer."
- (goto-char (point-min))
- (forward-line 2)
- (dolist (sym the-list)
- (if (eq sym 'help-newline)
- (forward-line 2)
- (forward-line 1)
- (whitespace-mark-x 2 (memq sym the-value)))))
-
-
-(defun whitespace-help-on (style)
- "Display the whitespace toggle options."
- (unless (get-buffer whitespace-help-buffer-name)
- (delete-other-windows)
- (let ((buffer (get-buffer-create whitespace-help-buffer-name)))
- (with-current-buffer buffer
- (erase-buffer)
- (insert whitespace-help-text)
- (whitespace-insert-option-mark
- whitespace-style-value-list style)
- (whitespace-display-window buffer)))))
-
-
-(defun whitespace-display-window (buffer)
- "Display BUFFER in a new window."
- (goto-char (point-min))
- (set-buffer-modified-p nil)
- (when (< (window-height) (* 2 window-min-height))
- (kill-buffer buffer)
- (error "Window height is too small; \
-can't split window to display whitespace toggle options"))
- (let ((win (split-window)))
- (set-window-buffer win buffer)
- (shrink-window-if-larger-than-buffer win)))
-
-
-(defun whitespace-kill-buffer (buffer-name)
- "Kill buffer BUFFER-NAME and windows related with it."
- (let ((buffer (get-buffer buffer-name)))
- (when buffer
- (delete-windows-on buffer)
- (kill-buffer buffer))))
-
-
-(defun whitespace-help-off ()
- "Remove the buffer and window of the whitespace toggle options."
- (whitespace-kill-buffer whitespace-help-buffer-name))
-
-
-(defun whitespace-help-scroll (&optional up)
- "Scroll help window, if it exists.
-
-If UP is non-nil, scroll up; otherwise, scroll down."
- (condition-case data-help
- (let ((buffer (get-buffer whitespace-help-buffer-name)))
- (if buffer
- (with-selected-window (get-buffer-window buffer)
- (if up
- (scroll-up 3)
- (scroll-down 3)))
- (ding)))
- ;; handler
- ((error)
- ;; just ignore error
- )))
-
-
-(defun whitespace-interactive-char (local-p)
- "Interactive function to read a char and return a symbol.
-
-If LOCAL-P is non-nil, it uses a local context; otherwise, it
-uses a global context.
-
-It accepts one of the following chars:
-
- CHAR MEANING
- (VIA FACES)
- f toggle face visualization
- t toggle TAB visualization
- s toggle SPACE and HARD SPACE visualization
- r toggle trailing blanks visualization
- l toggle \"long lines\" visualization
- L toggle \"long lines\" tail visualization
- n toggle NEWLINE visualization
- e toggle empty line at bob and/or eob visualization
- C-i toggle indentation SPACEs visualization (via `indent-tabs-mode')
- I toggle indentation SPACEs visualization
- i toggle indentation TABs visualization
- C-a toggle SPACEs after TAB visualization (via `indent-tabs-mode')
- A toggle SPACEs after TAB: SPACEs visualization
- a toggle SPACEs after TAB: TABs visualization
- C-b toggle SPACEs before TAB visualization (via `indent-tabs-mode')
- B toggle SPACEs before TAB: SPACEs visualization
- b toggle SPACEs before TAB: TABs visualization
-
- (VIA DISPLAY TABLE)
- T toggle TAB visualization
- S toggle SPACE and HARD SPACE visualization
- N toggle NEWLINE visualization
-
- x restore `whitespace-style' value
- ? display brief help
-
-See also `whitespace-toggle-option-alist'."
- (let* ((is-off (not (if local-p
- whitespace-mode
- global-whitespace-mode)))
- (style (cond (is-off whitespace-style) ; use default value
- (local-p whitespace-active-style)
- (t whitespace-toggle-style)))
- (prompt
- (format "Whitespace Toggle %s (type ? for further options)-"
- (if local-p "Local" "Global")))
- ch sym)
- ;; read a valid option and get the corresponding symbol
- (save-window-excursion
- (condition-case data
- (progn
- (while
- ;; while condition
- (progn
- (setq ch (read-char prompt))
- (not
- (setq sym
- (cdr
- (assq ch whitespace-toggle-option-alist)))))
- ;; while body
- (cond
- ((eq ch ?\?) (whitespace-help-on style))
- ((eq ch ?\ ) (whitespace-help-scroll t))
- ((eq ch ?\M- ) (whitespace-help-scroll))
- ((eq ch ?>) (whitespace-help-scroll t))
- ((eq ch ?<) (whitespace-help-scroll))
- (t (ding))))
- (whitespace-help-off)
- (message " ")) ; clean echo area
- ;; handler
- ((quit error)
- (whitespace-help-off)
- (error (error-message-string data)))))
- (list sym))) ; return the appropriate symbol
-
-
-(defun whitespace-toggle-list (local-p arg the-list)
- "Toggle options in THE-LIST based on list ARG.
-
-If LOCAL-P is non-nil, it uses a local context; otherwise, it
-uses a global context.
-
-ARG is a list of options to be toggled.
-
-THE-LIST is a list of options. This list will be toggled and the
-resultant list will be returned."
- (unless (if local-p whitespace-mode global-whitespace-mode)
- (setq the-list whitespace-style))
- (setq the-list (copy-sequence the-list)) ; keep original list
- (dolist (sym (if (listp arg) arg (list arg)))
- (cond
- ;; ignore help value
- ((eq sym 'help-newline))
- ;; restore default values
- ((eq sym 'whitespace-style)
- (setq the-list whitespace-style))
- ;; toggle valid values
- ((memq sym whitespace-style-value-list)
- (setq the-list (if (memq sym the-list)
- (delq sym the-list)
- (cons sym the-list))))))
- the-list)
-
-
-(defvar whitespace-display-table nil
- "Used to save a local display table.")
-
-(defvar whitespace-display-table-was-local nil
- "Used to remember whether a buffer initially had a local display table.")
-
-
-(defun whitespace-turn-on ()
- "Turn on whitespace visualization."
- ;; prepare local hooks
- (add-hook 'write-file-functions 'whitespace-write-file-hook nil t)
- ;; create whitespace local buffer environment
- (set (make-local-variable 'whitespace-font-lock-mode) nil)
- (set (make-local-variable 'whitespace-font-lock) nil)
- (set (make-local-variable 'whitespace-font-lock-keywords) nil)
- (set (make-local-variable 'whitespace-display-table) nil)
- (set (make-local-variable 'whitespace-display-table-was-local) nil)
- (set (make-local-variable 'whitespace-active-style)
- (if (listp whitespace-style)
- whitespace-style
- (list whitespace-style)))
- (set (make-local-variable 'whitespace-indent-tabs-mode)
- indent-tabs-mode)
- (set (make-local-variable 'whitespace-tab-width)
- tab-width)
- ;; turn on whitespace
- (when whitespace-active-style
- (whitespace-color-on)
- (whitespace-display-char-on)))
-
-
-(defun whitespace-turn-off ()
- "Turn off whitespace visualization."
- (remove-hook 'write-file-functions 'whitespace-write-file-hook t)
- (when whitespace-active-style
- (whitespace-color-off)
- (whitespace-display-char-off)))
-
-
-(defun whitespace-style-face-p ()
- "Return t if there is some visualization via face."
- (and (memq 'face whitespace-active-style)
- (or (memq 'tabs whitespace-active-style)
- (memq 'spaces whitespace-active-style)
- (memq 'trailing whitespace-active-style)
- (memq 'lines whitespace-active-style)
- (memq 'lines-tail whitespace-active-style)
- (memq 'newline whitespace-active-style)
- (memq 'empty whitespace-active-style)
- (memq 'indentation whitespace-active-style)
- (memq 'indentation::tab whitespace-active-style)
- (memq 'indentation::space whitespace-active-style)
- (memq 'space-after-tab whitespace-active-style)
- (memq 'space-after-tab::tab whitespace-active-style)
- (memq 'space-after-tab::space whitespace-active-style)
- (memq 'space-before-tab whitespace-active-style)
- (memq 'space-before-tab::tab whitespace-active-style)
- (memq 'space-before-tab::space whitespace-active-style))))
-
-
-(defun whitespace-color-on ()
- "Turn on color visualization."
- (when (whitespace-style-face-p)
- (unless whitespace-font-lock
- (setq whitespace-font-lock t
- whitespace-font-lock-keywords
- (copy-sequence font-lock-keywords)))
- ;; save current point and refontify when necessary
- (set (make-local-variable 'whitespace-point)
- (point))
- (set (make-local-variable 'whitespace-font-lock-refontify)
- 0)
- (set (make-local-variable 'whitespace-bob-marker)
- (point-min-marker))
- (set (make-local-variable 'whitespace-eob-marker)
- (point-max-marker))
- (set (make-local-variable 'whitespace-buffer-changed)
- nil)
- (add-hook 'post-command-hook #'whitespace-post-command-hook nil t)
- (add-hook 'before-change-functions #'whitespace-buffer-changed nil t)
- ;; turn off font lock
- (set (make-local-variable 'whitespace-font-lock-mode)
- font-lock-mode)
- (font-lock-mode 0)
- ;; add whitespace-mode color into font lock
- (when (memq 'spaces whitespace-active-style)
- (font-lock-add-keywords
- nil
- (list
- ;; Show SPACEs
- (list whitespace-space-regexp 1 whitespace-space t)
- ;; Show HARD SPACEs
- (list whitespace-hspace-regexp 1 whitespace-hspace t))
- t))
- (when (memq 'tabs whitespace-active-style)
- (font-lock-add-keywords
- nil
- (list
- ;; Show TABs
- (list whitespace-tab-regexp 1 whitespace-tab t))
- t))
- (when (memq 'trailing whitespace-active-style)
- (font-lock-add-keywords
- nil
- (list
- ;; Show trailing blanks
- (list #'whitespace-trailing-regexp 1 whitespace-trailing t))
- t))
- (when (or (memq 'lines whitespace-active-style)
- (memq 'lines-tail whitespace-active-style))
- (font-lock-add-keywords
- nil
- (list
- ;; Show "long" lines
- (list
- (let ((line-column (or whitespace-line-column fill-column)))
- (format
- "^\\([^\t\n]\\{%s\\}\\|[^\t\n]\\{0,%s\\}\t\\)\\{%d\\}%s\\(.+\\)$"
- whitespace-tab-width
- (1- whitespace-tab-width)
- (/ line-column whitespace-tab-width)
- (let ((rem (% line-column whitespace-tab-width)))
- (if (zerop rem)
- ""
- (format ".\\{%d\\}" rem)))))
- (if (memq 'lines whitespace-active-style)
- 0 ; whole line
- 2) ; line tail
- whitespace-line t))
- t))
- (cond
- ((memq 'space-before-tab whitespace-active-style)
- (font-lock-add-keywords
- nil
- (list
- ;; Show SPACEs before TAB (indent-tabs-mode)
- (list whitespace-space-before-tab-regexp
- (if whitespace-indent-tabs-mode 1 2)
- whitespace-space-before-tab t))
- t))
- ((memq 'space-before-tab::tab whitespace-active-style)
- (font-lock-add-keywords
- nil
- (list
- ;; Show SPACEs before TAB (SPACEs)
- (list whitespace-space-before-tab-regexp
- 1 whitespace-space-before-tab t))
- t))
- ((memq 'space-before-tab::space whitespace-active-style)
- (font-lock-add-keywords
- nil
- (list
- ;; Show SPACEs before TAB (TABs)
- (list whitespace-space-before-tab-regexp
- 2 whitespace-space-before-tab t))
- t)))
- (cond
- ((memq 'indentation whitespace-active-style)
- (font-lock-add-keywords
- nil
- (list
- ;; Show indentation SPACEs (indent-tabs-mode)
- (list (whitespace-indentation-regexp)
- 1 whitespace-indentation t))
- t))
- ((memq 'indentation::tab whitespace-active-style)
- (font-lock-add-keywords
- nil
- (list
- ;; Show indentation SPACEs (SPACEs)
- (list (whitespace-indentation-regexp 'tab)
- 1 whitespace-indentation t))
- t))
- ((memq 'indentation::space whitespace-active-style)
- (font-lock-add-keywords
- nil
- (list
- ;; Show indentation SPACEs (TABs)
- (list (whitespace-indentation-regexp 'space)
- 1 whitespace-indentation t))
- t)))
- (when (memq 'empty whitespace-active-style)
- (font-lock-add-keywords
- nil
- (list
- ;; Show empty lines at beginning of buffer
- (list #'whitespace-empty-at-bob-regexp
- 1 whitespace-empty t))
- t)
- (font-lock-add-keywords
- nil
- (list
- ;; Show empty lines at end of buffer
- (list #'whitespace-empty-at-eob-regexp
- 1 whitespace-empty t))
- t))
- (cond
- ((memq 'space-after-tab whitespace-active-style)
- (font-lock-add-keywords
- nil
- (list
- ;; Show SPACEs after TAB (indent-tabs-mode)
- (list (whitespace-space-after-tab-regexp)
- 1 whitespace-space-after-tab t))
- t))
- ((memq 'space-after-tab::tab whitespace-active-style)
- (font-lock-add-keywords
- nil
- (list
- ;; Show SPACEs after TAB (SPACEs)
- (list (whitespace-space-after-tab-regexp 'tab)
- 1 whitespace-space-after-tab t))
- t))
- ((memq 'space-after-tab::space whitespace-active-style)
- (font-lock-add-keywords
- nil
- (list
- ;; Show SPACEs after TAB (TABs)
- (list (whitespace-space-after-tab-regexp 'space)
- 1 whitespace-space-after-tab t))
- t)))
- ;; now turn on font lock and highlight blanks
- (font-lock-mode 1)))
-
-
-(defun whitespace-color-off ()
- "Turn off color visualization."
- ;; turn off font lock
- (when (whitespace-style-face-p)
- (font-lock-mode 0)
- (remove-hook 'post-command-hook #'whitespace-post-command-hook t)
- (remove-hook 'before-change-functions #'whitespace-buffer-changed t)
- (when whitespace-font-lock
- (setq whitespace-font-lock nil
- font-lock-keywords whitespace-font-lock-keywords))
- ;; restore original font lock state
- (font-lock-mode whitespace-font-lock-mode)))
-
-
-(defun whitespace-trailing-regexp (limit)
- "Match trailing spaces which do not contain the point at end of line."
- (let ((status t))
- (while (if (re-search-forward whitespace-trailing-regexp limit t)
- (save-match-data
- (= whitespace-point (match-end 1))) ;; loop if point at eol
- (setq status nil))) ;; end of buffer
- status))
-
-
-(defun whitespace-empty-at-bob-regexp (limit)
- "Match spaces at beginning of buffer which do not contain the point at \
-beginning of buffer."
- (let ((b (point))
- r)
- (cond
- ;; at bob
- ((= b 1)
- (setq r (and (/= whitespace-point 1)
- (looking-at whitespace-empty-at-bob-regexp)))
- (if r
- (set-marker whitespace-bob-marker (match-end 1))
- (set-marker whitespace-bob-marker b)))
- ;; inside bob empty region
- ((<= limit whitespace-bob-marker)
- (setq r (looking-at whitespace-empty-at-bob-regexp))
- (if r
- (when (< (match-end 1) limit)
- (set-marker whitespace-bob-marker (match-end 1)))
- (set-marker whitespace-bob-marker b)))
- ;; intersection with end of bob empty region
- ((<= b whitespace-bob-marker)
- (setq r (looking-at whitespace-empty-at-bob-regexp))
- (if r
- (set-marker whitespace-bob-marker (match-end 1))
- (set-marker whitespace-bob-marker b)))
- ;; it is not inside bob empty region
- (t
- (setq r nil)))
- ;; move to end of matching
- (and r (goto-char (match-end 1)))
- r))
-
-
-(defsubst whitespace-looking-back (regexp limit)
- (save-excursion
- (when (/= 0 (skip-chars-backward " \t\n" limit))
- (unless (bolp)
- (forward-line 1))
- (looking-at regexp))))
-
-
-(defun whitespace-empty-at-eob-regexp (limit)
- "Match spaces at end of buffer which do not contain the point at end of \
-buffer."
- (let ((b (point))
- (e (1+ (buffer-size)))
- r)
- (cond
- ;; at eob
- ((= limit e)
- (when (/= whitespace-point e)
- (goto-char limit)
- (setq r (whitespace-looking-back whitespace-empty-at-eob-regexp b)))
- (if r
- (set-marker whitespace-eob-marker (match-beginning 1))
- (set-marker whitespace-eob-marker limit)
- (goto-char b))) ; return back to initial position
- ;; inside eob empty region
- ((>= b whitespace-eob-marker)
- (goto-char limit)
- (setq r (whitespace-looking-back whitespace-empty-at-eob-regexp b))
- (if r
- (when (> (match-beginning 1) b)
- (set-marker whitespace-eob-marker (match-beginning 1)))
- (set-marker whitespace-eob-marker limit)
- (goto-char b))) ; return back to initial position
- ;; intersection with beginning of eob empty region
- ((>= limit whitespace-eob-marker)
- (goto-char limit)
- (setq r (whitespace-looking-back whitespace-empty-at-eob-regexp b))
- (if r
- (set-marker whitespace-eob-marker (match-beginning 1))
- (set-marker whitespace-eob-marker limit)
- (goto-char b))) ; return back to initial position
- ;; it is not inside eob empty region
- (t
- (setq r nil)))
- r))
-
-
-(defun whitespace-buffer-changed (beg end)
- "Set `whitespace-buffer-changed' variable to t."
- (setq whitespace-buffer-changed t))
-
-
-(defun whitespace-post-command-hook ()
- "Save current point into `whitespace-point' variable.
-Also refontify when necessary."
- (setq whitespace-point (point)) ; current point position
- (let ((refontify
- (or
- ;; it is at end of line ...
- (and (eolp)
- ;; ... with trailing SPACE or TAB
- (or (= (preceding-char) ?\ )
- (= (preceding-char) ?\t)))
- ;; it is at beginning of buffer (bob)
- (= whitespace-point 1)
- ;; the buffer was modified and ...
- (and whitespace-buffer-changed
- (or
- ;; ... or inside bob whitespace region
- (<= whitespace-point whitespace-bob-marker)
- ;; ... or at bob whitespace region border
- (and (= whitespace-point (1+ whitespace-bob-marker))
- (= (preceding-char) ?\n))))
- ;; it is at end of buffer (eob)
- (= whitespace-point (1+ (buffer-size)))
- ;; the buffer was modified and ...
- (and whitespace-buffer-changed
- (or
- ;; ... or inside eob whitespace region
- (>= whitespace-point whitespace-eob-marker)
- ;; ... or at eob whitespace region border
- (and (= whitespace-point (1- whitespace-eob-marker))
- (= (following-char) ?\n)))))))
- (when (or refontify (> whitespace-font-lock-refontify 0))
- (setq whitespace-buffer-changed nil)
- ;; adjust refontify counter
- (setq whitespace-font-lock-refontify
- (if refontify
- 1
- (1- whitespace-font-lock-refontify)))
- ;; refontify
- (jit-lock-refontify))))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;; Hacked from visws.el (Miles Bader <miles@gnu.org>)
-
-
-(defun whitespace-style-mark-p ()
- "Return t if there is some visualization via display table."
- (or (memq 'tab-mark whitespace-active-style)
- (memq 'space-mark whitespace-active-style)
- (memq 'newline-mark whitespace-active-style)))
-
-
-(defalias 'whitespace-characterp
- (if (fboundp 'characterp)
- 'characterp
- 'char-valid-p))
-
-
-(defsubst whitespace-char-valid-p (char)
- ;; This check should be improved!!!
- (or (< char 256)
- (whitespace-characterp char)))
-
-
-(defun whitespace-display-vector-p (vec)
- "Return true if every character in vector VEC can be displayed."
- (let ((i (length vec)))
- (when (> i 0)
- (while (and (>= (setq i (1- i)) 0)
- (whitespace-char-valid-p (aref vec i))))
- (< i 0))))
-
-
-(defun whitespace-display-char-on ()
- "Turn on character display mapping."
- (when (and whitespace-display-mappings
- (whitespace-style-mark-p))
- (let (vecs vec)
- ;; Remember whether a buffer has a local display table.
- (unless whitespace-display-table-was-local
- (setq whitespace-display-table-was-local t
- whitespace-display-table
- (copy-sequence buffer-display-table))
- ;; asure `buffer-display-table' is unique
- ;; when two or more windows are visible.
- (setq buffer-display-table
- (copy-sequence buffer-display-table)))
- (unless buffer-display-table
- (setq buffer-display-table (make-display-table)))
- (dolist (entry whitespace-display-mappings)
- ;; check if it is to display this mark
- (when (memq (car entry) whitespace-style)
- ;; Get a displayable mapping.
- (setq vecs (cddr entry))
- (while (and vecs
- (not (whitespace-display-vector-p (car vecs))))
- (setq vecs (cdr vecs)))
- ;; Display a valid mapping.
- (when vecs
- (setq vec (copy-sequence (car vecs)))
- ;; NEWLINE char
- (when (and (eq (cadr entry) ?\n)
- (memq 'newline whitespace-active-style))
- ;; Only insert face bits on NEWLINE char mapping to avoid
- ;; obstruction of other faces like TABs and (HARD) SPACEs
- ;; faces, font-lock faces, etc.
- (dotimes (i (length vec))
- ;; Only for Emacs 21 and 22:
- ;; Due to limitations of glyph representation, the char
- ;; code can not be above ?\x1FFFF. This is already
- ;; fixed in Emacs 23.
- (or (eq (aref vec i) ?\n)
- (and (< emacs-major-version 23)
- (> (aref vec i) #x1FFFF))
- (aset vec i
- (make-glyph-code (aref vec i)
- whitespace-newline)))))
- ;; Display mapping
- (aset buffer-display-table (cadr entry) vec)))))))
-
-
-(defun whitespace-display-char-off ()
- "Turn off character display mapping."
- (and whitespace-display-mappings
- (whitespace-style-mark-p)
- whitespace-display-table-was-local
- (setq whitespace-display-table-was-local nil
- buffer-display-table whitespace-display-table)))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;; Hook
-
-
-(defun whitespace-action-when-on ()
- "Action to be taken always when local whitespace is turned on."
- (cond ((memq 'cleanup whitespace-action)
- (whitespace-cleanup))
- ((memq 'report-on-bogus whitespace-action)
- (whitespace-report nil t))))
-
-
-(defun whitespace-write-file-hook ()
- "Action to be taken when buffer is written.
-It should be added buffer-locally to `write-file-functions'."
- (cond ((memq 'auto-cleanup whitespace-action)
- (whitespace-cleanup))
- ((memq 'abort-on-bogus whitespace-action)
- (when (whitespace-report nil t)
- (error "Abort write due to whitespace problems in %s"
- (buffer-name)))))
- nil) ; continue hook processing
-
-
-(defun whitespace-warn-read-only (msg)
- "Warn if buffer is read-only."
- (when (memq 'warn-if-read-only whitespace-action)
- (message "Can't %s: %s is read-only" msg (buffer-name))))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-
-(defun whitespace-unload-function ()
- "Unload the whitespace library."
- (global-whitespace-mode -1)
- ;; be sure all local whitespace mode is turned off
- (save-current-buffer
- (dolist (buf (buffer-list))
- (set-buffer buf)
- (whitespace-mode -1)))
- nil) ; continue standard unloading
-
-
-(provide 'whitespace)
-
-
-(run-hooks 'whitespace-load-hook)
-
-
-;; arch-tag: 1b1e2500-dbd4-4a26-8f7a-5a5edfd3c97e
-;;; whitespace.el ends here
diff --git a/.profile b/.profile
index 07fa59a..19f7225 100644
--- a/.profile
+++ b/.profile
@@ -17,7 +17,7 @@ fi
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
- . "$HOME/.bashrc"
+ . "$HOME/.bashrc"
fi
fi
diff --git a/.selected_editor b/.selected_editor
index 1bb91d9..81a95de 100644
--- a/.selected_editor
+++ b/.selected_editor
@@ -1,3 +1,4 @@
# Generated by /usr/bin/select-editor
SELECTED_EDITOR="emacsclient -a ''"
-ALTERNATE_EDITOR="$SELECTED_EDITOR -c" \ No newline at end of file
+ALTERNATE_EDITOR="$SELECTED_EDITOR -c"
+VISUAL="$SELECTED_EDITOR -c"
diff --git a/bin/v-editor b/bin/v-editor
index 86d1f50..5001b8a 100755
--- a/bin/v-editor
+++ b/bin/v-editor
@@ -4,4 +4,4 @@
${VISUAL:-$SELECTED_EDITOR} $@
else
${EDITOR:-$SELECTED_EDITOR} $@
-fi) || ${ALTERNATE_EDITOR:-false} $@ \ No newline at end of file
+fi) || ${ALTERNATE_EDITOR:-false} $@